/* Shared shell for the Message Store pages (SMS and WhatsApp): palette, sidebar, header, components. */

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

:root {
    --ink: #2c2503;
    --ink-2: #6b5f2e;
    --ink-3: #8a7a3a;
    --gold-1: var(--lib-accent-from, #f5c842);
    --gold-2: var(--lib-accent-to, #d4a017);
    --cream: #fbf8ef;
    --paper: #ffffff;
    --line: #eadfb8;
    --soft: #f7f2de;
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --bad: #b91c1c;
    --bad-bg: #fee2e2;
    --warn-bg: #fef3c7;
    --shadow-md: 0 1px 3px rgba(44, 37, 3, .06), 0 12px 28px -14px rgba(44, 37, 3, .25);
    --shadow-lg: 0 2px 6px rgba(44, 37, 3, .08), 0 22px 44px -18px rgba(212, 160, 23, .45);
}

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: radial-gradient(900px 380px at 92% -140px, rgba(245, 200, 66, .22), transparent 70%), var(--cream);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(212, 160, 23, .45); outline-offset: 2px; }
section[id] { scroll-margin-top: 84px; }

/* App shell: sidebar + header */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s ease; }
.app-main { min-width: 0; }
.sidebar { position: sticky; top: 0; z-index: 60; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, #2c2503 0%, #1d1802 100%); color: #f5e9b8; box-shadow: inset -1px 0 0 rgba(245, 200, 66, .18); }
.sb-brand { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 16px 18px; border-bottom: 1px solid rgba(245, 200, 66, .16); }
.sb-mark { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--ink); font-size: 14px; font-weight: 900; letter-spacing: .02em; box-shadow: 0 6px 16px -6px rgba(212, 160, 23, .7); }
.sb-title { min-width: 0; }
.sb-title strong { display: block; font-size: 15px; font-weight: 800; color: #fff3c4; letter-spacing: -.01em; white-space: nowrap; }
.sb-title span { display: block; max-width: 170px; font-size: 11px; color: #cdbd7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; scrollbar-color: rgba(245, 200, 66, .3) transparent; }
.sb-group { margin: 16px 12px 6px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #a8973f; white-space: nowrap; }
.sb-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 2px 0; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: #eadca4; font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease; }
.sb-item:hover { background: rgba(245, 200, 66, .12); color: #fff3c4; }
.sb-item.active { background: linear-gradient(135deg, #f5c842, #d4a017); color: var(--ink); box-shadow: 0 8px 18px -10px rgba(212, 160, 23, .9); }
.sb-ico { flex-shrink: 0; width: 22px; text-align: center; font-size: 16px; line-height: 1; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-caret { margin-left: auto; font-size: 11px; transition: transform .2s ease; }
.sb-parent[aria-expanded="false"] .sb-caret { transform: rotate(-90deg); }
.sb-sub { padding-left: 8px; }
.sb-sub .sb-item { padding: 9px 12px 9px 14px; font-size: 13px; }
.sb-dot { flex-shrink: 0; width: 8px; height: 8px; margin: 0 3px 0 5px; border-radius: 50%; background: var(--c, #f5c842); box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.sb-foot { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 14px 18px; border-top: 1px solid rgba(245, 200, 66, .16); font-size: 12px; color: #d9c77a; }
.sb-dot-live { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 3px rgba(250, 204, 21, .22); }
.sb-dot-live.online { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .22); }
.sb-dot-live.offline { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .22); }
.sb-backdrop { display: none; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg, #2c2503, #3f3407); box-shadow: inset 0 -2px 0 var(--gold-2), 0 4px 14px rgba(44, 37, 3, .25); color: #f5e9b8; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.top-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(245, 200, 66, .45); border-radius: 10px; background: rgba(255, 255, 255, .06); color: #fff3c4; font-size: 18px; line-height: 1; text-decoration: none; transition: background .15s ease; }
.icon-btn:hover { background: rgba(245, 200, 66, .16); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: #d9c77a; }
.crumb-current { color: #fff3c4; font-weight: 700; }
.sep { opacity: .5; }
.gw { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: rgba(255, 255, 255, .08); border: 1px solid rgba(245, 200, 66, .4); color: #fff3c4; }
.gw::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 3px rgba(250, 204, 21, .25); }
.gw.online::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.gw.offline::before { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-gold { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--ink); box-shadow: 0 6px 16px -6px rgba(212, 160, 23, .75); }
.btn-gold:hover { box-shadow: 0 10px 22px -8px rgba(212, 160, 23, .85); }
.btn-soft { background: var(--soft); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: #efe6c4; }
.btn-ghost { background: transparent; color: #fff3c4; border-color: rgba(245, 200, 66, .5); }
.btn-ghost:hover { background: rgba(245, 200, 66, .14); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: #fecaca; }

/* Page layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 40px; }
.hero { margin: 24px 0 18px; }
.hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 6px 0 0; color: var(--ink-2); max-width: 680px; }
.pill-royal { padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: linear-gradient(135deg, #fdf2c2, #f5d56b); color: #6b4f00; border: 1px solid #e9cd62; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--ink); font-size: 12px; font-weight: 800; flex-shrink: 0; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); transition: transform .2s ease, box-shadow .2s ease; }
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); }
.stat.ok::before { background: linear-gradient(90deg, #16a34a, #86efac); }
.stat.bad::before { background: linear-gradient(90deg, #dc2626, #fca5a5); }
.stat.info::before { background: linear-gradient(90deg, #2563eb, #93c5fd); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-val { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-val small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stat-phone { font-size: 18px; }
.stat-lbl { margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.stat-ico { flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 20px; background: linear-gradient(135deg, #fdf2c2, #f5d56b); color: var(--ink); }
.stat.ok .stat-ico { background: var(--ok-bg); color: var(--ok); }
.stat.bad .stat-ico { background: var(--bad-bg); color: var(--bad); }
.stat.info .stat-ico { background: #dbeafe; color: #1d4ed8; }

/* Cards */
.workspace { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin-top: 16px; align-items: start; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); overflow: hidden; }
.logs { margin-top: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; background: linear-gradient(180deg, #fffdf6, #fbf6e4); border-bottom: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.card-body { padding: 20px; }
.count-badge { padding: 4px 11px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }

/* Segmented tabs */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: all .2s ease; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--ink); box-shadow: 0 4px 10px -4px rgba(212, 160, 23, .7); }

/* Form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; padding: 9px 11px; font-size: 13px; background: #fff; border: 1px solid #d8c98f; border-radius: 10px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.select { cursor: pointer; }
.select-sm { width: auto; min-width: 140px; padding: 7px 10px; font-size: 12px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(212, 160, 23, .18); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.hint { font-size: 11px; color: var(--ink-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notice { margin-top: 12px; padding: 10px 12px; font-size: 12px; color: var(--ink-2); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.search { margin-top: 12px; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; }
.check-all { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.check-all input, .st-row input { width: 16px; height: 16px; accent-color: var(--gold-2); cursor: pointer; }
.extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.extras .input { padding: 7px 10px; font-size: 12px; }
.counter { font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* Audience list */
.list { max-height: 440px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; scrollbar-color: #d8c98f transparent; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #f3edd4; cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.st-row:last-child { border-bottom: 0; }
.st-row:hover { background: #fdfaf0; }
.st-row.selected { background: #fff8dc; box-shadow: inset 3px 0 0 var(--gold-2); }
.st-body { flex: 1; min-width: 0; }
.st-name { display: block; font-size: 13px; font-weight: 700; }
.st-name span { font-weight: 500; color: var(--ink-3); }
.st-meta { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-2); }
.chip { flex-shrink: 0; margin-left: auto; padding: 4px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: #fecaca; }
.empty { padding: 26px 14px; text-align: center; font-size: 13px; color: var(--ink-2); }

/* Template pills and tags */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 12px; scrollbar-width: thin; }
.pill { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 7px 14px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #fff; color: var(--ink); border: 1px solid #e3d59a; border-radius: 999px; box-shadow: 0 1px 2px rgba(44, 37, 3, .06); transition: all .18s ease; }
.pill:hover { transform: translateY(-1px); border-color: var(--gold-2); background: #fffbeb; }
.pill.active { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-2); color: var(--ink); box-shadow: 0 6px 14px -6px rgba(212, 160, 23, .75); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.tag { padding: 4px 9px; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 11px; font-weight: 700; color: #7a5b00; background: #fffbeb; border: 1px solid #efd77a; border-radius: 7px; transition: all .15s ease; }
.tag:hover { background: var(--gold-2); border-color: var(--gold-2); color: var(--ink); }

/* Preview and actions */
.preview { margin: 16px 0; }
.phone { max-width: 360px; margin: 6px auto 0; padding: 16px; background: linear-gradient(180deg, #fffdf5, #f6efd6); border: 1px solid #e6d9a5; border-radius: 26px; box-shadow: 0 0 0 6px #fff, 0 0 0 7px #e6d9a5, var(--shadow-md); }
.phone-bar { margin-bottom: 12px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-align: center; letter-spacing: .02em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed #e6d9a5; }

/* Logs table */
.logs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: var(--ink-2); background: var(--soft); border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid #f3edd4; }
tr:hover td { background: #fdfaf0; }
td.msg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.empty { padding: 26px 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
code { padding: 2px 6px; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 12px; background: var(--soft); border-radius: 6px; }
.status { display: inline-block; padding: 3px 9px; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; }
.status.sent { background: var(--ok-bg); color: var(--ok); }
.status.failed { background: var(--bad-bg); color: var(--bad); }
.status.other { background: var(--warn-bg); color: #b45309; }

/* Modal and progress */
.overlay { position: fixed; inset: 0; z-index: 9000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 16, 4, .55); backdrop-filter: blur(3px); }
.overlay.open { display: flex; }
.modal { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .2s ease, transform .2s ease; }
.overlay.open .modal { opacity: 1; transform: none; }
.modal-sm { width: min(380px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: linear-gradient(135deg, #2c2503, #3f3407); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: #fff3c4; }
.modal-x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; line-height: 1; }
.modal-body { padding: 20px; }
.modal-body.center { text-align: center; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: var(--cream); border-top: 1px solid var(--line); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch .track { position: relative; flex-shrink: 0; width: 42px; height: 24px; background: #d9cfa5; border-radius: 999px; transition: background .2s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s ease; }
.switch input:checked + .track { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(212, 160, 23, .35); }
.prog-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.progress { height: 16px; overflow: hidden; background: #f1ead0; border: 1px solid var(--line); border-radius: 999px; }
.progress-bar { display: flex; align-items: center; justify-content: center; height: 100%; width: 0%; color: var(--ink); font-size: 10px; font-weight: 800; background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); transition: width .4s ease; }
.progress-bar.busy { background-image: linear-gradient(45deg, rgba(255, 255, 255, .3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, .3) 75%, transparent 75%), linear-gradient(90deg, var(--gold-1), var(--gold-2)); background-size: 16px 16px, auto; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 16px 0, 0 0; } }
.prog-status { margin: 12px 0 16px; font-size: 13px; color: var(--ink-2); }
.prog-status.ok { color: var(--ok); font-weight: 700; }
.prog-status.bad { color: var(--bad); font-weight: 700; }

/* Icon glyphs used by the in-house LibAlert (no icon font needed) */
.fa { display: inline-block; font-style: normal; font-weight: 400; line-height: 1; }
.fa-bell::before { content: "\1F514"; }
.fa-check-circle::before { content: "\2714"; }
.fa-exclamation-circle::before { content: "\0021"; }
.fa-exclamation-triangle::before { content: "\26A0"; }
.fa-info-circle::before { content: "\0069"; }
.fa-long-arrow-right::before { content: "\2192"; }

/* Settings pages: status pill, grids and callouts */
.state { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: #fef3c7; color: #92400e; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.online { background: var(--ok-bg); color: var(--ok); }
.state.offline { background: var(--bad-bg); color: var(--bad); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.callout { margin-top: 14px; padding: 10px 12px; font-size: 12px; border: 1px solid transparent; border-radius: 10px; }
.callout:first-child { margin-top: 0; }
.callout.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.callout.ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.callout.warn { background: var(--warn-bg); color: #92400e; border-color: #fde68a; }
.callout.bad { background: var(--bad-bg); color: var(--bad); border-color: #fecaca; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed #e6d9a5; }
.progress-box { margin-top: 14px; padding: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.progress-box .progress { margin: 8px 0; }
.stack > .card + .card { margin-top: 16px; }

/* Desktop: sidebar can collapse to an icon rail */
@media (min-width: 901px) {
    .app.collapsed { grid-template-columns: 78px minmax(0, 1fr); }
    .app.collapsed .sb-title,
    .app.collapsed .sb-label,
    .app.collapsed .sb-caret { display: none; }
    .app.collapsed .sb-group { display: block; height: 1px; margin: 12px 14px; padding: 0; font-size: 0; background: rgba(245, 200, 66, .22); }
    .app.collapsed .sb-brand { justify-content: center; padding: 16px 0; }
    .app.collapsed .sb-item { justify-content: center; padding: 11px 0; }
    .app.collapsed .sb-sub { padding-left: 0; display: block !important; }
    .app.collapsed .sb-sub .sb-item { padding: 9px 0; }
    .app.collapsed .sb-foot { justify-content: center; padding: 14px 0; }
}

/* Mobile: sidebar becomes a slide-in drawer */
@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 272px; height: auto; transform: translateX(-104%); transition: transform .25s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, .35); }
    .app.nav-open .sidebar { transform: none; }
    .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 16, 4, .5); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    .app.nav-open .sb-backdrop { opacity: 1; pointer-events: auto; }
    .topbar-inner { padding: 12px 14px; }
    .wrap { padding: 0 14px 32px; }
    .hero h1 { font-size: 22px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace { grid-template-columns: 1fr; }
    .card-body { padding: 16px; }
    .stat-val { font-size: 24px; }
    .row2, .extras, .grid3 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
