:root {
  --bg: #050507;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(14, 14, 18, 0.82);
  --panel-solid: #101014;
  --ok: #34d399;
  --ok-deep: #059669;
  --warn: #fbbf24;
  --warn-deep: #d97706;
  --danger: #f87171;
  --violet: #c4b5fd;
  --glow: rgba(167, 139, 250, 0.18);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: Vazirmatn, Tahoma, sans-serif;
}
body {
  position: relative;
  isolation: isolate;
}
body::before,
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(80px);
}
body::before {
  width: 520px; height: 520px;
  top: -160px; right: -80px;
  background: radial-gradient(circle, rgba(167,139,250,0.22), transparent 68%);
}
body::after {
  width: 460px; height: 460px;
  bottom: -120px; left: -80px;
  background: radial-gradient(circle, rgba(52,211,153,0.12), transparent 70%);
}
.ai-ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(255,255,255,0.05), transparent 55%),
    linear-gradient(180deg, #07070a 0%, #050507 40%, #050507 100%);
}
.ai-ambient i {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}
.ai-ambient i:nth-child(1) {
  width: 280px; height: 280px; top: 20%; left: 18%;
  background: rgba(196,181,253,0.14);
}
.ai-ambient i:nth-child(2) {
  width: 220px; height: 220px; top: 55%; right: 12%;
  background: rgba(52,211,153,0.1);
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.55);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: 28px;
  padding: 8px 0;
  animation: ticker 36s linear infinite;
}
.ticker-track span::before {
  content: "•";
  margin-left: 28px;
  color: #52525b;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 12px 20px;
  background: rgba(5, 5, 7, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.logo, .login-logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: #050505; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 28px rgba(255,255,255,0.12);
}
.logo-text { display: grid; line-height: 1.1; }
.logo-text b { font-size: 16px; }
.logo-text small { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }

.desk-nav { display: none; }
.desk-nav a, .pill {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.desk-nav a { color: #a1a1aa; }
.desk-nav a.on, .desk-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.pill.ghost, .icon-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--fg);
}
.pill.solid {
  background: #fff; color: #050505; border: 0; font-weight: 700;
  box-shadow: 0 8px 24px rgba(255,255,255,0.08);
}
.pill.solid:hover { transform: translateY(-1px); }
.icon-btn, .nav-ico, .burger {
  width: 42px; height: 42px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; padding: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--fg);
  flex: 0 0 42px;
}
.nav-ico svg { width: 18px; height: 18px; }
.burger { gap: 5px; }
.burger span {
  display: block;
  width: 16px; height: 1.5px;
  background: #f4f4f5;
  border-radius: 99px;
  transition: transform 0.22s, opacity 0.22s;
}
.burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(-45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(45deg); }

.page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 12px 0 120px; }
.page-head { margin: 18px 0 22px; }
.page-head h1 {
  margin: 6px 0 0;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.eyebrow, .kicker {
  color: var(--violet);
  font-size: 11px;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}
.eyebrow-pill {
  display: inline-flex; border-radius: 999px;
  border: 1px solid rgba(196,181,253,0.25);
  background: rgba(196,181,253,0.08);
  padding: 6px 12px; font-size: 12px; color: #ddd6fe; margin: 0 0 16px;
}

.hero { padding: 32px 0 12px; }
.hero h1 {
  font-size: clamp(30px, 6vw, 56px);
  line-height: 1.22;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff 20%, #d4d4d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { color: #d4d4d8; font-size: 15px; line-height: 1.95; max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-cta .pill { min-height: 44px; padding: 10px 18px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 28px 0; }
.stats article, .card, .tiles a {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22,22,26,0.92) 0%, rgba(10,10,12,0.92) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.stats article::before, .card::before, .tiles a::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  pointer-events: none;
}
.stats b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.stats span, .tiles a span { color: var(--muted); font-size: 13px; }
.spaces h2 { margin: 8px 0 16px; font-size: 24px; letter-spacing: -0.03em; }
.tiles { display: grid; gap: 12px; }
.tiles a {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  min-height: 96px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tiles a .tile-ico { grid-row: 1 / span 2; }
.tiles a strong,
.tiles a span:not(.tile-ico) { grid-column: 2; }
.tiles a:hover {
  transform: translateY(-2px);
  border-color: rgba(196,181,253,0.28);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28), 0 0 0 1px rgba(196,181,253,0.08);
}
.tiles a .tile-ico,
.tiles a::after {
  grid-row: 1 / span 2;
}
.tile-ico {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e4e4e7;
  font-weight: 800;
  font-size: 14px;
}
.tiles a strong { display: block; margin-bottom: 4px; font-size: 17px; }
.card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: -0.02em; }
.card-head h2 { margin: 0; }

.grid-form { display: grid; gap: 12px; }
.grid-form .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(5,5,7,0.7);
  color: var(--fg);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus {
  border-color: rgba(196,181,253,0.45);
  box-shadow: 0 0 0 4px rgba(167,139,250,0.12);
}
button { cursor: pointer; }
button:not(.icon-btn):not(.pill):not(#more-btn):not(.ai-btn):not(.nav-ico):not(.burger):not(.pick-item):not(.mode-card):not(.ghost) {
  border: 0; border-radius: 999px; background: #fff; color: #050505;
  font-weight: 700; padding: 11px 16px;
  box-shadow: 0 8px 20px rgba(255,255,255,0.06);
}
button.ghost {
  background: transparent; color: #f4f4f5;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
}
button.danger, a.danger {
  background: transparent; color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
  box-shadow: none;
  cursor: pointer;
}
button.ok { background: linear-gradient(180deg, #34d399, #059669); color: #052e1f; }
button.warn { background: linear-gradient(180deg, #fbbf24, #d97706); color: #2a1703; }
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
th { color: #71717a; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }
.ltr { direction: ltr; text-align: left; unicode-bidi: isolate; }
.split { display: grid; gap: 12px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
video {
  width: 100%;
  border-radius: 22px;
  background: #000;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.kiosk { display: grid; gap: 14px; }
.kiosk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kiosk-actions button { min-height: 54px; font-size: 16px; }
.kiosk-msg, #enroll-msg, #face-msg, #plate-msg {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.site-footer {
  display: none;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer strong { color: var(--fg); display: block; margin-bottom: 8px; }
.site-footer span { display: block; margin-bottom: 8px; color: #fff; }
.site-footer a { display: block; margin: 6px 0; }

.dock {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: rgba(5,5,7,0.88);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.dock a, .dock button {
  background: none; border: 0; color: var(--muted);
  display: grid; justify-items: center; gap: 4px;
  font-size: 11px; padding: 6px 2px;
}
.dock a.on, .dock button.on { color: #fff; }
.dock-center {
  width: 56px; height: 56px; margin: -22px auto 0;
  border-radius: 50%; background: #fff; color: #050505 !important;
  display: grid !important; place-items: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4), 0 0 24px rgba(255,255,255,0.12);
  font-size: 18px; font-weight: 800;
}
.dock-center span { font-size: 18px; }

.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  display: grid; align-items: end;
}
.sheet-card {
  background: linear-gradient(180deg, #161618, #0b0b0c);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  display: grid; gap: 4px;
}
.sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-card a {
  padding: 14px 12px; border-radius: 14px; color: var(--fg);
}
.sheet-card a:hover { background: rgba(255,255,255,0.06); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  position: relative;
  overflow: hidden;
  width: min(420px, 100%);
  background: linear-gradient(180deg, #161618 0%, #0b0b0c 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 28px;
  padding: 32px 24px 24px;
  display: grid; gap: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 160px;
  background: radial-gradient(circle, rgba(196,181,253,0.16), transparent 68%);
  pointer-events: none;
}
.login-card h1 { margin: 8px 0 0; font-size: 24px; letter-spacing: -0.03em; }
.err { color: var(--danger); }
.muted { color: var(--muted); font-size: 13px; }

.ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.ai-overlay[hidden] { display: none !important; }
.ai-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(255,255,255,0.08), transparent 55%),
    rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.ai-card {
  position: relative;
  width: min(420px, 100%);
  overflow: hidden;
  border-radius: 28px;
  padding: 32px 26px 22px;
  background: linear-gradient(180deg, #161618 0%, #0b0b0c 100%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.08);
  text-align: center;
  animation: ai-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-shine {
  pointer-events: none;
  position: absolute;
  inset: -40% -20% auto;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 68%);
}
.ai-card[data-kind="success"] .ai-shine { background: radial-gradient(circle, rgba(52,211,153,0.22), transparent 68%); }
.ai-card[data-kind="error"] .ai-shine { background: radial-gradient(circle, rgba(248,113,113,0.2), transparent 68%); }
.ai-card[data-kind="warn"] .ai-shine { background: radial-gradient(circle, rgba(251,191,36,0.2), transparent 68%); }
.ai-card[data-kind="info"] .ai-shine,
.ai-card[data-kind="confirm"] .ai-shine { background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 68%); }
.ai-card[data-kind="loading"] .ai-shine { background: radial-gradient(circle, rgba(167,139,250,0.22), transparent 68%); }
.ai-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 32px rgba(255,255,255,0.06);
}
.ai-icon svg { width: 28px; height: 28px; }
.ai-card[data-kind="success"] .ai-icon { color: #34d399; box-shadow: 0 0 36px rgba(52,211,153,0.18); }
.ai-card[data-kind="error"] .ai-icon { color: #f87171; box-shadow: 0 0 36px rgba(248,113,113,0.16); }
.ai-card[data-kind="warn"] .ai-icon { color: #fbbf24; box-shadow: 0 0 36px rgba(251,191,36,0.16); }
.ai-card[data-kind="info"] .ai-icon,
.ai-card[data-kind="confirm"] .ai-icon { color: #f4f4f5; }
.ai-card[data-kind="loading"] .ai-icon { color: #c4b5fd; }
.ai-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #71717a;
}
.ai-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ai-card #ai-text {
  margin: 0 0 22px;
  color: #a1a1aa;
  font-size: 14px;
  line-height: 1.9;
}
.ai-actions { display: flex; gap: 10px; }
.ai-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}
.ai-btn.solid { border: 0; background: #fff; color: #050505; }
.ai-btn.ghost { border: 1px solid rgba(255,255,255,0.14); background: transparent; color: #f4f4f5; }
.ai-btn:hover { transform: translateY(-1px); }
.ai-overlay.is-loading .ai-btn.ghost,
.ai-overlay.is-loading [data-ai-dismiss] { display: none; }
.ai-overlay.is-loading .ai-actions { justify-content: center; }
.ai-overlay.is-loading .ai-btn.solid { display: none; }
.ai-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(196,181,253,0.25);
  border-top-color: #c4b5fd;
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.ai-drawer[hidden] { display: none !important; }
.ai-drawer-back {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.ai-drawer-panel {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: min(86vw, 360px);
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #141418 0%, #0a0a0c 100%);
  border-left: 1px solid rgba(255,255,255,0.1);
  box-shadow: -24px 0 80px rgba(0,0,0,0.45);
  transform: translateX(110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-drawer.is-open .ai-drawer-panel { transform: translateX(0); }
.ai-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.ai-drawer-nav {
  display: grid;
  gap: 6px;
  overflow: auto;
  flex: 1;
}
.ai-drawer-nav a {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
}
.ai-drawer-nav a b { font-size: 15px; }
.ai-drawer-nav a span { color: var(--muted); font-size: 12px; }
.ai-drawer-nav a.on,
.ai-drawer-nav a:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(196,181,253,0.22);
}
.ai-drawer-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.ai-drawer-foot a {
  min-height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  font-weight: 600;
}
.ai-drawer-foot a.on { background: rgba(255,255,255,0.08); }
body.menu-open { overflow: hidden; }

.emp-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.emp-card {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.emp-card[hidden] { display: none !important; }
.emp-card strong { display: block; margin-bottom: 4px; }
.emp-card .muted { display: block; font-size: 12px; }
.emp-photo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(255,255,255,0.08);
}
.emp-photo--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  background: rgba(255,255,255,0.04);
}

.pick-list { display: grid; gap: 8px; margin-top: 14px; }
.pick-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: right;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: inherit;
}
.pick-item[hidden] { display: none !important; }
.pick-item img, .pick-empty {
  width: 52px; height: 52px; border-radius: 14px;
}
.pick-item img { object-fit: cover; background: #111; }
.pick-empty {
  display: grid; place-items: center;
  background: rgba(196,181,253,0.12);
  color: var(--violet);
  font-weight: 800;
}
.pick-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pick-item:hover { border-color: rgba(196,181,253,0.35); background: rgba(255,255,255,0.05); }

.vision-page .page-head { margin-bottom: 10px; }
.vision-stage { display: grid; gap: 14px; }
.vision-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.vision-top strong { font-size: 28px; letter-spacing: 0.04em; }
.vision-cam {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  min-height: 280px;
}
.vision-cam video {
  display: block;
  width: 100%;
  max-height: none;
  height: min(62vh, 560px);
  object-fit: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: scaleX(-1);
}
.kiosk-frame { pointer-events: none; position: absolute; inset: 18px; }
.kiosk-frame__corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 3px solid rgba(196,181,253,0.85);
}
.kiosk-frame__corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.kiosk-frame__corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.kiosk-frame__corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.kiosk-frame__corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.kiosk-frame__scan {
  position: absolute;
  left: 8%; right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c4b5fd, transparent);
  box-shadow: 0 0 18px rgba(196,181,253,0.8);
  animation: kiosk-scan 2.4s ease-in-out infinite;
}
@keyframes kiosk-scan {
  0% { top: 8%; opacity: 0.2; }
  50% { opacity: 1; }
  100% { top: 88%; opacity: 0.2; }
}
.enroll-oval {
  pointer-events: none;
  position: absolute;
  left: 50%; top: 46%;
  width: min(58%, 240px);
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255,255,255,0.55);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0,0,0,0.28);
}
.enroll-eyes {
  pointer-events: none;
  position: absolute;
  left: 50%; top: 40%;
  width: min(36%, 140px);
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: space-between;
}
.enroll-eyes i {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
}
.dir-arrow {
  pointer-events: none;
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  min-width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5,5,8,0.55);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 22px;
  color: #fff;
}
.pose-badge {
  position: absolute;
  bottom: 14px; right: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(5,5,8,0.7);
  border: 1px solid rgba(196,181,253,0.3);
  font-size: 13px;
  font-weight: 700;
}
.vision-hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}
.vision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vision-actions button,
.vision-actions a {
  flex: 1;
  min-width: 120px;
  min-height: 46px;
  display: grid;
  place-items: center;
}
.enroll-thumbs {
  display: flex;
  gap: 8px;
  overflow: auto;
}
.enroll-thumbs img {
  width: 64px; height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  transform: scaleX(-1);
}
.kiosk-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: rgba(5,5,8,0.72);
  backdrop-filter: blur(16px);
  padding: 24px;
}
.kiosk-result img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  border: 3px solid rgba(255,255,255,0.2);
}
.kiosk-result h2 { margin: 0; font-size: 28px; }
.kiosk-result p { margin: 0; color: var(--muted); }
.kiosk-result-badge {
  justify-self: center;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.kiosk-result-badge.is-in { background: rgba(52,211,153,0.18); color: #34d399; }
.kiosk-result-badge.is-out { background: rgba(251,191,36,0.16); color: #fbbf24; }

.detect-modes { display: grid; gap: 12px; }
.mode-card {
  display: grid;
  gap: 6px;
  text-align: right;
  padding: 22px 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: inherit;
}
.mode-card b { font-size: 20px; }
.mode-card span { color: var(--muted); font-size: 13px; }
.mode-card:hover { border-color: rgba(196,181,253,0.35); }
.detect-overlay { pointer-events: none; position: absolute; inset: 0; }
.face-box {
  position: absolute;
  border: 2px solid rgba(248,113,113,0.85);
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(248,113,113,0.25);
}
.face-box.is-on {
  border-color: #34d399;
  box-shadow: 0 0 18px rgba(52,211,153,0.28);
}
.att-filters { display: grid; gap: 10px; margin: 12px 0 16px; }
.att-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.att-table { min-width: 960px; }
.att-st {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.att-st--present { background: rgba(52,211,153,0.16); color: #34d399; }
.att-st--leave { background: rgba(196,181,253,0.16); color: #c4b5fd; }
.att-st--mission { background: rgba(96,165,250,0.16); color: #93c5fd; }
.att-st--absent { background: rgba(248,113,113,0.14); color: #f87171; }
.att-st--mixed { background: rgba(251,191,36,0.14); color: #fbbf24; }
.att-st--holiday { background: rgba(255,255,255,0.08); color: #a1a1aa; }
.att-dialog {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 22px;
  background: #101014;
  color: inherit;
  width: min(560px, 94vw);
}
.att-dialog::backdrop { background: rgba(0,0,0,0.65); }
.att-form h2 { margin: 0 0 14px; }
.att-wide { grid-column: 1 / -1; }
.traffic-page .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.tr-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.tr-tab {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.tr-tab.on {
  color: #fff;
  background: rgba(196,181,253,0.16);
  border-color: rgba(196,181,253,0.35);
}
.tr-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tr-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.tr-pill.is-ok { color: var(--ok); border-color: rgba(52,211,153,0.35); }
.tr-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.tr-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.traffic-page .stats { margin: 10px 0 4px; }
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.live-card {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #0a0a0c;
}
.live-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #111;
  overflow: hidden;
}
.live-frame img,
.live-card .live-video,
.live-frame video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  background: #111;
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.live-card img.is-off { opacity: 0.25; }
.live-tag {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5,5,8,0.78);
  color: #e4e4e7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-tag.is-on { color: #34d399; }
.live-ph,
.live-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  border: 0;
  background: #111;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  line-height: 1.8;
}
.live-start {
  cursor: pointer;
  color: #e4e4e7;
  background: linear-gradient(180deg, #1a1a20, #111);
}
.live-start:hover { color: #fff; }
.live-card > strong,
.live-card > .muted {
  display: block;
  padding: 10px 12px 0;
}
.live-card > .muted { padding-bottom: 12px; }
.tr-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 8px; }
.scan-results { display: grid; gap: 8px; margin-top: 12px; }
textarea {
  width: 100%;
  min-height: 84px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: inherit;
  padding: 10px 12px;
  resize: vertical;
}

.kiosk-choice {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background: rgba(5,5,8,0.78);
  backdrop-filter: blur(16px);
  padding: 24px;
}
.kiosk-choice h2 { margin: 0; font-size: 22px; }
.kiosk-choice .vision-actions { justify-content: center; }

.face-box.is-on::after {
  content: attr(data-name);
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5,5,8,0.8);
  color: #34d399;
  font-size: 11px;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .emp-grid { grid-template-columns: 1fr 1fr; }
  .detect-modes { grid-template-columns: 1fr 1fr; }
  .vision-cam video { height: min(68vh, 640px); }
}

@media (min-width: 960px) {
  .desk-nav { display: flex; align-items: center; gap: 2px; }
  .header-actions { display: flex; }
  .burger, #nav-back, .ai-drawer { display: none !important; }
  .dock, .sheet { display: none !important; }
  .site-footer { display: grid; }
  .page { padding-bottom: 40px; }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr 1fr; }
  .hero { padding: 56px 0 24px; }
  .site-header { justify-content: space-between; }
}
@media (max-width: 959px) {
  .ticker { display: none; }
  .desk-nav, .header-actions, .site-footer, .dock, .sheet { display: none !important; }
  .site-header {
    min-height: 60px;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    justify-content: stretch;
  }
  .site-header .logo { justify-content: center; }
  #nav-back[hidden] {
    visibility: hidden;
    display: grid !important;
    pointer-events: none;
  }
  .logo-text small { display: none; }
  .page {
    width: min(100% - 20px, 1120px);
    padding: 10px 0 calc(28px + env(safe-area-inset-bottom));
  }
  .page-head { margin: 8px 0 16px; }
  .page-head h1 { font-size: 24px; }
  .hero { padding: 16px 0 8px; }
  .hero h1 { font-size: 28px; }
  .lead { font-size: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
  .stats article, .card, .tiles a { border-radius: 20px; padding: 14px; }
  .stats b { font-size: 24px; }
  .tiles a { min-height: 84px; }
  .spaces h2 { font-size: 20px; }
  .grid-form, .split { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .pill { width: 100%; }
  input, select { font-size: 16px; }
  video { max-height: 240px; }
  .kiosk-actions button { min-height: 50px; }
  .table-wrap { margin-inline: -2px; }
  table { min-width: 520px; }
  .login-body { padding: 20px 16px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .login-card { width: 100%; padding: 26px 18px 20px; }
}
