/* ============================================================
   FreightFlow - Google AI Studio Dark Theme
   Material Design 3 - Dark Charcoal - Glassmorphic Surfaces
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */

:root,
[data-theme="cobalt"],
[data-theme="dark"] {
  /* Surfaces - AI Studio Dark Charcoal */
  --bg-darkest: #0e0e0f;
  --bg: #131314;
  --bg-soft: #1a1a1b;
  --bg-elevated: #1e1f20;
  --bg-card: #1e1f20;
  --surface: #1e1f20;
  --surface-2: #282a2c;
  --surface-hover: rgba(255, 255, 255, 0.04);
  --surface-active: rgba(255, 255, 255, 0.08);
  --surface-glass: rgba(30, 31, 32, 0.92);
  --surface-glass-card: rgba(40, 42, 44, 0.94);
  --surface-muted: #282a2c;

  /* Borders - Subtle glass edges */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(138, 180, 248, 0.3);
  --border-focus: #8ab4f8;

  /* Typography - Off-white on dark */
  --text-primary: #e3e3e3;
  --text-secondary: #9aa0a6;
  --text-muted: #7c8389;
  --text-dim: #5f6368;
  --text-on-accent: #131314;

  /* Brand - Google AI Studio blue (desaturated for dark) */
  --accent: #8ab4f8;
  --accent-hover: #aecbfa;
  --accent-active: #669df6;
  --accent-soft: rgba(138, 180, 248, 0.08);
  --accent-glow: rgba(138, 180, 248, 0.18);
  --accent-border: rgba(138, 180, 248, 0.22);

  --ai-cyan: #78d9ec;
  --ai-cyan-hover: #a8e6f0;
  --ai-cyan-soft: rgba(120, 217, 236, 0.08);
  --ai-cyan-border: rgba(120, 217, 236, 0.25);

  /* Semantic Colors - Desaturated for dark */
  --success: #81c995;
  --success-soft: rgba(129, 201, 149, 0.08);
  --success-border: rgba(129, 201, 149, 0.25);

  --warning: #fdd663;
  --warning-soft: rgba(253, 214, 99, 0.08);
  --warning-border: rgba(253, 214, 99, 0.25);

  --danger: #f28b82;
  --danger-soft: rgba(242, 139, 130, 0.08);
  --danger-border: rgba(242, 139, 130, 0.25);

  --purple: #c58af9;
  --purple-soft: rgba(197, 138, 249, 0.08);
  --purple-border: rgba(197, 138, 249, 0.25);

  /* Severity - Dark mode */
  --sev-critical-bg: rgba(242, 139, 130, 0.1);
  --sev-critical-text: #f28b82;
  --sev-critical-border: rgba(242, 139, 130, 0.3);

  --sev-high-bg: rgba(252, 167, 105, 0.1);
  --sev-high-text: #fca76a;
  --sev-high-border: rgba(252, 167, 105, 0.3);

  --sev-medium-bg: rgba(253, 214, 99, 0.1);
  --sev-medium-text: #fdd663;
  --sev-medium-border: rgba(253, 214, 99, 0.3);

  --sev-low-bg: rgba(255, 255, 255, 0.04);
  --sev-low-text: #9aa0a6;
  --sev-low-border: rgba(255, 255, 255, 0.1);

  /* Status - Dark mode */
  --status-new-bg: rgba(138, 180, 248, 0.1);
  --status-new-text: #8ab4f8;
  --status-new-border: rgba(138, 180, 248, 0.3);

  --status-investigating-bg: rgba(197, 138, 249, 0.1);
  --status-investigating-text: #c58af9;
  --status-investigating-border: rgba(197, 138, 249, 0.3);

  --status-resolved-bg: rgba(129, 201, 149, 0.1);
  --status-resolved-text: #81c995;
  --status-resolved-border: rgba(129, 201, 149, 0.3);

  --status-dismissed-bg: rgba(255, 255, 255, 0.04);
  --status-dismissed-text: #5f6368;
  --status-dismissed-border: rgba(255, 255, 255, 0.08);

  /* Shadows - Minimal, elevation via surface lightness */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  --shadow-glow-cyan: 0 0 0 3px rgba(120, 217, 236, 0.2);
  --shadow-glow-rose: 0 0 0 3px rgba(242, 139, 130, 0.2);

  /* Component Tokens */
  --brand-gradient: linear-gradient(135deg, #8ab4f8 0%, #669df6 100%);
  --brand-mark-color: #e3e3e3;
  --brand-ai-gradient: linear-gradient(135deg, #8ab4f8 0%, #aecbfa 100%);
  --btn-primary-bg: #8ab4f8;
  --btn-primary-hover-bg: #aecbfa;
  --btn-primary-text: #131314;
  --btn-primary-shadow: 0 1px 3px rgba(138, 180, 248, 0.25);
  --body-bg-gradient: none;

  /* Geometry */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --topbar-height: 60px;
  --content-max-width: 1280px;

  /* Typography - Google Sans */
  --font-sans: "Google Sans", "Google Sans Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Google Sans Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --spring-fast: 150ms ease;
  --spring-base: 200ms ease;
  --spring-smooth: 300ms ease;
  --transition-fast: var(--spring-fast);
  --transition-base: var(--spring-base);
  --transition-smooth: var(--spring-smooth);
}

[data-theme="gold"] {
  --accent: #fdd663;
  --accent-hover: #fde293;
  --accent-active: #f5c518;
  --accent-soft: rgba(253, 214, 99, 0.08);
  --accent-glow: rgba(253, 214, 99, 0.15);
  --accent-border: rgba(253, 214, 99, 0.25);
  --border-highlight: rgba(253, 214, 99, 0.35);
  --border-focus: #fdd663;
}

[data-theme="emerald"] {
  --accent: #81c995;
  --accent-hover: #a8dab5;
  --accent-active: #5bb974;
  --accent-soft: rgba(129, 201, 149, 0.08);
  --accent-glow: rgba(129, 201, 149, 0.15);
  --accent-border: rgba(129, 201, 149, 0.25);
  --border-highlight: rgba(129, 201, 149, 0.35);
  --border-focus: #81c995;
}

[data-theme="violet"] {
  --accent: #c58af9;
  --accent-hover: #d7a9fb;
  --accent-active: #af6ef5;
  --accent-soft: rgba(197, 138, 249, 0.08);
  --accent-glow: rgba(197, 138, 249, 0.15);
  --accent-border: rgba(197, 138, 249, 0.25);
  --border-highlight: rgba(197, 138, 249, 0.35);
  --border-focus: #c58af9;
}



/* ---------- 2. Global Scaffolding & Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1, h2, h3, h4, p, ul {
  margin: 0 0 0.5em 0;
}

ul {
  padding-left: 1.25em;
}

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background: rgba(138, 180, 248, 0.35);
  color: #ffffff;
}

/* Custom Webkit Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---------- 3. Brand Identity ---------- */
.brand-link,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: var(--brand-mark-color);
  font-weight: 850;
  font-size: 14px;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 60%);
  pointer-events: none;
}

.brand-name {
  font-weight: 850;
  font-size: 18.5px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-ai {
  background: var(--brand-ai-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 850;
}

.brand-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  margin-left: 6px;
}

/* ---------- 4. Sidebar & Application Shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  transform: translateX(0);
  transition: transform var(--transition-base);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-item:hover svg {
  opacity: 1;
  transform: translateX(1px);
  color: var(--accent-hover);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  border-color: var(--accent-border);
}

.nav-item.active svg {
  color: var(--accent);
  opacity: 1;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  box-shadow: none;
}

.sidebar-shield-card {
  margin: 12px 6px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-shield-card strong {
  font-size: 12.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 4.5 Live Theme Palette Switcher ---------- */
.topbar-theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 4px;
  border-radius: var(--radius-full);
  box-shadow: none;
}

.topbar-theme-switcher.mini {
  padding: 2px 3px;
  gap: 2px;
}

.theme-switch-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 750;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.topbar-theme-switcher.mini .theme-switch-btn {
  padding: 3px 6px;
  font-size: 11px;
}

.theme-switch-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.theme-switch-btn.active {
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  border-color: var(--border-highlight) !important;
  box-shadow: var(--btn-primary-shadow), 0 0 14px var(--accent-glow) !important;
  font-weight: 800;
}

/* ---------- 4.6 Settings Theme Palette Selection Cards ---------- */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.theme-option-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.theme-option-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-option-card.selected {
  border-color: var(--accent) !important;
  box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow) !important;
  background: var(--surface-2);
}

.theme-option-card.selected::after {
  content: "\2713  Active";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--btn-primary-text);
  background: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.theme-card-preview {
  padding: 16px;
  height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.theme-card-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-primary);
}

.theme-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.sidebar-shield-card p {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.sidebar-footer {
  padding: 16px 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}

.sidebar-user:hover {
  border-color: var(--border);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-weight: 750;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-company {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--transition-base);
}

/* ---------- 5. Sticky Topbar & Header Station ---------- */
.main-column {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-height);
  padding: 0 32px;
  background: rgba(19, 19, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.topbar-brand {
  display: none;
  align-items: center;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-breadcrumb span,
.topbar-breadcrumb strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-breadcrumb strong {
  color: var(--text-primary);
  font-weight: 650;
}

.topbar-spacer {
  flex: 1;
  min-width: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.topbar-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 12px;
  font-weight: 650;
  color: var(--success);
  white-space: nowrap;
}

.topbar-badge .dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: none;
}

.topbar-badge .dot.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--success);
  animation: ff-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes ff-pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 28px 32px 80px;
  min-width: 0;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
}

/* ---------- 6. Typography, Headers & Eyebrows ---------- */
.page-header,
.dashboard-header {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-header h1,
.dashboard-header h1 {
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header h1 svg {
  color: var(--accent-hover);
}

.alert-count,
.help-text,
.dashboard-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.dashboard-header strong {
  color: var(--text-primary);
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-cyan) !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- 7. Containers, Glass Sections & Cards ---------- */
.card,
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover,
.section:hover {
  border-color: var(--border-strong);
}

.section h2 {
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 2px 0 0;
}

.engine-badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  border-radius: var(--radius-full);
  color: var(--accent-hover);
  font-size: 11.5px;
  font-weight: 750;
  padding: 5px 12px;
  white-space: nowrap;
}

/* ---------- 8. Metric Cards & KPI Surveillance Grids ---------- */
.stats-grid,
.results-summary,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat-card,
.result-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before,
.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover,
.result-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow);
}

.stat-card:hover::before,
.result-card:hover::before {
  opacity: 1;
}

.stat-title,
.result-card h3 {
  font-size: 11.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.stat-number,
.result-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.result-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  word-break: break-word;
}

.result-unit {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 650;
}

/* Fleet Risk Radar Strip */
.risk-radar-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.radar-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  min-width: 0;
}

.radar-chip > div:last-child {
  min-width: 0;
  overflow: hidden;
}

.radar-chip:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.radar-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radar-chip strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-chip span {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ---------- 9. Action Buttons & Workflows ---------- */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.action-buttons a,
.action-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(22, 34, 59, 0.45);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 650;
  transition: all var(--transition-fast);
}

.action-buttons a:hover,
.action-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 20px rgba(37, 99, 235, 0.22);
  transform: translateY(-2px);
}

.action-buttons a svg,
.action-card svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-hover);
}

.btn,
.primary-button,
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-primary,
.primary-button,
button[type="submit"] {
  background: var(--brand-gradient);
  border: 1px solid var(--border-highlight);
  color: var(--btn-primary-text);
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(138, 180, 248, 0.22);
}

.btn-primary:hover,
.primary-button:hover,
button[type="submit"]:hover {
  background: var(--accent-hover);
  color: var(--btn-primary-text);
  border-color: var(--border-focus);
  box-shadow: 0 6px 18px rgba(138, 180, 248, 0.32);
  transform: translateY(-1px);
}

.btn:active,
.btn-primary:active,
.primary-button:active,
.topbar-btn:active,
button[type="submit"]:active,
.action-buttons a:active,
.action-card:active {
  transform: scale(0.968) !important;
  transition: transform 90ms cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

/* ---------- 10. Tables & Forensic Ledgers ---------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table {
  min-width: 640px;
  font-size: 13.5px;
}

th {
  text-align: left;
  padding: 14px 18px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--surface-hover);
}

td small {
  color: var(--text-muted);
  font-size: 12px;
}

.amount-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
  color: var(--text-primary);
}

.alerts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.alerts-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.alerts-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.alerts-table tr:hover td {
  background: var(--surface-hover);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12.5px;
}

.table-toolbar strong {
  color: var(--text-primary);
  font-size: 13.5px;
}

/* 1-Click Copy Badge */
.copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-badge:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Apple-style Code & Parameter Pills */
.code-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  width: fit-content;
  letter-spacing: -0.01em;
}

.copy-badge svg {
  opacity: 0.6;
}

.copy-badge:hover svg {
  opacity: 1;
}

/* ---------- 11. Status & Severity Badges ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-critical {
  background: var(--sev-critical-bg);
  color: var(--sev-critical-text);
  border-color: var(--sev-critical-border);
}

.status-high {
  background: var(--sev-high-bg);
  color: var(--sev-high-text);
  border-color: var(--sev-high-border);
}

.status-medium {
  background: var(--sev-medium-bg);
  color: var(--sev-medium-text);
  border-color: var(--sev-medium-border);
}

.status-low {
  background: var(--sev-low-bg);
  color: var(--sev-low-text);
  border-color: var(--sev-low-border);
}

.status-new {
  background: var(--status-new-bg);
  color: var(--status-new-text);
  border-color: var(--status-new-border);
}

.status-investigating {
  background: var(--status-investigating-bg);
  color: var(--status-investigating-text);
  border-color: var(--status-investigating-border);
}

.status-resolved {
  background: var(--status-resolved-bg);
  color: var(--status-resolved-text);
  border-color: var(--status-resolved-border);
}

.status-dismissed {
  background: var(--status-dismissed-bg);
  color: var(--status-dismissed-text);
  border-color: var(--status-dismissed-border);
}

.risk-score {
  font-family: var(--font-mono);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ---------- 12. Dropzone & File Ingestion ---------- */
.upload-box {
  background: var(--surface);
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 58px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  transition: all var(--transition-base);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  transform: scale(1.002);
}

.dropzone-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.dropzone-icon svg {
  width: 30px;
  height: 30px;
}

.dropzone h2 {
  font-size: 19px;
  font-weight: 750;
  color: var(--text-primary);
  margin: 0;
}

.dropzone-filename {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--accent);
  min-height: 20px;
  word-break: break-all;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: inline-block;
}

.dropzone-filename:empty {
  display: none;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-submit {
  width: 100%;
  margin-top: 20px;
  padding: 14px 24px;
  font-size: 15px;
}

/* Pipeline Progress Tracker */
.audit-progress[hidden] {
  display: none;
}

.audit-progress {
  margin-top: 20px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: left;
  animation: ff-reveal 300ms both;
}

.audit-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.audit-progress-percent {
  color: var(--ai-cyan);
  font-family: var(--font-mono);
  font-weight: 850;
}

.audit-progress-track {
  height: 7px;
  margin: 12px 0 14px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
}

.audit-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--ai-cyan) 100%);
  box-shadow: 0 0 14px var(--accent-glow);
  transition: width 550ms cubic-bezier(0.16, 1, 0.3, 1);
}

.audit-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.audit-stages span {
  position: relative;
  padding-left: 15px;
}

.audit-stages span::before {
  position: absolute;
  top: 4px;
  left: 0;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  content: "";
}

.audit-stages span.is-active {
  color: #38bdf8;
  font-weight: 650;
}

.audit-stages span.is-active::before {
  border-color: var(--accent);
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.audit-stages span.is-complete {
  color: var(--success);
}

.audit-stages span.is-complete::before {
  border-color: var(--success);
  background: var(--success);
}

/* ---------- 13. Results & Leakage Intelligence ---------- */
.results-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.insight-panel,
.severity-panel,
.quality-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.insight-copy {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
  margin-top: 10px;
  max-width: 720px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.mini-metrics div {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.mini-metrics span {
  color: var(--text-muted);
  display: block;
  font-size: 11.5px;
  font-weight: 650;
}

.mini-metrics strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 850;
  color: var(--text-primary);
  margin-top: 4px;
}

.mini-metrics small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.severity-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 92px 1fr 38px;
  margin: 14px 0;
}

.severity-row strong {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  min-width: 24px;
}

.severity-track {
  background: var(--surface-2);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.severity-track span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.quality-strip {
  margin-bottom: 28px;
}

.finding-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.finding-item {
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  transition: border-color var(--transition-fast);
}

.finding-item:hover {
  border-color: var(--border-strong);
}

.finding-item strong {
  color: var(--text-primary);
  font-size: 13.5px;
}

.finding-item p {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin: 4px 0 0;
}

/* ---------- 14. Forensic Business Cards ---------- */
.business-card {
  background: var(--surface);
  color: var(--text-primary);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-left: 5px solid #f59e0b;
}

.business-card.risk-critical {
  border-left-color: #ef4444;
}

.business-card.risk-quarantine {
  border-left-color: #8b5cf6;
}

.business-card.risk-warning {
  border-left-color: #f59e0b;
}

.business-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.risk-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.risk-badge.risk-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.risk-badge.risk-quarantine {
  background: rgba(139, 92, 246, 0.18);
  color: #d8b4fe;
  border-color: rgba(139, 92, 246, 0.4);
}

/* Synthesis deck embedded container styling */
.executive-synthesis-deck {
  display: grid;
  gap: 20px;
}

/* ---------- 15. Form Controls & Parameter Inputs ---------- */
form label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11.5px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.alerts-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.alerts-filter-form .filter-field {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  flex: 1 1 220px;
}

.alerts-filter-form .filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.alerts-filter-form .filter-actions a {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 650;
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.alerts-filter-form .filter-actions a:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.status-update-form {
  display: flex;
  gap: 5px;
  align-items: center;
}

.status-update-form select {
  min-width: 105px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  height: 28px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.status-update-form select:focus {
  border-color: var(--accent);
}

.status-update-form select option {
  background-color: var(--surface);
  color: var(--text-primary);
}

.status-update-form button {
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  height: 28px;
  background: var(--brand-gradient);
  color: var(--btn-primary-text);
  border: 1px solid var(--border-highlight);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(138, 180, 248, 0.2);
  transition: all var(--transition-fast);
}

.status-update-form button:hover {
  background: var(--accent-hover);
  color: var(--btn-primary-text);
  border-color: var(--border-focus);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.pagination a {
  color: var(--accent);
  font-weight: 750;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.pagination a:hover {
  background: var(--accent);
  color: var(--text-primary);
}

/* Settings Inputs */
.settings-card form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 600px;
}

.input-with-prefix,
.input-with-suffix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.input-with-prefix span,
.input-with-suffix span {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 750;
  font-size: 14px;
  border-right: 1px solid var(--border-strong);
}

.input-with-suffix span {
  border-right: none;
  border-left: 1px solid var(--border-strong);
  order: 2;
}

.input-with-prefix input,
.input-with-suffix input {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
}

.input-with-prefix input:focus,
.input-with-suffix input:focus {
  box-shadow: none;
}

/* ---------- 16. Auth Cards & Onboarding ---------- */
.main-column.auth-mode {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  margin-left: 0;
  background: var(--bg-card);
}

.content.auth-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  padding: 0;
  margin: 0;
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-brand .brand-mark {
  width: 50px;
  height: 50px;
  font-size: 18px;
}

.auth-brand .brand-name {
  font-size: 23px;
}

.card.auth-card,
.content.auth-content .card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.card.auth-card h1,
.content.auth-content .card h1 {
  font-size: 23px;
  font-weight: 850;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.auth-subtitle {
  text-align: center;
  margin-bottom: 24px;
  font-size: 13.5px;
}

.content.auth-content form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content.auth-content form button[type="submit"] {
  width: 100%;
  margin-top: 10px;
  padding: 12.5px;
}

.google-signin {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.google-signin:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.google-logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  color: #4285f4;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 850;
}

.google-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 18px;
  transition: transform var(--transition-fast);
}

.google-signin:hover .google-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.content.auth-content p {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.content.auth-content p a {
  color: var(--accent);
  font-weight: 700;
}

.content.auth-content p a:hover {
  text-decoration: underline;
}

/* ---------- 17. Flash Messages & Toast Container ---------- */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--status-new-bg);
  border: 1px solid var(--status-new-border);
  border-radius: var(--radius-md);
  color: var(--status-new-text);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  animation: ff-fade-in-up 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.flash.flash-danger,
.flash.flash-error {
  background: var(--sev-critical-bg);
  border-color: var(--sev-critical-border);
  color: var(--sev-critical-text);
}

.flash.flash-success {
  background: var(--status-resolved-bg);
  border-color: var(--status-resolved-border);
  color: var(--status-resolved-text);
}

.flash.flash-warning {
  background: var(--sev-medium-bg);
  border-color: var(--sev-medium-border);
  color: var(--sev-medium-text);
}

.flash svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}

.flash-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.flash-dismiss {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.flash-dismiss:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.flash.flash-hidden {
  display: none;
}

/* Fleet Toast Alert for Quick Clipboard */
.fleet-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fleet-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 18. Empty States & Error States ---------- */
.empty-state {
  text-align: center;
  padding: 58px 24px;
}

.empty-state h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 24px;
}

.error-state {
  width: 100%;
  max-width: 480px;
  margin: 12vh auto 0;
  text-align: center;
}

.error-card h1 {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 900;
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

/* ---------- 19. Non-Blocking Slim Top Progress Bar & Smooth Transitions ---------- */
.top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--ai-cyan) 0%, var(--accent) 50%, var(--success) 100%);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 99999;
  opacity: 0;
  pointer-events: none !important;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.top-progress-bar.is-active {
  opacity: 1;
}

/* Completely disable and hide old blocking full-screen overlay */
.page-loader,
.page-loader.is-visible {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

@keyframes ff-loader {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

.main-column {
  animation: ff-page-in 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ff-page-in {
  from { opacity: 0.85; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Smooth Micro-Animations & Dynamic Feedback ---------- */
.stat-card,
.result-card,
.action-card,
.radar-chip {
  animation: ff-fade-in-up 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 40ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 80ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 120ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 160ms; }

.risk-radar-strip .radar-chip:nth-child(1) { animation-delay: 30ms; }
.risk-radar-strip .radar-chip:nth-child(2) { animation-delay: 70ms; }
.risk-radar-strip .radar-chip:nth-child(3) { animation-delay: 110ms; }

.action-buttons .action-card:nth-child(1) { animation-delay: 50ms; }
.action-buttons .action-card:nth-child(2) { animation-delay: 100ms; }
.action-buttons .action-card:nth-child(3) { animation-delay: 150ms; }

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

/* Smooth Accordion Expansion for Evidence */
details[open] summary ~ * {
  animation: ff-details-reveal 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ff-details-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth Click Depressions */
button:active,
.primary-button:active,
.btn-primary:active {
  transform: translateY(1px) scale(0.985) !important;
  transition: transform 60ms ease !important;
}

.copy-badge:active {
  transform: scale(0.94);
  background: rgba(37, 99, 235, 0.35);
}

/* Subtle Shimmer for Pipeline Progress Track */
.audit-progress-track span {
  background-size: 200% 100%;
  animation: ff-shimmer 2.5s ease-in-out infinite;
}

@keyframes ff-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Smooth Table Row Elevation */
tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}


/* ---------- 20. Responsive Layout Media Queries ---------- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
  }

  .main-column {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar-brand {
    display: inline-flex;
  }

  .topbar-breadcrumb {
    display: none;
  }

  .results-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 24px 20px 60px;
  }

  .topbar {
    padding: 0 20px;
  }

  .results-overview,
  .finding-grid,
  .risk-radar-strip {
    grid-template-columns: 1fr;
  }

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

  .alerts-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .alerts-filter-form .filter-field {
    min-width: 0;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons a {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats-grid,
  .results-summary {
    grid-template-columns: 1fr;
  }

  .topbar-badge span:not(.dot) {
    display: none;
  }
}

/* ============================================================
   MODERN SLATE MATRIX DESIGN SYSTEM (Variation 2)
   High-precision telemetry, financial leakage analytics,
   neon gradient curves, and interactive surveillance tables.
   ============================================================ */

/* Topbar Modern Slate Additions */
.topbar-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 280px;
  transition: all 0.2s ease;
}

.topbar-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.topbar-search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 100%;
  outline: none;
}

.topbar-search-input::placeholder {
  color: var(--text-muted);
}

.topbar-date-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-date-picker:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.3);
}

.audit-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.02em;
}

.pulse-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Modern Slate Dashboard Container */
.slate-dashboard {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

/* 4-Column KPI Ribbon */
.slate-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.slate-kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.slate-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px -6px rgba(11, 19, 35, 0.7), 0 0 16px rgba(56, 189, 248, 0.12);
}

.slate-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.slate-kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.slate-delta-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.slate-delta-cyan {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.slate-delta-red {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.slate-delta-purple {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.slate-delta-green {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.slate-kpi-value {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.slate-sparkline-wrap {
  width: 100%;
  height: 44px;
  position: relative;
  margin-top: auto;
}

.slate-sparkline-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Dual Analytics Matrix Section */
.slate-matrix-row {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 18px;
  width: 100%;
}

.slate-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.slate-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.slate-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slate-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.slate-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Fuel Siphoning Anomaly SVG Timeline */
.timeline-chart-container {
  width: 100%;
  height: 220px;
  position: relative;
  margin-top: 6px;
}

.timeline-chart-container svg {
  width: 100%;
  height: 100%;
}

/* Fleet Leakage Breakdown Donut Section */
.donut-breakdown-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-height: 220px;
}

.donut-chart-box {
  width: 160px;
  height: 160px;
  position: relative;
  flex-shrink: 0;
}

.donut-chart-box svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center-stat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.donut-stat-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-categories-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.donut-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.donut-cat-row:hover {
  background: var(--surface);
  border-color: rgba(56, 189, 248, 0.2);
}

.donut-cat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

.donut-cat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-slice {
  transform-origin: center;
  transition: stroke-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, filter 0.25s ease;
}

.donut-slice:hover {
  stroke-width: 16 !important;
}

.telemetry-pt {
  transition: r 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.telemetry-pt:hover {
  r: 8 !important;
}

#timelineHud {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

#interactiveCrosshair {
  pointer-events: none;
  transition: x1 0.1s linear, x2 0.1s linear, opacity 0.2s ease;
}

.scenario-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scenario-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.15);
}

/* Surveillance Table Section */
.slate-surveillance-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slate-table-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #233249;
  flex-wrap: wrap;
  gap: 12px;
}

.slate-table-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slate-table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slate-table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  min-width: 220px;
}

.slate-table-search input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
  width: 100%;
}

.slate-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.slate-table th {
  background: var(--surface);
  padding: 12px 18px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.slate-table td {
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.slate-table tr:hover td {
  background: var(--surface-hover);
}

.truck-plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.04em;
}

.risk-score-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
}

.risk-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.risk-high {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.risk-normal {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.btn-investigate {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-investigate:hover {
  background: #38bdf8;
  color: #07101e;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

/* Responsive Rules for Modern Slate */
@media (max-width: 1200px) {
  .slate-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .slate-matrix-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .slate-kpi-grid {
    grid-template-columns: 1fr;
  }
  .donut-breakdown-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-search-wrap {
    min-width: auto;
    width: 100%;
  }
}

/* ============================================================
   ULTRA-SMOOTH TELEMETRY TIMELINE & 60FPS CHARTS
   ============================================================ */

.timeline-chart-container {
  position: relative;
  overflow: hidden;
  user-select: none;
}

#timelineSvg {
  display: block;
  width: 100%;
  height: 220px;
  cursor: crosshair;
  will-change: transform;
}

#crosshairGroup {
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.telemetry-pt {
  transform-origin: center;
  transition: r 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), stroke-width 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.telemetry-pt.active-pt {
  r: 7.5px !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 6px currentColor);
}

#timelineHud {
  background: rgba(10, 16, 31, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s ease;
}

/* 60fps Donut / Pie Chart Mechanics */
.donut-chart-box {
  width: 165px;
  height: 165px;
  position: relative;
  flex-shrink: 0;
}

.donut-chart-box svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.donut-slice {
  transform-origin: 50px 50px;
  transform-box: fill-box;
  transition: stroke-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.donut-chart-box.has-hover .donut-slice:not(.is-active) {
  opacity: 0.28 !important;
  stroke-width: 11px !important;
}

.donut-slice.is-active,
.donut-slice:hover {
  opacity: 1 !important;
  stroke-width: 15px !important;
  transform: scale(1.035);
  filter: drop-shadow(0 0 8px currentColor);
}

.donut-center-stat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-center-stat.fading {
  opacity: 0.2;
  transform: translate(-50%, -50%) scale(0.94);
}

.donut-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.78rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.donut-cat-row:hover,
.donut-cat-row.is-active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.15);
}

/* ============================================================
   AUTOMATIONS & API CONNECTOR HUB STYLES
   ============================================================ */

.hub-hero-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(13, 27, 42, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.connector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.connector-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s ease;
}

.connector-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.connector-card:hover::before {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.scenario-chip {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.scenario-chip:hover {
  transform: translateY(-1px);
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.scenario-chip.active {
  background: rgba(138, 180, 248, 0.12) !important;
  border-color: #8ab4f8 !important;
  color: #8ab4f8 !important;
  box-shadow: 0 1px 3px rgba(138, 180, 248, 0.15);
}

.scenario-chip.active-clean {
  background: rgba(129, 201, 149, 0.12) !important;
  border-color: #81c995 !important;
  color: #81c995 !important;
  box-shadow: 0 1px 3px rgba(129, 201, 149, 0.15);
}

.scenario-chip.active-danger {
  background: rgba(242, 139, 130, 0.12) !important;
  border-color: #f28b82 !important;
  color: #f28b82 !important;
  box-shadow: 0 1px 3px rgba(242, 139, 130, 0.15);
}

.scenario-chip.active-warning {
  background: rgba(253, 214, 99, 0.12) !important;
  border-color: #fdd663 !important;
  color: #fdd663 !important;
  box-shadow: 0 1px 3px rgba(253, 214, 99, 0.15);
}

.scenario-chip.active-purple {
  background: rgba(197, 138, 249, 0.12) !important;
  border-color: #c58af9 !important;
  color: #c58af9 !important;
  box-shadow: 0 1px 3px rgba(197, 138, 249, 0.15);
}

.scenario-chip.active-slate {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #9aa0a6 !important;
  color: #e3e3e3 !important;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.06);
}

/* Modal Smooth Entrance - Bulletproof Stacking */
.modal-overlay-custom {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(10, 10, 12, 0.82) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px 20px !important;
  box-sizing: border-box;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay-custom.open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-content-custom {
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 18px !important;
  width: 100% !important;
  max-width: 920px !important;
  max-height: calc(100vh - 64px) !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 1000000 !important;
}

/* Pulse animation for live indicators */
@keyframes softPulse {
  0% { transform: scale(0.95); opacity: 0.75; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.75; }
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: softPulse 2s infinite ease-in-out;
}

/* ============================================================
   FUTURISTIC CYBER-RADAR TELEMETRY COMMAND CENTER
   ============================================================ */
.cyber-radar-card {
  position: relative;
  background: radial-gradient(circle at 50% 20%, rgba(14, 26, 52, 0.92) 0%, rgba(6, 11, 24, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65), inset 0 0 40px rgba(56, 189, 248, 0.04);
  overflow: hidden;
}

.cyber-radar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 50%, transparent 100%);
  opacity: 0.8;
}

/* Radar Scanline Grid Background */
.cyber-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

/* Incident Switcher Tabs */
.incident-tab-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.incident-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.incident-tab-btn.active {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

.incident-tab-btn.active.clean {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

/* Cyber Time Scrubber Slider */
.cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.6);
  cursor: grab;
  transition: transform 0.1s ease;
}

.cyber-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
}

.cyber-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px #38bdf8;
  cursor: grab;
}

/* Radar Sweep Line Animation */
@keyframes radarSweepHorizontal {
  0% { transform: translateX(-10%); opacity: 0.1; }
  50% { opacity: 0.4; }
  100% { transform: translateX(110%); opacity: 0.1; }
}

.radar-sweep-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, #38bdf8, transparent);
  box-shadow: 0 0 12px #38bdf8;
  pointer-events: none;
  animation: radarSweepHorizontal 8s infinite linear;
}

/* Siphoning Beacon Ripple */
@keyframes beaconRipple {
  0% { r: 6; opacity: 0.9; stroke-width: 2.5; }
  70% { r: 24; opacity: 0; stroke-width: 0.5; }
  100% { r: 24; opacity: 0; stroke-width: 0; }
}

.beacon-pulse-ring {
  animation: beaconRipple 2.2s infinite cubic-bezier(0.25, 1, 0.5, 1);
  transform-box: fill-box;
  transform-origin: center;
}

/* ============================================================
   APPLE GLASSMORPHISM & PRO DATA GRID DESIGN SYSTEM (2026)
   ============================================================ */

/* ============================================================
   APPLE GLASSMORPHISM & PRO DATA GRID DESIGN SYSTEM (2026)
   Full macOS Sequoia / VisionOS Liquid Glass Material Architecture
   ============================================================ */

/* --- 0. Clean Enterprise Canvas Atmosphere --- */
.apple-glass-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.apple-orb {
  display: none;
}

/* --- 1. Clean Enterprise Card Surfaces --- */
.apple-glass-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

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

.apple-kpi-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* Ambient Container Helper */
.apple-ambient-glow {
  position: relative;
  z-index: 1;
}

/* --- 2. Executive KPI Ribbon --- */
.apple-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.apple-kpi-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.apple-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(138, 180, 248, 0.18) 100%);
  border-radius: 18px 0 0 18px;
}

.apple-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.apple-kpi-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

.apple-kpi-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}

.apple-kpi-badge.cyan {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}

.apple-kpi-badge.red {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
}

.apple-kpi-badge.amber {
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.25);
}

.apple-kpi-badge.green {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.25);
}

.apple-kpi-badge.purple {
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple);
  border-color: rgba(124, 58, 237, 0.25);
}

.apple-kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.apple-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 9px;
  margin-top: auto;
}

/* --- 3. Analytics Grid (ApexCharts Deck) --- */
.apple-analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1180px) {
  .apple-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.apple-chart-card {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
}

.apple-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.apple-chart-title-wrap h2 {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.015em;
}

.apple-chart-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Range Selector Apple Segmented Control */
.apple-segmented-control {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.apple-segment-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-segment-btn:hover {
  color: var(--text-primary);
}

.apple-segment-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ApexCharts Theme Overrides */
.apexcharts-canvas {
  font-family: var(--font-sans) !important;
}

.apexcharts-tooltip.apexcharts-theme-dark,
.apexcharts-tooltip.apexcharts-theme-light {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: 12px !important;
  padding: 8px !important;
  color: var(--text-primary) !important;
}

.apexcharts-tooltip-title {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 7px 12px !important;
  border-radius: 8px 8px 0 0 !important;
  letter-spacing: -0.01em;
  color: var(--text-primary) !important;
}

.apexcharts-xaxistooltip.apexcharts-theme-dark,
.apexcharts-xaxistooltip.apexcharts-theme-light {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
}

.apexcharts-legend-text {
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* --- 4. Interactive Pro Data Grid (Apple VisionOS / macOS Table) --- */
.pro-table-card {
  padding: 24px 26px;
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}

.pro-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.pro-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 290px;
}

.pro-search-icon {
  position: absolute;
  left: 13px;
  color: #94a3b8;
  pointer-events: none;
}

.pro-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-search-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 3.5px var(--accent-soft);
}

.pro-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  display: none;
}

.pro-filter-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pro-pill-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-pill-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pro-pill-btn:active {
  transform: scale(0.97);
}

.pro-pill-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: none;
}

.pro-pill-count {
  font-size: 10px;
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.pro-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-density-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.pro-density-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pro-density-btn.active {
  background: var(--surface-2);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* The Data Table Container */
.pro-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.pro-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.pro-data-table th {
  background: var(--surface-2);
  padding: 13px 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.pro-data-table th:hover {
  color: var(--text-primary);
}

.pro-data-table th .sort-chevron {
  display: inline-block;
  margin-left: 5px;
  opacity: 0.35;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pro-data-table th.sort-asc .sort-chevron {
  opacity: 1;
  color: var(--accent);
  transform: rotate(0deg);
}

.pro-data-table th.sort-desc .sort-chevron {
  opacity: 1;
  color: var(--accent);
  transform: rotate(180deg);
}

.pro-data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background 0.15s ease;
}

.pro-data-table tr.data-row {
  cursor: pointer;
}

.pro-data-table tr.data-row:hover td {
  background: var(--surface-hover);
}

.pro-data-table tr.data-row.expanded td {
  background: var(--accent-soft);
}

/* Density Compact Mode */
.pro-data-table.density-compact td {
  padding: 9px 14px;
  font-size: 12.5px;
}

.pro-data-table.density-compact th {
  padding: 9px 14px;
}

/* Inline Risk Sparkbar */
.risk-spark-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.risk-spark-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  max-width: 65px;
}

.risk-spark-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.risk-spark-fill.critical {
  background: #dc2626;
}

.risk-spark-fill.high {
  background: #ea580c;
}

.risk-spark-fill.medium {
  background: #d97706;
}

.risk-spark-fill.low {
  background: #16a34a;
}

/* Expandable Row Dossier Drawer */
.pro-dossier-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}

.pro-dossier-drawer {
  background: var(--surface);
  border-left: 3.5px solid var(--accent);
  box-shadow: none;
  padding: 20px 26px;
  display: none;
  animation: dossierSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-dossier-drawer.active {
  display: block;
}

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

.dossier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .dossier-grid {
    grid-template-columns: 1fr;
  }
}

.dossier-item-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}

.dossier-item-val {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}

.table-empty-msg {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   ULTRA-LUXURY ENTERPRISE TYPOGRAPHY SUITES
   ============================================================ */

/* 1. Inter Suite (opt-in via class) */
html.font-inter,
html.font-inter body {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

/* 2. Plus Jakarta Sans Suite (Apple Editorial & Modern Fintech) */
html.font-jakarta,
html.font-jakarta body {
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* 3. Geist Sans Suite (Vercel & Next-Gen High-Tech Precision) */
html.font-geist,
html.font-geist body {
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* 4. Outfit Suite (Modern Geometric Avant-Garde) */
html.font-outfit,
html.font-outfit body {
  --font-sans: "Outfit", "Plus Jakarta Sans", sans-serif;
}

/* 5. Apple SF Pro Native */
html.font-apple,
html.font-apple body {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

h1, h2, h3, h4, .brand-name {
  font-family: var(--font-sans);
  letter-spacing: -0.025em;
}

/* Apple Luxury Font Switcher Dropdown */
.apple-font-switcher {
  position: relative;
  z-index: 50;
}

.apple-font-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
  animation: dossierSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-font-dropdown.show {
  display: block;
}

.font-dropdown-header {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.font-opt {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.font-opt strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 750;
}

.font-opt small {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.font-opt:hover {
  background: var(--surface-hover);
  border-color: var(--border-subtle);
}

.font-opt.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.font-opt.active strong {
  color: var(--accent);
}

/* ============================================================
   ULTRA-PRO DONUT & FORENSIC BREAKDOWN MATRIX (APPLE GLASS)
   ============================================================ */
.apple-donut-card {
  position: relative;
  overflow: hidden;
}

.apple-vector-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(197, 138, 249, 0.1);
  color: #c58af9;
  border: 1px solid rgba(197, 138, 249, 0.3);
}

.vector-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c58af9;
  box-shadow: 0 0 8px rgba(197, 138, 249, 0.4);
  animation: pulseGlow 2s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 12px rgba(197, 138, 249, 0.6); }
}

.donut-chart-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.03) 45%, transparent 70%);
  border-radius: 20px;
  margin: 6px 0 10px;
  padding: 4px 0;
}

.donut-breakdown-matrix {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 4px;
  box-shadow: none;
}

.donut-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-breakdown-row:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.donut-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.donut-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.donut-row-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.donut-val {
  font-size: 12.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.donut-pct {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.02em;
}

.donut-integrity-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
}

.integrity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  margin-bottom: 7px;
}

.integrity-title {
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.integrity-score {
  color: var(--success);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.integrity-score small {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  margin-left: 3px;
}

.integrity-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.integrity-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #16a34a);
  border-radius: 999px;
}

/* ============================================================
   APPLE VISIONOS SPOTLIGHT COMMAND BAR (Ctrl + K)
   ============================================================ */
.command-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  animation: fadeIn 0.18s ease;
}

.command-modal-box {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: dossierSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.command-search-header input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-sans);
}

.command-search-header input::placeholder {
  color: var(--text-muted);
}

.command-esc-key {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #94a3b8;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
}

.command-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.command-group-title {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px 4px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.command-item:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateX(3px);
}

.cmd-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.cmd-text {
  flex: 1;
  font-weight: 500;
}

.cmd-shortcut, .cmd-badge {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.cmd-badge {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

/* ROI Simulator Slider Styling */
.roi-simulator-card input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  outline: none;
}

.roi-simulator-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease;
}

.roi-simulator-card input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ============================================================
   ADVANCED AUTHENTICATION, PASSWORD METER & SECURITY SUITE
   ============================================================ */

.auth-wrapper {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modern-auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg), 0 0 35px var(--accent-soft);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.modern-auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--border-highlight), transparent);
}

.register-auth-card {
  max-width: 580px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 18px var(--accent-glow);
}

.auth-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-wrapper .input-icon,
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 3;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

/* Modern inputs - explicit specificity to prevent base input[type] from resetting padding */
.input-icon-wrapper input,
.input-icon-wrapper input[type="text"],
.input-icon-wrapper input[type="password"],
.input-icon-wrapper input[type="email"],
.input-icon-wrapper input[type="number"],
input.modern-input,
input[type="text"].modern-input,
input[type="password"].modern-input,
input[type="email"].modern-input,
.modern-input {
  width: 100%;
  padding: 12px 14px !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

/* Left padding when input has an icon on the left */
.input-icon-wrapper > .input-icon ~ input,
.input-icon-wrapper > .input-icon ~ input[type="text"],
.input-icon-wrapper > .input-icon ~ input[type="password"],
.input-icon-wrapper > .input-icon ~ input[type="email"],
.input-icon-wrapper > .input-icon ~ .modern-input,
input.has-icon-left,
.modern-input.has-icon-left {
  padding-left: 44px !important;
}

/* Right padding when input has an eye toggle or action icon on the right */
.input-icon-wrapper:has(.eye-toggle-btn) input,
.input-icon-wrapper input:has(~ .eye-toggle-btn),
.input-icon-wrapper > input[type="password"],
input.has-icon-right,
.modern-input.has-icon-right {
  padding-right: 44px !important;
}

.input-icon-wrapper input:focus,
.modern-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 16px var(--accent-glow);
}

.modern-input:focus ~ .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: var(--accent);
}

.modern-select {
  padding-left: 14px !important;
  cursor: pointer;
}

.eye-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 3;
  transition: all 0.15s ease;
}

.eye-toggle-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

/* Password Strength Meter */
.strength-meter-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.strength-bar-segment {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-hover);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.strength-bar-segment.lvl-1 {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.strength-bar-segment.lvl-2 {
  background: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.6);
}

.strength-bar-segment.lvl-3 {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.strength-bar-segment.lvl-4 {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.password-checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.check-item.valid {
  color: var(--success);
  font-weight: 500;
}

.check-item .chk-icon {
  font-size: 11px;
}

.check-item.valid .chk-icon {
  color: var(--success);
}

/* Rate Limiting & Lockout Alerts */
.rate-warning-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(253, 214, 99, 0.1);
  border: 1px solid rgba(253, 214, 99, 0.3);
  color: #fdd663;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.rate-warning-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fdd663;
  box-shadow: 0 0 6px rgba(253, 214, 99, 0.4);
}

.lockout-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(242, 139, 130, 0.1);
  border: 1px solid rgba(242, 139, 130, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #f28b82;
  font-size: 12.5px;
}

.lockout-alert-box p {
  margin: 4px 0 0;
  color: #f28b82;
  font-size: 12px;
}

.lockout-alert-box strong {
  color: var(--text-primary);
  font-size: 13.5px;
}

.lockout-icon {
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Google Auth Button */
.google-auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.google-auth-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.google-svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.google-btn-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(66, 133, 244, 0.18);
  color: #60a5fa;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 12px;
}

.modern-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
  border: 1px solid var(--border-highlight);
  transition: all 0.2s ease;
}

.modern-auth-btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  background: var(--btn-primary-hover-bg);
  box-shadow: var(--shadow-lg), 0 0 24px var(--accent-glow);
}

.modern-auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-footer-links {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.modern-auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.modern-auth-link:hover {
  text-decoration: underline;
}

.security-trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trust-dot {
  color: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   PROFILE SUITE & TABS
   ============================================================ */

.profile-tabs-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  overflow-x: auto;
}

.profile-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.profile-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.profile-tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

.card-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card-section-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.token-balance-hero {
  text-align: center;
  padding: 20px 0 10px;
}

.token-big-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.03em;
}

.token-hero-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.profile-progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 20px;
}

.profile-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tier-limits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.limit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.limit-row span {
  color: var(--text-secondary);
}

.limit-row strong {
  color: var(--text-primary);
}

.api-key-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 16px;
}

.api-key-text {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 90px);
}

.pref-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-strong);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .toggle-slider {
  background-color: var(--success);
}

.switch-toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.security-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.sec-label {
  color: var(--text-secondary);
}

.sec-value {
  color: var(--text-primary);
  font-weight: 500;
}

.sec-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ============================================================
   FIRST-TIME LOGIN ONBOARDING WIZARD MODAL
   ============================================================ */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transform: translateZ(0);
  will-change: opacity;
  animation: fadeIn 0.2s ease;
}

.onboarding-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(56, 189, 248, 0.12);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.onboarding-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
}

.onboarding-close-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.onboarding-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.onboarding-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.onboarding-step-indicator span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.onboarding-step-indicator.active {
  color: var(--accent);
}

.onboarding-step-indicator.active span {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.onboarding-step-line {
  flex: 1;
  height: 2px;
  background: var(--surface-hover);
  margin: 0 8px;
}

.wiz-header {
  margin-bottom: 16px;
}

.wiz-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 8px 0 4px;
}

.wiz-icon {
  font-size: 32px;
}

.wiz-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.wiz-reward-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-align: center;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
}

.wiz-celebrate-badge {
  font-size: 44px;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* ============================================================
   UPLOAD LIVE TOKEN COST ESTIMATOR
   ============================================================ */

.upload-token-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 16px;
  animation: fadeIn 0.25s ease;
}

.est-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.est-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.est-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.est-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.est-value {
  font-size: 13px;
  color: var(--text-primary);
}

.est-balance-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.est-balance-status.status-ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.est-balance-status.status-warn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* ============================================================
   MOBILE RESPONSIVENESS MASTER SYSTEM (Phones & Tablets)
   Pixel-perfect touch optimization, balanced grids, no horizontal overflow
   ============================================================ */

/* 1. Global Viewport & Base Shell Touch Enhancements */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(290px, 85vw);
    height: 100vh;
    z-index: 10000;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
  }

  .sidebar-overlay {
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
  }

  .main-column {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .menu-toggle {
    display: inline-flex !important;
  }
}

/* ============================================================
   RESPONSIVE DECLUTTERING & VISIBILITY UTILITIES
   ============================================================ */
.show-mobile { display: none !important; }
.hide-mobile { display: inline !important; }
div.hide-mobile, p.hide-mobile, section.hide-mobile, tr.hide-mobile { display: block !important; }

/* 2. Tablets & Smartphones (< 768px) */
@media (max-width: 768px) {
  /* Responsive Visibility */
  .show-mobile { display: inline !important; }
  div.show-mobile, p.show-mobile { display: block !important; }
  .hide-mobile { display: none !important; }

  /* Prevent iOS zoom & horizontal jitter */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
  }

  /* Universal button containment on mobile */
  .btn, .primary-button, button, a.btn {
    box-sizing: border-box !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    text-align: center;
  }

  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on focus */
  }

  .content {
    padding: 18px 14px 75px !important;
  }

  /* Topbar mobile refinement */
  .topbar {
    padding: 0 14px !important;
    height: 56px !important;
    gap: 8px !important;
  }

  .topbar-company-badge {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px !important;
  }

  .topbar-actions {
    gap: 6px !important;
  }

  .topbar-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .topbar-upload-btn {
    padding: 6px 11px !important;
    font-size: 11.5px !important;
  }

  .audit-status-badge .status-badge-text {
    display: none !important;
  }

  .audit-status-badge {
    padding: 5px 6px !important;
  }

  /* Dashboard Header & Quick Actions */
  .dashboard-header-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
  }

  .dashboard-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .dashboard-header-actions .primary-button {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
  }

  .dashboard-header-actions .btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    justify-content: center !important;
    padding: 8px 8px !important;
    font-size: 11.5px !important;
    text-align: center !important;
    line-height: 1.25 !important;
  }

  /* Zone 1: Executive KPI Cards (Decluttered 2x2 Matrix with Generous Spacing) */
  .apple-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .apple-kpi-card {
    padding: 14px 14px !important;
    border-radius: 12px !important;
  }

  .apple-kpi-header {
    margin-bottom: 6px !important;
    gap: 6px !important;
  }

  .apple-kpi-title {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    gap: 5px !important;
  }

  .apple-kpi-title svg {
    width: 13px !important;
    height: 13px !important;
  }

  .apple-kpi-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }

  .apple-kpi-value {
    font-size: 1.35rem !important;
    margin: 6px 0 8px 0 !important;
    line-height: 1.15 !important;
  }

  .apple-kpi-footer {
    font-size: 11px !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 4px !important;
  }

  .apple-kpi-footer span:first-child {
    display: none !important; /* Hides verbose batch / review counts to eliminate crowding */
  }

  /* Zone 2: Charts & Analytics Grid (Clean Single-Column Stack) */
  .apple-analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    margin-bottom: 24px !important;
  }

  .apple-chart-card {
    padding: 18px 16px !important;
    border-radius: 14px !important;
  }

  .apple-chart-subtitle {
    display: none !important; /* Hides crowded explanatory paragraphs */
  }

  .apple-chart-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  .apple-chart-title-wrap h2 {
    font-size: 1.1rem !important;
  }

  .apple-segmented-control {
    width: 100% !important;
    display: flex !important;
  }

  .apple-segment-btn {
    flex: 1 !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
  }

  #apexSpendLeakageChart {
    min-height: 250px !important;
  }

  /* Zone 3: Tables & Data Grids (Zero Page Blowout + Smooth Momentum Scrolling) */
  .pro-table-card {
    padding: 16px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 18px !important;
  }

  .pro-table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
    padding-bottom: 14px !important;
  }

  .pro-search-box {
    width: 100% !important;
  }

  .pro-filter-pills {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  .pro-pill-btn {
    padding: 5px 11px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .pro-controls-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .pro-pills-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    flex-wrap: nowrap !important;
  }

  .pro-controls-right {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .pro-table-wrapper,
  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    position: relative;
  }

  .pro-data-table,
  .alerts-table {
    min-width: 680px !important; /* Preserves column hierarchy during swipe */
  }

  .pro-data-table th,
  .pro-data-table td {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  /* Results Page: Mobile Action Deck */
  .results-actions-deck {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .results-actions-deck .action-btn-primary {
    width: 100% !important;
    justify-content: center !important;
    order: 1 !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  .results-actions-deck .action-btn-legal {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    order: 2 !important;
    padding: 9px 8px !important;
    font-size: 11px !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .results-actions-deck .action-btn-secondary {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    order: 3 !important;
    padding: 8px 8px !important;
    font-size: 11px !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* Results Banners */
  .withholding-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 16px 14px !important;
    gap: 14px !important;
  }

  .withholding-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .withholding-actions .btn,
  .withholding-actions .primary-button {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 10px 14px !important;
  }

  .share-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 14px 14px !important;
    gap: 12px !important;
  }

  .share-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .share-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    font-size: 11.5px !important;
  }

  /* Results 6 Stat Cards Grid (Clean 2x2 with Generous Spacing) */
  .results-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .results-stat-grid > div {
    padding: 15px 14px !important;
    border-radius: 12px !important;
  }

  .results-stat-grid > div > div:nth-child(2) {
    font-size: 1.35rem !important;
    margin: 4px 0 2px 0 !important;
  }

  /* Subscription Plans on Mobile */
  .subscription-plans-card {
    padding: 18px 14px !important;
  }

  .subscription-plans-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }

  .billing-cycle-switch {
    width: 100% !important;
    display: flex !important;
  }

  .billing-cycle-switch button {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    padding: 8px 8px !important;
  }

  .pricing-plans-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .dedicated-ca-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 16px 14px !important;
    gap: 14px !important;
  }

  .dedicated-ca-card > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .dedicated-ca-card > div:last-child .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Upload Pre-Flight Estimator Grid */
  .upload-box {
    padding: 18px 14px !important;
  }

  .dropzone {
    padding: 30px 14px !important;
  }

  .est-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .est-item {
    background: var(--surface-2);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
  }

  .est-label {
    font-size: 10px !important;
  }

  .est-value {
    font-size: 12px !important;
  }

  /* KPI Intelligence Modal (Native Sheet Transition on Mobile) */
  .modal-overlay-custom {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal-content-custom {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .kpi-modal-metric-box {
    padding: 10px 12px !important;
  }

  .kpi-modal-num {
    font-size: 1.25rem !important;
  }

  /* Mobile Onboarding Banner */
  .onboarding-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 14px !important;
  }

  .onboarding-banner .primary-button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* 3. Small Mobile Devices (< 480px) */
@media (max-width: 480px) {
  .content {
    padding: 14px 10px 80px !important;
  }

  .topbar {
    padding: 0 10px !important;
  }

  .topbar-company-badge {
    max-width: 95px !important;
  }

  .topbar-credits-label {
    display: none !important;
  }

  .topbar-upload-btn span {
    display: none !important;
  }

  .topbar-upload-btn {
    padding: 6px 8px !important;
  }

  .topbar-btn {
    padding: 5px 8px !important;
  }

  .apple-kpi-value {
    font-size: 1.15rem !important;
  }

  .apple-kpi-card {
    padding: 10px 9px !important;
  }

  .results-actions-deck .action-btn-legal {
    flex: 1 1 100% !important; /* Stack cleanly on tiny screens */
  }

  .share-actions {
    grid-template-columns: 1fr !important;
  }

  .results-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .results-stat-grid > div > div:nth-child(2) {
    font-size: 1.15rem !important;
  }
}

