/*
  Client-Space Shared Components — CANONICAL SOURCE (Izon brand kit, v2, IZO-633)

  Requires tokens.css loaded first, and Bootstrap 5.3.3 (CDN, see
  ../html-snippets/base-head.html) as the underlying component layer.
  Section A re-points Bootstrap at the tokens (same mapping as the toolkit's
  izon-wall-theme.css, minus the Google Fonts @import: fonts are self-hosted
  in tokens.css). Section B is the vw- component layer. Section C is the
  login layout. Video/camera components stay in video-components.css.

  Shape rules: radius 2px controls / 4px cards, sheets, menus / 0 tables;
  borders instead of shadows; one filled (ink) primary button per view;
  ember only for "needs a person". See ../RULESET.md.
*/

/* ============= A. Bootstrap follows the tokens ============= */
:root, [data-bs-theme="dark"], [data-bs-theme="light"] {
  --bs-body-bg: var(--vw-bg);
  --bs-body-color: var(--vw-text);
  --bs-secondary-color: var(--vw-text-muted);
  --bs-secondary-bg: var(--vw-surface-2);
  --bs-tertiary-bg: var(--vw-surface);
  --bs-border-color: var(--vw-border);
  --bs-link-color: var(--vw-accent);
  --bs-link-hover-color: var(--vw-ink);
  --bs-body-font-family: var(--vw-font);
  --bs-border-radius: var(--vw-radius);
  --bs-border-radius-sm: var(--vw-radius);
  --bs-border-radius-lg: var(--vw-radius-panel);
  --bs-border-radius-pill: var(--vw-radius);
  --bs-box-shadow: none;
  --bs-box-shadow-sm: none;
  --bs-box-shadow-lg: none;
}

.btn, .form-control, .form-select, .dropdown-menu, .modal-content, .card, .badge, .popover, .toast {
  border-radius: var(--vw-radius) !important;
  box-shadow: none !important;
}
.modal-content, .dropdown-menu, .popover, .card { border: 1px solid var(--vw-border-strong); background-image: none; }

.btn-primary {
  --bs-btn-bg: var(--vw-ink); --bs-btn-border-color: var(--vw-ink); --bs-btn-color: var(--vw-on-ink);
  --bs-btn-hover-bg: var(--vw-accent); --bs-btn-hover-border-color: var(--vw-accent); --bs-btn-hover-color: var(--vw-on-ink);
  --bs-btn-active-bg: var(--vw-accent); --bs-btn-active-border-color: var(--vw-accent); --bs-btn-active-color: var(--vw-on-ink);
  --bs-btn-disabled-bg: var(--vw-ink); --bs-btn-disabled-border-color: var(--vw-ink); --bs-btn-disabled-color: var(--vw-on-ink);
}
.btn-outline-primary, .btn-outline-secondary, .btn-outline-info {
  --bs-btn-color: var(--vw-text); --bs-btn-border-color: var(--vw-border-strong);
  --bs-btn-hover-bg: var(--vw-surface-2); --bs-btn-hover-border-color: var(--vw-accent); --bs-btn-hover-color: var(--vw-ink);
  --bs-btn-active-bg: var(--vw-ink); --bs-btn-active-border-color: var(--vw-ink); --bs-btn-active-color: var(--vw-on-ink);
}
/* Navbar controls sit on --vw-bar, which is dark in both themes. */
.vw-navbar .btn-outline-secondary {
  --bs-btn-color: var(--vw-on-bar); --bs-btn-border-color: var(--vw-on-bar-muted);
  --bs-btn-hover-bg: transparent; --bs-btn-hover-color: var(--vw-on-bar); --bs-btn-hover-border-color: var(--vw-on-bar);
  --bs-btn-active-bg: var(--vw-on-bar); --bs-btn-active-color: var(--vw-bar);
}
.btn-warning, .btn-outline-warning { --bs-btn-color: var(--vw-warning-ink); --bs-btn-border-color: var(--vw-warning); --bs-btn-bg: transparent; --bs-btn-hover-bg: var(--vw-chip-watch); --bs-btn-hover-color: var(--vw-warning-ink); --bs-btn-hover-border-color: var(--vw-warning); --bs-btn-active-bg: var(--vw-chip-watch); --bs-btn-active-color: var(--vw-warning-ink); --bs-btn-active-border-color: var(--vw-warning); }
.btn-outline-success { --bs-btn-color: var(--vw-success); --bs-btn-border-color: var(--vw-success); --bs-btn-hover-bg: var(--vw-success); --bs-btn-hover-border-color: var(--vw-success); --bs-btn-hover-color: var(--vw-on-ink); }
.btn-outline-danger, .btn-danger { --bs-btn-color: var(--vw-danger); --bs-btn-bg: transparent; --bs-btn-border-color: var(--vw-danger); --bs-btn-hover-bg: var(--vw-danger); --bs-btn-hover-border-color: var(--vw-danger); --bs-btn-hover-color: var(--vw-on-ink); --bs-btn-active-bg: var(--vw-danger); --bs-btn-active-color: var(--vw-on-ink); --bs-btn-active-border-color: var(--vw-danger); }
/* Opt-in ember, for the one action that needs a person now (Take action). Not a general button. */
.btn-ember {
  --bs-btn-bg: var(--vw-ember); --bs-btn-border-color: var(--vw-ember); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--vw-ember); --bs-btn-hover-border-color: var(--vw-ink); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--vw-ember); --bs-btn-active-border-color: var(--vw-ink); --bs-btn-active-color: #fff;
}
.btn-outline-ember {
  --bs-btn-bg: transparent; --bs-btn-color: var(--vw-ember-ink); --bs-btn-border-color: var(--vw-ember);
  --bs-btn-hover-bg: var(--vw-ember-wash); --bs-btn-hover-color: var(--vw-ember-ink); --bs-btn-hover-border-color: var(--vw-ember);
  --bs-btn-active-bg: var(--vw-ember-wash); --bs-btn-active-color: var(--vw-ember-ink); --bs-btn-active-border-color: var(--vw-ember);
}
.btn:focus-visible, .form-control:focus, .form-select:focus {
  outline: 2px solid var(--vw-accent); outline-offset: 1px; box-shadow: none !important; border-color: var(--vw-accent);
}
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--vw-accent); outline-offset: 2px; }

.badge.bg-danger, .badge.text-bg-danger { background-color: var(--vw-ember) !important; color: #fff !important; font-family: var(--vw-mono); font-weight: 500; }
.badge.bg-secondary, .badge.text-bg-secondary { background-color: var(--vw-surface-2) !important; color: var(--vw-text) !important; }
.text-warning { color: var(--vw-warning-ink) !important; }
.text-danger { color: var(--vw-danger) !important; }
.text-success { color: var(--vw-success) !important; }
.text-info, .text-primary { color: var(--vw-accent) !important; }

.form-control, .form-select { background-color: var(--vw-field); border-color: var(--vw-border-strong); color: var(--vw-text); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--vw-text); --bs-table-border-color: var(--vw-border); --bs-table-hover-bg: var(--vw-surface-2); }
.table thead th { font-family: var(--vw-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--vw-text-muted); }

/* ============= B. vw- components ============= */

/* ----- Type styles ----- */
/* Kicker: mono 11px tracked caps above a headline. */
.vw-kicker, .vw-micro {
  font-family: var(--vw-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--vw-text-muted);
}
.vw-kicker-ember { color: var(--vw-ember-ink); }
.vw-display { font-family: var(--vw-display); font-weight: 600; font-size: 28px; line-height: 34px; color: var(--vw-ink); margin: 0; }
.vw-lede { font-size: 15px; line-height: 23px; color: var(--vw-text-muted); margin: 0; }

/* ----- Count badges (nav tabs). Ember = unread/needs a person, ink = open count. ----- */
.vw-tab-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px;
  font-family: var(--vw-mono); font-size: 11px; font-weight: 500; line-height: 18px; text-align: center;
  border-radius: var(--vw-radius); color: #fff; background: var(--vw-ember);
}
.vw-tab-badge-ink { color: var(--vw-on-ink); background: var(--vw-ink); }
.vw-tab-badge:empty, .vw-tab-badge[hidden] { display: none; }

/* ----- Status chips: always paired with a word ----- */
.vw-chip { display: inline-block; padding: 2px 8px; font-size: 12px; line-height: 18px; border-radius: var(--vw-radius); border: 1px solid var(--vw-border); background: var(--vw-surface-2); color: var(--vw-text); }
.vw-chip-ok { background: var(--vw-chip-ok); color: var(--vw-success); border-color: transparent; }
.vw-chip-watch { background: var(--vw-chip-watch); color: var(--vw-warning-ink); border-color: transparent; }

/* ----- Brief: page-top panel with kicker, headline, one instruction line ----- */
.vw-brief {
  background: var(--vw-surface);
  border-top: 2px solid var(--vw-ink);
  border-bottom: 1px solid var(--vw-border);
  padding: 16px;
}
.vw-brief .vw-kicker { margin-bottom: 4px; }
.vw-brief h1, .vw-brief h2 { font-family: var(--vw-display); font-weight: 600; font-size: 22px; line-height: 28px; color: var(--vw-ink); margin: 0 0 4px; }
.vw-brief p { margin: 0; font-size: 15px; line-height: 23px; color: var(--vw-text-muted); }

/* ----- Ledger row: 44px min, hairline separated, mono sub-line ----- */
.vw-ledger { border-top: 1px solid var(--vw-border); }
.vw-ledger-row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px;
  background: var(--vw-surface); border-bottom: 1px solid var(--vw-border); color: var(--vw-text);
}
.vw-ledger-row .vw-ledger-main { flex: 1 1 auto; min-width: 0; font-family: var(--vw-display); font-weight: 600; font-size: 17px; line-height: 22px; }
.vw-ledger-row .vw-ledger-sub { font-family: var(--vw-mono); font-size: 12px; font-weight: 400; color: var(--vw-text-muted); }
.vw-ledger-row[aria-selected="true"], .vw-ledger-row.is-selected { background: var(--vw-pick); }
.vw-ledger-row.needs-you { border-top: 2px solid var(--vw-ember); }

/* ----- Segmented control (aria-pressed buttons) ----- */
.vw-segmented { display: inline-flex; border: 1px solid var(--vw-border-strong); border-radius: var(--vw-radius); overflow: hidden; background: var(--vw-surface); }
.vw-segmented > button {
  min-height: 44px; padding: 0 14px; border: 0; border-right: 1px solid var(--vw-border-strong);
  background: transparent; color: var(--vw-text); font: inherit; font-size: 14px; cursor: pointer;
}
.vw-segmented > button:last-child { border-right: 0; }
.vw-segmented > button[aria-pressed="true"] { background: var(--vw-ink); color: var(--vw-on-ink); }

/* ----- Sheet (bottom sheet on mobile, side card on desktop) + scrim ----- */
.vw-scrim { position: fixed; inset: 0; background: rgba(10, 13, 17, .5); z-index: 1040; }
.vw-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; max-height: 90vh; overflow-y: auto;
  background: var(--vw-surface); color: var(--vw-text);
  border: 1px solid var(--vw-border-strong); border-bottom: 0;
  border-radius: var(--vw-radius-panel) var(--vw-radius-panel) 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0));
}
.vw-sheet h2 { font-family: var(--vw-display); font-weight: 600; font-size: 22px; line-height: 28px; color: var(--vw-ink); margin: 4px 0 12px; }
@media (min-width: 768px) {
  .vw-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 480px; max-width: calc(100vw - 32px); border-bottom: 1px solid var(--vw-border-strong); border-radius: var(--vw-radius-panel); }
}

/* ----- Toast with Undo ----- */
.vw-toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--vw-bottomtabs-h) + 16px); z-index: 1060;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; max-width: 480px;
  background: var(--vw-bar); color: var(--vw-on-bar); border: 1px solid var(--vw-border-strong); border-radius: var(--vw-radius-panel);
}
.vw-toast button { margin-left: auto; min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--vw-on-bar); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ----- Skeleton: flat blocks, no shimmer ----- */
.vw-skeleton { display: block; background: var(--vw-surface-2); border-radius: var(--vw-radius); min-height: 14px; }
.vw-skeleton-still { aspect-ratio: 16 / 9; width: 100%; }

/* ----- State bar: three independent timestamps ----- */
.vw-state-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.vw-state-bar > li { list-style: none; padding: 4px 8px; background: var(--vw-surface-2); border-top: 4px solid var(--vw-border-strong); font-size: 12px; line-height: 16px; color: var(--vw-text-muted); }
.vw-state-bar > li.is-done { border-top-color: var(--vw-ink); color: var(--vw-text); }
.vw-state-bar .vw-state-time { display: block; font-family: var(--vw-mono); font-size: 12px; }

/* ----- Field: label above, input 44px, error beside colour ----- */
.vw-field { display: block; margin-bottom: 16px; }
.vw-field > label { display: block; margin-bottom: 4px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--vw-text); }
.vw-field .form-control { min-height: 44px; }
.vw-field.has-error .form-control { border-color: var(--vw-danger); }
.vw-field-error { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--vw-danger); }
.vw-field-wrap { position: relative; }
.vw-field-wrap .vw-field-toggle {
  position: absolute; top: 0; right: 0; height: 44px; padding: 0 12px; border: 0; background: transparent;
  color: var(--vw-accent); font: inherit; font-size: 14px; cursor: pointer;
}

/* Inline alert (login error etc.): word + border, never colour alone. */
.vw-alert { padding: 12px; margin-bottom: 16px; font-size: 14px; line-height: 20px; background: var(--vw-surface); border: 1px solid var(--vw-danger); border-radius: var(--vw-radius); color: var(--vw-text); }
.vw-alert:empty, .vw-alert[hidden] { display: none; }

/* ============= C. Login layout (canonical: html-snippets/login.html) ============= */
.vw-login { display: grid; grid-template-columns: 1fr; grid-template-rows: 56px 1fr; min-height: 100vh; min-height: 100dvh; background: var(--vw-bg); position: relative; }
.vw-login-panel { background: var(--vw-bar); color: var(--vw-on-bar); display: flex; align-items: center; padding: 0 16px; padding-top: env(safe-area-inset-top, 0); position: relative; overflow: hidden; }
.vw-login-brand-inner { display: flex; align-items: center; gap: 8px; }
.vw-login-panel .vw-login-mark { width: 28px; height: 28px; color: var(--vw-on-bar); flex: none; }
.vw-login-wordmark { font-family: var(--vw-display); font-weight: 600; font-size: 17px; }
.vw-login-pitch, .vw-login-trust { display: none; }
.vw-login-main { display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0)); }
.vw-login-form { width: 100%; max-width: 440px; }
.vw-login-form .vw-kicker { margin-bottom: 8px; }
.vw-login-form h1 { font-family: var(--vw-display); font-weight: 600; font-size: 28px; line-height: 34px; color: var(--vw-ink); margin: 0 0 8px; }
.vw-login-form .vw-lede { margin-bottom: 24px; }
.vw-login-form .btn-primary { width: 100%; min-height: 44px; }
.vw-login-foot { margin-top: 24px; font-size: 13px; line-height: 20px; color: var(--vw-text-muted); }
.vw-login-foot a { color: var(--vw-accent); }
.vw-login-theme { position: absolute; top: 6px; right: 8px; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--vw-on-bar); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 600px) and (max-width: 899.98px) {
  .vw-login-main { align-items: center; padding: 48px 32px; }
}
@media (min-width: 900px) {
  .vw-login { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: 1fr; }
  .vw-login-panel, .vw-login-main { align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: clamp(32px, 5vw, 96px); }
  .vw-login-brand-inner { width: 100%; max-width: clamp(420px, 34vw, 720px); flex-direction: column; align-items: flex-start; gap: clamp(20px, 2vw, 40px); position: relative; }
  .vw-login-brand-row { display: flex; align-items: center; gap: clamp(12px, 1vw, 16px); }
  .vw-login-panel .vw-login-mark { width: clamp(40px, 3.2vw, 72px); height: clamp(40px, 3.2vw, 72px); }
  .vw-login-panel .vw-login-wordmark { font-size: clamp(20px, 1.5vw, 32px); }
  .vw-login-panel::before {
    content: ""; position: absolute; right: -6%; bottom: -8%; width: min(clamp(360px, 60vw, 1400px), 85%); aspect-ratio: 1; pointer-events: none;
    background: var(--vw-on-bar); opacity: .05;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='2' y='4' width='28' height='4'/%3E%3Crect x='2' y='14' width='11' height='4'/%3E%3Crect x='21' y='14' width='9' height='4'/%3E%3Crect x='2' y='24' width='28' height='4'/%3E%3Crect x='14' y='10' width='6' height='6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='2' y='4' width='28' height='4'/%3E%3Crect x='2' y='14' width='11' height='4'/%3E%3Crect x='21' y='14' width='9' height='4'/%3E%3Crect x='2' y='24' width='28' height='4'/%3E%3Crect x='14' y='10' width='6' height='6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  [data-bs-theme="dark"] .vw-login-panel::before { opacity: .07; }
  .vw-login-pitch { display: block; font-family: var(--vw-display); font-weight: 600; font-size: clamp(32px, 3vw, 72px); line-height: 1.12; letter-spacing: -.01em; color: var(--vw-on-bar); margin: 0; max-width: 16ch; }
  .vw-login-trust { display: block; font-family: var(--vw-mono); font-size: clamp(12px, .9vw, 18px); line-height: 1.5; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--vw-on-bar-muted); margin: clamp(8px, 1vw, 24px) 0 0; max-width: 44ch; }
  .vw-login-main { align-items: center; }
  .vw-login-form { max-width: clamp(380px, 26vw, 520px); }
  .vw-login-form .vw-kicker { font-size: clamp(11px, .8vw, 15px); }
  .vw-login-form h1 { font-size: clamp(28px, 2.2vw, 48px); line-height: 1.15; }
  .vw-login-form .vw-lede { font-size: clamp(15px, 1.05vw, 20px); line-height: 1.5; margin-bottom: clamp(24px, 2vw, 40px); }
  .vw-login-form .vw-alert { font-size: clamp(14px, calc(1.05vw - 1px), 19px); }
  .vw-login-form .vw-field { margin-bottom: clamp(16px, 1.3vw, 28px); }
  .vw-login-form .vw-field > label { font-size: clamp(13px, .9vw, 17px); margin-bottom: 6px; }
  .vw-login-form .form-control { min-height: clamp(44px, 3.2vw, 68px); font-size: clamp(15px, 1.05vw, 20px); padding-inline: clamp(12px, .9vw, 20px); }
  .vw-login-form .vw-field-toggle { height: clamp(44px, 3.2vw, 68px); font-size: clamp(15px, 1.05vw, 20px); }
  .vw-login-form .btn-primary { min-height: clamp(44px, 3.2vw, 68px); font-size: clamp(15px, 1.05vw, 20px); }
  .vw-login-foot { font-size: clamp(13px, .9vw, 17px); line-height: 1.5; margin-top: clamp(24px, 2vw, 40px); }
  .vw-login-theme { top: clamp(16px, 1.5vw, 32px); right: clamp(16px, 1.5vw, 32px); color: var(--vw-text); }
  .vw-login-theme svg { width: clamp(20px, 1.4vw, 28px); height: clamp(20px, 1.4vw, 28px); }
}
@media (min-width: 1600px) {
  .vw-login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Header user label on --vw-bar, and button-element tabs in the bottom bar. */
.vw-navbar-user { color: var(--vw-on-bar-muted); font-size: .875rem; }
button.vw-bottom-tab { background: none; border: 0; }

/* Theme scope: lets a page show a subtree in a fixed theme (component-examples.html). */
.vw-theme-scope { background: var(--vw-bg); color: var(--vw-text); padding: 16px; }

/* ============= Legacy / carried-over components ============= */
/* ============= Page container ============= */
/* For card/dashboard-style pages (client_dashboard, loger) that aren't a
   full-bleed video wall. Video-wall-style apps skip this and let their
   layout fill the viewport instead (see video-components.css). */
.vw-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* ============= Navbar / header ============= */
.vw-navbar {
  background: var(--vw-bar);
  border-bottom: 1px solid var(--vw-border);
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--vw-navbar-h);
  z-index: 1030;
}
.vw-navbar .navbar-brand img { height: 26px; width: auto; display: block; }
.vw-navbar .nav-link { color: var(--vw-on-bar-muted); font-size: .875rem; }
.vw-navbar .nav-link:hover { color: var(--vw-on-bar); }
.vw-navbar .nav-link.active,
.vw-navbar .nav-link[aria-current="page"] { color: var(--vw-on-bar); border-bottom: 2px solid var(--vw-on-bar); }
.vw-navbar .navbar-brand { color: var(--vw-on-bar); }

/* Thin vertical divider between control groups in the navbar */
.vx-separator {
  width: 1px; height: 20px;
  background: var(--vw-border);
  display: inline-block;
}

/* Main content offset below the fixed navbar */
.vw-main {
  margin-top: var(--vw-navbar-h);
  min-height: calc(100vh - var(--vw-navbar-h) - var(--vw-bottomtabs-h));
}

/* ============= Mobile bottom tab bar ============= */
/* Hidden on desktop; becomes the primary nav on <768px, replacing the
   navbar's inline links (which collapse to a horizontal scroll strip). See
   ../html-snippets/bottom-tabbar.html for the markup. */
.vw-bottom-tabbar { display: none; }

@media (max-width: 767.98px) {
  /* !important needed: this div also carries Bootstrap's .d-flex utility,
     which sets display:flex !important — a plain rule can't beat that. */
  .vw-navbar-links { display: none !important; }
  .vw-navbar {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .vw-navbar > * { flex-shrink: 0; }

  .vw-bottom-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: var(--vw-bottomtabs-h);
    background: var(--vw-surface);
    border-top: 1px solid var(--vw-border);
    z-index: 1030;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .vw-bottom-tab {
    flex: 1 0 auto;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 6px;
    color: var(--vw-text-muted);
    text-decoration: none;
    font-size: .62rem;
    white-space: nowrap;
  }
  .vw-bottom-tab i { font-size: 1.05rem; }
  .vw-bottom-tab { position: relative; min-height: 44px; }
  .vw-bottom-tab.active { color: var(--vw-ink); border-top: 2px solid var(--vw-ink); }
}

/* ============= Buttons ============= */
/* Client-space builds on Bootstrap's own .btn/.btn-outline-secondary/
   .btn-primary/.btn-danger family rather than replacing it (unlike the
   agent-space system, which has no Bootstrap underneath it) — this matches
   every existing client_facing_space app. Header controls use
   `btn btn-sm btn-outline-secondary`. The one addition below fills a real
   gap: none of the source apps have a formal chromeless icon-only button
   for compact row actions outside the video grid (client_videowall_station
   only has one scoped to `.vw-cell-actions`) — generalized here so
   dashboard-style tables/lists have one to reuse instead of inventing a
   one-off per page. */
.vw-icon-btn {
  background: transparent;
  border: none;
  color: var(--vw-text-muted);
  width: 28px; height: 28px;
  border-radius: var(--vw-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  cursor: pointer;
}
.vw-icon-btn:hover { background: var(--vw-surface-2); color: var(--vw-text); }
.vw-icon-btn.vw-icon-btn-danger:hover { background: var(--vw-danger); color: var(--vw-on-ink); }

/* ============= Cards / panels ============= */
/* Two-tier elevation model used throughout the source apps: outer container
   on --vw-surface, nested item on --vw-surface-2. Generalized from
   .vw-timeline-wrap/.vw-clips-panel (outer) + .vw-clip-item (inner). */
.vw-card {
  background: var(--vw-surface);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius-panel);
  padding: 12px;
}
.vw-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.vw-card-sub {
  background: var(--vw-surface-2);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius-panel);
  padding: 8px 10px;
}

/* Uppercase micro-label panel header, e.g. section dividers inside a
   sidebar or drawer. From .vw-pb-panel-hdr. */
.vw-panel-hdr {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--vw-text-muted);
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--vw-border);
}

/* Row item inside a list/tree panel (e.g. a sidebar list), hover + active
   states. From .vw-wall-cam-item / .vw-pb-camera-item. */
.vw-list-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  font-size: .8125rem;
  color: var(--vw-text-muted);
  border-bottom: 1px solid var(--vw-surface-2);
  cursor: pointer;
  user-select: none;
  transition: background 90ms, color 90ms;
}
.vw-list-item:hover { background: var(--vw-surface-2); color: var(--vw-text); }
.vw-list-item.active { color: var(--vw-accent); background: var(--vw-surface-2); }

/* ============= Collapsible side-panel / drawer ============= */
/* Reusable wrapper + edge arrow tab pattern, used identically for 3+
   different panels across the source apps. The wrapper has no width/
   overflow of its own so the tab button stays visible even when the inner
   panel collapses to width:0. Ported near-verbatim — this is one of the
   most reusable patterns found in the source apps. */
.vw-side-panel {
  position: relative;
  display: flex;
  flex-shrink: 0;
}
.vw-panel-tab {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 46px;
  z-index: 5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vw-surface-2);
  border: 1px solid var(--vw-border);
  color: var(--vw-text-muted);
  padding: 0;
}
.vw-panel-tab:hover { color: var(--vw-text); background: var(--vw-border); }
.vw-side-panel-left .vw-panel-tab {
  right: -18px;
  border-radius: 0 var(--vw-radius-panel) var(--vw-radius-panel) 0;
  border-left: none;
}
.vw-side-panel-right .vw-panel-tab {
  left: -18px;
  border-radius: var(--vw-radius-panel) 0 0 var(--vw-radius-panel);
  border-right: none;
}
.vw-panel-tab i { font-size: .7rem; transition: transform .18s ease; }
.vw-panel-tab.is-collapsed i { transform: rotate(180deg); }

/* Shared dark backdrop for mobile overlay drawers (see RULESET.md's mobile
   pattern notes). */
@media (max-width: 767.98px) {
  .vw-panel-overlay {
    position: fixed;
    top: var(--vw-navbar-h); left: 0; right: 0; bottom: var(--vw-bottomtabs-h);
    background: rgba(0, 0, 0, .4);
    z-index: 1034;
  }
}

/* ============= Status dots / badges ============= */
/* The source apps indicate online/offline state with a colored Bootstrap
   Icon dot generated inline in JS rather than a formal class — formalized
   here as a reusable component so new code doesn't hand-roll the same
   inline style string again. */
.vw-status-dot {
  display: inline-block;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  margin-right: .35rem;
}
.vw-status-dot.online  { background: var(--vw-success); }
.vw-status-dot.offline { background: var(--vw-danger); }
.vw-status-dot.idle    { background: var(--vw-text-muted); }

/* Severity text colors, from client_videowall_station's incident severity
   mapping. Apply to text/icons, not backgrounds. */
.sev-critical { color: var(--vw-danger); }
.sev-high     { color: var(--vw-warning-ink); }
.sev-medium   { color: var(--vw-warning); }
.sev-low      { color: var(--vw-success); }

/* Pill-shaped stat chip, e.g. a small inline count/metric. */
.vw-stat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius);
  padding: 4px 12px;
  font-size: .8rem;
}

/* 5-segment severity/danger gauge — compact, colorblind-reasonable. */
.vw-danger-meter { display: flex; gap: 2px; align-items: center; }
.vw-danger-pip { width: 8px; height: 8px; border-radius: 2px; background: var(--vw-border); }
.vw-danger-pip.on-1, .vw-danger-pip.on-2, .vw-danger-pip.on-3 { background: var(--vw-success); }
.vw-danger-pip.on-4 { background: var(--vw-warning); }
.vw-danger-pip.on-5 { background: var(--vw-danger); }

/* ============= Tables ============= */
/* Layered on top of Bootstrap's own .table classes. */
.vw-table { font-size: .85rem; }
.vw-table thead th { font-family: var(--vw-mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--vw-text-muted); }

/* ============= Forms ============= */
/* No overrides needed — Bootstrap 5.3's .form-control/.form-select already
   re-theme correctly off data-bs-theme, and every source app relies on
   that rather than custom CSS. Do not add a competing .form-control rule
   here; if a form genuinely looks wrong in dark mode, it's a Bootstrap
   version/CDN issue, not a gap to patch locally. */

/* ============= Utility ============= */
.font-monospace { font-family: var(--vw-mono) !important; }
.vw-kbd {
  background: var(--vw-surface-2);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius);
  padding: 1px 5px;
  font-size: .75rem;
}
