/* Shared tokens + primitives for the three Veriti SPAs (warehouse console, merchant portal, public
   pages). The palette is the ops dashboard's (apps/ops/public/index.html :root) with Veriti's own
   accent: gold #b8912f on ink. Each page adds its own layout inline; this file is only what they
   share, so a button, a table or a pill reads the same on every screen. Plain ASCII, no em-dash. */
:root {
  --ink: #14110f; --ink2: #221d19; --muted: #6b7280; --faint: #9ca3af; --line: #e6e8eb; --bg: #f6f7f9; --card: #fff;
  --accent: #b8912f; --accent2: #a07a22; --accent-soft: #fbf5e6; --accent-ink: #fff;
  --green: #2d9f5d; --amber: #b07a00; --red: #b00020; --blue: #2c5aa0;
  --radius: 12px; --radius-sm: 8px;
  --font: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--accent2); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: .5rem .9rem; font-weight: 600; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--accent2); border-color: var(--accent2); }
.btn:focus-visible, .filt:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--red); border-color: #f3b3bf; }
.btn.danger:hover { background: #fdecef; }
.btn.sm { padding: .35rem .6rem; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Inputs */
.filt { font-size: .85rem; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .55rem; background: #fff; }
.chip { font-size: .78rem; padding: .32rem .7rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip b { color: inherit; }

/* Tables */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: .6rem .7rem; background: #fbfbfc; border-bottom: 1px solid var(--line); }
.tbl td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafafb; }
.tbl tr.click { cursor: pointer; }
.tbl .right, .right { text-align: right; }
.mono { font-family: var(--mono); font-size: .85em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: .85rem; }
.faint { color: var(--faint); }

/* Pills */
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: #f3f4f6; color: var(--muted); white-space: nowrap; }
.pill.green { color: var(--green); background: #eaf7ef; border-color: #b6e3c7; }
.pill.amber { color: var(--amber); background: #fffaf0; border-color: #eaddb8; }
.pill.red { color: var(--red); background: #fdecef; border-color: #f3b3bf; }
.pill.blue { color: var(--blue); background: #eef3fb; border-color: #c5d4ee; }
.pill.gold { color: var(--accent2); background: var(--accent-soft); border-color: #e6d3a3; }
.pill.ink { color: #fff; background: var(--ink); border-color: var(--ink); }

/* Cards + panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel > h3 { padding: .8rem 1rem; font-size: .92rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.panel > h3 .muted { font-weight: 400; }
.panel .body { padding: .8rem 1rem; }
.empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }
.empty b { color: var(--ink); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; position: relative; overflow: hidden; cursor: pointer; }
.stat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.stat .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-top: .1rem; font-variant-numeric: tabular-nums; }
.stat.green::after { background: var(--green); } .stat.green .v { color: var(--green); }
.stat.amber::after { background: var(--amber); } .stat.amber .v { color: var(--amber); }
.stat.red::after { background: var(--red); } .stat.red .v { color: var(--red); }

/* Forms */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; color: var(--muted); }
.form label.col2 { grid-column: 1 / -1; }
.form input, .form select, .form textarea { border: 1px solid var(--line); border-radius: 7px; padding: .5rem .6rem; background: #fff; color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form .check { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); }
.form .check input { width: auto; }
.form .hint { font-size: .74rem; color: var(--faint); }

/* Modal */
.scrim { position: fixed; inset: 0; background: rgba(20, 17, 15, .5); display: none; align-items: flex-start; justify-content: center; padding: 2.5rem 1rem; z-index: 50; }
.scrim.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: min(720px, 100%); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); max-height: 92vh; overflow: auto; }
.modal h2 { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.modal .form { padding: 1.1rem 1.3rem; }
.modal .foot { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.3rem; border-top: 1px solid var(--line); }

/* Toasts */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 60; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: #fff; padding: .7rem .9rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: .88rem; border-left: 4px solid var(--accent); }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

@media (max-width: 720px) { .form { grid-template-columns: 1fr; } }

/* [hidden] must beat every author display rule (.btn, .chip, label) or a hidden control still paints. */
[hidden] { display: none !important; }
