/* ============================================================
   Vision Ops — design tokens
   Asphalt charcoal base · wet-gloss teal accent ("the bead")
   Archivo (variable width) display/UI · IBM Plex Mono for data
   ============================================================ */
:root {
  --ink:      #16191d;   /* asphalt */
  --ink-2:    #21262c;
  --ink-3:    #2c333b;
  --paper:    #f2f4f5;   /* clay-bar white */
  --paper-2:  #e6e9eb;
  --bead:     #16b8a6;   /* wet teal */
  --bead-dk:  #0d8577;
  --amber:    #e8a13c;   /* low-stock */
  --red:      #d6544a;
  --line:     #d5dadd;
  --mut:      #6b7680;
  --radius: 10px;
  --font-ui: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--bead-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--bead); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: var(--ink); color: #fff;
  padding: 0 20px; height: 58px;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #7de8dc 0%, var(--bead) 45%, var(--bead-dk) 100%);
  color: var(--ink); font-weight: 800; display: grid; place-items: center;
  box-shadow: inset -2px -3px 6px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.4);
}
.brand-text { font-weight: 800; letter-spacing: .12em; font-stretch: 115%; }
.brand-text em { font-style: normal; color: var(--bead); font-weight: 500; letter-spacing: .02em; }
.mainnav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.mainnav a {
  color: #c8ced4; padding: 6px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; font-stretch: 85%;
}
.mainnav a:hover { color: #fff; background: var(--ink-3); text-decoration: none; }
.mainnav a.on { color: var(--ink); background: var(--bead); }
.userbox { display: flex; align-items: center; gap: 10px; }
.uname { font-size: 13px; color: #c8ced4; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }
.footer { text-align: center; color: var(--mut); font-size: 12px; padding: 20px; }
h1 { font-size: 26px; font-weight: 800; font-stretch: 110%; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.sub { color: var(--mut); margin: 0 0 20px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- cards / KPIs ---------- */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi .lab { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.kpi .val { font-family: var(--font-mono); font-size: 26px; font-weight: 500; margin-top: 2px; }
.kpi .val.warn { color: var(--amber); }
.kpi .val.bad { color: var(--red); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th {
  text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--mut); background: var(--paper-2); padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--paper-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafcfc; }
.num, .sku { font-family: var(--font-mono); font-size: 13.5px; }
.right { text-align: right; }

/* ---------- the bead: status dots + pills ---------- */
.bead { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline;
  background: radial-gradient(circle at 32% 28%, #fff9 0%, currentColor 55%); box-shadow: inset -1px -1px 2px rgba(0,0,0,.25); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: .02em; }
.pill.ok    { background: #dbf5f1; color: var(--bead-dk); }
.pill.warn  { background: #fbeed7; color: #9a6413; }
.pill.bad   { background: #f9e2e0; color: #99372f; }
.pill.mut   { background: var(--paper-2); color: var(--mut); }
.pill.info  { background: #e2ecf9; color: #2b598f; }

/* ---------- forms ---------- */
form.stack { display: grid; gap: 12px; max-width: 560px; }
.frow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: block; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--bead); outline: none; box-shadow: 0 0 0 3px #16b8a622; }
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px;
  transition: background .12s;
}
.btn:hover { background: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--bead-dk); }
.btn.primary:hover { background: var(--bead); color: var(--ink); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--mut); background: transparent; }
.topbar .btn.ghost { color: #c8ced4; border-color: var(--ink-3); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { background: var(--red); }

.flash {
  background: #dbf5f1; border: 1px solid var(--bead); color: var(--bead-dk);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 600;
}

/* ---------- misc ---------- */
.split { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .wrap { padding: 18px 12px 50px; } }
.mut { color: var(--mut); }
.small { font-size: 13px; }
details.card summary { cursor: pointer; font-weight: 700; }

/* ---------- POS ---------- */
.pos-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 900px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-prod button {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-align: left; cursor: pointer; font: inherit;
}
.pos-prod button:hover { border-color: var(--bead); box-shadow: 0 0 0 3px #16b8a622; }
.pos-prod .pname { font-weight: 700; font-size: 13.5px; }
.pos-prod .pprice { font-family: var(--font-mono); color: var(--bead-dk); margin-top: 4px; }

/* ---------- login screens ---------- */
.login-shell {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(1100px 500px at 80% -10%, #16b8a626, transparent 60%),
    var(--ink);
}
.login-card {
  width: min(400px, 92vw); background: #fff; border-radius: 16px; padding: 34px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-card .brand { color: var(--ink); margin-bottom: 18px; }
.login-card h1 { font-size: 20px; }
