@font-face { font-family: "Montserrat"; font-weight: 400; src: url("/static/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; src: url("/static/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; src: url("/static/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; src: url("/static/montserrat-latin-700-normal.woff2") format("woff2"); }
:root {
  --brand: #f4931e;         /* My Ecom Guide orange */
  --brand-soft: #fdf0de;
  --ink: #161616;           /* My Ecom Guide black */
  --bg: #f6f5f3; --card: #ffffff; --line: #e8e4df; --muted: #6b6560; --row: #faf8f6;
  --good: #2e8b57; --bad: #d64545; --good-soft: #e4f2ea; --bad-soft: #fbe6e6;
  --c2: #161616; --c3: #b8b1a9; --c4: #f8c27f;  /* chart colors after orange */
  --font: "Montserrat", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --brand-soft: #3a2a14; --ink: #f1eeea; --bg: #121212; --card: #1c1c1c; --line: #2f2c29; --muted: #a39d96; --row: #222;
    --good: #5cc28e; --bad: #f07575; --good-soft: #1d3326; --bad-soft: #3a1f1f; --c2: #e9e5e0; --c3: #7d766f; --c4: #b9792b; color-scheme: dark; }

}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { margin: 0 8px 24px; }
.logo img { width: 176px; display: block; }
.logo small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; border: 0;
  border-left: 3px solid transparent; background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
nav button:hover { background: var(--row); }
nav button.on { background: var(--brand-soft); font-weight: 700; border-left-color: var(--brand); }
nav button b { background: var(--bad); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 11.5px; }
nav button b:empty { display: none; }
nav button b.miss { background: var(--brand); color: #161616; }
.ok { color: var(--good); font-weight: 700; } .miss-t { color: var(--bad); font-weight: 700; } .part { color: #9a5a0a; font-weight: 700; } .na { color: var(--muted); }
body.client-view nav .mine { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.side-foot label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.side-foot select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-weight: 600; font-size: 13px; }
.viewtoggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewtoggle button { flex: 1; border: 0; background: transparent; padding: 7px 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.viewtoggle button.on { background: var(--ink); color: var(--card); }

.content { min-width: 0; }
.bar { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 14px 38px 0; }
#inbox-banner { display: flex; align-items: center; gap: 12px; background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
#inbox-banner:not([hidden]) + .period { margin-left: auto; }
.bar .period { margin-left: auto; }
.period { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.period label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.period select, .period input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); font-weight: 600; font-size: 13px; min-width: 150px; }
.period .dates { display: flex; gap: 10px; }
main { padding: 10px 38px 60px; max-width: 1320px; }
main:focus { outline: none; }

h1 { font-size: 26px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 28px 0 10px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 3px; font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 22px; font-weight: 500; }
.note { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; font-weight: 500; max-width: 90ch; }
.warn { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 10px 14px; border-radius: 6px; margin: 12px 0; max-width: 90ch; }
.empty { padding: 30px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); max-width: 70ch; background: var(--card); }

.card { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(22,22,22,.05), 0 6px 18px rgba(22,22,22,.04); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g11 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0 6px; }
.kpi .vs { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .spark { height: 40px; margin-top: 8px; }
.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.mini > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.mini > div:last-child { border-right: 0; }
.mini .l { color: var(--muted); font-size: 12px; font-weight: 600; } .mini .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.chip.g { background: var(--good-soft); color: var(--good); } .chip.b { background: var(--bad-soft); color: var(--bad); }
.up { color: var(--good); } .down { color: var(--bad); }
.chart { position: relative; height: 260px; }
.chart.short { height: 220px; }

.attn { background: #161616; color: #fff; }
.attn h3 { color: #fff; } .attn .note { color: #a9a39c; }
.attn .al { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; font-weight: 500; }
.attn .al i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--brand); }
.attn .al i.high { background: #ff6b6b; } .attn .al small { display: block; color: #a9a39c; margin-top: 2px; }
.btn { text-decoration: none; display: inline-block; border: 0; background: var(--brand); color: #161616; padding: 9px 15px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.dark { background: var(--ink); color: var(--card); }
.btn:disabled { opacity: .5; cursor: default; }

.tablewrap { overflow-x: auto; border-radius: 14px; background: var(--card); box-shadow: 0 1px 2px rgba(22,22,22,.05), 0 6px 18px rgba(22,22,22,.04); }
.card .tablewrap { box-shadow: none; border-radius: 0; }
.card th, .card td { padding: 8px 8px; }
body.client-view .side-foot label { display: none; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-weight: 500; }
th { font-weight: 600; color: var(--muted); background: var(--card); position: sticky; top: 0; cursor: pointer; user-select: none; }
th.sorted::after { content: " \25BE"; } th.sorted.asc::after { content: " \25B4"; }
td.r, th.r { text-align: right; } td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row); }
tr.click { cursor: pointer; } tr.detail td { background: var(--row); white-space: normal; }
td.bad { color: var(--bad); font-weight: 700; } td.good { color: var(--good); }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
.flag { color: var(--bad); font-weight: 600; } .flag.opp { color: var(--good); }
.sharebar { display: inline-block; width: 64px; height: 7px; background: var(--brand-soft); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.sharebar i { display: block; height: 100%; background: var(--brand); }
.filter { padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); min-width: 260px; margin: 0 0 12px; }

.statement div { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.statement div.sec { font-weight: 700; }
.statement div.ind span:first-child { padding-left: 16px; color: var(--muted); }
.statement div.total { font-weight: 700; font-size: 16px; border-bottom: 0; padding-top: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 5px 13px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.chips button.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.alert { display: grid; grid-template-columns: 5px 1fr auto; background: var(--card); border-radius: 12px; margin-bottom: 10px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(22,22,22,.05), 0 4px 12px rgba(22,22,22,.04); }
.alert .stripe { background: var(--c3); } .alert.high .stripe { background: var(--bad); } .alert.medium .stripe { background: var(--brand); }
.alert .body { padding: 12px 16px; } .alert .t { font-weight: 700; } .alert .m { color: var(--muted); font-size: 12px; margin-top: 4px; }
.alert .acts { display: flex; gap: 6px; align-items: center; padding: 10px 14px; }
.alert .acts button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: 12px; font-weight: 600; }
.alert.resolved { opacity: .55; }
.newdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 7px; }

.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 38px; text-align: center; background: var(--card); cursor: pointer; font-weight: 600; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.formrow { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 14px; align-items: end; }
.formrow label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.formrow select, .formrow input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-width: 160px; }
.status { margin: 10px 0; color: var(--muted); font-weight: 500; }
.act-new, .act-replace { color: var(--good); font-weight: 700; } .act-error { color: var(--bad); font-weight: 700; } .act-skip { color: var(--muted); }

/* Client report: a paper page, also in dark mode, and what prints to PDF */
.paper { background: #fff; color: #161616; max-width: 920px; border-radius: 8px; box-shadow: 0 10px 40px rgba(22,22,22,.10); overflow: hidden;
  --ink: #161616; --muted: #6b6560; --line: #e8e4df; --card: #fff; --row: #faf8f6; --brand-soft: #fdf0de; --good: #2e8b57; --bad: #d64545;
  --good-soft: #e4f2ea; --bad-soft: #fbe6e6; --c2: #161616; --c3: #b8b1a9; --c4: #f8c27f; }
.paper .top { display: flex; justify-content: space-between; align-items: center; padding: 24px 40px 20px; border-bottom: 5px solid var(--brand); }
.paper .top img { height: 58px; display: block; }
.paper .top .m { text-align: right; color: var(--muted); font-size: 13px; font-weight: 500; }
.paper .top h2 { margin: 0 0 3px; font-size: 20px; color: #161616; }
.paper .body { padding: 28px 40px 34px; }
.paper .brief { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 6px; padding: 16px 20px; margin-bottom: 22px; }
.paper .brief h3 { margin-bottom: 8px; } .paper .brief p { margin: 6px 0; line-height: 1.55; }
.paper .kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.paper .kp > div { border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.paper .kp .l { color: var(--muted); font-size: 12px; font-weight: 600; } .paper .kp .v { font-size: 23px; font-weight: 700; margin-top: 2px; }
.paper h4 { font-size: 15px; margin: 22px 0 8px; }
.paper .steps { list-style: none; padding: 0; margin: 0; }
.paper .steps li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.paper .steps li:last-child { border-bottom: 0; }
.st { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #efebe6; color: #6b6560; }
.st.done { background: var(--good-soft); color: var(--good); } .st.progress { background: var(--brand-soft); color: #9a5a0a; }
.paper .foot { color: var(--muted); font-size: 12px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.paper table th { position: static; }
.reportbar { display: flex; gap: 10px; align-items: center; margin: 0 0 16px; flex-wrap: wrap; }

/* Notes editor */
.editor textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); line-height: 1.5; }
.editor .step { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 8px; align-items: start; }
.editor .step textarea { min-height: 0; height: 58px; padding: 8px 10px; resize: vertical; }
.reportpage .editor { margin-bottom: 18px; } .reportpage .ed-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.editor .step input, .editor .step select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.editor .step button { border: 1px solid var(--line); background: transparent; border-radius: 8px; cursor: pointer; }
.pubstate { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: #efebe6; color: #6b6560; }
.pubstate.live { background: var(--good-soft); color: var(--good); }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; } aside { position: static; height: auto; }
  .g4, .g21, .g11, .g3 { grid-template-columns: 1fr; } main, .bar { padding-left: 16px; padding-right: 16px; }
}
@media print {
  @page { size: letter; margin: 0.4in; }
  body { background: #fff; } aside, .bar, .reportbar, .noprint { display: none !important; }
  .app { display: block; } main { padding: 0; max-width: none; }
  .paper { box-shadow: none; border-radius: 0; max-width: none; }
  .paper .grid.g11 { grid-template-columns: 1fr 1fr !important; }
  .paper .chart.short { height: 190px; }
  .paper canvas { max-width: 100% !important; }
  .paper .top { padding: 14px 24px 12px; } .paper .body { padding: 18px 24px 20px; }
  .paper .brief, .paper .kp, .paper .grid, .paper .steps li, .paper tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Sign-in */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.authcard { background: var(--card); border-radius: 16px; padding: 30px 32px; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(22,22,22,.10); }
.authcard img { width: 190px; display: block; margin-bottom: 18px; }
.authcard label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.authcard input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.authcard .err { color: var(--bad); font-weight: 600; min-height: 1.2em; }
body.role-client .admin-only { display: none !important; }
.client-only[hidden] { display: none !important; }
.ccard { margin-bottom: 18px; }
.ccard .row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 8px 0; }
.ccard .row label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--brand-soft); padding: 4px 8px; border-radius: 6px; font-weight: 700; }
.paused-tag { background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }

/* Restock pick lists */
.rlist { margin-bottom: 18px; }
.rlist .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rlist .meta { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.rlist input.q { width: 80px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); text-align: right; }
.rlist input.n, .rlist textarea.n { width: 100%; min-width: 160px; display: block; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.tick { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 3px; }
.pill-status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: #efebe6; color: #6b6560; margin-left: 8px; }
.pill-status.live { background: var(--brand-soft); color: #9a5a0a; } .pill-status.done { background: var(--good-soft); color: var(--good); }
@media print {
  body.print-one main > *:not(.printing) { display: none !important; }
  body.print-one .rlist.printing { box-shadow: none; padding: 0; }
  .rlist .noprint, .rlist button { display: none !important; }
  .rlist table { font-size: 12px; } .rlist th { position: static; }
}

/* Bought together cards */
.basket { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.basket .bc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.basket .bc h4 { margin: 0 0 2px; font-size: 13.5px; line-height: 1.35; }
.basket .bc .o { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.basket .bc ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.basket .bc li { margin: 4px 0; } .basket .bc li span { color: var(--muted); font-weight: 600; margin-left: 4px; }
