@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --blue-50: #eff5ff;
  --blue-100: #dbe8ff;
  --blue-200: #bfd5ff;
  --blue-500: #2563eb;
  --blue-600: #1d4ed8;
  --blue-700: #1e40af;
  --blue-900: #0b1f4d;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;
  --white: #ffffff;
  --green-50: #ecfdf5;
  --green-500: #10b981;
  --green-700: #047857;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-700: #b45309;
  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-700: #b91c1c;
  --purple-50: #f5f3ff;
  --purple-500: #8b5cf6;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 150ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #eef2f7; font-family: 'Inter', system-ui, sans-serif; color: var(--ink-900); -webkit-font-smoothing: antialiased; }

/* ===== APP SHELL ===== */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--ink-50); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 248px; background: var(--blue-900); color: #cfd8ea;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; flex-shrink: 0;
  z-index: 30;
}
.brand { padding: 20px 22px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 10px rgba(59,130,246,.4);
}
.brand-name { color: white; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: #8fa4c7; margin-top: 1px; }

.tenant-picker {
  margin: 14px 14px 6px; padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,.04); display: flex; align-items: center; gap: 10px;
  cursor: pointer; border: 1px solid rgba(255,255,255,.06);
  transition: background var(--transition);
}
.tenant-picker:hover { background: rgba(255,255,255,.08); }
.tenant-picker .t-avatar {
  width: 26px; height: 26px; border-radius: 6px; background: #fff; color: var(--blue-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px;
}
.tenant-picker .t-name { color: white; font-size: 13px; font-weight: 600; line-height: 1.1; }
.tenant-picker .t-meta { color: #8fa4c7; font-size: 11px; margin-top: 2px; }
.tenant-picker .chev { margin-left: auto; color: #8fa4c7; font-size: 12px; }

.nav-section { padding: 14px 14px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: #6f83a8; font-weight: 600; }
.nav { padding: 0 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 7px;
  color: #c3cee2; text-decoration: none; font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; transition: background var(--transition), color var(--transition);
}
.nav a:hover { background: rgba(255,255,255,.05); color: white; }
.nav a.active { background: var(--blue-500); color: white; box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.nav a .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }
.nav a .badge {
  margin-left: auto; background: rgba(255,255,255,.12); color: white;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.nav a.active .badge { background: rgba(255,255,255,.22); }
.nav a .badge.warn { background: var(--amber-500); color: #3b2500; }

.side-foot {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}
.side-foot .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--blue-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.side-foot .who { font-size: 13px; color: white; font-weight: 600; line-height: 1.15; }
.side-foot .role { font-size: 11px; color: #8fa4c7; margin-top: 1px; }
.side-foot .logout-btn {
  color: #8fa4c7; cursor: pointer; padding: 4px; border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.side-foot .logout-btn:hover { color: white; background: rgba(255,255,255,.08); }

/* ===== MAIN ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ===== TOPBAR ===== */
.topbar {
  height: 60px; background: white; border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; padding: 0 28px; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 12.5px; color: var(--ink-500); white-space: nowrap; }
.crumb b { color: var(--ink-900); font-weight: 600; }
.search {
  flex: 1; max-width: 420px; margin-left: 16px;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink-100); border: 1px solid transparent;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--ink-500);
}
.search input {
  border: none; background: transparent; outline: none; flex: 1;
  font-size: 13px; font-family: inherit; color: var(--ink-900);
}
.search .kbd {
  border: 1px solid var(--ink-300); background: white; border-radius: 4px;
  padding: 1px 6px; font-size: 10.5px; color: var(--ink-500); font-family: 'Inter'; font-weight: 600;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--ink-200);
  background: white; display: flex; align-items: center; justify-content: center;
  color: var(--ink-700); cursor: pointer; position: relative;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--ink-100); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px;
  background: var(--red-500); border-radius: 50%; border: 2px solid white;
}
.top-divider { width: 1px; height: 22px; background: var(--ink-200); }
.top-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ===== PAGE ===== */
.page { padding: 22px 28px 40px; animation: fadeIn 200ms ease; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 4px; }
.page-sub { font-size: 13px; color: var(--ink-500); }
.page-sub .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green-700); font-weight: 600; margin-left: 10px;
}
.page-sub .live::before {
  content: ""; width: 7px; height: 7px; background: var(--green-500);
  border-radius: 50%; box-shadow: 0 0 0 3px rgba(16,185,129,.2);
}

.head-actions { display: flex; align-items: center; gap: 10px; }

/* ===== BUTTONS ===== */
.btn {
  height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  font-family: inherit; display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; border: 1px solid transparent; transition: all var(--transition);
}
.btn-ghost { background: white; border-color: var(--ink-200); color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-primary { background: var(--blue-500); color: white; box-shadow: 0 2px 6px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--blue-600); }
.btn-danger { background: var(--red-500); color: white; }
.btn-danger:hover { background: var(--red-700); }
.btn-success { background: var(--green-500); color: white; }
.btn-success:hover { background: var(--green-700); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

.seg { display: inline-flex; background: white; border: 1px solid var(--ink-200); border-radius: 8px; padding: 3px; }
.seg button {
  border: none; background: transparent; font-family: inherit; font-size: 12.5px;
  font-weight: 600; padding: 6px 12px; border-radius: 6px; color: var(--ink-500);
  cursor: pointer; transition: all var(--transition);
}
.seg button.on { background: var(--blue-50); color: var(--blue-700); }

/* ===== KPI CARDS ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpis.cols-5 { grid-template-columns: repeat(5, 1fr); }
.kpi {
  background: white; border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  cursor: pointer; transition: box-shadow var(--transition), transform var(--transition);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi .k-label { font-size: 12px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .k-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.kpi .k-val { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.kpi .k-val small { font-size: 14px; color: var(--ink-500); font-weight: 600; margin-left: 4px; }
.kpi .k-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-500); }
.k-trend {
  display: inline-flex; align-items: center; gap: 3px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px; font-size: 11.5px;
}
.k-trend.up { background: var(--green-50); color: var(--green-700); }
.k-trend.down { background: var(--red-50); color: var(--red-700); }
.kpi.blue .k-icon { background: var(--blue-50); color: var(--blue-600); }
.kpi.amber .k-icon { background: var(--amber-50); color: var(--amber-700); }
.kpi.red .k-icon { background: var(--red-50); color: var(--red-700); }
.kpi.green .k-icon { background: var(--green-50); color: var(--green-700); }
.kpi.purple .k-icon { background: var(--purple-50); color: var(--purple-500); }
.spark { margin-top: 6px; height: 34px; width: 100%; }

/* ===== CARDS ===== */
.card {
  background: white; border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title .count { background: var(--ink-100); color: var(--ink-700); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.card-sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.card-body { padding: 18px; }
.link { font-size: 12.5px; color: var(--blue-600); font-weight: 600; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ===== GRID ===== */
.grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; }
.grid-full { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--ink-200);
  background: white; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tab {
  padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--ink-500);
  border-bottom: 2px solid transparent; cursor: pointer;
  display: flex; align-items: center; gap: 6px; margin-bottom: -1px;
  transition: color var(--transition);
}
.tab .n { background: var(--ink-100); color: var(--ink-700); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; }
.tab.on { color: var(--blue-700); border-bottom-color: var(--blue-500); }
.tab.on .n { background: var(--blue-50); color: var(--blue-700); }

/* ===== TABLE ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; color: var(--ink-500); text-transform: uppercase;
  letter-spacing: .5px; font-weight: 600; padding: 10px 18px;
  background: var(--ink-50); border-bottom: 1px solid var(--ink-200);
  cursor: default; white-space: nowrap;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink-700); }
.table th .sort-indicator { display: inline-block; margin-left: 4px; font-size: 10px; }
.table td {
  padding: 12px 18px; border-bottom: 1px solid var(--ink-100);
  font-size: 13px; color: var(--ink-900); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--ink-50); }
.table tr.clickable { cursor: pointer; }
.table tr.conflict-row td { background: var(--red-50); }
.table tr.conflict-row:hover td { background: #fde8e8; }

/* ===== CHIPS & BADGES ===== */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  font-weight: 600; padding: 3px 9px; border-radius: 10px; line-height: 1;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.chip.checked, .chip.active, .chip.online, .chip.synced, .chip.connected, .chip.approved, .chip.complete, .chip.confirmed { background: var(--green-50); color: var(--green-700); }
.chip.checked::before, .chip.active::before, .chip.online::before, .chip.synced::before, .chip.connected::before, .chip.approved::before, .chip.complete::before, .chip.confirmed::before { background: var(--green-500); }
.chip.expected, .chip.assigned, .chip.pending { background: var(--blue-50); color: var(--blue-700); }
.chip.expected::before, .chip.assigned::before, .chip.pending::before { background: var(--blue-500); }
.chip.expiring, .chip.suspended, .chip.stale, .chip.warn, .chip.escalated, .chip.medium { background: var(--amber-50); color: var(--amber-700); }
.chip.expiring::before, .chip.suspended::before, .chip.stale::before, .chip.warn::before, .chip.escalated::before, .chip.medium::before { background: var(--amber-500); }
.chip.failed, .chip.terminated, .chip.offline, .chip.error, .chip.denied, .chip.rejected, .chip.high, .chip.open { background: var(--red-50); color: var(--red-700); }
.chip.failed::before, .chip.terminated::before, .chip.offline::before, .chip.error::before, .chip.denied::before, .chip.rejected::before, .chip.high::before, .chip.open::before { background: var(--red-500); }
.chip.closed, .chip.resolved, .chip.completed, .chip.low { background: var(--ink-100); color: var(--ink-700); }
.chip.closed::before, .chip.resolved::before, .chip.completed::before, .chip.low::before { background: var(--ink-400); }
.chip.incomplete { background: var(--purple-50); color: var(--purple-500); }
.chip.incomplete::before { background: var(--purple-500); }
.chip.untested { background: var(--ink-100); color: var(--ink-500); }
.chip.untested::before { background: var(--ink-400); }
.chip.disconnected { background: var(--ink-100); color: var(--ink-700); }
.chip.disconnected::before { background: var(--ink-400); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px;
  font-weight: 600; color: var(--ink-700); background: var(--ink-100);
  padding: 2px 7px; border-radius: 8px;
}
.urgency-badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.urgency-badge.urgent { background: var(--red-50); color: var(--red-700); }
.urgency-badge.normal { background: var(--ink-100); color: var(--ink-700); }

/* ===== VISITOR NAME ===== */
.vname { display: flex; align-items: center; gap: 10px; }
.vava {
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 11px;
}
.vava.b1 { background: #dbeafe; color: #1e40af; }
.vava.b2 { background: #fef3c7; color: #92400e; }
.vava.b3 { background: #dcfce7; color: #166534; }
.vava.b4 { background: #fce7f3; color: #9d174d; }
.vava.b5 { background: #e0e7ff; color: #3730a3; }
.vava.b6 { background: #fef2f2; color: #b91c1c; }
.vsub { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--ink-200); flex-wrap: wrap;
}
.toolbar-search {
  display: flex; align-items: center; gap: 8px; background: var(--ink-100);
  border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 6px 12px;
  min-width: 220px;
}
.toolbar-search input {
  border: none; background: transparent; outline: none; font-size: 13px;
  font-family: inherit; color: var(--ink-900); width: 100%;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ===== DROPDOWN FILTER ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-trigger {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--ink-200); border-radius: var(--radius); background: white;
  font-size: 12.5px; font-weight: 600; color: var(--ink-700); cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
.dropdown-trigger:hover { border-color: var(--blue-500); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 180px;
  background: white; border: 1px solid var(--ink-200); border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 50; padding: 4px 0;
}
.dropdown-menu.open { display: block; animation: fadeIn 150ms ease; }
.dropdown-menu .dropdown-item {
  padding: 8px 14px; font-size: 13px; color: var(--ink-700); cursor: pointer;
  transition: background var(--transition);
}
.dropdown-menu .dropdown-item:hover { background: var(--blue-50); color: var(--blue-700); }
.dropdown-menu .dropdown-item.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--ink-200);
}
.pagination-info { font-size: 12px; color: var(--ink-500); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button {
  padding: 6px 12px; border: 1px solid var(--ink-200); border-radius: 6px;
  background: white; font-size: 12px; font-weight: 600; color: var(--ink-700);
  cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.pagination-btns button:hover { background: var(--ink-100); }
.pagination-btns button.on { background: var(--blue-500); color: white; border-color: var(--blue-500); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--ink-200); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; color: var(--ink-900);
  background: white; transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--blue-500); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue-500); }

/* ===== DETAIL PANEL ===== */
.detail-panel {
  background: var(--ink-50); border-top: 2px solid var(--blue-500);
  padding: 18px; animation: slideDown 200ms ease;
}
.detail-panel .detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-panel .detail-item { }
.detail-panel .detail-label { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; margin-bottom: 4px; }
.detail-panel .detail-value { font-size: 13px; color: var(--ink-900); }

/* ===== ALERT BANNER ===== */
.alert {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  background: linear-gradient(0deg, #fffbeb, #fffbeb), white;
  border: 1px solid #fde68a; border-radius: 10px; margin-bottom: 16px;
}
.alert .a-ico {
  width: 28px; height: 28px; border-radius: 6px; background: var(--amber-500);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.alert .a-txt { font-size: 13px; color: var(--amber-700); font-weight: 600; flex: 1; }
.alert .a-txt span { color: var(--ink-700); font-weight: 500; margin-left: 4px; }
.alert .a-cta {
  background: white; border: 1px solid #fde68a; color: var(--amber-700);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  transition: background var(--transition);
}
.alert .a-cta:hover { background: var(--amber-50); }

/* ===== OCCUPANCY/CHART ===== */
.occ-body { padding: 16px 18px 6px; }
.occ-summary { display: flex; align-items: center; gap: 24px; margin-bottom: 12px; }
.occ-big { font-size: 32px; font-weight: 700; letter-spacing: -.6px; line-height: 1; }
.occ-big small { font-size: 14px; font-weight: 600; color: var(--ink-500); margin-left: 4px; }
.occ-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.leg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-700); }
.leg .sw { width: 10px; height: 10px; border-radius: 3px; }
.chart-wrap { padding: 6px 18px 16px; }
.access-strip {
  display: flex; gap: 0; padding: 14px 18px; border-top: 1px solid var(--ink-200);
  background: var(--ink-50); border-radius: 0 0 12px 12px;
}
.acc-item { flex: 1; padding: 0 14px; border-right: 1px solid var(--ink-200); }
.acc-item:last-child { border-right: none; }
.acc-lab { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.acc-val { font-size: 18px; font-weight: 700; margin-top: 4px; }
.acc-sub { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* ===== HELPDESK QUEUE ===== */
.queue { padding: 6px 0; }
.q-item {
  display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--ink-100);
  cursor: pointer; transition: background var(--transition);
}
.q-item:last-child { border-bottom: none; }
.q-item:hover { background: var(--ink-50); }
.q-prio { width: 4px; border-radius: 3px; flex-shrink: 0; }
.q-prio.p1 { background: var(--red-500); }
.q-prio.p2 { background: var(--amber-500); }
.q-prio.p3 { background: var(--blue-500); }
.q-body { flex: 1; min-width: 0; }
.q-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.q-id { font-size: 11.5px; color: var(--ink-500); font-weight: 600; font-family: 'Inter'; }
.q-cat { font-size: 11px; background: var(--ink-100); color: var(--ink-700); padding: 1px 7px; border-radius: 8px; font-weight: 600; }
.q-sla { font-size: 11px; font-weight: 600; margin-left: auto; }
.q-sla.bad { color: var(--red-700); }
.q-sla.warn { color: var(--amber-700); }
.q-sla.ok { color: var(--green-700); }
.q-title { font-size: 13px; font-weight: 600; color: var(--ink-900); margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-meta { font-size: 11.5px; color: var(--ink-500); display: flex; align-items: center; gap: 10px; }
.q-meta .assignee { display: inline-flex; align-items: center; gap: 5px; }
.q-meta .assignee .a {
  width: 16px; height: 16px; border-radius: 50%; background: var(--blue-100);
  color: var(--blue-700); display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}

/* ===== BOOKINGS ===== */
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.book-cell { padding: 14px 18px; border-right: 1px solid var(--ink-200); border-bottom: 1px solid var(--ink-200); }
.book-cell:nth-child(2n) { border-right: none; }
.book-cell:nth-last-child(-n+2) { border-bottom: none; }
.book-lab { font-size: 11.5px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; gap: 5px; }
.book-val { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin-top: 6px; }
.book-val span { font-size: 13px; color: var(--ink-500); font-weight: 600; }
.book-bar { margin-top: 8px; height: 6px; background: var(--ink-100); border-radius: 3px; overflow: hidden; }
.book-bar > span { display: block; height: 100%; border-radius: 3px; }
.book-foot { font-size: 11px; color: var(--ink-500); margin-top: 6px; }

/* ===== ANNOUNCEMENTS ===== */
.ann-item { padding: 12px 18px; border-bottom: 1px solid var(--ink-100); display: flex; gap: 12px; }
.ann-item:last-child { border-bottom: none; }
.ann-badge {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px;
}
.ann-badge.b1 { background: var(--blue-50); color: var(--blue-700); }
.ann-badge.b2 { background: var(--purple-50); color: var(--purple-500); }
.ann-badge.b3 { background: var(--amber-50); color: var(--amber-700); }
.ann-title { font-size: 13px; font-weight: 600; margin: 0 0 3px; }
.ann-desc { font-size: 12px; color: var(--ink-500); line-height: 1.45; margin: 0; }
.ann-meta { font-size: 11px; color: var(--ink-400); margin-top: 5px; display: flex; align-items: center; gap: 8px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 200ms ease;
}
.modal-overlay.modal-open { opacity: 1; }
.modal {
  background: white; border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(15,23,42,.2);
  width: 90%; max-width: 520px; max-height: 80vh; overflow-y: auto;
  transform: translateY(10px); transition: transform 200ms ease;
}
.modal-open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--ink-200);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; border: none; background: var(--ink-100); border-radius: 6px;
  cursor: pointer; font-size: 14px; color: var(--ink-500);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--ink-200); }
.modal-body { padding: 20px; }
.modal-actions { padding: 16px 20px; border-top: 1px solid var(--ink-200); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 200;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius); display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; min-width: 280px; box-shadow: var(--shadow-md);
  transform: translateX(120%); transition: transform 300ms cubic-bezier(.4,0,.2,1);
}
.toast.toast-show { transform: translateX(0); }
.toast-icon { font-size: 16px; font-weight: 700; }

/* ===== INTEGRATION CARDS ===== */
.integration-card {
  border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 20px; background: white;
}
.integration-card .int-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.integration-card .int-name { font-size: 16px; font-weight: 700; }
.integration-card .int-field { margin-bottom: 12px; }
.integration-card .int-field label { font-size: 12px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; }

/* ===== CONFIG SECTION ===== */
.config-section { margin-bottom: 24px; }
.config-section .section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ===== LOGIN ===== */
.login-container {
  width: 1440px; margin: 0 auto; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue-900) 0%, #172554 50%, var(--blue-900) 100%);
}
.login-box {
  background: white; border-radius: 16px; padding: 40px; width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-box .login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 32px;
}
.login-box .login-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-box .login-sub { font-size: 14px; color: var(--ink-500); margin-bottom: 24px; }
.user-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 2px solid var(--ink-200); border-radius: var(--radius-lg);
  cursor: pointer; margin-bottom: 12px; transition: all var(--transition);
}
.user-card:hover { border-color: var(--blue-500); background: var(--blue-50); }
.user-card.selected { border-color: var(--blue-500); background: var(--blue-50); }
.user-card .uc-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.user-card .uc-name { font-size: 15px; font-weight: 600; }
.user-card .uc-role { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.user-card .uc-scope { font-size: 11px; color: var(--blue-600); font-weight: 600; margin-top: 2px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== TOGGLE ===== */
.toggle-group { display: inline-flex; border: 1px solid var(--ink-200); border-radius: var(--radius); overflow: hidden; }
.toggle-btn {
  padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-700);
  background: white; border: none; cursor: pointer; font-family: inherit;
  border-right: 1px solid var(--ink-200); transition: all var(--transition);
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn.on { background: var(--blue-500); color: white; }

/* ===== INLINE EDIT ===== */
.inline-input {
  width: 80px; padding: 4px 8px; border: 1px solid var(--blue-500); border-radius: 6px;
  font-size: 13px; font-family: inherit; text-align: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--ink-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state .empty-text { font-size: 14px; font-weight: 500; }

/* ===== MISC ===== */
.rcol { display: flex; flex-direction: column; gap: 16px; }
.mini-ico { width: 14px; height: 14px; }
.tbtn {
  border: 1px solid var(--ink-200); background: white; color: var(--ink-700);
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px;
  border-radius: 6px; cursor: pointer; transition: all var(--transition);
}
.tbtn:hover { background: var(--ink-100); }
.tbtn.primary { background: var(--blue-500); color: white; border-color: var(--blue-500); }
.tbtn.primary:hover { background: var(--blue-600); }
.tbtn.danger { background: var(--red-500); color: white; border-color: var(--red-500); }
.tbtn.danger:hover { background: var(--red-700); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--ink-500); }
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.warning-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--amber-50); border: 1px solid var(--amber-500);
  border-radius: var(--radius); font-size: 12px; color: var(--amber-700); font-weight: 600;
}
