/* ══════════════════════════════════════════════════════
   NINHO — Design System
   Dark/Light themes, fully responsive
══════════════════════════════════════════════════════ */

/* ── THEME VARIABLES ─────────────────────────────────── */
:root {
  --bg-base:     #f4f5f9;
  --bg-card:     #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-header:   #ffffff;
  --bg-inset:    #f0f1f6;
  --bg-hover:    #f5f6fb;
  --border:      rgba(0,0,0,0.07);
  --border-light:rgba(0,0,0,0.04);
  --text-1:      #0f1729;
  --text-2:      #5a6484;
  --text-3:      #9ba3bf;
  --accent:      #4f6ef7;
  --accent-2:    #7c3aed;
  --accent-soft: rgba(79,110,247,0.10);
  --success:     #10b981;
  --success-soft:rgba(16,185,129,0.10);
  --danger:      #ef4444;
  --danger-soft: rgba(239,68,68,0.10);
  --warning:     #f59e0b;
  --warning-soft:rgba(245,158,11,0.10);
  --terra:       #b5614a;
  --terra-soft:  rgba(181,97,74,0.10);
  --shadow:      0 2px 12px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.10);
  --radius:      16px;
  --radius-sm:   12px;
  --radius-xs:   8px;
  --sidebar-w:   220px;
  --header-h:    60px;
}

[data-theme="dark"] {
  --bg-base:     #0f1729;
  --bg-card:     #1a2441;
  --bg-sidebar:  #141e35;
  --bg-header:   #141e35;
  --bg-inset:    #1e2d4a;
  --bg-hover:    #223153;
  --border:      rgba(255,255,255,0.07);
  --border-light:rgba(255,255,255,0.04);
  --text-1:      #e8eeff;
  --text-2:      #8892b0;
  --text-3:      #4a5580;
  --shadow:      0 2px 12px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.4);
}

/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 15px; }
body { height: 100%; background: var(--bg-base); color: var(--text-1); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; transition: background .3s, color .3s; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.icon { display: inline-block; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── APP SHELL ────────────────────────────────────────── */
.app { display: grid; grid-template-rows: var(--header-h) 1fr; grid-template-columns: var(--sidebar-w) 1fr; height: 100dvh; }

/* ── HEADER ───────────────────────────────────────────── */
.header { grid-column: 1 / -1; background: var(--bg-header); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; box-shadow: var(--shadow); z-index: 100; }
.header-logo { display: flex; align-items: center; gap: 10px; width: var(--sidebar-w); padding-right: 16px; flex-shrink: 0; }
.header-logo img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.header-logo-name { font-size: 16px; font-weight: 800; color: var(--text-1); letter-spacing: -0.5px; }
.header-logo-name span { color: var(--accent); }
.header-nav { display: flex; gap: 4px; flex: 1; }
.header-nav-btn { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; color: var(--text-2); border: none; background: none; transition: all .2s; white-space: nowrap; }
.header-nav-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.header-nav-btn.active { background: var(--accent-soft); color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-greeting { text-align: right; }
.header-greeting-hello { font-size: 11px; color: var(--text-3); font-weight: 500; }
.header-greeting-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.header-avatars { display: flex; cursor: pointer; }
.header-avatars .hav { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--bg-card); object-fit: cover; background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; overflow: hidden; }
.header-avatars .hav:nth-child(2) { margin-left: -8px; }
.theme-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all .2s; flex-shrink: 0; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--border); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); padding: 12px 10px 6px; }
.sidebar-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; color: var(--text-2); border: none; background: none; width: 100%; text-align: left; transition: all .2s; }
.sidebar-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.sidebar-btn.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-btn .sb-icon { color: inherit; }
.sidebar-badge { margin-left: auto; background: var(--accent); color: white; font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 7px; min-width: 18px; text-align: center; }
.sidebar-badge.red { background: var(--danger); }
.sidebar-badge.green { background: var(--success); }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── MAIN CONTENT ─────────────────────────────────────── */
.main { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.main::-webkit-scrollbar { width: 4px; }
.main::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 4px; }
.page { display: none; padding: 20px 24px; gap: 16px; flex-direction: column; }
.page.active { display: flex; }

/* ── GRID ─────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }

/* ── CARDS ────────────────────────────────────────────── */
.card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-sm { padding: 14px 16px; }
.card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 8px; }
.card-subtitle { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.card-action { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all .2s; flex-shrink: 0; }
.card-action:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* STAT CARDS */
.stat-card { background: var(--bg-card); border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }
.stat-icon.purple { background: rgba(124,58,237,0.1); color: var(--accent-2); }
.stat-label { font-size: 11px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text-1); letter-spacing: -0.5px; margin-top: 2px; }
.stat-change { font-size: 11px; font-weight: 600; margin-top: 3px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── BUTTONS ──────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; border: none; transition: all .2s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { opacity: .88; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: var(--bg-inset); color: var(--text-1); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius-xs); justify-content: center; background: var(--bg-inset); color: var(--text-2); border: 1px solid var(--border); }
.btn-icon:hover { background: var(--accent); color: white; border-color: var(--accent); }
.btn-icon.red:hover { background: var(--danger); border-color: var(--danger); }

/* ── BADGES ───────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gray { background: var(--bg-inset); color: var(--text-2); }

/* ── LISTS ────────────────────────────────────────────── */
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-xs); transition: background .15s; }
.list-item:hover { background: var(--bg-hover); }
.list-avatar { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.list-info { flex: 1; min-width: 0; }
.list-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.list-right { flex-shrink: 0; text-align: right; }
.list-amount { font-size: 14px; font-weight: 700; }
.list-amount.pos { color: var(--success); }
.list-amount.neg { color: var(--text-1); }
.list-del { width: 28px; height: 28px; border-radius: 8px; border: none; background: transparent; color: var(--text-3); display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.list-del:hover { background: var(--danger-soft); color: var(--danger); }
.divider { height: 1px; background: var(--border-light); margin: 4px 0; }

/* ── FORM ELEMENTS ────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px; }
.form-control { width: 100%; background: var(--bg-inset); border: 1.5px solid var(--border); border-radius: var(--radius-xs); color: var(--text-1); font-size: 14px; padding: 10px 14px; outline: none; transition: border-color .2s; }
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.type-btn { padding: 10px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 700; border: 2px solid var(--border); background: var(--bg-inset); color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; }
.type-btn.active-expense { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.type-btn.active-income { border-color: var(--success); background: var(--success-soft); color: var(--success); }

/* ── CALENDAR ─────────────────────────────────────────── */
.cal-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-shrink: 0; }
.cal-tab { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: none; background: var(--bg-inset); color: var(--text-2); transition: all .2s; }
.cal-tab.active { background: var(--accent); color: white; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all .2s; }
.cal-nav-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.cal-nav-title { flex: 1; text-align: center; font-size: 12px; font-weight: 700; }
.events-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.event-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-inset); border-radius: var(--radius-xs); cursor: pointer; transition: all .15s; border: 1px solid transparent; flex-shrink: 0; }
.event-item:hover { border-color: var(--border); background: var(--bg-card); box-shadow: var(--shadow); }
.event-time { font-size: 10px; color: var(--text-3); width: 36px; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-bar { width: 3px; border-radius: 3px; flex-shrink: 0; align-self: stretch; min-height: 28px; }
.event-title { font-size: 12px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-sub { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.cal-legend { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); flex-wrap: wrap; flex-shrink: 0; }
.cal-filter { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-3); border: 1.5px solid transparent; background: var(--bg-inset); transition: all .2s; }
.cal-filter.active { border-color: var(--accent); color: var(--text-1); background: var(--accent-soft); }
.cal-filter-dot { width: 7px; height: 7px; border-radius: 50%; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; flex: 1; overflow-y: auto; min-height: 0; }
.week-day-hdr { font-size: 9px; font-weight: 700; text-align: center; padding: 4px 2px; border-radius: 6px; color: var(--text-3); text-transform: uppercase; }
.week-day-hdr.today { background: var(--accent); color: white; }
.week-event { font-size: 9px; padding: 2px 5px; border-radius: 4px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; margin-bottom: 2px; cursor: pointer; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.month-hdr { font-size: 9px; font-weight: 700; text-align: center; color: var(--text-3); padding: 3px 0; text-transform: uppercase; }
.month-day { min-height: 36px; border-radius: 6px; padding: 4px; }
.month-day.today { background: var(--accent-soft); }
.month-day.other-month { opacity: .3; }
.month-day-num { font-size: 10px; font-weight: 700; color: var(--text-1); }
.month-day.today .month-day-num { color: var(--accent); }
.month-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; margin: 1px; }

/* ── CIRCLES (recurrent tasks) ────────────────────────── */
.circles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.circle-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: var(--radius-sm); background: var(--bg-inset); cursor: pointer; transition: all .2s; border: 1px solid transparent; }
.circle-item:hover { border-color: var(--border); background: var(--bg-card); box-shadow: var(--shadow); }
.circle-item:active { transform: scale(0.96); }
.circle-name { font-size: 10px; color: var(--text-2); text-align: center; font-weight: 600; }
.circle-time { font-size: 9px; text-align: center; font-weight: 700; }

/* ── HABITS ───────────────────────────────────────────── */
.habit-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-xs); cursor: pointer; transition: all .15s; }
.habit-item:hover { background: var(--bg-hover); }
.habit-icon-wrap { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-inset); flex-shrink: 0; color: var(--text-2); }
.habit-info { flex: 1; min-width: 0; }
.habit-name { font-size: 12px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit-item.done .habit-name { color: var(--text-3); text-decoration: line-through; }
.habit-dots { display: flex; gap: 3px; margin-top: 3px; }
.h-dot { width: 6px; height: 6px; border-radius: 50%; }
.habit-streak { font-size: 10px; color: var(--text-3); font-weight: 700; flex-shrink: 0; }
.habit-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.habit-item.done .habit-check { background: var(--success); border-color: var(--success); }
.habit-check-in { width: 7px; height: 4px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) translateY(-1px); display: none; }
.habit-item.done .habit-check-in { display: block; }
.habit-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border-light); }

/* ── SHOPPING ─────────────────────────────────────────── */
.shop-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: all .15s; }
.shop-item:last-child { border-bottom: none; }
.shop-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.shop-item.done .shop-check { background: var(--success); border-color: var(--success); }
.shop-check-in { width: 7px; height: 4px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) translateY(-1px); display: none; }
.shop-item.done .shop-check-in { display: block; }
.shop-name { font-size: 13px; color: var(--text-1); font-weight: 500; flex: 1; }
.shop-item.done .shop-name { text-decoration: line-through; color: var(--text-3); }
.shop-done-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; background: var(--success-soft); border: none; color: var(--success); font-size: 12px; font-weight: 700; margin-top: 10px; transition: all .2s; }
.shop-done-btn:hover { background: var(--success); color: white; }
.shop-done-badge { background: var(--success); color: white; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.add-row { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border-light); }
.add-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: none; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 300; transition: all .2s; flex-shrink: 0; }
.add-btn:hover { background: var(--accent); color: white; }
.add-input { background: var(--bg-inset); border: 1.5px solid var(--border); border-radius: var(--radius-xs); color: var(--text-1); font-size: 13px; padding: 6px 12px; flex: 1; outline: none; display: none; }
.add-input:focus { border-color: var(--accent); }
.add-hint { font-size: 12px; color: var(--text-3); }

/* ── DAILY TEXT ───────────────────────────────────────── */
.daily-verse { font-size: 15px; line-height: 1.8; color: var(--text-2); font-style: italic; font-weight: 400; flex: 1; overflow-y: auto; }
.daily-ref { font-size: 12px; color: var(--accent); margin-top: 10px; font-weight: 700; }
.daily-comment { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.7; overflow-y: auto; }
.play-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 20px; background: var(--accent-soft); border: none; color: var(--accent); font-size: 12px; font-weight: 700; margin-top: 12px; transition: all .2s; }
.play-btn:hover { background: var(--accent); color: white; }
.play-btn.playing { background: var(--danger-soft); color: var(--danger); }

/* ── FINANCE ──────────────────────────────────────────── */
.fin-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.fin-period-nav { display: flex; align-items: center; gap: 8px; }
.fin-period-btn { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-inset); border: 1px solid var(--border); color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.fin-period-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.fin-period-label { font-size: 15px; font-weight: 700; color: var(--text-1); min-width: 140px; text-align: center; }
.fin-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fin-filter { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border); background: var(--bg-inset); color: var(--text-2); transition: all .2s; }
.fin-filter.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.fin-transaction { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-inset); margin-bottom: 6px; transition: all .15s; border: 1px solid transparent; cursor: pointer; }
.fin-transaction:hover { border-color: var(--border); background: var(--bg-card); box-shadow: var(--shadow); }
.fin-tx-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fin-tx-info { flex: 1; min-width: 0; }
.fin-tx-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.fin-tx-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.fin-tx-amount { font-size: 15px; font-weight: 800; flex-shrink: 0; }
.fin-tx-amount.income { color: var(--success); }
.fin-tx-amount.expense { color: var(--text-1); }
.fin-chart-wrap { position: relative; height: 180px; }
.fin-category-list { display: flex; flex-direction: column; gap: 8px; }
.fin-cat-item { display: flex; align-items: center; gap: 10px; }
.fin-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fin-cat-bar-wrap { flex: 1; background: var(--bg-inset); border-radius: 4px; height: 6px; overflow: hidden; }
.fin-cat-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }
.fin-cat-label { font-size: 11px; color: var(--text-2); white-space: nowrap; width: 90px; font-weight: 600; }
.fin-cat-amount { font-size: 11px; color: var(--text-1); font-weight: 700; width: 60px; text-align: right; }

/* ── EMERGENCY ────────────────────────────────────────── */
.emerg-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.emerg-tab { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: none; background: var(--bg-inset); color: var(--text-2); transition: all .2s; }
.emerg-tab.active { background: var(--danger); color: white; }
.emerg-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-inset); margin-bottom: 6px; border: 1px solid transparent; transition: all .15s; }
.emerg-item:hover { border-color: var(--border); background: var(--bg-card); }
.emerg-item-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-card); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-2); border: 1px solid var(--border); }
.emerg-info { flex: 1; min-width: 0; }
.emerg-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.emerg-detail { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── OVERLAYS ─────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(8px); }
.overlay.open { display: flex; }
@keyframes popIn { from { opacity:0; transform:scale(.92) translateY(12px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal { background: var(--bg-card); border-radius: 20px; width: 100%; max-width: 460px; max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); animation: popIn .25s ease; }
.modal-lg { max-width: 720px; }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 20px 22px 0; flex-shrink: 0; }
.modal-title { font-size: 17px; font-weight: 800; color: var(--text-1); flex: 1; letter-spacing: -0.3px; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-inset); border: none; color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 0 22px 20px; flex-shrink: 0; }

/* ── SETTINGS PANEL ───────────────────────────────────── */
.settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; display: none; align-items: flex-end; backdrop-filter: blur(6px); }
.settings-overlay.open { display: flex; }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
.settings-panel { background: var(--bg-card); border-radius: 24px 24px 0 0; width: 100%; max-height: 88dvh; display: flex; flex-direction: column; animation: slideUp .3s ease; box-shadow: 0 -8px 40px rgba(0,0,0,0.2); }
.settings-handle { width: 40px; height: 4px; background: var(--text-3); border-radius: 2px; margin: 14px auto 0; flex-shrink: 0; opacity: .5; cursor: pointer; }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 0; flex-shrink: 0; }
.settings-title { font-size: 20px; font-weight: 800; color: var(--text-1); }
.settings-tabs { display: flex; gap: 6px; padding: 14px 22px 0; overflow-x: auto; flex-shrink: 0; }
.stab { padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; border: none; background: var(--bg-inset); color: var(--text-2); white-space: nowrap; transition: all .2s; }
.stab.active { background: var(--accent); color: white; }
.settings-body { flex: 1; overflow-y: auto; padding: 16px 22px 32px; }
.stab-pane { display: none; }
.stab-pane.active { display: block; }
.set-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-inset); border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid transparent; transition: all .15s; }
.set-item:hover { border-color: var(--border); background: var(--bg-card); }
.set-icon { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.set-info { flex: 1; min-width: 0; }
.set-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.set-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.set-del { width: 28px; height: 28px; border-radius: 50%; background: var(--danger-soft); border: none; color: var(--danger); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.set-del:hover { background: var(--danger); color: white; }
.add-form { background: var(--bg-inset); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; }
.add-form-title { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.add-form-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.add-form-label { font-size: 11px; color: var(--text-3); width: 60px; flex-shrink: 0; font-weight: 600; }
.add-form-input { flex: 1; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-xs); color: var(--text-1); font-size: 13px; padding: 7px 12px; outline: none; }
.add-form-input:focus { border-color: var(--accent); }
.add-form-btn { background: var(--accent); color: white; border: none; border-radius: var(--radius-xs); padding: 10px 18px; font-size: 13px; font-weight: 700; width: 100%; margin-top: 4px; transition: opacity .2s; }
.add-form-btn:hover { opacity: .88; }
.day-picker { display: flex; gap: 5px; flex-wrap: wrap; }
.day-btn { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-3); font-size: 10px; font-weight: 700; transition: all .2s; }
.day-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.danger-btn { background: var(--danger-soft); border: 1px solid rgba(239,68,68,.15); border-radius: var(--radius-sm); padding: 12px 16px; color: var(--danger); font-size: 13px; font-weight: 600; width: 100%; margin-bottom: 8px; text-align: left; transition: all .2s; }
.danger-btn:hover { background: var(--danger); color: white; }
.ssection { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin: 16px 0 10px; }
.profile-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; background: var(--bg-inset); border-radius: var(--radius-sm); margin-bottom: 16px; }
.profile-pic { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--text-3); overflow: hidden; }
.profile-upload { padding: 7px 16px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); border: none; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* ── EDIT MODE ────────────────────────────────────────── */
.edit-mode-active .editable-card { border: 2px dashed rgba(79,110,247,0.35); cursor: grab; }
.editable-card.dragging { opacity: .4; }
.editable-card.drag-over { border-color: var(--accent) !important; background: var(--accent-soft); }
.drag-handle { display: none; color: var(--text-3); margin-right: 6px; }
.edit-mode-active .drag-handle { display: inline-flex; }
.resize-btns { display: none; gap: 3px; }
.edit-mode-active .resize-btns { display: flex; }
.resize-btn { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--bg-inset); color: var(--text-3); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.resize-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.edit-toggle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all .2s; }
.edit-toggle.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── SHOP DONE POPUP ──────────────────────────────────── */
.sdone-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.sdone-item:last-child { border-bottom: none; }
.sdone-cb { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.sdone-cb.checked { background: var(--danger); border-color: var(--danger); }
.sdone-cb-in { width: 7px; height: 4px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) translateY(-1px); display: none; }
.sdone-cb.checked .sdone-cb-in { display: block; }

/* ── NOTIF ────────────────────────────────────────────── */
.notif-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-right: 8px; animation: blink 2.5s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── FOOTER BAR ───────────────────────────────────────── */
.bottom-bar { display: none; }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --header-h: 56px; }
  .app { grid-template-columns: 1fr; grid-template-rows: var(--header-h) 1fr auto; }
  .sidebar { display: none; }
  .header-nav { display: none; }
  .header-logo { width: auto; }
  .bottom-bar { display: flex; grid-row: 3; background: var(--bg-header); border-top: 1px solid var(--border); padding: 8px 20px; gap: 0; justify-content: space-around; }
  .bottom-bar-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; border-radius: var(--radius-xs); border: none; background: none; color: var(--text-3); font-size: 10px; font-weight: 600; transition: all .2s; }
  .bottom-bar-btn.active { color: var(--accent); }
  .g-3 { grid-template-columns: 1fr; }
  .g-2 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-1-2, .g-2-1, .g-3-2 { grid-template-columns: 1fr; }
  .page { padding: 14px 16px; }
  .circles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) and (max-width: 1100px) {
  :root { --sidebar-w: 60px; }
  .sidebar-btn span:not(.sb-icon):not(.sidebar-badge) { display: none; }
  .sidebar-section { display: none; }
  .sidebar-btn { justify-content: center; }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .circles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 4px; }

.loading { color: var(--text-3); font-size: 12px; font-weight: 500; padding: 8px 0; }

/* ══ DASHBOARD LAYOUT (no sidebar) ══════════════════════ */
.app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: 1fr;
  height: 100dvh;
}
.sidebar { display: none !important; }

.main { overflow: hidden; display: flex; flex-direction: column; }
.page { display: none; padding: 16px 20px; flex-direction: column; height: calc(100dvh - var(--header-h)); overflow-y: auto; }
.page.active { display: flex; }

/* Dashboard 2-column grid */
.dash-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.dash-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}
.dash-left::-webkit-scrollbar { width: 3px; }
.dash-left::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 2px; }
.dash-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

/* Top card: clock + weather + daily text side by side */
.dash-top-card { flex-shrink: 0; }
.dash-top-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.dash-clock-section {
  flex-shrink: 0;
  min-width: 140px;
}
.dash-clock {
  font-size: 52px;
  font-weight: 200;
  letter-spacing: -3px;
  color: var(--text-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 500;
}
.dash-daily-text {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.dash-daily-text .daily-verse { font-size: 13px; }
.dash-daily-text .daily-comment { max-height: 50px; overflow: hidden; }

/* Calendar card - takes remaining height */
.dash-cal-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Next event - big display */
.next-event-big {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: white;
  position: relative;
  overflow: hidden;
}
.next-event-big::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.next-event-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .7;
  margin-bottom: 6px;
}
.next-event-time {
  font-size: 13px;
  font-weight: 700;
  opacity: .85;
  margin-bottom: 4px;
}
.next-event-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 4px;
}
.next-event-sub {
  font-size: 11px;
  opacity: .7;
}
.no-events-today {
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
  .dash-right { overflow: visible; }
  .dash-cal-card { min-height: 300px; }
  .dash-top-inner { flex-direction: column; gap: 14px; }
  .dash-daily-text { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 14px; }
  .dash-clock { font-size: 40px; }
}
@media (max-width: 640px) {
  .dash-grid { gap: 12px; }
  .page { padding: 12px 14px; }
}