/* Wear Ramé Care Desk — TOMYSKN-inspired: deep burgundy, warm cream, editorial type */
:root {
  --cream: #EDE7DB;
  --panel: #F6F2E9;
  --panel-2: #E7E0D2;
  --burgundy: #571F1C;
  --burgundy-2: #6E2D28;
  --burgundy-3: #7E3A33;
  --wine: #4A1917;
  --ink: #2B1613;
  --muted: #6E5F52;
  --line: #D8CDBB;
  --gold: #A97E2F;
  --gold-ink: #7E5B1C;
  --green: #4E6B4A;
  --red: #A33B2E;
  --radius: 2px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  font-size: 16px;
}
/* Self-hosted metric-friendly twin for Avenir Next — so Android/Windows match Apple.
   ISPs here block Google's font CDN, so these are served from /fonts on our own origin. */
@font-face { font-family: 'Hanken Grotesk'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/hanken-300.woff2?v=1') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/hanken-400.woff2?v=1') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/hanken-500.woff2?v=1') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/hanken-600.woff2?v=1') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/hanken-700.woff2?v=1') format('woff2'); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Hanken Grotesk", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--burgundy); }

/* keyboard focus rings — visible for keyboard/AT, subtle for mouse */
:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; border-radius: var(--radius); }
header :focus-visible, #login :focus-visible, .today-panel :focus-visible, .inbox-banner :focus-visible, .modal-back .btn:focus-visible { outline-color: #F3EBDF; }
input.field:focus-visible, select.field:focus-visible, textarea.field:focus-visible, .cell:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 0; }

.kicker { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.display { font-weight: 400; letter-spacing: .02em; }

/* ---------- login ---------- */
#login[hidden], #app[hidden] { display: none; }
#login {
  position: fixed; inset: 0; background: var(--burgundy);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  background-image: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.06), transparent 55%);
}
.login-card { width: 380px; max-width: calc(100vw - 48px); text-align: center; color: #F3EBDF; }
.login-brand { font-size: 30px; letter-spacing: .34em; font-weight: 500; margin-bottom: 6px; }
.login-brand .flip { display: inline-block; transform: scaleX(-1); }
.login-sub { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; opacity: .65; margin-bottom: 44px; }
.login-card input {
  width: 100%; padding: 13px 16px; margin-bottom: 12px; border: 1px solid rgba(243,235,223,.35);
  background: rgba(243,235,223,.06); color: #F3EBDF; border-radius: var(--radius); outline: none;
  letter-spacing: .04em;
}
.login-card input::placeholder { color: rgba(243,235,223,.45); text-transform: uppercase; font-size: 11px; letter-spacing: .18em; }
.login-card input:focus { border-color: rgba(243,235,223,.8); }
.login-card button {
  width: 100%; padding: 13px; margin-top: 10px; background: #F3EBDF; color: var(--burgundy);
  border: none; border-radius: var(--radius); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; font-weight: 600;
}
.login-card button:hover { background: #fff; }
.login-err { color: #F5C6B8; font-size: 12.5px; height: 18px; margin-top: 12px; letter-spacing: .04em; }

/* ---------- shell ---------- */
header {
  background: var(--burgundy); color: #F3EBDF; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; padding: 0 28px; height: 58px;
}
.brand { font-size: 17px; letter-spacing: .3em; font-weight: 500; white-space: nowrap; }
.brand .flip { display: inline-block; transform: scaleX(-1); }
nav { display: flex; gap: 6px; flex: 1; align-items: center; }

/* the big CS ↔ Influencer wing switcher */
.wing-switch {
  display: inline-flex; border: 1px solid rgba(243,235,223,.45); border-radius: 3px; overflow: hidden;
  margin-right: 14px; flex: none;
}
.wing-switch a {
  padding: 8px 16px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: rgba(243,235,223,.75); text-decoration: none; white-space: nowrap;
}
.wing-switch a:hover { color: #fff; }
.wing-switch a.active { background: #F3EBDF; color: var(--burgundy); }
nav a, .nav-group-btn {
  color: rgba(243,235,223,.75); text-decoration: none; font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; padding: 8px 11px; border-radius: var(--radius); position: relative; white-space: nowrap;
}
nav a.nav-link:hover, .nav-group-btn:hover { color: #fff; }
nav a.active { color: #fff; }
nav > a.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 1px; background: #F3EBDF; }

/* grouped dropdown nav */
.nav-group { position: relative; }
.nav-group-btn {
  background: transparent; border: none; cursor: pointer; font-family: inherit; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.nav-group.active > .nav-group-btn { color: #fff; }
.nav-group.active > .nav-group-btn::after { content: ""; position: absolute; left: 11px; right: 22px; bottom: 2px; height: 1px; background: #F3EBDF; }
.nav-group-btn .caret { font-size: 8px; opacity: .7; transition: transform .15s ease; }
.nav-group.open .nav-group-btn .caret { transform: rotate(180deg); }
.nav-group.open .nav-group-btn { color: #fff; }
.nav-drop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 172px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(43,22,19,.28); padding: 6px; display: none; flex-direction: column;
}
.nav-group.open .nav-drop { display: flex; }
.nav-drop a {
  color: var(--ink); text-decoration: none; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; padding: 10px 12px; border-radius: var(--radius); white-space: nowrap; position: static;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.nav-drop a:hover { background: rgba(87,31,28,.07); color: var(--burgundy); }
.nav-drop a.active { background: var(--burgundy); color: #F3EBDF; }
.nav-drop a.active::after { display: none; }
.nav-drop a .badge { background: var(--burgundy); color: #F3EBDF; }
.nav-drop a.active .badge { background: #F3EBDF; color: var(--burgundy); }
nav a .badge {
  background: #F3EBDF; color: var(--burgundy); border-radius: 8px; font-size: 9px; padding: 1px 5px;
  margin-left: 5px; font-weight: 700; letter-spacing: 0;
}
.hdr-btn {
  background: transparent; color: #F3EBDF; border: 1px solid rgba(243,235,223,.55); border-radius: var(--radius);
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 9px 16px; white-space: nowrap;
}
.hdr-btn:hover { background: #F3EBDF; color: var(--burgundy); }
.hdr-user { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; white-space: nowrap; }
.hdr-user b { cursor: pointer; }

/* ---------- notification bell ---------- */
.bell-wrap { position: relative; display: flex; align-items: center; }
.bell-wrap[hidden], .hdr-btn[hidden] { display: none; }
.bell-btn {
  background: transparent; border: none; color: rgba(243,235,223,.85); cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 0; transition: background .15s ease, color .15s ease;
}
.bell-btn:hover, .bell-btn.open { background: rgba(243,235,223,.14); color: #fff; }
.bell-btn.has-new { color: #fff; }
.bell-btn.has-new svg { animation: bell-swing 2.6s ease-in-out infinite; transform-origin: 50% 3px; }
@keyframes bell-swing { 0%,86%,100% { transform: rotate(0); } 89% { transform: rotate(11deg); } 93% { transform: rotate(-9deg); } 97% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) {
  .bell-btn.has-new svg, #loadbar.on, .nav-group.open .nav-drop { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.bell-badge {
  position: absolute; top: -1px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  background: var(--red); color: #fff; border: 1.5px solid var(--burgundy); border-radius: 9px;
  font-size: 9.5px; font-weight: 700; line-height: 13px; text-align: center; letter-spacing: 0;
}
.bell-panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: 344px; max-width: 88vw; z-index: 45;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(43,22,19,.34); overflow: hidden; cursor: default;
}
.bell-head { display: flex; align-items: baseline; justify-content: space-between; padding: 13px 15px 11px; border-bottom: 1px solid var(--line); }
.bell-head b { font-size: 13px; color: var(--ink); letter-spacing: .02em; }
.bell-head span { font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.bell-list { max-height: 366px; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; align-items: center; padding: 11px 15px; border-bottom: 1px solid rgba(216,205,187,.5); text-decoration: none; }
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: rgba(87,31,28,.05); }
.bell-item.done { opacity: .52; }
.bi-tag { flex: none; font-size: 8px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; padding: 3px 6px; border-radius: var(--radius); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.bi-tag.return { background: #E7DCC4; color: #7A5A12; }
.bi-tag.claim { background: #F0D6CF; color: var(--red); }
.bi-tag.sl { background: #DBE4D6; color: var(--green); }
.bi-body { flex: 1; min-width: 0; }
.bi-t { display: block; font-size: 12px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-num { color: var(--muted); font-weight: 500; }
.bi-s { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.bi-when { flex: none; font-size: 10px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.bi-check { color: var(--green); font-weight: 700; }
.bell-empty { padding: 24px 18px; font-size: 12px; color: var(--muted); line-height: 1.65; text-align: center; }
.bell-foot { display: block; padding: 11px 15px; text-align: center; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--burgundy); text-decoration: none; border-top: 1px solid var(--line); }
.bell-foot:hover { background: rgba(87,31,28,.05); }

/* ---------- dashboard "new from forms" banner ---------- */
.inbox-banner { background: linear-gradient(180deg, var(--burgundy), var(--wine)); color: #F3EBDF; border-radius: var(--radius); padding: 14px 18px 16px; margin-bottom: 18px; box-shadow: 0 8px 24px rgba(74,25,23,.22); }
.ib-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ib-head .kicker { color: rgba(243,235,223,.85); }
.ib-n { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 8px; letter-spacing: 0; }
.ib-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ib-card { flex: 1 1 150px; min-width: 0; background: rgba(243,235,223,.08); border: 1px solid rgba(243,235,223,.16); border-radius: var(--radius); padding: 10px 12px; text-decoration: none; color: #F3EBDF; transition: background .15s ease; display: flex; flex-direction: column; gap: 3px; }
.ib-card:hover { background: rgba(243,235,223,.17); }
.ib-tag { font-size: 8.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: rgba(243,235,223,.62); }
.ib-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-sub { font-size: 11px; color: rgba(243,235,223,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { max-width: 1240px; margin: 0 auto; padding: 36px 28px 80px; }

/* ---------- common ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 400; letter-spacing: .04em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.btn {
  background: var(--burgundy); color: #F3EBDF; border: 1px solid var(--burgundy); border-radius: var(--radius);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; padding: 11px 18px; font-weight: 600;
}
.btn:hover { background: var(--burgundy-2); }
.btn.ghost { background: transparent; color: var(--burgundy); }
.btn.ghost:hover { background: var(--burgundy); color: #F3EBDF; }
.btn.small { padding: 7px 12px; font-size: 9.5px; }
.btn.gold { background: var(--gold); border-color: var(--gold-ink); }
.btn:disabled { opacity: .5; cursor: default; }

/* interaction: press feedback + tasteful motion (short, ease-out, transform/opacity only) */
.btn, .hdr-btn, .chip, .tp-done, .tpl-chip, .rail-cta, .wing-switch a, nav a, .nav-group-btn, .nav-drop a, .view-toggle button, .login-card button, .bell-btn {
  transition: background .15s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out), transform .09s var(--ease-out);
}
.btn:active, .hdr-btn:active, .chip:active, .tp-done:active, .tpl-chip:active, .view-toggle button:active, .login-card button:active { transform: scale(.97); }
.stat:active, .mini:active { transform: translateY(0) scale(.99); }
.nav-group.open .nav-drop { animation: navdrop .16s var(--ease-out); }
@keyframes navdrop { from { opacity: 0; transform: translateY(-6px); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

input.field, select.field, textarea.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: #FBF8F1;
  border-radius: var(--radius); outline: none;
}
input.field:focus, select.field:focus, textarea.field:focus { border-color: var(--burgundy); }
textarea.field { resize: vertical; min-height: 90px; line-height: 1.55; }
label.lbl { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }

/* ---------- dashboard ---------- */
.hero { margin-bottom: 30px; }
.hero h1 { font-size: 34px; font-weight: 400; margin-top: 8px; }
.hero .date { color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: .06em; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 34px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; cursor: pointer; transition: transform .12s ease;
}
.stat:hover { transform: translateY(-2px); }
.stat .n { font-size: 32px; font-weight: 300; line-height: 1; margin-bottom: 8px; }
.stat .t { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat.alert { background: var(--burgundy); border-color: var(--burgundy); }
.stat.alert .n, .stat.alert .t { color: #F3EBDF; }
.stat.warn .n { color: var(--red); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin: 34px 0 0; }
.section-title h2 { font-size: 15px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; }
.section-title .more { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; }

/* ---------- case table ---------- */
table.cases { width: 100%; border-collapse: collapse; }
table.cases th {
  text-align: left; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  padding: 14px 12px 10px; border-bottom: 1px solid var(--line); font-weight: 600;
}
table.cases td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
table.cases tr.row { cursor: pointer; }
table.cases tr.row:hover td { background: rgba(87,31,28,.045); }
.case-subj { font-weight: 500; }
.case-cust { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .03em; }

.pill { display: inline-block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 10px; white-space: nowrap; }
.pill.new { background: var(--gold); color: #fff; }
.pill.open { background: var(--burgundy); color: #F3EBDF; }
.pill.waiting_customer { background: var(--panel-2); color: var(--muted); }
.pill.awaiting_decision { background: #3E2C4C; color: #EFE8F5; }
.pill.resolved { background: var(--green); color: #EFF3EE; }
.pill.closed { background: #B8AC9C; color: #fff; }
.pill.P1 { background: var(--red); color: #fff; }
.pill.P2 { background: var(--burgundy-3); color: #fff; }
.pill.P3 { background: var(--panel-2); color: var(--ink); }
.pill.P4 { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.sla { font-size: 11.5px; letter-spacing: .05em; }
.sla.over { color: var(--red); font-weight: 700; }
.sla.soon { color: var(--gold-ink); font-weight: 600; }
.sla.ok { color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 16px; padding: 7px 14px;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.chip.active { background: var(--burgundy); border-color: var(--burgundy); color: #F3EBDF; }
.filters input.field, .filters select.field { width: auto; }
.filters input.field { min-width: 220px; }

/* ---------- case detail ---------- */
.back { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 26px; align-items: start; margin-top: 18px; }
@media (max-width: 980px) { .case-layout { grid-template-columns: 1fr; } }
.case-main .card, .copilot .card { padding: 22px; margin-bottom: 18px; }
.case-title { font-size: 24px; font-weight: 400; line-height: 1.3; margin: 6px 0 14px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.meta-grid .kicker { margin-bottom: 4px; }
.meta-grid select.field { padding: 7px 8px; font-size: 12.5px; }
.desc { white-space: pre-wrap; line-height: 1.65; font-size: 14px; margin-top: 8px; }
.cust-line { font-size: 13px; color: var(--muted); margin-top: 10px; letter-spacing: .02em; }

.timeline { list-style: none; margin-top: 14px; }
.timeline li { border-left: 2px solid var(--line); padding: 2px 0 18px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.timeline li.reply::before { background: var(--burgundy); }
.timeline li.decision::before { background: #3E2C4C; }
.timeline .tl-head { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.timeline .tl-text { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

.copilot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.copilot-head h3 { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; }
.copilot .sug { border-top: 1px solid var(--line); padding: 14px 0; }
.copilot .sug:first-of-type { border-top: none; }
.sug .sug-kind { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; margin-bottom: 4px; }
.sug .sug-title { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.sug .sug-body { font-size: 12.5px; color: #5d4c42; line-height: 1.55; white-space: pre-wrap; max-height: 130px; overflow: auto; }
.sug .sug-actions { margin-top: 8px; display: flex; gap: 8px; }
.ai-box { background: var(--wine); color: #F3EBDF; border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.ai-box h3 { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }
.ai-box .ai-note { font-size: 12px; opacity: .75; line-height: 1.5; margin-bottom: 12px; }
.ai-out { font-size: 13px; line-height: 1.6; white-space: pre-wrap; background: rgba(243,235,223,.08); padding: 12px; border-radius: var(--radius); margin-top: 10px; }
.ai-tag { display: inline-block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; border: 1px solid rgba(243,235,223,.4); padding: 3px 8px; border-radius: 10px; margin-right: 6px; margin-bottom: 6px; }

.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }

/* ---------- decisions ---------- */
.dec-card { padding: 20px 22px; margin-bottom: 14px; }
.dec-q { font-size: 16.5px; font-weight: 500; margin: 6px 0; }
.dec-ctx { font-size: 13px; color: #5d4c42; line-height: 1.6; }
.dec-ans { border-left: 3px solid var(--burgundy); background: rgba(87,31,28,.05); padding: 12px 14px; margin-top: 12px; font-size: 13.5px; line-height: 1.6; }
.dec-meta { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* ---------- templates / playbooks ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tpl-card { padding: 20px; display: flex; flex-direction: column; }
.tpl-card .t { font-size: 15px; font-weight: 600; margin: 6px 0 8px; }
.tpl-card .b { font-size: 12.5px; color: #5d4c42; line-height: 1.6; white-space: pre-wrap; flex: 1; max-height: 170px; overflow: auto; margin-bottom: 12px; }
.tpl-card .row { display: flex; gap: 8px; }

/* ---------- insights ---------- */
.ins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 900px) { .ins-grid { grid-template-columns: 1fr; } }
.ins-card { padding: 22px; }
.ins-card h3 { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row .bl { width: 130px; font-size: 12px; color: #5d4c42; text-align: right; flex-shrink: 0; }
.bar-row .track { flex: 1; background: var(--panel-2); height: 16px; border-radius: 2px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--burgundy); }
.bar-row .bv { font-size: 12px; width: 30px; font-variant-numeric: tabular-nums; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 130px; margin-top: 10px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.trend .c-bar { background: var(--panel-2); border-radius: 1px; }
.trend .c-bar.res { background: var(--burgundy); }
.trend-lbl { display: flex; gap: 6px; margin-top: 6px; }
.trend-lbl span { flex: 1; text-align: center; font-size: 8.5px; color: var(--muted); letter-spacing: .04em; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th { text-align: left; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); }
table.plain td { padding: 10px 8px; border-bottom: 1px solid var(--line); }

/* ---------- settings ---------- */
.set-card { padding: 24px; margin-bottom: 20px; }
.set-card h3 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.set-card p { font-size: 13px; color: #5d4c42; line-height: 1.65; }
code.inline { background: var(--panel-2); padding: 2px 7px; border-radius: 2px; font-size: 12px; word-break: break-all; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43,22,19,.55); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; animation: mb-fade .18s var(--ease-out); }
.modal { background: var(--panel); border-radius: var(--radius); width: 560px; max-width: 100%; max-height: 90vh; overflow: auto; padding: 28px; animation: mb-pop .22s var(--ease-out); }
@keyframes mb-fade { from { opacity: 0; } }
@keyframes mb-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal h2 { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.modal .m-sub { font-size: 12.5px; color: var(--muted); }
.modal .m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #F3EBDF; padding: 12px 22px; border-radius: 2px; font-size: 12px;
  letter-spacing: .08em; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; max-width: 80vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#loadbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none;
  background: linear-gradient(90deg, var(--gold), #F3EBDF, var(--gold)); background-size: 200% 100%;
  opacity: 0; transition: opacity .15s ease;
}
#loadbar.on { opacity: 1; animation: loadslide 1.1s linear infinite; }
@keyframes loadslide { 0% { background-position: 200% 0; } 100% { background-position: 0% 0; } }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 13.5px; letter-spacing: .04em; }

/* ---------- decision guide ---------- */
.esc-lvl { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--line); }
.esc-lvl .esc-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; }
.esc-lvl .esc-b { font-size: 12.5px; line-height: 1.6; color: #5d4c42; }
.lvl-green { background: #EBEFE7; border-color: #C5D0BD; } .lvl-green .esc-t { color: var(--green); }
.lvl-gold { background: #F3ECD9; border-color: #DECFA6; } .lvl-gold .esc-t { color: var(--gold-ink); }
.lvl-red { background: #F4E3DE; border-color: #E0BEB4; } .lvl-red .esc-t { color: var(--red); }
.auth-badge { display: inline-block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line); }
.gstep { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.gstep:last-child { border-bottom: none; }
.gicon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.gi-green { background: #EBEFE7; color: var(--green); }
.gi-gold { background: #F3ECD9; color: var(--gold-ink); }
.gi-red { background: #F4E3DE; color: var(--red); }
.gstep-t { font-size: 14px; font-weight: 600; }
.gstep-d { font-size: 12.5px; color: #5d4c42; line-height: 1.6; margin-top: 3px; }
.guard-line { font-size: 12.5px; color: #5d4c42; line-height: 1.6; padding: 6px 0 6px 4px; border-bottom: 1px solid var(--line); }
.guard-line:last-of-type { border-bottom: none; }
.guide-flag { background: #F3ECD9; border: 1px solid #DECFA6; border-radius: var(--radius); padding: 12px 14px; font-size: 12.5px; line-height: 1.6; color: #6d5626; margin: 10px 0; }
.tpl-chip { display: inline-block; border: 1px solid var(--burgundy); color: var(--burgundy); text-decoration: none; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; border-radius: 14px; margin: 0 6px 6px 0; }
.tpl-chip:hover { background: var(--burgundy); color: #F3EBDF; }
.fb-ex { border-left: 3px solid var(--gold); background: rgba(169,126,47,.06); padding: 10px 14px; margin-bottom: 8px; border-radius: var(--radius); }
.fb-ex-q { font-size: 12.5px; color: #5d4c42; line-height: 1.55; font-style: italic; }
.fb-ex-a { font-size: 13px; line-height: 1.55; margin-top: 5px; font-weight: 500; }
.fb-ex-m { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 5px; }

/* ---------- feedback bank ---------- */
.fb-card { padding: 18px 20px; margin-bottom: 12px; }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fb-text { font-size: 14px; line-height: 1.6; }
.fb-product { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }
.fb-action { border-left: 3px solid var(--green); background: rgba(78,107,74,.07); padding: 10px 12px; margin-top: 10px; font-size: 13px; line-height: 1.55; }
.pill.fb-Negative { background: var(--red); color: #fff; }
.pill.fb-Positive { background: var(--green); color: #fff; }
.pill.fb-Suggestion { background: var(--gold); color: #fff; }

/* ---------- weekly ---------- */
.w-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.w-row:last-child { border-bottom: none; }
.flag-alert { background: var(--red); color: #fff; border-radius: var(--radius); padding: 14px 18px; font-size: 13px; font-weight: 600; letter-spacing: .04em; margin-bottom: 18px; }

/* ---------- second life ---------- */
tr.sl-flag td { background: rgba(163,59,46,.06) !important; }
tr.sl-flag td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.sl-type { display: inline-block; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 10px; white-space: nowrap; }
.sl-type.repair { background: var(--panel-2); color: var(--muted); }
.sl-type.service { background: rgba(169,126,47,.15); color: var(--gold-ink); }

/* ---------- refunds ---------- */
.rf-month { display: grid; grid-template-columns: 120px 1fr 150px; gap: 14px; align-items: center; padding: 8px 6px; border-radius: 3px; cursor: pointer; }
.rf-month:hover { background: rgba(87,31,28,.04); }
.rf-month.active { background: rgba(169,126,47,.12); }
.rf-m-name { font-size: 13px; font-weight: 600; }
.rf-m-bar { background: var(--panel-2); height: 14px; border-radius: 2px; overflow: hidden; }
.rf-m-fill { height: 100%; background: var(--burgundy); }
.rf-m-val { text-align: right; font-variant-numeric: tabular-nums; }
.rf-m-val b { font-size: 12.5px; } .rf-m-val span { font-size: 11px; color: var(--muted); margin-left: 6px; }
.rf-proc { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.rf-proc:first-child { border-top: none; }
.rf-proc:hover { color: var(--burgundy); }
.rf-proc.active { color: var(--burgundy); font-weight: 700; }
.rf-proc-v { color: var(--muted); font-variant-numeric: tabular-nums; }
.rf-proc.active .rf-proc-v { color: var(--burgundy); }
.rf-badge { display: inline-block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 10px; background: var(--panel-2); color: var(--ink); white-space: nowrap; }
.rf-cur { font-size: 9px; letter-spacing: .1em; font-weight: 700; color: var(--gold-ink); background: rgba(169,126,47,.12); padding: 2px 6px; border-radius: 8px; }

/* ---------- shopify order card ---------- */
.ord-card { border: 1px solid var(--line); background: #FBF8F1; border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.ord-loading, .ord-muted { color: var(--muted); font-size: 12.5px; font-style: italic; }
.ord-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ord-shop { color: #5E8B6E; letter-spacing: .04em; }
.ord-row { font-size: 12.5px; color: #5d4c42; }
.ord-warn { font-size: 12px; color: var(--red); margin-top: 8px; font-weight: 600; line-height: 1.5; }

/* ---------- shipments ---------- */
.ship-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.ship { width: 100%; min-width: 1180px; border-collapse: collapse; }
table.ship th {
  text-align: left; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding: 12px 8px 9px; border-bottom: 1px solid var(--ink); font-weight: 700; white-space: nowrap; background: var(--panel);
}
table.ship td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.ship tr:hover td { background: rgba(87,31,28,.035); }
.cell {
  border: 1px solid transparent; background: transparent; border-radius: 3px; padding: 6px 7px;
  font-size: 12.5px; width: 100%; min-width: 70px; outline: none; color: var(--ink); font-family: inherit;
}
.cell:hover { border-color: var(--line); background: #FBF8F1; }
.cell:focus { border-color: var(--burgundy); background: #FBF8F1; }
.cell:disabled { color: var(--muted); font-style: italic; cursor: not-allowed; }
.cell-date { width: 128px; font-variant-numeric: tabular-nums; }
.sb {
  display: inline-block; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  padding: 5px 10px; border-radius: 11px; white-space: nowrap;
}
.sb.amber { background: var(--gold); color: #fff; }
.sb.blue { background: #53687E; color: #EFF2F5; }
.sb.red { background: var(--red); color: #fff; }
.sb.green { background: var(--green); color: #EFF3EE; }
.sb.grey { background: var(--panel-2); color: var(--muted); }
/* live shopify order card (influencer modal) */
.oc { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; margin-top: 12px; }
.oc-head { font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oc-items { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* auto-update banner */
#update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 10px 16px; background: var(--gold); color: #fff; font-size: 13px; letter-spacing: .02em;
  box-shadow: 0 4px 16px rgba(43,22,19,.25);
}
#update-banner button {
  background: #fff; color: var(--burgundy); border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; padding: 7px 16px;
}

/* quick-add bar */
.quick-add { display: flex; gap: 10px; margin-bottom: 16px; }
.quick-add .field { flex: 1; }

/* today work queue */
.today-queue { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.today-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.today-card.silent { box-shadow: inset 4px 0 0 var(--red); }
.tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tc-name { font-size: 16px; font-weight: 600; }
.tc-h { color: var(--muted); font-weight: 400; font-size: 13px; }
.tc-meta { margin-top: 5px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-why { margin-top: 10px; font-size: 12.5px; color: var(--red); }
.tc-prod { margin-top: 6px; font-size: 12px; color: var(--gold-ink); }
.tc-last { margin-top: 6px; font-size: 12px; color: var(--muted); }
.tc-note { margin-top: 10px; }
.tc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.vt-n { background: var(--red); color: #fff; border-radius: 8px; padding: 1px 6px; font-size: 9px; margin-left: 4px; }

/* influencer pipeline board */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex: none; }
.view-toggle button {
  background: var(--panel); border: none; cursor: pointer; font-family: inherit;
  padding: 9px 14px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted);
}
.view-toggle button.on { background: var(--burgundy); color: #F3EBDF; }
.inf-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.inf-col { flex: 0 0 236px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.inf-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.inf-col-head b { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inf-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 62vh; overflow-y: auto; }
.inf-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; cursor: pointer; }
.inf-card:hover { border-color: var(--burgundy-3); }
.inf-card.flag { box-shadow: inset 3px 0 0 var(--red); }
.ic-t { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ic-m { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-p { font-size: 10.5px; color: var(--gold-ink); margin-top: 4px; }
.ic-f { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.ic-empty { text-align: center; color: var(--muted); padding: 18px 0; }

/* influencer pipeline stages */
.sb.inf-proposed { background: #7A5A8C; color: #F2ECF6; }
.sb.inf-approved { background: rgba(169,126,47,.2); color: var(--gold-ink); border: 1px solid var(--gold); }
.inf-stagesel { min-width: 118px; font-weight: 600; }
tr.inf-row { cursor: pointer; }
tr.inf-row:hover td { background: rgba(87,31,28,.035); }
.prop-list { display: flex; flex-direction: column; }
.prop-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.prop-who { min-width: 0; }
.sb.inf-lead { background: var(--panel-2); color: var(--muted); }
.sb.inf-outreach { background: #53687E; color: #EFF2F5; }
.sb.inf-agreed { background: var(--gold); color: #fff; }
.sb.inf-shipped { background: var(--burgundy-3); color: #F3EBDF; }
.sb.inf-received { background: var(--burgundy); color: #F3EBDF; }
.sb.inf-posted { background: var(--green); color: #EFF3EE; }
.sb.inf-done { background: rgba(78,107,74,.18); color: var(--green); }
.sb.inf-off { background: var(--panel-2); color: var(--muted); text-decoration: line-through; }
.ship-note { font-size: 10px; color: var(--gold-ink); margin-top: 2px; padding-left: 8px; letter-spacing: .03em; }
.ship-del { background: none; border: none; color: var(--line); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.ship-del:hover { color: var(--red); }
.tr-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tr-row .tr-name { flex: 1; }
.tr-row .tr-min, .tr-row .tr-max { width: 70px; }

/* ---------- dashboard v2 ---------- */
.today-panel {
  background: var(--burgundy); color: #F3EBDF; border-radius: var(--radius);
  padding: 18px 22px 14px; margin-bottom: 20px;
  background-image: radial-gradient(ellipse at 85% 0%, rgba(255,255,255,.05), transparent 55%);
}
.tp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.tp-head span { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; }
.tp-head a { color: rgba(243,235,223,.65); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; }
.tp-head a:hover { color: #fff; }
.tp-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(243,235,223,.14); }
.tp-when {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  padding: 4px 9px; border-radius: 10px; background: rgba(243,235,223,.12); color: rgba(243,235,223,.75);
  white-space: nowrap; flex-shrink: 0; min-width: 76px; text-align: center;
}
.tp-when.now { background: var(--gold); color: #fff; }
.tp-when.over { background: var(--red); color: #fff; }
.tp-body { flex: 1; min-width: 0; }
.tp-t { font-size: 13.5px; font-weight: 600; }
.tp-m { font-size: 11px; color: rgba(243,235,223,.6); margin-top: 2px; letter-spacing: .04em; }
.tp-m a { color: rgba(243,235,223,.85); }
.tp-done {
  background: transparent; border: 1px solid rgba(243,235,223,.5); color: #F3EBDF; border-radius: var(--radius);
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; padding: 7px 14px; font-weight: 600; flex-shrink: 0;
}
.tp-done:hover { background: #F3EBDF; color: var(--burgundy); }
.tp-empty { font-size: 12.5px; color: rgba(243,235,223,.65); padding: 8px 0 4px; letter-spacing: .04em; }

/* priority alert strip — the "impossible to miss" layer */
.priority { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 15px 18px; margin-bottom: 18px; }
.priority.has-red { border-color: var(--red); background: #F6E7E3; }
.pri-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.priority.has-red .pri-head .kicker { color: var(--red); }
.pri-count { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.al-row { display: flex; flex-wrap: wrap; gap: 9px; }
.al-chip { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; border-radius: 20px; padding: 7px 14px 7px 8px; font-size: 12.5px; letter-spacing: .01em; border: 1px solid transparent; transition: transform .1s ease; }
.al-chip:hover { transform: translateY(-1px); }
.al-chip b { font-size: 13px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.al-chip.red { background: var(--red); color: #F7EAE7; } .al-chip.red b { background: rgba(255,255,255,.22); color: #fff; }
.al-chip.amber { background: var(--panel-2); color: var(--ink); border-color: var(--line); } .al-chip.amber b { background: var(--gold); color: #fff; }
.al-chip span { font-weight: 500; }
.al-calm { font-size: 13.5px; color: var(--green); font-weight: 500; letter-spacing: .02em; }

.tile-group { margin-bottom: 16px; }
.tile-label { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.tile-group .mini-row { margin-bottom: 0; }
.rc-n { display: inline-block; background: var(--burgundy); color: #F3EBDF; border-radius: 9px; font-size: 10px; font-weight: 700; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.rc-split { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: grid; gap: 6px; }
.rc-split div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rc-split span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.rc-split b { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.mini-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.mini {
  display: flex; align-items: baseline; gap: 9px; border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 10px 16px; cursor: pointer; transition: border-color .12s;
}
.mini:hover { border-color: var(--burgundy); }
.mini b { font-size: 21px; font-weight: 300; line-height: 1; }
.mini span { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mini.hot { background: var(--burgundy); border-color: var(--burgundy); }
.mini.hot b, .mini.hot span { color: #F3EBDF; }
.mini.warm b { color: var(--red); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 1020px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-rail .rail-card { padding: 18px 20px; margin-bottom: 16px; }
.rail-card h3 { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; color: var(--ink); }
.rail-row { display: block; text-decoration: none; color: var(--ink); padding: 9px 0; border-top: 1px solid var(--line); }
.rail-row:hover .rr-t { color: var(--burgundy); }
.rr-t { font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.rr-m { font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .06em; }
.rail-empty { font-size: 12px; color: var(--muted); padding: 6px 0; }
.rail-cta { display: inline-block; margin-top: 10px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; text-decoration: none; }
.pulse { display: flex; gap: 22px; padding: 6px 0 2px; }
.pulse b { font-size: 24px; font-weight: 300; display: block; }
.pulse span { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pulse .pulse-hot b { color: var(--red); }

/* ---------- calendar ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-head div { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { min-height: 92px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #FBF8F1; cursor: pointer; transition: border-color .12s; overflow: hidden; }
.cal-day:hover { border-color: var(--burgundy); }
.cal-empty { background: transparent; border-color: transparent; cursor: default; }
.cal-today { border-color: var(--gold-ink); border-width: 2px; background: #F8F2E2; }
.cal-num { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cal-today .cal-num { color: var(--gold-ink); }
.cal-chip { font-size: 10px; line-height: 1.3; background: var(--burgundy); color: #F3EBDF; border-radius: 3px; padding: 3px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.over { background: var(--red); }
.cal-chip.done { background: var(--panel-2); color: var(--muted); text-decoration: line-through; }
.cal-chip.more { background: transparent; color: var(--muted); padding: 0 6px; }
.ag-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ag-row:last-child { border-bottom: none; }
.ag-t { font-size: 14px; font-weight: 600; }
.ag-m { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }
.ag-n { font-size: 12.5px; color: #5d4c42; margin-top: 5px; line-height: 1.5; }
.empty .big { font-size: 20px; color: var(--ink); font-weight: 400; margin-bottom: 8px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 12px; }

/* ---------- phone / tablet ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
  header { flex-wrap: wrap; height: auto; padding: 9px 14px; gap: 8px 10px; }
  .brand { font-size: 15px; }
  .wing-switch { margin-right: auto; }              /* keeps bell + New on row 1, pushed right */
  .hdr-user { display: none; }                      /* identity still in Settings; saves width */
  nav { order: 5; flex-basis: 100%; gap: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  nav::-webkit-scrollbar { display: none; }
  nav a, .nav-group-btn { padding: 8px 9px; white-space: nowrap; }
  .nav-drop { position: absolute; }                 /* dropdowns still overlay, not push the row */

  main { padding: 20px 14px 72px; }
  .page-head h1 { font-size: 25px; }
  .hero h1 { font-size: 27px; }

  .case-layout, .dash-grid, .ins-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: 1fr 1fr; }

  .filters { gap: 8px; }
  .filters input.field { min-width: 0; width: 100%; flex: 1 1 100%; }

  .modal { padding: 20px 16px; max-height: 92vh; }
  .modal [style*="grid-template-columns:1fr 1fr"],
  .modal [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  table.cases { min-width: 620px; }                 /* scrolls inside .table-scroll, never crushes */
  .today-panel, .priority, .inbox-banner { padding-left: 15px; padding-right: 15px; }
  .tp-row { flex-wrap: wrap; }
}

@media (max-width: 460px) {
  .stat-row { grid-template-columns: 1fr; }
  .wing-switch a { padding: 7px 12px; }
  .ib-card { flex-basis: 100%; }
}

/* loading skeleton (shown only when a view takes a beat to load) */
.skel { background: linear-gradient(90deg, var(--panel-2), #efe9dd, var(--panel-2)); background-size: 200% 100%; animation: skel 1.15s linear infinite; border-radius: var(--radius); }
@keyframes skel { to { background-position: -200% 0; } }
