:root {
  --bg: #eef2f6;
  --ink: #18212f;
  --muted: #6a7280;
  --line: #d9e0e9;
  --panel: #ffffff;
  --primary: #0f766e;
  --accent: #c2410c;
  --sidebar: #101820;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 18px 48px rgba(24, 33, 47, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 8px; background: var(--primary); color: white; padding: 10px 14px; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(0.96); }
button:disabled { opacity: 0.58; cursor: not-allowed; filter: none; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: white; color: var(--ink); }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(36px, 7vw, 72px); line-height: 0.95; max-width: 760px; }
h2 { margin-bottom: 0; font-size: 30px; }
h3 { margin-bottom: 14px; font-size: 18px; }

.hidden { display: none !important; }
.login-view { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 24px; background: #08111a; isolation: isolate; }
.login-view::before { content: ""; position: absolute; inset: 0; z-index: -3; background: radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--primary) 62%, transparent), transparent 34%), radial-gradient(circle at 82% 78%, color-mix(in srgb, var(--accent) 46%, transparent), transparent 32%), linear-gradient(135deg, #071018 0%, #11242c 48%, #1b1712 100%); }
.login-view::after { content: ""; position: absolute; inset: 0; z-index: -2; opacity: 0.26; background-image: linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px); background-size: 72px 72px; mask-image: radial-gradient(circle at center, black, transparent 78%); animation: loginGridDrift 18s linear infinite; }
.login-ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.login-ambient span { position: absolute; display: block; width: 36vw; aspect-ratio: 1; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; filter: blur(1px); opacity: 0.5; animation: loginFloat 11s ease-in-out infinite; }
.login-ambient span:nth-child(1) { left: -12vw; top: 12vh; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 18%, transparent), transparent 68%); }
.login-ambient span:nth-child(2) { right: -16vw; bottom: 0; width: 42vw; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 68%); animation-delay: -4s; }
.login-ambient span:nth-child(3) { right: 18vw; top: -18vw; width: 28vw; background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%); animation-delay: -7s; }
.login-panel { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr); gap: 34px; align-items: end; color: white; animation: loginRise 0.72s ease-out both; }
.login-hero { display: grid; justify-items: start; }
.login-brand-mark { width: 74px; height: 74px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid rgba(255,255,255,0.24); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05)); box-shadow: 0 24px 70px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.24); color: white; font-size: 24px; font-weight: 900; backdrop-filter: blur(18px); animation: brandPulse 4.8s ease-in-out infinite; }
.login-brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: white; }
.login-copy { color: rgba(255,255,255,0.78); font-size: 18px; max-width: 600px; line-height: 1.65; }
.login-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.login-chips span { border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 8px 11px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.82); font-size: 12px; font-weight: 800; backdrop-filter: blur(14px); }
.login-form { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1)); border: 1px solid rgba(255,255,255,0.26); border-radius: 14px; padding: 24px; backdrop-filter: blur(22px); box-shadow: 0 30px 90px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.22); animation: loginCardIn 0.8s 0.08s ease-out both; }
.login-form::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent); animation: loginShine 4.4s ease-in-out infinite; }
.login-form-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; color: white; }
.login-form-head strong { font-size: 15px; }
.login-form-head span { border-radius: 999px; padding: 5px 8px; background: rgba(34,197,94,0.15); color: #bbf7d0; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.login-form label { color: rgba(255,255,255,0.82); }
.login-form input, .login-form select { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.94); box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.login-form input:focus, .login-form select:focus { outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent); border-color: rgba(255,255,255,0.65); }
.login-form button { width: 100%; margin-top: 12px; background: linear-gradient(135deg, #ffffff, #dff7f2); color: #163f3d; box-shadow: 0 12px 28px rgba(0,0,0,0.16); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.login-form button:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(0,0,0,0.2); filter: none; }
.pin-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; color: rgba(255,255,255,0.8); font-size: 13px; }
.pin-grid span { border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 10px; background: rgba(255,255,255,0.07); backdrop-filter: blur(14px); animation: loginFadeIn 0.7s ease-out both; }
.pin-grid span:nth-child(2) { animation-delay: 0.05s; }
.pin-grid span:nth-child(3) { animation-delay: 0.1s; }
.pin-grid span:nth-child(4) { animation-delay: 0.15s; }
.form-error { min-height: 20px; color: #fecaca; margin-bottom: 0; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0; font-size: 12px; font-weight: 800; margin-bottom: 6px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 284px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px; background: var(--sidebar); color: white; box-shadow: 10px 0 36px rgba(16, 24, 32, 0.12); }
.brand-lockup { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; min-height: 56px; }
.brand-lockup span { display: block; color: rgba(255,255,255,0.62); font-size: 12px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--primary); font-weight: 900; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: white; }
.main-nav { display: grid; gap: 5px; overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.nav-button { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; color: rgba(255,255,255,0.74); text-align: left; padding: 10px 12px; }
.nav-button.active, .nav-button:hover { background: rgba(255,255,255,0.1); color: white; }
.ghost-button { margin-top: auto; background: transparent; border: 1px solid rgba(255,255,255,0.18); color: white; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 28px; background: rgba(238,242,246,0.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.tenant-context { display: flex; flex-wrap: wrap; gap: 6px; max-width: 720px; margin-top: 8px; }
.tenant-context span, .tenant-context strong { display: inline-flex; align-items: center; min-height: 26px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; background: rgba(255,255,255,0.74); color: var(--muted); font-size: 11px; font-weight: 800; }
.tenant-context strong { background: var(--primary); border-color: var(--primary); color: white; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar-actions select { min-width: 180px; }
.status-pill { display: inline-flex; align-items: center; min-height: 32px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; background: #dcfce7; color: var(--good); white-space: nowrap; }
.status-pill.warn { background: #fef3c7; color: var(--warn); }
.status-pill.bad { background: #fee2e2; color: var(--bad); }
.status-strip { min-height: 36px; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.review-gate { margin-bottom: 18px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; box-shadow: 0 1px 0 rgba(24,33,47,0.04); }
.review-list { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px; }
.review-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; }
.review-item span { display: inline-flex; margin-bottom: 6px; font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--muted); }
.review-item strong { display: block; font-size: 13px; }
.review-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; white-space: normal; }
.review-item.good { border-color: #bbf7d0; background: #f0fdf4; }
.review-item.warn { border-color: #fde68a; background: #fffbeb; }
.review-item.bad { border-color: #fecaca; background: #fef2f2; }
.review-confirm { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; color: var(--ink); font-weight: 800; text-align: left; touch-action: manipulation; }
.review-confirm.checked { border-color: #86efac; background: #f0fdf4; color: var(--good); }
.review-confirm:disabled { opacity: 0.65; cursor: not-allowed; }
.review-checkmark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; border: 2px solid #94a3b8; border-radius: 6px; background: white; color: var(--good); font-size: 18px; font-weight: 900; }
.review-confirm.checked .review-checkmark { border-color: var(--good); background: #dcfce7; }
.page { display: none; padding: 26px 28px 42px; }
.page.active { display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 1px 0 rgba(24,33,47,0.04); }
.secondary-button { background: #e6edf3; color: var(--ink); }
.danger-button { background: #fee2e2; color: var(--bad); }

.filter-row, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.wide-field { grid-column: 1 / -1; }
.filter-row > input { align-self: end; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: 16px; box-shadow: 0 1px 0 rgba(24,33,47,0.04); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 8px; font-size: 28px; }
.split-layout, .scanner-layout, .setup-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 18px; align-items: start; }
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #f7f9fb; color: var(--muted); text-transform: uppercase; font-size: 11px; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; background: #edf2f7; color: var(--muted); }
.badge.good { background: #dcfce7; color: var(--good); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.bad { background: #fee2e2; color: var(--bad); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions button { padding: 7px 9px; font-size: 12px; }
.stack-list { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfd; }
.list-item strong { display: block; margin-bottom: 4px; }
.list-item p { color: var(--muted); margin-bottom: 0; font-size: 13px; }
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.billing-card, .billing-notice { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: 14px; background: #fbfcfd; box-shadow: 0 1px 0 rgba(24,33,47,0.04); }
.billing-card.warn, .billing-notice.warn { border-left-color: var(--warn); background: #fffbeb; }
.billing-card.bad, .billing-notice.bad { border-left-color: var(--bad); background: #fef2f2; }
.billing-card-head, .billing-notice { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.billing-card strong, .billing-notice strong { display: block; margin-bottom: 4px; }
.billing-card p, .billing-notice p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.billing-usage { display: grid; gap: 7px; margin: 12px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.billing-usage.compact { min-width: 220px; margin: 0; }
.billing-card .billing-usage.compact { margin: 8px 0; max-width: 420px; }
.usage-bar { width: 100%; height: 9px; overflow: hidden; border-radius: 999px; background: #e5edf4; box-shadow: inset 0 1px 2px rgba(24,33,47,0.08); }
.usage-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #14b8a6); transition: width 0.28s ease; }
.billing-card.warn .usage-bar i, .billing-notice.warn .usage-bar i { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.billing-card.bad .usage-bar i, .billing-notice.bad .usage-bar i { background: linear-gradient(90deg, var(--bad), #ef4444); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.health-chip { display: grid; gap: 2px; border: 1px solid #dbe7df; border-radius: 8px; padding: 9px 10px; background: #f0fdf4; color: #14532d; font-size: 12px; }
.health-chip.bad { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.health-chip b { color: inherit; font-size: 11px; text-transform: uppercase; }
.timeline-list { position: relative; display: grid; gap: 10px; margin-bottom: 14px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfd; }
.timeline-item::before { content: ""; position: absolute; left: 20px; top: 30px; bottom: -12px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 10px; height: 10px; margin-top: 7px; border-radius: 999px; background: var(--primary); box-shadow: 0 0 0 4px #dff7f2; }
.timeline-item strong { display: block; margin-bottom: 4px; }
.timeline-item p { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

.scan-box { display: grid; gap: 14px; justify-items: center; text-align: center; background: #101820; color: white; border-radius: 8px; padding: 28px; box-shadow: var(--shadow); }
.scan-frame { position: relative; width: min(340px, 100%); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 2px solid rgba(255,255,255,0.38); border-radius: 8px; background: radial-gradient(circle at center, rgba(15,118,110,0.45), transparent 60%); }
.scan-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s ease; }
.scan-frame.scanning video { opacity: 1; }
.scan-frame span { position: relative; z-index: 1; width: 74%; height: 2px; background: #67e8f9; box-shadow: 0 0 18px #67e8f9; animation: scan 2s ease-in-out infinite; }
.camera-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@keyframes scan { 0%, 100% { transform: translateY(-90px); } 50% { transform: translateY(90px); } }
@keyframes loginRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginCardIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loginFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginFloat { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(18px, -16px, 0) scale(1.04); } }
@keyframes loginGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 72px 72px, 72px 72px; } }
@keyframes loginShine { 0%, 55%, 100% { transform: translateX(-100%); opacity: 0; } 70% { opacity: 0.9; } 86% { transform: translateX(100%); opacity: 0; } }
@keyframes brandPulse { 0%, 100% { transform: translateY(0); box-shadow: 0 24px 70px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.24); } 50% { transform: translateY(-4px); box-shadow: 0 32px 86px rgba(0,0,0,0.3), 0 0 30px color-mix(in srgb, var(--primary) 30%, transparent), inset 0 1px 0 rgba(255,255,255,0.24); } }
.inline-form { display: flex; gap: 10px; width: 100%; }
.result-box { width: 100%; min-height: 48px; border-radius: 8px; padding: 12px; background: rgba(255,255,255,0.08); color: inherit; text-align: left; }
.result-box strong { display: block; margin-bottom: 4px; }
.result-box p { margin-bottom: 0; color: rgba(255,255,255,0.72); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-head p { color: var(--muted); margin-bottom: 0; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.section-gap { margin-top: 18px; }
.roles-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.schedule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.schedule-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.schedule-card .form-grid { grid-template-columns: 1fr 1fr; margin-bottom: 0; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.qr-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-align: center; break-inside: avoid; }
.qr-card p { color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.qr-card button { margin-top: 12px; width: 100%; }
.qr-code { width: 148px; height: 148px; margin: 0 auto 12px; border: 8px solid white; object-fit: contain; background: white; box-shadow: 0 0 0 1px var(--line); }
.qr-card code, .qr-card strong { overflow-wrap: anywhere; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.report-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.report-card strong { display: block; font-size: 24px; margin: 10px 0; }
.button-stack { display: grid; gap: 10px; }
.brand-preview { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; }
.brand-preview strong { display: block; color: var(--ink); }
.brand-preview span { color: var(--muted); font-size: 12px; font-weight: 800; }
.brand-preview-mark { width: 56px; height: 56px; color: white; }
.portal-shell { max-width: 760px; }
.empty-state { padding: 24px; color: var(--muted); }
dialog { border: 0; border-radius: 8px; padding: 0; box-shadow: var(--shadow); width: min(520px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(16,24,32,0.44); }
.dialog-form { display: grid; gap: 12px; padding: 20px; }
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; margin: 8px 0 0; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); background: #101820; color: white; border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); z-index: 30; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 236px 1fr; }
  .sidebar { padding: 18px; }
  .page { padding: 22px; }
  .review-list { grid-template-columns: 1fr; }
  .split-layout, .scanner-layout, .setup-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; gap: 12px; padding: 14px; }
  .brand-lockup { grid-template-columns: 40px 1fr; min-height: 48px; }
  .brand-mark { width: 40px; height: 40px; }
  .main-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
  .nav-button { flex: 0 0 auto; width: auto; min-height: 42px; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; white-space: nowrap; }
  .ghost-button { margin-top: 0; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; padding: 16px; }
  .topbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .topbar-actions select, .topbar-actions button, .topbar-actions .status-pill { width: 100%; min-width: 0; justify-content: center; }
  .filter-row, .form-grid, .metric-grid, .split-layout, .scanner-layout, .setup-grid, .roles-grid, .schedule-grid, .report-grid { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .section-head > .row-actions, .section-head > div:not(:first-child) { justify-content: flex-start; }
  .row-actions { justify-content: flex-start; }
  .login-panel { grid-template-columns: 1fr; }
  .login-brand-mark { width: 64px; height: 64px; margin-bottom: 16px; }
  .pin-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  button, input, select { min-height: 44px; }
  h2 { font-size: 26px; }
  h3 { font-size: 16px; }
  .login-view { padding: 16px; }
  .login-panel { gap: 18px; }
  .login-brand-mark { width: 58px; height: 58px; border-radius: 14px; }
  .login-copy { font-size: 15px; line-height: 1.55; }
  .login-chips span { padding: 7px 9px; }
  .login-form { padding: 18px; border-radius: 12px; }
  .login-form-head { align-items: flex-start; flex-direction: column; }
  .pin-grid { grid-template-columns: 1fr; }
  .page { padding: 16px 12px 32px; }
  .topbar-actions { grid-template-columns: 1fr; }
  .metric-card strong { font-size: 24px; }
  .panel, .review-gate, .metric-card, .report-card, .schedule-card, .list-item { border-radius: 8px; }
  .scan-box { padding: 18px 12px; }
  .inline-form { flex-direction: column; }
  .camera-actions, .row-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .row-actions button, .camera-actions button { width: 100%; min-height: 44px; }
  .billing-card-head, .billing-notice { flex-direction: column; }
  .billing-usage.compact { width: 100%; min-width: 0; }
  .status-strip { padding: 10px 0; line-height: 1.5; }
  .status-pill { white-space: normal; justify-content: center; text-align: center; }
  .review-confirm { align-items: flex-start; }
  .table-wrap { max-width: calc(100vw - 24px); }
  table { min-width: 720px; }
  th, td { padding: 10px; font-size: 12px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

@media print {
  body * { visibility: hidden; }
  #qrCards, #qrCards * { visibility: visible; }
  #qrCards { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px; }
}
