/* =====================================================================================
   Oud & Glory — "oud resin by lamplight"
   Dark agarwood surfaces, brass light, ivory type. Cardo for display and the ledger
   numerals; Source Sans 3 (tabular figures) for everything you read and compare.
   ===================================================================================== */

@font-face { font-family: "Source Sans 3"; src: url(/static/fonts/source-sans-3.woff) format("woff"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(/static/fonts/source-sans-3-italic.woff) format("woff"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Cardo"; src: url(/static/fonts/cardo-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cardo"; src: url(/static/fonts/cardo-italic.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cardo"; src: url(/static/fonts/cardo-bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  /* wood — from the deepest heartwood (sidebar) up to the lightest raised surface */
  --heart: #120E0B;
  --ground: #1A1510;
  --panel: #221B15;
  --raised: #2B231C;
  --pressed: #362C23;
  --well: #15110D;                          /* inputs sit *into* the wood */

  /* ivory ink */
  --ink: #F1E7D8;
  --ink-2: #B8A993;
  --ink-3: #85786A;
  --line: rgba(232, 212, 182, .10);
  --line-2: rgba(232, 212, 182, .06);
  --line-3: rgba(232, 212, 182, .18);

  /* brass light */
  --accent: #D4AF6A;
  --accent-hi: #E9CD92;
  --accent-ink: #1A140E;
  --accent-soft: rgba(212, 175, 106, .12);
  --accent-line: rgba(212, 175, 106, .32);
  --gold: var(--accent); --gold-2: var(--accent-hi); --oud: var(--heart);

  /* states */
  --good: #7FC9A4; --good-soft: rgba(127, 201, 164, .12); --good-line: rgba(127, 201, 164, .3);
  --warn: #EBA45C; --warn-soft: rgba(235, 164, 92, .12); --warn-line: rgba(235, 164, 92, .3);
  --bad: #EE8272;  --bad-soft: rgba(238, 130, 114, .12); --bad-line: rgba(238, 130, 114, .32);

  /* platforms & series (validated on dark wood) */
  --ebay: #6690E6; --tiktok: #DE7440; --shopify: #2BA97F; --demo: #BE9447;

  --r-card: 16px; --r-ctl: 10px; --r-chip: 999px; --r-tag: 6px;
  --lift: inset 0 1px 0 rgba(255, 238, 210, .045), 0 1px 0 rgba(0, 0, 0, .35);
  --float: 0 24px 60px -12px rgba(0, 0, 0, .65), 0 0 0 1px rgba(232, 212, 182, .08);

  --serif: "Cardo", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Source Sans 3", "Fira Sans", -apple-system, "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; display: flex; min-height: 100vh; background: var(--ground); }
a { color: inherit; }
main a:not(.btn):not(.card):not(.list-cta) { color: var(--accent-hi); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
main a:not(.btn):not(.card):not(.list-cta):hover { color: var(--accent); }
b, strong { font-weight: 600; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; letter-spacing: -.005em; margin: 0; color: var(--ink); }
h2 { font-family: var(--sans); font-weight: 600; font-size: 15.5px; letter-spacing: .005em; margin: 0 0 14px; color: var(--ink); }
p { line-height: 1.55; }
hr { border: 0; border-top: 1px solid var(--line); }
.muted { color: var(--ink-2); } .small { font-size: 12.5px; }
.mono { font-family: var(--sans); font-size: 12.5px; letter-spacing: .01em; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums lining-nums; }
::selection { background: rgba(212, 175, 106, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--pressed) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--pressed); border-radius: 10px; border: 3px solid var(--ground); }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ sidebar */
.sidebar { width: 236px; background: var(--heart); color: var(--ink-2); display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; flex-shrink: 0; border-right: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 12px; padding: 26px 22px 24px; color: var(--accent); }
.logo { width: 36px; height: 36px; color: var(--accent); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-size: 23px; color: var(--ink); letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--ink-3); margin-top: 5px; letter-spacing: .02em; }
.list-cta svg { width: 16px; height: 16px; flex-shrink: 0; }
.list-cta { margin: 0 16px 8px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 10px 12px; border-radius: var(--r-ctl);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, #C39A52); color: var(--accent-ink); font-weight: 600; font-size: 13.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -8px rgba(212, 175, 106, .55); transition: filter .15s; }
.list-cta:hover { filter: brightness(1.06); }
.list-cta.alt { background: transparent; color: var(--ink); border: 1px solid var(--line-3); box-shadow: none; font-weight: 500; margin-bottom: 18px; }
.list-cta.alt:hover { border-color: var(--accent-line); background: var(--accent-soft); filter: none; }
nav { display: flex; flex-direction: column; padding: 6px 12px; gap: 1px; flex: 1; overflow-y: auto; }
nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-ctl); text-decoration: none; color: var(--ink-2);
  font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
nav a i { width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; color: var(--ink-3); transition: color .15s; }
nav a i svg { width: 19px; height: 19px; }
nav a:hover { background: rgba(232, 212, 182, .04); color: var(--ink); }
nav a:hover i { color: var(--ink-2); }
nav a.active { background: linear-gradient(90deg, rgba(212, 175, 106, .13), rgba(212, 175, 106, .02)); color: var(--ink); }
nav a.active i { color: var(--accent); }
nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 12px 1px rgba(212, 175, 106, .6); }
nav .pill { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: var(--r-chip); font-size: 11.5px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
nav .pill:empty { display: none; }
nav a.more-btn { display: none; }
.sidebar-foot { padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line-2); }
.sidebar-foot .btn { color: var(--ink-2); }

/* ------------------------------------------------------------------ canvas: the one moment of light */
main { flex: 1; min-width: 0; padding: 38px 44px 96px; max-width: 1480px; position: relative;
  background: radial-gradient(760px 380px at 8% -60px, rgba(212, 175, 106, .11), rgba(212, 175, 106, .03) 45%, transparent 70%) no-repeat; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .spacer, .card-h .spacer { flex: 1; }
.page-head h1 + .muted { margin-top: 10px; align-self: flex-end; padding-bottom: 4px; }
.lead { margin: -14px 0 22px; color: var(--ink-2); max-width: 70ch; }
.full-span { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ cards & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--lift); padding: 20px 22px; color: var(--ink); }
a.card { text-decoration: none; transition: border-color .15s, background .15s; }
a.card:hover { border-color: var(--accent-line); background: #251D17; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-h h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.two { grid-template-columns: 1.4fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.kpi { padding: 18px 22px 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi .value { font-family: var(--sans); font-weight: 300; font-size: 38px; line-height: 1.05; margin-top: 10px; color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.kpi .sub b { color: var(--ink-2); }
.kpi.alert .value { color: var(--bad); } .kpi.warnk .value { color: var(--warn); }
.kpi.alert { border-color: var(--bad-line); background: linear-gradient(180deg, rgba(238, 130, 114, .06), transparent 70%), var(--panel); }
.kpi .delta { font-size: 12px; }
.kpis.mini { grid-template-columns: repeat(4, 1fr); }
.kpis.mini .kpi { padding: 14px 16px; }
.kpis.mini .kpi .value { font-size: 26px; margin-top: 6px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ buttons */
.btn { border: 1px solid var(--line-3); background: var(--raised); color: var(--ink); padding: 8px 15px; border-radius: var(--r-ctl);
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 238, 210, .05); transition: border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: var(--accent-line); background: var(--pressed); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, #C39A52); border-color: #C9A35D; color: var(--accent-ink); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -10px rgba(212, 175, 106, .6); }
.btn.primary:hover { filter: brightness(1.06); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(232, 212, 182, .05); color: var(--ink); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad-line); background: var(--bad-soft); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; transform: none; }
.x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-3); width: 28px; height: 28px; border-radius: 8px; }
.x:hover { color: var(--ink); background: rgba(232, 212, 182, .06); }

/* ------------------------------------------------------------------ forms */
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--well); border: 1px solid var(--line-3); border-radius: var(--r-ctl);
  padding: 9px 11px; width: 100%; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: rgba(232, 212, 182, .26); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 175, 106, .18), inset 0 1px 2px rgba(0, 0, 0, .35); }
input[readonly] { color: var(--ink-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; box-shadow: none; padding: 0; }
input[type=date] { color-scheme: dark; }
input[type=file] { padding: 7px; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23B8A993' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
select option { background: var(--raised); color: var(--ink); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13.5px; color: var(--ink); }
label .help { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; cursor: pointer; }
.check input { width: 16px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; color: var(--ink-2); }
label.inline input { width: auto; padding: 4px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.search { max-width: 360px; padding-left: 36px !important;
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385786A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center !important; }
.req { color: var(--bad); }
.error { color: var(--bad); min-height: 1em; margin: 0; }

/* ------------------------------------------------------------------ tabs, chips, badges */
.tabs { display: inline-flex; gap: 2px; background: var(--well); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: color .15s, background .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--raised); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 238, 210, .06), 0 1px 3px rgba(0, 0, 0, .4); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 5px; }
.tabs button.on .count { color: var(--accent); }
.report-tabs { display: flex; margin-bottom: 20px; width: fit-content; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.report-tabs button { white-space: nowrap; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 12px 0; font-size: 13px; color: var(--ink-2); }
.chip { border: 1px solid var(--line-3); background: var(--raised); color: var(--ink); border-radius: var(--r-chip); padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-tag);
  background: rgba(232, 212, 182, .07); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.accent { background: var(--accent-soft); color: var(--accent-hi); }
.pill-in { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-chip); font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 5px; }
.plat { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.plat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #888) 18%, transparent); }
.plat.ebay, .dot.ebay { --c: var(--ebay); } .plat.shopify, .dot.shopify { --c: var(--shopify); } .plat.tiktok, .dot.tiktok { --c: var(--tiktok); } .plat.demo, .dot.demo { --c: var(--demo); }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  color: color-mix(in srgb, var(--c) 55%, #fff); background: color-mix(in srgb, var(--c) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); }
.dot.err { outline: 2px solid var(--bad); outline-offset: 1px; }
.info { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line-3); color: var(--ink-3);
  font-size: 11px; cursor: help; font-weight: 600; font-family: var(--sans); }
.info:hover { color: var(--accent); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ tables & lists */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; } td.c, th.c { text-align: center; }
td.num { white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click td { transition: background .12s; }
tr.click:hover td { background: rgba(232, 212, 182, .035); }
tr.click:hover td:first-child { box-shadow: inset 2px 0 var(--accent); }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-3); border-bottom: 0; }
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; box-shadow: inset 0 0 0 1px var(--line);
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23857865' stroke-width='1.2' stroke-linejoin='round'%3E%3Crect x='17.5' y='8' width='5' height='4' rx='.8'/%3E%3Cpath d='M16 12h8v2.5c3.2 1 5 3.6 5 7.2V30a2 2 0 0 1-2 2H13a2 2 0 0 1-2-2v-8.3c0-3.6 1.8-6.2 5-7.2z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod .t { font-weight: 500; line-height: 1.3; color: var(--ink); }
.stock-n { font-size: 19px; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stock-n.zero { color: var(--bad); } .stock-n.low { color: var(--warn); }
.empty { text-align: center; padding: 44px 12px; color: var(--ink-2); }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; color: var(--ink-2); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row.total { border-top: 1px solid var(--line-3); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.section-t { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--accent-hi); letter-spacing: .01em; }
.lvl-error { color: var(--bad); } .lvl-warn { color: var(--warn); }
.bad-t { color: var(--bad); }
.num.in { color: var(--good); font-weight: 600; } .num.out { color: var(--ink); font-weight: 600; }
.num.big, b.big { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ orders & accounts */
.orders { display: flex; flex-direction: column; gap: 10px; }
.order { display: grid; grid-template-columns: 1.1fr 2fr auto; gap: 18px; align-items: start; transition: border-color .15s; }
.order:hover { border-color: var(--accent-line); }
.order .lines { display: flex; flex-direction: column; gap: 5px; }
.order .line { display: flex; gap: 10px; align-items: baseline; }
.order .qty { font-size: 16px; font-weight: 700; line-height: 1.2; min-width: 28px; color: var(--ink-2); }
.order .qty.multi { color: var(--accent); }
.order .actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.order .actions b { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.acc-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.acc .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.acc .name { font-family: var(--serif); font-size: 23px; margin-top: 6px; }
.acc .stats { display: flex; gap: 20px; margin: 14px 0; color: var(--ink-3); font-size: 12.5px; }
.acc .stats b { color: var(--ink); font-size: 20px; font-weight: 600; display: block; letter-spacing: -.01em; }
.acc .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.acc .err { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line); border-radius: var(--r-ctl); padding: 9px 11px; font-size: 13px; margin-bottom: 12px; word-break: break-word; }
.toggle-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.add-acc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border-style: dashed; border-color: var(--line-3); min-height: 220px; color: var(--ink-2); background: transparent; box-shadow: none; }
.add-acc:hover { border-color: var(--accent-line); color: var(--accent-hi); background: var(--accent-soft); }

/* ------------------------------------------------------------------ overlays */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 6, 4, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex;
  align-items: flex-start; justify-content: center; z-index: 50; padding: 6vh 16px; overflow-y: auto; animation: fade .16s ease-out; }
.modal { background: var(--panel); border-radius: 20px; width: 100%; max-width: 660px; box-shadow: var(--float); animation: rise .2s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { max-width: 940px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.15; }
.modal-b { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-f { padding: 14px 24px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.note { background: linear-gradient(90deg, rgba(212, 175, 106, .10), rgba(212, 175, 106, .03)); border: 1px solid rgba(212, 175, 106, .16); border-left: 2px solid var(--accent);
  border-radius: 4px 12px 12px 4px; padding: 11px 16px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.note.warn { background: linear-gradient(90deg, rgba(235, 164, 92, .11), rgba(235, 164, 92, .03)); border-color: rgba(235, 164, 92, .18); border-left-color: var(--warn); }
.note .btn { margin-left: 8px; }
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper input { width: 96px; text-align: center; font-size: 20px; font-weight: 600; }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 8px); background: var(--ink); color: var(--accent-ink); padding: 11px 20px;
  border-radius: var(--r-chip); font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 90; max-width: 90vw;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, .7); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#tip { position: fixed; z-index: 80; pointer-events: none; opacity: 0; transition: opacity .12s; background: var(--raised); color: var(--ink-2);
  border: 1px solid var(--line-3); border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.55; box-shadow: var(--float); max-width: 290px; }
#tip b { color: var(--ink); font-weight: 600; }
.sel-bar { position: sticky; bottom: 16px; margin-top: 16px; background: var(--raised); color: var(--ink); border: 1px solid var(--accent-line); border-radius: 14px;
  padding: 10px 12px 10px 20px; display: flex; align-items: center; gap: 12px; box-shadow: var(--float); }
.sel-bar .spacer { flex: 1; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent); margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }

/* ------------------------------------------------------------------ charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 14px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b span { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--accent-hi), #A9843F); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .9; }
.bars .b:hover span { opacity: 1; }
.bars .b small { color: var(--ink-3); font-size: 11.5px; }
.chart { display: block; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11.5px; font-family: var(--sans); }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .bar:hover { filter: brightness(1.15); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hb { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hb-t { height: 8px; background: rgba(232, 212, 182, .06); border-radius: 99px; overflow: hidden; }
.hb-t span { display: block; height: 100%; border-radius: 99px; }
.hb-v { font-weight: 600; min-width: 68px; text-align: right; font-variant-numeric: tabular-nums; }
.heat { display: grid; gap: 3px; font-size: 11px; overflow-x: auto; }
.heat .hl { color: var(--ink-3); text-align: center; font-size: 11px; }
.heat .hr { color: var(--ink-2); padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; align-self: center; font-size: 12.5px; }
.heat .hc { height: 20px; border-radius: 4px; }
.heat .hc:hover { outline: 2px solid var(--accent-hi); outline-offset: 0; }
.agebar { display: flex; gap: 2px; height: 14px; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; background: rgba(232, 212, 182, .05); }
.agebar span { min-width: 3px; }
.agelegend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-2); }
.agelegend b { color: var(--ink); }

/* ------------------------------------------------------------------ reports & money */
.rangebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.rangebar select { width: auto; min-width: 180px; }
.rangebar .dates { display: flex; gap: 6px; align-items: center; color: var(--ink-3); }
.rangebar .dates input { width: auto; }
.rangebar .dates.ro input { color: var(--ink-2); background: transparent; box-shadow: none; border-color: var(--line); }
.delta { font-weight: 600; font-size: 12px; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
table.stmt td { padding: 8px 4px; border-bottom: 0; }
table.stmt tr.sec td { padding-top: 20px; font-size: 13px; font-weight: 600; color: var(--accent-hi); }
table.stmt td.ind { padding-left: 18px; color: var(--ink-2); }
table.stmt tr.sub td { border-top: 1px solid var(--line); font-weight: 600; }
table.stmt tr.gp td { border-top: 1px solid var(--line-3); font-size: 18px; font-weight: 600; padding-top: 14px; }
table.stmt tr.np td { border-top: 1px solid var(--accent-line); border-bottom: 3px double var(--accent-line); font-size: 24px; font-weight: 300; padding: 14px 4px;
  color: var(--accent-hi); letter-spacing: -.02em; }
.money-box, .sumbox { background: var(--well); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; }
.money-box .list-row.total, .sumbox .list-row.total { font-size: 18px; font-weight: 600; }
.iline { display: grid; grid-template-columns: 1fr 2fr 80px 100px 30px; gap: 6px; margin-bottom: 6px; }
.imp h2 { font-size: 16px; margin-bottom: 6px; }
.imp p { margin: 0 0 12px; line-height: 1.55; font-size: 13.5px; color: var(--ink-2); }
.imp .btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cash-kpi { background: radial-gradient(400px 160px at 0% 0%, rgba(212, 175, 106, .16), transparent 70%), var(--panel); border-color: var(--accent-line); }
.cash-kpi .label { color: var(--accent-hi); } .cash-kpi a { color: var(--accent-hi); }
select.txcat { padding: 6px 30px 6px 10px; font-size: 13px; min-width: 180px; background-position: right 10px center; }
select.txcat.unsorted { border-color: var(--warn-line); background-color: rgba(235, 164, 92, .07); }

/* ------------------------------------------------------------------ list a product */
.nl { display: flex; flex-direction: column; gap: 16px; max-width: 1000px; padding-bottom: 96px; }
.nl-sec { display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.nl-n { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--accent-line); color: var(--accent-hi); display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; background: var(--accent-soft); }
.nl-b { min-width: 0; }
.nl-b h2 { margin-bottom: 6px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.ph { position: relative; width: 116px; height: 116px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--well); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .main { position: absolute; left: 6px; top: 6px; background: rgba(18, 14, 11, .85); color: var(--accent-hi); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-chip); }
.ph-a { position: absolute; right: 5px; bottom: 5px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.ph:hover .ph-a, .ph:focus-within .ph-a { opacity: 1; }
.ph-a button { border: 0; background: rgba(18, 14, 11, .85); color: var(--ink); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.drop { border: 1.5px dashed var(--line-3); border-radius: 16px; padding: 28px; text-align: center; background: rgba(232, 212, 182, .02); color: var(--ink-2); transition: border-color .15s, background .15s; }
.drop b { color: var(--ink); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop a { color: var(--accent-hi); }
.small-drop { padding: 16px; }
.vt td { padding: 4px; } .vt input { padding: 7px 8px; } .vt th { padding: 6px 4px; }
.acc-group { margin-bottom: 12px; }
.acc-pick { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  margin-top: 6px; font-weight: 500; cursor: pointer; background: var(--well); transition: border-color .15s, background .15s; }
.acc-pick:hover { border-color: var(--line-3); }
.acc-pick.on { border-color: var(--accent-line); background: var(--accent-soft); }
.acc-pick input { width: 16px; }
.acc-pick .spacer { flex: 1; }
.acc-probs { flex-basis: 100%; font-size: 13px; color: var(--warn); font-weight: 400; padding-left: 26px; line-height: 1.6; }
.catpick { display: flex; gap: 6px; }
.catres { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.catopt { text-align: left; border: 1px solid var(--line); background: var(--well); color: var(--ink); border-radius: var(--r-ctl); padding: 9px 12px; cursor: pointer; font: inherit; }
.catopt:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.catsel { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--good-soft); border: 1px solid var(--good-line); }
.nl-bar { position: fixed; left: 236px; right: 0; bottom: 0; background: rgba(26, 21, 16, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 14px 44px; display: flex; gap: 10px; align-items: center; z-index: 30; }
.nl-bar .spacer { flex: 1; }
.lp-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); }
.lp-row .spacer { flex: 1; }
.lp-i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: rgba(232, 212, 182, .06); color: var(--ink-3); }
.lp-row.working .lp-i { background: var(--accent-soft); color: var(--accent); animation: pulse 1s infinite; }
.lp-row.listed .lp-i { background: var(--good-soft); color: var(--good); }
.lp-row.failed .lp-i { background: var(--bad-soft); color: var(--bad); }
.lp-row.failed .lp-m { color: var(--bad); font-size: 13px; max-width: 60%; text-align: right; }
.lp-m a { color: var(--accent-hi); }

/* safety & compliance */
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mlbox { display: flex; align-items: center; gap: 6px; }
.mlbox input { width: 100%; }
.mlbox span { color: var(--ink-3); font-size: 13px; }
.docchip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border: 1px solid var(--good-line); border-radius: 12px; background: var(--good-soft); }
.docchip a { color: var(--ink); font-weight: 600; }
.certs { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; background: var(--well); }
.cert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-2); }
.cert:first-of-type { border-top: 0; }
.cert .spacer { flex: 1; }
.cert label.btn { flex-direction: row; font-weight: 500; }

/* product editor */
.ed-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ed-head .spacer { flex: 1; }
.ed-title { font-size: 30px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.ed-head a.muted { text-decoration: none; }
.link-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.link-row .spacer { display: none; }
.link-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 240px; }
.lchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--good-line); background: var(--good-soft); color: var(--ink); border-radius: var(--r-chip);
  padding: 3px 6px 3px 11px; font-size: 12.5px; }
.lchip.off { background: rgba(232, 212, 182, .04); border-color: var(--line); color: var(--ink-3); }
.lchip.err { background: var(--bad-soft); border-color: var(--bad-line); }
.lchip a { color: var(--accent-hi); text-decoration: none; }
.lchip button { border: 0; background: rgba(232, 212, 182, .08); color: var(--ink-2); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; }

/* goods in */
.gi-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table.gi td { vertical-align: top; }
table.gi tr.gi-ok td:first-child { box-shadow: inset 3px 0 var(--good); }
table.gi tr.gi-maybe td:first-child { box-shadow: inset 3px 0 var(--warn); }
table.gi tr.gi-none td:first-child { box-shadow: inset 3px 0 var(--bad); }
table.gi tr.gi-ignored { opacity: .45; }
.newp { display: grid; grid-template-columns: 1fr 2fr 90px; gap: 4px; }
.rawtext { white-space: pre-wrap; max-height: 200px; overflow: auto; background: var(--well); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; font-size: 12px; color: var(--ink-2); }
.gi-done { text-align: center; padding: 12px; }
.gi-done .big { font-size: 64px; font-weight: 300; color: var(--good); line-height: 1; letter-spacing: -.03em; }

/* ------------------------------------------------------------------ wholesale */
.ob { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ob-side { position: sticky; top: 16px; }
.ob-add { position: relative; margin-bottom: 12px; }
.ob-add input { width: 100%; font-size: 15.5px; padding: 12px 14px; }
.ob-res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--raised); border: 1px solid var(--line-3); border-radius: 14px;
  box-shadow: var(--float); max-height: 380px; overflow: auto; }
.ob-res:empty { display: none; }
.ob-hit { display: grid; grid-template-columns: 1fr auto 84px; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.ob-hit:last-child { border-bottom: 0; }
.ob-hit:hover { background: var(--accent-soft); }
.ob-hit b.num { text-align: right; }
.ob-lines input[type=number] { width: 84px; text-align: right; padding: 6px 8px; }
.ob-lines input[type=checkbox] { width: 16px; }
.wpr-in { width: 82px; text-align: right; padding: 5px 7px; border-color: transparent; background: transparent; box-shadow: none; }
.wpr-in:hover { border-color: var(--line-3); }
.wpr-in:focus { background: var(--well); }
.wpr-in.saved { color: var(--good); }
.chase-log { max-height: 280px; overflow: auto; }
.chase { position: relative; border-left: 2px solid var(--line-3); padding: 4px 30px 10px 12px; margin-bottom: 4px; font-size: 13.5px; }
.chase.promise { border-color: var(--accent); } .chase.hold { border-color: var(--bad); } .chase.reminder { border-color: var(--tiktok); } .chase.release { border-color: var(--good); }
.chase .x { position: absolute; right: 0; top: 0; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }

/* ------------------------------------------------------------------ sign in */
.login-body { align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(700px 420px at 50% 0%, rgba(212, 175, 106, .16), transparent 70%), radial-gradient(900px 600px at 50% 120%, rgba(110, 60, 30, .22), transparent 70%), var(--heart); }
.login-card { width: 380px; max-width: 92vw; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: stretch; }
.login-mark { color: var(--accent); display: flex; justify-content: center; }
.login-mark .logo { width: 76px; height: 76px; filter: drop-shadow(0 0 24px rgba(212, 175, 106, .35)); }
.login-title { font-family: var(--serif); font-size: 46px; color: var(--ink); line-height: 1; margin-top: 8px; }
.login-sub { font-size: 14px; color: var(--ink-3); }
.rule { display: flex; align-items: center; gap: 14px; color: var(--accent); font-size: 8px; margin: 12px 0 10px; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-line), transparent); }
.login-card label { text-align: left; color: var(--ink-2); font-weight: 500; }
.login-card input { padding: 13px 14px; font-size: 15.5px; }
.login-card .btn.primary { padding: 13px; font-size: 15px; margin-top: 4px; }
.login-card .error { color: var(--bad); }

/* ------------------------------------------------------------------ mobile */
.hide-desktop { display: none; }
@media (max-width: 980px) { .ob { grid-template-columns: 1fr; } .ob-side { position: static; } .grid.three { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body { flex-direction: column; }
  main { padding: 22px 16px 100px; background-size: 140% 300px; }
  h1 { font-size: 31px; }
  .sidebar { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; z-index: 40; flex-direction: row; border-right: 0; border-top: 1px solid var(--line);
    background: rgba(18, 14, 11, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-bottom: env(safe-area-inset-bottom); }
  .sidebar .brand, .hide-mobile { display: none !important; }
  nav { flex-direction: row; justify-content: space-around; padding: 6px 4px; overflow: visible; }
  nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 8px; }
  nav a i svg { width: 22px; height: 22px; }
  nav a.active { background: none; }
  nav a.active::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 2px; }
  nav .pill { position: absolute; top: 0; right: 2px; }
  nav a.more-btn { display: flex; }
  .hide-desktop { display: initial; }
  .card { padding: 16px; border-radius: 14px; }
  .kpi .value { font-size: 30px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis.mini { grid-template-columns: 1fr 1fr; }
  table.resp thead { display: none; }
  table.resp tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  table.resp td { border: 0; padding: 3px 4px; }
  table.resp td.hm, .hm { display: none; }
  .order { grid-template-columns: 1fr; } .order .actions { align-items: stretch; flex-direction: row; }
  .form-grid { grid-template-columns: 1fr; } .form-grid.four { grid-template-columns: 1fr 1fr; } .span2 { grid-column: auto; }
  .hb { grid-template-columns: minmax(90px, 40%) 1fr auto; }
  .iline { grid-template-columns: 1fr 1fr; }
  .rangebar select { min-width: 0; flex: 1; }
  .nl-sec { grid-template-columns: 1fr; } .nl-n { display: none; }
  .nl-bar { left: 0; bottom: 64px; padding: 10px 14px; flex-wrap: wrap; } .nl-bar #nl-sum { flex-basis: 100%; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; }
  .search { max-width: none; }
}
.consent-list { text-align: left; margin: 0 0 4px; padding-left: 18px; color: var(--ink-2); line-height: 1.7; font-size: 14px; }
.consent .login-sub { line-height: 1.55; }

/* ------------------------------------------------------------------ who's signed in */
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who-n { color: var(--ink); font-weight: 500; }
.who-r { color: var(--ink-3); font-size: 12px; }
.foot-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-left: -10px; }
.actor { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent-hi); background: var(--accent-soft); border-radius: var(--r-tag); padding: 0 6px; margin-right: 6px; }
nav .pill.late { background: var(--bad); color: #1A0E0B; }
.up-t { color: var(--good); } .good-t { color: var(--good); }

/* ------------------------------------------------------------------ morning briefing */
.brief-card { margin-bottom: 16px; padding: 0; overflow: hidden; }
.brief-card:empty { display: none; }
.brief { padding: 20px 24px; background: radial-gradient(520px 200px at 0% 0%, rgba(212, 175, 106, .12), transparent 70%); }
.brief-h { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.brief-g { font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--ink); }
.brief-d { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.brief-y { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.brief-y b { font-size: 28px; font-weight: 300; letter-spacing: -.02em; }
.brief-l { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.brief-l li { display: flex; gap: 10px; align-items: baseline; }
.brief-l li::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.brief-l li.lv-warn::before { background: var(--warn); } .brief-l li.lv-bad::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.brief-l a { color: var(--ink) !important; text-decoration: none !important; }
.brief-l a:hover { color: var(--accent-hi) !important; }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; height: calc(100vh - 170px); min-height: 520px; }
.inbox-list, .inbox-view { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--lift); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.inbox-tools { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.inbox-tools .search { max-width: none; }
.threads { overflow-y: auto; flex: 1; }
.thr { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 12px 14px; cursor: pointer; font: inherit; position: relative; }
.thr:hover { background: rgba(232, 212, 182, .03); }
.thr.on { background: var(--accent-soft); }
.thr.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }
.thr-top { display: flex; align-items: center; gap: 6px; }
.thr-top .spacer { flex: 1; }
.thr.needs b { color: var(--ink); } .thr:not(.needs) b { color: var(--ink-2); font-weight: 500; }
.thr-s { font-size: 13px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr-b { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thr-a { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.wait { font-size: 12px; font-weight: 600; color: var(--ink-2); background: rgba(232, 212, 182, .07); border-radius: var(--r-tag); padding: 1px 7px; }
.wait.soon { color: var(--warn); background: var(--warn-soft); } .wait.late { color: var(--bad); background: var(--bad-soft); }
.conv-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.conv-h .spacer { flex: 1; }
.conv-t { font-family: var(--serif); font-size: 21px; display: flex; align-items: center; gap: 4px; }
.conv-ctx { display: flex; gap: 24px; flex-wrap: wrap; padding: 12px 18px; background: var(--well); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.conv-ctx > div { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.conv { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bub { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.bub.in { align-self: flex-start; } .bub.out { align-self: flex-end; align-items: flex-end; }
.bub-b { padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: 14px; }
.bub.in .bub-b { background: var(--raised); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.out .bub-b { background: linear-gradient(180deg, rgba(212, 175, 106, .22), rgba(212, 175, 106, .14)); border: 1px solid var(--accent-line); border-bottom-right-radius: 4px; }
.bub-m { font-size: 11.5px; color: var(--ink-3); padding: 0 4px; }
.composer { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.composer textarea { min-height: 96px; }
.composer-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-a .spacer { flex: 1; }
.small-in { width: auto; flex: 1; min-width: 180px; max-width: 360px; padding: 7px 10px; font-size: 13px; }

/* ------------------------------------------------------------------ pricing */
.spark { display: block; }
b.sugg { color: var(--accent-hi); }
tr.off td { opacity: .5; }

/* ------------------------------------------------------------------ device */
.dev-sec { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--well); display: flex; flex-direction: column; gap: 8px; }
.dev-sec h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.ios-share { display: inline-block; transform: rotate(-90deg); }
.login-card .help { font-weight: 400; color: var(--ink-3); font-size: 12px; }

@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; height: calc(100dvh - 250px); min-height: 420px; }
  .inbox.has-open { height: calc(100dvh - 200px); }
  .small-in { display: none; }
  .conv-ctx { padding: 10px 14px; } .conv { padding: 12px; } .composer textarea { min-height: 70px; }
  .conv-h { padding: 10px 12px; }
  .inbox.has-open .inbox-list { display: none; }
  .inbox:not(.has-open) .inbox-view { display: none; }
  .bub { max-width: 90%; }
  .brief-y { margin-left: 0; align-items: flex-start; }
}

/* compact search box inside a card header (stock report, big lists) */
.search-sm { width: 200px; max-width: 46vw; padding: 7px 11px; font-size: 13px; border-radius: 8px; margin-right: 8px; }

/* ---------- System health ---------- */
.grid.sys2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (max-width: 900px) { .grid.sys2 { grid-template-columns: 1fr; } }
.sys-verdict { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; border-radius: var(--r-card, 14px);
  border: 1px solid var(--line-2); background: var(--panel); font-size: 15px; }
.sys-verdict .muted { margin-left: auto; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-3); }
.good > .sys-dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.warn > .sys-dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.bad > .sys-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.sys-verdict.good { border-color: var(--good-line); } .sys-verdict.warn { border-color: var(--warn-line); } .sys-verdict.bad { border-color: var(--bad-line); }
.sys-checks { list-style: none; margin: 0; padding: 0; }
.sys-checks li { display: flex; align-items: center; gap: 14px; padding: 11px 2px; border-top: 1px solid var(--line-2); }
.sys-checks li:first-child { border-top: 0; }
.sys-checks li > div { flex: 1; min-width: 0; }
.sys-checks li .sys-dot { margin-left: 4px; }
td.warnt { color: var(--warn); }
.sel-sm { width: 64px; min-width: 64px; padding: 4px 22px 4px 10px; font-size: 13px; background-position: right 7px center; }

/* =====================================================================================
   MAISON LAYER — the couture finish
   One cinematic moment (the lamplit vitrine on the dashboard); everything else quieter,
   deeper and more precise: espresso-black ground, film grain, gold-foil hairlines,
   surfaces lit from above like lacquered wood in a perfumer's cabinet.
   ===================================================================================== */
:root {
  --heart: #0C0907;
  --ground: #110D0A;
  --panel: #1A1410;
  --raised: #251D17;
  --pressed: #30261E;
  --well: #0E0B08;
  --ink: #F4ECDF;
  --ink-2: #BDAE97;
  --ink-3: #8A7C6B;
  --line: rgba(236, 214, 178, .09);
  --line-2: rgba(236, 214, 178, .055);
  --line-3: rgba(236, 214, 178, .16);
  --foil: linear-gradient(115deg, #A47A38 0%, #E9CF94 22%, #FFF3D1 34%, #D6B06A 48%, #9C722F 66%, #E6C783 84%, #B88E47 100%);
  --foil-line: linear-gradient(90deg, transparent, rgba(222, 186, 118, .55) 20%, rgba(255, 238, 200, .8) 50%, rgba(222, 186, 118, .55) 80%, transparent);
  --garnet: #5A1A1F;
  --r-card: 18px;
  --lift: inset 0 1px 0 rgba(255, 238, 210, .055), 0 1px 0 rgba(0, 0, 0, .5), 0 18px 40px -28px rgba(0, 0, 0, .9);
}
html, body { background: var(--ground); }

/* the room: a warm lamp off to the top right, a garnet shadow low left, and fine film grain */
.ambience { position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(214, 170, 96, .10), transparent 65%),
    radial-gradient(800px 600px at 8% 110%, rgba(90, 26, 31, .16), transparent 70%); }
.ambience::after { content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
body { isolation: isolate; }
.ambience { z-index: -1; }

/* sidebar: one piece with the room, divided by a gold hairline that fades out at both ends */
.sidebar { background: linear-gradient(180deg, rgba(12, 9, 7, .92), rgba(12, 9, 7, .78)); border-right: 0; backdrop-filter: blur(6px); }
.sidebar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(222, 186, 118, .28) 30%, rgba(222, 186, 118, .14) 70%, transparent); }
.brand { padding: 30px 22px 26px; }
.brand-name { font-size: 25px; letter-spacing: .015em; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; }
.brand-sub { letter-spacing: .14em; font-size: 10.5px; color: var(--ink-3); margin-top: 7px; }
.logo { width: 40px; height: 40px; filter: drop-shadow(0 0 14px rgba(214, 170, 96, .28)); }
nav a { border-radius: 10px; letter-spacing: .005em; }
nav a.active { background: linear-gradient(90deg, rgba(222, 186, 118, .14), rgba(222, 186, 118, .025) 70%, transparent); }
nav a.active::before { background: var(--foil); width: 2px; box-shadow: 0 0 12px rgba(233, 205, 146, .7); }
nav a.active i { color: #E9CD92; filter: drop-shadow(0 0 6px rgba(233, 205, 146, .35)); }
.list-cta, .btn.primary { background: var(--foil); background-size: 180% 100%; background-position: 0% 0; border-color: rgba(255, 236, 196, .35);
  color: #1A120A; letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 250, 235, .55), inset 0 -1px 0 rgba(90, 60, 20, .35), 0 10px 26px -12px rgba(214, 170, 96, .75);
  transition: background-position .6s cubic-bezier(.2, .7, .2, 1), filter .2s, box-shadow .2s; }
.list-cta:hover, .btn.primary:hover { background-position: 100% 0; filter: none;
  box-shadow: inset 0 1px 0 rgba(255, 250, 235, .6), inset 0 -1px 0 rgba(90, 60, 20, .35), 0 14px 30px -12px rgba(214, 170, 96, .9); }
.list-cta.alt { background: rgba(255, 240, 210, .02); border-color: rgba(222, 186, 118, .22); color: var(--ink); box-shadow: none; }
.list-cta.alt:hover { background: rgba(222, 186, 118, .07); border-color: rgba(222, 186, 118, .45); }

/* type: larger, finer display */
h1 { font-size: 44px; letter-spacing: -.012em; font-weight: 400; }
.page-head { margin-bottom: 30px; }
.page-head h1 { text-shadow: 0 2px 30px rgba(0, 0, 0, .5); }

/* surfaces: lacquered, lit from above, edged with a hairline that is brighter at the top */
.card { background: linear-gradient(180deg, rgba(38, 30, 23, .92), rgba(24, 19, 15, .94)); border: 1px solid transparent;
  background-clip: padding-box; position: relative; box-shadow: var(--lift); }
.card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, rgba(236, 214, 178, .17), rgba(236, 214, 178, .05) 40%, rgba(236, 214, 178, .03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.kpi .label { font-size: 12.5px; letter-spacing: .02em; color: var(--ink-3); }
.kpi .value { font-size: 42px; font-weight: 200; letter-spacing: -.025em; margin-top: 12px; }
.kpi::after { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 1px; background: var(--foil-line); opacity: 0; transition: opacity .3s; }
.kpi:hover::after { opacity: .7; }
.kpi.alert { background: linear-gradient(180deg, rgba(238, 130, 114, .07), transparent 60%), linear-gradient(180deg, rgba(38, 30, 23, .92), rgba(24, 19, 15, .94)); }
.kpi.alert::before { background: linear-gradient(180deg, rgba(238, 130, 114, .45), rgba(238, 130, 114, .08)); }

/* controls */
.btn { background: rgba(255, 240, 210, .035); border-color: rgba(236, 214, 178, .14); }
.btn:hover { background: rgba(222, 186, 118, .07); border-color: rgba(222, 186, 118, .4); }
.tabs { background: rgba(8, 6, 4, .55); border-color: rgba(236, 214, 178, .08); }
.tabs button.on { background: linear-gradient(180deg, #2E241C, #241C16); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 238, 210, .08), 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 1px rgba(222, 186, 118, .18); }
input, select, textarea { background: rgba(6, 4, 3, .55); border-color: rgba(236, 214, 178, .12); }
input:focus, select:focus, textarea:focus { border-color: rgba(233, 205, 146, .7); box-shadow: 0 0 0 4px rgba(214, 170, 96, .12), 0 0 22px -6px rgba(214, 170, 96, .5); }
th { font-size: 12px; letter-spacing: .03em; color: var(--ink-3); border-bottom-color: rgba(236, 214, 178, .1); }
tbody tr { transition: background .18s; }
tbody tr:hover td { background: rgba(222, 186, 118, .035); }
.badge { letter-spacing: .01em; }

/* ---------- the vitrine: dashboard briefing (the one bold moment) ---------- */
.brief-card { padding: 0; border-radius: 22px; margin-bottom: 20px; isolation: isolate;
  background: radial-gradient(120% 140% at 85% 0%, #2A1E14 0%, #17110D 55%, #0E0A08 100%); }
.brief-card::before { background: linear-gradient(180deg, rgba(240, 206, 140, .42), rgba(240, 206, 140, .08) 45%, rgba(240, 206, 140, .18)); }
.vitrine-smoke { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: -1; pointer-events: none; }
.vitrine-smoke i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; mix-blend-mode: screen; }
.vitrine-smoke i:nth-child(1) { width: 520px; height: 300px; right: -80px; top: -120px; background: radial-gradient(closest-side, rgba(226, 178, 98, .55), transparent);
  animation: drift1 26s ease-in-out infinite alternate; }
.vitrine-smoke i:nth-child(2) { width: 460px; height: 260px; left: 28%; bottom: -150px; background: radial-gradient(closest-side, rgba(122, 36, 40, .6), transparent);
  animation: drift2 32s ease-in-out infinite alternate; }
.vitrine-smoke i:nth-child(3) { width: 340px; height: 200px; left: -60px; top: -60px; background: radial-gradient(closest-side, rgba(255, 228, 176, .22), transparent);
  animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-140px, 60px) scale(1.15) rotate(8deg); } }
@keyframes drift2 { to { transform: translate(160px, -40px) scale(1.25) rotate(-6deg); } }
@keyframes drift3 { to { transform: translate(120px, 50px) scale(.9); } }
/* a perfume-box inner frame: a second hairline set 10px inside the edge */
.vitrine-frame { position: absolute; inset: 10px; border-radius: 14px; border: 1px solid rgba(233, 205, 146, .13); pointer-events: none; }
.brief { position: relative; padding: 38px 44px 34px; background: none; }
.brief-h { align-items: flex-end; gap: 28px; }
.brief-g { font-size: 54px; line-height: 1; letter-spacing: -.015em; color: #FBF4E8; text-shadow: 0 4px 40px rgba(0, 0, 0, .6); }
.brief-d { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); margin-top: 10px; }
.brief-y { gap: 6px; }
.brief-y .muted { letter-spacing: .08em; font-size: 11px; color: var(--ink-3); }
.brief-y b { font-size: 58px; font-weight: 200; letter-spacing: -.035em; line-height: 1; background: var(--foil); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brief-rule { height: 1px; margin: 28px 0 20px; background: var(--foil-line); opacity: .55; }
.brief-l { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 10px 36px; margin: 0; }
.brief-l li { font-size: 14.5px; line-height: 1.5; }
.brief-l li::before { flex-basis: 6px; height: 6px; transform: translateY(-2px); box-shadow: 0 0 10px rgba(214, 170, 96, .8); }
.brief-l li.lv-warn::before { box-shadow: 0 0 10px rgba(235, 164, 92, .8); }
.brief-l a { color: #EADFCB !important; }
/* the one load-in moment */
.brief > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.brief > *:nth-child(2) { animation-delay: .12s; } .brief > *:nth-child(3) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

/* ---------- sign in: the same vitrine, full screen ---------- */
.login-body { background: radial-gradient(900px 560px at 50% -10%, rgba(214, 170, 96, .18), transparent 65%),
  radial-gradient(900px 600px at 50% 120%, rgba(90, 26, 31, .35), transparent 70%), #0A0706; overflow: hidden; }
.login-body .vitrine-smoke { position: fixed; z-index: 0; }
.login-body .vitrine-smoke i { opacity: .45; }
.login-card { padding: 46px 40px 34px; border-radius: 24px; position: relative; z-index: 1;
  background: linear-gradient(180deg, rgba(34, 26, 20, .72), rgba(16, 12, 9, .82)); backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 238, 210, .08), 0 0 0 1px rgba(233, 205, 146, .14); }
.login-card::after { content: ""; position: absolute; inset: 10px; border-radius: 17px; border: 1px solid rgba(233, 205, 146, .09); pointer-events: none; }
.login-mark .logo { width: 86px; height: 86px; filter: drop-shadow(0 0 30px rgba(214, 170, 96, .45)); }
.login-title { font-size: 52px; background: var(--foil); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.login-sub { letter-spacing: .2em; font-size: 11px; }

@media (max-width: 900px) {
  .brief { padding: 28px 24px 24px; }
  .brief-g { font-size: 40px; }
  .brief-y b { font-size: 44px; }
  .brief-l { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
  .vitrine-frame { inset: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .vitrine-smoke i, .brief > * { animation: none !important; }
}
.brand-name { font-size: 22.5px; white-space: nowrap; }
.kpi .value { font-size: clamp(30px, 2.5vw, 40px); }

/* live sync indicator in the sidebar */
#sync-state { display: inline-flex; align-items: center; gap: 8px; }
#sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
#sync-state.live i { background: var(--good); box-shadow: 0 0 0 0 rgba(127, 201, 164, .6); animation: livepulse 2.4s ease-out infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px rgba(127, 201, 164, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 201, 164, 0); } }
@media (prefers-reduced-motion: reduce) { #sync-state.live i { animation: none; } }
