/* ── Vimond Brand Design System ───────────────────────────────────────────── */
/* Primary blue  : #49B9FF                                                     */
/* Dark navy     : #0A1628                                                     */
/* Medium blue   : #364A7A  •  Steel: #7889B3  •  Light: #A8DDFF #E4F4FF     */
/* Accent pink   : #F3185A  •  Mid: #F687AD  •  Pale: #FFE6EE                */
/* Accent purple : #727EBF  •  Light: #A4AEE7  •  Pale: #D5DBFF              */
/* Neutrals      : #333333  •  Border: #E4E3E0  •  Bg: #F5F8FC               */

/* ── Base ─────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: #F0F4FA;
  color: #333333;
  min-height: 100vh;
}

/* ── Header / chrome ──────────────────────────────────────────────────────── */

header {
  background: #0A1628 !important;
  border-bottom: none !important;
  box-shadow: 0 2px 12px rgba(10,22,40,0.4);
}

/* Brand logo */
header .brand-logo {
  height: 28px;
  width: auto;
  background: #ffffff;
  border-radius: 5px;
  padding: 2px 3px;
}

/* Brand name */
header .brand-name {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #49B9FF !important;
  font-size: 1.1rem;
}

/* ── Tab navigation ───────────────────────────────────────────────────────── */

.tab-btn {
  color: rgba(168, 221, 255, 0.7);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 6px;
}
.tab-btn:hover {
  background: rgba(73, 185, 255, 0.12) !important;
  color: #A8DDFF !important;
}
.tab-btn.active {
  background: rgba(73, 185, 255, 0.2) !important;
  color: #49B9FF !important;
  font-weight: 600;
}

/* ── Main content area ────────────────────────────────────────────────────── */

main {
  padding-top: 1.5rem;
}


/* Cards / panels */
.card {
  background: #ffffff;
  border: 1px solid #E4E3E0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(10,22,40,0.06);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

/* Primary */
button.btn-primary,
button[class*="bg-blue-600"] {
  background: #49B9FF !important;
  color: #0A1628 !important;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s, box-shadow 0.15s;
}
button.btn-primary:hover,
button[class*="bg-blue-600"]:hover,
button[class*="hover:bg-blue-700"]:hover {
  background: #2eaaff !important;
  box-shadow: 0 2px 8px rgba(73,185,255,0.4);
}

/* Danger */
button[class*="text-red"] {
  color: #F3185A !important;
}
button[class*="hover:text-red"]:hover {
  color: #c4104a !important;
}
button[class*="hover:bg-red"]:hover {
  background: #FFE6EE !important;
}

/* Small text links / inline actions */
button[class*="text-blue-500"],
a[class*="text-blue-500"] {
  color: #49B9FF !important;
}
button[class*="hover:text-blue-700"]:hover {
  color: #0A1628 !important;
}

/* ── Inline editing ───────────────────────────────────────────────────────── */

/* Fixed-layout tables: cells must never push past their column width */
#view-timesheet table td {
  overflow: hidden;
  max-width: 0;   /* combined with overflow:hidden this enforces the col width */
}

.cell-editable { cursor: pointer; }
.cell-editable:hover { background: #E4F4FF; }
.cell-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #49B9FF;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.875rem;
  font-family: 'Roboto', sans-serif;
  outline: none;
  background: #fff;
  color: #333333;
  box-shadow: 0 0 0 3px rgba(73,185,255,0.15);
  min-width: 0; /* prevents flex/table blowout */
}

/* ── Custom portal dropdown ───────────────────────────────────────────────── */

.tl-dropdown {
  background: #ffffff;
  border: 1.5px solid #49B9FF;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.18);
  overflow-y: auto;
  max-height: 240px;
  padding: 4px 0;
  font-family: 'Roboto', sans-serif;
  font-size: 0.875rem;
}

.tl-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #333333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.08s;
}
.tl-dropdown-item:hover,
.tl-dropdown-item.is-focused {
  background: #E4F4FF;
  color: #0A1628;
}
.tl-dropdown-item.is-selected {
  background: #EBF5FF;
  color: #364A7A;
  font-weight: 500;
}
.tl-dropdown-item.is-selected.is-focused {
  background: #D5EBFF;
}
.tl-dropdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

/* ── Category color swatch ────────────────────────────────────────────────── */

.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid rgba(0,0,0,0.08);
  vertical-align: middle;
}

/* ── Table chrome ─────────────────────────────────────────────────────────── */

thead tr {
  border-bottom: 1.5px solid #E4E3E0;
}
thead th {
  color: #7889B3 !important;
  font-weight: 600;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: #F5F8FC !important;
}

/* ── Undo toast ───────────────────────────────────────────────────────────── */

.undo-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0A1628;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 4px 24px rgba(10,22,40,0.45);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
}
.undo-toast.undo-toast-show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.undo-toast-msg { flex: 1; white-space: nowrap; }
.undo-toast-undo {
  background: #49B9FF;
  color: #0A1628;
  border: none;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
  transition: background 0.12s;
}
.undo-toast-undo:hover { background: #2eaaff; }
.undo-toast-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.12s;
}
.undo-toast-dismiss:hover { color: #fff; }

/* Time ordering error (start ≥ end) */
.time-order-error {
  color: #F3185A !important;
  font-weight: 600;
}

/* Overlapping entry rows */
tr.entry-overlap td {
  background: #fffbeb !important;
}

/* Day header rows in week view */
.day-header-row {
  background: #EBF5FF !important;
  font-weight: 600;
  color: #364A7A !important;
}

/* ── Calendar grid ────────────────────────────────────────────────────────── */

.cal-cell {
  border: 1px solid #E4E3E0;
  min-height: 90px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.15s;
  background: #fff;
  overflow: hidden;
}
.cal-cell:hover {
  background: #EBF5FF;
  border-color: #A8DDFF;
}
.cal-cell.today {
  border-color: #49B9FF;
  background: #F0F9FF;
}
.cal-cell.today .day-num {
  background: #49B9FF;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.cal-cell.other-month {
  background: #F9FAFB;
  border-color: #F0F0EE;
  opacity: 0.5;
}

/* Holiday row in week/day views */
.day-header-row.is-holiday td {
  background: #FFF0F4;
}

/* Holiday cell */
.cal-cell.holiday {
  background: #FFF0F4;
  border-color: #F687AD;
}
.cal-cell.holiday:hover {
  background: #FFE6EE;
  border-color: #F3185A;
}
.cal-cell.holiday .day-num,
.day-num { color: #364A7A; }
.cal-cell.holiday .holiday-day-num { color: #F3185A !important; }

.holiday-name {
  font-size: 0.6rem;
  color: #F3185A;
  font-weight: 600;
  line-height: 1.2;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Entry pills inside month cells */
.cal-entry-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(73,185,255,0.08);
  font-size: 0.6rem;
  color: #364A7A;
  line-height: 1.3;
  overflow: hidden;
}
.cal-entry-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-entry-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-entry-more {
  font-size: 0.58rem;
  color: #7889B3;
  padding: 1px 3px;
}
.cal-day-total {
  font-size: 0.65rem;
  color: #7889B3;
  text-align: right;
  margin-top: 2px;
  font-weight: 500;
}

/* Year view cells */
div[class*="cal-cell"][class*="rounded-lg"] {
  border: 1px solid #E4E3E0;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
div[class*="cal-cell"][class*="rounded-lg"]:hover {
  background: #EBF5FF;
  border-color: #49B9FF;
  box-shadow: 0 2px 8px rgba(73,185,255,0.2);
}
div[class*="cal-cell"][class*="rounded-lg"] .font-semibold {
  color: #364A7A !important;
}

/* ── Nav bar (timesheet navigation) ──────────────────────────────────────────*/

/* View toggle buttons (Day / Week / Month / Year) */
button[class*="view-toggle"],
nav[id="view-toggle"] button {
  color: #7889B3;
  border: 1px solid #E4E3E0;
  background: #fff;
  border-radius: 5px;
  font-size: 0.8rem;
  transition: all 0.15s;
}
button[class*="view-toggle"]:hover {
  border-color: #49B9FF;
  color: #49B9FF;
}
button[class*="view-toggle"].active,
button[class*="view-toggle"][class*="bg-blue"] {
  background: #49B9FF !important;
  color: #0A1628 !important;
  border-color: #49B9FF;
  font-weight: 600;
}

/* Period label */
#period-label {
  color: #364A7A;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Prev / Next / Today buttons */
button#nav-prev, button#nav-next {
  color: #364A7A;
  border: 1px solid #E4E3E0;
  background: #fff;
  border-radius: 5px;
  transition: all 0.15s;
  font-size: 0.85rem;
  padding: 4px 10px;
}
button#nav-prev:hover, button#nav-next:hover {
  border-color: #49B9FF;
  color: #49B9FF;
  background: #F0F9FF;
}
button.nav-today-btn {
  color: #ffffff;
  border: 1px solid #364A7A;
  background: #364A7A;
  border-radius: 5px;
  transition: all 0.15s;
  font-size: 0.85rem;
  padding: 4px 10px;
  font-weight: 600;
}
button.nav-today-btn:hover {
  background: #0A1628;
  border-color: #0A1628;
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.3);
}

/* ── Reports summary table ────────────────────────────────────────────────── */

#view-reports table td,
#view-reports table th {
  color: #333333;
}
#view-reports table tfoot td {
  background: #EBF5FF;
  color: #364A7A;
  font-weight: 700;
}

/* ── Settings cards ───────────────────────────────────────────────────────── */

#view-settings .bg-white {
  border: 1px solid #E4E3E0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(10,22,40,0.05);
}
#view-settings h2 {
  color: #364A7A;
  font-weight: 700;
}

/* ── Utility overrides ────────────────────────────────────────────────────── */

/* Tailwind bg-gray-50 → brand bg */
.bg-gray-50 { background: #F0F4FA !important; }

/* Blue text used for totals */
.text-blue-600 { color: #364A7A !important; }

/* Section headings */
h2.text-lg, h3.text-base { color: #364A7A !important; }

/* Error/validation text */
.text-red-500, .ring-red-400 { color: #F3185A !important; }
.border-red-400, .ring-red-400 { border-color: #F3185A !important; }

/* ── Flatpickr time picker — Vimond theme ─────────────────────────────────── */

.flatpickr-calendar {
  border: 1.5px solid #49B9FF !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.2) !important;
  font-family: 'Roboto', sans-serif !important;
  padding: 6px !important;
}
/* Hide the invisible triangle arrow Flatpickr adds */
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after { display: none !important; }

.flatpickr-time {
  border-top: none !important;
  height: 52px !important;
}
.flatpickr-time input {
  font-family: 'Roboto', sans-serif !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #0A1628 !important;
  border-radius: 6px !important;
}
.flatpickr-time input:focus,
.flatpickr-time input:hover,
.numInputWrapper:hover {
  background: #E4F4FF !important;
}
.flatpickr-time .flatpickr-time-separator {
  color: #364A7A;
  font-weight: 700;
}
.numInputWrapper span.arrowUp::after  { border-bottom-color: #49B9FF !important; }
.numInputWrapper span.arrowDown::after { border-top-color:    #49B9FF !important; }
.numInputWrapper span:hover { background: #E4F4FF !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

#view-timesheet table,
#view-reports table {
  min-width: 600px;
}
#view-timesheet,
#view-reports {
  overflow-x: auto;
}

/* ── Header dark-mode toggle button ──────────────────────────────────────── */

.dark-mode-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0.8;
  transition: opacity 0.15s, background 0.15s;
}
.dark-mode-btn:hover {
  opacity: 1;
  background: rgba(73, 185, 255, 0.12);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
/*
 * Palette:
 *   bg            #0D1520   very dark navy — page background
 *   surface       #122030   slightly lighter — cards, tables, inputs
 *   surface-alt   #162840   a step lighter — day headers, footer rows
 *   border        #1E3350   subtle border colour
 *   text          #D8E4F0   primary text (off-white with a blue tint)
 *   text-muted    #5C7BA8   muted / secondary text
 *   text-heading  #A8DDFF   headings / emphasis (brand light blue)
 *   row-hover     #192D44   table-row and cell hover
 *   accent        #49B9FF   unchanged — brand blue stays the same
 */

body.dark {
  background: #0D1520 !important;
  color: #D8E4F0;
}

/* ── Tailwind utility overrides ─────────────────────────────────────────── */

body.dark .bg-gray-50   { background: #0D1520 !important; }
body.dark .bg-white     { background: #122030 !important; }
body.dark .bg-gray-100  { background: #162840 !important; }

body.dark .text-gray-400 { color: #5C7BA8 !important; }
body.dark .text-gray-500 { color: #6B84B0 !important; }
body.dark .text-gray-600 { color: #8AA0C8 !important; }
body.dark .text-gray-700 { color: #A8DDFF !important; }
body.dark .text-gray-800 { color: #D8E4F0 !important; }
body.dark .text-blue-600 { color: #A8DDFF !important; }

body.dark .border-gray-100 { border-color: #1A2D44 !important; }
body.dark .border-gray-200 { border-color: #1E3350 !important; }
body.dark .border-gray-300 { border-color: #2A4060 !important; }

body.dark .hover\:bg-gray-50:hover,
body.dark .hover\:bg-gray-100:hover { background: #192D44 !important; }

/* ── Headings ────────────────────────────────────────────────────────────── */

body.dark h2.text-lg,
body.dark h3.text-base,
body.dark #view-settings h2,
body.dark #view-settings h3 { color: #A8DDFF !important; }

/* ── Tables ──────────────────────────────────────────────────────────────── */

body.dark thead tr          { border-bottom-color: #1E3350; }
body.dark thead th          { color: #5C7BA8 !important; }
body.dark tbody tr          { border-bottom-color: #1A2D44 !important; }
body.dark tbody tr:hover    { background: #192D44 !important; }
body.dark tbody td          { color: #D8E4F0 !important; }

/* ── Settings cards ──────────────────────────────────────────────────────── */

body.dark #view-settings .bg-white {
  background: #122030 !important;
  border-color: #1E3350 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
}

/* ── Inline editing ──────────────────────────────────────────────────────── */

body.dark .cell-editable:hover { background: #1A3050 !important; }
body.dark .cell-input {
  background: #0D1520 !important;
  color: #D8E4F0 !important;
  border-color: #49B9FF !important;
  box-shadow: 0 0 0 3px rgba(73,185,255,0.1) !important;
}

/* ── Custom portal dropdown ──────────────────────────────────────────────── */

body.dark .tl-dropdown {
  background: #122030 !important;
  border-color: #49B9FF !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}
body.dark .tl-dropdown-item              { color: #D8E4F0; }
body.dark .tl-dropdown-item:hover,
body.dark .tl-dropdown-item.is-focused   { background: #1A3050; color: #A8DDFF; }
body.dark .tl-dropdown-item.is-selected  { background: #1D3560; color: #A8DDFF; }
body.dark .tl-dropdown-item.is-selected.is-focused { background: #223F70; }

/* ── Nav buttons (Prev / Next / Today / view toggles) ────────────────────── */

body.dark button#nav-prev,
body.dark button#nav-next {
  background: #122030 !important;
  border-color: #1E3350 !important;
  color: #A8DDFF !important;
}
body.dark button#nav-prev:hover,
body.dark button#nav-next:hover {
  background: #1A3050 !important;
  border-color: #49B9FF !important;
  color: #49B9FF !important;
}
body.dark button.nav-today-btn {
  background: #364A7A !important;
  border-color: #364A7A !important;
}
body.dark button.nav-today-btn:hover {
  background: #1E3050 !important;
  border-color: #49B9FF !important;
}
body.dark button[data-view] {
  background: #122030 !important;
  border-color: #1E3350 !important;
  color: #5C7BA8 !important;
}
body.dark button[data-view]:hover {
  border-color: #49B9FF !important;
  color: #49B9FF !important;
}
body.dark button[data-view].bg-blue-600 {
  background: #49B9FF !important;
  border-color: #49B9FF !important;
  color: #0A1628 !important;
}

/* Period label */
body.dark #period-label { color: #A8DDFF; }

/* ── Keyboard shortcuts panel ────────────────────────────────────────────── */

body.dark #nav-help-panel {
  background: #122030 !important;
  border-color: #1E3350 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}
body.dark #nav-help-panel span[style*="color:#1e293b"] { color: #A8DDFF !important; }
body.dark #nav-help-panel span[style*="color:#374151"] { color: #8AA0C8 !important; }

/* ── Day header rows (week view) ─────────────────────────────────────────── */

body.dark .day-header-row {
  background: #162840 !important;
  color: #A8DDFF !important;
}
body.dark .day-header-row .text-gray-400 { color: #5C7BA8 !important; }

/* ── Overlap / time-order errors ─────────────────────────────────────────── */

body.dark tr.entry-overlap td            { background: #2A2010 !important; }
body.dark .day-header-row.is-holiday td  { background: #2A1020 !important; }
body.dark .day-header-row.is-holiday     { background: #2A1020 !important; }

/* ── Calendar cells ──────────────────────────────────────────────────────── */

body.dark .cal-cell {
  background: #122030 !important;
  border-color: #1E3350 !important;
}
body.dark .cal-cell:hover {
  background: #1A3050 !important;
  border-color: #49B9FF !important;
}
body.dark .cal-cell.today {
  background: #0D2040 !important;
  border-color: #49B9FF !important;
}
body.dark .cal-cell.other-month {
  background: #0E1A2A !important;
  border-color: #162030 !important;
  opacity: 0.6;
}
body.dark .cal-cell.holiday {
  background: #2A1020 !important;
  border-color: #7A2045 !important;
}
body.dark .cal-cell.holiday:hover {
  background: #3A1830 !important;
  border-color: #F3185A !important;
}
body.dark .day-num                   { color: #A8DDFF; }
body.dark .cal-cell.holiday .holiday-day-num { color: #F3185A !important; }
body.dark .cal-day-total             { color: #5C7BA8; }
body.dark .cal-entry-pill            { background: rgba(73,185,255,0.1); color: #A8DDFF; }
body.dark .cal-entry-more            { color: #5C7BA8; }

/* Year-view month cells */
body.dark div[class*="cal-cell"][class*="rounded-lg"] {
  background: #122030 !important;
  border-color: #1E3350 !important;
}
body.dark div[class*="cal-cell"][class*="rounded-lg"]:hover {
  background: #1A3050 !important;
  border-color: #49B9FF !important;
  box-shadow: 0 2px 8px rgba(73,185,255,0.15) !important;
}
body.dark div[class*="cal-cell"][class*="rounded-lg"] .font-semibold {
  color: #A8DDFF !important;
}
body.dark div[class*="cal-cell"][class*="rounded-lg"] .text-blue-600 {
  color: #49B9FF !important;
}
body.dark div[class*="cal-cell"][class*="rounded-lg"] .text-gray-300 {
  color: #2A3E58 !important;
}

/* ── Reports tab ─────────────────────────────────────────────────────────── */

body.dark #view-reports table td,
body.dark #view-reports table th { color: #D8E4F0 !important; }
body.dark #view-reports table tfoot td {
  background: #162840 !important;
  color: #A8DDFF !important;
}

/* ── Buttons (green/indigo export) ──────────────────────────────────────── */

body.dark button[class*="bg-green-600"]  { background: #166534 !important; color: #D8E4F0 !important; }
body.dark button[class*="bg-indigo-600"] { background: #3730A3 !important; color: #D8E4F0 !important; }
body.dark button[class*="bg-green-600"]:hover  { background: #15803D !important; }
body.dark button[class*="bg-indigo-600"]:hover { background: #4338CA !important; }

/* ── Flatpickr time picker ───────────────────────────────────────────────── */

body.dark .flatpickr-calendar {
  background: #122030 !important;
  border-color: #49B9FF !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}
body.dark .flatpickr-time input {
  color: #A8DDFF !important;
  background: transparent !important;
}
body.dark .flatpickr-time input:focus,
body.dark .flatpickr-time input:hover,
body.dark .numInputWrapper:hover      { background: #1A3050 !important; }
body.dark .flatpickr-time .flatpickr-time-separator { color: #A8DDFF; }

/* ── Project reassign inline row ─────────────────────────────────────────── */

body.dark .project-reassign-row td { background: #2A2010 !important; }

/* ── Undo toast ──────────────────────────────────────────────────────────── */
/* toast already uses dark navy bg — keep as-is; lighten border for contrast */
body.dark .undo-toast {
  border: 1px solid #1E3350;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ── Mobile UI (≤ 640 px) ────────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Day navigation bar ──────────────────────────────────────────────────── */

.mob-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 4px 16px;
}

.mob-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid #E4E3E0;
  background: #fff;
  font-size: 1.2rem;
  color: #364A7A;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.mob-arrow:hover, .mob-arrow:active {
  background: #EBF5FF;
  border-color: #49B9FF;
  color: #49B9FF;
}

.mob-date-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.mob-weekday {
  font-size: 0.8rem;
  color: #7889B3;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.mob-date-full {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0A1628;
  line-height: 1.3;
}
.mob-today-pill {
  margin-top: 4px;
  display: inline-block;
  background: #364A7A;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.mob-today-pill:hover { background: #0A1628; }

/* ── Cards list ──────────────────────────────────────────────────────────── */

.mob-cards-wrap {
  padding: 0 0 100px; /* space for FAB */
}

.mob-total {
  font-size: 0.78rem;
  color: #7889B3;
  font-weight: 600;
  text-align: right;
  padding: 0 4px 8px;
}

.mob-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 48px 16px;
  color: #7889B3;
  font-size: 0.95rem;
}
.mob-empty-hint {
  font-size: 0.78rem;
  color: #A8DDFF;
  opacity: 0.8;
}

.mob-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #E4E3E0;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(10,22,40,0.06);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-card:active {
  box-shadow: 0 2px 10px rgba(73,185,255,0.2);
  border-color: #A8DDFF;
}

.mob-card-stripe {
  width: 5px;
  flex-shrink: 0;
}

.mob-card-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}

.mob-card-r1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.mob-card-cat {
  font-size: 0.82rem;
  font-weight: 600;
  color: #364A7A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-card-dur {
  font-size: 0.82rem;
  font-weight: 700;
  color: #49B9FF;
  flex-shrink: 0;
}

.mob-card-r2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.mob-card-proj {
  font-size: 0.85rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-card-times {
  font-size: 0.78rem;
  color: #7889B3;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.mob-card-r3 {
  margin-top: 5px;
  font-size: 0.78rem;
  color: #7889B3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Floating add button ─────────────────────────────────────────────────── */

.mob-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #49B9FF;
  color: #0A1628;
  border: none;
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(73,185,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mob-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(73,185,255,0.3);
}

/* ── Edit sheet overlay ──────────────────────────────────────────────────── */

.mob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  transition: background 0.25s;
}
.mob-overlay-show {
  background: rgba(10, 22, 40, 0.55);
}

.mob-sheet {
  width: 100%;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 8px 20px 36px;
  box-shadow: 0 -4px 32px rgba(10,22,40,0.18);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.mob-sheet-show {
  transform: translateY(0);
}

.mob-sheet-handle {
  width: 40px;
  height: 4px;
  background: #E4E3E0;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.mob-sheet-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0A1628;
  margin-bottom: 16px;
}

.mob-sheet-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #7889B3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  margin-top: 12px;
}

.mob-sheet-input {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #E4E3E0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  color: #333;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.mob-sheet-input:focus {
  border-color: #49B9FF;
  box-shadow: 0 0 0 3px rgba(73,185,255,0.15);
}
.mob-input-error { border-color: #F3185A !important; }

.mob-sheet-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mob-sheet-error {
  font-size: 0.78rem;
  color: #F3185A;
  margin-top: 6px;
}

.mob-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.mob-sheet-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-sheet-btn:active { opacity: 0.8; }
.mob-sheet-save { background: #49B9FF; color: #0A1628; }
.mob-sheet-del  { background: #FFE6EE; color: #F3185A; }

/* ── Dark mode overrides for mobile ─────────────────────────────────────── */

body.dark .mob-arrow {
  background: #122030;
  border-color: #1E3350;
  color: #A8DDFF;
}
body.dark .mob-arrow:hover, body.dark .mob-arrow:active {
  background: #1A3050;
  border-color: #49B9FF;
  color: #49B9FF;
}
body.dark .mob-date-full { color: #D8E4F0; }
body.dark .mob-weekday   { color: #5C7BA8; }

body.dark .mob-card {
  background: #122030;
  border-color: #1E3350;
}
body.dark .mob-card:active { border-color: #49B9FF; }
body.dark .mob-card-cat    { color: #A8DDFF; }
body.dark .mob-card-proj   { color: #D8E4F0; }
body.dark .mob-card-times  { color: #5C7BA8; }
body.dark .mob-card-r3     { color: #5C7BA8; }

body.dark .mob-sheet {
  background: #122030;
}
body.dark .mob-sheet-handle { background: #1E3350; }
body.dark .mob-sheet-title  { color: #D8E4F0; }
body.dark .mob-sheet-input  {
  background: #0D1520;
  color: #D8E4F0;
  border-color: #1E3350;
}
body.dark .mob-sheet-input:focus {
  border-color: #49B9FF;
}
body.dark .mob-sheet-del { background: #2A1020; color: #F3185A; }
