/* ══════════════════════════════════════════════════════════════════
   VELENTRA VMS — GLOBAL CSS
   All design tokens, layout, shared components, utilities
   ══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DESIGN TOKENS ────────────────────────────────────────────────── */
:root {
  /* Brand */
  --accent: #e8604a;
  --vms-accent: var(--accent, #e8604a);
  --vms-accent-light: color-mix(in srgb, var(--accent, #e8604a) 14%, var(--surface, #fff));
  --vms-accent-dark: color-mix(in srgb, var(--accent, #e8604a) 80%, #000);
  --vms-accent-ring: color-mix(in srgb, var(--accent, #e8604a) 18%, transparent);

  /* Semantic Colors */
  --vms-green: #059669;
  --vms-green-light: #d1fae5;
  --vms-green-ring: rgba(5,150,105,0.18);
  --vms-red: #dc2626;
  --vms-red-light: #fee2e2;
  --vms-red-ring: rgba(220,38,38,0.18);
  --vms-amber: #d97706;
  --vms-amber-light: #fef3c7;
  --vms-amber-ring: rgba(217,119,6,0.18);
  --vms-blue: #2563eb;
  --vms-blue-light: #eff6ff;
  --vms-blue-ring: rgba(37,99,235,0.18);
  --vms-violet: #7c3aed;
  --vms-violet-light: #f5f3ff;
  --vms-violet-ring: rgba(124,58,237,0.18);
  --vms-indigo: #4338ca;
  --vms-indigo-light: #e0e7ff;
  --vms-cyan: #0891b2;
  --vms-cyan-light: #ecfeff;

  /* Short aliases used by dashboard.css components */
  --c-red:    #dc2626;
  --c-amber:  #d97706;
  --c-green:  #059669;
  --c-blue:   #2563eb;
  --c-indigo: #4f46e5;
  --c-violet: #7c3aed;

  /* Typography */
  --font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* Sidebar */
  --sidebar-w: 232px;
  --chrome-light: #1c1c1e;
  --chrome-dark: #111111;
  --sidebar-bg: var(--chrome-light);
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text: rgba(255,255,255,1);
  --sidebar-text-active: #ffffff;
  --sidebar-item-active-bg: color-mix(in srgb, var(--accent, #e8604a) 18%, transparent);
  --sidebar-item-active-border: var(--accent, #e8604a);
  --sidebar-item-hover-bg: rgba(255,255,255,0.05);
  --sidebar-label-color: rgba(255,255,255,0.22);

  /* Light Theme */
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface2: #faf8f5;
  --surface3: #f4f3ef;
  --border: #e6e3dc;
  --border-subtle: #ede9e2;
  --border-sub: #ede9e2;
  --text: #111111;
  --text-muted: #666666;
  --text-dim: #999999;
  --topbar-bg: #ffffff;
  --input-bg: #faf8f5;
  --input-border: #e6e3dc;
  --hover-bg: #f0ede8;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 4px 18px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 36px rgba(0,0,0,0.09), 0 4px 14px rgba(0,0,0,0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-full: 999px;
}

/* ── DARK THEME ───────────────────────────────────────────────────── */
[data-theme="dark"] {
  --sidebar-bg: var(--chrome-dark);
  --bg: #0e0d0b;
  --surface: #181714;
  --surface2: #1e1d1a;
  --surface3: #1e1d1a;
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.04);
  --border-sub: rgba(255,255,255,0.04);
  --text: #f0ede8;
  --text-muted: #8a8580;
  --text-dim: #555250;
  --topbar-bg: #181714;
  --input-bg: #1e1d1a;
  --input-border: rgba(255,255,255,0.1);
  --hover-bg: #1e1d1a;
  --vms-green-light: rgba(5,150,105,0.15);
  --vms-red-light: rgba(220,38,38,0.15);
  --vms-amber-light: rgba(217,119,6,0.15);
  --vms-blue-light: rgba(37,99,235,0.15);
  --vms-accent-light: color-mix(in srgb, var(--accent, #e8604a) 15%, transparent);
  --vms-violet-light: rgba(124,58,237,0.15);
  --vms-cyan-light: rgba(8,145,178,0.15);
  --vms-indigo-light: rgba(67,56,202,0.15);
}

/* ── BASE ─────────────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── LAYOUT SHELL ─────────────────────────────────────────────────── */
.vms-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.vms-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  min-width: 0;
  min-height: 0;
}

/* ── SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  transition: width 0.22s ease, min-width 0.22s ease;
  position: relative;
  z-index: 200;
  will-change: width, transform;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Sidebar scrollable content area */
.sidebar-scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* Logo area */
.vms-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.vms-logo-mark {
  width: 30px; height: 30px;
  background: var(--accent, #e8604a);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent, #e8604a) 40%, transparent);
}
.vms-logo-mark svg { width: 16px; height: 16px; }
.vms-logo-text { line-height: 1.1; }
.vms-logo-name { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.vms-logo-sub { font-size: 10px; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 1px; }

/* Site chip */
.vms-site-chip {
  margin: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}
.vms-site-chip:hover { background: rgba(255,255,255,0.09); }
.vms-site-name { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.85); }
.vms-site-hint { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 1px; }

/* Nav sections */
.vms-nav-section { margin-top: 6px; }
.vms-nav-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.28);
  padding: 10px 16px 4px;
}
.vms-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 400;
  color: #ffffff;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.13s, color 0.13s, padding-left 0.16s cubic-bezier(.34,1.2,.64,1);
  position: relative;
  text-decoration: none;
}
.vms-nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); padding-left: 20px; }
.vms-nav-item.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: #fff;
  font-weight: 500;
  padding-left: 16px;
  animation: navPop .28s cubic-bezier(.34,1.2,.64,1) both;
}
.vms-nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.vms-nav-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.vms-nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.6;
}
.vms-nav-badge.amber { background: var(--c-amber); }

/* Nav group (collapsible) */
.vms-nav-group { display: flex; flex-direction: column; }
.vms-nav-group-trigger { width: 100%; border: none; background: transparent; text-align: left; }
.vms-nav-group-caret {
  margin-left: auto;
  color: rgba(255,255,255,.4);
  transition: transform .18s ease, color .13s ease;
  flex-shrink: 0;
}
.vms-nav-group.open .vms-nav-group-caret { transform: rotate(180deg); color: rgba(255,255,255,.72); }
.vms-nav-group-children { display: none; padding: 4px 0 0 38px; }
.vms-nav-group.open .vms-nav-group-children { display: flex; flex-direction: column; gap: 4px; }
.vms-nav-subitem {
  display: flex; align-items: center; min-height: 34px;
  padding: 0 12px; border-radius: 10px;
  color: rgba(255,255,255,.5); font-size: 12px; font-weight: 500;
  transition: background .13s, color .13s;
}
.vms-nav-subitem:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.84); }
.vms-nav-subitem.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #fff; }

@keyframes navPop {
  0%   { opacity: 0; transform: translateX(-8px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Sidebar footer */
.vms-sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 14px;
  flex-shrink: 0;
}
.vms-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s;
}
.vms-user-row:hover { background: rgba(255,255,255,0.06); }
.vms-user-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent, #e8604a);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.vms-user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); }
.vms-user-role { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }

/* Sidebar toggle button */
.vms-sidebar-toggle {
  margin-left: auto;
  background: color-mix(in srgb, var(--accent) 18%, rgba(255,255,255,.04));
  border: none;
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: color-mix(in srgb, var(--accent) 80%, #fff);
  flex-shrink: 0;
  transition: background .18s, color .18s, transform .15s;
}
.vms-sidebar-toggle:hover {
  background: color-mix(in srgb, var(--accent) 35%, rgba(255,255,255,.06));
  color: #fff;
}
.vms-sidebar-toggle:active { transform: scale(.88); }
.vms-sidebar-toggle svg { transition: transform .22s ease; }
.sidebar:not(.collapsed) .vms-sidebar-toggle svg { transform: rotate(180deg); }

/* ── SIDEBAR COLLAPSED STATE (class on .sidebar element) ──────────── */
.sidebar.collapsed { width: 56px; min-width: 56px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .vms-logo-text,
.sidebar.collapsed .vms-nav-label,
.sidebar.collapsed .vms-nav-badge,
.sidebar.collapsed .vms-site-chip .site-info,
.sidebar.collapsed .vms-site-chip svg,
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .vms-logo { flex-direction: column; align-items: center; justify-content: flex-start; padding: 14px 0 10px; gap: 8px; }
.sidebar.collapsed .vms-nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .vms-logo-text { display: none; }
.sidebar.collapsed .vms-sidebar-toggle { margin-left: 0; }
.sidebar.collapsed .vms-site-chip { display: none; }
.sidebar.collapsed .vms-user-av { margin: 0 auto; }
.sidebar.collapsed .vms-user-row { justify-content: center; }
.sidebar.collapsed .vms-nav-group-children { display: none !important; }
.sidebar.collapsed .vms-nav-group-caret { display: none; }

/* ── SIDEBAR COLLAPSED STATE (legacy: class on body) ─────────────── */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .vms-logo-text,
body.sidebar-collapsed .vms-site-chip,
body.sidebar-collapsed .vms-nav-label,
body.sidebar-collapsed .vms-nav-badge,
body.sidebar-collapsed .vms-user-name,
body.sidebar-collapsed .vms-user-role,
body.sidebar-collapsed .vms-logo-sub {
  opacity: 0; pointer-events: none; width: 0; overflow: hidden; white-space: nowrap;
}
body.sidebar-collapsed .vms-nav-item span.nav-label {
  opacity: 0; pointer-events: none; width: 0; overflow: hidden; white-space: nowrap;
}
body.sidebar-collapsed .vms-logo { justify-content: center; padding: 16px 0; }
body.sidebar-collapsed .vms-logo-mark { margin: 0 auto; }
body.sidebar-collapsed .vms-nav-item { justify-content: center; padding: 10px 0; margin: 2px 6px; border-left: none; }
body.sidebar-collapsed .vms-nav-item.active { border-left: none; }
body.sidebar-collapsed .vms-nav-item svg { width: 18px; height: 18px; margin: 0; }
body.sidebar-collapsed .vms-nav-section { padding: 4px 0; }
body.sidebar-collapsed .vms-user-row { justify-content: center; padding: 8px 4px; }
body.sidebar-collapsed .vms-user-av { margin: 0; }
body.sidebar-collapsed .vms-sidebar-footer { padding: 10px 4px; }
body.sidebar-collapsed .vms-sidebar-toggle { margin: 0 auto; }

/* Tooltip on body-collapsed items */
body.sidebar-collapsed .vms-nav-item::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #1e293b; color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.sidebar-collapsed .vms-nav-item:hover::after { opacity: 1; }

/* ── TOPBAR ───────────────────────────────────────────────────────── */
.vms-topbar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(0,0,0,.2);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  z-index: 100;
  position: relative;
}
.vms-page-title {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  letter-spacing: -0.01em;
}
.vms-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vms-topbar-sep { width: 1px; height: 20px; background: rgba(255,255,255,.15); margin: 0 2px; flex-shrink: 0; }

/* Live pill */
.vms-live-pill {
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--c-green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-green) 25%, transparent);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 500;
  color: var(--c-green);
  letter-spacing: .3px;
}
.vms-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.7); } }
@keyframes livePulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Hamburger (mobile) */
.vms-hamburger {
  display: none;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,.6);
  transition: all 0.14s;
}
.vms-hamburger:hover { background: rgba(255,255,255,.18); color: #fff; }

/* Theme toggle button */
.vms-theme-btn {
  background: none; border: none;
  color: rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: var(--radius-sm);
  transition: background .13s, color .13s;
}
.vms-theme-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── TOPBAR SEARCH ────────────────────────────────────────────────── */
.vms-topbar-search {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 0 10px; height: 34px;
  transition: border-color .2s, box-shadow .2s, background .2s, width .25s;
  z-index: 10;
}
.vms-topbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  background: rgba(255,255,255,.15);
}
.vms-topbar-search > svg { color: rgba(255,255,255,.45); flex-shrink: 0; }
.vms-topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12.5px; color: rgba(255,255,255,.85); font-family: inherit;
}
.vms-topbar-search input::placeholder { color: rgba(255,255,255,.35); }
.vms-search-kbd {
  font-size: 10px; color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.12); border-radius: 4px;
  padding: 1px 5px; font-family: 'DM Mono', monospace; flex-shrink: 0;
  transition: opacity .15s;
}
.vms-topbar-search:focus-within .vms-search-kbd { opacity: 0; }

/* Search results dropdown */
.vms-search-results {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; z-index: 999;
}
.vms-search-results.open { display: block; }
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; transition: background .12s;
  border-bottom: 1px solid var(--border-sub);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--bg); }
.sr-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.sr-label { font-size: 12px; font-weight: 600; color: var(--text); }
.sr-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.sr-empty { padding: 12px; font-size: 12px; color: var(--text-dim); text-align: center; }
.sr-group-label {
  padding: 6px 12px 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-dim); background: var(--surface2, var(--bg));
  border-bottom: 1px solid var(--border-sub);
}
.sr-item--nav { background: transparent; }
.sr-item--nav:hover { background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.sr-av--nav { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-radius: 6px; }
.sr-nav-arrow { margin-left: auto; font-size: 14px; color: var(--text-dim); flex-shrink: 0; }

/* ── RELOAD BUTTON ────────────────────────────────────────────────── */
.vms-reload-btn {
  background: none; border: none; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: var(--radius-sm);
  transition: background .13s, color .13s;
}
.vms-reload-btn:hover { background: var(--border); color: var(--text); }
.vms-reload-btn.spinning svg { animation: spin-once .65s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes spin-once { to { transform: rotate(360deg); } }

/* ── TOPBAR LOGO (mobile only) ────────────────────────────────────── */
.vms-topbar-logo { display: none; flex-shrink: 0; align-items: center; gap: 8px; }
.vms-topbar-logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vms-topbar-logo-mark svg { width: 15px; height: 15px; }
.vms-topbar-logo-name { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .3px; white-space: nowrap; }

/* ── TOPBAR PROFILE ───────────────────────────────────────────────── */
.vms-tp-wrap { position: relative; }
.vms-tp-av-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px; border-radius: 40px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.vms-tp-av-btn:hover { background: rgba(255,255,255,.17); border-color: rgba(255,255,255,.3); box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.vms-tp-av-btn:active { transform: scale(.98); }
.tp-av-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden;
}
.tp-av-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tp-av-info { text-align: left; line-height: 1; }
.tp-av-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); white-space: nowrap; }
.tp-av-role { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 2px; white-space: nowrap; }
.tp-av-caret { color: rgba(255,255,255,.4); flex-shrink: 0; transition: transform .2s; }
.vms-tp-av-btn:hover .tp-av-caret { color: rgba(255,255,255,.65); }
.vms-tp-av-btn[aria-expanded="true"] .tp-av-caret { transform: rotate(180deg); }

/* ── PROFILE DROPDOWN ─────────────────────────────────────────────── */
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.vms-profile-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 210px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  z-index: 700; overflow: hidden;
  animation: dropIn .18s cubic-bezier(.16,1,.3,1) both;
}
.vms-profile-dropdown.open { display: block; }
.pd-header {
  padding: 14px 16px 12px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.pd-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.pd-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.pd-role { font-size: 10.5px; color: var(--text-muted); }
.pd-divider { height: 1px; background: var(--border); }
.pd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-muted); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.pd-item:hover { background: var(--bg); color: var(--text); }
.pd-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.pd-item.danger:hover { background: color-mix(in srgb, var(--c-red) 8%, transparent); color: var(--c-red); }

/* ── THEME COLOR PICKER ───────────────────────────────────────────── */
.vms-theme-picker-wrap { position: relative; }
.vms-color-picker-panel {
  display: none; position: absolute; top: calc(100% + 8px); right: -4px;
  width: 212px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0,0,0,.18), 0 3px 10px rgba(0,0,0,.1);
  padding: 14px; z-index: 600;
  animation: dropIn .2s cubic-bezier(.16,1,.3,1) both;
}
.vms-color-picker-panel.open { display: block; }
.cp-header { font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.cp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cp-swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid transparent; padding: 0; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); margin: 0 auto; display: block;
}
.cp-swatch:hover { transform: scale(1.2); box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.cp-swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 2px 6px rgba(0,0,0,.3); }

/* ── CONTENT AREA ─────────────────────────────────────────────────── */
.vms-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.vms-content::-webkit-scrollbar { width: 5px; }
.vms-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── OVERLAY (mobile) ─────────────────────────────────────────────── */
.vms-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 390;
  backdrop-filter: blur(2px);
}
.vms-overlay.active { display: block; }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.vms-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.14s; white-space: nowrap; text-decoration: none;
}
.vms-btn--primary, .vms-btn.primary { background: var(--vms-accent); color: #fff; border: none; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.vms-btn--primary:hover, .vms-btn.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-1px); }
.vms-btn--default, .vms-btn.default { background: var(--surface); color: var(--text); border-color: var(--border); }
.vms-btn--default:hover, .vms-btn.default:hover { background: color-mix(in srgb, var(--vms-accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--vms-accent) 35%, var(--border)); color: var(--vms-accent); }
.vms-btn--success { background: var(--vms-green-light); color: var(--vms-green); border: 1px solid rgba(5,150,105,0.2); }
.vms-btn--success:hover { filter: brightness(.94); }
.vms-btn--danger { background: var(--vms-red-light); color: var(--vms-red); border: 1px solid rgba(220,38,38,0.2); }
.vms-btn--danger:hover { filter: brightness(.94); }
.vms-btn--ghost, .vms-btn.ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.vms-btn--ghost:hover, .vms-btn.ghost:hover { background: color-mix(in srgb, var(--vms-accent) 8%, transparent); border-color: color-mix(in srgb, var(--vms-accent) 35%, var(--border)); color: var(--vms-accent); }
.vms-btn--sm, .vms-btn.sm { padding: 5px 10px; font-size: 11.5px; }
.vms-btn:active { transform: scale(.96) !important; }
.vms-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vms-accent-ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--vms-accent); }

/* ── TABLE BUTTONS ────────────────────────────────────────────────── */
.tbl-btn, .vms-tbl-btn {
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); transition: all .12s, transform .1s;
  white-space: nowrap; font-family: var(--font);
}
.tbl-btn:hover, .vms-tbl-btn:hover { background: var(--bg); color: var(--text); }
.tbl-btn:active, .vms-tbl-btn:active { transform: scale(.94); }
.tbl-btn:focus-visible, .vms-tbl-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.tbl-btn.success, .vms-tbl-btn--success {
  background: color-mix(in srgb, var(--c-green) 10%, transparent);
  border-color: color-mix(in srgb, var(--c-green) 25%, transparent); color: var(--c-green);
}
.tbl-btn.success:hover, .vms-tbl-btn--success:hover { background: var(--c-green); color: #fff; }
.tbl-btn.success:disabled { opacity: .55; cursor: default; }
.tbl-btn.danger, .vms-tbl-btn--danger {
  background: color-mix(in srgb, var(--c-red) 8%, transparent);
  border-color: color-mix(in srgb, var(--c-red) 20%, transparent); color: var(--c-red);
}
.tbl-btn.danger:hover, .vms-tbl-btn--danger:hover { background: var(--c-red); color: #fff; }
.tbl-btn.neutral { background: var(--bg); color: var(--text-muted); }

/* ── STATUS BADGES ────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
  transition: transform .12s, box-shadow .12s;
}
.status-badge:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.status-badge.checked-in  { background: color-mix(in srgb,var(--c-green) 12%,transparent); color: var(--c-green); }
.status-badge.checked-out { background: color-mix(in srgb,var(--c-indigo) 12%,transparent); color: var(--c-indigo); }
.status-badge.noshow      { background: color-mix(in srgb,var(--c-red) 10%,transparent); color: var(--c-red); }
.status-badge.vip         { background: color-mix(in srgb,var(--c-amber) 12%,transparent); color: var(--c-amber); }
.status-badge.violet      { background: color-mix(in srgb,var(--c-violet) 10%,transparent); color: var(--c-violet); }
.status-badge.blue-b      { background: color-mix(in srgb,var(--c-blue) 10%,transparent); color: var(--c-blue); }
.status-badge.green-b     { background: color-mix(in srgb,var(--c-green) 10%,transparent); color: var(--c-green); }
.status-badge.live        { background: color-mix(in srgb,var(--c-green) 12%,transparent); color: var(--c-green); font-size: 10px; }
.status-badge.danger-badge{ background: color-mix(in srgb,var(--c-red) 10%,transparent); color: var(--c-red); }

/* ── FILTER PILLS ─────────────────────────────────────────────────── */
.filter-pills, .vms-filter-pills { display: flex; gap: 5px; flex-wrap: wrap; flex-shrink: 0; }
.pill, .vms-pill {
  padding: 5px 13px; border-radius: 20px;
  font-size: 9.5px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); white-space: nowrap; min-height: unset;
  line-height: 1.4; transition: all .13s; font-family: var(--font);
}
.pill:hover, .vms-pill:hover { color: var(--text); border-color: var(--text-muted); background: var(--hover-bg); }
.pill.active, .vms-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── DOT UTILITY ──────────────────────────────────────────────────── */
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.red    { background: var(--c-red); }
.dot.green  { background: var(--c-green); }
.dot.blue   { background: var(--c-blue); }
.dot.amber  { background: var(--c-amber); }

/* ── TABLE NAME CELL HELPERS ──────────────────────────────────────── */
.name-cell { display: flex; align-items: center; gap: 8px; }
.name-primary { font-size: 12.5px; font-weight: 600; color: var(--text); }
.name-sec     { font-size: 10.5px; color: var(--text-muted); }
.date-text    { font-size: 11.5px; font-weight: 500; margin-bottom: 3px; }
.time-cell    { font-size: 11.5px; white-space: nowrap; color: var(--text); }
.purpose-cell { font-size: 11.5px; color: var(--text-muted); max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono-cell    { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--accent); }

/* ── CARDS ────────────────────────────────────────────────────────── */
.vms-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  transition: box-shadow .22s, transform .18s;
}
.vms-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1), 0 1px 4px rgba(0,0,0,.06); transform: translateY(-1px); }
.vms-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(108deg, transparent 30%, rgba(255,255,255,.045) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0s; pointer-events: none;
}
.vms-card:hover::after { transform: translateX(200%); transition: transform .65s ease; }

/* Card header — prefixed and unprefixed versions */
.vms-card-header, .card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}
.vms-card-title, .card-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.vms-card-body, .card-body { padding: 10px 14px 12px; }

/* Panel subhead */
.panel-subhead {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px 7px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
  border-bottom: 1px solid var(--border-sub);
}
.panel-subhead .subhead-count {
  margin-left: auto; background: var(--border); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; color: var(--text-muted);
}
.panel-subhead.requires { color: #b91c1c; background: color-mix(in srgb,#dc2626 5%,transparent); }
.panel-subhead.waiting  { color: #065f46; background: color-mix(in srgb,#059669 5%,transparent); }
.panel-subhead.inside   { color: #1e40af; background: color-mix(in srgb,#2563eb 5%,transparent); }
.panel-subhead.needs-attention { color: #92400e; background: color-mix(in srgb,#d97706 5%,transparent); }
[data-theme="dark"] .panel-subhead.requires { color: #fca5a5; }
[data-theme="dark"] .panel-subhead.waiting  { color: #6ee7b7; }
[data-theme="dark"] .panel-subhead.inside   { color: #93c5fd; }
[data-theme="dark"] .panel-subhead.needs-attention { color: #fcd34d; }

/* ── BADGES ───────────────────────────────────────────────────────── */
.vms-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.vms-badge--pending   { background: var(--vms-amber-light); color: var(--vms-amber); }
.vms-badge--approved  { background: var(--vms-green-light); color: var(--vms-green); }
.vms-badge--checkedin { background: var(--vms-blue-light);  color: var(--vms-blue); }
.vms-badge--checkedout{ background: var(--surface3); color: var(--text-muted); }
.vms-badge--rejected  { background: var(--vms-red-light);   color: var(--vms-red); }
.vms-badge--noshow    { background: var(--surface3); color: var(--text-dim); }
.vms-badge--active    { background: var(--vms-green-light); color: var(--vms-green); }
.vms-badge--expired   { background: var(--vms-red-light);   color: var(--vms-red); }
.vms-badge--overstay  { background: var(--vms-red-light);   color: var(--vms-red); }
.vms-badge--live      { background: var(--vms-green-light); color: var(--vms-green); animation: livePulse 2s infinite; }
.vms-badge--violet    { background: var(--vms-violet-light); color: var(--vms-violet); }
.vms-badge--blue      { background: var(--vms-blue-light);  color: var(--vms-blue); }
.vms-badge--cyan      { background: var(--vms-cyan-light);  color: var(--vms-cyan); }
.vms-badge--indigo    { background: var(--vms-indigo-light); color: var(--vms-indigo); }
.vms-badge--gray      { background: var(--surface3); color: var(--text-muted); }
.vms-badge--amber     { background: var(--vms-amber-light); color: var(--vms-amber); }
.vms-badge--red       { background: var(--vms-red-light); color: var(--vms-red); }
.vms-badge--green     { background: var(--vms-green-light); color: var(--vms-green); }

/* ── TABLES ───────────────────────────────────────────────────────── */
.vms-table-wrap, .table-wrap { overflow-x: auto; }
.vms-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.vms-table thead tr { background: var(--surface2); border-bottom: 1px solid var(--border); }
.vms-table thead th {
  padding: 9px 14px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dim); text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: var(--surface2);
}
.vms-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted); vertical-align: middle;
}
.vms-table tbody tr { transition: background .12s; }
.vms-table tbody tr:hover { background: var(--bg); }
.vms-table tr:last-child td { border-bottom: none; }
.vms-td-name { color: var(--text) !important; font-weight: 600; font-size: 12.5px; }
.vms-td-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; }
.vms-name-cell { display: flex; align-items: center; gap: 8px; }
.vms-name-info { line-height: 1.3; }
.vms-name-primary { font-weight: 600; color: var(--text); font-size: 12.5px; }
.vms-name-secondary { font-size: 11px; color: var(--text-muted); }
.panel-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.panel-sub   { font-size: 11px; color: var(--text-muted); margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recur { color: var(--accent); font-weight: 600; }

/* ── FILTER BAR ───────────────────────────────────────────────────── */
.vms-filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.vms-clear-btn {
  display: none; align-items: center; gap: 4px;
  padding: 5px 10px; font-size: 12px; font-weight: 500;
  color: var(--text-muted); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.vms-clear-btn:hover { background: var(--surface3); color: var(--text); }
.vms-clear-btn.visible { display: inline-flex; }
.vms-search {
  flex: 1; min-width: 180px;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  font-family: var(--font); font-size: 12.5px; color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.vms-search:focus { border-color: var(--vms-accent); box-shadow: 0 0 0 3px var(--vms-accent-ring); outline: none; }
.vms-search::placeholder { color: var(--text-dim); }
.vms-select {
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-family: var(--font); font-size: 12px; color: var(--text-muted);
  outline: none; cursor: pointer; transition: border-color 0.15s;
}
.vms-select:focus { border-color: var(--vms-accent); box-shadow: 0 0 0 3px var(--vms-accent-ring); outline: none; }

/* ── FORM ELEMENTS ────────────────────────────────────────────────── */
.vms-form-section { margin-bottom: 22px; }
.vms-form-section-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--vms-accent); margin-bottom: 12px; padding-bottom: 7px;
  border-bottom: 1px solid var(--vms-accent-light);
}
.vms-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px;}
.vms-form-group { display: flex; flex-direction: column; gap: 4px; }
.vms-form-group.full { grid-column: 1/-1; }
.vms-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.vms-input {
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-sm); padding: 7px 11px;
  font-family: var(--font); font-size: 12.5px; color: var(--text);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.vms-input:focus { border-color: var(--vms-accent); box-shadow: 0 0 0 3px var(--vms-accent-ring); outline: none; }
.vms-input::placeholder { color: var(--text-dim); }
textarea.vms-input { resize: vertical; min-height: 72px; }
select.vms-input { cursor: pointer; }

/* ── KPI CARDS ────────────────────────────────────────────────────── */
.vms-kpi-row {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.vms-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 14px 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.vms-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.vms-kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius) var(--radius) 0 0; }
.vms-kpi--amber { --kpi-color: var(--vms-amber); }
.vms-kpi--green { --kpi-color: var(--vms-green); }
.vms-kpi--blue  { --kpi-color: var(--vms-blue); }
.vms-kpi--red   { --kpi-color: var(--vms-red); }
.vms-kpi--violet{ --kpi-color: var(--vms-violet); }
.vms-kpi--indigo{ --kpi-color: var(--vms-indigo); }
.vms-kpi--cyan  { --kpi-color: var(--vms-cyan); }
.vms-kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vms-kpi--amber .vms-kpi-icon { background: var(--vms-amber-light); color: var(--vms-amber); }
.vms-kpi--green .vms-kpi-icon { background: var(--vms-green-light); color: var(--vms-green); }
.vms-kpi--blue  .vms-kpi-icon { background: var(--vms-blue-light);  color: var(--vms-blue); }
.vms-kpi--red   .vms-kpi-icon { background: var(--vms-red-light);   color: var(--vms-red); }
.vms-kpi--violet .vms-kpi-icon { background: var(--vms-violet-light); color: var(--vms-violet); }
.vms-kpi--indigo .vms-kpi-icon { background: var(--vms-indigo-light); color: var(--vms-indigo); }
.vms-kpi--cyan  .vms-kpi-icon { background: var(--vms-cyan-light);  color: var(--vms-cyan); }
.vms-kpi-icon svg { width: 16px; height: 16px; }
.vms-kpi-body { flex: 1; min-width: 0; }
.vms-kpi-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.vms-kpi-label { font-size: 10.5px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
.vms-kpi-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.vms-ring-wrap { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.vms-ring { width: 36px; height: 36px; transform: rotate(-90deg); }
.vms-ring__track { fill: none; stroke: var(--border); stroke-width: 3; }
.vms-ring__fill { fill: none; stroke: var(--kpi-color, var(--vms-accent)); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray 0.6s ease; }
.vms-ring__pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: var(--text-muted); }

/* ── STAT CARDS ───────────────────────────────────────────────────── */
.vms-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.vms-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.vms-stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sc, var(--vms-accent)); border-radius: var(--radius) var(--radius) 0 0; }
.vms-stat-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 6px; }
.vms-stat-val { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1; margin-bottom: 4px; }
.vms-stat-sub { font-size: 11px; color: var(--text-muted); }

/* ── TABS ─────────────────────────────────────────────────────────── */
.vms-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.vms-tabs::-webkit-scrollbar { display: none; }
.vms-tab {
  padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
  font-family: var(--font); transition: all 0.14s; white-space: nowrap;
}
.vms-tab:hover { color: var(--text); }
.vms-tab.active { color: var(--vms-accent); border-bottom-color: var(--vms-accent); }

/* ── SECTION HEADERS ──────────────────────────────────────────────── */
.vms-section { margin-bottom: 20px; }
.vms-section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vms-section-title { font-size: 13px; font-weight: 700; color: var(--text); }
.vms-section-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--accent); font-weight: 600;
  text-decoration: none; opacity: .8; transition: gap .15s, opacity .15s;
}
.vms-section-link:hover { text-decoration: none; gap: 6px; opacity: 1; }

/* ── PANEL ROWS ───────────────────────────────────────────────────── */
.vms-panel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s; position: relative; overflow: hidden;
}
.vms-panel-row:last-child { border-bottom: none; }
.vms-panel-row:hover { background: var(--hover-bg); }
.vms-panel-info { flex: 1; min-width: 0; }
.vms-panel-title { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vms-panel-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── AVATARS ──────────────────────────────────────────────────────── */
.vms-av {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.vms-av-sm, .vms-av.av-sm { width: 26px; height: 26px; font-size: 10px; border-radius: 7px; }
.vms-av-lg { width: 40px; height: 40px; font-size: 13px; border-radius: 11px; }

/* ── ALERT ROWS / TIMELINE ────────────────────────────────────────── */
.vms-alert-row { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.vms-alert-row:last-child { border-bottom: none; }
.vms-alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.vms-tl-item { display: flex; gap: 10px; padding: 7px 0; }
.vms-tl-time { font-size: 10.5px; color: var(--text-dim); width: 50px; flex-shrink: 0; text-align: right; }
.vms-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vms-accent); flex-shrink: 0; margin-top: 5px; position: relative; }
.vms-tl-dot::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 1px; height: 26px; background: var(--border); }
.vms-tl-item:last-child .vms-tl-dot::after { display: none; }
.vms-tl-text { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.vms-tl-text strong { color: var(--text); font-weight: 600; }

/* ── ZONE BARS ────────────────────────────────────────────────────── */
.vms-zone-row { padding: 7px 0; }
.vms-zone-hdr { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--text); font-weight: 500; }
.vms-zone-hdr span:last-child { font-weight: 700; }
.vms-zone-track { height: 5px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.vms-zone-fill  { height: 100%; border-radius: 99px; }

/* ── PTW CARDS ────────────────────────────────────────────────────── */
.vms-ptw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow-sm); }
.vms-ptw-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.vms-ptw-body { flex: 1; }
.vms-ptw-name { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.vms-ptw-meta { font-size: 11px; color: var(--text-muted); }
.vms-ptw-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.vms-ptw-time { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* ── TRAINING CARDS ───────────────────────────────────────────────── */
.vms-training-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.vms-prog-track { height: 5px; background: var(--surface3); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.vms-prog-fill  { height: 100%; border-radius: 99px; }

/* ── HORIZONTAL BAR CHART ─────────────────────────────────────────── */
.vms-bar-row { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 12px; }
.vms-bar-lbl { width: 130px; color: var(--text-muted); text-align: right; flex-shrink: 0; font-size: 11.5px; }
.vms-bar-track { flex: 1; height: 20px; background: var(--surface3); border-radius: 5px; overflow: hidden; }
.vms-bar-fill { height: 100%; border-radius: 5px; display: flex; align-items: center; padding-left: 8px; font-size: 10.5px; font-weight: 600; }
.vms-bar-count { width: 34px; color: var(--text-muted); font-size: 11px; text-align: right; }

/* ── GATE PASS CARD ───────────────────────────────────────────────── */
.vms-pass-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.vms-pass-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent, #e8604a); }

/* ── MUSTER CARDS ─────────────────────────────────────────────────── */
.vms-muster-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow-sm); }
.vms-muster-count { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.vms-muster-label { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.vms-muster-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* ── EMERGENCY BANNER ─────────────────────────────────────────────── */
.vms-emergency-banner { background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.25); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }

/* ── ACTIONS BAR ──────────────────────────────────────────────────── */
.vms-actions-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

/* ── EMPTY STATE ──────────────────────────────────────────────────── */
.vms-empty { padding: 32px 16px; text-align: center; color: var(--text-dim); }
.vms-empty-icon { font-size: 28px; margin-bottom: 8px; }
.vms-empty-text { font-size: 12px; }

/* ── INFO CHIP ────────────────────────────────────────────────────── */
.vms-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}

/* ── LAYOUT GRID HELPERS ──────────────────────────────────────────── */
.g2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3  { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.g4  { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.g3c { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.g6  { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; }
.col { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-sb { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mb  { margin-bottom: 16px; }
.sep { height: 1px; background: var(--border-subtle); margin: 8px 0; }

/* ── MODAL ────────────────────────────────────────────────────────── */
.vms-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 9000;
  align-items: center; justify-content: center;
}
.vms-modal-overlay.open { display: flex; }
.vms-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; width: 420px;
  max-width: calc(100vw - 32px); max-height: 90vh;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
}
.vms-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.vms-modal-title { font-size: 13px; font-weight: 700; color: var(--text); }
.vms-modal-close {
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-dim); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.vms-modal-close:hover { background: var(--surface2, var(--bg)); color: var(--text); }
.vms-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 0; }
.vms-modal-footer { padding: 10px 16px 14px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ── PASS RENEWAL TABS ────────────────────────────────────────────── */
.pr-tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pr-tab {
  padding: 7px 18px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit; transition: color .15s, border-color .15s;
}
.pr-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pr-tab:hover:not(.active) { color: var(--text); }
.pr-pane { display: none; }
.pr-pane.active { display: block; }
.pr-search-wrap { position: relative; width: 220px; flex: none; display: flex; align-items: center; margin-left: auto; }
.pr-search-wrap .vms-search { width: 100%; padding-right: 28px; }
.pr-search-clear {
  position: absolute; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: var(--text-dim); color: var(--surface);
  font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; flex-shrink: 0;
}
.pr-search-clear:hover { background: var(--text-muted); }
.pr-icon-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-start; }
.pr-icon-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1.5px solid transparent;
  background: transparent; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.pr-icon-btn--reschedule { color: #6366f1; border-color: rgba(99,102,241,.25); background: rgba(99,102,241,.07); }
.pr-icon-btn--reschedule:hover { background: rgba(99,102,241,.16); border-color: rgba(99,102,241,.5); }
.pr-icon-btn--renew { color: #059669; border-color: rgba(5,150,105,.25); background: rgba(5,150,105,.07); }
.pr-icon-btn--renew:hover { background: rgba(5,150,105,.16); border-color: rgba(5,150,105,.5); }
.pr-icon-btn--view { color: #2563eb; border-color: rgba(37,99,235,.25); background: rgba(37,99,235,.07); }
.pr-icon-btn--view:hover { background: rgba(37,99,235,.16); border-color: rgba(37,99,235,.5); }
.pr-icon-btn--cancel { color: #dc2626; border-color: rgba(220,38,38,.25); background: rgba(220,38,38,.07); }
.pr-icon-btn--cancel:hover { background: rgba(220,38,38,.15); border-color: rgba(220,38,38,.5); }

/* ── DARK MODE OVERRIDES ──────────────────────────────────────────── */
[data-theme="dark"] .vms-card,
[data-theme="dark"] .vms-kpi,
[data-theme="dark"] .vms-stat-card,
[data-theme="dark"] .vms-ptw-card,
[data-theme="dark"] .vms-training-card,
[data-theme="dark"] .vms-pass-card,
[data-theme="dark"] .vms-muster-card { background: var(--surface); }
[data-theme="dark"] .vms-table thead tr { background: var(--surface2); }
[data-theme="dark"] .vms-input { background: var(--input-bg); border-color: var(--input-border); color: var(--text); }
[data-theme="dark"] select.vms-input { background: var(--input-bg); color: var(--text); }
[data-theme="dark"] .vms-search { background: var(--input-bg); border-color: var(--input-border); }
[data-theme="dark"] .vms-select { background: var(--input-bg); border-color: var(--input-border); color: var(--text-muted); }
[data-theme="dark"] .vms-btn--default, [data-theme="dark"] .vms-btn.default { background: var(--surface2); border-color: var(--border); }
[data-theme="dark"] .vms-btn--ghost, [data-theme="dark"] .vms-btn.ghost { background: transparent; border-color: var(--border); }
[data-theme="dark"] .tbl-btn, [data-theme="dark"] .vms-tbl-btn { background: var(--surface2); border-color: var(--border); }
[data-theme="dark"] .vms-form-section-title { border-bottom-color: color-mix(in srgb, var(--accent, #e8604a) 20%, transparent); }
[data-theme="dark"] .sidebar { box-shadow: 2px 0 16px rgba(0,0,0,.35); }

/* ── SCROLLBARS ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── PAGE AMBIENT SHIMMER ─────────────────────────────────────────── */
.vms-shell::before {
  content: ''; position: fixed; inset: 0;
  background: linear-gradient(115deg, transparent 0%, transparent 38%, rgba(255,255,255,.022) 50%, transparent 62%, transparent 100%);
  background-size: 300% 300%;
  animation: ambient-shimmer 9s ease-in-out infinite;
  pointer-events: none; z-index: 9998;
}
@keyframes ambient-shimmer { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   Breakpoints (max-width):
     1439px  Large desktop → desktop
     1199px  Desktop → small laptop
      991px  Small laptop → tablet landscape
      767px  Tablet → mobile (sidebar becomes drawer)
      575px  Mobile
      479px  Large phone
      374px  Small phone
   ══════════════════════════════════════════════════════════════════ */

/* Touch targets (applies at all sizes) */
.vms-btn, .tbl-btn, .vms-nav-item, .pd-item { min-height: 44px; }
.vms-hamburger, .vms-theme-btn, .vms-reload-btn,
.vms-sidebar-toggle, .vms-tp-av-btn { min-height: 36px; min-width: 36px; }

/* ── ≤1439px: desktop → small laptop ───────────────────────────── */
@media (max-width: 1439px) {
  .vms-content    { padding: 18px 20px; }
}

/* ── ≤1199px: small laptop ──────────────────────────────────────── */
@media (max-width: 1199px) {
  .vms-kpi-row    { grid-template-columns: repeat(3, 1fr); }
  .g4             { grid-template-columns: repeat(2, 1fr); }
  .g6             { grid-template-columns: repeat(3, 1fr); }
  .vms-stat-grid  { grid-template-columns: repeat(2, 1fr); }
  .vms-content    { padding: 16px 18px; }
  .vms-topbar     { padding: 0 18px; }
}

/* ── ≤991px: small laptop / tablet landscape ────────────────────── */
@media (max-width: 991px) {
  :root           { --sidebar-w: 210px; }
  .vms-kpi-row    { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .g2, .g3        { grid-template-columns: 1fr; }
  .g3c            { grid-template-columns: repeat(2, 1fr); }
  .vms-content    { padding: 16px; }
}

/* ── 768px–1199px: laptop/tablet — fix topbar search overlap ───────
   The search bar is position:absolute centred on the full viewport.
   With a visible sidebar eating 210–232px, it clips under the
   sidebar or overlaps the profile button. Switch to relative/flex
   flow for the entire range where the sidebar is still visible.
   ─────────────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1199px) {
  .vms-topbar-search {
    position: relative;
    left: auto;
    transform: none;
    flex-shrink: 1;
    width: 240px;
  }
  .vms-topbar-search:focus-within { width: 280px; }
  .vms-page-title {
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  .vms-search-kbd { display: none; }
}

/* ── 768px–991px: narrower tablet — tighten search further ─────── */
@media (min-width: 768px) and (max-width: 991px) {
  .vms-topbar-search { width: 200px; }
  .vms-topbar-search:focus-within { width: 240px; }
  .vms-page-title { max-width: 160px; }
}

/* ── ≤767px: tablet / mobile ───────────────────────────────────── */
@media (max-width: 767px) {
  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    position: fixed !important; top: 0 !important; left: 0 !important;
    height: 100% !important; width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1) !important;
    z-index: 400; box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 32px rgba(0,0,0,.35);
  }
  /* Undo collapsed state inside the drawer */
  .sidebar.collapsed,
  .sidebar.open.collapsed {
    width: var(--sidebar-w) !important; min-width: var(--sidebar-w) !important;
  }
  .sidebar.open.collapsed { transform: translateX(0) !important; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .vms-logo-text,
  .sidebar.collapsed .vms-nav-label,
  .sidebar.collapsed .vms-nav-badge,
  .sidebar.collapsed .vms-site-chip { display: revert !important; }
  .sidebar.collapsed .vms-nav-item  { justify-content: flex-start !important; padding: 9px 16px !important; }
  .sidebar.collapsed .vms-user-row  { justify-content: flex-start !important; }
  .sidebar.collapsed .vms-nav-group-caret { display: block !important; }
  .sidebar.collapsed .vms-nav-group.open .vms-nav-group-children { display: flex !important; }

  .vms-hamburger        { display: flex !important; }
  .vms-sidebar-toggle   { display: none !important; }
  .vms-main             { width: 100% !important; }

  .vms-topbar           { padding: 0 14px; height: 52px; gap: 8px; }
  .vms-live-pill        { padding: 3px 8px; font-size: 10px; }

  /* Fix search bar: switch from absolute-centred to inline flow */
  .vms-topbar-search {
    position: relative;
    left: auto;
    transform: none;
    width: 180px;
    flex-shrink: 1;
  }
  .vms-topbar-search:focus-within { width: 220px; }
  .vms-search-kbd { display: none; }
  .vms-page-title {
    font-size: 14px;
    max-width: 130px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }

  .vms-kpi-row          { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vms-stat-grid        { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .g2, .g3, .g4, .g3c  { grid-template-columns: 1fr; }
  .g6                   { grid-template-columns: repeat(2, 1fr); }

  .vms-content          { padding: 14px; }

  .vms-table-wrap       { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .vms-table            { min-width: 560px; }

  .vms-filter-bar       { flex-wrap: wrap; gap: 6px; }
  .vms-search           { min-width: 100%; order: -1; }
  .vms-select           { flex: 1 1 auto; min-width: 120px; }

  .vms-form-grid        { grid-template-columns: 1fr; }
  .vms-form-group.full  { grid-column: 1; }

  .vms-actions-bar      { flex-wrap: wrap; gap: 6px; }
  .vms-actions-bar .vms-btn { flex: 1 1 130px; justify-content: center; }

  .vms-pass-card        { padding: 16px; }
  .vms-ptw-card         { flex-wrap: wrap; }
  .vms-ptw-actions      { flex-direction: row; flex-wrap: wrap; margin-top: 8px; width: 100%; }
  .vms-emergency-banner { flex-direction: column; align-items: flex-start; gap: 10px; }

  .vms-topbar-logo      { display: flex; }
  .vms-color-picker-panel { right: -50px; }
}

/* ── ≤575px: mobile ──────────────────────────────────────────────── */
@media (max-width: 575px) {
  .vms-topbar           { padding: 0 12px; gap: 6px; }
  .vms-page-title       { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vms-live-pill        { display: none; }
  .vms-topbar-sep       { display: none; }
  .vms-topbar-search    { display: none !important; }
  .tp-av-info, .tp-av-caret { display: none; }

  .vms-kpi              { padding: 11px 10px; }
  .vms-kpi-value        { font-size: 20px; }
  .vms-ring-wrap        { display: none; }

  .vms-stat-val         { font-size: 22px; }

  .vms-content          { padding: 12px; }
  .g6                   { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  .vms-actions-bar {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px; margin-bottom: 10px;
  }
  .vms-actions-bar::-webkit-scrollbar { display: none; }
  .vms-actions-bar .vms-btn { flex: 0 0 auto; min-width: unset; white-space: nowrap; }

  .tbl-btn              { padding: 6px 10px; font-size: 11px; min-height: 34px; }
  .vms-panel-row        { padding: 9px 10px; }
  .filter-pills, .vms-filter-pills { flex-wrap: wrap; }
  .vms-input, .vms-select { font-size: 16px; }
  .vms-color-picker-panel { right: -30px; }
}

/* ── ≤479px: large phone ─────────────────────────────────────────── */
@media (max-width: 479px) {
  .vms-kpi-row          { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vms-table            { min-width: 480px; }
  .vms-filter-bar       { gap: 5px; }
  .vms-select           { font-size: 13px; }
  .vms-tbl-btns         { flex-direction: column; gap: 4px; }
  .vms-tbl-btns .vms-btn { width: 100%; justify-content: center; }
  .ep-wrap              { gap: 4px; }
}

/* ── ≤374px: small mobile ────────────────────────────────────────── */
@media (max-width: 374px) {
  .vms-kpi-row          { gap: 6px; }
  .vms-kpi              { padding: 10px 8px; }
  .vms-kpi-value        { font-size: 18px; }
  .g6                   { grid-template-columns: 1fr; }
  .vms-content          { padding: 10px; }
  .vms-topbar           { padding: 0 10px; gap: 4px; }
  .vms-page-title       { max-width: 90px; }
  .vms-table            { min-width: 360px; }
}
