@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Barlow+Condensed:wght@500;600;700&display=swap');

:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-alt: #f4f6f8;
  --color-border: #e6eaee;
  --color-text: #0d0f12;
  --color-text-muted: #5b646d;
  --color-text-faint: #7e8892;

  --color-primary: #12557f;
  --color-primary-hover: #0f4a70;
  --color-primary-soft: #e6eef4;
  --color-accent: #12557f;
  --color-accent-100: #e6eef4;
  --color-accent-200: #c4d8e6;
  --color-accent-700: #0c3b5a;
  --color-accent-800: #092c43;

  --color-accent-2: #1c8a63;
  --color-accent-2-100: #e4f3ed;
  --color-accent-2-200: #bfe3d5;
  --color-accent-2-700: #125f45;
  --color-accent-2-800: #0d4633;

  --color-danger: #9a3324;
  --color-danger-soft: #f7e9e6;
  --color-danger-border: #e3c3ba;
  --color-success: #1c8a63;
  --color-success-soft: #e4f3ed;
  --color-warning: #8a5a00;
  --color-warning-soft: #f8eed9;
  --color-warning-border: #e6d2a0;
  --color-info-soft: #e6eef4;

  --color-neutral-100: #f4f6f8;
  --color-neutral-200: #e6eaee;
  --color-neutral-300: #d2d8de;
  --color-neutral-400: #aab3bc;
  --color-neutral-500: #7e8892;
  --color-neutral-600: #5b646d;
  --color-neutral-700: #3a424a;
  --color-neutral-800: #20262c;
  --color-neutral-900: #0d0f12;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(20, 30, 45, 0.08);
  --shadow-md: 0 4px 14px rgba(20, 30, 45, 0.10);
  --shadow-lg: 0 10px 34px rgba(20, 30, 45, 0.16);

  /* ---------- Glassmorphism ("white morphism") tokens, used throughout ---------- */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(16px);

  --sidebar-w: 222px;
  --topbar-h: 70px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-heading: "Barlow Condensed", var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(160deg, #f4f7fb 0%, #eef2f7 50%, #f7f5f1 100%);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
/* Soft, blurred colour blobs behind everything — fixed so they stay put while the page scrolls.
   This one background treatment is what makes every card/sidebar/drawer's translucency below
   actually read as "glass" rather than just plain white. */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none;
}
body::before { width: 480px; height: 480px; top: -140px; left: -120px; background: color-mix(in srgb, var(--color-primary) 26%, transparent); }
body::after { width: 440px; height: 440px; bottom: -160px; right: -120px; background: color-mix(in srgb, var(--color-primary) 18%, transparent); }
a { color: var(--color-primary); text-underline-offset: 3px; }
h1, h2, h3, h4 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
p { margin: 0 0 8px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: color-mix(in srgb, var(--color-primary) 25%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--color-neutral-300); }

/* ---------- App shell ---------- */
#shell-root { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}
.sidebar-brand {
  padding: 14px 18px 16px;
  display: flex; align-items: center; gap: 9px;
}
.sidebar-brand .mark {
  width: 20px; height: 20px; flex: none;
  border: 1.5px solid var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 10px; color: var(--color-primary);
}
.sidebar-brand .brand-text {
  font-family: var(--font-heading); font-weight: 600; font-size: 16px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-primary);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.sidebar-group-label {
  font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--color-neutral-500); padding: 14px 9px 5px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: var(--radius-sm);
  color: var(--color-neutral-700); text-decoration: none; font-size: 13px; font-weight: 500;
  margin: 1px 0;
}
.sidebar-link:hover { background: rgba(18, 85, 127, 0.08); color: var(--color-text); }
.sidebar-link.active { background: var(--color-accent-100); color: var(--color-accent-800); font-weight: 600; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--glass-border); font-size: 10px; line-height: 1.5; color: var(--color-neutral-500); }

.topbar {
  min-height: var(--topbar-h);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: stretch;
  padding: 0;
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.hamburger {
  display: none;
  border: none; background: none; cursor: pointer;
  width: 44px; flex: none;
  align-items: center; justify-content: center;
  font-size: 18px; color: var(--color-text);
}
.org-lockup {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-right: 1px solid var(--glass-border);
  flex: none;
}
.org-mark { width: 34px; height: 34px; flex: none; border: 1.5px solid var(--color-primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 12px; color: var(--color-primary); }
.topbar-title {
  align-self: center;
  padding: 10px 18px;
  font-family: var(--font-heading); font-size: 19px; font-weight: 600;
}
.topbar-title span { display: block; font-family: var(--font); font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-neutral-500); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; margin-left: auto; }
.viewing-as { display: flex; align-items: center; gap: 7px; }
.viewing-as-label { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-neutral-500); }
.viewing-as-role { font-size: 12.5px; font-weight: 600; color: var(--color-text); }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; }

.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 34px; height: 34px; flex: none;
  background: var(--color-neutral-200); border: 1px solid var(--color-neutral-300);
  color: var(--color-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
}
.avatar-photo { background-size: cover; background-position: center; }
.user-meta { line-height: 1.25; }
.user-meta .name { font-size: 13px; font-weight: 600; }
.user-meta .role { font-size: 11px; color: var(--color-text-muted); letter-spacing: 0.03em; }

.main-col { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.page { padding: 22px 26px 60px; max-width: 1320px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-sub { color: var(--color-text-muted); font-size: 12.5px; letter-spacing: 0.02em; max-width: 68ch; }

.sidebar-scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-col { margin-left: 0; }
  .hamburger { display: flex; }
  .org-lockup { padding: 10px 12px; }
  .user-meta { display: none; }
  .sidebar-scrim.open { display: block; position: fixed; inset: 0; background: rgba(13, 15, 18, 0.45); z-index: 30; }
  .page { padding: 16px 14px 50px; }
  .topbar-right { gap: 8px; }
  .viewing-as { display: none; }
}

/* ---------- Components ---------- */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (min-width: 901px) and (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.kpi, .modal, .drawer-corners {
  position: relative;
  background-color: var(--color-surface);
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--color-accent), var(--color-accent)), linear-gradient(var(--color-accent), var(--color-accent)),
    linear-gradient(var(--color-accent), var(--color-accent)), linear-gradient(var(--color-accent), var(--color-accent)),
    linear-gradient(var(--color-accent), var(--color-accent)), linear-gradient(var(--color-accent), var(--color-accent)),
    linear-gradient(var(--color-accent), var(--color-accent)), linear-gradient(var(--color-accent), var(--color-accent));
  background-size: 1.5px 11px, 11px 1.5px, 1.5px 11px, 11px 1.5px, 1.5px 11px, 11px 1.5px, 1.5px 11px, 11px 1.5px;
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
}
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-primary); }
.kpi .value { font-family: var(--font-heading); font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi .delta { font-size: 12px; color: var(--color-accent-2); }
.kpi .delta.down { color: var(--color-danger); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 15px;
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid transparent; text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-color: var(--glass-border); color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-accent-100); }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-sm { padding: 6px 11px; font-size: 11px; }
.btn-lg { padding: 14px 20px; font-size: 13px; width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .sidebar-link:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}

.badge.live { animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-success { background: var(--color-success-soft); color: var(--color-accent-2-700); border-color: var(--color-accent-2-200); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: var(--color-warning-border); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger-border); }
.badge-info { background: var(--color-accent-100); color: var(--color-accent-800); border-color: var(--color-accent-200); }
.badge-neutral { background: transparent; color: var(--color-neutral-600); border-color: var(--color-neutral-300); }
.badge.clickable { cursor: pointer; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap, .tbl-wrap { overflow-x: auto; }
th {
  text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--color-neutral-600); background: rgba(20, 30, 45, 0.04);
  padding: 10px 12px; border-bottom: 1px solid var(--glass-border); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid rgba(20, 30, 45, 0.07); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: rgba(18, 85, 127, 0.05); }

.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
input, select, textarea {
  border: 1px solid rgba(20, 30, 45, 0.14); border-radius: var(--radius-sm);
  padding: 8px 10px; background: rgba(255, 255, 255, 0.55); color: var(--color-text); width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:hover, select:hover, textarea:hover { background: rgba(255, 255, 255, 0.8); }
input:focus, select:focus, textarea:focus { outline: none; background: rgba(255, 255, 255, 0.9); border-color: var(--color-primary); }
.field-hint { font-size: 11px; color: var(--color-text-faint); }
.field-error { font-size: 11px; color: var(--color-danger); }

label.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
label.field input, label.field select, label.field textarea { margin-top: 0; font-size: 14px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--color-text); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; font-size: 12.5px; font-weight: 500; color: var(--color-neutral-700); cursor: pointer;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: 999px; white-space: nowrap;
}
.tab.active { color: #fff; background: var(--color-primary); border-color: var(--color-primary); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Auth page ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.auth-card {
  position: relative; z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 380px; padding: 32px 28px;
}
.auth-logo { margin-bottom: 18px; }
.auth-logo .mark { width: 44px; height: 44px; border: 1.5px solid var(--color-primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 15px; color: var(--color-primary); }
.auth-title { font-family: var(--font-heading); font-size: 15px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-primary); }
.auth-sub { font-size: 12px; color: var(--color-text-muted); margin-bottom: 20px; letter-spacing: 0.02em; }

/* ---------- Side drawer (ported from SPTS/HRIS's own drawer/form-drawer pattern) ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(20, 30, 45, 0.28); backdrop-filter: blur(2px); z-index: 65; display: flex; justify-content: flex-end; }
.drawer {
  width: min(480px, 100%); height: 100%;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  animation: tin 0.18s ease-out;
}
.drawer-head { display: flex; align-items: flex-start; gap: 12px; }
.drawer-title { font-family: var(--font-heading); font-size: 22px; line-height: 1.15; font-weight: 600; }
.drawer-sub { font-size: 12px; color: var(--color-neutral-600); margin-top: 2px; }
.drawer-close { flex: none; }
.drawer-group { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--glass-border); padding-top: 14px; }
.drawer-group:first-child { border-top: none; padding-top: 0; }
.drawer-group-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); font-weight: 600; }
@media (max-width: 560px) { .drawer { width: 100%; } }

/* Centered pop-up dialog (licenses.js's "Manage license") — distinct from the side-sliding .drawer
   above: bigger, centered, and used only for that one screen rather than every create/edit flow.
   .modal itself (width/position/etc.) is layered on top of the shared corner-bracket decoration
   already defined for .kpi/.modal/.drawer-corners earlier in this file. */
.modal-scrim { position: fixed; inset: 0; background: rgba(20, 30, 45, 0.4); backdrop-filter: blur(2px); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal {
  width: min(760px, 100%); max-height: min(88vh, 900px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: tin 0.18s ease-out;
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--glass-border); flex: none; }
.modal-title { font-family: var(--font-heading); font-size: 22px; line-height: 1.15; font-weight: 600; }
.modal-sub { font-size: 12px; color: var(--color-neutral-600); margin-top: 2px; }
.modal-body { overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--glass-border); flex: none; }
@media (max-width: 800px) { .modal-scrim { padding: 0; } .modal { width: 100%; height: 100%; max-height: 100%; } }

/* Per-module allowed-URL editor inside the manage-license modal — add one at a time, delete hits
   the database immediately (see licenses.js's addModuleUrl/removeModuleUrl), unlike the bulk
   save-on-submit textarea ModuleGrants still uses for a brand-new license's initial URLs. */
.url-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.url-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: color-mix(in srgb, var(--color-text) 4%, transparent); border-radius: var(--radius-sm); font-size: 12.5px; }
.url-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.url-row button { flex: none; }
.url-add-row { display: flex; gap: 8px; }
.url-add-row input { flex: 1; }

/* Verify-call log inside the manage modal — refreshed on a timer while the modal is open (see
   licenses.js's refreshVerifyLog), so it actually reflects a product's real check-in cadence
   instead of a snapshot taken once when the modal was opened. */
.verify-log-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent-2); margin-right: 6px; animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: rgba(13, 15, 18, 0.82); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 12.5px; box-shadow: var(--shadow-lg); min-width: 220px;
}
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-accent-2); }

.empty-state, .empty { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }
.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); font-size: 12px; }
.divider { height: 1px; background: var(--color-border); margin: 14px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }

.note { font-size: 12.5px; line-height: 1.55; color: var(--color-neutral-700); border-left: 2px solid var(--color-accent-2); padding-left: 12px; }

/* ---------- FLMS-specific: live tracking map ---------- */
.mapbox { position: relative; height: 460px; border: 1px solid var(--color-neutral-200); overflow: hidden; isolation: isolate; box-shadow: var(--shadow-sm); }
.mapbox.tall { height: 600px; }
.leaflet-container { font-family: var(--font); background: var(--color-neutral-200); }

/* Global VoIP call banner (voip-call.js) — fixed to the top of the viewport so it's visible
   regardless of which screen is currently open, same idea as a phone's own incoming-call UI. */
#voip-overlay { position: fixed; top: 0; left: 0; right: 0; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
.voip-banner { pointer-events: auto; margin-top: 10px; background: var(--color-neutral-900); color: #fff; border-radius: 0; box-shadow: var(--shadow-lg); padding: 10px 16px; display: flex; align-items: center; gap: 16px; font-size: 13px; }
.voip-banner-info { display: flex; align-items: center; gap: 8px; }
.voip-banner-actions { display: flex; gap: 8px; }
.voip-incoming { background: var(--color-accent-2); }
.voip-active { background: var(--color-neutral-900); }
#voip-timer { font-variant-numeric: tabular-nums; opacity: 0.8; }

/* Floating VoIP quick-dial button + popover (voip-call.js) — present on every authenticated page so
   a call can be placed without leaving whatever screen someone's on. Sits above page content but
   below the incoming-call/active-call banner (z-index 90) so an active call banner always wins. */
.voip-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 85;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-primary); color: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.voip-fab:hover { background: var(--color-primary-hover); transform: scale(1.05); }
.voip-fab .voip-fab-dot {
  position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--color-accent-2); border: 2px solid var(--color-surface); display: none;
}
.voip-fab.has-online .voip-fab-dot { display: block; }

.voip-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 85;
  width: 300px; max-height: 60vh; display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-neutral-200); box-shadow: var(--shadow-lg);
  animation: tin 0.15s ease-out;
}
.voip-panel-head { padding: 12px 14px; border-bottom: 1px solid var(--color-neutral-200); display: flex; align-items: center; justify-content: space-between; }
.voip-panel-head b { font-family: var(--font-heading); font-size: 14px; }
.voip-panel-list { overflow-y: auto; padding: 6px; }
.voip-panel-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; }
.voip-panel-row:hover { background: var(--color-neutral-100); }
.voip-panel-row .name { font-size: 12.5px; font-weight: 600; }
.voip-panel-row .sub { font-size: 10.5px; color: var(--color-text-faint); }
.voip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-neutral-400); flex: none; }
.voip-dot.online { background: var(--color-accent-2); }
.voip-panel-foot { padding: 8px 14px; border-top: 1px solid var(--color-neutral-200); text-align: center; }
.voip-panel-foot a { font-size: 11.5px; }
