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

:root {
  color-scheme: dark;
  /* Apple macOS dark palette */
  --bg: #1c1c1e;
  --bg-soft: #2c2c2e;
  --surface: rgba(44,44,46,0.82);
  --surface-2: rgba(58,58,60,0.85);
  --surface-3: rgba(72,72,74,0.88);
  --surface-strong: rgba(88,88,90,0.9);
  /* Borders */
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --line-glow: rgba(34, 199, 192,0.3);
  /* Text */
  --text: rgba(255,255,255,0.92);
  --text-soft: rgba(255,255,255,0.60);
  --muted: rgba(255,255,255,0.36);
  --muted-strong: rgba(255,255,255,0.50);
  /* Apple system colors */
  --primary: #22c7c0;
  --primary-strong: #0f948f;
  --primary-bg: rgba(34, 199, 192,0.12);
  --primary-soft: rgba(34, 199, 192,0.18);
  --accent: #30D158;
  --accent-soft: rgba(48,209,88,0.14);
  --danger: #FF453A;
  --danger-soft: rgba(255,69,58,0.14);
  --warn: #FF9F0A;
  --warn-soft: rgba(255,159,10,0.14);
  --success: #30D158;
  --success-soft: rgba(48,209,88,0.14);
  /* Radii - Apple style */
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  /* Shadows */
  --shadow-card: 0 0 0 0.5px rgba(0,0,0,0.5), 0 4px 24px rgba(0,0,0,0.5);
  --shadow-soft: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(34, 199, 192,0.2);
  --focus-ring: 0 0 0 3px rgba(34, 199, 192,0.4);
  /* Transitions */
  --ease: cubic-bezier(0.25,0.46,0.45,0.94);
  --duration: 0.18s;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & GLOBAL BASE
   ═══════════════════════════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-wrap {
  min-height: 100vh;
  padding: 16px 12px 24px;
  display: flex;
  justify-content: center;
}

.app {
  width: min(1200px, 100%);
  display: grid;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 8px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(28,28,30,0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #22c7c0 0%, #22d9a8 100%);
  box-shadow: 0 6px 16px -6px rgba(34, 199, 192, 0.6);
  flex-shrink: 0;
}

/* ── Badge ─────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.auth {
  color: #a0ffd8;
  border-color: rgba(34, 217, 168, 0.36);
  background: rgba(34, 217, 168, 0.12);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHELL — Card Container System
   ═══════════════════════════════════════════════════════════════════════════ */

.shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 32px 64px -16px rgba(0,0,0,0.4);
  animation: fade-up 0.28s var(--ease) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SHELL
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-shell {
  display: grid;
  gap: 14px;
}

.auth-title {
  display: grid;
  gap: 6px;
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(34, 217, 168, 0.36);
  background: rgba(34, 217, 168, 0.12);
  color: #a0ffd8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-title h2 {
  margin: 0;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.auth-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 560px;
}

.auth-2fa {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(34, 199, 192, 0.06);
}

.auth-2fa-head {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.auth-2fa-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

body.auth-screen .page-wrap {
  align-items: center;
}

body.auth-screen .app {
  width: min(680px, 100%);
}

body.auth-screen .topbar {
  display: none;
}

body.auth-screen .auth-shell {
  padding: 24px;
  border-color: rgba(34, 199, 192, 0.28);
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 199, 192, 0.14), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(34, 217, 168, 0.08), transparent 45%),
    rgba(12, 20, 36, 0.94);
  box-shadow: 0 20px 48px -26px rgba(0, 0, 0, 0.66), 0 0 0 1px rgba(34, 199, 192, 0.12) inset;
}

body.auth-screen .auth-grid {
  grid-template-columns: 1fr;
  max-width: none;
}

body.auth-screen .auth-grid .btn {
  min-height: 44px;
  font-size: 15px;
}

body.auth-screen .auth-2fa-row {
  grid-template-columns: 1fr;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WORKSPACE
   ═══════════════════════════════════════════════════════════════════════════ */

.workspace {
  display: grid;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HEAD
   ═══════════════════════════════════════════════════════════════════════════ */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

input,
textarea,
select {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: #e2e8f0;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 9px 12px;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: #6b8bb5;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7a9bc0 50%),
    linear-gradient(135deg, #7a9bc0 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.25);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  color: #fff;
  border-color: rgba(34, 199, 192, 0.6);
  background: var(--primary);
  box-shadow: 0 8px 20px -10px rgba(34, 199, 192, 0.7);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 28px -10px rgba(34, 199, 192, 0.85);
}

.btn-dark {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.btn-dark:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.btn-soft {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.btn-soft:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.btn-mini {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
}

.btn-open-cq {
  color: #fff;
  border-color: rgba(34, 199, 192, 0.5);
  background: var(--primary);
}

.btn-copy-id {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.btn-claim {
  color: #c0ffe4;
  border-color: rgba(34, 217, 168, 0.4);
  background: rgba(34, 217, 168, 0.12);
}

.btn-snooze {
  color: #ffdba8;
  border-color: rgba(232, 164, 78, 0.35);
  background: rgba(232, 164, 78, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMMAND SHELL — Monitoring Section
   ═══════════════════════════════════════════════════════════════════════════ */

.command-shell {
  padding: 18px;
}

.monitor-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: start;
}

.monitor-config {
  display: grid;
  gap: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
}

.settings-grid .toggle-card {
  grid-column: 1 / -1;
}

/* ── Toggle Card ─────── */

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease);
}

.toggle-card:hover {
  border-color: var(--line-strong);
}

.toggle-title {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.toggle-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toggle-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

/* ── Presets ─────── */

.monitor-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.monitor-quick-label {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preset-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-preset {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.btn-preset.active {
  border-color: rgba(34, 199, 192, 0.5);
  color: #e0f0ff;
  background: linear-gradient(135deg, rgba(34, 199, 192, 0.24) 0%, rgba(34, 217, 168, 0.14) 100%);
  box-shadow: 0 4px 14px -6px rgba(34, 199, 192, 0.6);
}

/* ── Summary Chips ─────── */

.monitor-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
}

.summary-chip strong {
  color: var(--text);
  font-weight: 800;
}

.summary-chip.alert {
  border-color: rgba(232, 164, 78, 0.3);
  background: var(--warn-soft);
  color: #eec88a;
}

.monitor-autoscan {
  margin-top: 0;
}

/* ── Status Card ─────── */

.monitor-status-card {
  border: 1px solid var(--line-glow);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  position: sticky;
  top: 80px;
}

.monitor-status-head {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.monitor-status-time {
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.monitor-status-fresh {
  color: #8dffd0;
  font-size: 13px;
  font-weight: 700;
}

.monitor-status-now {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.monitor-status-next {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.monitor-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.monitor-kv {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 9px;
  display: grid;
  gap: 3px;
}

.monitor-kv span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monitor-kv strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.monitor-status-mode {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.meta-subtle {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KPI / STATS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-shell {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 10px;
  display: grid;
  gap: 4px;
  justify-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0.5;
}

.stat:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.stat:nth-child(1)::before { background: var(--primary); }
.stat:nth-child(2)::before { background: var(--warn); }
.stat:nth-child(3)::before { background: var(--danger); }
.stat:nth-child(4)::before { background: var(--accent); }
.stat:nth-child(5)::before { background: var(--color-primary); }

.stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat strong {
  color: var(--text);
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERVIEW TABS
   ═══════════════════════════════════════════════════════════════════════════ */

.tabs-nav {
  display: flex;
  justify-content: space-between;
  gap: 0px;
  padding: 4px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  padding: 0 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  background: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILTERS
   ═══════════════════════════════════════════════════════════════════════════ */

.filters-shell {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 72px;
  z-index: 18;
  backdrop-filter: blur(12px);
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(110px, 1fr));
  gap: 6px;
}

.field-wide {
  grid-column: span 2;
}

.filters-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filters-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.btn-filter-preset.active {
  border-color: rgba(34, 199, 192, 0.4);
  color: #daeeff;
  background: var(--primary-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRENDS, KPI CARDS, INSIGHTS
   ═══════════════════════════════════════════════════════════════════════════ */

.trends-shell {
  display: grid;
  gap: 8px;
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.queue-card,
.team-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: grid;
  gap: 6px;
  transition: border-color var(--duration) var(--ease);
}

.queue-card:hover,
.team-card:hover {
  border-color: var(--line-strong);
}

.queue-card span,
.team-card .team-name {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.queue-card strong,
.team-score {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.queue-card small,
.team-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.team-stats,
.meta-list,
.timeline-list {
  display: grid;
  gap: 5px;
}

.team-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.meta-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted-strong);
  font-size: 12px;
}

.meta-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.meta-pill.warn {
  border-color: rgba(232, 164, 78, 0.3);
  background: rgba(232, 164, 78, 0.08);
}

.meta-pill.danger {
  border-color: rgba(255, 92, 106, 0.3);
  background: rgba(255, 92, 106, 0.08);
}

.timeline-list {
  padding-left: 16px;
  color: var(--muted-strong);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANELS — Risk & Breaches
   ═══════════════════════════════════════════════════════════════════════════ */

.panel {
  padding: 18px;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.group-title {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Alert / Risk Item Card ─────── */

.item {
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  padding: 14px;
  display: grid;
  gap: 8px;
  transition: border-color var(--duration) var(--ease), transform 0.14s var(--ease), box-shadow var(--duration) var(--ease);
}

.item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.item.high {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(255, 92, 106, 0.04) 0%, rgba(15, 26, 46, 0.95) 6%);
}

.item.medium {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, rgba(232, 164, 78, 0.03) 0%, rgba(15, 26, 46, 0.95) 6%);
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.item-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.item-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

.item-link:hover {
  text-decoration: underline;
  color: var(--primary);
}

.item-severity {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-severity.high {
  color: #ffbbc2;
  border-color: rgba(255, 92, 106, 0.35);
  background: var(--danger-soft);
}

.item-severity.medium,
.item-severity.warn {
  color: #eecfa0;
  border-color: rgba(232, 164, 78, 0.3);
  background: var(--warn-soft);
}

.item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.item-reason {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

.issue-banner {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.issue-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.issue-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.issue-banner.high {
  border-color: rgba(255, 92, 106, 0.35);
  background: rgba(255, 92, 106, 0.1);
}

.issue-banner.high .issue-text {
  color: #ffbbc2;
}

.issue-banner.medium,
.issue-banner.warn {
  border-color: rgba(232, 164, 78, 0.35);
  background: rgba(232, 164, 78, 0.1);
}

.issue-banner.medium .issue-text,
.issue-banner.warn .issue-text {
  color: #eecfa0;
}

.item-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.item-meta-line strong {
  color: var(--text);
}

/* ── Reply Status ─────── */

.reply-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.reply-status.unanswered {
  color: #ffbbc2;
  border-color: rgba(255, 92, 106, 0.35);
  background: var(--danger-soft);
}

.reply-status.answered {
  color: #eecfa0;
  border-color: rgba(232, 164, 78, 0.3);
  background: var(--warn-soft);
}

.reply-status.resolved {
  color: #a0ffd8;
  border-color: rgba(34, 217, 168, 0.4);
  background: var(--accent-soft);
}

/* ── KV Block ─────── */

.kv {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 14px;
}

.kv strong {
  color: var(--text);
  font-weight: 800;
}

/* ── Issues ─────── */

.issues {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--warn);
  font-size: 14px;
  line-height: 1.45;
}

.issues li {
  margin: 2px 0;
}

.issues li::marker {
  color: var(--warn);
}

.issues.breaches {
  color: #ffbbc2;
}

/* ── Coach Tip ─────── */

.coach-tip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-soft);
  font-size: 13px;
  background: rgba(34, 199, 192, 0.06);
}

/* ── Score ─────── */

.score-wrap {
  margin-top: 2px;
}

.score-bar {
  height: 5px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}

.score-bar span.warn {
  background: var(--warn);
}

.score-bar span.bad {
  background: var(--danger);
}

/* ── Penalty Breakdown ─────── */

.penalty-breakdown {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.penalty-title {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.penalty-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.penalty-row span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.penalty-row strong {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.penalty-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.penalty-bar i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(232, 164, 78, 0.8) 0%, rgba(34, 199, 192, 0.7) 100%);
  transition: width 0.5s var(--ease);
}

/* ── Item Actions ─────── */

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.empty {
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS BAR (Footer)
   ═══════════════════════════════════════════════════════════════════════════ */

.status {
  position: sticky;
  bottom: 6px;
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  text-align: center;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  background: rgba(8, 14, 25, 0.92);
  backdrop-filter: blur(12px);
}

.status.ok {
  color: #a0ffd8;
  border-color: rgba(34, 217, 168, 0.4);
}

.status.err {
  color: #ffbbc2;
  border-color: rgba(255, 92, 106, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(130, 158, 200, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(130, 158, 200, 0.3);
  border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

.seg-tab {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.seg-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.seg-tab.active {
  color: #fff;
  border-color: rgba(34, 199, 192, 0.5);
  background: var(--primary);
  box-shadow: 0 4px 14px -6px rgba(34, 199, 192, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RATINGS — Data Tables
   ═══════════════════════════════════════════════════════════════════════════ */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
  background: rgba(255, 255, 255, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.data-table th {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background var(--duration) var(--ease);
}

.data-table tbody tr:hover {
  background: rgba(34, 199, 192, 0.06);
}

.data-table .row-active {
  background: rgba(34, 199, 192, 0.1);
}

.data-table .row-negative {
  background: rgba(255, 92, 106, 0.07);
  border-left: 3px solid var(--danger);
}

.data-table .row-positive {
  background: rgba(34, 217, 168, 0.06);
  border-left: 3px solid var(--accent);
}

.data-table .row-warn {
  background: rgba(232, 164, 78, 0.05);
}

.data-table .row-negative:hover { background: rgba(255, 92, 106, 0.12); }
.data-table .row-positive:hover { background: rgba(34, 217, 168, 0.1); }

.data-table .cell-danger {
  color: #fff;
  font-weight: 800;
  background: rgba(185, 30, 48, 0.6);
  border-radius: 4px;
  text-align: center;
}

.data-table .cell-positive {
  color: #e0fff5;
  font-weight: 700;
  background: rgba(16, 130, 96, 0.5);
  border-radius: 4px;
  text-align: center;
}

.data-table .cell-neutral {
  color: #fff8ea;
  font-weight: 700;
  background: rgba(140, 90, 20, 0.5);
  border-radius: 4px;
  text-align: center;
}

/* Light theme */
body.theme-light .data-table .cell-danger {
  color: #fff;
  background: rgba(185, 30, 48, 0.65);
}
body.theme-light .data-table .cell-positive {
  color: #fff;
  background: rgba(13, 120, 85, 0.6);
}
body.theme-light .data-table .cell-neutral {
  color: #fff;
  background: rgba(130, 80, 15, 0.5);
}

/* ── KPI Hero Cards (Ratings Сводка) ─────── */

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.05);
}

.kpi-hero-card {
  position: relative;
  overflow: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--duration) var(--ease);
}
.kpi-hero-card:last-child {
  border-right: none;
}

.kpi-hero-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.kpi-hero-card::before {
  display: none;
}

.kpi-score::before  { background: transparent; }
.kpi-total::before  { background: transparent; }
.kpi-pos::before    { background: transparent; }
.kpi-neu::before    { background: transparent; }
.kpi-neg::before    { background: transparent; }
.kpi-days::before   { background: transparent; }

.kpi-score { border-color: transparent; background: transparent; }
.kpi-pos   { border-color: transparent; background: transparent; }
.kpi-neg   { border-color: transparent; background: transparent; }
.kpi-days  { border-color: transparent; background: transparent; }

.kpi-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}

.kpi-value {
  color: #fff;
  font-family: inherit;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
}

.kpi-score .kpi-value { color: #fff; }
.kpi-pos   .kpi-value { color: #fff; }
.kpi-neg   .kpi-value { color: #fff; }
.kpi-days  .kpi-value { color: #fff; }

.kpi-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Stagger animation */
.kpi-hero-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-hero-card:nth-child(2) { animation-delay: 0.07s; }
.kpi-hero-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-hero-card:nth-child(4) { animation-delay: 0.13s; }
.kpi-hero-card:nth-child(5) { animation-delay: 0.16s; }
.kpi-hero-card:nth-child(6) { animation-delay: 0.19s; }

/* Light theme adjustments */
body.theme-light .kpi-hero-card {
  background: #fff;
  border-color: rgba(15, 78, 75, 0.12);
}
body.theme-light .kpi-score { background: rgba(15, 148, 143, 0.05); border-color: rgba(15, 148, 143, 0.18); }
body.theme-light .kpi-pos   { background: rgba(13, 149, 114, 0.05); border-color: rgba(13, 149, 114, 0.16); }
body.theme-light .kpi-neg   { background: rgba(212, 56, 72, 0.04);  border-color: rgba(212, 56, 72, 0.15); }
body.theme-light .kpi-days  { background: rgba(34, 199, 192, 0.04); border-color: rgba(34, 199, 192, 0.14); }

body.theme-light .kpi-score .kpi-value { color: #0f948f; }
body.theme-light .kpi-pos   .kpi-value { color: #0a7860; }
body.theme-light .kpi-neg   .kpi-value { color: #c0202e; }
body.theme-light .kpi-days  .kpi-value { color: #0f948f; }


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 980px) {
  .brand-copy h1 {
    font-size: 20px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .monitor-layout {
    grid-template-columns: 1fr;
  }

  .monitor-status-time {
    font-size: 24px;
  }

  .monitor-status-card {
    position: static;
  }

  .stats-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters-shell {
    position: static;
  }

  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .trends-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-grid,
  .team-grid,
  .meta-list,
  .team-stats {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .seg-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {
  .page-wrap {
    padding: 8px 8px 16px;
  }

  .topbar {
    padding: 8px 12px;
    top: 4px;
  }

  .brand-copy h1 {
    font-size: 18px;
  }

  .topbar-dialog-title {
    display: none;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-2fa-row {
    grid-template-columns: 1fr;
  }

  .auth-title h2 {
    font-size: 24px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .monitor-status-grid {
    grid-template-columns: 1fr;
  }

  .monitor-status-time {
    font-size: 22px;
  }

  .tabs-nav {
    grid-template-columns: 1fr;
  }

  .notify-controls {
    grid-template-columns: 1fr;
  }

  .stat strong {
    font-size: 26px;
  }

  .item-title {
    font-size: 15px;
  }

  .item p {
    font-size: 13px;
  }

  .kv,
  .issues {
    font-size: 13px;
  }

  .filters-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-presets {
    align-items: stretch;
  }

  .trends-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status {
    position: static;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════════════════ */

body.theme-light {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-strong: #ffffff;
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --text-soft: #1e293b;
  --muted: #475569;
  --muted-strong: #334155;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01), 0 0 0 1px rgba(0, 0, 0, 0.035);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.02);
  --accent: #047857;
  --accent-soft: rgba(16, 185, 129, 0.08);
  --warn: #b45309;
  --warn-soft: rgba(245, 158, 11, 0.08);
  --danger: #b91c1c;
  --danger-soft: rgba(239, 68, 68, 0.08);
}

body.theme-light .topbar {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-light .logo {
  box-shadow: 0 6px 16px -6px rgba(34, 199, 192, 0.25);
}

body.theme-light .shell {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(34, 199, 192, 0.12);
  outline: none;
}

body.theme-light .auth-2fa {
  background: rgba(34, 199, 192, 0.05);
  border-color: rgba(34, 199, 192, 0.15);
}

body.theme-light.auth-screen .auth-shell {
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 199, 192, 0.08), transparent 52%),
    radial-gradient(circle at 100% 100%, rgba(5, 150, 105, 0.05), transparent 40%),
    #ffffff;
  border-color: rgba(34, 199, 192, 0.2);
}

body.theme-light .btn-soft,
body.theme-light .btn-dark,
body.theme-light .btn-copy-id {
  background: #ffffff;
  color: #1e293b;
  border-color: rgba(148, 163, 184, 0.25);
}

body.theme-light .btn-soft:hover:not(:disabled),
body.theme-light .btn-dark:hover:not(:disabled) {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.4);
}

body.theme-light .btn-open-cq {
  color: #ffffff;
  border-color: rgba(34, 199, 192, 0.6);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary) 100%);
}

body.theme-light .btn-claim {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.06);
}

body.theme-light .btn-snooze {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.06);
}

body.theme-light .btn-preset.active {
  color: var(--color-primary);
  border-color: rgba(34, 199, 192, 0.3);
  background: linear-gradient(135deg, rgba(34, 199, 192, 0.08) 0%, rgba(15, 148, 143, 0.06) 100%);
}

body.theme-light .badge {
  background: #f1f5f9;
  color: #334155;
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-light .badge.auth {
  color: #ffffff;
  background: #059669;
  border-color: #059669;
}

body.theme-light .summary-chip {
  background: #ffffff;
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
}

body.theme-light .summary-chip.alert {
  color: #b45309;
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  font-weight: 600;
}

body.theme-light .monitor-status-card {
  background: linear-gradient(180deg, rgba(34, 199, 192, 0.03) 0%, #ffffff 100%);
  border-color: rgba(34, 199, 192, 0.12);
}

body.theme-light .monitor-status-fresh {
  color: #059669;
  font-weight: 600;
}

body.theme-light .monitor-status-now {
  color: var(--color-primary);
  font-weight: 600;
}

body.theme-light .monitor-status-next {
  color: var(--color-primary);
  font-weight: 600;
}

body.theme-light .stat {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .stat::before {
  opacity: 0.7;
}

body.theme-light .penalty-breakdown,
body.theme-light .coach-tip {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.15);
  color: var(--text-soft);
}

body.theme-light .item {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

body.theme-light .item:hover {
  border-color: rgba(34, 199, 192, 0.25);
  box-shadow: 0 4px 12px rgba(34, 199, 192, 0.03);
}

body.theme-light .item.high {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, #ffffff 8%);
  border-left: 4px solid #ef4444;
}

body.theme-light .item.medium {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, #ffffff 8%);
  border-left: 4px solid #f59e0b;
}

body.theme-light .item-severity.high {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
  font-weight: 600;
}

body.theme-light .item-severity.medium,
body.theme-light .item-severity.warn {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
  font-weight: 600;
}

body.theme-light .item-reason {
  color: #1e293b;
  font-weight: 600;
}

body.theme-light .issue-banner {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(34, 199, 192, 0.03);
}

body.theme-light .issue-text {
  color: #0b6f6b;
}

body.theme-light .issue-banner.high {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

body.theme-light .issue-banner.high .issue-text {
  color: #b91c1c;
}

body.theme-light .issue-banner.medium,
body.theme-light .issue-banner.warn {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
}

body.theme-light .issue-banner.medium .issue-text,
body.theme-light .issue-banner.warn .issue-text {
  color: #b45309;
}

body.theme-light .item-meta-line {
  color: #475569;
}

body.theme-light .item-meta-line strong {
  color: #0f172a;
}

body.theme-light .issues {
  color: #b45309;
}

body.theme-light .issues.breaches {
  color: #dc2626;
}

body.theme-light .reply-status.unanswered {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

body.theme-light .reply-status.answered {
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
}

body.theme-light .reply-status.resolved {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.06);
}

body.theme-light .status {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .status.ok {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

body.theme-light .status.err {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ── Light theme: Segmented tabs ─────── */

body.theme-light .seg-tabs {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .seg-tab {
  color: #475569;
  font-weight: 600;
}

body.theme-light .seg-tab:hover {
  background: rgba(34, 199, 192, 0.05);
  color: var(--color-primary);
}

body.theme-light .seg-tab.active {
  color: #ffffff;
  border-color: rgba(34, 199, 192, 0.6);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary) 100%);
}

/* ── Light theme: Data tables ─────── */

body.theme-light .table-wrap {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .data-table th,
body.theme-light .data-table td {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

body.theme-light .data-table th {
  color: #334155;
  background: #f8fafc;
  font-weight: 700;
}

body.theme-light .data-table tbody tr:hover {
  background: rgba(34, 199, 192, 0.03);
}

body.theme-light .data-table .row-active {
  background: rgba(34, 199, 192, 0.06);
}

body.theme-light .tabs-nav {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .tab-btn {
  color: #475569;
  font-weight: 600;
}

body.theme-light .tab-btn:hover {
  color: var(--color-primary);
  background: rgba(34, 199, 192, 0.05);
}

body.theme-light .tab-btn.active {
  color: var(--color-primary);
  border-color: rgba(34, 199, 192, 0.3);
  background: linear-gradient(135deg, rgba(34, 199, 192, 0.08) 0%, rgba(15, 148, 143, 0.04) 100%);
}

body.theme-light .kv {
  background: rgba(34, 199, 192, 0.03);
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .monitor-kv {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.15);
}

body.theme-light .stats-shell {
  background: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.15) !important;
}

body.theme-light .filters-shell {
  backdrop-filter: blur(12px);
}

body.theme-light .queue-card,
body.theme-light .team-card,
body.theme-light .trend-card,
body.theme-light .kpi-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: var(--shadow-soft);
}

body.theme-light .queue-card:hover,
body.theme-light .trend-card:hover,
body.theme-light .kpi-card:hover,
body.theme-light .insight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 199, 192, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(34, 199, 192, 0.05);
}

/* ── Light Theme: Explicit Contrast Overrides ── */
body.theme-light .field > span,
body.theme-light label span,
body.theme-light .field span,
body.theme-light .monitor-kv span,
body.theme-light .summary-chip span,
body.theme-light .filters-presets span,
body.theme-light .monitor-quick-label {
  color: #334155 !important;
  font-weight: 700 !important;
}

body.theme-light .field-help,
body.theme-light .toggle-card p,
body.theme-light .hero-sub,
body.theme-light .section-head p,
body.theme-light .meta,
body.theme-light p {
  color: #475569 !important;
}

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light .hero-title,
body.theme-light .section-head h2,
body.theme-light .toggle-title,
body.theme-light .sql-title,
body.theme-light .monitor-status-head {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #0f172a !important;
  color: #0f172a !important;
  text-shadow: none !important;
}

body.theme-light .stat span {
  color: #475569 !important;
}

body.theme-light .stat strong {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #0f172a !important;
  color: #0f172a !important;
  text-shadow: none !important;
}

body.theme-light .monitor-kv strong {
  color: #0f172a !important;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #64748b !important;
  opacity: 0.9 !important;
}

body.theme-light .c-score,
body.theme-light .kpi-c-score {
  color: #0f948f !important;
  text-shadow: none !important;
}

body.theme-light .c-pos,
body.theme-light .kpi-c-pos {
  color: #047857 !important;
  text-shadow: none !important;
}

body.theme-light .c-neu,
body.theme-light .kpi-c-neu {
  color: #b45309 !important;
  text-shadow: none !important;
}

body.theme-light .c-neg,
body.theme-light .kpi-c-neg {
  color: #b91c1c !important;
  text-shadow: none !important;
}

body.theme-light .nav-item .nav-label {
  color: #475569 !important;
}

body.theme-light .nav-item .nav-sub {
  color: #64748b !important;
}

body.theme-light .nav-item .nav-icon {
  opacity: 0.95 !important;
  filter: none !important;
}

body.theme-light .nav-item:hover .nav-label {
  color: #0f172a !important;
}

body.theme-light .nav-item:hover .nav-sub {
  color: #1e293b !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MICRO-ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shimmer {
  from { background-position: -200% center; }
  to { background-position: 200% center; }
}

/* Subtle stagger effect for list items */
.list > .item:nth-child(1) { animation-delay: 0.02s; }
.list > .item:nth-child(2) { animation-delay: 0.04s; }
.list > .item:nth-child(3) { animation-delay: 0.06s; }
.list > .item:nth-child(4) { animation-delay: 0.08s; }
.list > .item:nth-child(5) { animation-delay: 0.1s; }
.list > .item:nth-child(n+6) { animation-delay: 0.12s; }

.list > .item {
  animation: fade-up 0.28s var(--ease) both;
}

/* Smooth interactivity */
.queue-card,
.team-card,
.trend-card,
.kpi-card,
.insight-card,
.monitor-kv {
  transition: border-color var(--duration) var(--ease), transform 0.14s var(--ease);
}

.queue-card:hover,
.trend-card:hover,
.kpi-card:hover,
.insight-card:hover {
  transform: translateY(-1px);
}

/* ── Light Theme: Globals, Tabs & Navigation Overrides ── */
body.theme-light .segmented,
body.theme-light .r-tabs,
body.theme-light .tabs-nav {
  background: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .r-tab,
body.theme-light .seg-tab,
body.theme-light .tab-btn {
  color: #475569 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}

body.theme-light .r-tab:hover,
body.theme-light .seg-tab:hover,
body.theme-light .tab-btn:hover {
  color: #0f172a !important;
  background: rgba(0, 0, 0, 0.02) !important;
}

body.theme-light .r-tab.active,
body.theme-light .seg-tab.active,
body.theme-light .tab-btn.active {
  color: var(--color-primary) !important;
  background: #ffffff !important;
  border-color: rgba(34, 199, 192, 0.22) !important;
  box-shadow: 0 2px 8px rgba(34, 199, 192, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

body.theme-light .section-link {
  color: #475569 !important;
  background: transparent !important;
  border-color: transparent !important;
}

body.theme-light .section-link:hover {
  color: #0f172a !important;
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

body.theme-light .section-link.active {
  color: var(--color-primary) !important;
  background: #ffffff !important;
  border-color: rgba(34, 199, 192, 0.22) !important;
  box-shadow: 0 2px 8px rgba(34, 199, 192, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

/* ==========================================================================
   NEW STANDALONE LOGIN SCREEN PREMIUM DESIGN
   ========================================================================== */

/* Page Background Overrides */
body.auth-screen {
  background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),0.15), #070a13 80%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  padding: 0 !important;
  overflow: auto !important;
}

body.theme-light.auth-screen {
  background: radial-gradient(circle at 50% 50%, #f1f5f9, #cbd5e1 90%) !important;
}

/* Auth Card Overrides */
body.auth-screen .auth-shell {
  background: rgba(15, 23, 42, 0.82) !important;
  border: 1px solid rgba(var(--accent-rgb),0.25) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(var(--accent-rgb),0.05) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border-radius: 20px !important;
  padding: 32px !important;
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
}

body.theme-light.auth-screen .auth-shell {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(var(--accent-rgb),0.15) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

/* Titles and Kickers */
body.auth-screen .auth-kicker {
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  background: rgba(16, 185, 129, 0.1) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
}

body.theme-light.auth-screen .auth-kicker {
  border: 1px solid rgba(5, 150, 105, 0.25) !important;
  background: rgba(5, 150, 105, 0.06) !important;
  color: #059669 !important;
}

body.auth-screen .auth-title h2 {
  color: #ffffff !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}

body.theme-light.auth-screen .auth-title h2 {
  color: #0f172a !important;
}

body.auth-screen .auth-title p {
  color: #94a3b8 !important;
  font-size: 14px !important;
}

body.theme-light.auth-screen .auth-title p {
  color: #475569 !important;
}

/* Brand Section Styling */
.login-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 520px !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.login-brand {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin-bottom: 8px !important;
}

.login-brand .logo {
  width: 44px !important;
  height: 44px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.3) !important;
}

body.theme-light .login-brand .logo {
  box-shadow: 0 4px 12px rgba(34, 199, 192, 0.2) !important;
}

.login-brand-copy h1 {
  margin: 0 !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  background: linear-gradient(135deg, #ffffff 12%, #a4ffe4 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body.theme-light .login-brand-copy h1 {
  background: linear-gradient(135deg, #0f172a 12%, var(--color-primary) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.login-brand-copy p {
  margin: 0 !important;
  font-size: 13px !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

body.theme-light .login-brand-copy p {
  color: #475569 !important;
}

/* Inputs styling */
body.auth-screen input {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  height: 46px !important;
  transition: all 0.2s ease !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15) !important;
}

body.auth-screen input:focus {
  border-color: var(--color-primary) !important;
  background: rgba(var(--accent-rgb),0.05) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.25) !important;
  outline: none !important;
}

body.theme-light.auth-screen input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

body.theme-light.auth-screen input:focus {
  border-color: var(--color-primary) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(34, 199, 192, 0.15) !important;
}

/* Primary buttons styling */
body.auth-screen .btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary)) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  height: 46px !important;
  padding: 0 24px !important;
  font-size: 15px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.3) !important;
}

body.auth-screen .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(var(--accent-rgb),0.4) !important;
}

body.theme-light.auth-screen .btn-primary {
  background: var(--color-primary) !important;
  box-shadow: 0 4px 12px rgba(34, 199, 192, 0.2) !important;
}

body.theme-light.auth-screen .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(34, 199, 192, 0.3) !important;
}

/* 2FA Panel Overrides */
body.auth-screen .auth-2fa {
  margin-top: 16px !important;
  padding: 16px !important;
  background: rgba(var(--accent-rgb),0.05) !important;
  border: 1px solid rgba(var(--accent-rgb),0.15) !important;
  border-radius: 14px !important;
  gap: 12px !important;
}

body.theme-light.auth-screen .auth-2fa {
  background: rgba(34, 199, 192, 0.03) !important;
  border: 1px solid rgba(34, 199, 192, 0.1) !important;
}

body.auth-screen .auth-2fa-head {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--color-primary) !important;
  margin-bottom: 2px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

body.theme-light.auth-screen .auth-2fa-head {
  color: var(--color-primary) !important;
}

body.auth-screen .auth-2fa-row {
  display: grid !important;
  grid-template-columns: 1fr auto auto !important;
  gap: 8px !important;
  align-items: center !important;
}

body.auth-screen .auth-2fa-row .btn {
  height: 46px !important;
  font-size: 14px !important;
  border-radius: 12px !important;
}

/* Soft buttons */
body.auth-screen .btn-soft {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #d1d5db !important;
  transition: all 0.2s ease !important;
}

body.auth-screen .btn-soft:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

body.theme-light.auth-screen .btn-soft {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.theme-light.auth-screen .btn-soft:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Status bar */
body.auth-screen .status {
  position: relative !important;
  bottom: 0 !important;
  margin-top: 12px !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
}

body.theme-light.auth-screen .status {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02) !important;
}

body.auth-screen .status.err {
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(220, 38, 38, 0.15) !important;
}

body.theme-light.auth-screen .status.err {
  color: #b91c1c !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

/* Theme Toggle button */
.login-theme-btn {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 100 !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  font-size: 18px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  transform: scale(1.05) !important;
}

body.theme-light .login-theme-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

body.theme-light .login-theme-btn:hover {
  background: #f1f5f9 !important;
}

/* Panel Switcher Button Styling */
.panel-switch-item {
  border: 1px dashed rgba(var(--accent-rgb),0.25) !important;
  background: rgba(var(--accent-rgb),0.04) !important;
  border-radius: var(--radius-md) !important;
  margin: 4px 10px 10px 10px !important;
  padding: 8px 12px !important;
  transition: all 0.2s ease !important;
}
.panel-switch-item:hover {
  border-color: rgba(var(--accent-rgb),0.5) !important;
  background: rgba(var(--accent-rgb),0.08) !important;
  transform: translateY(-0.5px);
}
body.theme-light .panel-switch-item {
  border-color: rgba(34, 199, 192, 0.2) !important;
  background: rgba(34, 199, 192, 0.02) !important;
}
body.theme-light .panel-switch-item:hover {
  border-color: rgba(34, 199, 192, 0.45) !important;
  background: rgba(34, 199, 192, 0.05) !important;
}
