/* ── CSS Custom Properties ── */
:root {
  --accent:         #533AB7;
  --accent-subtle:  #EEEDFE;
  --accent-muted:   #AFA9EC;
  --accent-dark:    #26215C;

  --surface:        #ffffff;
  --surface-hover:  #F1EFE8;
  --bg:             #F8F7F3;

  --border:         rgba(0,0,0,0.10);
  --border-strong:  rgba(0,0,0,0.18);

  --text-primary:   #1a1a1a;
  --text-secondary: #5F5E5A;
  --text-tertiary:  #888780;

  --success:        #1D9E75;
  --success-subtle: #E1F5EE;
  --warning:        #BA7517;
  --warning-subtle: #FAEEDA;
  --danger:         #A32D2D;
  --danger-subtle:  #FCEBEB;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface:        #1e1e1e;
    --surface-hover:  #2a2a2a;
    --bg:             #161616;
    --border:         rgba(255,255,255,0.10);
    --border-strong:  rgba(255,255,255,0.18);
    --text-primary:   #f0f0f0;
    --text-secondary: #aaa;
    --text-tertiary:  #777;
    --accent-subtle:  #26215C;
    --accent-muted:   #3C3489;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       font-size: 14px; background: var(--bg); color: var(--text-primary); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ── Layout ── */
#app { display: flex; height: 100vh; overflow: hidden; }

#left-nav {
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

#main-content {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}

.topbar {
  flex-shrink: 0; height: 52px;
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-content { flex: 1; overflow-y: auto; padding: 20px; }

#right-panel {
  width: 260px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 12px;
}

/* ── Nav ── */
.nav-brand { padding: 16px 14px 12px; border-bottom: 1px solid var(--border); }
.nav-brand-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.nav-brand-year { font-size: 11px; color: var(--text-tertiary); }

.nav-section { padding: 10px 8px 4px; }
.nav-section-label { font-size: 10px; font-weight: 600; color: var(--text-tertiary);
                     text-transform: uppercase; letter-spacing: 0.06em; padding: 0 6px; margin-bottom: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; user-select: none;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); font-weight: 500; }
.nav-item i { font-size: 16px; }

.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.nav-cat-item .cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.nav-footer { margin-top: auto; padding: 8px; border-top: 1px solid var(--border); }
.nav-user-info { display: flex; align-items: center; gap: 6px; padding: 6px 8px;
                 font-size: 12px; color: var(--text-secondary); }

/* ── Right Panel ── */
.rp-section { margin-bottom: 16px; }
.rp-title { font-size: 11px; font-weight: 600; color: var(--text-tertiary);
            text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }

.rp-cal-header { display: flex; align-items: center; justify-content: space-between;
                 margin-bottom: 6px; }
.rp-cal-header span { font-size: 12px; font-weight: 500; }
.rp-cal-header button { background: none; border: none; cursor: pointer;
                         color: var(--text-secondary); font-size: 14px; padding: 2px; }

.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-cal-header { font-size: 9px; font-weight: 600; color: var(--text-tertiary);
                   text-align: center; padding: 2px 0; }
.mini-cal-day { font-size: 10px; text-align: center; padding: 3px 1px;
                border-radius: 50%; cursor: pointer; color: var(--text-secondary); }
.mini-cal-day:hover { background: var(--surface-hover); }
.mini-cal-day.today { background: var(--accent); color: #fff; font-weight: 600; }
.mini-cal-day.has-task { border-bottom: 2px solid var(--accent-muted); }
.mini-cal-day.selected { background: var(--accent-subtle); color: var(--accent); }
.mini-cal-day.other-month { color: var(--text-tertiary); }

.deadline-item { margin-bottom: 8px; }
.deadline-item-clickable { cursor: pointer; padding: 4px 6px; margin: 0 -6px 4px; border-radius: var(--radius-sm); }
.deadline-item-clickable:hover { background: var(--surface-hover); }
.deadline-name { font-size: 12px; font-weight: 500; color: var(--text-primary);
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.deadline-days { font-size: 11px; color: var(--text-tertiary); }
.deadline-days.overdue { color: var(--danger); }
.deadline-days.due-soon { color: var(--warning); }

.cat-legend-row { display: flex; align-items: center; gap: 6px;
                  font-size: 12px; margin-bottom: 6px; color: var(--text-secondary); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ── Topbar ── */
.topbar-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.topbar-title i { font-size: 18px; color: var(--accent); }
.topbar-spacer { flex: 1; }
.topbar-meta { font-size: 12px; color: var(--text-tertiary); }

/* ── Buttons ── */
.btn-primary { background: var(--accent); color: #fff; border: none;
               padding: 7px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.btn-primary:hover { opacity: 0.88; }

.btn-secondary { background: transparent; color: var(--text-secondary);
                 border: 1px solid var(--border-strong);
                 padding: 7px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: var(--surface-hover); }

.btn-danger { background: var(--danger); color: #fff; border: none;
              padding: 7px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }

.icon-btn { background: none; border: none; padding: 4px 6px;
            border-radius: var(--radius-sm); color: var(--text-tertiary);
            cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.icon-btn.danger:hover { color: var(--danger); }

/* ── Pills / Badges ── */
.pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500;
        padding: 2px 8px; border-radius: 10px; }

.pill-yearly  { background: #EEEDFE; color: #3C3489; }
.pill-monthly { background: #E1F5EE; color: #085041; }

.pill-status-active   { background: #E1F5EE; color: #085041; }
.pill-status-complete { background: #EAF3DE; color: #27500A; }
.pill-status-archived { background: #F1EFE8; color: #5F5E5A; }

.status-badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; }
.status-badge.not-started { background: #F1EFE8; color: #5F5E5A; }
.status-badge.in-progress { background: #FAEEDA; color: #854F0B; }
.status-badge.done        { background: #EAF3DE; color: #27500A; }

/* ── Progress Bars ── */
.progress-bar  { height: 6px; background: var(--surface-hover);
                 border-radius: 3px; overflow: hidden; }
.progress-bar.wide { flex: 1; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px;
                 transition: width 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

/* ── Cards ── */
.goal-detail-card, .assignment-card, .category-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 8px;
}
.goal-detail-card:hover, .assignment-card:hover { border-color: var(--border-strong); }

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius-md); padding: 14px 16px; }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ── Section Headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between;
                  margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 600; }
.section-link { font-size: 12px; color: var(--accent); cursor: pointer; }
.section-link:hover { text-decoration: underline; }

/* ── Goal Cards (Dashboard) ── */
.goal-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 6px;
  cursor: pointer;
}
.goal-card:hover { border-color: var(--border-strong); }
.goal-info { flex: 1; min-width: 0; }
.goal-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-cat { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.goal-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 100px; }
.goal-date { font-size: 11px; color: var(--text-tertiary); }
.progress-label { font-size: 11px; color: var(--text-secondary); }

/* ── Goal Detail Cards ── */
.gdc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gdc-title { font-size: 15px; font-weight: 600; flex: 1; }
.gdc-actions { display: flex; gap: 4px; margin-left: auto; }
.gdc-meta { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px;
            margin-bottom: 6px; flex-wrap: wrap; }
.gdc-description { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.gdc-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gdc-assignments { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-fields { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.goal-field  { display: flex; align-items: center; gap: 4px; font-size: 12px; }

/* ── View Modal ── */
.view-fields { display: flex; flex-direction: column; gap: 10px; }
.view-row { display: flex; align-items: baseline; gap: 12px; }
.view-row-block { align-items: flex-start; }
.view-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary);
              text-transform: uppercase; letter-spacing: 0.04em; min-width: 90px; flex-shrink: 0; }
.view-value { font-size: 13px; color: var(--text-primary); }
.view-title { font-weight: 600; font-size: 15px; }
.view-text  { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }

.asgn-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
             background: var(--surface-hover); border-radius: 20px; padding: 3px 10px;
             color: var(--text-secondary); cursor: pointer; }
.asgn-chip:hover { background: var(--accent-subtle); color: var(--accent); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.not-started { background: #888780; }
.status-dot.in-progress { background: #BA7517; }
.status-dot.done        { background: #1D9E75; }

/* ── Task Items (dashboard rows) ── */
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-check, .task-toggle {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--border-strong); border-radius: 50%; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 11px;
}
.task-check.done, .task-toggle.done {
  background: var(--success); border-color: var(--success); color: #fff;
}
.task-title { font-size: 13px; flex: 1; min-width: 0; }
.task-title.done { text-decoration: line-through; color: var(--text-tertiary); }
.task-title-bold { font-weight: 600; }

.cat-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px;
           background: var(--surface-hover); color: var(--text-secondary); white-space: nowrap; }
.asgn-tag { font-size: 11px; color: var(--accent); }
.task-body { flex: 1; min-width: 0; }
.task-asgn { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 4px; }
.task-actions { display: flex; gap: 2px; }

/* ── Task Items (full task list) ── */
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border); margin-bottom: 6px;
  background: var(--surface);
}
.task-item:last-child { margin-bottom: 0; }
.task-item.status-in-progress { background: var(--warning-subtle); border-color: rgba(186,117,23,0.25); }
.task-item.status-done        { background: var(--success-subtle); border-color: rgba(29,158,117,0.25); }
.task-item-body  { flex: 1; min-width: 0; }
.task-item-main  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.task-item-desc  { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.task-item-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.task-item-notes { font-size: 12px; color: var(--text-secondary); font-style: italic; margin-top: 4px; }
.task-item-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.task-item-fields { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.task-item-fields .ti-field-full { width: 100%; }
.ti-field { display: flex; align-items: center; gap: 4px; }
.ti-emoji { font-size: 12px; flex-shrink: 0; line-height: 1.4; }
.ti-text  { font-size: 12px; color: var(--text-secondary); }

/* ── Priority Badge ── */
.priority-badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.priority-badge.low    { background: #F1EFE8; color: #5F5E5A; }
.priority-badge.medium { background: #FAEEDA; color: #854F0B; }
.priority-badge.high   { background: #FCEBEB; color: #A32D2D; }

/* ── Done button ── */
.btn-done {
  background: var(--success); color: #fff; border: none;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn-done:hover { opacity: 0.85; }

/* ── Content Section Box ── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.content-section .section-header { margin-top: 0; }

/* ── Assignment Cards ── */
.ac-body { flex: 1; min-width: 0; }
.ac-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.ac-title { font-size: 13px; font-weight: 600; flex: 1; }
.ac-fields { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.ac-field { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.ac-field-full { width: 100%; align-items: flex-start; }
.ac-emoji { font-size: 12px; flex-shrink: 0; line-height: 1.4; }
.ac-text { font-size: 12px; color: var(--text-secondary); }
.ac-text-muted { font-style: italic; }
.ac-tasks-text { font-size: 11px; color: var(--text-secondary); }
.ac-notes { font-size: 12px; color: var(--text-secondary); font-style: italic; margin-bottom: 6px; }
.ac-tasks-summary { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.ac-actions { display: flex; gap: 4px; align-items: flex-start; }
.assignment-card { display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border); padding: 12px 0; }
.assignment-card:first-child { padding-top: 0; }
.assignment-card:last-child { border-bottom: none; padding-bottom: 0; }
.priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.priority-dot.low    { background: #888780; }
.priority-dot.medium { background: #BA7517; }
.priority-dot.high   { background: #A32D2D; }
.goal-chip { display: inline-flex; align-items: center; gap: 4px; }
.due-date { display: inline-flex; align-items: center; gap: 3px; }
.due-date.overdue { color: var(--danger); }
.due-date.due-soon { color: var(--warning); }
.mini-progress { height: 4px; width: 60px; background: var(--surface-hover); border-radius: 2px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--success); }

/* ── Category Cards ── */
.categories-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.category-card { display: flex; gap: 12px; align-items: center; }
.cc-swatch { width: 44px; height: 44px; border-radius: var(--radius-md);
             display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-body { flex: 1; min-width: 0; }
.cc-name { font-size: 13px; font-weight: 500; }
.cc-stats { font-size: 11px; color: var(--text-tertiary); }
.cc-actions { display: flex; gap: 4px; }

/* ── Forms ── */
input[type="text"], input[type="date"], input[type="password"],
input[type="email"], input[type="color"], input[type="number"], textarea, select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-size: 13px; background: var(--surface); color: var(--text-primary);
  font-family: inherit;
}
input[type="color"] { padding: 2px 4px; height: 34px; cursor: pointer; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 500;
                  color: var(--text-secondary); margin-bottom: 4px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea { resize: vertical; min-height: 60px; }

/* ── Colour Palette ── */
.color-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.color-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
                border: 2px solid transparent; }
.color-swatch.selected { border-color: var(--text-primary); }

/* ── Modal ── */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
#modal-overlay.hidden { display: none; }
#modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { flex: 1; font-size: 16px; font-weight: 600; }
#modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ── Tasks Summary ── */
.tasks-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 12px; color: var(--text-secondary); }
.tasks-summary .progress-bar { flex: 1; }

/* ── Filter Row ── */
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row select { width: auto; padding: 5px 10px; font-size: 12px; }

/* ── Date Nav ── */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav button { background: none; border: 1px solid var(--border-strong);
                   border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer;
                   color: var(--text-secondary); font-size: 13px; }
.date-nav button:hover { background: var(--surface-hover); }
.date-nav input[type="date"] { width: auto; font-size: 12px; padding: 4px 8px; }

/* ── Quick date buttons ── */
.quick-date-row { display: flex; gap: 6px; margin-bottom: 14px; }
.quick-date-btn { background: var(--surface-hover); border: none; border-radius: 20px;
                  padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.quick-date-btn:hover { background: var(--accent-subtle); color: var(--accent); }
.quick-date-btn.active { background: var(--accent); color: #fff; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-tertiary); }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { margin-bottom: 16px; }

/* ── Dropdown ── */
.dropdown-wrapper { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100; min-width: 160px; overflow: hidden;
}
.dropdown-menu.hidden { display: none; }
.dropdown-item { display: block; padding: 9px 14px; font-size: 13px;
                 color: var(--text-primary); cursor: pointer; }
.dropdown-item:hover { background: var(--surface-hover); }

/* ── Configure-dashboard modal checkboxes ── */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: background 0.12s;
}
.check-row:hover { background: var(--surface-hover); }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Bottom tabs ── */
#bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  justify-content: space-around; padding: 8px 0 env(safe-area-inset-bottom);
  z-index: 50;
}
#bottom-tabs a { display: flex; flex-direction: column; align-items: center;
                 gap: 2px; font-size: 10px; color: var(--text-secondary);
                 padding: 4px 8px; }
#bottom-tabs a.active { color: var(--accent); }
#bottom-tabs a i { font-size: 22px; }

/* ── Responsive ── */
@media (max-width: 1023px) {
  #right-panel { display: none; }
}

@media (max-width: 767px) {
  #left-nav { width: 48px; }
  #left-nav .nav-brand-name,
  #left-nav .nav-brand-year,
  #left-nav .nav-section-label,
  #left-nav span:not(.nav-badge),
  #left-nav .nav-user-info span { display: none; }
  #right-panel { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: 1fr; }
}

/* ── Settings Page ── */
.settings-tabs-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: -20px -20px 20px;
  padding: 0 20px;
  background: var(--surface);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.settings-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.settings-tab-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

@media (max-width: 479px) {
  #left-nav  { display: none; }
  #bottom-tabs { display: flex; }
  #main-content { padding-bottom: 60px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Icon Palette ── */
.icon-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color 0.15s;
  user-select: none;
}
.icon-tile:hover { border-color: var(--accent-muted); }
.icon-tile.selected { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.icon-tile i { font-size: 18px; }
