/* CertKeeper — "Harbor" palette */
:root {
  --ink: #0E2A3B;
  --ink-2: #1D3F55;
  --ink-soft: #4A6476;
  --muted: #7C8F9C;
  --line: #E2E6E3;
  --paper: #F6F4EF;
  --card: #FFFFFF;
  --teal: #12A594;
  --teal-dark: #0C7F72;
  --teal-tint: #DDF4EF;
  --amber: #F5A524;
  --amber-tint: #FEF1D8;
  --orange: #E8772E;
  --orange-tint: #FCE6D6;
  --coral: #E5484D;
  --coral-tint: #FCE3E3;
  --sky: #3B82C4;
  --sky-tint: #E1EEF9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(14, 42, 59, .06), 0 6px 20px rgba(14, 42, 59, .06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--paper);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 800; }
h3 { font-size: .95rem; font-weight: 700; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #DDE7EC; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; }
.brand-name span { color: var(--teal); }
.brand-tag { font-size: .72rem; color: #9FB4C0; display: block; font-weight: 600; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #C9D7DE; font-weight: 600; text-decoration: none; margin-bottom: 2px;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--teal); color: #fff; }
.nav .badge { margin-left: auto; background: var(--coral); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; font-size: .78rem; color: #9FB4C0; padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot button { margin-top: 8px; width: 100%; }

.main { min-width: 0; display: flex; flex-direction: column; }
.demo-banner {
  background: repeating-linear-gradient(-45deg, var(--amber-tint), var(--amber-tint) 12px, #FDE9C2 12px, #FDE9C2 24px);
  color: #6B4A06; font-size: .84rem; font-weight: 600; padding: 7px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid #F3D9A4;
}
.demo-banner b { background: #6B4A06; color: #FEF1D8; padding: 1px 8px; border-radius: 6px; letter-spacing: .06em; font-size: .72rem; }
.demo-banner button { margin-left: auto; background: transparent; border: 1px solid #C99A3E; color: #6B4A06; border-radius: 8px; padding: 2px 10px; cursor: pointer; font-weight: 700; font-size: .78rem; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(246,244,239,.92);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
}
.topbar .mobile-brand { display: none; align-items: center; gap: 8px; font-weight: 800; }
.topbar .mobile-brand img { width: 28px; height: 28px; }
.topbar .spacer { flex: 1; }
.acting { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink-soft); }
.acting select { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.content { padding: 24px 28px 48px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--ink-soft); }

.bottom-nav { display: none; }

/* ---------- Cards / grid ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #ECEEEA; padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .right { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.kpi { display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; text-decoration: none !important; color: inherit; transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(14,42,59,.10); }
.kpi .label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.kpi .sub { font-size: .82rem; color: var(--muted); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent, var(--teal)); }
.kpi.overdue { --accent: var(--coral); }
.kpi.d30 { --accent: var(--orange); }
.kpi.d60 { --accent: var(--amber); }
.kpi.d90 { --accent: var(--sky); }
.kpi.overdue .value { color: var(--coral); }

.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--ink-soft); margin: 26px 0 10px; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--teal-tint); color: var(--teal-dark); }
.pill.d90 { background: var(--sky-tint); color: #23649F; }
.pill.d60 { background: var(--amber-tint); color: #93620A; }
.pill.d30 { background: var(--orange-tint); color: #A44D14; }
.pill.overdue { background: var(--coral-tint); color: #B1262B; }
.pill.neutral { background: #EEF1F2; color: var(--ink-soft); }
.pill.neutral::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); background: #F0F2F0; border-radius: 7px; padding: 2px 8px; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); padding: 9px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: .9rem; text-decoration: none !important;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { border-color: #C9D2CF; background: #FAFBFA; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: #B1262B; border-color: #F2C3C4; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid #D7DDDA; border-radius: 10px; background: #fff; outline: none;
}
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,165,148,.18); }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.search input { padding-left: 38px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; padding: 6px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; cursor: pointer; color: var(--ink-soft); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; }
.seg { display: inline-flex; background: #EBEEEC; padding: 4px; border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ink-soft); display: inline-flex; gap: 6px; align-items: center; }
.seg button svg { width: 17px; height: 17px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.check input { margin-top: 3px; accent-color: var(--teal); width: 16px; height: 16px; }
.check b { display: block; font-size: .9rem; }
.check span { font-size: .8rem; color: var(--muted); }

/* ---------- Lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: grid; grid-template-columns: 2.2fr 1.3fr 1.5fr 1.1fr 24px; gap: 14px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important;
}
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #F9FAF8; }
.list-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
.list-row .title { font-weight: 700; }
.list-row .meta { font-size: .8rem; color: var(--muted); }
.list-row .chev { color: #B6C0C4; width: 18px; }
.list.people .list-row { grid-template-columns: 2.2fr 1.2fr 1fr 1.2fr 24px; }
.flush { padding: 0; overflow: hidden; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; }
.who .title, .who .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.icon-box { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-dark); flex: none; }
.icon-box svg { width: 20px; height: 20px; }
.icon-box.truck { background: var(--sky-tint); color: #23649F; }
.icon-box.yard { background: #ECE8F7; color: #5B4A9E; }
.icon-box.vendor { background: var(--amber-tint); color: #93620A; }
.icon-box.person { background: #F0EAE4; color: #7A5536; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Attention list */
.attn { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); color: inherit; text-decoration: none !important; }
.attn:last-child { border-bottom: 0; }
.attn .grow { flex: 1; min-width: 0; }
.attn .grow .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn .grow .m { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days { font-weight: 800; font-size: .86rem; text-align: right; white-space: nowrap; }

/* Bar chart */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: #EEF1EF; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.bar-row .n { text-align: right; font-weight: 800; }
.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: #EEF1EF; margin: 6px 0 12px; }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: absolute; left: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--teal); color: var(--teal-dark); }
.timeline .dot svg { width: 12px; height: 12px; }
.timeline .dot.cert { border-color: var(--amber); color: #93620A; }
.timeline .dot.move { border-color: var(--sky); color: #23649F; }
.timeline .dot.warn { border-color: var(--coral); color: #B1262B; }
.timeline .dot.reg { border-color: var(--ink-soft); color: var(--ink-soft); }
.timeline .t { font-weight: 700; }
.timeline .m { font-size: .82rem; color: var(--muted); }
.timeline .d { font-size: .86rem; color: var(--ink-soft); margin-top: 2px; }

/* Progress */
.progress { height: 8px; background: #EEF1EF; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress > i { display: block; height: 100%; background: var(--c, var(--teal)); }

/* Tool hero */
.hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero .icon-box { width: 56px; height: 56px; border-radius: 14px; }
.hero .icon-box svg { width: 30px; height: 30px; }
.big-days { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

/* QR */
.qr-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr { width: 168px; height: 168px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-meta { min-width: 0; flex: 1; }
.payload { font-family: var(--mono); font-size: .78rem; background: #F2F4F2; padding: 6px 8px; border-radius: 7px; overflow-wrap: anywhere; display: block; margin: 4px 0 10px; }

/* Scan screen */
.scan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.viewfinder {
  position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #2C4A5E, #0B1C27 70%); display: grid; place-items: center; color: #CFE3EA;
}
.viewfinder .frame { width: 56%; aspect-ratio: 1; position: relative; }
.viewfinder .frame::before, .viewfinder .frame::after,
.viewfinder .frame i::before, .viewfinder .frame i::after { content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid var(--teal); }
.viewfinder .frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.viewfinder .frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.viewfinder .frame i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.viewfinder .frame i::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.viewfinder .scanline { position: absolute; left: 6%; right: 6%; height: 3px; background: linear-gradient(90deg, transparent, var(--teal), transparent); box-shadow: 0 0 14px var(--teal); animation: scan 2.2s ease-in-out infinite; }
.viewfinder .ghost-qr { position: absolute; inset: 16%; opacity: .16; }
.viewfinder .ghost-qr svg { width: 100%; height: 100%; }
.viewfinder .hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .84rem; font-weight: 600; opacity: .85; }
.viewfinder .sim { position: absolute; top: 12px; left: 12px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; background: rgba(245,165,36,.92); color: #3D2A03; padding: 3px 8px; border-radius: 6px; }
.viewfinder.flash::after { content: ""; position: absolute; inset: 0; background: rgba(18,165,148,.45); animation: flash .5s ease-out forwards; }
@keyframes scan { 0%, 100% { top: 22%; } 50% { top: 76%; } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.nfc-pad { display: grid; place-items: center; }
.nfc-pad .rings { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.nfc-pad .rings span { position: absolute; inset: 0; border: 3px solid var(--teal); border-radius: 50%; opacity: 0; animation: ring 2.4s ease-out infinite; }
.nfc-pad .rings span:nth-child(2) { animation-delay: .8s; }
.nfc-pad .rings span:nth-child(3) { animation-delay: 1.6s; }
.nfc-pad .rings svg { width: 54px; height: 54px; color: var(--teal); }
@keyframes ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-chip { font-family: var(--mono); font-size: .76rem; border: 1px dashed #9FC9C1; background: #F3FBF9; color: var(--teal-dark); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.tag-chip:hover { background: var(--teal-tint); }
.target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.target { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 11px; padding: 9px 10px; cursor: pointer; background: #fff; text-align: left; }
.target .avatar, .target .icon-box { width: 30px; height: 30px; font-size: .7rem; }
.target .icon-box svg { width: 16px; height: 16px; }
.target b { display: block; font-size: .84rem; line-height: 1.2; }
.target small { color: var(--muted); font-size: .74rem; }
.target.on { border-color: var(--teal); background: #F1FBF8; box-shadow: 0 0 0 3px rgba(18,165,148,.15); }
.target[disabled] { opacity: .4; cursor: not-allowed; }
.callout { border-radius: 12px; padding: 12px 14px; font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout.warn { background: var(--coral-tint); color: #8E1E22; }
.callout.info { background: var(--sky-tint); color: #1E527F; }
.callout.ok { background: var(--teal-tint); color: #0A5F55; }
.callout.amber { background: var(--amber-tint); color: #6B4A06; }

/* Alerts */
.lead-chips .chip.on { background: var(--teal); border-color: var(--teal); }
.recipients { display: flex; flex-wrap: wrap; gap: 6px; }
.recipient { display: inline-flex; align-items: center; gap: 6px; background: #F0F2F0; border-radius: 99px; padding: 2px 9px 2px 2px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.recipient .avatar { width: 20px; height: 20px; font-size: .55rem; }
.preview { font-size: .88rem; background: #F7F8F6; border: 1px solid var(--line); border-radius: 12px; padding: 14px; white-space: pre-wrap; font-family: var(--font); }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(14,42,59,.45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal header { padding: 18px 20px 0; display: flex; align-items: center; }
.modal header button { margin-left: auto; }
.modal .body { padding: 16px 20px; }
.modal footer { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: rise .2s; display: flex; gap: 8px; align-items: center; }
.toast svg { width: 18px; height: 18px; color: var(--teal); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Print label */
.print-label { display: none; }
@media print {
  body * { visibility: hidden; }
  .print-label, .print-label * { visibility: visible; }
  .print-label { display: flex; position: fixed; top: 0; left: 0; gap: 12px; align-items: center; border: 1px solid #000; padding: 10px; width: 3.5in; font-family: var(--font); }
  .print-label svg { width: 1.2in; height: 1.2in; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 14px; }
  .topbar .mobile-brand { display: flex; }
  .topbar h1 { display: none; }
  .acting .lbl { display: none; }
  .content { padding: 16px 14px 100px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  h1 { font-size: 1.35rem; }
  .kpi .value { font-size: 1.7rem; }
  .list-row, .list.people .list-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .list-row > .c-hide { display: none; }
  .list-row .chev { display: none; }
  .list-head { display: none; }
  .bar-row { grid-template-columns: 96px 1fr 28px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 10px; min-width: 52px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--teal-dark); }
  .bottom-nav a.scan-tab svg { background: var(--teal); color: #fff; border-radius: 12px; padding: 6px; width: 38px; height: 38px; margin-top: -16px; box-shadow: 0 6px 16px rgba(18,165,148,.4); }
  .toast-host { bottom: 86px; }
  .qr { width: 140px; height: 140px; }
}
@media (max-width: 420px) {
  .g-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .demo-banner button { margin-left: 0; }
}

/* Mobile: keep the "acting as" picker inside the viewport */
.acting { min-width: 0; }
@media (max-width: 820px) {
  .acting select { max-width: 46vw; text-overflow: ellipsis; }
  .main { min-width: 0; overflow-x: hidden; }
}
