/* VM Audit — shared design system.
   Direction: store-floor signage. White floor, true-black ink, one cobalt for "you can act here"
   and for AI. Archivo's width axis does the expressive work: condensed + heavy for signage-like
   names and numbers, normal width for reading. Status colour appears only when it means something. */
:root {
  --bg: #FFFFFF;
  --ink: #000000;
  --ink-2: #5B5E66;      /* graphite: secondary text */
  --ink-3: #9497A0;      /* tertiary / disabled */
  --rule: #E3E4E8;       /* hairlines */
  --rule-2: #C9CBD1;     /* control borders */
  --wash: #F4F5F7;       /* the only fill tone: image wells, hover rows */
  --cobalt: #1B3BFF;     /* action + AI */
  --cobalt-wash: #EEF1FF;
  --red: #D7261E;   --red-wash: #FDEDEC;
  --amber: #B26F00; --amber-wash: #FFF4DF;
  --green: #17804A; --green-wash: #E7F5EC;

  /* legacy aliases so page code written against the first token set keeps working */
  --surface: var(--bg); --subtle: var(--wash); --line: var(--rule); --line-strong: var(--rule-2);
  --accent: var(--ink); --accent-ink: #FFFFFF; --blue: var(--cobalt); --blue-tint: var(--cobalt-wash);
  --red-tint: var(--red-wash); --amber-tint: var(--amber-wash); --green-tint: var(--green-wash);

  --r-control: 6px;      /* buttons, inputs */
  --r-media: 4px;        /* photos */
  --r-pill: 999px;       /* status chips only */
  --radius: 6px; --radius-sm: 6px;

  /* Motion tokens (docs/design/2026-10-01-design-language.md). Only transform, opacity and
     clip-path ever animate, so it stays smooth on entry-level Android phones. */
  --t-micro: 80ms; --t-quick: 150ms; --t-fast: 250ms; --t-medium: 350ms; --t-slow: 500ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-pop: cubic-bezier(0.34, 1.45, 0.64, 1);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Signage type: condensed, heavy, tight. Use for zone names, store names, scores, page titles. */
.display, .sign { font-family: var(--font-display); font-variation-settings: "wdth" 72; font-weight: 800; letter-spacing: -0.01em; line-height: 0.95; }
.sign-lite { font-variation-settings: "wdth" 80; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Buttons: black is the default commit action; cobalt marks AI or capture actions. */
.btn { appearance: none; transition: transform var(--t-quick) var(--ease-out), background .12s, border-color .12s, color .12s; border: 1px solid var(--rule-2); background: var(--bg); color: var(--ink); border-radius: var(--r-control); padding: 11px 18px; font: 600 14px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); transition-duration: var(--t-micro); }
.btn:disabled { opacity: .38; cursor: default; transform: none; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #262626; }
.btn.cobalt { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.btn.cobalt:hover { background: #1230D6; }
.btn.danger { color: var(--red); border-color: currentColor; }
.btn.ghost { border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { background: var(--wash); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 13px; }

.input, select.input, textarea.input { width: 100%; border: 1px solid var(--rule-2); border-radius: var(--r-control); padding: 11px 12px; font: 15px var(--font); background: var(--bg); color: var(--ink); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* Surfaces: hairline-bounded, no shadows. Prefer whitespace + rules over boxes. */
.card { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--r-control); padding: 16px; }
.divider { height: 1px; background: var(--rule); border: 0; margin: 12px 0; }

/* Status chips — the only pills in the system. Sentence case. */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 8px; border-radius: var(--r-pill); background: var(--wash); color: var(--ink-2); white-space: nowrap; line-height: 1.4; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.critical { background: var(--red-wash); color: var(--red); }
.badge.major { background: var(--amber-wash); color: var(--amber); }
.badge.minor { background: var(--cobalt-wash); color: var(--cobalt); }
.badge.ok { background: var(--green-wash); color: var(--green); }
.badge.dark { background: var(--ink); color: #fff; }
.badge.review { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-2); }
.badge.plain::before { display: none; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule-2); flex-shrink: 0; display: inline-block; }
.dot.active { background: var(--ink); box-shadow: none; }
.dot.critical { background: var(--red); box-shadow: none; }
.dot.major { background: var(--amber); box-shadow: none; }
.dot.ok { background: var(--green); box-shadow: none; }
.dot.ai { background: var(--cobalt); box-shadow: none; }
.dot.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* AI provenance: cobalt dot = live model, amber dot = demo analyzer. */
.ai-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 10px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--rule); background: var(--bg); }
.ai-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); }
.ai-chip.demo::before { background: var(--amber); }

/* Scores */
.score-num { font-family: var(--font-display); font-variation-settings: "wdth" 62; font-weight: 800; font-size: 88px; line-height: .85; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.score-bad { color: var(--red); } .score-mid { color: var(--amber); } .score-good { color: var(--green); }

/* Swing tag — the signature shape for a store's weekly VM score.
   Usage: <div class="swing-tag"><span class="score-num">61</span><span>VM score this week</span></div> */
.swing-tag { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 30px 22px 18px; min-width: 150px; background: var(--ink); clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px); }
/* The border is the black tag showing through a white inner tag inset by 1.5px, so the clipped corners keep a clean single edge. */
.swing-tag > * { position: relative; z-index: 1; }
.swing-tag::before { content: ""; position: absolute; inset: 1.5px; background: var(--bg); clip-path: polygon(17px 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 0 100%, 0 17px); z-index: 0; }
.swing-tag::after { content: ""; position: absolute; top: 10px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); z-index: 1; }

/* Before/after compare: .compare > img.ref + .compare-top > img.cap, handle via --pos (0–100%). */
.compare { position: relative; overflow: hidden; border-radius: var(--r-media); background: var(--wash); aspect-ratio: 4 / 5; user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: ew-resize; }
.compare-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.compare-label { position: absolute; bottom: 8px; font-size: 11.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.62); padding: 3px 8px; border-radius: 3px; }
.compare-label.l { left: 8px; } .compare-label.r { right: 8px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-control); font-size: 14px; font-weight: 500; z-index: 1000; animation: toast-in var(--t-medium) var(--ease-out); }
.toast.out { opacity: 0; transform: translate(-50%, 8px) scale(.97); transition: opacity var(--t-fast) var(--ease-in), transform var(--t-fast) var(--ease-in); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px) scale(.97) } to { opacity: 1; transform: translate(-50%, 0) scale(1) } }
.empty { color: var(--ink-2); font-size: 14px; padding: 22px 0; }
/* Skeletons pulse in opacity (cheap) instead of a moving gradient. */
.skeleton { background: var(--wash); animation: sk 1s linear infinite alternate; border-radius: var(--r-media); }
@keyframes sk { from { opacity: 1 } to { opacity: .55 } }

/* Brand wordmark: set in condensed heavy, not tracked caps. */
.brand { font-family: var(--font-display); font-variation-settings: "wdth" 62; font-weight: 900; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { position: relative; background: var(--wash); overflow: hidden; display: flex; align-items: flex-end; padding: 40px; }
.login-art .sign { font-size: clamp(64px, 9vw, 132px); letter-spacing: -0.03em; }
.login-pane { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 360px; }
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; } .login-art { min-height: 34vh; padding: 24px 20px; } }
