/* ===========================================================================
   Arrivo (Visitor Management) — admin theme
   A thin monochrome "zinc" layer on top of Bootstrap 5.
   No inline styles anywhere in the app; everything lives here.
   =========================================================================== */

/* ---- Inter (variable, SIL Open Font License — licenses/inter-OFL.txt) ---- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --vms-bg:        #fbfbfb;
  --vms-surface:   #ffffff;
  --vms-ink:       #09090b;   /* near-black — used for text/headings */
  --vms-ink-soft:  #27272a;

  /* ---- Brand accent (default = Arrivo indigo). Admin can override via
         Settings → Design → theme colour; see theme_style_tag(). ------------- */
  --vms-primary:       #4f46e5;   /* buttons, links, highlights, brand marks */
  --vms-primary-hover: #4338ca;
  --vms-primary-soft:  #eef2ff;   /* light accent surface (active nav, stat chips) */
  --vms-muted:     #71717a;
  --vms-faint:     #a1a1aa;
  --vms-line:      #e4e4e7;
  --vms-line-soft: #f1f1f3;
  --vms-zinc-50:   #fafafa;
  --vms-zinc-100:  #f4f4f5;
  --vms-zinc-200:  #e4e4e7;
  --vms-rose:      #e11d48;
  --vms-amber:     #b45309;
  --vms-green:     #15803d;
  --vms-rose-soft:  #fff1f2;
  --vms-rose-line:  #fecdd3;
  --vms-rose-ink:   #881337;
  --vms-green-soft: #f0fdf4;
  --vms-green-line: #bbf7d0;
  --vms-amber-soft: #fffbeb;
  --vms-amber-line: #fde68a;
  --vms-track:      #d4d4d8;
  --vms-sidebar-w: 248px;
  --vms-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --vms-radius: 8px;        /* controls: inputs, buttons */
  --vms-radius-lg: 12px;    /* cards, modals */
  --vms-shadow-sm: 0 1px 2px rgba(9, 9, 11, .05);
  --vms-shadow-md: 0 4px 16px -6px rgba(9, 9, 11, .12);
  /* Dark chrome (sidebar + brand panels) derived from the accent so it follows
     the admin's Settings colour. Static fallback first for older browsers. */
  --vms-sidebar-bg: #1e1b4b;      /* dark indigo sidebar (fallback) */
  --vms-sidebar-bg: color-mix(in srgb, var(--vms-primary) 24%, #0b0a16);
  --vms-sidebar-bg2: #14122c;     /* deeper shade for gradients (fallback) */
  --vms-sidebar-bg2: color-mix(in srgb, var(--vms-primary) 13%, #08070f);

  /* Re-point Bootstrap's primary onto the brand accent so stock components match. */
  --bs-primary:        #4f46e5;
  --bs-primary-rgb:    79, 70, 229;
  --bs-body-color:     #27272a;
  --bs-body-bg:        #fbfbfb;
  --bs-border-color:   #e4e4e7;
  --bs-link-color:     #4f46e5;
  --bs-link-hover-color: #4338ca;
  --bs-focus-ring-color: rgba(79, 70, 229, .25);
}

/* ---- Dark mode ------------------------------------------------------------
   data-theme="dark" (user choice) or the system setting when the user has not
   chosen (no data-theme attribute). Only tokens change; components follow. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --vms-bg:        #0c0c11;
  --vms-surface:   #16161d;
  --vms-ink:       #f4f4f5;
  --vms-ink-soft:  #d4d4d8;
  --vms-primary-soft: color-mix(in srgb, var(--vms-primary) 22%, #16161d);
  --vms-muted:     #a1a1aa;
  --vms-faint:     #71717a;
  --vms-line:      #2a2a35;
  --vms-line-soft: #202029;
  --vms-zinc-50:   #191920;
  --vms-zinc-100:  #1f1f27;
  --vms-zinc-200:  #2a2a35;
  --vms-rose:      #fb7185;
  --vms-amber:     #fbbf24;
  --vms-green:     #4ade80;
  --vms-rose-soft:  rgba(244, 63, 94, .12);
  --vms-rose-line:  rgba(244, 63, 94, .35);
  --vms-rose-ink:   #fecdd3;
  --vms-green-soft: rgba(34, 197, 94, .12);
  --vms-green-line: rgba(34, 197, 94, .35);
  --vms-amber-soft: rgba(245, 158, 11, .12);
  --vms-amber-line: rgba(245, 158, 11, .35);
  --vms-track:      #3f3f4a;
  --bs-body-color:     #d4d4d8;
  --bs-body-bg:        #0c0c11;
  --bs-border-color:   #2a2a35;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --vms-bg:        #0c0c11;
    --vms-surface:   #16161d;
    --vms-ink:       #f4f4f5;
    --vms-ink-soft:  #d4d4d8;
    --vms-primary-soft: color-mix(in srgb, var(--vms-primary) 22%, #16161d);
    --vms-muted:     #a1a1aa;
    --vms-faint:     #71717a;
    --vms-line:      #2a2a35;
    --vms-line-soft: #202029;
    --vms-zinc-50:   #191920;
    --vms-zinc-100:  #1f1f27;
    --vms-zinc-200:  #2a2a35;
    --vms-rose:      #fb7185;
    --vms-amber:     #fbbf24;
    --vms-green:     #4ade80;
    --vms-rose-soft:  rgba(244, 63, 94, .12);
    --vms-rose-line:  rgba(244, 63, 94, .35);
    --vms-rose-ink:   #fecdd3;
    --vms-green-soft: rgba(34, 197, 94, .12);
    --vms-green-line: rgba(34, 197, 94, .35);
    --vms-amber-soft: rgba(245, 158, 11, .12);
    --vms-amber-line: rgba(245, 158, 11, .35);
    --vms-track:      #3f3f4a;
    --bs-body-color:     #d4d4d8;
    --bs-body-bg:        #0c0c11;
    --bs-border-color:   #2a2a35;
  }
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--vms-bg);
  color: var(--vms-ink-soft);
  font-family: var(--vms-font);
  font-feature-settings: "cv11", "ss01";   /* Inter: single-storey a, open digits */
  font-size: 14px;
  line-height: 1.55;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--vms-font); }

a { text-decoration: none; color: var(--vms-primary); }
a:hover { color: var(--vms-primary-hover); }
a.cell-main, .cell-main a { color: var(--vms-ink); }
a.cell-main:hover { color: var(--vms-primary); }

/* ---- App shell ---------------------------------------------------------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.app-sidebar {
  width: var(--vms-sidebar-w);
  flex-shrink: 0;
  background: var(--vms-sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.app-content { flex: 1 1 auto; overflow-y: auto; padding: 1.5rem; }
.content-wrap { max-width: 1500px; margin: 0 auto; }

/* ---- Sidebar brand ------------------------------------------------------ */
.sidebar-brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand .brand-mark {
  height: 30px; width: 30px;
  border-radius: 8px;
  background: var(--vms-primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 10px -4px rgba(0,0,0,.4);
}
.sidebar-brand .brand-text {
  font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand .brand-text span { color: rgba(255,255,255,.5); font-weight: 600; }
.sidebar-brand .brand-logo { max-height: 30px; max-width: 168px; object-fit: contain; }

/* ---- Sidebar nav -------------------------------------------------------- */
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem .65rem; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-group { margin-bottom: 1.4rem; }
.nav-group-label {
  padding: 0 .65rem; margin-bottom: .5rem;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.42);
}
.nav-link-av {
  display: flex; align-items: center; gap: .65rem;
  padding: 8px .65rem; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.74);
  transition: background-color .12s, color .12s;
}
.nav-link-av .bi { font-size: 15px; width: 18px; text-align: center; }
.nav-link-av:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link-av.active { background: var(--vms-primary); color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.45); }
.nav-link-av .nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 6px; background: rgba(255,255,255,.16); color: #fff;
  font-size: 10px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center;
}
.nav-link-av.active .nav-badge { background: rgba(255,255,255,.26); }

/* ---- Sidebar user block ------------------------------------------------- */
.sidebar-user { border-top: 1px solid rgba(255,255,255,.08); padding: .65rem; flex-shrink: 0; }
.sidebar-user .user-avatar {
  height: 32px; width: 32px; border-radius: 8px; background: var(--vms-primary);
  color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user .user-name { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user .user-role { font-size: 11px; color: rgba(255,255,255,.5); text-transform: capitalize; }
.sidebar-user .btn-av-ghost { color: rgba(255,255,255,.6); }
.sidebar-user .btn-av-ghost:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ---- Topbar ------------------------------------------------------------- */
.app-topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 0 1.5rem;
  background: var(--vms-surface);
  border-bottom: 1px solid var(--vms-line);
}
.breadcrumbs { display: flex; align-items: center; gap: .45rem; min-width: 0;
  font-size: 13.5px; font-weight: 500; }
.breadcrumbs a { color: var(--vms-muted); }
.breadcrumbs a:hover { color: var(--vms-ink); }
.breadcrumbs .sep { color: var(--vms-faint); }
.breadcrumbs .current { color: var(--vms-ink); font-weight: 600; }
.topbar-link {
  font-size: 13.5px; font-weight: 500;
  color: var(--vms-muted); display: inline-flex; align-items: center; gap: .35rem;
}
.topbar-link:hover { color: var(--vms-ink); }

/* Sidebar drawer toggle (mobile) */
.sidebar-toggle { background: none; border: 0; color: var(--vms-muted); font-size: 20px; padding: 0; }

/* ---- Cards -------------------------------------------------------------- */
.av-card { background: var(--vms-surface); border: 1px solid var(--vms-line);
  border-radius: var(--vms-radius-lg); box-shadow: var(--vms-shadow-sm); }
.av-card-pad { padding: 1.25rem; }
.av-card-head {
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--vms-line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.av-card-head h2, .av-card-head h3 {
  font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--vms-ink); margin: 0;
  display: flex; align-items: center; gap: .5rem;
}

/* ---- Stat cards (label · icon chip · big number · mini progress bar) ----- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 992px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--vms-surface); border: 1px solid var(--vms-line);
  border-radius: var(--vms-radius-lg); padding: 1.15rem 1.25rem 1.2rem; box-shadow: var(--vms-shadow-sm); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-card .stat-label { font-size: 13px; font-weight: 500; color: var(--vms-muted); line-height: 1.3; }
.stat-card .stat-icon { height: 40px; width: 40px; border-radius: 10px;
  background: var(--vms-primary-soft); color: var(--vms-primary); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--vms-ink);
  line-height: 1; margin-top: .7rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-track { height: 5px; background: var(--vms-zinc-100); border-radius: 10px; margin-top: 1rem; overflow: hidden; }
.mini-fill { height: 100%; background: var(--vms-primary); border-radius: 10px; }

/* ---- Dashboard greeting hero ------------------------------------------- */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem 1.7rem; margin-bottom: 1.5rem; border-radius: 16px; color: #fff;
  background: linear-gradient(150deg, #1e1b4b 0%, #312e81 100%);
  background: radial-gradient(620px 320px at 92% -50%, var(--vms-primary) 0%, transparent 60%),
    linear-gradient(150deg, var(--vms-sidebar-bg) 0%, color-mix(in srgb, var(--vms-primary) 42%, #0c0b1a) 100%); }
.dash-hero h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 3px 0; color: #fff; }
.dash-hero-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #a5b4fc; margin: 0; }
.dash-hero-sub { font-size: 14px; color: #c7c8e8; margin: 0; }
.btn-av-light { background: #fff; color: var(--vms-primary); border: 1px solid #fff; }
.btn-av-light:hover { background: #eef2ff; color: var(--vms-primary); }
.mini-fill.is-stub { width: 18px; }
.w-fill-0 { width: 0; } .w-fill-10 { width: 10%; } .w-fill-20 { width: 20%; }
.w-fill-30 { width: 30%; } .w-fill-40 { width: 40%; } .w-fill-50 { width: 50%; }
.w-fill-60 { width: 60%; } .w-fill-70 { width: 70%; } .w-fill-80 { width: 80%; }
.w-fill-90 { width: 90%; } .w-fill-100 { width: 100%; }

/* ---- Page header -------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em;
  color: var(--vms-ink); margin: 0; }
.page-head .page-sub { font-size: 14px; color: var(--vms-muted); margin-top: .25rem; }

/* ---- Buttons ------------------------------------------------------------ */
.btn-av { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 36px; font-family: var(--vms-font); font-size: 13.5px; font-weight: 600; letter-spacing: 0;
  line-height: 1.2; border-radius: var(--vms-radius); padding: .5rem .95rem; border: 1px solid transparent;
  white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s, box-shadow .12s; }
.btn-av .bi { font-size: 15px; }
.btn-av:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.btn-av-primary { background: var(--vms-primary); color: #fff; box-shadow: var(--vms-shadow-sm); }
.btn-av-primary:hover { background: var(--vms-primary-hover); color: #fff; }
.btn-av-outline { background: var(--vms-surface); color: var(--vms-ink-soft); border-color: var(--vms-line);
  box-shadow: var(--vms-shadow-sm); }
.btn-av-outline:hover { background: var(--vms-zinc-50); color: var(--vms-ink); }
.btn-av-ghost { background: transparent; color: var(--vms-muted); }
.btn-av-ghost:hover { background: var(--vms-zinc-100); color: var(--vms-ink); }
.btn-av-danger { background: transparent; color: var(--vms-rose); border-color: var(--vms-rose-line); }
.btn-av-danger:hover { background: var(--vms-rose-soft); }
.btn-av-sm { min-height: 30px; padding: .35rem .7rem; font-size: 12.5px; }
.btn-av-sm .bi { font-size: 13.5px; }

/* ---- Forms -------------------------------------------------------------- */
.form-label-av { display: block; font-size: 13px; font-weight: 500; color: var(--vms-ink-soft); margin-bottom: .35rem; }
.form-control-av, .form-select-av {
  width: 100%; min-height: 38px; padding: .5rem .75rem; background: var(--vms-surface);
  border: 1px solid var(--vms-line); border-radius: var(--vms-radius); font-family: var(--vms-font); font-size: 14px;
  box-shadow: var(--vms-shadow-sm);
  color: var(--vms-ink); transition: border-color .12s, box-shadow .12s; }
.form-control-av::placeholder { color: var(--vms-faint); }
.form-control-av:focus, .form-select-av:focus {
  outline: none; border-color: var(--vms-primary);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color); background: var(--vms-surface); }
.form-control-av.is-error, .form-select-av.is-error { border-color: #fda4af; }
textarea.form-control-av { resize: vertical; min-height: 90px; }
/* Larger input for kiosk touch screens. */
.form-control-lg-av { height: 52px; font-size: 1.05rem; padding: 0 14px; }
.field-error { color: var(--vms-rose); font-size: 12.5px; margin-top: .3rem; }
.form-hint { color: var(--vms-muted); font-size: 12.5px; margin-top: .3rem; }

/* Custom select — hide the native arrow, draw our own chevron. */
.form-select-av {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px; }
.form-select-av::-ms-expand { display: none; }

/* Custom file / image picker — the native input is hidden inside the label. */
.file-drop { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
  border: 1px dashed var(--vms-line); border-radius: var(--vms-radius); background: var(--vms-surface);
  cursor: pointer; transition: border-color .12s, background-color .12s; margin: 0; }
.file-drop:hover { border-color: var(--vms-faint); background: var(--vms-surface); }
.file-drop input[type=file] { position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.file-drop .file-icon { height: 36px; width: 36px; border-radius: 10px; background: var(--vms-surface);
  border: 1px solid var(--vms-line); display: inline-flex; align-items: center; justify-content: center;
  color: var(--vms-muted); font-size: 17px; flex-shrink: 0; }
.file-drop .file-body { min-width: 0; line-height: 1.3; }
.file-drop .file-text { font-size: 13px; color: var(--vms-ink-soft); font-weight: 600;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-drop .file-sub { font-size: 11.5px; color: var(--vms-faint); }
.file-drop.is-error { border-color: #fda4af; }

/* Searchable select (progressive enhancement over a native <select>). */
.ss { position: relative; display: block; width: 100%; }
.ss-native { position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.ss-control { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; min-height: 38px; padding: .5rem .75rem; background: var(--vms-surface); border: 1px solid var(--vms-line);
  border-radius: var(--vms-radius); font-size: 14px; color: var(--vms-ink); cursor: pointer; box-shadow: var(--vms-shadow-sm);
  transition: border-color .12s, box-shadow .12s; }
.ss-control:focus, .ss.open > .ss-control { outline: none; border-color: var(--vms-primary);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color); background: var(--vms-surface); }
.ss-control .ss-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-control .ss-value.is-placeholder { color: var(--vms-faint); }
.ss-control .ss-caret { color: var(--vms-faint); flex-shrink: 0; font-size: 12px; display: inline-flex; }
.ss.is-error > .ss-control { border-color: #fda4af; }
.ss-panel { position: absolute; z-index: 1090; background: var(--vms-surface); border: 1px solid var(--vms-line);
  border-radius: 10px; box-shadow: 0 8px 26px rgba(9,9,11,.14); overflow: hidden; min-width: 170px; }
.ss-search-wrap { padding: 6px; border-bottom: 1px solid var(--vms-line-soft); }
.ss-search { width: 100%; padding: .4rem .55rem; border: 1px solid var(--vms-line); border-radius: var(--vms-radius);
  font-size: 13px; background: var(--vms-zinc-50); outline: none; }
.ss-search:focus { border-color: var(--vms-faint); background: var(--vms-surface); }
.ss-options { max-height: 240px; overflow-y: auto; padding: 4px; }
.ss-option { padding: .45rem .6rem; border-radius: 6px; font-size: 14px; color: var(--vms-ink-soft);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-option:hover, .ss-option.active { background: var(--vms-zinc-100); color: var(--vms-ink); }
.ss-option.selected { font-weight: 600; color: var(--vms-ink); }
.ss-empty { padding: .65rem; text-align: center; color: var(--vms-faint); font-size: 12.5px; }

/* ---- Tables ------------------------------------------------------------- */
.table-av { width: 100%; border-collapse: collapse; }
.table-av thead th {
  padding: .7rem 1.1rem; text-align: left; font-size: 12.5px; font-weight: 600;
  color: var(--vms-muted);
  background: var(--vms-zinc-50); border-bottom: 1px solid var(--vms-line); white-space: nowrap; }
.table-av tbody td { padding: .8rem 1.1rem; font-size: 14px; color: var(--vms-ink-soft);
  border-bottom: 1px solid var(--vms-line-soft); vertical-align: middle; }
.table-av tbody tr { transition: background-color .1s ease; }
.table-av tbody tr:last-child td { border-bottom: 0; }
.table-av tbody tr:hover { background: var(--vms-zinc-50); }
.table-av td.tabnum, .table-av th.tabnum { font-variant-numeric: tabular-nums; }
/* Two-line cell: a primary value with a muted sub-line beneath it. */
.cell-main { font-weight: 600; color: var(--vms-ink); }
.cell-sub { font-size: 12.5px; color: var(--vms-muted); margin-top: 1px; }
.cell-sub.tabnum { font-variant-numeric: tabular-nums; }
/* Tables sit flush inside a card; round the card so header/footer corners follow. */
.av-card > .table-responsive:first-child .table-av thead th:first-child { border-top-left-radius: var(--vms-radius-lg); }
.av-card > .table-responsive:first-child .table-av thead th:last-child { border-top-right-radius: var(--vms-radius-lg); }

/* ---- Badges ------------------------------------------------------------- */
.badge-av { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0;
  border: 1px solid transparent; line-height: 1.45; white-space: nowrap; }
.badge-zinc  { background: var(--vms-zinc-100); color: var(--vms-ink-soft); border-color: var(--vms-line); }
.badge-amber { background: var(--vms-amber-soft); color: var(--vms-amber); border-color: var(--vms-amber-line); }
.badge-green { background: var(--vms-green-soft); color: var(--vms-green); border-color: var(--vms-green-line); }
.badge-rose  { background: var(--vms-rose-soft); color: var(--vms-rose); border-color: var(--vms-rose-line); }

/* ---- Flash messages ----------------------------------------------------- */
.flash-stack { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.flash { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem;
  border-radius: var(--vms-radius); font-size: 14px; border: 1px solid transparent; }
.flash .bi { font-size: 17px; flex-shrink: 0; }
.flash-success { background: var(--vms-green-soft); color: var(--vms-green); border-color: var(--vms-green-line); }
.flash-danger  { background: var(--vms-rose-soft); color: var(--vms-rose); border-color: var(--vms-rose-line); }
.flash-warning { background: var(--vms-amber-soft); color: var(--vms-amber); border-color: var(--vms-amber-line); }
.flash-info    { background: var(--vms-zinc-50); color: var(--vms-ink-soft); border-color: var(--vms-line); }
.flash .flash-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; }
.flash .flash-close:hover { opacity: 1; }

/* ---- Empty state -------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1.25rem; color: var(--vms-muted); font-size: 14px; }
.empty-state .bi { font-size: 22px; color: var(--vms-primary); display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: 0 auto .75rem; border-radius: 12px; background: var(--vms-primary-soft); }

/* ---- Confirm modal ------------------------------------------------------ */
.av-modal-backdrop { position: fixed; inset: 0; z-index: 1080; display: none;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(9,9,11,.35); backdrop-filter: blur(2px); }
.av-modal-backdrop.show { display: flex; }
.av-modal { background: var(--vms-surface); border: 1px solid var(--vms-line); border-radius: var(--vms-radius-lg);
  box-shadow: 0 20px 50px rgba(9,9,11,.25); width: 100%; max-width: 420px; overflow: hidden; }
.av-modal-body { padding: 1.25rem; display: flex; gap: .8rem; align-items: flex-start; }
.av-modal-body .icon { height: 38px; width: 38px; border-radius: 10px; background: var(--vms-rose-soft);
  color: var(--vms-rose); display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0; }
.av-modal-body h3 { font-size: 16px; font-weight: 600; color: var(--vms-ink); margin: 0; }
.av-modal-body p { font-size: 14px; color: var(--vms-muted); margin: .25rem 0 0; }
.av-modal-foot { display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1.25rem; border-top: 1px solid var(--vms-line-soft); background: var(--vms-zinc-50); }

/* ---- Bootstrap modal — zinc skin (used for create/edit forms) ----------- */
.modal-content {
  border: 1px solid var(--vms-line); border-radius: var(--vms-radius-lg); overflow: hidden;
  box-shadow: 0 20px 50px rgba(9,9,11,.22); background: var(--vms-surface); color: var(--vms-ink-soft);
}
.modal-header { border-bottom: 1px solid var(--vms-line-soft); padding: 1rem 1.25rem; }
.modal-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--vms-ink); }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--vms-line-soft); padding: .85rem 1.25rem;
  background: var(--vms-zinc-50); gap: .5rem; }

/* ---- Form switch (status toggles) --------------------------------------- */
.form-switch-av { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.form-switch-av input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-switch-av .track { width: 38px; height: 21px; background: var(--vms-track); border-radius: 999px;
  position: relative; transition: background-color .15s; flex-shrink: 0; }
.form-switch-av .track::after { content: ''; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; background: var(--vms-surface); border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.form-switch-av input:checked + .track { background: var(--vms-primary); }
.form-switch-av input:checked + .track::after { transform: translateX(17px); }
.form-switch-av .switch-text { font-size: 14px; color: var(--vms-ink-soft); }

/* ---- List page header (title + search + action) ------------------------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.list-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--vms-ink); margin: 0; }
.list-head .page-sub { font-size: 14px; color: var(--vms-muted); margin: .25rem 0 0; max-width: 760px; }
.list-head-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.list-search { position: relative; }
.list-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--vms-faint); font-size: 14px; pointer-events: none; }
.list-search input { width: 240px; max-width: 100%; padding-left: 2rem; }

/* ---- Table footer + pagination ------------------------------------------ */
.table-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1rem; border-top: 1px solid var(--vms-line-soft); flex-wrap: wrap; }
.foot-summary { font-size: 13px; font-weight: 500; color: var(--vms-muted); margin: 0; }
.pager { display: inline-flex; align-items: center; gap: .15rem; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 .55rem; border-radius: var(--vms-radius);
  font-size: 13px; font-weight: 500; color: var(--vms-muted); transition: background-color .12s, color .12s; }
.pager-btn:hover { background: var(--vms-zinc-100); color: var(--vms-ink); }
.pager-btn.active { background: var(--vms-primary); color: #fff; font-weight: 600; }
.pager-gap { padding: 0 .35rem; color: var(--vms-faint); }

/* ---- Row action buttons ------------------------------------------------- */
.row-actions { display: inline-flex; gap: .1rem; white-space: nowrap; justify-content: flex-end; }
.icon-btn-av { display: inline-flex; align-items: center; justify-content: center;
  height: 30px; width: 30px; border: 0; background: transparent; border-radius: 10px;
  color: var(--vms-faint); cursor: pointer; transition: background-color .12s, color .12s; }
.icon-btn-av:hover { background: var(--vms-zinc-100); color: var(--vms-ink); }
.icon-btn-av.danger:hover { background: var(--vms-rose-soft); color: var(--vms-rose); }
.col-actions { text-align: right; }

/* ---- Auth pages --------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: var(--vms-bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-mark { height: 44px; width: 44px; border-radius: 10px; background: var(--vms-primary);
  color: #fff; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.auth-brand .auth-logo { max-height: 56px; max-width: 220px; object-fit: contain; }
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--vms-ink); margin: .75rem 0 .15rem; }
.public-logo { max-height: 34px; max-width: 160px; object-fit: contain; }
.auth-brand p { font-size: 14px; color: var(--vms-muted); margin: 0; }

/* Split-screen login: indigo brand panel + form */
.auth-split { min-height: 100vh; display: flex; }
.auth-aside { display: none; flex: 1 1 0; position: relative; color: #fff; padding: 52px 56px;
  flex-direction: column; justify-content: space-between;
  background: linear-gradient(165deg, #1e1b4b 0%, #14122c 100%);
  background: radial-gradient(720px 420px at 82% -12%, var(--vms-primary) 0%, transparent 60%),
    linear-gradient(165deg, var(--vms-sidebar-bg) 0%, var(--vms-sidebar-bg2) 100%); }
@media (min-width: 900px) { .auth-aside { display: flex; } }
.auth-aside .a-brand { display: flex; align-items: center; gap: 12px; }
.auth-aside .a-mk { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; color: #fff; background: linear-gradient(155deg, var(--vms-primary), var(--vms-primary-hover));
  box-shadow: 0 14px 26px -10px rgba(0,0,0,.45); }
.auth-aside .a-logo { max-height: 40px; max-width: 200px; object-fit: contain; }
.auth-aside .a-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.auth-aside .a-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: #a5b4fc; margin: 0 0 16px; }
.auth-aside .a-head { font-size: 38px; font-weight: 850; letter-spacing: -.025em; line-height: 1.1; color: #fff; margin: 0 0 30px; }
.auth-aside .a-head span { color: #a5b4fc; }
.auth-aside .a-feats { list-style: none; display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; }
.auth-aside .a-feats li { display: flex; align-items: center; gap: 13px; font-size: 16px; font-weight: 500; line-height: 1.35; color: #dcddf2; }
.auth-aside .a-feats li i { color: #a5b4fc; font-size: 19px; flex: 0 0 auto; }
.auth-aside .a-foot { font-size: 13px; color: #a5a3e0; font-weight: 600; }
.auth-main { flex: 1 1 0; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--vms-bg); }
.auth-main .auth-card { width: 100%; max-width: 400px; }

/* ---- Filter bar --------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1.25rem; }
.filter-bar .filter-field { display: flex; flex-direction: column; gap: .3rem; }
.filter-bar .filter-field .form-label-av { margin-bottom: 0; }
.filter-bar .form-control-av, .filter-bar .form-select-av, .filter-bar .ss { min-width: 170px; }
.filter-bar .filter-grow { flex: 1 1 200px; }
.filter-bar .filter-field .ss-control { padding-top: .5rem; padding-bottom: .5rem; }
.filter-bar .filter-actions { display: flex; gap: .5rem; align-items: flex-end; }

/* ---- Form layout (full-page forms) -------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.form-section-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  color: var(--vms-ink); margin: 0 0 .75rem; }

/* ---- Photo upload preview ----------------------------------------------- */
.photo-preview { width: 100%; max-width: 220px; aspect-ratio: 1; border: 1px solid var(--vms-line);
  border-radius: 10px; object-fit: cover; background: var(--vms-zinc-50); }
.photo-drop { border: 1px dashed var(--vms-line); border-radius: 10px; padding: 1rem; background: var(--vms-zinc-50); }

/* ---- Detail view -------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-photo { width: 100%; border-radius: 10px; border: 1px solid var(--vms-line); object-fit: cover; }
.detail-photo-empty { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--vms-line);
  background: var(--vms-zinc-50); display: flex; align-items: center; justify-content: center;
  color: var(--vms-faint); font-size: 34px; }
.field-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
@media (max-width: 600px) { .field-list { grid-template-columns: 1fr; } }
.field-list .span-2 { grid-column: 1 / -1; }
.field-item .field-key { font-size: 13px; font-weight: 500; color: var(--vms-muted); margin-bottom: .15rem; }
.field-item .field-val { font-size: 14px; color: var(--vms-ink-soft); }
.detail-ref { font-size: 12px; font-weight: 600; color: var(--vms-muted); font-variant-numeric: tabular-nums; }

/* ---- Utilities ---------------------------------------------------------- */
.text-muted-av { color: var(--vms-muted) !important; }
.text-faint-av { color: var(--vms-faint) !important; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.form-narrow { max-width: 860px; }
.divider-av { height: 1px; background: var(--vms-line); margin: 1.25rem 0; }
.thumb-sm { height: 40px; width: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--vms-line); }
.chart-box { position: relative; height: 280px; }
.tab-nav-av { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--vms-line); margin-bottom: 1.25rem; }
.tab-nav-av a { padding: .65rem 0; font-size: 14px; font-weight: 500; color: var(--vms-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-nav-av a:hover { color: var(--vms-ink); }
.tab-nav-av a.active { color: var(--vms-primary); border-bottom-color: var(--vms-primary); font-weight: 600; }

/* ---- Signature pad ------------------------------------------------------ */
.signature-wrap { border: 1px solid var(--vms-line); border-radius: 10px; background: #fff; overflow: hidden; }
.signature-pad { width: 100%; height: 180px; display: block; touch-action: none; cursor: crosshair; background: #fff; }
.signature-bar { display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .6rem; border-top: 1px solid var(--vms-line-soft); background: var(--vms-zinc-50); }
.signature-bar span { font-size: 11.5px; color: var(--vms-faint); }

/* ---- Public pages ------------------------------------------------------- */
.public-body { background: var(--vms-bg); min-height: 100vh; display: flex; flex-direction: column; }
.public-header { background: var(--vms-surface); border-bottom: 1px solid var(--vms-line); }
.public-header .public-bar { max-width: 920px; margin: 0 auto; padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--vms-ink); }
.public-brand .brand-mark { height: 30px; width: 30px; border-radius: 10px; background: var(--vms-primary);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.public-nav { display: flex; gap: .4rem; }
.public-main { flex: 1 1 auto; padding: 2rem 1.25rem; }
.public-wrap { max-width: 720px; margin: 0 auto; }
.public-hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--vms-ink); margin: 0 0 .4rem; }
.public-hero p { color: var(--vms-muted); margin: 0 0 1.5rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.result-box { text-align: center; padding: 2.5rem 1.5rem; }
.result-box .result-icon { height: 56px; width: 56px; border-radius: 10px; background: var(--vms-green-soft);
  color: var(--vms-green); display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 1rem; }
.result-ref { display: inline-block; margin-top: .5rem; padding: .5rem 1rem; border-radius: 10px;
  background: var(--vms-zinc-100); font-weight: 700; font-size: 18px; letter-spacing: .04em; color: var(--vms-ink); }

/* ---- DataTables alignment with the zinc theme --------------------------- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--vms-line); border-radius: 10px; padding: .35rem .6rem;
  background: var(--vms-zinc-50); font-size: 13px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--vms-primary) !important; border-color: var(--vms-primary) !important;
  color: #fff !important; border-radius: 10px; }
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { font-size: 12.5px; color: var(--vms-muted); }

/* ---- Mobile sidebar drawer --------------------------------------------- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(9,9,11,.3);
  z-index: 1040; display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1050;
    transform: translateX(-100%); transition: transform .25s ease; }
  .app-shell.drawer-open .app-sidebar { transform: translateX(0); }
  .app-shell.drawer-open .sidebar-overlay { display: block; }
}
@media (min-width: 992px) {
  .sidebar-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* Public demo banner */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1rem;
  font-size: .85rem;
  text-align: center;
  color: var(--vms-ink);
  background: var(--vms-primary-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--vms-primary) 20%, transparent);
}
.demo-banner i { color: var(--vms-primary); }

/* Demo one-click role logins (login page, demo mode only) */
.demo-logins-title {
  margin: 0 0 .5rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--vms-muted);
}
.demo-logins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: .5rem;
}
.demo-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .65rem .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--vms-ink);
  background: var(--vms-surface);
  border: 1px solid var(--vms-line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.demo-login i { font-size: 1.15rem; color: var(--vms-primary); }
.demo-login:hover,
.demo-login:focus-visible { border-color: var(--vms-primary); background: var(--vms-primary-soft); outline: none; }

/* ---- Webcam capture (visitor photo) ------------------------------------- */
.webcam { display: flex; flex-direction: column; gap: .5rem; }
.webcam-media {
  width: 100%; max-width: 320px; aspect-ratio: 4 / 3;
  background: var(--vms-zinc-100); border: 1px solid var(--vms-line);
  border-radius: 10px; object-fit: cover;
}
.webcam-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---- Visitor / visit avatars + check-in layout -------------------------- */
.visitor-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--vms-zinc-100); border: 1px solid var(--vms-line); flex: 0 0 auto;
}
.visitor-avatar-lg { width: 96px; height: 96px; border-radius: 10px; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--vms-muted); background: var(--vms-zinc-100);
}

/* ---- Visit timeline ----------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--vms-line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--vms-primary);
}
.timeline .tl-time { color: var(--vms-muted); font-size: 12px; }

/* ---- Overstay flag ------------------------------------------------------ */
.flag-overstay { color: var(--vms-rose); font-weight: 600; }

/* ---- Inline checkbox (agreement acceptance) ----------------------------- */
.form-check-av { display: flex; align-items: flex-start; gap: .5rem; font-size: 14px; cursor: pointer; }
.form-check-av input[type="checkbox"] { margin-top: .15rem; flex: 0 0 auto; }
.form-check-av.is-error span { color: var(--vms-rose); }

/* ---- Agreement / NDA text box ------------------------------------------- */
.agreement-box {
  max-height: 160px; overflow-y: auto; padding: .75rem .9rem;
  background: var(--vms-zinc-50); border: 1px solid var(--vms-line);
  border-radius: 10px; font-size: 13px; color: var(--vms-ink-soft); white-space: pre-line;
}

/* ---- Detail definition lists (record views) ----------------------------- */
.detail-list { display: grid; grid-template-columns: 130px 1fr; gap: .4rem .75rem; margin: 0; }
.detail-list dt { color: var(--vms-muted); font-size: 13px; font-weight: 500; }
.detail-list dd { margin: 0; color: var(--vms-ink-soft); font-size: 14px; }
@media (max-width: 480px) { .detail-list { grid-template-columns: 1fr; gap: .1rem; } .detail-list dd { margin-bottom: .5rem; } }

/* ---- Watchlist match alert (check-in) ----------------------------------- */
.watchlist-alert { border: 1px solid var(--vms-rose); background: var(--vms-rose-soft); color: var(--vms-rose-ink); }
.watchlist-alert .bi { color: var(--vms-rose); }
.watchlist-alert ul { padding-left: 1.1rem; font-size: 13px; }

/* ---- Dashboard: on-site-by-location list -------------------------------- */
.site-count-list { list-style: none; margin: 0; padding: 0; }
.site-count-list li { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--vms-line-soft); font-size: 14px; }
.site-count-list li:last-child { border-bottom: 0; }

/* ---- Kiosk self-check-in (full-screen tablet experience) --------------- */
.kiosk-body { background: var(--vms-bg); min-height: 100vh; }
.kiosk-main { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1100px 620px at 50% -8%, var(--vms-zinc-100) 0%, var(--vms-bg) 62%); }

/* Brand bar with a live clock (on every kiosk page) */
.kiosk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 36px; }
.kiosk-top .k-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kiosk-top .k-mark { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; color: #fff; font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--vms-primary), var(--vms-primary-hover));
  box-shadow: 0 8px 16px -10px rgba(0,0,0,.25); }
.kiosk-top .k-logo { max-height: 46px; }
.kiosk-top .k-org { font-size: 18px; font-weight: 700; color: var(--vms-ink); letter-spacing: -.01em; }
.kiosk-clock { text-align: right; flex: 0 0 auto; }
.kiosk-clock .k-time { font-size: 22px; font-weight: 800; color: var(--vms-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.kiosk-clock .k-date { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--vms-muted); margin-top: 5px; }

/* Centred content area */
.kiosk-wrap { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; padding: 8px 24px 56px; }

/* Welcome hero */
.kiosk-hero { width: 100%; max-width: 600px; text-align: center; }
.kiosk-eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 12px; font-weight: 700; color: var(--vms-faint); margin: 0; }
.kiosk-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--vms-ink); margin: 0 0 .4rem; }
.kiosk-sub { color: var(--vms-muted); font-size: 14px; margin-bottom: .5rem; }
.kiosk-hero .kiosk-title { font-size: 42px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 10px; line-height: 1.05; }
.kiosk-hero .kiosk-sub { font-size: 17px; margin: 0; }

/* Big touch tiles (welcome actions) */
.kiosk-tiles { width: 100%; max-width: 540px; margin: 36px auto 0; display: flex; flex-direction: column; gap: 14px; }
.kiosk-tiles-row { display: flex; gap: 14px; }
.kiosk-tiles-row .kiosk-tile { flex: 1 1 0; }
.kiosk-tile { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  padding: 20px 22px; border-radius: 16px; border: 1px solid var(--vms-line); background: var(--vms-surface);
  box-shadow: 0 1px 2px rgba(9,9,11,.04); transition: border-color .15s, box-shadow .15s, transform .05s; }
.kiosk-tile:hover { border-color: var(--vms-primary); box-shadow: 0 12px 28px -14px rgba(9,9,11,.3); }
.kiosk-tile:active { transform: scale(.99); }
.kiosk-tile .ti-icon { width: 52px; height: 52px; border-radius: 13px; flex: 0 0 auto; font-size: 25px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--vms-primary-soft); color: var(--vms-primary); }
.kiosk-tile .ti-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.kiosk-tile .ti-title { font-size: 20px; font-weight: 700; color: var(--vms-ink); line-height: 1.1; }
.kiosk-tile .ti-desc { font-size: 13px; color: var(--vms-muted); margin-top: 2px; }
.kiosk-tile .ti-arrow { color: var(--vms-faint); font-size: 20px; flex: 0 0 auto; }
.kiosk-tile-primary { background: var(--vms-primary); border-color: var(--vms-primary); }
.kiosk-tile-primary .ti-icon { background: rgba(255,255,255,.16); color: #fff; }
.kiosk-tile-primary .ti-title { color: #fff; }
.kiosk-tile-primary .ti-desc { color: rgba(255,255,255,.7); }
.kiosk-tile-primary .ti-arrow { color: rgba(255,255,255,.85); }
.kiosk-tile-primary:hover { box-shadow: 0 16px 34px -12px rgba(9,9,11,.5); }

/* Form / result pages use a centred card */
.kiosk-card { width: 100%; max-width: 560px; background: var(--vms-surface); border: 1px solid var(--vms-line);
  border-radius: 18px; padding: 2rem; box-shadow: 0 10px 30px -18px rgba(9,9,11,.22); }
.kiosk-mark { display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px; color: #fff; font-size: 26px; margin-bottom: 10px;
  background: linear-gradient(160deg, var(--vms-primary), var(--vms-primary-hover));
  box-shadow: 0 8px 16px -10px rgba(0,0,0,.25); }
.kiosk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kiosk-actions-stack { flex-direction: column; align-items: center; gap: 10px; margin-top: 1.5rem; }
.kiosk-cta { font-size: 16px; min-height: 48px; padding: .8rem 2rem; }
.kiosk-foot { margin-top: 1.5rem; color: var(--vms-faint); font-size: 12px; }
.kiosk-badge-no { font-size: 1.1rem; font-weight: 700; margin-top: 6px; }
@media (max-width: 560px) {
  .kiosk-top { padding: 16px 18px; }
  .kiosk-hero .kiosk-title { font-size: 32px; }
  .kiosk-tiles-row { flex-direction: column; }
}

/* ---- Large avatar fallback icon + signature preview --------------------- */
.visitor-avatar-lg.avatar-fallback { font-size: 2rem; }
.signature-view { max-width: 280px; background: #fff; }


/* ---- Badge scan bar (fast check-in/out) --------------------------------- */
.scan-bar {
  border: 1px solid var(--vms-line);
  border-radius: var(--vms-radius-lg);
  background: var(--vms-surface);
  padding: 16px 18px;
  box-shadow: var(--vms-shadow-sm);
}
.scan-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-title { font-size: 15px; font-weight: 600; color: var(--vms-ink); display: inline-flex; align-items: center; gap: 8px; }
.scan-title .bi { color: var(--vms-primary); }
.scan-note { font-size: 13px; color: var(--vms-muted); }

/* Scan field (icon + input), then the camera and Go buttons. */
.scan-group { display: flex; align-items: stretch; gap: 8px; }
.scan-field { position: relative; flex: 1 1 auto; min-width: 0; }
.scan-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 1.15rem; color: var(--vms-faint); pointer-events: none;
}
.scan-input {
  width: 100%; height: 48px; padding: 0 14px 0 42px;
  font-family: var(--vms-font); font-size: 1rem; letter-spacing: .2px;
  color: var(--vms-ink); background: var(--vms-surface);
  border: 1px solid var(--vms-line); border-radius: var(--vms-radius);
  box-shadow: var(--vms-shadow-sm); outline: none; transition: border-color .12s, box-shadow .12s;
}
.scan-input::placeholder { color: var(--vms-faint); font-size: .95rem; letter-spacing: 0; }
.scan-input:focus { border-color: var(--vms-primary); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.scan-field:focus-within .scan-icon { color: var(--vms-primary); }
.scan-cam, .scan-go { height: 48px; padding: 0 18px; font-size: 14.5px; }
.scan-go .bi { font-size: 1.2rem; }
@media (max-width: 560px) {
  .scan-group { flex-wrap: wrap; }
  .scan-field { flex-basis: 100%; }
  .scan-cam, .scan-go { flex: 1 1 0; }
  .scan-cam .d-none { display: inline !important; }
}

/* ---- Webcam face guide + 3-2-1 countdown -------------------------------- */
/* The stage must hug the video (not stretch to the column) so the overlays
   center over the picture. align-self stops the flex parent from stretching it. */
.webcam-stage { position: relative; align-self: flex-start; width: 100%; max-width: 320px; line-height: 0; overflow: hidden; border-radius: 10px; }
.webcam-stage .webcam-media { width: 100%; max-width: 100%; display: block; margin: 0; }
.webcam-guide { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52%; height: 78%; border: 2px dashed rgba(255,255,255,.9); border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.18); pointer-events: none; }
.webcam-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); pointer-events: none; }

/* ---- Button loading state (double-submit guard) ------------------------- */
.btn-av.is-loading { opacity: .6; pointer-events: none; }

/* ---- Privacy / consent note (public + kiosk forms) --------------------- */
.privacy-note { color: var(--vms-faint); font-size: 12px; margin-top: .75rem; text-align: center; }

/* ---- Kiosk background image (optional, set in settings) ----------------- */
.kiosk-main.kiosk-has-bg { position: relative; background-size: cover; background-position: center; }
.kiosk-main.kiosk-has-bg::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--vms-bg) 85%, transparent); }
.kiosk-main.kiosk-has-bg > * { position: relative; z-index: 1; }

/* ===========================================================================
   Printable HTML visitor badge (views/badge/card.php) — full-colour, used for
   on-screen preview + browser printing (the Dompdf badge is the bundled PDF).
   =========================================================================== */
.badge-page { background: #e9eaee; min-height: 100vh; padding: 28px 16px; }
.badge-toolbar { max-width: 330px; margin: 0 auto 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.bcard { --bc: #09090b; width: 330px; height: 550px; margin: 0 auto; background: #fff; border-radius: 14px;
  overflow: hidden; position: relative; text-align: center;
  box-shadow: 0 24px 60px -20px rgba(15,23,42,.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
/* Make sure colour bands actually print. */
.bcard, .bcard * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---- Shared leaf pieces (reused inside each template's own layout) ------- */
.bcard .b-logo { max-height: 36px; max-width: 160px; }
.bcard .b-mk { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.bcard .b-org { font-weight: 800; font-size: 15px; line-height: 1.05; }
.bcard .b-photo, .bcard .b-photo-ph { width: 150px; height: 168px; border-radius: 12px; border: 3px solid var(--bc);
  margin: 0 auto; display: block; object-fit: cover; object-position: center 28%; background: #eef2f7; }
.bcard .b-photo-ph { display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 58px; }
.bcard .b-name { font-size: 25px; font-weight: 800; color: #18181b; margin-top: 14px; letter-spacing: -.01em; line-height: 1.05; overflow-wrap: anywhere; }
.bcard .b-role { align-self: center; display: inline-block; background: var(--rc, var(--bc)); color: #fff; font-weight: 800; font-size: 15px;
  letter-spacing: .1em; text-transform: uppercase; padding: 9px 32px; border-radius: 8px; margin-top: 12px; }
.bcard .b-company { align-self: center; font-size: 12px; color: #71717a; margin-top: 9px; letter-spacing: .02em; }
/* Centred as a block, with labels right-aligned so the colons line up. */
.bcard .b-fields { align-self: center; text-align: left; display: inline-block; margin-top: 18px; }
.bcard .b-fields .b-row { display: flex; font-size: 13.5px; margin-bottom: 9px; }
.bcard .b-fields .k { width: 54px; text-align: right; font-weight: 800; color: var(--bc); text-transform: uppercase;
  letter-spacing: .05em; font-size: 12px; padding-top: 1px; }
.bcard .b-fields .sep { color: #b6c0cc; margin: 0 9px; }
.bcard .b-fields .v { color: #475569; min-width: 0; overflow-wrap: anywhere; }
/* Big, scan-friendly barcode (taller bars, wide quiet zone). */
.bcard .b-qr { width: 84px; height: 84px; margin: 10px auto 2px; display: block; flex: 0 0 auto; }
.bcard .b-ref { font-size: 11px; letter-spacing: 3px; color: #64748b; }

/* ======================= Template 1 — Classic banner ===================== */
.bcard.t1 { --bc: #09090b; }
.t1 .t1-head { background: var(--bc); color: #fff; padding: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.t1 .t1-body { box-sizing: border-box; height: 486px; padding: 22px 24px 64px; display: flex; flex-direction: column; }
.t1 .t1-body .b-info { margin-top: 8px; }
.t1 .t1-foot { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bc); color: rgba(255,255,255,.78);
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase; padding: 9px 16px; display: flex; justify-content: space-between; }
.t1 .t1-foot b { color: #fff; }

/* ======================= Template 2 — Hero photo ========================= */
.bcard.t2 { --bc: #3b3f6b; }
.t2 .t2-hero { position: relative; height: 256px; background: linear-gradient(150deg,#cbd5e1,#94a3b8); }
.t2 .t2-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.t2 .t2-hero .b-photo-ph { width: 100%; height: 100%; border: 0; border-radius: 0; background: linear-gradient(150deg,#cbd5e1,#94a3b8); font-size: 92px; }
.t2 .t2-swoosh { position: absolute; left: 0; right: 0; bottom: -1px; height: 76px; background: #fff; border-top-right-radius: 100px; z-index: 1; }
.t2 .t2-brand { position: absolute; left: 22px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 9px; }
.t2 .t2-brand .b-mk { background: var(--bc); }
.t2 .t2-brand .b-org { color: var(--bc); font-size: 13.5px; text-align: left; }
.t2 .t2-body { box-sizing: border-box; height: 294px; padding: 4px 26px 22px; display: flex; flex-direction: column; position: relative; z-index: 2; }
.t2 .b-name { color: var(--bc); font-size: 27px; margin-top: 4px; }
.t2 .b-fields { margin-top: 14px; }
.t2 .t2-body .b-qr { margin-top: auto; }
.t2 .t2-corner { position: absolute; right: 0; bottom: 0; width: 92px; height: 42px; background: var(--bc); border-top-left-radius: 56px; z-index: 0; }

/* ===================== Template 3 — Circular portrait ==================== */
.bcard.t3 { --bc: #1d4ed8; }
.t3 .t3-top { background: var(--bc); height: 132px; }
.t3 .t3-top .b-org { color: #fff; font-size: 16px; padding-top: 26px; }
.t3 .t3-top .b-logo { margin-top: 24px; }
.t3 .t3-body { box-sizing: border-box; height: 418px; padding: 0 24px 0; display: flex; flex-direction: column; }
.t3 .t3-photowrap { margin-top: -82px; }
.t3 .b-photo, .t3 .b-photo-ph { width: 150px; height: 150px; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 0 0 3px var(--bc); object-position: center 25%; }
.t3 .b-name { color: var(--bc); margin-top: 16px; }
.t3 .t3-body .b-info { margin-top: 14px; }
.t3 .t3-foot { background: var(--bc); color: rgba(255,255,255,.82); margin: auto -24px 0; padding: 9px 18px;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase; display: flex; justify-content: space-between; }
.t3 .t3-foot b { color: #fff; }

/* ======================== Template 4 — Side rail ========================= */
.bcard.t4 { --bc: #0f766e; display: flex; text-align: center; }
.t4 .t4-rail { width: 64px; flex: 0 0 64px; background: var(--bc); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 0; }
.t4 .t4-rail .b-mk { width: 36px; height: 36px; font-size: 19px; }
.t4 .t4-vorg { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; font-size: 12px; }
.t4 .t4-rail .b-num { writing-mode: vertical-rl; font-size: 8px; letter-spacing: .14em; opacity: .85; }
.t4 .t4-main { box-sizing: border-box; flex: 1 1 auto; min-width: 0; height: 550px; padding: 26px 18px 22px;
  display: flex; flex-direction: column; }
.t4 .b-photo, .t4 .b-photo-ph { width: 134px; height: 152px; border-radius: 10px; }
.t4 .b-name { color: var(--bc); font-size: 22px; }
.t4 .b-fields { margin-top: 14px; }
.t4 .b-info { flex-direction: column; gap: 10px; margin-top: 14px; }
.t4 .b-info .b-fields { max-width: 100%; }
.t4 .b-info .b-qr { width: 70px; height: 70px; }
.t4 .t4-note { font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; margin-top: 8px; }

/* ========================= Template 5 — Minimal ========================== */
.bcard.t5 { --bc: #b91c1c; }
.t5 .t5-body { box-sizing: border-box; height: 550px; padding: 28px 28px 24px; display: flex; flex-direction: column; }
.t5 .t5-top { display: flex; align-items: center; justify-content: space-between; }
.t5 .t5-top .b-org { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: #18181b; }
.t5 .t5-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bc); flex: 0 0 auto; }
.t5 .t5-rule { height: 2px; background: var(--bc); margin: 12px 0 24px; }
.t5 .b-photo, .t5 .b-photo-ph { width: 142px; height: 160px; border-radius: 10px; border: 1px solid #e5e7eb; }
.t5 .b-name { color: var(--bc); font-size: 24px; }
.t5 .b-role { background: transparent; color: var(--rc, var(--bc)); border: 1.5px solid var(--rc, var(--bc)); }
.t5 .b-fields .k { color: #18181b; }
.t5 .t5-body .b-qr { margin-top: auto; }
.t5 .t5-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef0f2;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8;
  display: flex; justify-content: space-between; }
.t5 .t5-foot b { color: #475569; }

/* ========================= Template 6 — Diagonal ========================= */
.bcard.t6 { --bc: #db2777; }
.t6 .t6-head { background: var(--bc); height: 122px; padding: 20px 22px; color: #fff; display: flex; align-items: flex-start; gap: 9px;
  position: relative; z-index: 1; clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%); }
.t6 .t6-head .b-org { color: #fff; }
.t6 .t6-body { box-sizing: border-box; height: 424px; margin-top: -36px; padding: 0 24px 14px;
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.t6 .b-photo, .t6 .b-photo-ph { position: relative; z-index: 2; width: 116px; height: 126px;
  border: 4px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.16); }
.t6 .b-name { color: var(--bc); margin-top: 12px; }
.t6 .t6-body .b-qr { margin-top: auto; }

/* ======================= Template 7 — Floating card ====================== */
.bcard.t7 { --bc: #0e7490; background: var(--bc); }
.t7 .t7-head { color: #fff; padding: 16px 18px 12px; display: flex; align-items: center; gap: 9px; }
.t7 .t7-head .b-org { color: #fff; }
.t7 .t7-inner { box-sizing: border-box; background: #fff; border-radius: 16px; margin: 0 16px 16px; height: 460px;
  padding: 24px 20px 20px; box-shadow: 0 12px 30px rgba(0,0,0,.28); display: flex; flex-direction: column; align-items: center; }
.t7 .b-name { color: #18181b; }
.t7 .t7-inner .b-qr { margin-top: auto; }

/* ========================= Template 8 — Ticket =========================== */
.bcard.t8 { --bc: #c2410c; display: flex; flex-direction: column; }
.t8 .t8-head { background: var(--bc); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 9px; }
.t8 .t8-head .b-org { color: #fff; }
.t8 .t8-main { flex: 1 1 auto; padding: 14px 24px 4px; display: flex; flex-direction: column; align-items: center; }
.t8 .b-photo, .t8 .b-photo-ph { width: 108px; height: 120px; }
.t8 .b-name { color: var(--bc); }
.t8 .t8-perf { border-top: 2px dashed #cbd5e1; margin: 6px 22px 0; position: relative; }
.t8 .t8-perf::before, .t8 .t8-perf::after { content: ""; position: absolute; top: -10px; width: 18px; height: 18px;
  border-radius: 50%; background: #e9eaee; }
.t8 .t8-perf::before { left: -31px; }
.t8 .t8-perf::after { right: -31px; }
.t8 .t8-stub { padding: 10px 24px 12px; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; }
.t8 .t8-stub .b-qr { width: 66px; height: 66px; margin: 0; }
.t8 .t8-stub .t8-foot { text-align: left; line-height: 1.6; }
.t8 .t8-foot { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; }

/* ---- Badge accent colour input ------------------------------------------ */
.form-color-av { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--vms-line);
  border-radius: 10px; background: var(--vms-surface); cursor: pointer; vertical-align: middle; }

/* Preset colour swatches (theme picker quick-select). */
.color-presets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.color-presets button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--vms-line); cursor: pointer; padding: 0; transition: transform .08s; }
.color-presets button:hover { transform: scale(1.12); }
.color-presets .tc0 { background: #09090b; }
.color-presets .tc1 { background: #2563eb; }
.color-presets .tc2 { background: #4f46e5; }
.color-presets .tc3 { background: #7c3aed; }
.color-presets .tc4 { background: #0d9488; }
.color-presets .tc5 { background: #059669; }
.color-presets .tc6 { background: #e11d48; }
.color-presets .tc7 { background: #ea580c; }

/* ---- Template chooser gallery (views/badge/preview.php) ----------------- */
.badge-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badge-bar .swatches { display: flex; gap: 8px; }
.badge-bar .swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--vms-line); cursor: pointer; padding: 0; }
.badge-bar .swatch.is-on { box-shadow: 0 0 0 2px var(--vms-ink); }
.badge-bar .swatch.sw0 { background: #09090b; }
.badge-bar .swatch.sw1 { background: #1e3a8a; }
.badge-bar .swatch.sw2 { background: #4338ca; }
.badge-bar .swatch.sw3 { background: #0f766e; }
.badge-bar .swatch.sw4 { background: #047857; }
.badge-bar .swatch.sw5 { background: #b91c1c; }
.badge-gallery { display: flex; flex-wrap: wrap; gap: 30px; }
.badge-gallery .pick { width: 330px; }
.badge-gallery .pick-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 12px; }
.badge-gallery .pick-name { font-weight: 700; font-size: 13.5px; color: var(--vms-ink); }
.badge-gallery .pick .bcard { box-shadow: 0 12px 34px -14px rgba(15,23,42,.3); }
.badge-gallery .pick.is-active .bcard { outline: 3px solid var(--vms-ink); outline-offset: 3px; }

/* ---- Print: one full-bleed card per page, exactly like the PDF ---------- */
@media print {
  html, body, .badge-page { background: #fff !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  .badge-toolbar { display: none !important; }
  @page { size: 3.4375in 5.7292in; margin: 0; }
  .bcard { box-shadow: none; border-radius: 0; margin: 0; width: 3.4375in; height: 5.7292in; }
}

/* ---- Theme toggle (topbar) ------------------------------------------------ */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--vms-line); border-radius: 10px; background: var(--vms-surface); color: var(--vms-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--vms-ink); border-color: var(--vms-faint); }
.theme-toggle .bi-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .bi-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .bi-moon-stars { display: none; }
}

/* ---- Two-factor authentication ------------------------------------------- */
.otp-input { font-size: 1.4rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--vms-line); border-radius: 12px; line-height: 0; }
.qr-box img, .qr-box svg { width: 180px; height: 180px; }
.secret-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .06em;
  padding: .4rem .6rem; background: var(--vms-zinc-100); border-radius: 8px; word-break: break-all; }

/* ---- Badge details + QR code side by side -------------------------------- */
.bcard .b-info { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.bcard .b-info .b-fields { margin-top: 0; }
.bcard .b-info .b-qr { width: 74px; height: 74px; margin: 0; }

/* Long visitor names: smaller type, still at most two lines */
.bcard .b-name.b-name-long { font-size: 20px; line-height: 1.1; }
/* Details beside the QR code stay on one line each; long values end in "…" */
.bcard .b-info .b-fields { min-width: 0; max-width: 178px; }
.bcard .b-info .b-fields .b-row { margin-bottom: 7px; }
.bcard .b-info .b-fields .v { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.bcard .b-company { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Pre-registration check-in QR code ------------------------------------ */
.qr-invite { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: 1rem; }
.qr-invite-left { align-items: flex-start; }
.qr-invite-code { width: 180px; height: 180px; padding: 6px; background: #fff; border: 1px solid var(--vms-line); border-radius: 12px; }

/* ---- Camera QR scanner overlay --------------------------------------------- */
.qr-scan-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(9, 9, 11, .88);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.qr-scan-box { position: relative; width: min(420px, 92vw); aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #000; }
.qr-scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-scan-frame { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, .92); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28); pointer-events: none; }
.qr-scan-msg { color: #fff; font-size: 15px; margin: 0; text-align: center; }
.scan-cam { flex: 0 0 auto; }
.kiosk-scan { width: 100%; justify-content: center; font-size: 1.05rem; padding: .95rem 1rem; }
.kiosk-or { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--vms-faint); font-size: 12px;
  text-transform: uppercase; letter-spacing: .1em; }
.kiosk-or::before, .kiosk-or::after { content: ""; flex: 1; height: 1px; background: var(--vms-line); }

/* ---- Kiosk device pairing code --------------------------------------------- */
.pair-code-box { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; margin-bottom: 1rem;
  background: var(--vms-primary-soft); border: 1px solid color-mix(in srgb, var(--vms-primary) 25%, transparent); border-radius: 12px; }
.pair-code-label { font-size: 12px; font-weight: 600; color: var(--vms-muted); }
.pair-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.9rem; font-weight: 700; letter-spacing: .12em; color: var(--vms-ink); }

/* ---- Host approval ---------------------------------------------------------- */
.approval-visitor { display: flex; align-items: center; gap: 1rem; }
.approval-name { font-size: 1.25rem; font-weight: 700; color: var(--vms-ink); }
.approval-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.approval-actions .btn-av { flex: 1 1 140px; justify-content: center; padding: .8rem 1rem; }
.result-box .result-icon.result-icon-rose { background: var(--vms-rose-soft); color: var(--vms-rose); }
.result-box .result-icon.result-icon-muted { background: var(--vms-zinc-100); color: var(--vms-muted); }
.approval-inline { display: inline-flex; gap: .35rem; }

.approval-banner { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .9rem 1.1rem; margin-bottom: 1rem;
  background: var(--vms-amber-soft); border: 1px solid var(--vms-amber-line); border-radius: 12px; color: var(--vms-ink-soft); }
.approval-banner > i { font-size: 1.3rem; color: var(--vms-amber); }
.approval-banner-declined { background: var(--vms-rose-soft); border-color: var(--vms-rose-line); }
.approval-banner-declined > i { color: var(--vms-rose); }

/* ---- Visitor types ---------------------------------------------------------- */
.type-pill { --tc: var(--vms-ink); display: inline-block; padding: .2rem .55rem; border-radius: 6px; background: var(--tc);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.type-rules { display: flex; flex-wrap: wrap; gap: .3rem .8rem; color: var(--vms-muted); font-size: 12.5px; }
.type-rules i { margin-right: 2px; }
.agreement-box[data-type-agreement] { white-space: pre-line; }
.cf-field[hidden] { display: none !important; }

/* ---- CSV import -------------------------------------------------------------- */
.import-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.import-choice { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border: 1px solid var(--vms-line);
  border-radius: 10px; cursor: pointer; font-size: 13.5px; background: var(--vms-surface); }
.import-choice:has(input:checked) { border-color: var(--vms-primary); background: var(--vms-primary-soft); }
.import-summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.import-issues { margin: .75rem 0 0; padding-left: 1.1rem; font-size: 13px; color: var(--vms-ink-soft); }

/* ---- Lobby TV screen ---------------------------------------------------------- */
.lobby-body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: #fff; font-family: var(--vms-font);
  background: radial-gradient(1100px 600px at 85% -10%, color-mix(in srgb, var(--vms-primary) 55%, transparent) 0%, transparent 60%),
              linear-gradient(160deg, var(--vms-sidebar-bg) 0%, var(--vms-sidebar-bg2) 100%); }
.lobby-top { display: flex; align-items: center; justify-content: space-between; padding: 2.5vh 4vw; }
.lobby-brand { display: flex; align-items: center; gap: 14px; font-size: clamp(18px, 1.6vw, 30px); font-weight: 700; }
.lobby-logo { max-height: 6vh; max-width: 26vw; object-fit: contain; }
.lobby-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--vms-primary); display: grid; place-items: center; font-size: 26px; }
.lobby-clock { text-align: right; }
.lobby-clock .k-time { font-size: clamp(28px, 3.4vw, 64px); font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.lobby-clock .k-date { font-size: clamp(12px, 1vw, 18px); color: rgba(255,255,255,.65); margin-top: 6px; text-transform: uppercase; letter-spacing: .12em; }
.lobby-main { flex: 1 1 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 4vw; padding: 2vh 4vw 4vh; align-items: center; }
.lobby-eyebrow { font-size: clamp(14px, 1.2vw, 22px); color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .16em; margin: 0 0 1.2vh; font-weight: 600; }
.lobby-hero h1 { font-size: clamp(32px, 4.2vw, 84px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 0; }
.lobby-stats { display: flex; gap: 3vw; margin-top: 5vh; }
.lobby-stats .n { display: block; font-size: clamp(32px, 3.6vw, 72px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.lobby-stats .l { display: block; margin-top: 8px; font-size: clamp(12px, 1vw, 18px); color: rgba(255,255,255,.68); }
.lobby-panels { display: flex; flex-direction: column; gap: 2.5vh; }
.lobby-panel { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 2.6vh 2vw; backdrop-filter: blur(6px); }
.lobby-panel h2 { font-size: clamp(16px, 1.3vw, 26px); font-weight: 700; margin: 0 0 1.6vh; display: flex; align-items: center; gap: 10px; }
.lobby-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.2vh; }
.lobby-list li { display: flex; align-items: baseline; gap: 14px; font-size: clamp(15px, 1.3vw, 26px); }
.lobby-list .t { width: 6.5em; flex: 0 0 auto; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.lobby-list .who { font-weight: 700; }
.lobby-list .host { color: rgba(255,255,255,.65); }
.lobby-empty { color: rgba(255,255,255,.6); margin: 0; font-size: clamp(14px, 1.1vw, 22px); }
.lobby-foot { padding: 2vh 4vw; font-size: clamp(12px, .95vw, 18px); color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 900px) { .lobby-main { grid-template-columns: 1fr; } }
.ms-switch-indent { margin-top: -.25rem; }
.pass-qr { display: flex; justify-content: center; }
.form-grid.gap-sm { gap: .75rem; }
.doc-add { border-top: 1px solid var(--vms-line-soft); }
.doc-add-grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.4fr; gap: .75rem; }
@media (max-width: 900px) { .doc-add-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .doc-add-grid { grid-template-columns: 1fr; } }
.file-drop-sm { min-height: 38px; padding: .3rem .55rem; }
.file-drop-sm .file-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
.form-control-av:disabled, .form-select-av:disabled { background: var(--vms-zinc-100); color: var(--vms-muted); cursor: not-allowed; box-shadow: none; }
.form-switch-av input:disabled + .track { opacity: .5; }

/* ---- Insights ------------------------------------------------------------------ */
.seg-control { display: inline-flex; padding: 3px; border: 1px solid var(--vms-line); border-radius: var(--vms-radius); background: var(--vms-surface); box-shadow: var(--vms-shadow-sm); }
.seg-control a { padding: .35rem .75rem; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--vms-muted); white-space: nowrap; }
.seg-control a:hover { color: var(--vms-ink); }
.seg-control a.active { background: var(--vms-primary-soft); color: var(--vms-primary); font-weight: 600; }
.chart-box-sm { height: 260px; }
.heatmap { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(18px, 1fr)); gap: 4px; align-items: center; overflow-x: auto; }
.hm-hour { font-size: 11px; color: var(--vms-muted); text-align: center; }
.hm-day { font-size: 12.5px; color: var(--vms-muted); font-weight: 500; }
.hm-cell { display: block; height: 24px; border-radius: 5px; background: var(--vms-zinc-100); }
.hm-1 { background: color-mix(in srgb, var(--vms-primary) 22%, var(--vms-surface)); }
.hm-2 { background: color-mix(in srgb, var(--vms-primary) 45%, var(--vms-surface)); }
.hm-3 { background: color-mix(in srgb, var(--vms-primary) 70%, var(--vms-surface)); }
.hm-4 { background: var(--vms-primary); }
.hm-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--vms-muted); }
.hm-legend .hm-cell { width: 16px; height: 16px; }
.rank-row { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) 1fr 40px; align-items: center; gap: 12px; padding: .7rem 1.25rem; border-bottom: 1px solid var(--vms-line-soft); }
.rank-row:last-child { border-bottom: 0; }
.rank-n { color: var(--vms-faint); font-size: 12.5px; font-weight: 600; }
.rank-name { font-weight: 500; color: var(--vms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 6px; border-radius: 6px; background: var(--vms-zinc-100); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--vms-primary); border-radius: 6px; }
.rank-c { text-align: right; font-weight: 600; color: var(--vms-ink-soft); }

/* ---- Solid red button (destructive confirmations) ---------------------------- */
.btn-av-solid-danger { background: #dc2626; color: #fff; box-shadow: var(--vms-shadow-sm); }
.btn-av-solid-danger:hover { background: #b91c1c; color: #fff; }
.av-modal-backdrop.is-neutral .av-modal-body .icon { background: var(--vms-primary-soft); color: var(--vms-primary); }
.av-modal-body .av-modal-note { font-size: 12.5px; color: var(--vms-rose); margin-top: .4rem; }

/* ---- Collapsible sidebar groups ---------------------------------------------- */
.nav-group-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0;
  cursor: pointer; text-align: left; padding: 0 .65rem; }
.nav-group-toggle .bi { font-size: 11px; transition: transform .15s; }
.nav-group-toggle:hover { color: rgba(255,255,255,.75); }
.nav-group.is-collapsed .nav-group-items { display: none; }
.nav-group.is-collapsed .nav-group-toggle .bi { transform: rotate(-90deg); }
.tab-nav-av a .bi { margin-right: 4px; }

/* ---- Checkboxes and radios (consistent on every browser and in dark mode) -------- */
.app-shell input[type=checkbox]:where(:not(.form-switch-av input)),
.public-body input[type=checkbox], .kiosk-body input[type=checkbox], .auth-split input[type=checkbox],
.app-shell input[type=radio], .public-body input[type=radio] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 18px; height: 18px; margin: 0; vertical-align: -3px; cursor: pointer;
  border: 1.5px solid var(--vms-faint); background: var(--vms-surface);
  display: inline-grid; place-content: center; transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.app-shell input[type=checkbox]:where(:not(.form-switch-av input)), .public-body input[type=checkbox],
.kiosk-body input[type=checkbox], .auth-split input[type=checkbox] { border-radius: 5px; }
.app-shell input[type=radio], .public-body input[type=radio] { border-radius: 50%; }
/* :is(…) keeps these above the per-layout base rules above (same specificity + one). */
input[type=checkbox]:checked,
:is(.app-shell, .public-body, .kiosk-body, .auth-split) input[type=checkbox]:checked { background: var(--vms-primary); border-color: var(--vms-primary); }
input[type=checkbox]:checked::after {
  content: ""; width: 10px; height: 10px; background: #fff;
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 85% 8%, 39% 69%);
}
input[type=radio]:checked, :is(.app-shell, .public-body) input[type=radio]:checked { border-color: var(--vms-primary); }
input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vms-primary); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-switch-av input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.form-check-av { display: inline-flex; align-items: flex-start; gap: .55rem; cursor: pointer; font-size: 14px; color: var(--vms-ink-soft); }
.form-check-av input { margin-top: 2px; }
.import-choice input[type=radio] { width: 16px; height: 16px; }

/* Native date/time pickers follow dark mode. */
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=datetime-local]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.75); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) input[type=date]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type=datetime-local]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.75); }
}
.table-av .nowrap { white-space: nowrap; }

.stat-hint { margin-top: .55rem; font-size: 12.5px; color: var(--vms-muted); font-weight: 500; }
.stat-hint.is-up { color: var(--vms-green); }
.stat-hint.is-down { color: var(--vms-muted); }
.stat-hint.is-warn { color: var(--vms-amber); }
.stat-card .stat-value { margin-top: .55rem; }

/* ---- Dashboard "today" lists -------------------------------------------------- */
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--vms-line-soft); }
.today-list li:last-child { border-bottom: 0; }
.today-main { display: flex; flex-direction: column; min-width: 0; color: inherit; }
.today-main:hover .cell-main { color: var(--vms-primary); }
.today-main .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-main .cell-main .badge-av { margin-left: 4px; font-size: 11px; }
.today-time { flex: 0 0 auto; font-size: 13px; color: var(--vms-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.today-time.is-late { color: var(--vms-amber); font-weight: 600; }
.empty-state.empty-sm { padding: 2rem 1rem; }
.text-primary-av { color: var(--vms-primary); }
.text-amber { color: var(--vms-amber); }

/* ---- Detail pages ------------------------------------------------------------- */
.head-avatar { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; }
.detail-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.detail-grid-2 dt, .detail-label { font-size: 12.5px; font-weight: 500; color: var(--vms-muted); margin: 0 0 .15rem; }
.detail-grid-2 dd { margin: 0; font-size: 14px; color: var(--vms-ink); overflow-wrap: anywhere; }
@media (max-width: 560px) { .detail-grid-2 { grid-template-columns: 1fr; } }
.badge-preview-qr { width: 88px; height: 88px; flex: 0 0 auto; border: 1px solid var(--vms-line); border-radius: 10px; padding: 4px; background: #fff; }
.badge-preview-no { font-size: 20px; font-weight: 700; color: var(--vms-ink); margin-bottom: .3rem; }
.timeline-v2 { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-v2 li { display: flex; gap: .75rem; position: relative; padding-bottom: 1rem; }
.timeline-v2 li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--vms-line); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px;
  background: var(--vms-primary-soft); color: var(--vms-primary); }
.timeline-v2 li.is-muted .tl-dot { background: var(--vms-zinc-100); color: var(--vms-muted); }
.timeline-v2 li.is-warn .tl-dot { background: var(--vms-amber-soft); color: var(--vms-amber); }
.tl-text { font-size: 14px; font-weight: 500; color: var(--vms-ink); }
.tl-meta { font-size: 12.5px; color: var(--vms-muted); }
.signature-view { max-width: 280px; background: #fff; border: 1px solid var(--vms-line); border-radius: 10px; }

/* ---- Toasts --------------------------------------------------------------------- */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast-av { background: var(--vms-surface); color: var(--vms-ink); border: 1px solid var(--vms-line); box-shadow: 0 12px 32px -12px rgba(9, 9, 11, .3);
  animation: toast-in .22s ease-out; transition: opacity .25s, transform .25s; }
.toast-av.flash-success .bi:first-child { color: var(--vms-green); }
.toast-av.flash-info .bi:first-child { color: var(--vms-primary); }
.toast-av.is-leaving { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast-av { animation: none; } }

.copy-field { display: flex; gap: 8px; }
.copy-field .form-control-av { min-width: 0; }
.btn-av.is-copied { color: var(--vms-green); border-color: var(--vms-green-line); }
.secret-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---- Sortable headers + clickable rows ------------------------------------------ */
.table-av th.sortable a { color: inherit; display: inline-flex; align-items: center; gap: .3rem; }
.table-av th.sortable a:hover, .table-av th.is-sorted a { color: var(--vms-ink); }
.table-av th.sortable .bi { font-size: 11px; opacity: .45; }
.table-av th.is-sorted .bi { opacity: 1; color: var(--vms-primary); }
.table-av tr[data-href] { cursor: pointer; }

/* ---- Notification bell ------------------------------------------------------------ */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; border: 2px solid var(--vms-surface); }
.bell-panel { width: 360px; max-width: calc(100vw - 24px); padding: 0; border: 1px solid var(--vms-line); border-radius: var(--vms-radius-lg);
  box-shadow: 0 18px 44px -14px rgba(9, 9, 11, .3); background: var(--vms-surface); overflow: hidden; }
.bell-head { padding: .8rem 1rem; font-weight: 600; font-size: 15px; color: var(--vms-ink); border-bottom: 1px solid var(--vms-line-soft); display: flex; align-items: center; gap: .5rem; }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item { display: flex; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--vms-line-soft); color: inherit; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--vms-zinc-50); color: inherit; }
.bell-item.is-new { background: var(--vms-primary-soft); }
.bell-item.is-new .bell-title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: .4rem; border-radius: 50%; background: var(--vms-primary); vertical-align: middle; }
.bell-icon { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.bell-icon.is-amber { background: var(--vms-amber-soft); color: var(--vms-amber); }
.bell-icon.is-rose { background: var(--vms-rose-soft); color: var(--vms-rose); }
.bell-icon.is-muted { background: var(--vms-zinc-100); color: var(--vms-muted); }
.bell-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--vms-ink); }
.bell-time { font-weight: 400; color: var(--vms-faint); font-size: 12px; margin-left: 4px; }
.bell-text { display: block; font-size: 13px; color: var(--vms-muted); line-height: 1.4; }
.bell-empty { padding: 2rem 1rem; text-align: center; color: var(--vms-muted); display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.bell-empty .bi { font-size: 26px; color: var(--vms-green); }

/* ---- Row action menu ("⋯") ----------------------------------------------------------- */
.row-menu { position: relative; display: inline-block; }
.row-menu-toggle { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--vms-muted);
  display: inline-grid; place-items: center; font-size: 17px; cursor: pointer; }
.row-menu-toggle:hover, .row-menu.open .row-menu-toggle { background: var(--vms-zinc-100); color: var(--vms-ink); border-color: var(--vms-line); }
.row-menu-panel { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; padding: 4px;
  background: var(--vms-surface); border: 1px solid var(--vms-line); border-radius: 10px; box-shadow: 0 14px 32px -12px rgba(9, 9, 11, .28); }
.row-menu.drop-up .row-menu-panel { top: auto; bottom: calc(100% + 4px); }
.row-menu.open .row-menu-panel { display: block; }
.row-menu-panel form { margin: 0; }
.row-menu-item { display: flex !important; align-items: center; gap: .55rem; width: 100%; height: auto !important; padding: .5rem .65rem !important;
  border: 0 !important; border-radius: 6px; background: transparent !important; color: var(--vms-ink-soft) !important; font-size: 13.5px; text-align: left; cursor: pointer; }
.row-menu-item:hover { background: var(--vms-zinc-100) !important; color: var(--vms-ink) !important; }
.row-menu-item .bi { font-size: 15px; width: 16px; }
.row-menu-item.is-danger { color: #dc2626 !important; }
.row-menu-item.is-danger:hover { background: var(--vms-rose-soft) !important; }
.table-av td:has(.row-menu) { width: 1%; text-align: right; }

/* ---- Mobile card tables ----------------------------------------------------------------- */
@media (max-width: 640px) {
  .table-av.table-cards thead { display: none; }
  .table-av.table-cards, .table-av.table-cards tbody, .table-av.table-cards tr, .table-av.table-cards td { display: block; width: 100%; }
  .table-av.table-cards tbody tr { padding: .75rem 1rem; border-bottom: 1px solid var(--vms-line); }
  .table-av.table-cards tbody tr:last-child { border-bottom: 0; }
  .table-av.table-cards tbody td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table-av.table-cards tbody td::before { content: attr(data-label); color: var(--vms-muted); font-size: 12.5px; text-align: left; flex: 0 0 auto; }
  .table-av.table-cards tbody td:first-child { display: block; text-align: left; padding-bottom: .35rem; }
  .table-av.table-cards tbody td:first-child::before { content: none; }
  .table-av.table-cards tbody td:not([data-label])::before, .table-av.table-cards tbody td[data-label=""]::before { content: none; }
  .table-av.table-cards td:has(.row-menu) { width: 100%; justify-content: flex-end; }
  .table-responsive { overflow-x: visible; }
  .table-av.table-cards .cell-stack { text-align: right; min-width: 0; }
}
.row-menu-item { justify-content: flex-start !important; text-transform: none; letter-spacing: 0; min-height: 0; }
@media (max-width: 640px) { .table-av.table-cards td:has(.row-menu)::before { content: none; } }

/* ---- Full-height app layout --------------------------------------------------------
   The body is a column: the optional demo banner takes its own height and the app
   shell fills exactly the rest, so the sidebar footer (signed-in user) is always
   visible and only the content area scrolls. dvh = visible height on mobile. */
.app-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app-body > .demo-banner { flex: 0 0 auto; }
.app-body > .app-shell { flex: 1 1 auto; min-height: 0; height: auto; }
.app-body .app-sidebar, .app-body .app-main { height: auto; align-self: stretch; min-height: 0; }
.app-body .sidebar-nav { min-height: 0; }
@media (max-width: 991.98px) {
  .app-body .app-sidebar { height: auto; }
}

/* Visitor profile: visit summary figures */
.visit-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--vms-line-soft); border-bottom: 1px solid var(--vms-line-soft); }
.visit-summary > div { background: var(--vms-surface); padding: .9rem 1.25rem; display: flex; flex-direction: column; }
.vs-value { font-size: 1.35rem; font-weight: 600; color: var(--vms-ink); line-height: 1.2; }
.vs-label { font-size: 12.5px; color: var(--vms-muted); }

/* ---- System: health, tasks, error log ---------------------------------------------------- */
.min-w-0 { min-width: 0; }
.health-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; }
.health-icon.is-green { background: var(--vms-green-soft, #ecfdf5); color: var(--vms-green); }
.health-icon.is-amber { background: var(--vms-amber-soft); color: var(--vms-amber); }
.health-icon.is-rose { background: var(--vms-rose-soft); color: var(--vms-rose); }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 991px) { .health-grid { grid-template-columns: 1fr; } }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; border-top: 1px solid var(--vms-line-soft); }
.health-list li:first-child { border-top: 0; }
.health-label { font-size: 13.5px; color: var(--vms-ink); font-weight: 500; overflow-wrap: anywhere; }
.health-value { font-size: 12.5px; color: var(--vms-muted); overflow-wrap: anywhere; }
.health-list .badge-av { flex: 0 0 auto; }
.log-view { margin: 0; max-height: 560px; overflow: auto; padding: 1rem 1.25rem; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--vms-ink-soft); background: var(--vms-zinc-50); border-top: 1px solid var(--vms-line-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.log-view span { display: block; }
.log-view .is-error { color: var(--vms-rose); }
.log-view .is-warn { color: var(--vms-amber); }
.maint-page { max-width: 460px; margin: 4rem auto; text-align: center; padding: 0 1rem; }
.maint-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; background: var(--vms-primary-soft); color: var(--vms-primary); margin-bottom: 1.25rem; }
.maint-page h1 { font-size: 1.5rem; font-weight: 600; color: var(--vms-ink); margin-bottom: .5rem; }
.maint-page p { color: var(--vms-muted); margin-bottom: 1.5rem; }
.tab-nav-av { overflow-x: auto; scrollbar-width: none; }
.tab-nav-av::-webkit-scrollbar { display: none; }
.tab-nav-av a { white-space: nowrap; flex: 0 0 auto; }
.mail-preview { display: block; width: 100%; height: 70vh; border: 0; background: #fff; }
.text-rose-av { color: var(--vms-rose) !important; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Kiosk / phone check-in language buttons */
.kiosk-lang { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--vms-line); border-radius: 999px; background: var(--vms-surface); box-shadow: var(--vms-shadow-sm); margin-left: auto; margin-right: 1.25rem; }
.kiosk-lang a { padding: .4rem .9rem; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--vms-muted); text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.kiosk-lang a.active { background: var(--vms-primary); color: #fff; }
@media (max-width: 640px) { .kiosk-lang { margin-right: .5rem; } .kiosk-lang a { padding: .35rem .65rem; font-size: 13px; } .kiosk-top .kiosk-clock { display: none; } }

/* Label-printer badge (screen preview; prints at the label size via @page) */
.label-sheet { display: flex; justify-content: center; padding: 2rem 1rem; }
.label-sheet .lb { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); border-radius: 2mm; }
@media print { .label-sheet { padding: 0; display: block; } .label-sheet .lb { box-shadow: none; border-radius: 0; } }

/* Touchless: the visitor's phone badge */
.phone-badge .kiosk-title { margin-bottom: .25rem; }
.phone-qr { width: 200px; max-width: 70%; margin: 1.25rem auto .5rem; padding: 12px; background: #fff; border: 1px solid var(--vms-line); border-radius: 16px; }
.phone-qr svg { width: 100%; height: auto; display: block; }
.phone-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1.25rem 0 1rem; text-align: center; }
.phone-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--vms-muted); font-weight: 600; }
.phone-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--vms-ink); font-size: 14px; overflow-wrap: anywhere; }
.result-icon.is-muted { background: var(--vms-zinc-100); color: var(--vms-muted); }
.kiosk-lang-sm { margin-right: .75rem; box-shadow: none; }
.kiosk-lang-sm a { min-height: 28px; padding: .2rem .6rem; font-size: 12.5px; font-weight: 600; }

/* ---- Evacuation: live banner, roll-call, broadcast -------------------------------------- */
.evac-live { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--vms-rose-line, #fecdd3); background: var(--vms-rose-soft); border-radius: var(--vms-radius-lg); color: var(--vms-ink); text-decoration: none; flex-wrap: wrap; }
.evac-live:hover { color: var(--vms-ink); }
.evac-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--vms-rose); display: inline-block; box-shadow: 0 0 0 0 rgba(225, 29, 72, .5); animation: evacPulse 1.6s infinite; flex: 0 0 auto; }
.evac-pulse.sm { width: 7px; height: 7px; vertical-align: middle; }
@keyframes evacPulse { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .5); } 70% { box-shadow: 0 0 0 9px rgba(225, 29, 72, 0); } 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); } }
@media (prefers-reduced-motion: reduce) { .evac-pulse { animation: none; } }
.evac-broadcast { border-color: var(--vms-rose-line, #fecdd3); }
.rollcall-count { font-size: 2rem; font-weight: 700; line-height: 1; text-align: right; }
.rollcall-bar { height: 10px; border-radius: 99px; background: var(--vms-zinc-100); overflow: hidden; }
.rollcall-bar span { display: block; height: 100%; background: var(--vms-green); border-radius: 99px; transition: width .3s ease; }
.rollcall-list { display: flex; flex-direction: column; gap: .5rem; }
.rollcall-list[data-filter-state="missing"] .rollcall-person.is-safe { display: none; }
.rollcall-person { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 64px; padding: .75rem 1rem; text-align: left; border: 1px solid var(--vms-line); border-radius: var(--vms-radius-lg); background: var(--vms-surface); color: var(--vms-ink); box-shadow: var(--vms-shadow-sm); cursor: pointer; transition: background .15s, border-color .15s; }
.rollcall-person:disabled { cursor: default; }
.rollcall-person .rc-check { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--vms-line); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex: 0 0 auto; font-size: 18px; }
.rollcall-person .rc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rollcall-person .rc-name { font-weight: 600; font-size: 15px; }
.rollcall-person .rc-sub { font-size: 12.5px; color: var(--vms-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rollcall-person .rc-state { font-size: 12.5px; color: var(--vms-muted); white-space: nowrap; }
.rollcall-person.is-safe { background: var(--vms-green-soft); border-color: var(--vms-green-line, #bbf7d0); }
.rollcall-person.is-safe .rc-check { background: var(--vms-green); border-color: var(--vms-green); color: #fff; }
.rollcall-person.is-safe .rc-state { color: var(--vms-green); font-weight: 600; }

.btn-av:disabled, .btn-av[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
@media (max-width: 520px) {
  .public-nav .btn-av-ghost { display: none; }
  .kiosk-lang-sm { margin-right: .4rem; }
  .kiosk-lang-sm a { padding: .2rem .45rem; }
}
@media (max-width: 350px) { .kiosk-lang-sm { display: none; } }
/* Bootstrap's .text-dark is near-black; follow the theme's ink colour instead. */
.text-dark { color: var(--vms-ink) !important; }

/* ---- Loading feedback: busy buttons, page progress bar, shimmer placeholders ------- */
.btn-av.is-loading { position: relative; pointer-events: none; opacity: .85; }
.btn-av.is-loading > .bi { visibility: hidden; }
.btn-av.is-loading::before { content: ""; position: absolute; left: .85em; top: 50%; width: 1em; height: 1em; margin-top: -.5em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin-av .7s linear infinite; }
.btn-av.is-loading:not(:has(> .bi)) { padding-left: 2.3em; }
@keyframes spin-av { to { transform: rotate(360deg); } }
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s; }
.nav-progress::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--vms-primary); border-radius: 0 3px 3px 0; animation: navbar-av 1.1s ease-in-out infinite; }
body.is-navigating .nav-progress { opacity: 1; }
@keyframes navbar-av { 0% { left: -40%; width: 40%; } 60% { left: 50%; width: 45%; } 100% { left: 100%; width: 20%; } }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after { content: ""; position: absolute; inset: 0; border-radius: var(--vms-radius); pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--vms-zinc-100) 80%, transparent) 50%, transparent 100%), var(--vms-zinc-50);
  background-size: 200% 100%, auto; animation: shimmer-av 1.3s ease-in-out infinite; }
@keyframes shimmer-av { 0% { background-position: 150% 0, 0 0; } 100% { background-position: -50% 0, 0 0; } }
.shimmer-line { height: .8em; border-radius: 4px; background: var(--vms-zinc-100); margin: .45em 0; }
@media (prefers-reduced-motion: reduce) { .btn-av.is-loading::before, .nav-progress::before, .shimmer::after { animation-duration: 3s; } }

/* ---- Desktop: collapsible sidebar (icon rail), remembered in a cookie ------------- */
.sidebar-collapse-btn { display: none; background: none; border: 0; padding: 0; width: 32px; height: 32px; border-radius: 8px; color: var(--vms-muted); font-size: 18px; align-items: center; justify-content: center; }
.sidebar-collapse-btn:hover { background: var(--vms-zinc-100); color: var(--vms-ink); }
@media (min-width: 992px) {
  .sidebar-collapse-btn { display: inline-flex; }
  .app-sidebar { transition: width .2s ease; }
  .app-shell.sidebar-collapsed .app-sidebar { width: 68px; }
  .app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
  .app-shell.sidebar-collapsed .sidebar-brand .brand-text { display: none; }
  .app-shell.sidebar-collapsed .sidebar-brand .brand-logo { max-width: 40px; }
  .app-shell.sidebar-collapsed .sidebar-nav { padding: 1rem .55rem; }
  .app-shell.sidebar-collapsed .nav-group { margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px solid rgba(255,255,255,.07); }
  .app-shell.sidebar-collapsed .nav-group-label { display: none; }
  .app-shell.sidebar-collapsed .nav-group.is-collapsed .nav-group-items { display: block; }
  .app-shell.sidebar-collapsed .nav-link-av { justify-content: center; padding: 9px 0; position: relative; }
  .app-shell.sidebar-collapsed .nav-link-av > span { display: none; }
  .app-shell.sidebar-collapsed .nav-link-av .bi { font-size: 17px; width: auto; }
  .app-shell.sidebar-collapsed .nav-link-av .nav-badge { position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; font-size: 9px; padding: 0 4px; margin: 0; }
  .app-shell.sidebar-collapsed .sidebar-user > div { flex-direction: column; gap: .4rem !important; }
  .app-shell.sidebar-collapsed .sidebar-user .min-w-0 { display: none !important; }
}

/* ---- Person cells (avatar initials + name + sub-line) in tables ------------------- */
.person-cell { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person-dot { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--vms-primary); background: var(--vms-primary-soft); }
.person-dot.is-muted { color: var(--vms-muted); background: var(--vms-zinc-100); }
.table-av td.nowrap, .table-av th.nowrap { white-space: nowrap; }
.table-av td:has(> a.cell-main:only-child) { white-space: nowrap; }
.person-dot.sm { width: 26px; height: 26px; font-size: 10px; }

/* ---- Stat cards (final): icon tile + label / value / hint, any number per row ------ */
.stats-grid { display: grid; gap: .85rem; margin-bottom: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.stat-card { display: flex; align-items: flex-start; gap: .9rem; padding: 1.05rem 1.15rem; min-height: 0; min-width: 0;
  background: var(--vms-surface); border: 1px solid var(--vms-line); border-radius: var(--vms-radius-lg); box-shadow: var(--vms-shadow-sm); }
.stat-card .stat-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; background: var(--vms-primary-soft); color: var(--vms-primary); margin: 0; }
.stat-card.tone-down .stat-icon { background: var(--vms-rose-soft); color: var(--vms-rose); }
.stat-card.tone-warn .stat-icon { background: var(--vms-amber-soft); color: var(--vms-amber); }
.stat-card .stat-body { min-width: 0; flex: 1 1 auto; }
.stat-card .stat-label { font-size: 12.5px; font-weight: 500; color: var(--vms-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--vms-ink); margin: .2rem 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .stat-hint { margin-top: .3rem; font-size: 12px; font-weight: 500; color: var(--vms-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .stat-hint.is-up { color: var(--vms-green); }
.stat-card .stat-hint.is-down { color: var(--vms-rose); }
.stat-card .stat-hint.is-warn { color: var(--vms-amber); }
.stat-card .stat-card-top, .stat-card .mini-track { display: none; }
@media (max-width: 575.98px) {
  .stat-card { padding: .85rem; gap: .65rem; flex-direction: column; }
  .stat-card .stat-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 9px; }
  .stat-card .stat-value { font-size: 22px; }
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); } }
.stat-card { container-type: inline-size; }
.stat-card .stat-label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stat-card .stat-value { overflow: visible; text-overflow: clip; }
.stat-card .stat-hint.is-down { color: var(--vms-muted); }
@container (max-width: 205px) {
  .stat-body { padding-top: .1rem; }
}
.stats-grid > .stat-card { flex-direction: row; }
@media (min-width: 768px) {
  .stat-card { container-type: inline-size; }
}
.stats-grid > .stat-card { display: block; container-type: inline-size; }
.stat-inner { display: flex; align-items: flex-start; gap: .9rem; }
@container (max-width: 210px) {
  .stat-inner { flex-direction: column; gap: .6rem; }
  .stat-card .stat-value { font-size: 24px; }
}
@media (max-width: 575.98px) { .stat-inner { flex-direction: column; gap: .55rem; } }
.person-dot.lg { width: 52px; height: 52px; font-size: 18px; }

/* ---- Mobile: filters fold behind a "Filters" button (search stays) -------- */
.filter-toggle { display: none; }
@media (max-width: 767.98px) {
  .js .filter-bar:not(.is-open) > .filter-field:not(.filter-grow) { display: none; }
  .js .filter-bar .filter-toggle { display: inline-flex; }
  .filter-bar .filter-grow { flex-basis: 100%; }
  .filter-bar .filter-field:not(.filter-grow) { flex: 1 1 calc(50% - .4rem); min-width: 0; }
  .filter-bar .form-control-av, .filter-bar .form-select-av, .filter-bar .ss { min-width: 0; width: 100%; }
  .filter-bar .filter-actions { flex-basis: 100%; }
  .filter-toggle .filter-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: currentColor; }
  .filter-toggle .filter-count span { color: #fff; }
}
@media (max-width: 575.98px) {
  .stats-grid { gap: .6rem; margin-bottom: 1rem; }
  .stat-card { padding: .75rem .85rem; }
  .stat-card .stat-inner { gap: .55rem; }
  .stat-card .stat-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .stat-card .stat-value { font-size: 20px; }
}

/* Bell: per-alert read state + "Mark all as read" */
.bell-head { justify-content: space-between; }
.bell-head > span { display: inline-flex; align-items: center; gap: .5rem; }
.bell-read-all { border: 0; background: transparent; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--vms-primary); }
.bell-read-all:hover { text-decoration: underline; }
.bell-item:not(.is-new) .bell-title { font-weight: 500; color: var(--vms-ink-soft); }
.bell-item { position: relative; padding-right: 2rem !important; }
.bell-item.is-new .bell-title::after { display: none; }
.bell-item.is-new::after { content: ""; position: absolute; right: 14px; top: 1.15rem; width: 8px; height: 8px; border-radius: 50%; background: var(--vms-primary); }
[data-install-app][hidden] { display: none !important; }
.app-icon-preview { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1px solid var(--vms-line); flex: 0 0 auto; }

/* Dashboard "waiting for approval": stacked card rows on phones */
@media (max-width: 640px) {
  .approval-table, .approval-table tbody, .approval-table tr, .approval-table td { display: block; width: 100%; }
  .approval-table tr { padding: .85rem 1rem; border-bottom: 1px solid var(--vms-line); }
  .approval-table tr:last-child { border-bottom: 0; }
  .approval-table td { padding: 0 !important; border: 0 !important; text-align: left !important; }
  .approval-table td.nowrap { margin: .2rem 0 .65rem; font-size: 13px; }
  .approval-table .approval-inline { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .approval-table .approval-inline .btn-av { width: 100%; justify-content: center; }
}
