/* ══════════════════════════════════════════════════════════════
   Crank Household – Main Stylesheet
   Pastel Green & Blue · Light/Dark Mode · Mobile First
══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --green-100: #d4f0e6;
  --green-200: #a8e0cc;
  --green-400: #7BC8A4;
  --green-600: #4A9E7F;
  --green-800: #2D6A54;

  --blue-100: #d4eaf5;
  --blue-200: #a8d4ec;
  --blue-400: #7EB8D4;
  --blue-600: #4A8FAD;
  --blue-800: #2D5F7A;

  --purple-100: #ede0f7;
  --purple-400: #C77DFF;
  --yellow-100: #fff8dc;
  --yellow-400: #FFD97D;
  --red-100: #ffe0e5;
  --red-400: #FF8A9B;

  /* Light theme */
  --bg: #F0F7F4;
  --bg-2: #E5F2ED;
  --surface: #FFFFFF;
  --surface-2: #F7FBF9;
  --border: #D1E8DD;
  --text: #2D4A3E;
  --text-muted: #7AA090;
  --text-invert: #FFFFFF;
  --primary: var(--green-400);
  --primary-hover: var(--green-600);
  --accent: var(--blue-400);
  --shadow: 0 4px 20px rgba(74, 158, 127, 0.12);
  --shadow-hover: 0 8px 32px rgba(74, 158, 127, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --nav-bg: linear-gradient(135deg, #FFFFFF 0%, #F0F7F4 100%);
  --nav-border: var(--border);
}

[data-theme="dark"] {
  --bg: #1A2E28;
  --bg-2: #162620;
  --surface: #243B35;
  --surface-2: #1E3028;
  --border: #2D4A3E;
  --text: #D4EDE5;
  --text-muted: #6B9082;
  --text-invert: #1A2E28;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5);
  --nav-bg: linear-gradient(135deg, #243B35 0%, #1A2E28 100%);
  --nav-border: #2D4A3E;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ────────────────────────────────────────────────── */
.crank-navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-400);
  box-shadow: 0 2px 8px rgba(123,200,164,0.3);
}

.brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green-600);
  letter-spacing: -0.3px;
}
[data-theme="dark"] .brand-text { color: var(--green-400); }

.brand-thin { font-weight: 300; color: var(--text-muted); }

.nav-pill {
  border-radius: var(--radius-pill) !important;
  padding: 0.4rem 1.1rem !important;
  font-weight: 600;
  color: var(--text-muted) !important;
  transition: all 0.2s;
}
.nav-pill:hover, .nav-pill.active {
  background: var(--green-100) !important;
  color: var(--green-600) !important;
}
[data-theme="dark"] .nav-pill:hover,
[data-theme="dark"] .nav-pill.active {
  background: rgba(123,200,164,0.15) !important;
  color: var(--green-400) !important;
}

.user-badge {
  background: var(--green-100);
  color: var(--green-600);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
}
[data-theme="dark"] .user-badge {
  background: rgba(123,200,164,0.15);
  color: var(--green-400);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--green-100); color: var(--green-600); }

/* ── Landing ───────────────────────────────────────────────── */
.landing-body {
  background: linear-gradient(135deg, var(--green-100) 0%, var(--blue-100) 50%, var(--green-100) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .landing-body {
  background: linear-gradient(135deg, #1A2E28 0%, #162630 50%, #1A2E28 100%);
}

.landing-wrapper {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 480px;
  width: 100%;
}

.landing-crest-wrap {
  margin-bottom: 1.5rem;
}

.landing-crest {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-hover);
  animation: floatIn 0.8s ease-out;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -1px;
  margin-bottom: 0.25rem;
}
[data-theme="dark"] .landing-title { color: var(--green-400); }
.landing-title span { font-weight: 300; color: var(--text-muted); }

.landing-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.landing-users {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-user-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 140px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  transition: all 0.25s;
  box-shadow: var(--shadow);
}
.landing-user-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--green-400);
  background: var(--green-100);
}
[data-theme="dark"] .landing-user-btn:hover {
  background: rgba(123,200,164,0.15);
}

.user-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--green-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: var(--green-600);
  transition: all 0.25s;
}
.user-avatar.female {
  background: var(--blue-100);
  color: var(--blue-600);
}
.landing-user-btn:hover .user-avatar { transform: scale(1.1); }

.landing-footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Page Layout ───────────────────────────────────────────── */
.page-main {
  padding: 0 0 3rem 0;
  min-height: calc(100vh - 66px);
}

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.25rem 1rem;
  position: sticky;
  top: 66px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Glass Cards ───────────────────────────────────────────── */
.card-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  background: var(--green-400) !important;
  border-color: var(--green-400) !important;
  color: white !important;
  font-weight: 700;
  border-radius: var(--radius-pill) !important;
  transition: all 0.2s !important;
}
.btn-primary:hover {
  background: var(--green-600) !important;
  border-color: var(--green-600) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74,158,127,0.35) !important;
}

.btn-outline-secondary {
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-pill) !important;
  font-weight: 600;
}
.btn-outline-secondary:hover {
  background: var(--surface-2) !important;
  color: var(--text) !important;
}

.btn-outline-danger {
  border-radius: var(--radius-pill) !important;
  font-weight: 600;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  border-radius: var(--radius-pill) !important;
}
.btn-ghost {
  background: none;
  border: none;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}
.btn-ghost:hover { opacity: 0.7; }

/* ── Category Pills ────────────────────────────────────────── */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--cat-color, var(--green-400));
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.cat-pill .cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cat-color, var(--green-400));
  opacity: 0.4;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.cat-pill.active {
  background: color-mix(in srgb, var(--cat-color, var(--green-400)) 15%, transparent);
  color: var(--text);
}
.cat-pill.active .cat-dot { opacity: 1; }

/* ── Filter bar ────────────────────────────────────────────── */
.filter-toggle-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted);
  cursor: pointer; transition: all 0.18s;
  font-family: 'Nunito', sans-serif;
}
.filter-toggle-btn:hover { border-color: var(--green-400); color: var(--text); }
.filter-chevron { font-size: 0.65rem; transition: transform 0.2s; }
.filter-toggle-btn[aria-expanded="true"] .filter-chevron { transform: rotate(180deg); }
.filter-active-count {
  background: var(--green-400); color: #fff;
  border-radius: 50%; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}
.filter-section { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--text-muted);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border: 1.5px solid var(--border);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
  user-select: none;
}
.filter-chip input[type="checkbox"] { display: none; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; opacity: 0.45; transition: opacity 0.15s; }
.chip-icon { font-size: 0.72rem; opacity: 0.6; }
.filter-chip.active {
  background: color-mix(in srgb, var(--green-400) 12%, transparent);
  border-color: var(--green-400);
  color: var(--text);
}
.filter-chip.active .chip-dot { opacity: 1; }
.filter-chip.active .chip-icon { opacity: 1; }
.filter-chip:hover { border-color: var(--green-400); color: var(--text); }

/* ── Icon picker ───────────────────────────────────────────── */
.icon-picker-grid {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.icon-picker-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem;
  transition: all 0.15s;
}
.icon-picker-btn:hover { border-color: var(--green-400); color: var(--text); }
.icon-picker-btn.selected { border-color: var(--green-400); background: color-mix(in srgb, var(--green-400) 20%, transparent); color: var(--green-400); }

/* ── Offcanvas ─────────────────────────────────────────────── */
.crank-offcanvas {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-left: 1px solid var(--border) !important;
  width: 320px !important;
}
.crank-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.cat-swatch {
  width: 26px; height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9);
  font-size: 0.72rem;
}
.cat-label { font-weight: 600; flex: 1; font-size: 0.9rem; }

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--surface-2) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-family: 'Nunito', sans-serif !important;
  font-size: 0.9rem !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green-400) !important;
  box-shadow: 0 0 0 3px rgba(123,200,164,0.2) !important;
  background: var(--surface) !important;
}
.form-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.input-group-text {
  background: var(--surface-2) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--border) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25) !important;
  color: var(--text) !important;
}
.modal-backdrop { background: rgba(26, 46, 40, 0.6) !important; }
.btn-close { filter: var(--bs-btn-close-filter, none); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ── Tabs ──────────────────────────────────────────────────── */
.crank-tabs {
  border-bottom: 2px solid var(--border);
  padding: 0 1.25rem;
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.crank-tabs::-webkit-scrollbar { display: none; }

.crank-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.crank-tab:hover { color: var(--text); background: var(--surface-2); }
.crank-tab.active, .crank-tab[aria-selected="true"] {
  color: var(--green-600) !important;
  border-bottom-color: var(--green-400) !important;
  background: transparent !important;
}
[data-theme="dark"] .crank-tab.active { color: var(--green-400) !important; }

/* ── Calendar ──────────────────────────────────────────────── */
.calendar-container {
  margin: 1.25rem;
  padding: 1rem;
  overflow: hidden;
}

/* Location pin icon on calendar events */
.cal-loc-icon {
  font-size: 0.65rem;
  margin-left: 5px;
  opacity: 0.85;
  vertical-align: middle;
  flex-shrink: 0;
}
.fc-list-event-title .cal-loc-icon {
  font-size: 0.7rem;
}

/* ── Saved location preview card (event modal) ─────────────────────── */
.loc-preview-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.loc-preview-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.loc-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Location row (offcanvas manage list) ───────────────────────────── */
.loc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.loc-row-img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.loc-row-img-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Category colour preset palette ────────────────────────────────── */
.cat-preset-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.cat-preset-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.cat-preset-swatch:hover,
.cat-preset-swatch.active {
  transform: scale(1.25);
  border-color: var(--text);
}

/* ── Plaid connected bank rows ──────────────────────────────────────── */
.plaid-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.plaid-item-row:last-child { border-bottom: none; }

/* ── Sync log rows ──────────────────────────────────────────────────── */
.sync-log-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.sync-log-row:last-child { border-bottom: none; }

/* ── Multi-category pill checkboxes (event modal) ─────────────────── */
.ev-cat-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ev-cat-check input[type=checkbox] { display: none; }
.ev-cat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 2px solid var(--cat-color, #7BC8A4);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.ev-cat-check input:checked + .ev-cat-label {
  background: var(--cat-color, #7BC8A4);
  color: #fff;
}
.ev-cat-check input:checked + .ev-cat-label .cat-dot {
  background: rgba(255,255,255,0.7);
}

/* ── Multi-category dots on calendar events ───────────────────────── */
.ev-multi-cats { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; }
.ev-multi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid rgba(255,255,255,0.7);
  flex-shrink: 0;
}

/* ── Ticket tracker ───────────────────────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ticket-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 4px solid var(--border);
  transition: opacity 0.2s;
}
.ticket-row-resolved { opacity: 0.6; border-left-color: var(--green-400); }
.ticket-body { flex: 1; min-width: 0; }
.ticket-actions { display: flex; gap: 0.4rem; flex-shrink: 0; align-items: center; }
.ticket-priority {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.ticket-priority-low    { background: #e2e8f0; color: #475569; }
.ticket-priority-normal { background: #fef3c7; color: #92400e; }
.ticket-priority-high   { background: #fee2e2; color: #991b1b; }

/* ── Message theme swatches ──────────────────────────────────────── */
.msg-theme-opt input { display: none; }
.msg-theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.15s;
}
.msg-theme-opt input:checked + .msg-theme-swatch { border-color: currentColor; }
.msg-theme-pink   { background: var(--msg-pink-bg,   #ffe4f0); color: #e84393; }
.msg-theme-yellow { background: var(--msg-yellow-bg, #fff8e1); color: #f5a623; }
.msg-theme-blue   { background: var(--msg-blue-bg,   #e0f0ff); color: #3b82f6; }
.msg-theme-green  { background: var(--msg-green-bg,  #e6f9ee); color: #22c55e; }

.fc {
  font-family: 'Nunito', sans-serif !important;
}
.fc .fc-toolbar-title { font-weight: 800 !important; font-size: 1.2rem !important; }
.fc .fc-button {
  background: var(--green-400) !important;
  border-color: var(--green-400) !important;
  border-radius: var(--radius-pill) !important;
  font-weight: 700 !important;
  font-family: 'Nunito', sans-serif !important;
}
.fc .fc-button:hover { background: var(--green-600) !important; border-color: var(--green-600) !important; }
.fc .fc-button-active { background: var(--green-600) !important; }
.fc .fc-daygrid-day { background: var(--surface) !important; }
.fc .fc-daygrid-day:hover { background: var(--surface-2) !important; }
.fc .fc-col-header-cell { background: var(--surface-2) !important; color: var(--text-muted) !important; font-weight: 700 !important; }
.fc .fc-daygrid-day-number { color: var(--text) !important; font-weight: 600 !important; }
.fc .fc-day-today { background: color-mix(in srgb, var(--green-400) 8%, var(--surface)) !important; }
.fc .fc-event { border-radius: 6px !important; font-size: 0.78rem !important; font-weight: 700 !important; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border) !important; }
.fc-theme-standard .fc-scrollgrid { border-color: var(--border) !important; }
[data-theme="dark"] .fc .fc-toolbar-title { color: var(--text) !important; }
[data-theme="dark"] .fc .fc-daygrid-day-number { color: var(--text) !important; }

/* Account logo image inside the icon box */
.acct-icon-img {
  background: var(--surface-2);
  padding: 2px;
}
.acct-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

/* ── Acct-totals chip — utilization variant ─────────── */
.chip-util {
  border-color: #7BC8A4;
  color: var(--text);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 120px;
  padding: 0.35rem 0.75rem;
}
.chip-util-bar-wrap {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--border-color);
  overflow: hidden;
}
.chip-util-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease, background 0.3s;
}
.chip-util > *:first-child {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  width: 100%;
}

/* ── Budget ────────────────────────────────────────────────── */
.accounts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem;
}

.account-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;          /* allow shrinking below content size */
  flex: 1 1 200px;       /* grow/shrink, base 200px */
  box-shadow: var(--shadow);
  transition: all 0.2s;
  overflow: hidden;      /* clip anything that still spills */
}
.account-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.acct-checking .acct-icon { background: var(--green-100); color: var(--green-600); }
.acct-savings  .acct-icon { background: var(--blue-100);  color: var(--blue-600);  }
.acct-credit   .acct-icon { background: var(--red-100);   color: #d94f5c; }
.acct-loan     .acct-icon { background: var(--yellow-100);color: #b8860b; }
.acct-gov      .acct-icon { background: #ede7f6;          color: #7c5cbf; }

.acct-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Middle info section — must be able to shrink & clip */
.acct-info {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}
.acct-name {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-last-four { font-size: 0.72rem; color: var(--text-muted); margin-left: 0.3rem; }
.acct-type { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }

/* Right side — balance + util bar */
.acct-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;        /* never shrink the balance area */
  max-width: 48%;        /* but cap it so name still shows */
}
.acct-balance {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green-600);
  white-space: nowrap;
}
.acct-balance.neg { color: #d94f5c; }
.acct-utilization { width: 110px; max-width: 100%; }
.util-bar-wrap {
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.2rem;
}
.util-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--green-400);
  transition: width 0.4s ease;
}
.util-bar.warn  { background: #f0a500; }
.util-bar.danger{ background: #d94f5c; }
.util-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* DataTables */
.crank-table { border-collapse: separate !important; border-spacing: 0 !important; }
.crank-table thead th {
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--border) !important;
  padding: 0.75rem 1rem !important;
}
.crank-table tbody tr {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: background 0.15s;
}
.crank-table tbody tr:hover { background: var(--surface-2) !important; }
.crank-table tbody td { padding: 0.7rem 1rem !important; vertical-align: middle !important; font-size: 0.88rem !important; }
.dataTables_wrapper { padding: 0 !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--surface-2) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  padding: 0.3rem 0.6rem !important;
  font-family: 'Nunito', sans-serif !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: var(--text-muted) !important; font-size: 0.82rem !important; }
.dataTables_wrapper .paginate_button {
  border-radius: var(--radius-pill) !important;
  padding: 0.2rem 0.6rem !important;
  color: var(--text-muted) !important;
}
.dataTables_wrapper .paginate_button.current {
  background: var(--green-400) !important;
  border-color: var(--green-400) !important;
  color: white !important;
}

/* ── Account last-four & net strip ─────────────────────────── */
.acct-last-four {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-left: 0.3rem;
}
.net-strip {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  gap: 0;
}
.net-item { flex: 1; text-align: center; }
.net-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.1rem;
}
.net-value { font-size: 1.15rem; font-weight: 800; }
.net-value.income { color: var(--green-600, #2e7d5e); }
.net-value.expense { color: #d94f5c; }
.net-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 0.5rem;
}

/* ── Meals / Planner ───────────────────────────────────────── */
.week-label { font-weight: 700; color: var(--text); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

@media (max-width: 700px) {
  .week-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

.week-col {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  min-width: 100px;
}

.week-day-header {
  background: var(--surface-2);
  padding: 0.4rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.week-day-header span:first-child { font-weight: 700; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.week-date { font-size: 1rem; font-weight: 800; color: var(--text); }

.week-meals { padding: 0.4rem; min-height: 60px; display: flex; flex-direction: column; gap: 0.3rem; }

.meal-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--green-100);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-800);
  position: relative;
}
.meal-chip.breakfast { background: var(--yellow-100); color: #7a5c00; }
.meal-chip.lunch { background: var(--blue-100); color: var(--blue-800); }
.meal-chip.dinner { background: var(--green-100); color: var(--green-800); }
.meal-chip.snack { background: var(--purple-100); color: #5a2d82; }
[data-theme="dark"] .meal-chip { color: var(--text); opacity: 0.85; }

.meal-chip-img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.meal-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-chip-del {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  color: inherit; opacity: 0.5; padding: 0 2px; line-height: 1;
}
.meal-chip-del:hover { opacity: 1; }

.week-add-btn {
  width: 100%; background: none; border: none; border-top: 1px dashed var(--border);
  padding: 0.4rem; color: var(--text-muted); cursor: pointer; font-size: 0.8rem;
  transition: all 0.15s;
}
.week-add-btn:hover { background: var(--green-100); color: var(--green-600); }

/* ── Recipe Grid ───────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}

.recipe-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--green-400); }

.recipe-img {
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: var(--green-100);
}
.recipe-no-img {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--green-400);
}

.recipe-body { padding: 0.75rem; }
.recipe-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.3rem; line-height: 1.3; }
.recipe-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.recipe-meta span { font-size: 0.72rem; color: var(--text-muted); }

.recipe-detail-img {
  width: 100%; max-height: 250px; object-fit: cover;
  border-radius: var(--radius-sm);
}

.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.ingredient-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ing-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ing-thumb-placeholder {
  width: 36px; height: 36px; border-radius: 8px; background: var(--green-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-400); font-size: 1rem; flex-shrink: 0;
}

.instructions-block {
  background: var(--surface-2);
  border-left: 3px solid var(--green-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Ingredient Manager ─────────────────────────────────────── */
.ing-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}
.ing-manager-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.ing-manager-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-hover); }
.ing-manager-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.ing-manager-placeholder {
  width: 64px; height: 64px; border-radius: 10px;
  background: var(--green-100); color: var(--green-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.ing-manager-name {
  font-size: 0.75rem; font-weight: 600; text-align: center;
  color: var(--text); line-height: 1.2;
  word-break: break-word;
}
.ing-manager-edit {
  position: absolute; top: 5px; right: 6px;
  font-size: 0.65rem; color: var(--text-muted); opacity: 0;
  transition: opacity 0.15s;
}
.ing-manager-card:hover .ing-manager-edit { opacity: 1; }
.ing-edit-preview { width: 100px; height: 100px; border-radius: 12px; object-fit: cover; }
.ing-edit-placeholder {
  width: 100px; height: 100px; border-radius: 12px;
  background: var(--green-100); color: var(--green-400);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

/* ── Grocery ───────────────────────────────────────────────── */
.grocery-list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.grocery-list-row:hover { background: var(--surface-2); }

.grocery-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}
.grocery-item.checked { opacity: 0.45; }
.grocery-item.checked .grocery-item-name { text-decoration: line-through; }

.grocery-check {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: 0;
  color: var(--green-400);
  transition: color 0.15s, transform 0.15s;
}
.grocery-check:hover { transform: scale(1.2); }
.grocery-item.checked .grocery-check { color: var(--green-600); }

.grocery-ing-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.grocery-ing-placeholder {
  width: 36px; height: 36px; border-radius: 8px; background: var(--green-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-400); font-size: 0.9rem; flex-shrink: 0;
}

.grocery-item-info { flex: 1; }
.grocery-item-name { font-weight: 600; font-size: 0.9rem; display: block; }
.grocery-item-qty { font-size: 0.78rem; color: var(--text-muted); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  border-radius: var(--radius-pill) !important;
  font-family: 'Nunito', sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  padding: 0.3em 0.7em !important;
}
.bg-soft-green { background: var(--green-100) !important; color: var(--green-800) !important; }
.bg-soft-blue { background: var(--blue-100) !important; color: var(--blue-800) !important; }
.bg-soft-purple { background: var(--purple-100) !important; color: #5a2d82 !important; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Utilities ─────────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.tab-content { padding: 0 1.25rem; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--green-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-400); }

/* ── Mobile tweaks ─────────────────────────────────────────── */
@media (max-width: 576px) {
  .page-header { top: 0; }
  .calendar-container { margin: 0.75rem; padding: 0.5rem; }
  .accounts-row { padding: 0.75rem; gap: 0.6rem; }
  .account-card { flex: 1 1 100%; padding: 0.75rem 1rem; }
  .acct-utilization { width: 90px; }
  .recipe-grid { padding: 0.75rem; grid-template-columns: repeat(2, 1fr); }
  .tab-content { padding: 0 0.75rem; }
  .modal-dialog { margin: 0.5rem; }
  .crank-offcanvas { width: 100vw !important; }
  .landing-crest { width: 110px; height: 110px; }
  .landing-title { font-size: 1.7rem; }
}

/* ── Planner active button ─────────────────────────────────── */
.planner-view-btn.active {
  background: var(--green-400) !important;
  color: #fff !important;
  border-color: var(--green-400) !important;
}

/* ── Month View ────────────────────────────────────────────── */
.month-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: auto;
}

.month-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1.5px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
}
.month-head-cell {
  text-align: center;
  padding: 0.45rem 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.month-week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 90px;
}
.month-week-row:last-child { border-bottom: none; }

.month-day-cell {
  border-right: 1px solid var(--border);
  padding: 0.3rem 0.35rem 0.2rem;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.month-day-cell:last-child { border-right: none; }
.month-day-cell.other-month { background: var(--bg-2); opacity: 0.55; }
.month-day-cell:hover { background: var(--surface-2); }

.month-day-num {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.month-day-meals {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  overflow: hidden;
}
.month-day-meals .meal-chip {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.month-add-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
  align-self: flex-end;
}
.month-day-cell:hover .month-add-btn { opacity: 1; }

/* ── Household Category Pills ──────────────────────────────── */
.hh-cat-pill {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.hh-cat-pill:hover {
  border-color: var(--cat-c, var(--green-400));
  color: var(--cat-c, var(--green-600));
  background: color-mix(in srgb, var(--cat-c, var(--green-400)) 12%, transparent);
}
.hh-cat-pill.active {
  background: var(--cat-c, var(--green-400));
  border-color: var(--cat-c, var(--green-400));
  color: #fff;
}

/* ── Household Item Grid ───────────────────────────────────── */
.hh-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}
.hh-item-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.hh-item-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-hover); }
.hh-item-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.hh-item-placeholder {
  width: 64px; height: 64px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.hh-item-name {
  font-size: 0.75rem; font-weight: 600; text-align: center;
  color: var(--text); line-height: 1.2; word-break: break-word;
}
.hh-item-cat {
  font-size: 0.65rem; font-weight: 700; text-align: center; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hh-item-edit {
  position: absolute; top: 5px; right: 6px;
  font-size: 0.65rem; color: var(--text-muted); opacity: 0;
  transition: opacity 0.15s;
}
.hh-item-card:hover .hh-item-edit { opacity: 1; }

/* ── Grocery Picker Modal Grid ─────────────────────────────── */
.hh-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem;
}
.hh-picker-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  user-select: none;
}
.hh-picker-card:hover { border-color: var(--green-400); transform: translateY(-2px); }
.hh-picker-card.selected {
  border-color: var(--green-600);
  background: var(--green-100);
  box-shadow: 0 0 0 2px var(--green-400);
}
[data-theme="dark"] .hh-picker-card.selected { background: rgba(123,200,164,0.15); }

.hh-picker-check {
  position: absolute; top: 5px; right: 6px;
  color: var(--green-600); font-size: 1.1rem; line-height: 1;
}
.hh-picker-img { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; }
.hh-picker-placeholder {
  width: 58px; height: 58px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.hh-picker-name {
  font-size: 0.72rem; font-weight: 700; text-align: center;
  line-height: 1.2; word-break: break-word; color: var(--text);
}
.hh-picker-cat {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   2 DO – Daily Task Scheduler
══════════════════════════════════════════════════════════════ */

/* ── Progress bars ─────────────────────────────────────────── */
.todo-progress-wrap {
  height: 8px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.todo-progress-bar {
  height: 100%; background: var(--green-400); border-radius: 999px;
  transition: width 0.4s ease;
}
.goal-progress-wrap {
  height: 8px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.goal-progress-bar {
  height: 100%; border-radius: 999px; transition: width 0.4s ease;
}

/* ── Task items ────────────────────────────────────────────── */
.todo-task-list { display: flex; flex-direction: column; gap: 6px; }
.todo-task-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 8px 10px; border: 1px solid var(--border);
  transition: opacity 0.2s;
}
.todo-task-item.done { opacity: 0.5; }
.todo-task-item.done .task-title { text-decoration: line-through; }
.task-color-bar { width: 3px; border-radius: 99px; align-self: stretch; flex-shrink: 0; min-height: 20px; }
.task-check { padding-top: 2px; }
.task-body { min-width: 0; }
.task-title { font-weight: 600; word-break: break-word; }
.task-notes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }

/* ── Calendar event list (today panel) ─────────────────────── */
.todo-cal-list { display: flex; flex-direction: column; gap: 4px; }
.cal-event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }

/* ── Goal picker modal ─────────────────────────────────────── */
.picker-task-row { transition: background 0.15s; }
.picker-task-row:hover { background: var(--surface) !important; }

/* ── Calendar event destination (2DO today panel) ──────────── */
.cal-event-dest { margin-top: 3px; display: flex; flex-direction: column; gap: 1px; }
.dest-name { font-size: 0.78rem; color: var(--text-muted); }
.dest-link { font-size: 0.78rem; color: var(--accent); text-decoration: none; }
.dest-link:hover { text-decoration: underline; }

/* ── Week grid ─────────────────────────────────────────────── */
.todo-week-grid {
  display: grid; gap: 6px;
  grid-template-columns: repeat(7, 1fr);
}
@media (max-width: 768px) {
  .todo-week-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .todo-week-grid { grid-template-columns: 1fr 1fr; }
}
.week-col {
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 8px; min-height: 100px;
}
.week-col-today {
  border-color: var(--green-400); background: var(--green-100);
}
[data-theme="dark"] .week-col-today { background: rgba(123,200,164,0.12); }
.week-col-header {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); text-align: center; margin-bottom: 6px;
  line-height: 1.3;
}
.week-col-tasks { display: flex; flex-direction: column; gap: 4px; }
.week-task {
  display: flex; align-items: center; gap: 4px; font-size: 0.78rem;
  padding: 3px 5px; background: var(--surface); border-radius: 6px;
  border: 1px solid var(--border); cursor: default;
}
.week-task.done span { text-decoration: line-through; opacity: 0.5; }
.add-week-task { font-size: 0.72rem; opacity: 0.5; }
.add-week-task:hover { opacity: 1; }

/* ── Goal cards ────────────────────────────────────────────── */
.goal-card { transition: box-shadow 0.2s; }
.goal-card:hover { box-shadow: var(--shadow-hover); }
.goal-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 1rem;
}
.goal-task-list { display: flex; flex-direction: column; gap: 4px; }
.goal-task-item {
  padding: 4px 6px; background: var(--surface-2); border-radius: 6px;
  font-size: 0.85rem;
}

/* ── Login Message Popup ────────────────────────────────────── */
:root {
  --msg-pink-bg:   #fde8f1;
  --msg-yellow-bg: #fff9e0;
  --msg-blue-bg:   #e5f0ff;
  --msg-green-bg:  #e5f7ee;
  --msg-accent:    #e84393;
}
[data-theme="dark"] {
  --msg-pink-bg:   rgba(232,67,147,0.15);
  --msg-yellow-bg: rgba(245,166,35,0.15);
  --msg-blue-bg:   rgba(59,130,246,0.15);
  --msg-green-bg:  rgba(34,197,94,0.15);
}
.login-msg-card {
  border-radius: 20px !important;
  border: 2px solid var(--msg-accent) !important;
  background: var(--surface) !important;
  overflow: hidden;
}
.login-msg-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  transition: background 0.3s;
}
.login-msg-icon { font-size: 1.8rem; transition: color 0.3s; }
.login-msg-from { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.login-msg-text { font-size: 1.05rem; font-weight: 600; color: var(--text); line-height: 1.5; }
.login-msg-counter { font-size: 0.8rem; color: var(--text-muted); align-self: center; min-width: 40px; text-align: center; }
.login-msg-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 2px 10px; }
.login-msg-close-btn {
  background: var(--msg-accent); color: #fff; border-radius: 999px;
  font-weight: 700; padding: 8px 20px; border: none; transition: opacity 0.2s;
}
.login-msg-close-btn:hover { opacity: 0.85; color: #fff; }

/* ── Year-over-Year Trends ────────────────────────────────────────── */
.trend-year-toggle .form-check-input {
  border-color: var(--ty-color, #aaa);
}
.trend-year-toggle .form-check-input:checked {
  background-color: var(--ty-color, #aaa);
  border-color:     var(--ty-color, #aaa);
}
/* Small color dot used in trend summary table */
.cat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
#trendTable thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
#trendTable tbody tr:last-child {
  border-top: 2px solid var(--border);
}
