/* =====================================================================
   University Success Tracker - design system
   Concept: a student's desk. Deep-ink teal chrome, quiet paper surfaces,
   and ONE memorable object: the ruled notebook page with a highlighter,
   used wherever the student writes what they learned.
   ===================================================================== */
:root {
  --ink: #0f2a2e;
  --ink-soft: #4b6166;
  --paper: #f3f5f2;
  --card: #ffffff;
  --line: #dbe2df;
  --brand: #0f3d3e;
  --brand-2: #1f7a6d;
  --brand-soft: #e2f0ec;
  --highlight: #ffe066;
  --danger: #c8442f;   --danger-soft: #fbe9e5;
  --warning: #a86a0c;  --warning-soft: #fdf1d8;
  --success: #23794f;  --success-soft: #dff2e7;
  --info: #26649b;     --info-soft: #e0edf8;
  --neutral: #55686d;  --neutral-soft: #e8eeec;
  --radius: 14px;
  --sidebar-w: 252px;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --bottom-nav-h: 64px;
}
[data-theme="dark"] {
  --ink: #e6efed;
  --ink-soft: #9cb1b5;
  --paper: #0d1719;
  --card: #142124;
  --line: #263a3d;
  --brand: #08282a;
  --brand-2: #45b6a3;
  --brand-soft: #173a37;
  --danger-soft: #3b1f1a; --warning-soft: #372a10; --success-soft: #143a27; --info-soft: #14304a; --neutral-soft: #1f2f32;
  --danger: #ff8a75; --warning: #f0b45a; --success: #57c98d; --info: #7fb8ee; --neutral: #9cb1b5;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); font-size: 1rem; line-height: 1.55; margin: 0; }
h1, h2, h3, h4, .display { font-family: var(--font-head); letter-spacing: -0.01em; color: var(--ink); }
a { color: var(--brand-2); }
.text-muted { color: var(--ink-soft) !important; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--highlight); color: #000; padding: .5rem 1rem; z-index: 999; }
.skip-link:focus { left: .5rem; top: .5rem; }
.req { color: var(--danger); }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--brand); color: #d5e6e2; padding: 1.1rem .8rem; display: none; flex-direction: column; overflow-y: auto; z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; padding: .2rem .5rem 1.1rem; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--highlight); color: #0f3d3e; font-size: 1.15rem; flex: none; }
.brand-mark.sm { width: 34px; height: 34px; font-size: 1rem; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.nav-group { margin-bottom: 1rem; }
.nav-group-title { font-size: .78rem; font-weight: 600; color: #8fb3ad; padding: 0 .6rem .3rem; letter-spacing: .02em; }
.nav-link-x { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: #d5e6e2; text-decoration: none; font-weight: 500; background: none; border: 0; }
.nav-link-x i { font-size: 1.08rem; width: 1.3rem; text-align: center; opacity: .9; }
.nav-link-x:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link-x.active { background: rgba(255,224,102,.16); color: #fff; box-shadow: inset 3px 0 0 var(--highlight); }
.sidebar-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(255,255,255,.1); }

.main-col { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; padding-top: calc(.65rem + env(safe-area-inset-top)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-search { flex: 1; max-width: 460px; position: relative; }
.topbar-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.topbar-search input { width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: .5rem 1rem .5rem 2.4rem; font-size: .95rem; }
.topbar-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--ink); font-size: 1.15rem; text-decoration: none; }
.icon-btn:hover { background: var(--neutral-soft); color: var(--ink); }
.dot-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-2); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-family: var(--font-head); }
.content { padding: 1.25rem 1rem calc(var(--bottom-nav-h) + 6.5rem); max-width: 1240px; margin: 0 auto; }
.content-narrow { max-width: 860px; }
body:not(.area-student) .content { padding-bottom: 3rem; }

@media (min-width: 992px) {
  .sidebar { display: flex; }
  .main-col { margin-left: var(--sidebar-w); }
  .content { padding: 1.75rem 2rem 4rem; }
  .bottom-nav { display: none !important; }
  .topbar { padding-inline: 2rem; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: clamp(1.55rem, 4.5vw, 2.15rem); font-weight: 700; margin: 0; }
.page-sub { margin: .15rem 0 0; color: var(--ink-soft); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn { border-radius: 11px; font-weight: 600; padding: .55rem 1.05rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-brand { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .btn-brand { color: #06201d; }
[data-theme="dark"] .btn-brand:hover { background: #6fd0bf; border-color: #6fd0bf; color: #06201d; }
.btn-soft { background: var(--brand-soft); color: var(--brand-2); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand-2); color: #fff; }
.btn-outline-ink { border: 1px solid var(--line); color: var(--ink); background: var(--card); }
.btn-outline-ink:hover { border-color: var(--brand-2); color: var(--brand-2); }
.btn-sm { padding: .3rem .7rem; border-radius: 9px; }

/* ---------- Surfaces ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; margin-bottom: 1.1rem; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-family: var(--font-head); font-size: 1.12rem; font-weight: 650; margin: 0 0 .8rem; }
.panel-title small { font-family: var(--font-body); font-weight: 500; color: var(--ink-soft); font-size: .85rem; }
.panel.flat { border-style: dashed; background: transparent; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; height: 100%; display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--brand-2); color: var(--ink); }
.stat .label { font-size: .86rem; color: var(--ink-soft); display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.stat .value { font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat .sub { font-size: .84rem; color: var(--ink-soft); }
.stat-accent { border-left: 4px solid var(--stat, var(--brand-2)); }

/* ---------- Tones / badges ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger  { background: var(--danger-soft);  color: var(--danger); }
.tone-info    { background: var(--info-soft);    color: var(--info); }
.tone-neutral { background: var(--neutral-soft); color: var(--neutral); }
.tone-brand   { background: var(--brand-soft);   color: var(--brand-2); }
.progress-slim { height: 8px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; margin-top: .4rem; }
.progress-slim .bar { height: 100%; border-radius: 99px; transition: width .5s ease; }
.progress-slim .bar.tone-success { background: var(--success); } .progress-slim .bar.tone-warning { background: #e0a038; }
.progress-slim .bar.tone-danger { background: var(--danger); } .progress-slim .bar.tone-info { background: var(--info); }
.progress-slim .bar.tone-brand, .progress-slim .bar.tone-neutral { background: var(--brand-2); }

/* ---------- Subject chips ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.chip-face { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .95rem; transition: all .15s; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chip, #94a3b8); display: inline-block; flex: none; }
.chip input:checked + .chip-face { background: var(--chip); border-color: var(--chip); color: #fff; }
.chip input:checked + .chip-face .chip-dot { background: #fff; }
.chip input:focus-visible + .chip-face { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.subject-tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; padding: .12rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--chip) 15%, transparent); color: color-mix(in srgb, var(--chip) 75%, var(--ink)); white-space: nowrap; }

/* ---------- Segmented / rating ---------- */
.segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); max-width: 100%; flex-wrap: wrap; }
.seg { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: .55rem 1rem; min-height: 44px; line-height: 1.7; font-weight: 600; font-size: .93rem; border-right: 1px solid var(--line); }
.seg:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand-2); color: #fff; }
.seg-attended input:checked + span, .seg-1 input:checked + span { background: var(--success); }
.seg-late input:checked + span { background: #d08a1a; }
.seg-missed input:checked + span, .seg-0 input:checked + span { background: var(--danger); }
.seg input:focus-visible + span { outline: 3px solid var(--brand-2); outline-offset: -3px; }
.seg-yn .seg span { min-width: 4.4rem; text-align: center; }
.rating { display: inline-flex; flex-wrap: wrap; gap: .35rem; max-width: 100%; }
.rating label { margin: 0; position: relative; }
.rating input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rating span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; background: var(--card); }
.rating input:checked + span { background: var(--highlight); border-color: #d9b800; color: #2b2400; }
.rating input:focus-visible + span { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 11px; border: 1.5px solid var(--line); background-color: var(--card); color: var(--ink); padding: .62rem .85rem; min-height: 46px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 25%, transparent); background-color: var(--card); color: var(--ink); }
.form-control::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); }
.form-control-color { padding: .3rem; width: 100%; }
.form-text { color: var(--ink-soft); }
.form-section { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section > h3 { font-size: 1.05rem; font-weight: 650; margin-bottom: .8rem; }
.savebar { position: sticky; bottom: calc(var(--bottom-nav-h) + .6rem); z-index: 15; display: flex; gap: .6rem; justify-content: flex-end; align-items: center; padding: .7rem .9rem; margin-top: 1.2rem; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(15,42,46,.12); }
@media (min-width: 992px) { .savebar { bottom: 1rem; } }
.savebar .msg { margin-right: auto; color: var(--ink-soft); font-size: .9rem; }

/* ---------- The notebook (centrepiece) ---------- */
.notebook { position: relative; background:
    linear-gradient(90deg, transparent 2.6rem, #e9a29a 2.6rem, #e9a29a calc(2.6rem + 2px), transparent calc(2.6rem + 2px)),
    repeating-linear-gradient(transparent 0, transparent 31px, #cfe0e6 31px, #cfe0e6 32px), #fffef8;
  border: 1px solid #d9d4bd; border-radius: 6px 16px 16px 6px; padding: 1.2rem 1.2rem 1.4rem 3.5rem; margin-bottom: 1.1rem; box-shadow: 0 1px 0 #fff inset, 0 10px 24px rgba(60,50,10,.08); color: #1e2a2c; }
[data-theme="dark"] .notebook { background:
    linear-gradient(90deg, transparent 2.6rem, #7a3d38 2.6rem, #7a3d38 calc(2.6rem + 2px), transparent calc(2.6rem + 2px)),
    repeating-linear-gradient(transparent 0, transparent 31px, #24393c 31px, #24393c 32px), #172629; border-color: #2b4245; color: #e6efed; box-shadow: none; }
.notebook::before { content: ""; position: absolute; left: .85rem; top: 1.6rem; bottom: 1.6rem; width: 12px; background: radial-gradient(circle at 6px 6px, #9aa9a4 0 4px, transparent 5px) 0 0 / 12px 44px repeat-y; opacity: .55; }
.notebook h2 { font-size: 1.45rem; font-weight: 700; margin: 0 0 .15rem; color: inherit; }
.notebook h2 mark { background: linear-gradient(transparent 55%, var(--highlight) 55%); color: inherit; padding: 0 .15em; }
[data-theme="dark"] .notebook h2 mark { background: linear-gradient(transparent 55%, rgba(255,224,102,.35) 55%); }
.notebook .hint { color: #5f6f72; margin-bottom: .9rem; }
[data-theme="dark"] .notebook .hint { color: #9cb1b5; }
.notebook label.form-label { font-family: var(--font-head); font-size: 1rem; }
.notebook .form-control { background: transparent; border: 0; border-bottom: 1.5px dashed #b9c9cf; border-radius: 0; padding-inline: 0; line-height: 32px; min-height: 0; font-size: 1.02rem; }
.notebook .form-control:focus { box-shadow: none; background: rgba(255,224,102,.16); border-bottom-color: var(--brand-2); }
.notebook textarea.form-control { background-image: none; }

.learning-card { border: 1px solid var(--line); background: var(--card); border-left: 5px solid var(--chip, var(--brand-2)); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .8rem; }
.learning-card .topic { font-family: var(--font-head); font-weight: 650; font-size: 1.08rem; }
.learning-card .kv { margin-top: .5rem; font-size: .95rem; }
.learning-card .kv b { color: var(--ink-soft); font-weight: 600; font-size: .82rem; display: block; }
mark.hit { background: var(--highlight); color: #241e00; padding: 0 .1em; border-radius: 3px; }

/* ---------- Lists / rows ---------- */
.row-item { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 600; overflow-wrap: anywhere; }
.row-item .meta { font-size: .85rem; color: var(--ink-soft); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-item.done .title { text-decoration: line-through; color: var(--ink-soft); }
.check-toggle { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: inline-grid; place-items: center; color: transparent; flex: none; cursor: pointer; padding: 0; }
.check-toggle:hover { border-color: var(--success); }
.check-toggle.on { background: var(--success); border-color: var(--success); color: #fff; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); }
.table thead th { font-size: .82rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: var(--radius); }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--ink-soft); }
.empty-state i { font-size: 2.3rem; color: var(--brand-2); opacity: .8; }
.empty-state h3 { font-size: 1.15rem; margin: .5rem 0 .2rem; }
.empty-state p { max-width: 34rem; margin: 0 auto .8rem; }

/* ---------- Dashboard ---------- */
.hello { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.2rem; }
.hello h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 700; margin: 0; }
.hello .quote { color: var(--ink-soft); margin: .2rem 0 0; }
.streak { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-weight: 700; }
.score-ring { --p: 0; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring, var(--brand-2)) calc(var(--p) * 1%), var(--neutral-soft) 0); position: relative; flex: none; }
.score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.score-ring span { position: relative; font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; }
.score-break .score-row { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.score-break .score-row.muted { opacity: .6; }
.score-note { font-size: .86rem; color: var(--ink-soft); margin: .8rem 0 0; }
.insight { display: flex; gap: .7rem; padding: .65rem .8rem; border-radius: 12px; margin-bottom: .5rem; text-decoration: none; color: var(--ink); align-items: flex-start; }
.insight i { margin-top: .15rem; }
.insight.tone-success i { color: var(--success); } .insight.tone-warning i { color: var(--warning); } .insight.tone-danger i { color: var(--danger); } .insight.tone-info i { color: var(--info); }
a.insight:hover { color: var(--ink); filter: brightness(.97); }
.tone-success.insight, .tone-warning.insight, .tone-danger.insight, .tone-info.insight { color: var(--ink); }
.chart-box { position: relative; width: 100%; }
.att-card { border: 1px solid var(--line); border-left: 6px solid var(--chip); border-radius: 12px; padding: .9rem 1rem; background: var(--card); height: 100%; }
.att-card .pct { font-family: var(--font-head); font-size: 2rem; font-weight: 700; line-height: 1; }
.att-card.risk { border-color: var(--danger); border-left-color: var(--danger); background: var(--danger-soft); }
.att-card.close { border-left-color: #e0a038; }

/* ---------- Habit / calendar grids ---------- */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .h { aspect-ratio: 1; border-radius: 8px; background: var(--neutral-soft); display: grid; place-items: center; font-size: .78rem; color: var(--ink-soft); position: relative; }
.heat .h.l1 { background: color-mix(in srgb, var(--brand-2) 30%, var(--card)); color: var(--ink); }
.heat .h.l2 { background: color-mix(in srgb, var(--brand-2) 60%, var(--card)); color: #fff; }
.heat .h.l3 { background: var(--brand-2); color: #fff; }
.heat .h.today { outline: 2px solid var(--highlight); outline-offset: 1px; }
.heat .h.out { visibility: hidden; }
.heat-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; font-size: .75rem; text-align: center; color: var(--ink-soft); margin-bottom: 4px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cal .dow { padding: .45rem; text-align: center; font-weight: 600; font-size: .8rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: var(--neutral-soft); }
.cal .day { min-height: 92px; padding: .3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .78rem; overflow: hidden; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: color-mix(in srgb, var(--neutral-soft) 60%, transparent); opacity: .6; }
.cal .day.today .num { background: var(--highlight); color: #241e00; }
.cal .num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; font-weight: 700; margin-bottom: 2px; }
.ev { display: block; padding: 1px 6px; border-radius: 6px; margin-bottom: 2px; background: color-mix(in srgb, var(--chip, #64748b) 16%, transparent); border-left: 3px solid var(--chip, #64748b); color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.exam { background: var(--danger-soft); border-left-color: var(--danger); }
.ev.hw { border-left-style: dashed; }
@media (max-width: 767px) {
  .cal .day { min-height: 64px; padding: .15rem; font-size: .68rem; }
  .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; display: inline-block; width: 6px; margin: 1px; }
}

.habit-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.habit-row:last-child { border-bottom: 0; }

/* ---------- FAB + bottom nav ---------- */
.fab-wrap { position: fixed; right: 1rem; bottom: calc(var(--bottom-nav-h) + .9rem + env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
@media (min-width: 992px) { .fab-wrap { bottom: 1.5rem; right: 2rem; } }
.fab { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--highlight); color: #1d2a00; font-size: 1.6rem; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.25); transition: transform .2s; }
.fab[aria-expanded="true"] { transform: rotate(45deg); }
.fab-menu { display: flex; flex-direction: column; gap: .45rem; align-items: flex-end; }
.fab-menu[hidden] { display: none; }
.fab-item { display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); text-decoration: none; color: var(--ink); font-weight: 600; }
.fab-item i { color: var(--brand-2); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink-soft); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottom-nav a i { font-size: 1.35rem; line-height: 1; }
.bottom-nav a.active { color: var(--brand-2); }

.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 640px) { .more-grid { grid-template-columns: repeat(3, 1fr); } }
.more-tile { display: flex; align-items: center; gap: .7rem; padding: 1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; min-height: 64px; }
.more-tile i { font-size: 1.35rem; color: var(--brand-2); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 500px at 15% -10%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent), var(--paper); }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 2rem 1.6rem; box-shadow: 0 20px 50px rgba(15,42,46,.1); }
.auth-card h1 { font-size: 1.7rem; margin: .8rem 0 .2rem; }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .fab-wrap, .savebar, .page-actions, .no-print, .alert { display: none !important; }
  .main-col { margin: 0 !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; max-width: none; }
  .panel, .stat { break-inside: avoid; border-color: #bbb; }
  a { color: inherit; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
