/* Visual design for the admin console. The HTML files do not carry styles. */

:root {
  color-scheme: light;
  --surface: #f9f9ff;
  --on-surface: #141b2b;
  --surface-lowest: #ffffff;
  --surface-low: #f1f3ff;
  --surface-container: #e9edff;
  --surface-high: #e1e8fd;
  --surface-highest: #dce2f7;
  --on-surface-variant: #4a4455;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --primary-container: #6c2bd9;
  --on-primary-container: #dac7ff;
  --on-primary: #ffffff;
  --purple-400: #6c2bd9;
  --purple-500: #5b21b6;
  --secondary: #0051d5;
  --lavender: #f4edff;
  --success: #0f9d58;
  --success-surface: #e7f7ee;
  --warning: #b86a1f;
  --warning-surface: #fff1e6;
  --danger: #dc2626;
  --danger-surface: #fdecec;
  --error-container: #ffdad6;
  --outline-variant: #ccc3d7;
  --sheen: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
  --shadow-bar: 0 1px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-table: 0 4px 12px rgba(15, 23, 42, 0.06);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, Consolas, monospace;
  --sidebar: 72px;
  --topbar: 64px;
  --radius: 0.75rem;
}

html.dark {
  color-scheme: dark;
  --surface: #10141f;
  --on-surface: #edf0ff;
  --surface-lowest: #1a2030;
  --surface-low: #222838;
  --surface-container: #2a3144;
  --surface-high: #343c52;
  --surface-highest: #3e4760;
  --on-surface-variant: #c8c0d4;
  --slate-500: #94a3b8;
  --slate-400: #7c8aa0;
  --lavender: #2c2444;
  --success-surface: #143226;
  --warning-surface: #3a2c1d;
  --warning: #e6af71;
  --danger-surface: #3a1d1d;
  --error-container: #5c2420;
  --outline-variant: #3d455c;
  --sheen: linear-gradient(to bottom, rgba(255, 255, 255, 0.06), transparent);
  --shadow-bar: 0 1px 8px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-table: 0 4px 16px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1;
  overscroll-behavior: none;
}

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

.icon {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
}

.icon-xs { font-size: 14px; }
.icon-sm { font-size: 18px; }
.icon-md { font-size: 20px; }
.icon-lg { font-size: 24px; }
.icon-xl { font-size: 32px; }

.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--sidebar);
  padding: 24px 0;
  background: color-mix(in srgb, var(--surface-lowest) 94%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-bar);
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.sidebar-nav, .sidebar-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.sidebar-nav { flex: 1; }
.sidebar-foot {
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--outline-variant);
}
.nav-link.is-spinning .icon { animation: spin 0.7s linear infinite; }

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-link:hover {
  background: var(--surface-high);
  color: var(--on-surface);
}

.nav-link.is-active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  box-shadow: 0 4px 12px rgba(108, 43, 217, 0.25);
}

.workspace { padding-left: var(--sidebar); }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar);
  padding: 0 28px;
  background: color-mix(in srgb, var(--surface-lowest) 94%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-bar);
}

.brand-lockup, .topbar-actions, .session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-lockup { gap: 8px; }

.brand-copy, .session-copy { display: flex; flex-direction: column; }
.session-copy { text-align: right; }

.brand-title, .session-name {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.session-name { font-size: 13px; line-height: 18px; }

.brand-subtitle, .session-status {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-subtitle { color: var(--slate-500); }
.session-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  color: var(--success);
}

.live-dot, .sync-dot, .ping, .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.live-dot, .sync-dot { background: var(--success); }
.live-dot { animation: pulse 1.6s ease-in-out infinite; }

.header-btn, .avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.header-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-low) 70%, transparent);
  color: var(--on-surface-variant);
  transition: background 0.15s, color 0.15s;
}

.header-btn:hover { background: var(--surface-high); color: var(--on-surface); }

.alert-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--purple-400);
  box-shadow: 0 0 0 2px var(--surface-lowest);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 0.25rem;
  background: color-mix(in srgb, var(--outline-variant) 30%, transparent);
}

.avatar-btn {
  padding: 2px;
  border-radius: 999px;
}

.avatar-btn:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple-400) 40%, transparent); }

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-400);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  flex: none;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-contractors { background: var(--warning-surface); color: var(--warning); }
.avatar-visitors { background: var(--lavender); color: var(--purple-400); }
.avatar-employees { background: var(--surface-high); color: var(--secondary); }

.page-slot {
  min-height: 100vh;
  padding-top: var(--topbar);
  background: var(--surface);
}

.page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-intro { display: flex; flex-direction: column; gap: 0.125rem; }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  color: var(--purple-400);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-title, .empty-card h2, .modal-title h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: 28px;
  line-height: 34px;
}

.lede, .empty-card p, .scan-note {
  margin: 0;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 20px;
}

.lede { max-width: 40rem; }

.page-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn-surface, .btn-primary, .btn-in, .btn-validate, .btn-quiet, .btn-intervene, .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-surface, .btn-primary {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.btn-primary { padding-inline: 1.5rem; }

.btn-surface {
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.btn-surface:hover { background: var(--surface-low); box-shadow: var(--shadow-card-hover); }
.btn-surface .icon { transition: transform 0.15s; }
.btn-surface:hover .icon { transform: scale(1.1); }
.is-success { color: var(--success); }
.is-secondary { color: var(--secondary); }
.is-danger { color: var(--danger); }

.btn-primary {
  background: linear-gradient(to bottom, #8758ff, #7c4dff, #6c2bd9);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(108, 43, 217, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 43, 217, 0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-in {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(to bottom, #34c77b, #14a85c, #0f9d58);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 157, 88, 0.28);
}

.btn-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 157, 88, 0.35);
}

.btn-in:active { transform: translateY(0); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 70%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: var(--sheen);
  pointer-events: none;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.stat-card.is-selected { box-shadow: 0 0 0 2px var(--purple-400), var(--shadow-card); }
.stat-card.is-danger { background: var(--danger-surface); }
.stat-card.is-danger::before { background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent); }

.stat-top, .stat-foot, .stat-figure, .person, .gate, .assets, .actions, .toolbar, .toolbar-main, .toolbar-tools, .table-footer, .pager {
  display: flex;
  align-items: center;
}

.stat-top, .stat-foot { justify-content: space-between; gap: 0.75rem; }
.stat-figure { align-items: baseline; gap: 0.25rem; margin-top: 0.25rem; }

.stat-label, .stat-unit, .stat-foot, .sync-note, .stack-meta, .person-meta, .logged-out {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-label {
  color: var(--slate-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-card.is-danger .stat-label,
.stat-card.is-danger .stat-value,
.stat-card.is-danger .stat-unit,
.stat-card.is-danger .stat-foot { color: var(--danger); }

.stat-card.is-danger .stat-unit { opacity: 0.7; }

.stat-value {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-unit { color: var(--slate-400); text-transform: uppercase; }

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  flex: none;
  transition: background 0.15s, color 0.15s;
}

.stat-icon.is-total { background: var(--lavender); color: var(--purple-400); }
.stat-card:hover .stat-icon.is-total { background: var(--primary-container); color: var(--on-primary-container); }
.stat-icon.is-employees { background: var(--surface-high); color: var(--secondary); }
.stat-card:hover .stat-icon.is-employees { background: var(--secondary); color: #fff; }
.stat-icon.is-visitors { background: var(--surface-high); color: var(--warning); }
.stat-card:hover .stat-icon.is-visitors { background: var(--warning); color: #fff; }
.stat-icon.is-overdue { background: var(--error-container); color: var(--danger); }
.stat-card:hover .stat-icon.is-overdue { background: var(--danger); color: #fff; }

.stat-foot { margin-top: 0.5rem; color: var(--slate-400); font-weight: 500; }
.stat-foot .is-success, .trend.is-up { color: var(--success); font-weight: 600; }
.trend { display: inline-flex; align-items: center; gap: 0.25rem; }
.stat-card.is-danger .trend { font-weight: 600; }

.ping {
  background: var(--danger);
  animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.review-link { text-decoration: underline; font-weight: 500; }

.toolbar {
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 60%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.toolbar-main { flex: 1; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.toolbar-tools { gap: 0.25rem; margin-left: auto; }

.search { position: relative; flex: 1; min-width: 16rem; max-width: 28rem; }

.search .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  color: var(--slate-400);
  transform: translateY(-50%);
}

.search input, .override input {
  width: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: var(--surface-low);
  color: var(--on-surface);
  font-size: 13px;
  line-height: 18px;
}

.search input { padding: 0.5rem 0.75rem 0.5rem 2.25rem; }
.search input::placeholder, .override input::placeholder { color: var(--slate-400); }
.search input:focus, .override input:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple-400) 25%, transparent);
}

.segmented {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: var(--surface-low);
}

.segment, .pager-page, .pager-arrow, .tool-btn, .icon-btn {
  border: 0;
  background: transparent;
}

.segment {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--slate-500);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.segment:hover, .pager-page:hover, .pager-arrow:hover { color: var(--on-surface); }
.segment.is-active {
  background: var(--surface-lowest);
  color: var(--on-surface);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.sync-note {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding-right: 0.5rem;
  color: var(--slate-500);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.tool-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--slate-500);
}

.tool-btn { padding: 0.5rem; background: var(--surface-low); }
.tool-btn:hover, .icon-btn:hover { background: var(--surface-high); color: var(--on-surface); }
.icon-btn { padding: 0.25rem; color: var(--slate-400); }
.icon-btn:hover { color: var(--purple-400); }
.icon-btn.is-danger { color: var(--danger); }
.icon-btn.is-danger:hover { background: var(--error-container); color: var(--danger); }

.table-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-table);
}

.table-scroll {
  max-height: calc(100vh - 18rem);
  overflow: auto;
  scrollbar-width: thin;
}
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 999px;
}

.data-table { width: 100%; min-width: 960px; border-collapse: collapse; text-align: left; }

.stat-card[data-filter-column],
.stat-card[data-dataset] { cursor: pointer; text-align: left; }

button.stat-card { color: inherit; font: inherit; }

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.5rem 0.55rem;
  background: var(--surface-low);
  color: var(--slate-500);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.data-table th .icon { vertical-align: -2px; color: var(--slate-400); }
.data-table th.is-right, .actions { text-align: right; }

.data-table td {
  padding: 0.75rem 0.55rem;
  border-top: 1px solid var(--surface-container);
  font-size: 13px;
  line-height: 18px;
  vertical-align: middle;
}

.data-table tbody tr:hover { background: color-mix(in srgb, var(--lavender) 40%, transparent); }
.data-table td.table-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--slate-500);
}
.data-table tbody tr[data-empty]:hover { background: transparent; }
.data-table tr[hidden] { display: none; }

.mono { font-family: var(--mono); font-size: 12px; line-height: 16px; }
.mono-strong { color: var(--purple-400); font-weight: 600; }
.mono.is-muted, .stack-meta, .person-meta { color: var(--slate-500); font-weight: 500; }
.mono.is-faint { color: var(--slate-400); }
.mono.is-danger, .mono-strong.is-danger, .person-meta.is-danger, .gate.is-danger { color: var(--danger); font-weight: 600; }

.person, .gate, .assets, .actions { gap: 0.5rem; }
.person-copy, .stack { display: flex; flex-direction: column; }
.person-name, .stack-title { font-size: 13px; line-height: 18px; font-weight: 600; }
.stack-title { font-weight: 500; }
.person-meta, .stack-meta { letter-spacing: 0.02em; font-weight: 500; }
.gate { color: var(--slate-500); }
.gate.is-accent .icon, .asset.is-accent { color: var(--purple-400); }
.asset.is-danger { color: var(--danger); }
.actions { justify-content: flex-end; gap: 0.25rem; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-employees { background: var(--surface-high); color: var(--on-surface); font-weight: 500; }
.pill-employees .dot { background: var(--secondary); }
.pill-contractors { background: var(--warning-surface); color: var(--warning); font-weight: 500; }
.pill-visitors { background: var(--lavender); color: var(--purple-400); }
.pill-inside { background: var(--success-surface); color: var(--success); }
.pill-overdue, .pill-flagged { background: var(--danger-surface); color: var(--danger); }
.pill-exited { background: var(--surface-high); color: var(--slate-500); }
.pill-exited .dot { background: var(--slate-400); }

.btn-quiet, .btn-intervene {
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.btn-quiet { background: var(--surface-high); }
.btn-quiet:hover { background: var(--surface-highest); }
.btn-intervene { background: var(--error-container); color: var(--danger); }
.btn-intervene:hover { background: var(--danger-surface); }
.logged-out { padding: 0.25rem 0.5rem; color: var(--slate-400); letter-spacing: 0; font-weight: 500; }

.table-footer {
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, var(--surface-low) 40%, transparent);
  flex-wrap: wrap;
}

.table-footer p { margin: 0; color: var(--slate-500); font-size: 12px; line-height: 16px; }
.count { color: var(--on-surface); font-weight: 600; }

.pager { gap: 0.25rem; }
.pager-page, .pager-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 600;
}
.pager-arrow { width: auto; padding: 0.25rem; color: var(--slate-400); }
.pager-page:hover, .pager-arrow:hover:not(:disabled) { background: var(--surface-high); }
.pager-page.is-current { background: var(--primary-container); color: var(--on-primary-container); }
.pager-arrow:disabled { opacity: 0.45; }
.pager-gap { padding: 0 0.25rem; color: var(--slate-400); font-size: 12px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
}

.modal.is-open { display: flex; }

.modal-card {
  width: min(100%, 32rem);
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--surface-lowest);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.modal-head, .modal-title, .modal-foot, .override-row {
  display: flex;
  align-items: center;
}

.modal-head, .modal-foot { justify-content: space-between; }
.modal-title { gap: 0.25rem; color: var(--purple-400); }
.modal-title h2 { color: var(--on-surface); font-size: 18px; line-height: 24px; letter-spacing: -0.01em; font-weight: 600; }
.modal-foot { justify-content: flex-end; margin-top: 0.25rem; }

.scan-well {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.75rem 0;
  padding: 1.5rem;
  border: 2px dashed color-mix(in srgb, var(--purple-400) 30%, transparent);
  border-radius: var(--radius);
  background: var(--surface-low);
  text-align: center;
}

.scan-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-400);
  animation: pulse 1.6s ease-in-out infinite;
}

.scan-lead { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.override { display: flex; flex-direction: column; gap: 0.25rem; }
.override > span { color: var(--slate-500); font-size: 12px; line-height: 16px; font-weight: 500; }
.override-row { gap: 0.25rem; }
.override input { flex: 1; padding: 0.5rem 0.75rem; font-family: var(--mono); }

.btn-validate {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 13px;
  font-weight: 600;
}

.btn-validate:hover { background: var(--purple-500); }
.btn-text { padding: 0.5rem 0.75rem; border-radius: 0.5rem; color: var(--slate-500); font-size: 13px; font-weight: 600; }
.btn-text:hover { background: var(--surface-high); color: var(--on-surface); }

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 36rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  box-shadow: var(--shadow-card);
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--lavender);
  color: var(--purple-400);
}

.empty-card h2 { font-size: 18px; line-height: 24px; letter-spacing: -0.01em; }

.kicker-note { color: var(--slate-500); }
.lede.is-compact { max-width: none; font-size: 13px; line-height: 18px; color: var(--on-surface-variant); }

.screen-visitors .stat-card {
  padding: 1rem;
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
}
.screen-visitors .stat-foot { margin-top: 0.75rem; }
.stat-value.is-success { color: var(--success); }
.stat-value.is-warning { color: var(--warning); }
.stat-card.is-flag .stat-label,
.stat-card.is-flag .stat-value,
.stat-card.is-flag .trend { color: var(--danger); }
.stat-icon.is-today { background: var(--surface-high); color: var(--purple-400); }
.stat-card:hover .stat-icon.is-today { background: var(--purple-400); color: #fff; }
.stat-icon.is-in { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.stat-card:hover .stat-icon.is-in { background: var(--success); color: #fff; }
.stat-icon.is-pending { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.stat-card:hover .stat-icon.is-pending { background: var(--warning); color: #fff; }
.stat-icon.is-flagged { background: var(--danger-surface); color: var(--danger); }
.stat-card:hover .stat-icon.is-flagged { background: var(--danger); color: #fff; }
.dot.is-warning { background: var(--warning); animation: pulse 1.6s ease-in-out infinite; }
.stat-foot .is-warning { color: var(--warning); font-weight: 600; }
.stat-foot .is-strong { color: var(--on-surface); font-weight: 600; }

.insight-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.insight-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.insight-head, .legend, .compliance, .signoff, .chip-bar, .chips, .pass, .modal-copy {
  display: flex;
  align-items: center;
}
.insight-head, .signoff { justify-content: space-between; gap: 0.75rem; }
.insight-copy, .signoffs, .modal-copy { display: flex; flex-direction: column; }
.insight-kicker, .axis, .compliance-note, .field > span {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--slate-400);
}
.insight-kicker { color: var(--slate-500); letter-spacing: 0.05em; text-transform: uppercase; }
.insight-title { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -0.005em; }
.legend { gap: 0.75rem; flex-wrap: wrap; color: var(--on-surface-variant); font-size: 11px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch.is-purple { background: var(--purple-400); }
.swatch.is-blue { background: var(--secondary); }
.flow-chart { width: 100%; height: 96px; display: block; }
.flow-fill { fill: var(--purple-400); fill-opacity: 0.12; }
.flow-line { fill: none; stroke: var(--purple-400); stroke-width: 2.5; }
.flow-clearance { fill: none; stroke: var(--secondary); stroke-width: 2; stroke-dasharray: 4 3; }
.axis { display: flex; justify-content: space-between; gap: 0.5rem; }
.compliance { gap: 1rem; align-items: center; }
.ring { position: relative; width: 80px; height: 80px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-container); }
.ring-value { stroke: var(--purple-400); }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-value-text { font-size: 14px; line-height: 20px; font-weight: 700; }
.ring-caption { font-size: 11px; line-height: 14px; color: var(--slate-400); font-weight: 600; }
.signoffs { gap: 0.25rem; flex: 1; font-size: 13px; line-height: 18px; }
.signoff span:first-child { color: var(--on-surface-variant); }
.signoff strong { font-weight: 600; }
.signoff.is-danger, .signoff.is-danger strong { color: var(--danger); }
.compliance-note { letter-spacing: 0.02em; }

.chip-bar {
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-lowest) 80%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.chip-bar .search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 28rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-low);
}
.chip-bar .search .icon { position: static; transform: none; }
.chip-bar .search input {
  padding: 0.35rem 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.chip-bar .search input:focus { box-shadow: none; }
.chips { gap: 0.25rem; padding: 0.25rem; border-radius: var(--radius); background: var(--surface-low); }
.chip, .filter-more {
  border: 0;
  background: transparent;
  color: var(--slate-500);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.chip { padding: 0.25rem 0.5rem; border-radius: 0.5rem; white-space: nowrap; }
.chip.is-active { background: var(--surface-lowest); color: var(--purple-400); box-shadow: var(--shadow-card); }
.chip:hover, .filter-more:hover { color: var(--on-surface); }
.filter-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  background: var(--surface-low);
}
.filter-more:hover { background: var(--surface-high); }
.filter-tools { display: flex; align-items: center; gap: 0.25rem; }

.screen-visitors .data-table { min-width: 0; }
.screen-visitors td.mono { white-space: nowrap; }
.pass { gap: 0.375rem; color: var(--purple-400); font-weight: 600; white-space: nowrap; }
.pass.is-danger, .when.is-danger { color: var(--danger); }
.pass.is-quiet, tr.is-quiet .person-name, tr.is-quiet .company, tr.is-quiet .stack-title { color: var(--slate-500); }
.pass.is-quiet { color: var(--slate-400); font-weight: 600; }
.company { font-size: 14px; line-height: 20px; font-weight: 500; }
.when { font-size: 11px; line-height: 14px; font-weight: 600; white-space: nowrap; }
.when span { color: var(--slate-400); font-weight: 500; }
.purpose.is-quiet { background: var(--surface-container); color: var(--slate-500); }
.purpose.is-danger, .pill.is-danger { background: var(--danger-surface); color: var(--danger); }
.pill.is-quiet { background: var(--surface-container); color: var(--slate-500); }
.pill .icon { font-size: 14px; }
.plate {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--surface-low);
  color: var(--on-surface);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.plate.is-quiet { background: var(--surface-container); color: var(--slate-400); }
.plate.is-danger { background: var(--danger-surface); color: var(--danger); }
.avatar.is-alert { background: var(--danger-surface); color: var(--danger); }
.avatar.is-quiet { background: var(--surface-container); color: var(--slate-400); }
.person-name.is-danger { color: var(--danger); }
.icon-btn.is-warning:hover { color: var(--warning); background: var(--surface-high); }
.icon-btn.is-success { color: var(--success); }
.icon-btn.is-success:hover { color: var(--success); background: var(--surface-high); }
.icon-btn.is-neutral:hover { color: var(--on-surface); }

.modal-card.is-form { display: flex; flex-direction: column; gap: 1rem; width: min(100%, 36rem); }
.modal-title.is-compact { align-items: flex-start; gap: 0.5rem; }
.modal-title.is-compact h2 { font-size: 16px; line-height: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field.is-wide { grid-column: 1 / -1; }
.field > span { letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500); }
.pill-inside .dot { animation: pulse 1.6s ease-in-out infinite; }
.pager-page:disabled { opacity: 0.45; cursor: default; }
.field input, .field select {
  width: 100%;
  padding: 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--surface-low);
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
  line-height: 18px;
}
.field input:focus, .field select:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple-400) 20%, transparent);
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--purple-400) 10%, transparent);
  color: var(--purple-400);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.btn-issue {
  padding: 0.5rem 1.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--purple-400);
  color: var(--on-primary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.btn-issue:hover { background: #7c4dff; }

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .screen-visitors .insight-grid { grid-template-columns: 2fr 1fr; }
  .screen-assets .insight-grid { grid-template-columns: repeat(3, 1fr); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  80%, 100% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .session-copy { display: flex; }
}

@media (min-width: 768px) {
  .page-header { flex-direction: row; align-items: center; }
}

@media (min-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .screen-assets .stat-grid { grid-template-columns: repeat(5, 1fr); }
  .screen-gate .stat-grid,
  .screen-visitors .stat-grid,
  .screen-master .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .screen-material .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.screen-gate .toolbar .table-footer {
  flex: 1;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: transparent;
}

.screen-gate {
  min-height: calc(100vh - var(--topbar));
}

.screen-gate .table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen-gate .table-scroll,
.screen-visitors .table-scroll,
.screen-assets .table-scroll,
.screen-master .table-scroll {
  flex: 1;
  max-height: calc(100vh - 18rem);
  overflow: auto;
}

.screen-gate .data-table { min-width: 0; }
.screen-gate .btn-quiet:disabled,
.screen-visitors .btn-quiet:disabled { opacity: 0.45; cursor: default; }

.screen-visitors {
  min-height: calc(100vh - var(--topbar));
}

.screen-visitors .chip-bar .table-footer {
  flex: 1;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: transparent;
}

.screen-visitors .table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen-assets {
  min-height: calc(100vh - var(--topbar));
}

.screen-assets .toolbar .table-footer {
  flex: 1;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: transparent;
}

.screen-assets .table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.checkin-title.confirm-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkin-title.confirm-title .icon { color: var(--purple-400); }

.screen-assets .actions .icon-btn { width: 2rem; height: 2rem; padding: 0; }
.screen-assets .actions .icon-btn .icon { font-size: 20px; }
.screen-assets .actions .icon-btn.is-warning { color: var(--warning); }

@media (max-width: 639px) {
  .session-copy { display: none; }
  .page { padding: 1rem; }
  .topbar { padding-inline: 1rem; }
  .segmented { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.icon.is-accent { color: var(--purple-400); }
.icon.is-warning { color: var(--warning); }
.person-meta.is-success, .stack-title.is-danger, .stack-meta.is-danger { font-weight: 600; }
.person-meta.is-success { color: var(--success); }
.stack-title.is-danger { color: var(--danger); }

.eyebrow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.eyebrow-pill {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-400);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--outline-variant); }

.metric-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.metric {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--surface-lowest);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.metric::after {
  content: "";
  position: absolute;
  top: -3rem;
  right: -3rem;
  width: 7rem;
  height: 7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--glow, var(--purple-400)) 12%, transparent);
  filter: blur(18px);
  pointer-events: none;
}
.metric.is-out { --glow: var(--secondary); }
.metric.is-clear { --glow: var(--purple-400); }
.metric.is-danger { --glow: var(--danger); background: var(--danger-surface); }
.metric-head, .metric-figure, .metric-note, .checkpoint, .inline-search, .pair, .alert-item, .asset-toolbar, .asset-filters, .sort-btn, .btn-soft, .btn-lavender {
  display: flex;
  align-items: center;
}
.metric-head, .asset-toolbar { justify-content: space-between; gap: 0.75rem; }
.metric-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--slate-500); }
.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: var(--surface-low);
  flex: none;
}
.metric-icon.is-primary { color: var(--purple-400); }
.metric-icon.is-secondary { color: var(--secondary); }
.metric-icon.is-accent { background: var(--lavender); color: var(--purple-400); }
.metric-icon.is-danger { background: color-mix(in srgb, var(--surface-lowest) 70%, transparent); color: var(--danger); }
.metric-figure { align-items: baseline; gap: 0.5rem; }
.metric-value { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; }
.metric-note { gap: 0.25rem; margin: 0.5rem 0 0; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--slate-500); }
.metric-note.is-up { color: var(--success); }
.metric-note.is-accent { color: var(--purple-400); }
.metric.is-danger .metric-label,
.metric.is-danger .metric-value,
.metric.is-danger .stat-unit,
.metric.is-danger .metric-note { color: var(--danger); }

.gauge { position: relative; width: 144px; height: 144px; margin: 0.75rem auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; }
.gauge-track { stroke: var(--surface-high); stroke-width: 10; }
.gauge-outer { stroke: var(--purple-400); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 301.59; stroke-dashoffset: 65; }
.gauge-inner { stroke: var(--secondary); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 213.62; stroke-dashoffset: 130; }
.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.swatch.is-round { border-radius: 999px; }
.screen-assets .signoff strong { color: var(--slate-500); font-weight: 600; }
.screen-assets .signoff > span { display: inline-flex; align-items: center; gap: 0.5rem; }
h2.insight-title { margin: 0; }

.inline-search {
  position: relative;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-low);
}
.inline-search .icon { color: var(--slate-400); }
.inline-search input {
  width: 100%;
  padding: 0.65rem 0;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
}
.inline-search input:focus { outline: none; }
.pair { gap: 0.5rem; margin-top: 0.5rem; }
.btn-soft, .btn-lavender {
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.pair .btn-soft, .pair .btn-lavender { flex: 1; }
.btn-soft { background: var(--surface-container); }
.btn-soft:hover, .filter-more:hover { background: var(--surface-high); }
.btn-lavender { flex: 1; background: var(--lavender); color: var(--purple-400); }
.btn-lavender:hover { background: color-mix(in srgb, var(--purple-400) 16%, var(--lavender)); }
.btn-soft.is-block { width: 100%; border-radius: var(--radius); }
.checkpoint { gap: 0.75rem; margin-top: 0.75rem; padding: 0.75rem; border-radius: var(--radius); background: var(--surface-low); }

.alert-list { display: flex; flex-direction: column; gap: 0.5rem; }
.alert-item { align-items: flex-start; gap: 0.75rem; padding: 0.625rem; border-radius: var(--radius); background: var(--surface-low); }
.alert-item.is-danger { background: var(--danger-surface); color: var(--danger); }
.alert-item p { margin: 0; color: var(--slate-500); font-size: 13px; line-height: 18px; }
.alert-item.is-danger p { color: var(--on-surface); }
.alert-title { font-size: 13px; line-height: 18px; font-weight: 600; }

.asset-toolbar { flex-wrap: wrap; padding: 1rem; }
.asset-filters { flex: 1; gap: 0.5rem; min-width: 16rem; max-width: 40rem; }
.asset-filters .inline-search { flex: 1; margin-top: 0; }
.asset-filters select, .field textarea {
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
}
.asset-filters select { padding: 0.65rem 0.75rem; }
.field.is-plain > span { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--on-surface); }
.field textarea { width: 100%; min-height: 4.5rem; padding: 0.5rem; resize: vertical; }
.form-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.sort-btn { gap: 0.25rem; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; }
.screen-assets .data-table { min-width: 0; }
tr.is-flagged { background: color-mix(in srgb, var(--danger-surface) 70%, transparent); }
tr.is-flagged:hover { background: var(--danger-surface); }

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(24rem, calc(100% - 3rem));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--on-surface);
  color: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  transform: translateY(5rem);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
}
.toast.is-open { transform: none; opacity: 1; }
.toast .icon { color: #d2bcff; }

.checkin-modal .modal-card {
  position: relative;
  width: min(100%, 460px);
  max-height: none;
  padding: 28px 28px 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 60px 120px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

.checkin-modal .modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
}

.checkin-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  background: var(--surface-lowest);
  color: var(--slate-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.checkin-close:hover {
  background: var(--lavender);
  border-color: rgba(108, 43, 217, 0.25);
  color: var(--purple-400);
}

.checkin-title {
  margin: 0 40px 22px 0;
  color: var(--on-surface);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.checkin-modal form { display: flex; flex-direction: column; gap: 16px; }

.checkin-field { display: flex; flex-direction: column; gap: 6px; }
.checkin-field > span {
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.checkin-modal input[type="time"],
.checkin-modal input[type="date"],
.checkin-modal input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface);
  font: inherit;
  font-size: 14px;
}

.checkin-modal input[type="time"]:focus,
.checkin-modal input[type="date"]:focus,
.checkin-modal input[type="text"]:focus {
  outline: none;
  border-color: var(--purple-400);
  box-shadow: 0 0 0 2px rgba(108, 43, 217, 0.15);
}

.checkin-modal .searchable-select { position: relative; }

.checkin-modal .search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.checkin-modal .search-input::placeholder { color: var(--slate-500); }

.checkin-modal .search-input:focus {
  outline: none;
  border-color: var(--purple-400);
  box-shadow: 0 0 0 2px rgba(108, 43, 217, 0.15);
}

.checkin-modal .dropdown-caret {
  position: absolute;
  top: 22px;
  right: 12px;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.checkin-modal .options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 5;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.checkin-modal .options[hidden],
.checkin-modal .option[hidden],
.checkin-modal .option-empty[hidden] { display: none; }

.checkin-modal .option,
.checkin-modal .option-empty {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.checkin-modal .option { cursor: pointer; }
.checkin-modal .option.has-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.checkin-modal .option.has-meta[hidden] { display: none; }
.checkin-modal .option-meta { color: var(--slate-500); font-size: 12px; }

.checkin-field[hidden],
.checkin-specs[hidden] { display: none; }

.checkin-specs { display: flex; flex-direction: column; gap: 16px; }

#add-asset-modal.is-open,
.checkin-modal.is-tall.is-open {
  align-items: flex-start;
  overflow-y: auto;
  padding-block: 1.5rem;
}

#add-asset-modal .modal-card,
.checkin-modal.is-tall .modal-card { margin-inline: auto; max-height: none; }
.checkin-modal .option:hover,
.checkin-modal .option:focus-visible { background: rgba(108, 43, 217, 0.06); }
.checkin-modal .option-empty { color: var(--slate-500); }

.form-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.form-success {
  margin: 8px 0 0;
  color: var(--success);
  font-size: 0.875rem;
}

.checkin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
}

.checkin-cancel,
.checkin-save {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.checkin-cancel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.6);
  color: var(--on-surface);
}

.checkin-save {
  border: 0;
  background: linear-gradient(180deg, #8758ff 0%, #7c4dff 35%, #6c2bd9 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(108, 43, 217, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.checkin-save:disabled,
.checkin-save:disabled:hover { opacity: 0.45; cursor: default; box-shadow: none; transform: none; }

.btn-in.checkin-save {
  background: linear-gradient(to bottom, #34c77b, #14a85c, #0f9d58);
  box-shadow: 0 6px 18px rgba(15, 157, 88, 0.25);
}

html.dark .checkin-modal .modal-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: transparent;
}

html.dark .checkin-modal .modal-card::before {
  background: rgba(30, 41, 59, 0.9);
}

html.dark .checkin-modal .search-input,
html.dark .checkin-modal input[type="time"],
html.dark .checkin-modal input[type="date"],
html.dark .checkin-modal input[type="text"],
html.dark .checkin-cancel {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.75);
  color: var(--on-surface);
}

html.dark .checkin-modal .options {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(26, 32, 48, 0.96);
}

@media (min-width: 640px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.th-content.sorted-asc::after,
.th-content.sorted-desc::after {
  font-size: 10px;
  color: var(--purple-400);
}

.th-content.sorted-asc::after { content: "▲"; }
.th-content.sorted-desc::after { content: "▼"; }

.th-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate-400);
  cursor: pointer;
}

.data-table th .th-icon .icon { color: inherit; }
.th-icon:hover,
.th-icon.filter-active { color: var(--purple-400); background: var(--lavender); }

.th-icon.filter-active::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-400);
}

.column-popup {
  position: fixed;
  z-index: 80;
  width: 280px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 24px 60px rgba(0, 0, 0, 0.12);
  max-height: calc(100vh - 16px);
  overflow: auto;
}

.column-popup[hidden] { display: none; }

.popup-section {
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.popup-section:not(:last-of-type)::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}

.popup-title {
  margin-bottom: 10px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.column-popup .sort-buttons { display: flex; gap: 8px; }

.column-popup .sort-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.column-popup .sort-btn:hover { border-color: var(--purple-400); }

.column-popup .filter-search {
  position: relative;
  display: block;
  margin-bottom: 8px;
}

.column-popup .filter-search input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface);
  font: inherit;
  font-size: 13px;
}

.column-popup .filter-search input:focus {
  outline: none;
  border-color: var(--purple-400);
  box-shadow: 0 0 0 2px rgba(108, 43, 217, 0.15);
}

.column-popup .filter-search .icon {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--slate-500);
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-list { max-height: 180px; overflow: auto; }

.filter-list label,
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.filter-list label[hidden] { display: none; }
.filter-list label:hover { background: rgba(108, 43, 217, 0.06); }
.filter-list .date-year { margin-top: 6px; }
.filter-list .date-year > label { font-weight: 600; }
.filter-list .date-month { margin-top: 4px; margin-left: 16px; }
.filter-list .date-month label:not(:first-child) { margin-left: 16px; font-weight: 400; }

.popup-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.popup-actions.center { justify-content: center; }

.column-popup .btn-outline,
.column-popup .btn-primary {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.column-popup .btn-outline {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface);
}

.column-popup .btn-primary {
  border: 0;
  background: linear-gradient(180deg, #8758ff 0%, #7c4dff 35%, #6c2bd9 100%);
  color: #fff;
}

html.dark .column-popup {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.94);
}

html.dark .column-popup .sort-btn,
html.dark .column-popup .filter-search input,
html.dark .column-popup .btn-outline {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  color: var(--on-surface);
}

.page-spinner {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.page-spinner.is-visible { display: flex; }

.table-spinner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-lowest) 72%, transparent);
}

.table-card.is-loading .table-spinner { display: flex; }

.spinner {
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid transparent;
  border-top-color: var(--purple-400);
  border-bottom-color: var(--purple-400);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner::before {
  content: "";
  position: absolute;
  inset: 5px;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-left-color: var(--slate-400);
  border-right-color: var(--slate-400);
  border-radius: 50%;
  animation: spin-reverse 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }

.floating-tooltip {
  position: fixed;
  z-index: 999999;
  padding: 6px 10px;
  color: var(--on-surface);
  background: color-mix(in srgb, var(--surface-lowest) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.06);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.96);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(.2, .8, .2, 1);
  backdrop-filter: blur(8px);
}

.floating-tooltip.tooltip-right::after,
.floating-tooltip.tooltip-left::after,
.floating-tooltip.tooltip-top::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: color-mix(in srgb, var(--surface-lowest) 82%, transparent);
}

.floating-tooltip.tooltip-right::after {
  left: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  border-left: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.floating-tooltip.tooltip-left::after {
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  border-right: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.floating-tooltip.tooltip-top::after {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
}
