/* Pepsi Perfect Store - visual system follows the approved Q1-Q19 UX boards:
   navy header, royal-blue actions, pale-blue question cards, green/red/amber states.
   Layout: phone = stacked screen with sticky header and footer; desktop = sidebar + workspace. */
:root {
  --navy: #0B2361; --navy-2: #0D1F4E; --navy-ink: #FFFFFF; --navy-sub: #B9C6E8;
  --blue: #1F4FD1; --blue-strong: #1A43B5; --blue-50: #EEF3FC; --blue-100: #DCE6FA; --blue-ink: #163A9E;
  --pepsi-red: #E32934;
  --bg: #F3F5FA; --card: #FFFFFF; --ink: #0E1A33; --ink-2: #46526D; --muted: #7A859E; --line: #E2E7F1; --line-2: #CBD4E5;
  --green: #12813D; --green-bg: #16A34A; --green-50: #E7F6EC; --red: #C62834; --red-bg: #D92D3A; --red-50: #FDEDEE;
  --amber: #8A5A00; --amber-50: #FFF5DC; --amber-line: #F2D58A;
  --s1: #1F4FD1; --s2: #EB6834; --s3: #1BAF7A; --s4: #EDA100; --s5: #E87BA4; --s6: #6250D6; --s-other: #8E97A8;
  --shadow: 0 1px 2px rgba(14, 26, 51, .06), 0 4px 14px rgba(14, 26, 51, .06);
  --r: 14px; --r-sm: 10px;
  --font: "Figtree", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Figtree", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0A1A47; --navy-2: #08143A; --navy-sub: #9FB0DB;
    --blue: #5B84F0; --blue-strong: #4A73E2; --blue-50: #15224A; --blue-100: #1E3166; --blue-ink: #A9C0FF;
    --bg: #090F1E; --card: #111A2F; --ink: #E8EDF7; --ink-2: #B4BFD6; --muted: #8590AA; --line: #22304E; --line-2: #31426A;
    --green: #4CC77A; --green-bg: #1F9A4F; --green-50: #0F2A1B; --red: #FF7C85; --red-bg: #D63A46; --red-50: #34141A;
    --amber: #F2C35B; --amber-50: #2C2210; --amber-line: #5A4513;
    --s1: #5B84F0; --s2: #D95926; --s3: #199E70; --s4: #C98500; --s5: #D55181; --s6: #9085E9; --s-other: #7A8396;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0A1A47; --navy-2: #08143A; --navy-sub: #9FB0DB;
  --blue: #5B84F0; --blue-strong: #4A73E2; --blue-50: #15224A; --blue-100: #1E3166; --blue-ink: #A9C0FF;
  --bg: #090F1E; --card: #111A2F; --ink: #E8EDF7; --ink-2: #B4BFD6; --muted: #8590AA; --line: #22304E; --line-2: #31426A;
  --green: #4CC77A; --green-bg: #1F9A4F; --green-50: #0F2A1B; --red: #FF7C85; --red-bg: #D63A46; --red-50: #34141A;
  --amber: #F2C35B; --amber-50: #2C2210; --amber-line: #5A4513;
  --s1: #5B84F0; --s2: #D95926; --s3: #199E70; --s4: #C98500; --s5: #D55181; --s6: #9085E9; --s-other: #7A8396;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
svg { width: 18px; height: 18px; flex: none; }
.opt svg { width: 18px; height: 18px; }
.tabs svg { width: 14px; height: 14px; vertical-align: -2px; }
.evidence .meta span svg { width: 12px; height: 12px; vertical-align: -1px; }
.tile .d svg { width: 14px; height: 14px; }
.sourcechip svg { width: 14px; height: 14px; }
.tile .k svg { width: 20px; height: 20px; }
.grid-src { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--navy); }
html[lang="ar"] body { font-family: var(--font-ar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; }
img { max-width: 100%; }
.tab { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100%; }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--navy); color: var(--navy-ink); padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.topbar-row { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--navy-sub); font-size: 12.5px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn svg { width: 22px; height: 22px; }
html[dir="rtl"] .flip svg { transform: scaleX(-1); }
.brandmark { display: flex; align-items: center; gap: 10px; }
.brandmark img.globe { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 1px; }
.brandmark b { font-size: 15px; letter-spacing: .02em; display: block; line-height: 1.1; }
.brandmark span { font-size: 11px; color: var(--navy-sub); letter-spacing: .12em; text-transform: uppercase; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--navy-sub); }
.progress .bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: #6F95FF; border-radius: 3px; transition: width .3s; }
.content { flex: 1; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto; }
.content.wide { max-width: 1320px; }
.bottomnav { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.bottomnav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 6px 0; border-radius: 10px; }
.bottomnav button svg { width: 22px; height: 22px; }
.bottomnav button.on { color: var(--blue); font-weight: 600; }
.footer-actions { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }

@media (min-width: 1024px) {
  .shell { grid-template-columns: 252px 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; padding: 20px 14px; gap: 6px; }
  .side .brandmark { padding: 4px 8px 18px; }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side .navlabel { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-sub); padding: 14px 10px 6px; }
  .side button { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: #DCE4F8; padding: 9px 10px; border-radius: 10px; font-size: 14px; text-align: start; }
  .side button svg { width: 19px; height: 19px; opacity: .9; }
  .side button:hover { background: rgba(255, 255, 255, .07); }
  .side button.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
  .side .vendor { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 8px 0; font-size: 11px; color: var(--navy-sub); }
  .side .vendor img { width: 140px; display: block; margin-top: 6px; opacity: .95; }
  .bottomnav { display: none; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .content { padding: 24px 28px 40px; }
  .audit-layout { display: grid; grid-template-columns: minmax(0, 560px) 300px; gap: 24px; justify-content: center; align-items: start; }
  .outline { display: block !important; position: sticky; top: 96px; max-height: calc(100vh - 200px); overflow: auto; }
  .footer-actions { max-width: 560px; margin-left: calc(50% - 430px); width: 560px; border: 1px solid var(--line); border-radius: 16px 16px 0 0; }
  html[dir="rtl"] .footer-actions { margin-left: 0; margin-right: calc(50% - 430px); }
}
.outline { display: none; }

/* ---------- generic components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--blue-50); border-color: var(--blue-100); box-shadow: none; }
.qhead { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.qhead .qi { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--blue-100); display: grid; place-items: center; color: var(--blue); }
.qhead .qi svg { width: 22px; height: 22px; }
.qhead h2 { font-size: 18px; line-height: 1.25; }
.qhead p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.hint { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 13px; border-top: 1px solid var(--blue-100); margin-top: 12px; padding-top: 10px; }
.hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--blue); }
.label { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.field-label { font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; display: block; }
.req { color: var(--red); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

.btn { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-strong); }
.btn.primary:disabled { background: var(--blue-100); border-color: var(--blue-100); color: var(--blue-ink); opacity: .75; cursor: not-allowed; }
.btn.success { background: var(--green-bg); border-color: var(--green-bg); color: #fff; }
.btn.danger-soft { background: var(--red-50); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }

.stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); overflow: hidden; height: 50px; }
.stepper button { border: 0; background: none; height: 100%; font-size: 22px; color: var(--ink-2); }
.stepper button:hover { background: var(--blue-50); }
.stepper input { border: 0; background: none; text-align: center; font-size: 20px; font-weight: 700; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.sm { height: 40px; grid-template-columns: 36px 1fr 36px; border-radius: 10px; }
.stepper.sm input { font-size: 16px; }
.stepper.unset input { color: var(--muted); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.opt { border: 1.5px solid var(--line-2); background: var(--card); border-radius: 11px; padding: 10px 12px; min-height: 44px; font-weight: 600; font-size: 14.5px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); text-align: center; }
.opt .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.opt.on { border-color: var(--blue); background: var(--blue-50); color: var(--blue-ink); }
.opt.on .dot { border: 5px solid var(--blue); }
.opt.yes.on { background: var(--green-bg); border-color: var(--green-bg); color: #fff; }
.opt.no.on { background: var(--red-50); border-color: var(--red-bg); color: var(--red); }
.opt.no.on .dot { border-color: var(--red-bg); }
.opt.better.on { background: var(--green-bg); border-color: var(--green-bg); color: #fff; }
.opt.worse.on { background: var(--red-bg); border-color: var(--red-bg); color: #fff; }
.opt.same.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.left { justify-content: flex-start; text-align: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex: none; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip svg { width: 14px; height: 14px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: 11px; padding: 12px 13px; font-size: 15px; min-height: 46px; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-inline-start: 40px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: var(--blue-50); color: var(--blue-ink); white-space: nowrap; }
.pill.good { background: var(--green-50); color: var(--green); }
.pill.bad { background: var(--red-50); color: var(--red); }
.pill.warn { background: var(--amber-50); color: var(--amber); }
.pill.grey { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--ink-2); }
.pill svg { width: 12px; height: 12px; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner.warn { background: var(--amber-50); border-color: var(--amber-line); color: var(--amber); }
.banner.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-ink); }
.banner.good { background: var(--green-50); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.banner.bad { background: var(--red-50); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.toggle { position: relative; width: 46px; height: 28px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: .2s; }
.toggle i::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.toggle input:checked + i { background: var(--blue); }
.toggle input:checked + i::after { inset-inline-start: 21px; }

/* evidence row */
.evidence { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.evidence > svg { width: 18px; height: 18px; color: var(--blue); flex: none; }
.evidence .meta { flex: 1; min-width: 0; }
.evidence .meta b { font-size: 14px; display: block; }
.evidence .meta span { font-size: 11.5px; color: var(--green); display: inline-flex; gap: 8px; }
.thumbs { display: flex; gap: 6px; }
.thumbs img, .thumbs .add { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.thumbs .add { display: grid; place-items: center; border: 1.5px dashed var(--blue); color: var(--blue); background: var(--blue-50); }
.thumbs .add svg { width: 18px; height: 18px; }

/* SKU rows */
.sku { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sku .body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sku h4 { font-size: 15px; line-height: 1.25; }
.sku .code { font-size: 12px; color: var(--muted); }
.pack { width: 54px; height: 66px; display: grid; place-items: center; border: 0; background: none; padding: 0; position: relative; }
.pack .shape { position: relative; display: grid; place-items: center; border-radius: 7px; box-shadow: inset -6px 0 10px rgba(0, 0, 0, .18), inset 4px 0 6px rgba(255, 255, 255, .25); }
.pack .shape.can { width: 34px; height: 56px; border-radius: 6px 6px 8px 8px; }
.pack .shape.pet { width: 26px; height: 64px; border-radius: 9px 9px 7px 7px; }
.pack .shape.pet::before { content: ""; position: absolute; top: -5px; width: 12px; height: 7px; border-radius: 3px 3px 0 0; background: inherit; filter: brightness(.8); }
.pack .shape.glass { width: 22px; height: 62px; border-radius: 6px 6px 7px 7px; box-shadow: inset -5px 0 8px rgba(0, 0, 0, .25), inset 3px 0 6px rgba(255, 255, 255, .45); }
.pack .shape.glass::before { content: ""; position: absolute; top: -7px; width: 9px; height: 10px; border-radius: 3px 3px 0 0; background: inherit; filter: brightness(.75); }
.pack .shape.glass img { width: 18px; height: 18px; }
.pack .shape.multi { width: 50px; height: 44px; border-radius: 6px; }
.pack .shape img { width: 24px; height: 24px; border-radius: 50%; background: #fff; object-fit: contain; padding: 1px; }
.sku .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sku .tot { display: flex; justify-content: space-between; align-items: center; background: var(--blue-50); border-radius: 10px; padding: 8px 12px; font-weight: 700; color: var(--blue-ink); font-size: 14px; }
.sku .line { display: grid; grid-template-columns: 1fr 140px; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* metric callout inside a question */
.calc { display: flex; justify-content: space-between; align-items: center; background: var(--blue-50); border-radius: 12px; padding: 12px 14px; color: var(--blue-ink); font-weight: 600; font-size: 14px; }
.calc b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* voice */
.rec-time { text-align: center; font-size: 60px; font-weight: 800; letter-spacing: .02em; line-height: 1; font-variant-numeric: tabular-nums; }
.wave { width: 100%; height: 64px; display: block; }
.recbtn { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 10px var(--blue-50); margin: 6px auto; }
.recbtn svg { width: 36px; height: 36px; }
.recbtn.stop { background: var(--red-bg); box-shadow: 0 0 0 10px var(--red-50); }
.recctl { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; justify-items: center; gap: 8px; }
.roundbtn { width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); display: grid; place-items: center; color: var(--ink); }
.roundbtn svg { width: 22px; height: 22px; }
.recctl span { font-size: 13px; color: var(--ink-2); display: block; text-align: center; margin-top: 6px; }
.livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--red-bg); display: inline-block; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.scrub { width: 100%; accent-color: var(--blue); }

/* stopwatch */
.ring { width: 190px; height: 190px; margin: 6px auto; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-size: 56px; font-weight: 800; line-height: 1; display: block; font-variant-numeric: tabular-nums; }

/* lists */
.list { display: flex; flex-direction: column; }
.list > .li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.list > .li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow span { font-size: 12.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li button.grow { border: 0; background: none; text-align: start; padding: 0; color: inherit; }
.avatar { width: 40px; height: 40px; border-radius: 11px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.score { min-width: 46px; text-align: center; border-radius: 10px; padding: 5px 7px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.score.g { background: var(--green-50); color: var(--green); }
.score.a { background: var(--amber-50); color: var(--amber); }
.score.r { background: var(--red-50); color: var(--red); }

/* home */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #183C9C 100%); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; inset-inline-end: -70px; top: -90px; background: radial-gradient(circle, rgba(227, 41, 52, .35), transparent 65%); }
.hero .eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-sub); }
.hero h2 { font-size: 24px; }
.hero .loc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #DCE4F8; }
.hero .loc span { display: inline-flex; align-items: center; gap: 5px; }
.hero .loc svg { width: 14px; height: 14px; }
.hero .btn.primary { background: #fff; color: var(--navy); border-color: #fff; }
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; z-index: 1; }
.statrow div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px; }
.statrow b { font-size: 22px; display: block; font-variant-numeric: tabular-nums; }
.statrow span { font-size: 11.5px; color: #C9D4F2; }

/* dashboards */
.dash-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters select { border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; min-height: 38px; max-width: 180px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tile .v { font-size: 28px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .d { font-size: 12px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.tile .d.up { color: var(--green); } .tile .d.down { color: var(--red); } .tile .d.flat { color: var(--muted); }
.tile.hero-tile { background: linear-gradient(135deg, var(--navy), #183C9C); color: #fff; border: 0; }
.tile.hero-tile .k, .tile.hero-tile .d { color: #DCE4F8; }
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.dgrid > * { grid-column: span 12; min-width: 0; }
@media (min-width: 900px) { .span6 { grid-column: span 6 !important; } .span4 { grid-column: span 4 !important; } .span8 { grid-column: span 8 !important; } .span5 { grid-column: span 5 !important; } .span7 { grid-column: span 7 !important; } .span12 { grid-column: 1 / -1 !important; } }
.panel h3 { font-size: 15.5px; margin-bottom: 2px; }
.panel .cap { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.chartbox { position: relative; height: 260px; }
.chartbox.tall { height: 340px; }
.chartbox.short { height: 200px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--blue-50); }
.minibar { display: inline-block; height: 7px; border-radius: 4px; background: var(--blue); vertical-align: middle; margin-inline-end: 6px; }
.insight { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.insight:last-child { border-bottom: 0; }
.insight .sev { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.insight .sev svg { width: 16px; height: 16px; }
.sev.critical { background: var(--red-50); color: var(--red); } .sev.serious { background: var(--amber-50); color: var(--amber); } .sev.good { background: var(--green-50); color: var(--green); } .sev.info { background: var(--blue-50); color: var(--blue); }
.quote { border-inline-start: 3px solid var(--blue); padding: 6px 12px; margin: 8px 0; font-size: 14px; color: var(--ink); background: var(--blue-50); border-radius: 0 10px 10px 0; }
html[dir="rtl"] .quote { border-radius: 10px 0 0 10px; }
.quote small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.kpi-card { display: flex; flex-direction: column; gap: 6px; }
.kpi-card .n { font-size: 11.5px; font-weight: 800; color: var(--blue); letter-spacing: .08em; }
.kpi-card .val { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; background: var(--blue-50); padding: 4px; border-radius: 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: var(--card); color: var(--blue-ink); box-shadow: var(--shadow); }
.wordcloud { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.wordcloud span { color: var(--blue-ink); font-weight: 700; }
.sourcechip { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: 999px; padding: 5px 10px; }

/* modal / sheet */
.scrim { position: fixed; inset: 0; background: rgba(5, 12, 30, .55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 20px; max-width: 620px; } .sheet.wide { max-width: 980px; } }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet .sheet-head h3 { font-size: 18px; }
.sheet .sheet-head .icon-btn { color: var(--ink); }
.sheet .sheet-head .icon-btn:hover { background: var(--blue-50); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: end; }
.toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.camera { position: fixed; inset: 0; background: #000; z-index: 90; display: flex; flex-direction: column; }
.camera video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.camera .bar { display: flex; justify-content: space-around; align-items: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); }

/* splash / sign in */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(1200px 600px at 80% -10%, rgba(227, 41, 52, .25), transparent 60%), linear-gradient(160deg, #0B2361, #06153F 70%); color: #fff; }
.signin .box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.signin .logo { width: 84px; height: 84px; border-radius: 50%; background: #fff; padding: 2px; }
.signin h1 { font-size: 30px; line-height: 1.1; }
.signin p { color: #C9D4F2; margin: 0; }
.signin .card { color: var(--ink); }
.signin .vendor { display: flex; align-items: center; gap: 10px; color: #9FB0DB; font-size: 12px; }
.signin .vendor img { width: 132px; }
.rolegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rolegrid .opt { flex-direction: column; gap: 4px; padding: 12px 8px; }
.rolegrid .opt svg { width: 22px; height: 22px; }
.rolegrid .opt small { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.rolegrid .opt.on small { color: inherit; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin-bottom: 8px; color: var(--blue); opacity: .6; }
.success-mark { width: 92px; height: 92px; border-radius: 50%; background: var(--green-50); display: grid; place-items: center; margin: 10px auto 0; box-shadow: 0 0 0 12px color-mix(in srgb, var(--green-50) 60%, transparent); }
.success-mark svg { width: 46px; height: 46px; color: var(--green); }
.sumhead { background: linear-gradient(135deg, var(--navy), #183C9C); color: #fff; border-radius: 16px; padding: 18px; }
.sumhead .big { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.secrow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.secrow:last-child { border-bottom: 0; }
.secrow svg { width: 20px; height: 20px; flex: none; }
.secrow .ok { color: var(--green); } .secrow .miss { color: var(--red); }
.secrow button { border: 0; background: none; padding: 0; flex: 1; text-align: start; color: inherit; }
.secrow em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.outline .secrow { font-size: 13.5px; padding: 7px 2px; }
.outline .secrow.cur { color: var(--blue); font-weight: 700; }
.photo-stamp { font-size: 11px; }
.hide-mobile { display: none; }
@media (min-width: 1024px) { .hide-mobile { display: initial; } .hide-desktop { display: none !important; } }
