/* VIBRIYOGN Ops — dashboard styles. Brand: ink + paper + signal yellow; VIBGYOR spectrum marks locations. */
:root {
  --ink: #0a0a0a;
  --ink-2: #1c1c1c;
  --ink-3: #2c2c2c;
  --paper: #ffffff;
  --ground: #eceef0;
  --line: #d9dce0;
  --line-2: #e7e9ec;
  --text: #16181b;
  --muted: #5b6168;
  --accent: #ffd400;
  --accent-ink: #0a0a0a;
  --good: #1fa85a;
  --warn: #ff8a00;
  --bad: #e63b2e;
  --info: #1e7fd8;
  --s1: #7b3fbf; --s2: #3b3fb5; --s3: #1e7fd8; --s4: #1fa85a; --s5: #e8b900; --s6: #ff8a00; --s7: #e63b2e;
  --spectrum: linear-gradient(90deg, var(--s1), var(--s2), var(--s3), var(--s4), var(--s5), var(--s6), var(--s7));
  --head: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px;
  --r-sm: 8px;
  --side: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, .kpi b { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ── Sign-in ─────────────────────────────────────────── */
.signin { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.signin-card { width: min(420px, 100%); background: var(--paper); border-radius: 18px; overflow: hidden; }
.signin-card .stripe { height: 6px; background: var(--spectrum); }
.signin-card .inner { padding: 28px; }
.signin-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.signin-card .brand img { width: 34px; height: 34px; }
.signin-card .brand span { font-family: var(--head); font-weight: 800; font-size: 18px; }
.signin-card p { color: var(--muted); margin: 6px 0 18px; }
.code-input { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Shell ───────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.side { background: var(--ink); color: #e8e8e8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .stripe { height: 4px; background: var(--spectrum); flex: none; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; text-decoration: none; }
.side .brand img { width: 28px; height: 28px; }
.side .brand b { font-family: var(--head); font-size: 16px; font-weight: 800; color: #fff; }
.side .brand small { display: block; color: #9a9a9a; font-size: 12px; }
.biz { margin: 6px 12px 12px; }
.biz select { width: 100%; background: var(--ink-2); color: #fff; border: 1px solid var(--ink-3); border-radius: var(--r-sm); padding: 9px 10px; }
.nav { display: flex; flex-direction: column; padding: 0 8px 12px; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; color: #cfcfcf; font-size: 14px; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .group { color: #8a8a8a; font-size: 12px; padding: 16px 12px 6px; }
.nav a.soon { color: #8f8f8f; }
.nav a.soon em { margin-left: auto; font-style: normal; font-size: 11px; color: #777; }
.side .who { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--ink-3); font-size: 13px; color: #a8a8a8; }
.side .who b { color: #fff; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.side .who button { background: none; border: 0; color: #a8a8a8; padding: 0; text-decoration: underline; cursor: pointer; font-size: 13px; }

.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 28px clamp(16px, 3vw, 36px) 64px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ro-note { background: #fff7cc; border: 1px solid #f2df85; color: #5a4a00; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; }

/* ── Controls ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9bec4; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-3); }
.btn.signal { background: var(--accent); border-color: #e6bf00; color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); cursor: pointer; text-decoration: underline; font-size: inherit; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
label.f > small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 9px 11px; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.45); }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }

/* ── Surfaces ────────────────────────────────────────── */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head a, .panel-head .linkbtn { font-size: 13px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.grid2 > .panel + .panel { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* KPI strip: one ruled band, not a row of cards */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line-2); }
.kpi:first-child { border-left: 0; }
.kpi span { display: block; color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-family: var(--head); font-size: 26px; font-weight: 800; margin-top: 2px; }
.kpi.alert b { color: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f8f9; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--ground); display: block; }
.thumb.empty { display: grid; place-items: center; color: #9aa0a6; }
.name-cell { display: flex; align-items: center; gap: 12px; }
.name-cell b { font-weight: 600; }
.name-cell small { display: block; color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--ground); color: var(--ink-3); white-space: nowrap; }
.tag.low { background: #ffe9e6; color: #b3261b; }
.tag.good { background: #e3f6ea; color: #136c3a; }
.tag.warn { background: #fff1de; color: #9a5300; }
.tag.info { background: #e3effc; color: #12569b; }
.tag.off { background: #eceef0; color: #6b7178; }
.mv { font-weight: 600; }
.mv.in { color: var(--good); }
.mv.out { color: var(--bad); }

/* Spectrum location chips and the stacked stock bar — the signature element */
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.spread { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); min-width: 120px; }
.spread i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 8px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li .l { min-width: 0; }
.list li .l b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .l small { color: var(--muted); }

.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state .btn { margin-top: 14px; }

.map { height: 360px; border-radius: var(--r-sm); border: 1px solid var(--line); z-index: 0; }
.map.short { height: 240px; }
.map.pick { height: 260px; cursor: crosshair; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--ground); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(10, 10, 10, 0.75); color: #fff; cursor: pointer; line-height: 1; }
.photo.add { border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 13px; text-align: center; padding: 8px; }
.photo.add:hover { border-color: var(--ink); color: var(--ink); }

.quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* Variant builder */
.axes { display: grid; gap: 10px; }
.axis { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; align-items: center; }
.vtable input { min-height: 34px; padding: 6px 8px; }
.vtable td { padding: 6px; }

/* Import steps */
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 10px; line-height: 1.55; }
.steps li .btn { vertical-align: middle; }

/* Being built out */
.soon-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; max-width: 720px; position: relative; overflow: hidden; }
.soon-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, var(--ink) 10px 20px); }
.soon-card h2 { margin-bottom: 8px; }
.soon-card .badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 99px; margin-bottom: 12px; }
.soon-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }
.soon-card li + li { margin-top: 4px; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { background: var(--ink); color: #f2f2f2; padding: 14px; border-radius: var(--r-sm); overflow-x: auto; white-space: pre; margin: 8px 0 0; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* Dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100% - 24px)); max-height: calc(100% - 32px); background: var(--paper); color: var(--text); }
dialog.wide { width: min(900px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(10, 10, 10, 0.55); }
dialog form.d { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.d-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.d-head button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.d-body { padding: 10px 20px; overflow-y: auto; }
.d-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); }
.err { background: #ffe9e6; color: #8e1c13; padding: 9px 12px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 12px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.toast.bad { background: var(--bad); }

.loading { padding: 40px 0; color: var(--muted); }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0; border-top: 1px solid var(--line-2); }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line-2); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; }
  .shell.open .side { transform: none; }
  .shell.open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .topbar b { font-family: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 20px 16px 56px; }
  h1 { font-size: 24px; }
  .axis { grid-template-columns: 1fr; }
  .toolbar input[type=search] { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
