/* =============================================================
   YBE Imprint — design system (amber)
   Light canvas, white rounded cards, near-black ink, amber accent.
   ============================================================= */
:root {
    --canvas: #f3efe7;
    --canvas-2: #f9f6f0;
    --surface: #ffffff;
    --line: #ebe5d9;
    --line-2: #ded6c7;
    --ink: #1a1712;
    --ink-2: #3a342b;
    --muted: #7d7466;
    --muted-2: #ada393;

    --accent: #b8862b;
    --accent-2: #d9b25a;
    --accent-ink: #8a6420;          /* readable amber for small text on white */
    --tint: #faf3e3;
    --tint-2: #efe2c2;
    --grad: linear-gradient(135deg, #b8862b 0%, #d9b25a 100%);
            --text-grad: linear-gradient(135deg, #8a6420 0%, #b08a3c 100%);
    --grad-soft: linear-gradient(180deg, rgba(184,134,43,.18) 0%, rgba(217,178,90,0) 100%);

    --success: #1fa463;  --success-bg: #e8f7ef;
    --danger: #e5484d;   --danger-bg: #fdecec;
    --info: #3b6fd8;     --info-bg: #ecf2fd;

    --r-xl: 24px; --r-lg: 20px; --r: 14px; --r-sm: 10px; --pill: 999px;
    --shadow: 0 1px 2px rgba(26,23,18,.04), 0 8px 24px -12px rgba(26,23,18,.10);
    --shadow-lg: 0 2px 4px rgba(26,23,18,.04), 0 24px 48px -20px rgba(26,23,18,.18);
    --display: 'Instrument Serif', Georgia, serif;
    --sans: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;

    /* Legacy aliases so older inline styles keep working */
    --ivory: var(--canvas-2); --paper: var(--surface); --cream: var(--canvas);
    --navy: var(--ink); --navy-2: var(--ink-2); --gold: var(--accent); --gold-soft: var(--accent-2);
    --gold-tint: rgba(184,134,43,.12); --serif: var(--sans); --radius: var(--r);
    --green: var(--success); --red: var(--danger);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--canvas); color: var(--ink); font-family: var(--sans);
    font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
    min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--ink); }
img, svg { display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
em.gold, .hl { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: 1.08em; line-height: 1; padding-right: .06em; background: var(--text-grad); color: #8a6420; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.num { font-variant-numeric: tabular-nums; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line); padding: 5px 12px 5px 8px; border-radius: var(--pill);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }

/* ---------- Public header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 14px 0; background: rgba(243,239,231,.86); backdrop-filter: blur(10px); }
.site-header .nav {
    display: flex; justify-content: space-between; align-items: center; height: 64px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 12px 0 16px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo-mark {
    width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 800;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), 0 4px 10px -4px rgba(184,134,43,.6);
}
.logo small { font-size: 0.68rem; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 0.88rem; font-weight: 500; padding: 8px 12px; border-radius: var(--pill); transition: background .15s; }
.nav-links a:hover, .nav-links a.active { background: var(--canvas-2); }
.btn-portal { background: var(--ink); color: #fff !important; font-weight: 600 !important; padding: 10px 18px !important; }
.btn-portal:hover { background: #0d0b08 !important; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
    padding: 12px 22px; border-radius: var(--pill); border: 1px solid transparent;
    font-family: var(--sans); font-weight: 600; font-size: 0.9rem; letter-spacing: 0; text-transform: none;
    transition: transform .1s, background .2s, border-color .2s, box-shadow .2s, color .2s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: #0d0b08; }
.btn-gold { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -8px rgba(184,134,43,.8), inset 0 -2px 0 rgba(0,0,0,.08); }
.btn-gold:hover { box-shadow: 0 10px 22px -8px rgba(184,134,43,.9), inset 0 -2px 0 rgba(0,0,0,.08); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-line:hover { border-color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f3caca; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-icon {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; position: relative;
}
.btn-icon:hover { border-color: var(--ink); }
.btn-icon .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field label .req { color: var(--accent); }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--r-sm); color: var(--ink); font-size: 0.92rem; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input[readonly] { background: var(--canvas-2); color: var(--muted); }
.field textarea { resize: vertical; min-height: 110px; }
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%231a1712' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(184,134,43,.14); }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Alerts ---------- */
.flash-wrap { padding-top: 8px; }
.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: 0.88rem; margin-bottom: 16px; line-height: 1.45; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: currentColor; }
.alert.error { background: var(--danger-bg); border-color: #f6cfd0; color: #a8272c; }
.alert.success { background: var(--success-bg); border-color: #c5ead6; color: #157548; }
.alert.info { background: var(--tint); border-color: var(--tint-2); color: #8a4310; }

/* ---------- Cards ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.35rem; margin-bottom: 6px; }
.panel h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.panel-top { }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-side { grid-template-columns: 1.45fr 1fr; align-items: start; }
.sticky-panel { position: sticky; top: 24px; }
.page { padding: 36px 0 80px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin: 12px 0 6px; }
.page-head p { color: var(--muted); max-width: 640px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.big-num { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 600; padding: 3px 9px; border-radius: var(--pill); }
.chip.up { background: var(--success-bg); color: #157548; }
.chip.down { background: var(--danger-bg); color: #a8272c; }
.chip.neutral { background: var(--canvas-2); color: var(--muted); border: 1px solid var(--line); }
.chip.amber { background: var(--tint); color: var(--accent-ink); }

/* ---------- Auth ---------- */
.auth { padding: 48px 0 90px; }
.auth-card {
    max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-xl); padding: 36px 34px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.85rem; margin: 16px 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }
.auth-links { margin-top: 18px; font-size: 0.86rem; color: var(--muted); text-align: center; }
.auth-links a { color: var(--ink); font-weight: 600; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; }
.stat span { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.stat b { display: block; font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -0.03em; }
.stat .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--tint); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.stat.feature { background: var(--ink); border-color: var(--ink); }
.stat.feature b { color: #fff; }
.stat.feature span { color: #c4bbab; }
.stat.feature .ico { background: rgba(255,255,255,.1); color: var(--accent-2); }
.stat.feature::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(217,178,90,.35), transparent 70%); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.88rem; }
table.data th {
    text-align: left; font-size: 0.78rem; font-weight: 500; color: var(--muted); padding: 11px 14px;
    background: var(--canvas-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th:first-child { border-left: 1px solid var(--line); border-radius: var(--r-sm) 0 0 var(--r-sm); }
table.data th:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
table.data td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fbf8f2; }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.low { color: var(--danger); font-weight: 600; }
.person { display: flex; align-items: center; gap: 12px; }
.avatar {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--tint); color: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem;
}
.avatar.dark { background: var(--ink); color: #fff; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; text-transform: capitalize;
    padding: 4px 10px; border-radius: var(--pill); background: var(--canvas-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.badge.pending { background: var(--tint); color: var(--accent-ink); border-color: var(--tint-2); }
.badge.pending::before { background: var(--accent); }
.badge.accepted, .badge.active, .badge.give, .badge.open { background: var(--success-bg); color: #157548; border-color: #c5ead6; }
.badge.accepted::before, .badge.active::before, .badge.give::before, .badge.open::before { background: var(--success); }
.badge.waitlisted, .badge.ask { background: var(--info-bg); color: #2b56ad; border-color: #d3e0f8; }
.badge.waitlisted::before, .badge.ask::before { background: var(--info); }
.badge.declined, .badge.suspended, .badge.closed { background: var(--danger-bg); color: #a8272c; border-color: #f6cfd0; }
.badge.declined::before, .badge.suspended::before, .badge.closed::before { background: var(--danger); }
.badge.plain::before { display: none; }

/* ---------- Toolbar / tabs ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { padding: 9px 14px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface); font-family: inherit; font-size: .88rem; min-width: 240px; }
.toolbar input[type=search]:focus { outline: none; border-color: var(--accent); }
.tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: var(--pill); }
.tabs a { text-decoration: none; font-size: 0.84rem; font-weight: 500; padding: 7px 14px; border-radius: var(--pill); color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs a span { opacity: .6; margin-left: 3px; font-size: .78rem; }

/* ---------- Details ---------- */
dl.details { display: grid; grid-template-columns: 150px 1fr; gap: 12px 18px; font-size: 0.92rem; }
dl.details dt { font-size: 0.84rem; color: var(--muted); }
.story { white-space: pre-wrap; background: var(--canvas-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; font-size: 0.92rem; }

/* ---------- Lists ---------- */
.list { list-style: none; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 0.92rem; }
.list li:last-child { border-bottom: none; }
.list li::before {
    content: ""; flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--tint)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath fill='none' stroke='%23b8862b' stroke-width='1.8' d='M1 4l2.6 2.6L9 1.2'/%3E%3C/svg%3E") center no-repeat;
}
.link-list li::before { display: none; }
.link-list li { justify-content: space-between; border-bottom-style: solid; border-color: var(--line); }
.link-list a { font-weight: 600; text-decoration: none; }
.link-list a:hover { color: var(--accent-ink); }

/* Row card (like "Upcoming bill") */
.row-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.row-card + .row-card { margin-top: 10px; }
a.row-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.row-card .tile { flex: 0 0 42px; height: 42px; border-radius: 12px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.row-card .tile.blue { background: var(--info-bg); color: var(--info); }
.row-card .tile.green { background: var(--success-bg); color: var(--success); }
.row-card .grow { flex: 1; min-width: 0; }
.row-card strong { display: block; font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card small { color: var(--muted); font-size: .8rem; }

/* ---------- Charts ---------- */
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; height: 190px; padding-top: 30px; position: relative; }
.bars::before { content: ""; position: absolute; inset: 30px 0 28px; background: repeating-linear-gradient(180deg, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); border-top: 1px dashed var(--line-2); pointer-events: none; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; position: relative; z-index: 1; }
.bar i { display: block; width: 100%; max-width: 56px; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, #ece6da, #f9f6f0); min-height: 8px; position: relative; }
.bar.on i { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 70%, rgba(217,178,90,.25) 100%); box-shadow: 0 10px 22px -10px rgba(184,134,43,.8); }
.bar b { position: absolute; top: -26px; font-size: .78rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1px 7px; box-shadow: var(--shadow); }
.bar span { font-size: .76rem; color: var(--muted); white-space: nowrap; height: 20px; }
.bar.low i { background: linear-gradient(180deg, #f3b9bb, #fbe4e5); }
.stack { display: flex; height: 40px; border-radius: 8px; overflow: hidden; background: var(--canvas-2); gap: 2px; }
.stack i { display: block; height: 100%; }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; font-size: .84rem; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted-2)); }
.legend small { display: block; color: var(--muted); padding-left: 16px; }

/* ---------- Give & Ask ---------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.post + .post { margin-top: 12px; }
.post-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.post h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.post p { font-size: 0.92rem; white-space: pre-wrap; color: var(--ink-2); }
.post-meta { font-size: 0.8rem; color: var(--muted); margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Onboarding ---------- */
.hero-band { padding: 30px 0 10px; }
.hero-inner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 46px 44px; position: relative; overflow: hidden; }
.hero-band h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); margin: 18px 0 14px; line-height: 1.08; letter-spacing: -0.035em; }
.hero-band p { font-size: 1.05rem; color: var(--muted); max-width: 620px; }
.timeline { list-style: none; counter-reset: t; }
.timeline li { counter-increment: t; position: relative; padding: 0 0 22px 52px; }
.timeline li::before {
    content: counter(t); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.timeline li:first-child::before { background: var(--grad); color: #fff; border-color: transparent; }
.timeline li::after { content: ""; position: absolute; left: 18px; top: 40px; bottom: 4px; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline h3 { font-size: 1.02rem; font-weight: 600; margin: 6px 0 4px; }
.timeline p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Public footer ---------- */
.site-footer { padding: 0 0 20px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; font-size: 0.8rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* =============================================================
   App shell (member portal + admin): sidebar + top bar
   ============================================================= */
body.app-body { background: var(--canvas); }
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; max-width: 1480px; margin: 0 auto; width: 100%; padding: 16px; gap: 0; }
.app-frame { display: contents; }
.sidebar {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl) 0 0 var(--r-xl); border-right: none;
    padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; height: calc(100vh - 32px);
}
.sidebar .logo { padding: 2px 6px 6px; }
.side-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; color: var(--muted-2); font-size: .86rem; }
.side-search kbd { margin-left: auto; font-family: inherit; font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.side-label { font-size: 0.72rem; font-weight: 600; color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; padding: 0 10px; margin-bottom: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none;
    color: var(--ink-2); font-size: .92rem; font-weight: 500; transition: background .15s;
}
.side-nav a svg { color: var(--muted); flex: 0 0 auto; }
.side-nav a:hover { background: var(--canvas-2); }
.side-nav a.active { background: linear-gradient(180deg, #35302a 0%, #1a1712 100%); color: #fff; box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); }
.side-nav a.active svg { color: #fff; }
.side-nav a .count { margin-left: auto; min-width: 22px; height: 22px; border-radius: var(--pill); background: var(--grad); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.side-nav a.danger { color: var(--danger); }
.side-nav a.danger svg { color: var(--danger); }
.side-promo { margin-top: auto; background: var(--canvas-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.side-promo h4 { font-size: 1rem; margin-bottom: 4px; }
.side-promo p { font-size: .8rem; color: var(--muted); margin-bottom: 12px; line-height: 1.45; }

.app-main { background: var(--canvas-2); border: 1px solid var(--line); border-radius: 0 var(--r-xl) var(--r-xl) 0; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 0 var(--r-xl) 0 0; }
.topbar h1 { font-size: 1.4rem; letter-spacing: -0.02em; }
.topbar .sub { font-size: .84rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line); }
.user-chip .avatar { flex-basis: 40px; width: 40px; height: 40px; }
.user-chip strong { display: block; font-size: .88rem; font-weight: 600; line-height: 1.2; }
.user-chip small { font-size: .78rem; color: var(--muted); }
.app-content { padding: 24px 28px 40px; flex: 1; }
.app-content .page { padding: 0; }
.app-content .container { max-width: none; padding: 0; }
.app-content .page-head h1 { font-size: 1.6rem; margin: 10px 0 4px; }
.app-foot { padding: 14px 28px; font-size: .76rem; color: var(--muted-2); border-top: 1px solid var(--line); }
.menu-toggle { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
    .grid-2, .grid-3, .grid-side { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    dl.details { grid-template-columns: 1fr; gap: 2px; }
    dl.details dd { margin-bottom: 10px; }
    .app { grid-template-columns: 1fr; padding: 10px; }
    .sidebar { position: static; height: auto; border-radius: var(--r-lg); border-right: 1px solid var(--line); margin-bottom: 10px; padding: 14px; gap: 10px; }
    .sidebar .side-search, .sidebar .side-promo, .sidebar .side-label { display: none; }
    .sidebar .side-group { display: none; }
    .sidebar.open .side-group { display: block; }
    .sidebar-head { display: flex; justify-content: space-between; align-items: center; }
    .menu-toggle { display: inline-flex; }
    .app-main { border-radius: var(--r-lg); }
    .topbar { border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 14px 18px; }
    .app-content { padding: 18px; }
    .user-chip div { display: none; }
}
@media (max-width: 640px) {
    .site-header .nav-links .hide-sm { display: none; }
    .logo small { display: none; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .auth-card, .panel { padding: 22px 18px; }
    .hero-inner { padding: 30px 22px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .page { padding: 24px 0 60px; }
    .stats { gap: 10px; }
    .stat { padding: 16px; }
    .stat b { font-size: 1.5rem; }
    .topbar .btn-icon { display: none; }
    .bars { gap: 6px; }
}

.hero-inner::before { content: ""; position: absolute; right: -160px; top: -180px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(217,178,90,.22), transparent 70%); pointer-events: none; }
.grid-2 > *, .grid-3 > *, .grid-side > *, .app-main, .app-content, .panel { min-width: 0; }
@media (max-width: 640px) {
    .bar span { font-size: .66rem; }
    .topbar h1 { font-size: 1.15rem; }
    .panel-head { flex-wrap: wrap; }
}
.toolbar form { flex-wrap: wrap; }
@media (max-width: 640px) {
    .toolbar input[type=search] { min-width: 0; flex: 1 1 160px; }
    .toolbar > form { width: 100%; }
}
