:root {
  /* Youze Africa brand palette (sampled from the official logo files) */
  --navy: #06112d;
  --navy-deep: #040b1f;
  --orange: #fc3b49;      /* brand scarlet — primary accent */
  --orange-mid: #fd7c37;  /* gradient mid from the mark */
  /* theme tokens (light) */
  --orange-soft: #fee8ea;
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #22243a;
  --muted: #7a7d99;
  --line: #e4e6f0;
  --heading: #06112d;
  --hover: #fafbff;
  --ok: #14804a;
  --warn: #c2410c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange-soft: rgba(252, 59, 73, .16);
    --bg: #0b1226; --card: #121c3d; --ink: #e7eaf6; --muted: #939cba;
    --line: #24305a; --heading: #ffffff; --hover: #17234b;
    --ok: #34d27e; --warn: #ff8a5c;
  }
}
:root[data-theme="dark"] {
  --orange-soft: rgba(252, 59, 73, .16);
  --bg: #0b1226; --card: #121c3d; --ink: #e7eaf6; --muted: #939cba;
  --line: #24305a; --heading: #ffffff; --hover: #17234b;
  --ok: #34d27e; --warn: #ff8a5c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--heading); }
h1 { font-size: 22px; margin: 10px 0 14px; color: var(--heading); }
h2 { font-size: 15px; margin: 4px 0 10px; color: var(--heading); }

/* --- nav --- */
.topnav {
  display: flex; align-items: center; gap: 24px;
  background: var(--navy); color: #fff; padding: 10px 22px;
}
.brand { display: flex; align-items: center; }
.brand img { height: 30px; display: block; }
.brand.big img { height: 64px; margin: 0 auto; }
.topnav .links { display: flex; gap: 4px; flex: 1; }
.topnav .links a {
  color: #cfd2ea; text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 600;
}
.topnav .links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topnav .links a.active { background: var(--orange); color: #fff; }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.theme-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); cursor: pointer;
  border-radius: 99px; width: 34px; height: 34px; font-size: 15px; line-height: 1; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: rgba(255,255,255,.16); }
.theme-btn-float {
  position: fixed; top: 14px; right: 16px; z-index: 40;
  background: var(--card); border-color: var(--line);
}
.who { color: #cfd2ea; font-size: 13px; }

.container { max-width: 1280px; margin: 20px auto; padding: 0 20px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 32px; }

/* --- cards / layout --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.scroll-x { overflow-x: auto; }

/* --- KPIs --- */
.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi-row.tight { margin-bottom: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; padding: 10px 16px; min-width: 130px; }
.kpi-num { font-size: 18px; font-weight: 800; color: var(--heading); }
.kpi-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi.small .kpi-num { font-size: 15px; }
.kpi-warn { border-left-color: var(--warn); }
.kpi-warn .kpi-num { color: var(--warn); }

/* --- tables --- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl.half { max-width: 560px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 8px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .r, th.r { text-align: right; }
.total-row td { font-weight: 800; color: var(--heading); border-top: 2px solid var(--heading); }
.muted { color: var(--muted); font-size: 12px; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
tr.inactive td { opacity: .45; }

/* --- pills / chips --- */
.pill { display: inline-block; background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill-big { font-size: 12px; vertical-align: middle; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 12px; padding: 5px 11px; border-radius: 99px; text-decoration: none; cursor: pointer; }
.chip-on { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip-cloud { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.inline-search { display: flex; gap: 6px; margin-left: auto; }

/* --- forms --- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(242,107,33,.35); border-color: var(--orange); }
input.narrow { width: 90px; }
textarea { width: 100%; resize: vertical; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: nowrap; margin-bottom: 10px; }
.form-row.wrap { flex-wrap: wrap; }
.form-col { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.form-col label { width: 100%; }
form.inline { display: inline; }
.add-block { margin-top: 10px; }
.add-block summary { cursor: pointer; color: var(--orange); font-weight: 700; margin-bottom: 8px; }

/* --- buttons --- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--heading);
  font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 7px; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--heading); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: #e02a3a; border-color: #e02a3a; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 4px 8px; }
.btn-ghost:hover { color: var(--warn); border-color: transparent; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.wide { width: 100%; }

/* --- flash --- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.flash-error { background: #fdecea; color: #b3261e; }
.flash-ok { background: #e7f6ee; color: var(--ok); }

/* --- quote total on new order --- */
.quote-total { font-size: 15px; margin: 14px 0; color: var(--heading); }
.quote-total strong { color: var(--orange); font-size: 17px; }

/* --- client & business portal --- */
.portal-login { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: 6vh auto 0; }
.portal-login.single { grid-template-columns: 1fr; max-width: 460px; }
@media (max-width: 800px) { .portal-login { grid-template-columns: 1fr; } }
.p-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.p-card h2 { margin-bottom: 6px; }
.p-card .muted { margin-bottom: 16px; }
.p-card-biz { background: var(--navy); border-color: var(--navy); }
.p-card-biz h2 { color: #fff; }
.p-card-biz .muted { color: #b9c0d6; }
.p-card-biz label { color: #b9c0d6; }
.access-code {
  background: var(--orange-soft); color: var(--orange); font-weight: 800;
  padding: 3px 9px; border-radius: 6px; letter-spacing: 1.5px; font-size: 13px;
}
.progress-list { list-style: none; padding: 0; margin: 0; }
.progress-list li {
  position: relative; padding: 7px 0 7px 28px; color: var(--muted); font-size: 14px;
}
.progress-list li::before {
  content: ''; position: absolute; left: 6px; top: 13px;
  width: 10px; height: 10px; border-radius: 99px; background: var(--line);
}
.progress-list li.done { color: var(--ink); }
.progress-list li.done::before { background: var(--ok); }
.progress-list li.now { color: var(--orange); font-weight: 800; }
.progress-list li.now::before { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }

/* --- products / merge --- */
.dupe-card { border-left: 4px solid var(--orange); }
.dupe-group { border-bottom: 1px dashed var(--line); padding: 10px 0 16px; margin-bottom: 10px; }
.dupe-group:last-child { border-bottom: 0; }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; font-size: 12px; }

/* --- login: the staff sign-in page is styled in admin.css ("Admin login") --- */

/* ================= OPERATIONS DASHBOARD ================= */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.dash-head h1 { margin-bottom: 2px; }
.dash-actions { display: flex; gap: 8px; }
.mono, .mono-badge, .mono-link { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--orange); margin-left: 8px; }
.mono-badge { background: var(--orange-soft); color: var(--orange); font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

/* --- metric strip --- */
.metric-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1300px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr; } .metric-hero { grid-column: span 1; } }
.metric {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; position: relative; overflow: hidden;
}
.metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line); }
.metric-hero { grid-column: span 2; }
.metric-hero::before { background: linear-gradient(180deg, #fd9c35, #fc3b49); }
.metric-warn::before { background: var(--warn); }
.metric-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.metric-hint { display: block; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 10.5px; opacity: .8; }
.metric-value {
  font-size: 21px; font-weight: 900; color: var(--heading); margin: 6px 0 2px;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.metric-hero .metric-value { font-size: 30px; }
.metric-foot { font-size: 11.5px; }
.metric-foot .up { color: var(--ok); font-weight: 800; }
.metric-foot .down { color: var(--warn); font-weight: 800; }

/* --- action queues --- */
.queue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .queue-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .queue-grid { grid-template-columns: 1fr; } }
.queue { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.queue-hot { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft) inset; }
.queue-warn { border-color: var(--warn); }
.queue-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--heading); margin-bottom: 8px; }
.queue-head .btn { margin-left: auto; }
.queue-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px;
  border-radius: 7px; background: var(--orange); color: #fff; font-size: 13px; font-weight: 900; padding: 0 6px;
}
.queue-warn .queue-n { background: var(--warn); }
.queue ul { list-style: none; padding: 0; margin: 0; }
.queue li { font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.queue li:last-child { border-bottom: 0; }
.queue li .muted { display: block; font-size: 11px; }

/* --- stacked bars --- */
.cb-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.cb-dot, .dn-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.cb-a, .cb-dot.cb-a { background: var(--orange); }
.cb-b, .cb-dot.cb-b { background: var(--navy); }
:root[data-theme="dark"] .cb-b, :root[data-theme="dark"] .cb-dot.cb-b { background: #6d7ba8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cb-b, :root:not([data-theme="light"]) .cb-dot.cb-b { background: #6d7ba8; } }
.cb-chart { display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--line); }
.cb-slot { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.cb-stack { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.cb-val { font-size: 10.5px; font-weight: 800; color: var(--muted); text-align: center; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.cb-bar { border-radius: 4px 4px 0 0; min-height: 0; transition: height .3s ease; }
.cb-bar.cb-a { border-radius: 0 0 0 0; }
.cb-slot:hover .cb-bar { filter: brightness(1.12); }
.cb-label { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding-top: 5px; }

/* --- line chart --- */
.cl-chart { width: 100%; display: block; overflow: visible; }
.cl-line { fill: none; stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.cl-area { fill: var(--orange-soft); opacity: .75; }
.cl-dots circle { fill: var(--orange); }
.cl-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; padding-top: 4px; }

/* --- ranked bars --- */
.rb { display: flex; flex-direction: column; gap: 7px; }
.rb-row { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; align-items: center; gap: 10px; }
.rb-label { font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { background: var(--line); border-radius: 99px; height: 9px; overflow: hidden; }
.rb-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fd9c35, #fc3b49); }
.rb-value { font-size: 12px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; text-align: right; }
.rb-value small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; }

/* --- funnel --- */
.fn { display: flex; flex-direction: column; gap: 5px; }
.fn-row { display: grid; grid-template-columns: 165px 1fr 34px; align-items: center; gap: 10px; }
.fn-label { font-size: 12px; font-weight: 700; color: var(--ink); }
.fn-track { background: var(--line); border-radius: 6px; height: 16px; overflow: hidden; }
.fn-fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--orange)); border-radius: 6px; }
.fn-n { font-size: 12.5px; font-weight: 900; color: var(--heading); text-align: right; font-variant-numeric: tabular-nums; }
.fn-empty .fn-label, .fn-empty .fn-n { opacity: .45; }
@media (max-width: 620px) { .fn-row { grid-template-columns: 120px 1fr 28px; } }

/* --- donut --- */
.dn-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dn-legend { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dn-legend b { color: var(--heading); }
.dn-seg { transition: opacity .15s; }
.dn-seg:hover { opacity: .8; }
.dn-0, .dn-dot.dn-0 { stroke: #fc3b49; background: #fc3b49; }
.dn-1, .dn-dot.dn-1 { stroke: #fd9c35; background: #fd9c35; }
.dn-2, .dn-dot.dn-2 { stroke: #06112d; background: #06112d; }
.dn-3, .dn-dot.dn-3 { stroke: #4a5a8f; background: #4a5a8f; }
.dn-4, .dn-dot.dn-4 { stroke: #14804a; background: #14804a; }
.dn-5, .dn-dot.dn-5 { stroke: #9aa1b8; background: #9aa1b8; }
:root[data-theme="dark"] .dn-2, :root[data-theme="dark"] .dn-dot.dn-2 { stroke: #8f9dc9; background: #8f9dc9; }

/* --- misc dashboard --- */
.tbl.compact td, .tbl.compact th { padding: 6px 8px; font-size: 12.5px; }
.health { list-style: none; padding: 0; margin: 0; }
.health li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.health li:last-child { border-bottom: 0; }
.health li span { color: var(--muted); }
.health li b { color: var(--heading); }
.health-warn b { color: var(--warn); }

/* --- morning brief --- */
.digest-text {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  color: var(--ink); max-height: 460px; overflow-y: auto; margin: 0;
}
code { background: var(--orange-soft); color: var(--orange); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* --- branded partner entry --- */
.brand-entry { text-align: center; margin: 5vh auto 0; max-width: 560px; }
.brand-entry h1 { font-size: 26px; margin-bottom: 2px; }
.brand-entry + .portal-login { margin-top: 18px; }

/* --- consignments --- */
.consignment { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--bg); }
.cn-ref { font-size: 15px; color: var(--orange); align-self: center; }

/* ---------- WhatsApp inbox ---------- */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 1px 5px; margin-left: 2px;
  border-radius: 9px; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 900; text-align: center; vertical-align: 1px;
}
.row-new td { background: var(--orange-soft); }
.wa-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 60vh; overflow-y: auto; padding: 6px 2px 10px;
}
.wa-msg {
  max-width: 78%; padding: 8px 11px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); font-size: 14px;
}
.wa-msg.wa-in { align-self: flex-start; border-bottom-left-radius: 3px; }
.wa-msg.wa-out {
  align-self: flex-end; border-bottom-right-radius: 3px;
  background: var(--orange-soft); border-color: transparent;
}
.wa-body { white-space: pre-wrap; word-break: break-word; }
.wa-meta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.wa-shot {
  display: block; max-width: 100%; max-height: 260px;
  border-radius: 8px; margin-bottom: 6px;
}
.wa-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.wa-compose textarea {
  flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: inherit; resize: vertical;
}
.pill-ok { background: rgba(20, 128, 74, .14); color: var(--ok); }
.pill-warn { background: var(--orange-soft); color: var(--warn); }
@media (max-width: 700px) { .wa-msg { max-width: 92%; } }

.catalog-admin-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; margin-top:20px; }
/* Bulk catalogue import preview */
.import-preview tr.imp-error td { background: rgba(179, 38, 30, .08); }
.import-preview tr.imp-duplicate td { opacity: .6; }
.import-preview td { vertical-align: top; }
.import-preview td:nth-child(2) { min-width: 150px; }
.import-preview td:last-child { min-width: 220px; }

/* Phones: wide tables scroll inside their card instead of widening the page. */
@media (max-width: 700px) {
  .card { overflow-x: auto; }
  .card > .tbl, .card .tbl { min-width: 0; }
}

/* AI leaflet reader */
.lf-upload { max-width: 520px; }
.lf-file { overflow-wrap: anywhere; }
td.lf-file { min-width: 160px; }
.lf-bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0 12px; }
.lf-bar span { display: block; height: 100%; background: linear-gradient(90deg, #fd9c35, #fc3b49); transition: width .4s ease; }
.lf-pages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; }
.lf-pages li { min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 6px; font-size: 12px; font-weight: 800;
  border: 1px solid var(--line); color: var(--muted); }
.lf-pages .lf-p-running { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.lf-pages .lf-p-done { background: rgba(20, 128, 74, .14); border-color: transparent; color: var(--ok); }
.lf-pages .lf-p-failed { background: var(--orange-soft); border-color: transparent; color: var(--warn); }
.lf-failed { list-style: none; padding: 0; margin: 0; }
.lf-failed li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lf-failed li:last-child { border-bottom: 0; }
.lf-table input { padding: 5px 7px; }
.lf-table .lf-name { width: 240px; }
.lf-table .lf-unit { width: 92px; }
.lf-table .lf-cat { width: 130px; }
.lf-table input.r { text-align: right; }
.lf-table .lf-ref { font-size: 11.5px; color: var(--muted); min-width: 120px; }
.lf-table td:nth-child(2) { min-width: 0; }
.lf-photo { width: 84px; }
.lf-thumb { display: block; width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 4px; }
.lf-table tr.lf-low td { background: rgba(194, 65, 12, .08); }
.lf-table tr.lf-off td { opacity: .55; }
.lf-table tr.lf-off td:first-child { opacity: 1; }
.lf-actions { flex-wrap: wrap; }

/* The staff links never widen the page: they shrink, then scroll. Below 1200 px they get their own row. */
.topnav .links { min-width: 0; overflow-x: auto; }
@media (max-width: 1200px) {
  .topnav { flex-wrap: wrap; gap: 8px 12px; }
  .topnav .links { order: 3; flex: 1 1 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 2px; }
  .topnav .links a { flex: none; white-space: nowrap; }
  .logout { margin-left: auto; gap: 8px; }
}
@media (max-width: 760px) {
  .topnav { padding: 8px 12px; }
  .topnav .links a { padding: 6px 10px; }
  .container { padding: 0 12px; }
}
/* A grid column (1fr) otherwise grows to its widest table; on phones the card scrolls the table instead (see .card above). */
@media (max-width: 700px) { .grid-2 > *, .grid-3 > * { min-width: 0; } }
@media (max-width: 420px) { .who { display: none; } }
