:root {
  --ink: #151719;
  --ink-2: #24272b;
  --ink-3: #3e4349;
  --muted: #69717b;
  --line: #dfe3e8;
  --line-strong: #c9ced5;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --surface-3: #eef0f2;
  --danger: #b4232b;
  --danger-dark: #881b21;
  --danger-soft: #fff0f1;
  --success: #16794a;
  --success-soft: #eaf8f1;
  --warning: #936213;
  --warning-soft: #fff7e7;
  --info: #285e9e;
  --info-soft: #edf5ff;
  --purple: #6551a8;
  --purple-soft: #f3f0ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 12px 34px rgba(21, 23, 25, .10);
  --shadow-lg: 0 24px 70px rgba(21, 23, 25, .18);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 258px;
  --header-height: 72px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-2); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--surface-2); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
svg { flex: 0 0 auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.app-loading { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 30%, #fff 0, #f1f2f3 45%, #e6e8ea 100%); }
.loading-card { width: min(390px, 100%); padding: 40px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center; }
.loading-card img { width: 220px; max-height: 130px; object-fit: contain; }
.loading-card p { color: var(--muted); margin: 16px 0 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--danger); border-radius: 50%; margin: 20px auto 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) minmax(480px, 1.08fr); background: var(--surface); }
.auth-visual { position: relative; overflow: hidden; padding: 52px clamp(32px, 5vw, 84px); display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(145deg, #111315 0%, #24282d 68%, #17191b 100%); }
.auth-visual::before { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -260px; top: -170px; box-shadow: 0 0 0 58px rgba(255,255,255,.025), 0 0 0 116px rgba(255,255,255,.018); }
.auth-visual::after { content: ""; position: absolute; inset: auto -80px -150px auto; width: 390px; height: 390px; border-radius: 80px; transform: rotate(25deg); background: linear-gradient(145deg, rgba(180,35,43,.22), transparent 68%); }
.auth-brand, .auth-pitch, .auth-foot { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 18px; }
.auth-brand__mark { width: 88px; height: 68px; border-radius: 13px; background: white; display: grid; place-items: center; padding: 5px 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.auth-brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand h1 { font-size: 19px; letter-spacing: .02em; margin: 0; }
.auth-brand p { margin: 5px 0 0; color: #b9bec5; font-size: 13px; }
.auth-pitch { max-width: 580px; margin: 68px 0; }
.auth-kicker { color: #f2a8ac; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; font-size: 12px; }
.auth-pitch h2 { font-size: clamp(38px, 4.4vw, 66px); line-height: 1.02; letter-spacing: -.045em; margin: 17px 0 24px; max-width: 640px; }
.auth-pitch > p { color: #c8ccd1; line-height: 1.7; font-size: 17px; max-width: 530px; }
.auth-benefits { display: grid; gap: 12px; margin-top: 34px; }
.auth-benefit { display: flex; align-items: center; gap: 12px; color: #eceeef; font-size: 14px; }
.auth-benefit__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.08); }
.auth-foot { color: #aab0b8; font-size: 12px; }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 42px clamp(24px, 6vw, 90px); overflow-y: auto; }
.auth-card { width: min(570px, 100%); }
.auth-mobile-logo { display: none; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-mobile-logo img { width: 96px; height: 70px; object-fit: contain; }
.auth-mobile-logo strong { font-size: 18px; }
.auth-card__header { margin-bottom: 28px; }
.auth-card__header h2 { font-size: 32px; letter-spacing: -.035em; margin: 0 0 9px; }
.auth-card__header p { color: var(--muted); margin: 0; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface-3); margin-bottom: 26px; }
.auth-tab { border: 0; border-radius: 9px; padding: 11px 12px; background: transparent; color: var(--muted); font-weight: 700; }
.auth-tab.is-active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-stepper { display: flex; align-items: center; margin: 6px 0 28px; }
.auth-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.auth-step__number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); }
.auth-step.is-active { color: var(--ink); }
.auth-step.is-active .auth-step__number { background: var(--ink); color: white; }
.auth-step.is-complete .auth-step__number { background: var(--success); color: white; }
.auth-stepper__line { flex: 1; height: 1px; background: var(--line); margin: 0 9px; }
.demo-box { margin-top: 30px; padding: 18px; border-radius: var(--radius); border: 1px dashed var(--line-strong); background: var(--surface-2); }
.demo-box__head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.demo-box__head svg { color: var(--danger); }
.demo-box h3 { margin: 0; font-size: 14px; }
.demo-box p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.demo-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-action { min-height: 74px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 10px 8px; color: var(--ink-3); font-size: 11px; font-weight: 700; display: grid; justify-items: center; gap: 5px; }
.demo-action:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.demo-action svg { color: var(--danger); }
.privacy-note { margin-top: 22px; color: var(--muted); font-size: 11px; line-height: 1.55; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: grid; gap: 7px; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-label { color: var(--ink-3); font-size: 12px; font-weight: 750; }
.form-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-control { width: 100%; min-height: 45px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.form-control:hover { border-color: #aeb5be; }
.form-control:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(21,23,25,.08); }
.form-control[disabled], .form-control[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
textarea.form-control { min-height: 98px; resize: vertical; }
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 35px; }
.input-with-icon { position: relative; }
.input-with-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-with-icon .form-control { padding-left: 43px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix .form-control { border-radius: 10px 0 0 10px; }
.input-suffix__label { display: flex; align-items: center; padding: 0 13px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.choice-row { display: flex; gap: 9px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: flex; align-items: center; gap: 8px; min-height: 41px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.choice input:checked + label { border-color: var(--ink); color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 2px rgba(21,23,25,.06); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--ink); }
.checkbox-row label { font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.file-control { position: relative; display: grid; place-items: center; min-height: 112px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-2); color: var(--muted); text-align: center; overflow: hidden; }
.file-control:hover { border-color: var(--ink-3); }
.file-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-control strong { color: var(--ink-3); font-size: 12px; }
.file-control span { font-size: 10px; margin-top: 4px; }
.field-error { color: var(--danger); font-size: 11px; }
.form-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: 10px; font-size: 12px; line-height: 1.5; margin-bottom: 17px; }
.form-alert--error { color: var(--danger-dark); background: var(--danger-soft); border: 1px solid #f4c7ca; }
.form-alert--info { color: #214f83; background: var(--info-soft); border: 1px solid #cfe2f8; }
.form-alert--success { color: #12653e; background: var(--success-soft); border: 1px solid #c5ead7; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.form-actions--stretch .btn { flex: 1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Buttons */
.btn { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 750; line-height: 1; transition: transform .12s, background-color .12s, border-color .12s, box-shadow .12s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .52; cursor: not-allowed; transform: none; }
.btn--primary { color: white; background: var(--ink); border-color: var(--ink); box-shadow: 0 7px 14px rgba(21,23,25,.12); }
.btn--primary:hover { background: #292d31; }
.btn--danger { color: white; background: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-dark); }
.btn--outline { color: var(--ink-3); background: var(--surface); border-color: var(--line-strong); }
.btn--outline:hover { border-color: var(--ink-3); }
.btn--soft { color: var(--ink-3); background: var(--surface-3); border-color: transparent; }
.btn--soft:hover { background: #e5e8eb; }
.btn--success { color: var(--success); background: var(--success-soft); border-color: #c5ead7; }
.btn--warning { color: var(--warning); background: var(--warning-soft); border-color: #f0dda9; }
.btn--link { min-height: auto; padding: 4px; color: var(--info); background: transparent; }
.btn--icon { width: 40px; padding: 0; }
.btn--small { min-height: 34px; padding: 7px 10px; font-size: 11px; border-radius: 8px; }
.btn--large { min-height: 49px; padding: 12px 19px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Main shell */
.portal { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex; flex-direction: column; color: #e7e9eb; background: #17191b; border-right: 1px solid #2b2e32; transition: transform .2s ease; }
.sidebar__brand { height: var(--header-height); display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__logo { width: 65px; height: 52px; display: grid; place-items: center; padding: 2px 4px; border-radius: 8px; background: white; }
.sidebar__logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar__brand-text strong { display: block; font-size: 13px; }
.sidebar__brand-text span { display: block; color: #999fa7; font-size: 10px; margin-top: 3px; }
.sidebar__role { margin: 18px 14px 7px; padding: 11px 12px; border-radius: 10px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06); }
.sidebar__role-label { color: #9299a2; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 750; }
.sidebar__role strong { display: block; margin-top: 4px; font-size: 12px; }
.sidebar__nav { flex: 1; padding: 8px 10px 20px; overflow-y: auto; }
.nav-section-label { margin: 14px 12px 7px; color: #747b84; font-size: 9px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; padding: 9px 12px; margin: 2px 0; color: #aeb4bb; background: transparent; font-size: 12px; text-align: left; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: white; background: rgba(180,35,43,.92); box-shadow: 0 8px 20px rgba(180,35,43,.18); }
.nav-item__count { margin-left: auto; min-width: 21px; height: 19px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; color: #d8dce0; background: rgba(255,255,255,.10); font-size: 9px; }
.nav-item.is-active .nav-item__count { background: rgba(255,255,255,.18); color: white; }
.sidebar__footer { padding: 13px 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.user-mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: linear-gradient(145deg, #4d535b, #2a2e33); font-size: 11px; font-weight: 800; }
.avatar--tenant { background: linear-gradient(145deg, #366fab, #234c7a); }
.avatar--manager { background: linear-gradient(145deg, #897229, #5c4a12); }
.avatar--guardian { background: linear-gradient(145deg, #bb343c, #7f1d24); }
.user-mini__text { min-width: 0; flex: 1; }
.user-mini__text strong, .user-mini__text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini__text strong { font-size: 11px; }
.user-mini__text span { color: #8f969f; font-size: 9px; margin-top: 3px; }
.user-mini__logout { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #939aa3; background: transparent; }
.user-mini__logout:hover { color: white; background: rgba(255,255,255,.07); }
.main-shell { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(20px, 3vw, 38px); background: rgba(255,255,255,.94); backdrop-filter: blur(13px); border-bottom: 1px solid var(--line); }
.topbar__left { min-width: 0; display: flex; align-items: center; gap: 14px; }
.mobile-menu { display: none; }
.topbar__titles { min-width: 0; }
.topbar__titles h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; letter-spacing: -.02em; }
.topbar__titles p { margin: 4px 0 0; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__right { display: flex; align-items: center; gap: 9px; }
.mode-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #ead49b; border-radius: 20px; color: #775111; background: #fff8e8; font-size: 10px; font-weight: 750; }
.mode-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: #d69526; box-shadow: 0 0 0 3px rgba(214,149,38,.15); }
.topbar-action { position: relative; width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-3); background: white; }
.topbar-action:hover { border-color: var(--ink-3); }
.topbar-action__dot { position: absolute; right: 7px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid white; }
.content { width: min(1550px, 100%); margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-head h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 12px; }
.page-head__actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

/* General components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card__head h3 { margin: 0; font-size: 13px; }
.card__head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.card__body { padding: 18px; }
.card__foot { padding: 13px 18px; border-top: 1px solid var(--line); background: #fbfbfc; border-radius: 0 0 var(--radius) var(--radius); }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-head h3 { margin: 0; font-size: 15px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); align-items: start; }
.stack { display: grid; gap: 14px; }
.inline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.tiny { font-size: 9px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.no-margin { margin: 0; }

.hero-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); min-height: 220px; color: white; background: linear-gradient(128deg, #151719 0%, #272b30 70%, #1d2023 100%); border: 0; box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; right: -120px; top: -200px; width: 500px; height: 500px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.hero-card__content { position: relative; z-index: 1; padding: 30px; }
.hero-card__eyebrow { color: #d8dce0; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 750; }
.hero-card h2 { margin: 9px 0 8px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
.hero-card p { max-width: 640px; margin: 0; color: #bfc4ca; font-size: 12px; line-height: 1.6; }
.hero-card__meta { display: flex; gap: 25px; flex-wrap: wrap; margin-top: 27px; }
.hero-meta { display: grid; gap: 4px; }
.hero-meta span { color: #999fa7; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.hero-meta strong { font-size: 13px; }
.hero-card__status { position: relative; z-index: 1; display: grid; align-content: center; padding: 28px; border-left: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); }
.status-ring { width: 126px; height: 126px; display: grid; place-items: center; margin: auto; border-radius: 50%; border: 8px solid rgba(255,255,255,.12); box-shadow: inset 0 0 0 2px rgba(255,255,255,.05); }
.status-ring--active { border-color: rgba(64, 196, 127, .45); }
.status-ring--expired { border-color: rgba(217, 73, 81, .55); }
.status-ring__inner { text-align: center; }
.status-ring__inner svg { color: #7ae0ab; }
.status-ring__inner strong { display: block; font-size: 13px; margin-top: 4px; }
.status-ring__inner span { display: block; color: #abb1b8; font-size: 9px; margin-top: 3px; }

.stat-card { padding: 17px; min-height: 120px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-card__icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-3); background: var(--surface-3); }
.stat-card__icon--danger { color: var(--danger); background: var(--danger-soft); }
.stat-card__icon--success { color: var(--success); background: var(--success-soft); }
.stat-card__icon--warning { color: var(--warning); background: var(--warning-soft); }
.stat-card__icon--info { color: var(--info); background: var(--info-soft); }
.stat-card__copy { min-width: 0; }
.stat-card__copy span { color: var(--muted); font-size: 10px; }
.stat-card__copy strong { display: block; margin-top: 5px; font-size: 27px; letter-spacing: -.04em; }
.stat-card__copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.stat-card__trend { color: var(--success); font-size: 9px; font-weight: 700; }

.action-card { position: relative; overflow: hidden; min-height: 148px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: white; text-align: left; transition: transform .15s, box-shadow .15s, border-color .15s; }
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.action-card__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--ink); }
.action-card--temp .action-card__icon { background: var(--purple); }
.action-card--guest .action-card__icon { background: var(--info); }
.action-card h3 { margin: 16px 0 5px; font-size: 13px; }
.action-card p { margin: 0; max-width: 90%; color: var(--muted); font-size: 10px; line-height: 1.45; }
.action-card__arrow { position: absolute; right: 17px; top: 17px; color: var(--line-strong); }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 4px 8px; border-radius: 20px; font-size: 9px; font-weight: 800; line-height: 1; text-transform: capitalize; white-space: nowrap; }
.badge--active, .badge--approved, .badge--sent { color: var(--success); background: var(--success-soft); border: 1px solid #c9ead8; }
.badge--inactive, .badge--neutral, .badge--moved_out { color: #5e6670; background: #eef0f2; border: 1px solid #dde1e5; }
.badge--expired, .badge--rejected, .badge--failed { color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c5c8; }
.badge--pending, .badge--pending_change, .badge--scheduled { color: var(--warning); background: var(--warning-soft); border: 1px solid #eedba8; }
.badge--temporary { color: var(--purple); background: var(--purple-soft); border: 1px solid #ddd6fa; }
.badge--guest { color: var(--info); background: var(--info-soft); border: 1px solid #cce0f6; }
.badge--resident { color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); }
.badge--suspended { color: #8b4e13; background: #fff0df; border: 1px solid #f2cfaa; }

.vehicle-list { display: grid; gap: 11px; }
.vehicle-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.vehicle-card--inactive { opacity: .72; background: #fafafa; }
.vehicle-card__icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-3); background: var(--surface-3); }
.vehicle-card--temporary .vehicle-card__icon { color: var(--purple); background: var(--purple-soft); }
.vehicle-card--guest .vehicle-card__icon { color: var(--info); background: var(--info-soft); }
.vehicle-card__main { min-width: 0; }
.vehicle-card__top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.vehicle-card__top strong { font-size: 13px; }
.vehicle-card__meta { display: flex; align-items: center; gap: 7px 14px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 9px; }
.vehicle-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.plate { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid #bfc4ca; border-radius: 5px; color: #151719; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; letter-spacing: .07em; box-shadow: inset 0 0 0 2px #f0f1f2; }
.vehicle-card__actions { display: flex; gap: 6px; align-items: center; }
.vehicle-card__actions .btn { min-height: 34px; }

.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: #fafbfb; font-size: 9px; text-transform: uppercase; letter-spacing: .075em; font-weight: 800; }
.data-table td { font-size: 10px; }
.data-table tbody tr:hover { background: #fafbfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-primary { display: grid; gap: 3px; }
.table-primary strong { color: var(--ink); font-size: 11px; }
.table-primary span { color: var(--muted); font-size: 9px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.table-empty { padding: 38px !important; text-align: center !important; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 11px; flex-wrap: wrap; margin-bottom: 13px; }
.toolbar__left, .toolbar__right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; min-width: min(320px, 100%); }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { min-height: 39px; width: 100%; padding: 8px 12px 8px 38px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: white; font-size: 11px; }
.search-box input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(21,23,25,.06); }
.filter-select { min-height: 39px; padding: 8px 34px 8px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: var(--ink-3); font-size: 10px; }
.tabs { display: flex; gap: 3px; padding: 4px; border-radius: 10px; background: var(--surface-3); overflow-x: auto; }
.tab { min-height: 34px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); background: white; box-shadow: var(--shadow-sm); }
.property-select { max-width: 270px; min-height: 39px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 34px 8px 11px; background: white; color: var(--ink-3); font-size: 11px; }

.empty-state { display: grid; justify-items: center; text-align: center; padding: 42px 20px; }
.empty-state__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--muted); background: var(--surface-3); }
.empty-state h3 { margin: 15px 0 6px; font-size: 13px; }
.empty-state p { max-width: 380px; margin: 0; color: var(--muted); line-height: 1.55; font-size: 10px; }
.empty-state .btn { margin-top: 16px; }

.notice { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); }
.notice__icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--info); background: var(--info-soft); }
.notice--warning .notice__icon { color: var(--warning); background: var(--warning-soft); }
.notice--danger .notice__icon { color: var(--danger); background: var(--danger-soft); }
.notice--success .notice__icon { color: var(--success); background: var(--success-soft); }
.notice h4 { margin: 0; font-size: 11px; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 18px; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 27px; bottom: 2px; width: 1px; background: var(--line); }
.timeline-item__dot { position: relative; z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; }
.timeline-item__content { padding-top: 3px; }
.timeline-item__content strong { display: block; font-size: 10px; }
.timeline-item__content p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.timeline-item__content time { display: block; margin-top: 5px; color: #949ba3; font-size: 8px; }

.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--info); background: var(--info-soft); }
.notification-item__copy strong { display: block; font-size: 10px; }
.notification-item__copy p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; font-size: 9px; }
.notification-item time { color: #949ba3; font-size: 8px; white-space: nowrap; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.property-card { overflow: hidden; }
.property-card__cover { height: 70px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; color: white; background: linear-gradient(125deg, #24272b, #3a3f45); }
.property-card__cover svg { opacity: .58; }
.property-card__body { padding: 15px; }
.property-card__body h3 { margin: 0; font-size: 13px; }
.property-card__body > p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.property-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.property-card__stat { padding: 9px; border-radius: 8px; background: var(--surface-2); }
.property-card__stat span { display: block; color: var(--muted); font-size: 8px; }
.property-card__stat strong { display: block; margin-top: 3px; font-size: 13px; }
.property-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.registration-code { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--ink-3); background: var(--surface-2); font-family: ui-monospace, monospace; font-size: 9px; font-weight: 700; }

.lookup-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 16px; border-radius: var(--radius); color: white; background: linear-gradient(130deg, #1c1f22, #2d3136); }
.lookup-panel input { min-height: 46px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: white; background: rgba(255,255,255,.08); outline: none; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.lookup-panel input::placeholder { color: #959ca4; text-transform: none; letter-spacing: 0; font-weight: 400; }
.lookup-panel input:focus { border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 3px rgba(255,255,255,.07); }
.lookup-result { margin-top: 13px; padding: 15px; border-radius: 11px; border: 1px solid var(--line); background: white; }
.lookup-result--active { border-left: 5px solid var(--success); }
.lookup-result--not-found { border-left: 5px solid var(--danger); }
.lookup-result__head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.lookup-result__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 14px; }
.lookup-result__field span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.lookup-result__field strong { display: block; margin-top: 4px; font-size: 10px; }

.integration-card { position: relative; overflow: hidden; padding: 22px; }
.integration-card::after { content: ""; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: var(--surface-2); }
.integration-card__head { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 15px; }
.integration-logo { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 14px; color: white; background: #1b5d91; font-size: 14px; font-weight: 900; letter-spacing: -.04em; }
.integration-card h3 { margin: 17px 0 6px; font-size: 16px; }
.integration-card p { max-width: 520px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.integration-status { display: flex; align-items: center; gap: 7px; color: var(--warning); font-size: 9px; font-weight: 750; }
.integration-status__dot { width: 8px; height: 8px; border-radius: 50%; background: #d49a32; box-shadow: 0 0 0 4px rgba(212,154,50,.13); }
.integration-status--connected { color: var(--success); }
.integration-status--connected .integration-status__dot { background: var(--success); }
.integration-card__actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.sync-log { display: grid; gap: 8px; }
.sync-log__row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sync-log__row:last-child { border-bottom: 0; }
.sync-log__icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--success); background: var(--success-soft); }
.sync-log__copy strong { display: block; font-size: 9px; }
.sync-log__copy span { display: block; color: var(--muted); font-size: 8px; margin-top: 3px; }
.sync-log time { color: var(--muted); font-size: 8px; }

.code-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.code-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-family: ui-monospace, monospace; font-size: 10px; }

.import-zone { display: grid; place-items: center; min-height: 190px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); text-align: center; position: relative; }
.import-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import-zone__icon { width: 51px; height: 51px; display: grid; place-items: center; border-radius: 14px; color: var(--info); background: var(--info-soft); }
.import-zone h3 { margin: 14px 0 5px; font-size: 13px; }
.import-zone p { max-width: 440px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.import-preview { margin-top: 15px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Modal, drawer, toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8,10,12,.58); backdrop-filter: blur(4px); animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(670px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; border-radius: 18px; background: white; box-shadow: var(--shadow-lg); animation: modalIn .18s ease; }
.modal--wide { width: min(940px, 100%); }
.modal--narrow { width: min(470px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.modal__head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.modal__close { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: var(--surface-2); }
.modal__close:hover { color: var(--ink); background: var(--surface-3); }
.modal__body { padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfb; border-radius: 0 0 18px 18px; }
.confirm-copy { text-align: center; padding: 12px 8px; }
.confirm-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: auto; border-radius: 17px; color: var(--danger); background: var(--danger-soft); }
.confirm-copy h3 { margin: 17px 0 7px; font-size: 17px; }
.confirm-copy p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 11px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(8,10,12,.35); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(420px, 92vw); display: flex; flex-direction: column; background: white; box-shadow: var(--shadow-lg); animation: drawerIn .2s ease; }
@keyframes drawerIn { from { transform: translateX(100%); } }
.drawer__head { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 160; display: grid; gap: 8px; width: min(390px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 10px; align-items: flex-start; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); pointer-events: auto; animation: toastIn .22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast__icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: var(--success); background: var(--success-soft); }
.toast--error .toast__icon { color: var(--danger); background: var(--danger-soft); }
.toast--warning .toast__icon { color: var(--warning); background: var(--warning-soft); }
.toast__copy strong { display: block; font-size: 10px; }
.toast__copy p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toast__close { border: 0; background: transparent; color: var(--muted); padding: 2px; }

.mobile-overlay { display: none; }

@media (max-width: 1100px) {
  .auth-page { grid-template-columns: minmax(330px, .8fr) minmax(460px, 1.2fr); }
  .auth-pitch h2 { font-size: 44px; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lookup-result__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .auth-page { display: block; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 20px 50px; }
  .auth-mobile-logo { display: flex; }
  .portal { display: block; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main-shell { grid-column: auto; }
  .mobile-menu { display: grid; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(8,10,12,.42); }
  .grid--sidebar { grid-template-columns: 1fr; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card__status { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .status-ring { width: 105px; height: 105px; }
  .mapping-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .content { padding: 22px 14px 45px; }
  .topbar { padding: 0 13px; }
  .topbar__titles p, .mode-pill span:not(.mode-pill__dot) { display: none; }
  .page-head { display: grid; }
  .page-head__actions { justify-content: flex-start; }
  .page-head h2 { font-size: 23px; }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .hero-card__content { padding: 23px 20px; }
  .hero-card__status { padding: 20px; }
  .hero-card__meta { gap: 15px; }
  .vehicle-card { grid-template-columns: auto minmax(0,1fr); }
  .vehicle-card__actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
  .demo-actions { grid-template-columns: 1fr; }
  .demo-action { min-height: 52px; grid-template-columns: 24px 1fr; justify-items: start; text-align: left; padding: 10px 12px; }
  .auth-card__header h2 { font-size: 27px; }
  .auth-step span:not(.auth-step__number) { display: none; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal--wide, .modal--narrow { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal__foot { border-radius: 0; }
  .modal__foot .btn { flex: 1; }
  .lookup-panel { grid-template-columns: 1fr; }
  .lookup-result__grid { grid-template-columns: 1fr 1fr; }
  .mapping-grid { grid-template-columns: 1fr; }
  .property-card__stats { grid-template-columns: repeat(3, 1fr); }
  .toolbar { align-items: stretch; }
  .toolbar__left, .toolbar__right, .search-box { width: 100%; }
  .filter-select { flex: 1; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
}

@media print {
  .sidebar, .topbar, .page-head__actions, .btn, .toolbar, .mode-pill { display: none !important; }
  .portal, .main-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: white; }
}

/* Guardian Lot Scan */
.lot-scan-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .72fr); gap: 18px; align-items: start; }
.lot-scan-console { overflow: hidden; }
.scan-control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr); gap: 15px; align-items: end; margin-bottom: 16px; }
.scan-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-3); }
.scan-mode-tab { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 750; }
.scan-mode-tab:hover:not(:disabled) { color: var(--ink); }
.scan-mode-tab.is-active { color: var(--ink); background: white; box-shadow: var(--shadow-sm); }
.scan-mode-tab:disabled { opacity: .55; cursor: not-allowed; }
.scan-camera-stage { position: relative; min-height: 300px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; border: 1px solid #34393f; color: white; background: radial-gradient(circle at 50% 45%, #343a40 0, #1b1e21 68%, #101214 100%); isolation: isolate; }
.scan-camera-stage::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.18), transparent 25%, transparent 72%, rgba(0,0,0,.28)); }
.scan-camera-stage video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: none; object-fit: cover; background: #0e1012; }
.scan-camera-stage.is-running video, .scan-camera-stage.is-processing video { display: block; }
.scan-camera-placeholder { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; text-align: center; }
.scan-camera-placeholder svg { color: #c4c9cf; }
.scan-camera-placeholder strong { font-size: 14px; }
.scan-camera-placeholder span { max-width: 470px; color: #aeb5bd; font-size: 10px; line-height: 1.55; }
.scan-camera-stage.is-running .scan-camera-placeholder, .scan-camera-stage.is-processing .scan-camera-placeholder { display: none; }
.scan-reticle { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(82%, 540px); aspect-ratio: 2 / 1; transform: translate(-50%,-50%); pointer-events: none; opacity: .9; filter: drop-shadow(0 1px 5px rgba(0,0,0,.48)); }

.scan-camera-stage.is-running .scan-reticle::before {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  top: 8%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(88,214,154,.98) 18%, rgba(255,255,255,.98) 50%, rgba(88,214,154,.98) 82%, transparent);
  box-shadow: 0 0 10px rgba(88,214,154,.9), 0 0 24px rgba(88,214,154,.5);
  animation: scanSweep 1.25s ease-in-out infinite alternate;
}
.scan-camera-stage.is-running .scan-reticle > span { border-color: rgba(88,214,154,.98); }
.scan-reticle > span { position: absolute; width: 36px; height: 27px; border-color: rgba(255,255,255,.93); }
.scan-reticle > span:nth-child(1) { left: 0; top: 0; border-left: 3px solid; border-top: 3px solid; }
.scan-reticle > span:nth-child(2) { right: 0; top: 0; border-right: 3px solid; border-top: 3px solid; }
.scan-reticle > span:nth-child(3) { left: 0; bottom: 0; border-left: 3px solid; border-bottom: 3px solid; }
.scan-reticle > span:nth-child(4) { right: 0; bottom: 0; border-right: 3px solid; border-bottom: 3px solid; }
.scan-reticle > div { position: absolute; left: 50%; bottom: -25px; transform: translateX(-50%); padding: 4px 7px; border-radius: 5px; color: rgba(255,255,255,.88); background: rgba(0,0,0,.45); font-size: 8px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.scan-live-indicator { position: absolute; left: 14px; top: 14px; z-index: 4; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 7px; background: rgba(12,14,16,.72); backdrop-filter: blur(5px); font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.scan-live-indicator > span { width: 7px; height: 7px; border-radius: 50%; background: #ff4d55; box-shadow: 0 0 0 4px rgba(255,77,85,.18); animation: scanPulse 1.25s infinite; }
#lot-scan-live-result-host { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 7; pointer-events: none; }
.scan-live-result-stack { display: grid; justify-items: stretch; gap: 8px; width: min(100%, 720px); margin-left: auto; }
.scan-live-result { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: stretch; overflow: hidden; border: 2px solid rgba(255,255,255,.35); border-radius: 13px; color: white; background: rgba(10,13,16,.92); box-shadow: 0 12px 36px rgba(0,0,0,.36); backdrop-filter: blur(8px); animation: scanResultIn .2s ease-out; }
.scan-live-result--valid { border-color: #58d69a; box-shadow: 0 12px 36px rgba(0,0,0,.36), 0 0 0 3px rgba(39,169,111,.16); }
.scan-live-result--invalid { border-color: #ff646d; box-shadow: 0 12px 36px rgba(0,0,0,.36), 0 0 0 3px rgba(225,61,70,.18); }
.scan-live-result--verify { border-color: #ffc857; box-shadow: 0 12px 36px rgba(0,0,0,.36), 0 0 0 3px rgba(231,166,37,.18); }
.scan-live-result__outcome { min-width: 102px; display: grid; align-content: center; justify-items: center; gap: 5px; padding: 13px 14px; text-align: center; }
.scan-live-result--valid .scan-live-result__outcome { color: #eafff4; background: rgba(25,151,91,.86); }
.scan-live-result--invalid .scan-live-result__outcome { color: white; background: rgba(205,42,52,.9); }
.scan-live-result--verify .scan-live-result__outcome { color: #241b08; background: rgba(255,190,55,.94); }
.scan-live-result__outcome strong { font-size: 14px; line-height: 1; letter-spacing: .055em; }
.scan-live-result__body { min-width: 0; display: grid; grid-template-columns: minmax(110px,.7fr) minmax(0,1.3fr); align-items: center; gap: 12px; padding: 10px 13px; }
.scan-live-result__plate span { display: block; color: #aeb7c0; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.scan-live-result__plate strong { display: block; overflow: hidden; margin-top: 2px; font-size: clamp(19px,3vw,28px); line-height: 1; letter-spacing: .055em; text-overflow: ellipsis; white-space: nowrap; }
.scan-live-result__reason { min-width: 0; }
.scan-live-result__reason strong { display: block; font-size: 10px; }
.scan-live-result__reason span { display: block; margin-top: 3px; color: #d3d8de; font-size: 8px; line-height: 1.4; }
.scan-live-result__facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; color: #b8c0c8; font-size: 7px; }
.scan-live-result__facts strong { color: white; }
.scan-live-result__saved { display: flex; align-items: center; gap: 5px; padding: 9px 10px; border-left: 1px solid rgba(255,255,255,.12); color: #c2c9d0; font-size: 7px; font-weight: 750; writing-mode: vertical-rl; transform: rotate(180deg); }
.scan-history-outcome { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 5px 7px; border-radius: 6px; font-size: 7px; font-weight: 900; letter-spacing: .06em; }
.scan-history-outcome--valid { color: var(--success); background: var(--success-soft); }
.scan-history-outcome--invalid { color: var(--danger); background: var(--danger-soft); }
.scan-history-outcome--verify { color: var(--warning); background: var(--warning-soft); }
.scan-history-table td { vertical-align: top; }
@keyframes scanResultIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes scanPulse { 50% { opacity: .38; transform: scale(.88); } }
@keyframes scanSweep { from { top: 8%; opacity: .6; } to { top: 90%; opacity: 1; } }
.scan-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.scan-file-button { position: relative; max-width: 100%; overflow: hidden; }
.scan-file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.scan-settings { margin-top: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.scan-settings summary { color: var(--ink-3); font-size: 10px; font-weight: 750; cursor: pointer; }
.scan-status { display: inline-flex; align-items: center; gap: 7px; max-width: 250px; padding: 6px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-3); font-size: 8px; font-weight: 750; line-height: 1.25; }
.scan-status > span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.scan-status--success { color: var(--success); background: var(--success-soft); }
.scan-status--danger { color: var(--danger); background: var(--danger-soft); }
.scan-status--info { color: var(--info); background: var(--info-soft); }
.scan-progress { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.scan-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--info); transition: width .18s ease; }
.scan-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.scan-stat { min-height: 72px; display: grid; align-content: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.scan-stat span { color: var(--muted); font-size: 8px; font-weight: 700; }
.scan-stat strong { margin-top: 4px; font-size: 21px; letter-spacing: -.035em; }
.scan-stat--success { border-color: #cce9db; background: var(--success-soft); }
.scan-stat--success strong { color: var(--success); }
.scan-stat--danger { border-color: #f2c8cb; background: var(--danger-soft); }
.scan-stat--danger strong { color: var(--danger); }
.scan-stat--warning { border-color: #ecd9ad; background: var(--warning-soft); }
.scan-stat--warning strong { color: var(--warning); }
.scan-tips { display: grid; gap: 9px; }
.scan-tips > div { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-3); font-size: 9px; line-height: 1.45; }
.scan-tips svg { margin-top: 1px; color: var(--success); }
.scan-detection-list { display: grid; gap: 11px; }
.scan-detection { overflow: hidden; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: white; }
.scan-detection--authorized { border-left-color: var(--success); }
.scan-detection--temporary { border-left-color: var(--purple); }
.scan-detection--flagged { border-left-color: var(--danger); }
.scan-detection--review { border-left-color: var(--warning); }
.scan-detection.is-dismissed { opacity: .55; }
.scan-detection__status { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-bottom: 1px solid var(--line); color: var(--ink-3); background: #fafbfb; font-size: 9px; font-weight: 800; }
.scan-detection--authorized .scan-detection__status { color: var(--success); background: var(--success-soft); }
.scan-detection--temporary .scan-detection__status { color: var(--purple); background: var(--purple-soft); }
.scan-detection--flagged .scan-detection__status { color: var(--danger); background: var(--danger-soft); }
.scan-detection--review .scan-detection__status { color: var(--warning); background: var(--warning-soft); }
.scan-detection__main { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; }
.scan-detection__plate { display: flex; align-items: center; gap: 8px; }
.scan-detection__plate .plate { font-size: 13px; }
.scan-verified { padding: 4px 6px; border-radius: 5px; color: var(--success); background: var(--success-soft); font-size: 7px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.scan-detection__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: var(--muted); font-size: 8px; }
.scan-detection__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.scan-match { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.scan-match > div { min-width: 0; padding: 11px 13px; background: white; }
.scan-match span { display: block; color: var(--muted); font-size: 7px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.scan-match strong { display: block; overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.scan-suggestion { display: flex; align-items: center; gap: 7px; margin: 0 13px 13px; padding: 10px 11px; border-radius: 8px; color: var(--warning); background: var(--warning-soft); font-size: 9px; line-height: 1.45; }
.scan-suggestion--danger { color: var(--danger); background: var(--danger-soft); }
.modal--medium { width: min(670px, 100%); }

@media (max-width: 1100px) {
  .lot-scan-layout { grid-template-columns: minmax(0, 1fr); }
  .lot-scan-layout > .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .scan-control-grid { grid-template-columns: 1fr; }
  .scan-camera-stage { min-height: 235px; aspect-ratio: 4 / 3; }
  .scan-detection__main { align-items: flex-start; }
  .scan-match { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-scan-layout > .stack { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .scan-mode-tabs, .scan-stat-grid { grid-template-columns: 1fr 1fr; }
  .scan-camera-stage { min-height: 210px; }
  .scan-actions > .btn, .scan-actions > .scan-file-button { width: 100%; justify-content: center; }
  .scan-detection__main { display: grid; }
  .scan-detection__actions { justify-content: flex-start; }
  .scan-match { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  #lot-scan-live-result-host { left: 8px; right: 8px; bottom: 8px; }
  .scan-live-result-stack .scan-live-result:nth-child(n+2) { display: none; }
  .scan-live-result { grid-template-columns: 82px minmax(0,1fr); border-radius: 11px; }
  .scan-live-result__outcome { min-width: 0; padding: 10px 8px; }
  .scan-live-result__outcome strong { font-size: 11px; }
  .scan-live-result__body { grid-template-columns: minmax(86px,.75fr) minmax(0,1.25fr); gap: 8px; padding: 8px 9px; }
  .scan-live-result__plate strong { font-size: 17px; }
  .scan-live-result__reason span { max-height: 2.8em; overflow: hidden; }
  .scan-live-result__facts { gap: 3px 7px; }
  .scan-live-result__saved { display: none; }
}

/* Demo live-camera OCR and editable valid-plate roster */
#lot-scan-ocr-status-host { position: absolute; top: 12px; right: 12px; z-index: 6; width: min(330px, calc(100% - 150px)); pointer-events: none; }
.demo-ocr-status { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: white; background: rgba(11,14,17,.82); box-shadow: 0 8px 24px rgba(0,0,0,.25); backdrop-filter: blur(7px); }
.demo-ocr-status__dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: #9da6ae; box-shadow: 0 0 0 4px rgba(157,166,174,.14); }
.demo-ocr-status--loading .demo-ocr-status__dot, .demo-ocr-status--reading .demo-ocr-status__dot { background: #ffc857; box-shadow: 0 0 0 4px rgba(255,200,87,.18); animation: scanPulse 1s infinite; }
.demo-ocr-status--ready .demo-ocr-status__dot, .demo-ocr-status--read .demo-ocr-status__dot { background: #58d69a; box-shadow: 0 0 0 4px rgba(88,214,154,.16); }
.demo-ocr-status--error .demo-ocr-status__dot { background: #ff646d; box-shadow: 0 0 0 4px rgba(255,100,109,.16); }
.demo-ocr-status > div { min-width: 0; display: grid; gap: 2px; }
.demo-ocr-status strong { font-size: 9px; line-height: 1.25; }
.demo-ocr-status small { display: block; overflow: hidden; color: #c8d0d7; font-size: 7px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.demo-valid-card .card__head { align-items: flex-start; }
.demo-valid-list { display: grid; gap: 7px; max-height: 292px; overflow: auto; padding-right: 2px; }
.demo-valid-plate { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.demo-valid-plate--featured { border-color: #bfe4d2; background: var(--success-soft); box-shadow: inset 3px 0 0 var(--success); }
.demo-valid-plate > div { min-width: 0; display: grid; gap: 3px; }
.demo-valid-plate .plate { font-size: 12px; }
.demo-valid-plate small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.demo-valid-plate__remove { flex: 0 0 auto; }
.demo-valid-add { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.demo-valid-add__row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.demo-valid-add input { text-transform: uppercase; }

@media (max-width: 720px) {
  #lot-scan-ocr-status-host { left: 8px; right: 8px; top: 44px; width: auto; }
  .demo-ocr-status small { max-width: 78vw; }
  .demo-valid-add__row { grid-template-columns: 1fr; }
  .demo-valid-add__row .btn { width: 100%; justify-content: center; }
}

/* Automatic physical-plate demo guidance */
.demo-auto-scan-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid #c8d9ee;
  border-radius: 11px;
  color: var(--info);
  background: var(--info-soft);
}
.demo-auto-scan-note > svg { margin-top: 1px; }
.demo-auto-scan-note > div { display: grid; gap: 3px; }
.demo-auto-scan-note strong { font-size: 10px; }
.demo-auto-scan-note span { color: var(--ink-3); font-size: 9px; line-height: 1.5; }
.demo-valid-plate--featured::after {
  content: "PINNED";
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--success);
  background: rgba(255,255,255,.78);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .08em;
}

@media (max-width: 520px) {
  .demo-auto-scan-note { padding: 10px 11px; }
}
