:root {

/* ============================================
   CSS Custom Iterate Color Properties (Variables)
   ============================================ */

    --Primary-Yellow: var(--color-yellow-500);
  /* Colors - Primary & Brand */
  --color-primary: var(--color-blue-500);
  --color-primary-light: #DFF0FD;
  --color-primary-dark: #1976d2;
  --color-accent-red: #D4575D;
  --color-accent-orange: var(--color-orange-500);

  /* Neutral Scale (Tailwind neutral) */
  --white: #ffffff;
  --color-neutral-50: #fafafa;
  --color-neutral-100: #f5f5f5;
  --color-neutral-200: #e5e5e5;
  --color-neutral-300: #d4d4d4;
  --color-neutral-400: #a3a3a3;
  --color-neutral-500: #737373;
  --color-neutral-600: #525252;
  --color-neutral-700: #404040;
  --color-neutral-800: #262626;
  --color-neutral-900: #171717;
  --color-neutral-950: #0a0a0a;

  /* Blue Scale (Custom) */
  --color-blue-50: #E9F0FC;
  --color-blue-100: #D5E1F9;
  --color-blue-200: #ADC5F4;
  --color-blue-300: #84A8EF;
  --color-blue-400: #5C8CE9;
  --color-blue-500: #336FE4;
  --color-blue-600: #1A54C5;
  --color-blue-700: #133F93;
  --color-blue-800: #0D2A62;
  --color-blue-900: #061530;
  --color-blue-950: #030A17;

  /* Orange Scale (Custom) */
  --color-orange-50: #FDF1EE;
  --color-orange-100: #FCDFD9;
  --color-orange-200: #F8BBAF;
  --color-orange-300: #F49785;
  --color-orange-400: #F0735B;
  --color-orange-500: #EC4F31;
  --color-orange-600: #C93C21;
  --color-orange-700: #A02D17;
  --color-orange-800: #742010;
  --color-orange-900: #47140A;
  --color-orange-950: #310D06;

  /* Yellow Scale (Custom) */
  --color-yellow-50: #FEFAED;
  --color-yellow-100: #FCF4D8;
  --color-yellow-200: #F9E9AD;
  --color-yellow-300: #F5DE82;
  --color-yellow-400: #F2D258;
  --color-yellow-500: #EFC72D;
  --color-yellow-600: #D9AF10;
  --color-yellow-700: #A9890D;
  --color-yellow-800: #7A6309;
  --color-yellow-900: #4A3C06;
  --color-yellow-950: #332904;

  /* Red Scale (Custom) */
  --color-red-50: #F9E0E0;
  --color-red-100: #F6CACA;
  --color-red-200: #EE9F9F;
  --color-red-300: #E67474;
  --color-red-400: #DE4949;
  --color-red-500: #CF2525;
  --color-red-600: #A81E1E;
  --color-red-700: #811717;
  --color-red-800: #5A1010;
  --color-red-900: #330909;
  --color-red-950: #200606;

  /* Green Scale (Custom) */
  --color-green-50: #E6F9EF;
  --color-green-100: #CDF4DF;
  --color-green-200: #9BE8BE;
  --color-green-300: #6ADD9E;
  --color-green-400: #38D17D;
  --color-green-500: #26A660;
  --color-green-600: #1E854D;
  --color-green-700: #17643A;
  --color-green-800: #0F4226;
  --color-green-900: #082113;
  --color-green-950: #04110A;

  /* Cyan Scale (Custom) */
  --color-cyan-50: #E7FBFE;
  --color-cyan-100: #CFF6FC;
  --color-cyan-200: #9EEEFA;
  --color-cyan-300: #6EE5F7;
  --color-cyan-400: #3DDDF5;
  --color-cyan-500: #0DD4F2;
  --color-cyan-600: #0AAAC2;
  --color-cyan-700: #087F91;
  --color-cyan-800: #055561;
  --color-cyan-900: #032A30;
  --color-cyan-950: #011518;

  /* Violet Scale (Custom) */
  --color-violet-50: #F1E9FC;
  --color-violet-100: #E3D5F9;
  --color-violet-200: #C8ADF4;
  --color-violet-300: #AD84EF;
  --color-violet-400: #925CE9;
  --color-violet-500: #7733E4;
  --color-violet-600: #5E1BC9;
  --color-violet-700: #49159C;
  --color-violet-800: #340F6F;
  --color-violet-900: #1F0942;
  --color-violet-950: #14062C;

  /* Colors - Dark Text */
  --color-text-primary: var(--color-neutral-900);
  --color-text-dark: var(--color-neutral-900);
  --color-text-darker: var(--color-neutral-900);
  --color-text-medium: var(--color-neutral-700);
  --color-text-secondary: var(--color-neutral-500);
    --color-text-muted: var(--color-neutral-500);
  --color-text-light: var(--color-neutral-400);

  /* Colors - Borders (Semantic - change these to update all borders) */
  --border-color-default: var(--color-neutral-200);     /* Default border color */
  --border-color-light: var(--color-neutral-100);       /* Lighter borders */
  --border-color-medium: var(--color-neutral-500);      /* Medium borders */
  --border-color-dark: var(--color-neutral-900);        /* Darker borders */

/* Simplified Black/White Theme (Matches WebUI) */
  --primary-500: #000000;
  --secondary-500: #666666;
  --success-500: #166534;
  --alert-500: #991b1b;
  --warning-500: #92400e;

  /* Neutrals */
  --neutral-950: #000000;
  --neutral-900: #171717;
  --neutral-800: #e5e5e5; /* Lighter borders */
  --neutral-400: #737373; /* Muted text */
  --neutral-100: #000000; /* Main text */

  /* Theme Mapping */
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --panel: #ffffff; /* Panels connect seamlessly or use slight off-white if needed */
  --component-bg: #ffffff;
  --muted: var(--neutral-400);
  --text: var(--neutral-100);
  --text-primary: var(--color-neutral-950);
  --text-muted: var(--color-neutral-500);

  --accent: #000000;
  --accent-secondary: #404040;

  --danger: var(--color-red-500);
  --warning: var(--color-yellow-600);
  --success: var(--color-green-500);

  --border: var(--color-neutral-200);

  --control-default-font:    14px;
  --control-default-padding: 8px 16px;
  --control-sm-font:         12px;
  --control-sm-padding:      6px 12px;
  --control-line-height:     1.4;
  --control-border:          1px;

}

* {
  box-sizing: border-box;
  scrollbar-color: var(--color-neutral-300) rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  background: var(--bg);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* ===========================
   Dashboard Heading Styles
   =========================== */

h1, h2, h3, h4, h5 {
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

/* Page title — used once per view */
h1 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

/* Section heading — major content regions */
h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

/* Subsection title — nested content groups */
h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

/* Card or panel header */
h4 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

/* Label / category tag — all-caps eyebrow style */
h5 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 5;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  height: 38px;
  width: auto;
}

.brand-subtitle-container {
  display: flex;
  flex-direction: column;
}

.brand-by {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  font-weight: 700;
}

.controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.container {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-3 > * {
  min-width: 0;
  overflow: hidden;
}

/* Prevent ApexCharts SVG from overflowing chart cards */
.grid-3 .apexcharts-canvas,
.grid-3 .apexcharts-canvas svg {
  max-width: 100% !important;
  overflow: hidden !important;
}

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

/* Responsive grid layouts */
@media (max-width: 992px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Make 3-column grids stack on tablets/mobile */
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  /* Make 4-column perf stats into 2x2 on tablets */
  #perf-stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Hide header elements on mobile */
  #open-wizard-btn,
  #health-status,
  #user-name,
  #user-email {
    display: none !important;
  }
}

/* Sidebar wizard button — mobile only */
.sidebar-wizard-btn-wrapper {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-wizard-btn-wrapper {
    display: block;
    padding: 12px 12px 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
}

@media (max-width: 576px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  /* Make perf stats fully stack on small mobile */
  #perf-stats-container {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   MOBILE SIDEBAR DRAWER (≤ 992px)
   ============================================ */

/* Logo swap */
.logo-mobile { display: none; }

/* Hamburger button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.mobile-menu-btn:hover {
  background: var(--color-neutral-100);
}
.mobile-menu-btn [data-lucide] {
  width: 20px;
  height: 20px;
}

/* Backdrop — hidden on desktop; present but invisible on mobile until .visible */
.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 992px) {
  /* Show hamburger */
  .mobile-menu-btn {
    display: flex;
  }

  /* Swap logo */
  .logo-desktop { display: none; }
  .logo-mobile  { display: block; }

  /* Activate backdrop layer */
  .mobile-sidebar-backdrop {
    display: block;
  }

  /* Sidebar becomes a fixed overlay drawer */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100% !important;
    z-index: 200;
    width: 265px !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Reset all collapsed-state overrides so the drawer always shows full labels */
  .sidebar.collapsed .nav-label {
    display: inline !important;
  }
  .sidebar.collapsed .nav-section-label {
    font-size: 10px !important;
    padding: 16px 12px 8px 12px !important;
    margin-top: 4px !important;
    overflow: visible !important;
  }
  .sidebar.collapsed .nav-item {
    padding: 6px 12px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }
  .sidebar.collapsed .menu-arrow {
    display: inline-flex !important;
  }

  /* Hide the desktop collapse toggle in mobile drawer */
  .sidebar-collapse-btn-wrapper {
    display: none !important;
  }
}

.panel {
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: none;
  margin-bottom: 8px;
}

.panel h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h3 i[data-lucide],
.panel h3 svg {
  display: none;
}

.panel h3 select {
  margin-left: auto;
  float: none;
}

/* Panel header with controls on the right */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header h3 {
  margin: 0;
}

.panel-header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-header-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .panel-header-controls select,
  .panel-header-controls button {
    flex: 1;
    min-width: 0;
  }

  /* Stack inline grids on mobile */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Responsive form controls */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
label {
  display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  line-height: 1;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  box-sizing: border-box;
}

input[type="checkbox"]:hover {
  border-color: var(--color-blue-500);
}

input[type="checkbox"]:checked {
  background: var(--color-blue-500);
  border-color: var(--color-blue-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 111, 228, 0.25);
}

input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
select,
button,
textarea {
  font-size: var(--control-default-font);
  padding: var(--control-default-padding);
  background-color: var(--white);
  line-height: var(--control-line-height);
  border: var(--control-border) solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
}

input:focus,
select:focus,
button:focus,
textarea:focus {
  border-color: var(--accent);
}

/* .btn {
  background: var(--color-neutral-950); 
  border: 1px solid var(--color-neutral-950);
  color: #ffffff;
  cursor: pointer;
  transition: 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
} */

/* All variants share the same solid black style for a consistent look */
.btn.primary,
.btn.success,
.btn.warning,
.btn.danger {
  background: #111827;
  border-color: transparent;
  color: #ffffff;
}

.btn:hover {
  background: var(--color-neutral-700);
}

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

/*-------------------------------------------
  Button styles
-------------------------------------------*/
/* ── Base ── */
.btn {
  background: var(--color-neutral-950);
  border: var(--control-border) solid transparent;
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  font-size: var(--control-default-font);
  padding: var(--control-default-padding);
  line-height: var(--control-line-height);
  white-space: nowrap;
  box-sizing: border-box;
  border-radius: 8px;
}

/* ── Small size ── */
.btn.btn-sm {
  font-size: var(--control-sm-font);
  padding: var(--control-sm-padding);
  border-radius: 6px;
}

/* ── Primary (default style) ── */
.btn.btn-primary {
  background: var(--color-neutral-950);
  border-color: transparent;
  color: var(--white);
}

.btn.btn-primary:hover:not(:disabled) {
  background: var(--color-neutral-700);
  border-color: var(--color-neutral-700);
}

.btn.btn-primary:active:not(:disabled) {
  background: var(--color-neutral-600);
  border-color: var(--color-neutral-600);
}

/* ── Secondary ── */
.btn.btn-secondary {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.btn.btn-secondary:active:not(:disabled) {
  background: #f3f4f6;
  border-color: #6b7280;
}

/* ── Text link button ── */
.btn.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--color-neutral-950);       
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  font-weight: 500;
}

.btn.btn-link:hover:not(:disabled) {
  background: transparent;
  border-color: transparent;        
  text-decoration-color: currentColor;
}

.btn.btn-link:active:not(:disabled) {      
  background: transparent;
  border-color: transparent;
}

/* ── Disabled (shared) ── */
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sdk-tab-btn.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.sdk-code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.78rem;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  line-height: 1.5;
}

/* Pagination controls */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-controls .btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  min-height: 30px;
  min-width: 32px;
  justify-content: center;
  gap: 4px;
}

.pagination-controls .btn[disabled] {
  opacity: 0.4;
}

.pagination-controls .btn.primary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 30px;
  font-size: 15px;
  color: var(--text-muted);
  user-select: none;
}

/* Ensure SVG icons inside buttons don't block clicks */
.btn svg,
.btn i,
.btn svg * {
  pointer-events: none;
}

.metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metric {
  flex: 1 1 200px;
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.metric .value {
  font-size: 20px;
  font-weight: 700;
}

.metric .label {
  font-size: 12px;
  color: var(--text-muted);
}

.metric .trend {
  font-size: 11px;
  margin-top: 4px;
}

.metric .trend.up {
  color: var(--color-green-500);
}

.metric .trend.down {
  color: var(--color-red-500);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}
.text-muted {
  color: var(--text-muted);
}

/* Markdown content styling for AI Insights */
.markdown-content {
  color: var(--text-primary);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
}

.markdown-content h1 {
  font-size: 1.5em;
}
.markdown-content h2 {
  font-size: 1.3em;
}
.markdown-content h3 {
  font-size: 1.15em;
}
.markdown-content h4 {
  font-size: 1.05em;
}

.markdown-content p {
  margin: 0 0 8px 0;
}

.markdown-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-content em {
  font-style: italic;
}

.markdown-content code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 0.9em;
  color: var(--accent);
}

.markdown-content pre {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

.markdown-content ul,
.markdown-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.markdown-content li {
  margin: 4px 0;
  line-height: 1.6;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.markdown-content th,
.markdown-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-content tr:nth-child(even) {
  background: var(--bg-secondary);
}

.markdown-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 12px 0;
  padding: 8px 16px;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.markdown-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.markdown-content a {
  color: var(--accent);
  text-decoration: none;
}

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

/* Typing cursor animation for streaming */
.typing-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid;
  display: inline-block;
  margin: 2px;
  white-space: nowrap;
}
.tag.blue {
  background-color: var(--color-blue-500);
  color: var(--white);
}
.tag.green {
  background-color: var(--color-green-600);
  color: var(--white);
}
.tag.orange {
  background-color: var(--color-orange-600);
  color: var(--white);
}
.tag.red {
  background-color: var(--color-red-500);
  color: var(--white);
}
.tag.cyan {
  background-color: var(--color-cyan-700);
  color: var(--white);
}
.tag.violet {
  background-color: var(--color-violet-500);
  color: var(--white);
}
.tag.yellow {
  background-color: var(--color-yellow-800);
  color: var(--white);
}
.tag.pink {
  background-color: #ec4899;
  color: var(--white);
}

.tag.active {
  border-color: var(--color-green-500);
  color: var(--color-green-500);
  background: var(--color-green-50);
}

.tag.suspended {
  border-color: var(--color-red-500);
  color: var(--color-red-500);
  background: var(--color-red-50);
}

.tag.enabled {
  border-color: var(--color-green-500);
  color: var(--color-green-500);
  background: var(--color-green-50);
}

.tag.disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--color-neutral-50);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  /* margin-right: 6px; */
}

.status-dot.healthy {
  background: var(--color-green-500);
}

.status-dot.warning {
  background: var(--warning);
}

.status-dot.error {
  background: var(--danger);
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--component-bg);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  display: inline-block;
}

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

/* User Menu */
.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-orange-500);
  color: #fff;  
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

#user-email {
  font-size: 11px;
  color: var(--muted);
}

/* User Menu Dropdown */
.user-menu-wrapper {
  position: relative;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.user-menu-chevron {
  transition: transform 0.2s ease;
}

.user-menu-wrapper.open .user-menu-chevron {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 140px;
  z-index: 200;
  overflow: hidden;
}

.user-menu-wrapper.open .user-menu-dropdown {
  display: block;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.user-menu-item:hover {
  background: var(--bg-secondary);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}

.sidebar {
  width: 265px;
  background: var(--component-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: visible;
  transition: width 0.25s ease;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
  width: 52px;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .nav-section-label {
  font-size: 0;
  padding: 0;
  margin: 4px 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  padding: 6px;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .nav-item .tooltip-wrapper {
  display: none !important;
}

.sidebar.collapsed .menu-arrow {
  display: none;
}

.sidebar.collapsed #settings-submenu,
.sidebar.collapsed #platform-admin-submenu {
  display: none !important;
}

.sidebar.collapsed .sidebar-footer-info {
  display: none;
}

/* Sidebar collapse toggle button — styled as a nav-item */
.sidebar-collapse-btn {
  color: var(--text-muted);
}

.sidebar.collapsed .sidebar-collapse-btn-wrapper {
  margin: 0;
  padding: 4px 8px;
}

/* Floating nav tooltip shown on hover in collapsed state */
#sidebar-nav-tooltip {
  position: fixed;
  z-index: 9999;
  padding: 5px 10px;
  background: var(--color-neutral-900);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

#sidebar-nav-tooltip.visible {
  opacity: 1;
}

.sidebar-nav {
  padding: 16px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Replaces .tab styling */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--color-neutral-100);
  color: var(--neutral-900);
}

.nav-item.active {
  background-color: var(--color-neutral-100);
  color: var(--color-orange-500);
  font-weight: 500;
}

.nav-item [data-lucide] {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.main-content {
  flex: 1;
  padding: 24px;
  background: var(--color-neutral-100);
  overflow-y: auto;
  min-width: 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

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

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

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(calc(100% + 20px)); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(calc(100% + 20px)); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chart-placeholder {
  height: 200px;
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.employee-card {
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.employee-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.employee-card .stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.model-usage-bar {
  background: var(--component-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  height: 20px;
  margin: 4px 0;
}

.model-usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.3s ease;
}

.loading {
  opacity: 0.6;
}

.error-message {
  color: var(--danger);
  background: rgba(222, 40, 84, 0.1);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.success-message {
  color: var(--success);
  background: rgba(38, 166, 96, 0.1);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

/* Lucide icon styling for clean, minimal icons (no heavy chips) */
[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.panel h3 [data-lucide],
.tabs .tab [data-lucide] {
  color: var(--accent);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active,
.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  padding:0;
}
.close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--panel);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 12px;
}

/* Chat Bubbles */
#chat-history-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  position: relative;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--component-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}

.chat-message.system {
  align-self: stretch;
  background: transparent;
  color: var(--text);
  border: none;
  max-width: 100%;
  padding: 4px 0;
}

.chat-message.system .role {
  display: none;
}

.chat-message .role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.8;
  display: block;
}

.chat-message pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  margin: 8px 0;
}

/* Chat History Modal Enhanced Styles */
.chat-history-modal-content {
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
}

.chat-history-modal-body {
  flex: 1;
  overflow-y: auto;
  max-height: calc(85vh - 160px);
  padding: 20px;
}

.chat-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.chat-section-header i {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

/* Analysis Section Styles */
.analysis-section {
  background: linear-gradient(
    135deg,
    var(--component-bg) 0%,
    rgba(51, 111, 228, 0.03) 100%
  );
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.analysis-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.analysis-title i {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.analysis-content {
  min-height: 60px;
}

.analysis-placeholder,
.analysis-loading,
.analysis-error,
.no-detections {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-placeholder i,
.analysis-loading i,
.no-detections i {
  width: 18px;
  height: 18px;
}

.analysis-error {
  color: var(--danger);
}

.no-detections {
  background: rgba(34, 197, 94, 0.08);
  border-radius: 8px;
  color: #22c55e;
}

.no-detections i {
  color: #22c55e;
}

/* Analysis Results */
.analysis-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.summary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-card.clean {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.summary-card.low {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.05);
}

.summary-card.warning {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.05);
}

.summary-card.critical {
  border-color: #CF2525;
  background: rgba(239, 68, 68, 0.08);
}

.summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--component-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-icon i {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.summary-card.clean .summary-icon i {
  color: #22c55e;
}
.summary-card.low .summary-icon i {
  color: #eab308;
}
.summary-card.warning .summary-icon i {
  color: #f97316;
}
.summary-card.critical .summary-icon i {
  color: #CF2525;
}

.summary-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.summary-value.small {
  font-size: 12px;
  font-weight: 600;
}

.summary-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

/* Detections Section */
.detections-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section-title i {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.detections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.detection-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--component-bg);
  border-radius: 8px;
  border-left: 3px solid var(--border);
}

.detection-card.low {
  border-left-color: #eab308;
}

.detection-card.warning {
  border-left-color: #f97316;
}

.detection-card.critical {
  border-left-color: #CF2525;
  background: rgba(239, 68, 68, 0.05);
}

.detection-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detection-icon i {
  width: 16px;
  height: 16px;
}

.detection-card.low .detection-icon i {
  color: #eab308;
}
.detection-card.warning .detection-icon i {
  color: #f97316;
}
.detection-card.critical .detection-icon i {
  color: #CF2525;
}

.detection-details {
  flex: 1;
  min-width: 0;
}

.detection-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.detection-count {
  font-size: 11px;
  color: var(--muted);
}

.detection-confidence {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.8;
}

/* Compliance Violations */
.compliance-violations {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.violation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  color: #CF2525;
  margin-bottom: 10px;
}

.violation-header i {
  width: 16px;
  height: 16px;
}

.violation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.violation-tag {
  background: rgba(239, 68, 68, 0.15);
  color: #CF2525;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Recommendations */
.analysis-recommendations {
  background: rgba(51, 111, 228, 0.05);
  border: 1px solid rgba(51, 111, 228, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.recommendations-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.recommendations-header i {
  width: 16px;
  height: 16px;
}

.recommendations-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text);
}

.recommendations-list li {
  margin-bottom: 4px;
}

/* JSON Syntax Highlighting */
.json-content {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.json-key {
  color: #0550ae;
}
.json-string {
  color: #0a3069;
}
.json-number {
  color: #0550ae;
}
.json-boolean {
  color: #cf222e;
}
.json-null {
  color: #6e7781;
}

.code-block {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
}

.inline-code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Badge styles for classification */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border:1px solid transparent;
}

.badge-success {
  background: var(--color-green-50);
  color: var(--color-green-500);
  border-color: var(--color-green-500);
}

.badge-muted {
  background: var(--color-neutral-50);
  color: var(--color-neutral-500);
  border-color: var(--color-neutral-500);

}

.badge-info {
  background: var(--color-blue-50);
  color: var(--color-blue-500);
  border-color: var(--color-blue-500);
}

.badge-warning {
  background: var(--color-orange-50);
  color: var(--color-orange-500);
  border-color: var(--color-orange-500);
}

.badge-danger {
  background: var(--color-red-50);
  color: var(--color-red-500);
  border-color: var(--color-red-500);
}

/* Spinner Animation */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Category Breakdown */
.category-breakdown {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--component-bg);
  border-radius: 8px;
  border-left: 4px solid var(--border);
}

.category-card i {
  width: 24px;
  height: 24px;
}

.category-info {
  flex: 1;
}

.category-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.category-count {
  font-size: 11px;
  color: var(--muted);
}

/* Severity Breakdown */
.severity-breakdown {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.severity-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.severity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.severity-label {
  width: 60px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-label.critical {
  color: #CF2525;
}
.severity-label.high {
  color: #f97316;
}
.severity-label.medium {
  color: #eab308;
}
.severity-label.low {
  color: #22c55e;
}

.severity-bar-container {
  flex: 1;
  height: 8px;
  background: var(--component-bg);
  border-radius: 4px;
  overflow: hidden;
}

.severity-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.severity-bar.critical {
  background: #CF2525;
}
.severity-bar.high {
  background: #f97316;
}
.severity-bar.medium {
  background: #eab308;
}
.severity-bar.low {
  background: #22c55e;
}

.severity-count {
  width: 30px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* Detection meta info */
.detection-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.category-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.category-badge.phi {
  background: rgba(239, 68, 68, 0.15);
  color: #CF2525;
}

.category-badge.pii {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.category-badge.pci {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.category-badge.credentials {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.confidence {
  font-size: 10px;
  color: var(--muted);
}

/* Clickable detection cards */
.detection-card.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.detection-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detection-card.active {
  ring: 2px solid var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  background: rgba(51, 111, 228, 0.08);
}

.detection-card .click-hint {
  width: 12px;
  height: 12px;
  color: var(--muted);
  margin-left: 4px;
  opacity: 0.6;
}

.detection-card.clickable:hover .click-hint {
  opacity: 1;
  color: var(--accent);
}

/* Detection highlight in chat */
.detection-highlight {
  background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
  padding: 1px 4px;
  border-radius: 3px;
  color: #854d0e;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.detection-highlight.pulse {
  animation: highlightPulse 0.5s ease-in-out 3;
}

@keyframes highlightPulse {
  0%,
  100% {
    background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
    transform: scale(1);
  }
  50% {
    background: linear-gradient(120deg, #fde047 0%, #facc15 100%);
    transform: scale(1.05);
  }
}

/* Highlight status bar */
.highlight-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  animation: slideDown 0.3s ease;
}

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

.highlight-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #854d0e;
  font-size: 13px;
}

.highlight-info i {
  width: 16px;
  height: 16px;
}

.highlight-info strong {
  font-weight: 700;
}

.clear-highlights-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #fde047;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #854d0e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-highlights-btn:hover {
  background: white;
  border-color: #facc15;
}

.clear-highlights-btn i {
  width: 14px;
  height: 14px;
}

/* Different highlight colors for different categories */
.detection-highlight[data-type*="creditCard"],
.detection-highlight[data-type*="cvv"],
.detection-highlight[data-type*="cardPin"] {
  background: linear-gradient(120deg, #f5d0fe 0%, #e879f9 50%, #f5d0fe 100%);
  color: #701a75;
}

.detection-highlight[data-type*="mrn"],
.detection-highlight[data-type*="healthPlan"],
.detection-highlight[data-type*="npi"],
.detection-highlight[data-type*="medication"],
.detection-highlight[data-type*="labResult"],
.detection-highlight[data-type*="treatment"] {
  background: linear-gradient(120deg, #fecaca 0%, #f87171 50%, #fecaca 100%);
  color: #7f1d1d;
}

.detection-highlight[data-type*="apiKey"],
.detection-highlight[data-type*="password"],
.detection-highlight[data-type*="aws"],
.detection-highlight[data-type*="privateKey"],
.detection-highlight[data-type*="jwt"] {
  background: linear-gradient(120deg, #fecdd3 0%, #fb7185 50%, #fecdd3 100%);
  color: #881337;
}

/* Tools and MCP Servers Section */
.tools-section,
.mcp-section {
  margin-top: 16px;
  padding: 12px;
  background: var(--component-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tools-section .section-title,
.mcp-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.tools-section .section-title i,
.mcp-section .section-title i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.tools-grid,
.mcp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-badge,
.mcp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
  transition: all 0.2s ease;
}

.tool-badge {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.tool-badge:hover {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  transform: translateY(-1px);
}

.mcp-badge {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #7c3aed;
  border: 1px solid #c4b5fd;
}

.mcp-badge:hover {
  background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 100%);
  transform: translateY(-1px);
}

.tool-badge i,
.mcp-badge i {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Analysis Method Indicator */
.analysis-method {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.analysis-method i {
  width: 16px;
  height: 16px;
  color: #b45309;
}

/* Analysis Summary Text */
.analysis-summary-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--component-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.analysis-summary-text i {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .analysis-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-history-modal-content {
    width: 95%;
    max-width: none;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }
}

#audit-trail-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

#audit-trail-table tbody tr:hover {
  background: rgba(51, 111, 228, 0.05);
}

.small {
  font-size: 11px;
}

/* ============================================
   OBSERVABILITY FILTER BAR STYLING
   ============================================ */

.obs-filter-container {
  background: var(--panel-bg, var(--component-bg));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.obs-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:hover {
  border-color: var(--accent);
  background: var(--panel-bg, var(--component-bg));
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.filter-multi {
  min-height: 38px;
  max-height: 120px;
}

.filter-multi option {
  padding: 6px 8px;
  border-radius: 4px;
  margin: 2px 0;
}

.filter-multi option:checked {
  background: var(--accent);
  color: white;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  flex: 1;
}

.filter-input:hover {
  border-color: var(--accent);
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* #obs-toggle-filters.active {
  background: var(--color-neutral-950);
  color: #fff;
  border-color: transparent;
} */

.obs-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: start;
  align-self: end;
}

@media (max-width: 768px) {
  .obs-filter-row {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .obs-filter-actions {
    grid-column: 1 / -1;
  }

  .obs-filter-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

/* Custom Multi-Select Dropdown Styling */
.custom-multi-select {
  position: relative;
}

.multi-select-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background-color: var(--white);
}

.multi-select-btn::after {
  content: "▼";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.6;
}

.multi-select-btn:hover {
  border-color: var(--accent);
  background: var(--panel-bg, var(--component-bg));
}

.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
}

.multi-select-dropdown.active {
  display: block;
}

.multi-select-option {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.multi-select-option:hover {
  background: var(--panel-bg, var(--component-bg));
}

.multi-select-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.multi-select-option label {
  flex: 1;
  cursor: pointer;
  margin: 0;
  font-size: 14px;
}

/* Provider Sidebar Items */
.provider-sidebar-item {
  transition: all 0.15s ease;
}

.provider-sidebar-item:hover:not(.selected) {
  background: var(--border) !important;
  border-color: var(--border) !important;
}

.provider-sidebar-item.selected {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}

.provider-sidebar-item.selected * {
  color: white !important;
}

.provider-sidebar-item.selected span {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Spin animation for loading icons */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ============================================
   HELP TOOLTIPS & INFO ICONS
   ============================================ */

/* Info icon button in sidebar */
.nav-item-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.nav-item-wrapper .nav-item {
  flex: 1;
}

.nav-item .tooltip-wrapper {
  margin-left: auto;
  display: none;
  flex-shrink: 0;
}

.nav-item:hover .tooltip-wrapper {
  display: inline-flex;
}

/* Section labels in sidebar */
.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-muted);
  padding: 16px 12px 8px 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.nav-section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border: none;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-400);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.info-icon:hover {
  color: var(--text-primary);
}

/* Tooltip container */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-wrapper .tooltip {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  background: var(--neutral-900);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  width: 200px;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  pointer-events: none;
}

.tooltip-wrapper .tooltip::before {
  display: none;
}

.tooltip-wrapper:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Inline info icon (for headers and labels) */
.info-icon-inline {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.info-icon-inline:hover {
  color: var(--text-primary);
}

/* Tooltip for inline icons (appears below) */
.tooltip-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-inline .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--neutral-950);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: max-content;
  max-width: 220px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  text-align: left;
  white-space: normal;
}

.tooltip-inline .tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--neutral-900);
}

.icon-btn-refresh {
  border-radius: var(--radius-md);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn-refresh:hover {
  background: var(--color-neutral-100);
}

.tooltip-inline:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  margin-bottom: 8px;
}

/* ============================================
   PAGE HELP BANNERS
   ============================================ */

.page-help-banner {
  background: linear-gradient(135deg, #f0f7ff 0%, #f5f5ff 100%);
  border: 1px solid #d0e3ff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.page-help-banner .help-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-help-banner .help-icon i {
  color: white;
  width: 20px;
  height: 20px;
}

.page-help-banner .help-content {
  flex: 1;
}

.page-help-banner .help-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 8px 0;
}

.page-help-banner .help-description {
  font-size: 13px;
  color: #4a6fa5;
  line-height: 1.6;
  margin: 0;
}

.page-help-banner .help-description ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.page-help-banner .help-description li {
  margin-bottom: 4px;
}

/* Collapsible help banner */
.page-help-banner.collapsible {
  cursor: pointer;
}

.page-help-banner.collapsible .help-content {
  transition: max-height 0.3s ease;
}

.page-help-banner.collapsed .help-description {
  display: none;
}

.page-help-banner .collapse-toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #c0d4f0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.page-help-banner .collapse-toggle:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.page-help-banner .collapse-toggle i {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.page-help-banner.collapsed .collapse-toggle i {
  transform: rotate(180deg);
}

/* Section header with info icon */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.section-header h3 {
  margin: 0;
}

.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

/* Panel section description - appears under h3 headers */
.panel-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 16px 0;
  line-height: 1.5;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-description.no-border {
  border-bottom: none;
  padding-bottom: 0;
}

/* Compact description for smaller sections */
.section-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 12px 0;
  font-style: italic;
}

/* Subsection header with description */
.panel h3 + .panel-description,
.panel h4 + .panel-description {
  margin-top: 4px;
}

/* Card section mini-description */
.card-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

/* Info box for sections */
.info-box {
  background: var(--color-blue-50);
  border: 1px solid var(--color-blue-300);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.info-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-blue-700);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-box p,
.info-box ul {
  font-size: 12px;
  color: var(--color-blue-700);
  margin: 0;
  line-height: 1.6;
}

.info-box ul {
  padding-left: 16px;
  margin-top: 8px;
}

.info-box li {
  margin-bottom: 4px;
}

/* Metric card with tooltip */
.metric-with-tooltip {
  position: relative;
}

.metric-with-tooltip .tooltip-inline {
  position: absolute;
  top: 8px;
  right: 8px;
}

.metric-with-tooltip .tooltip-inline .tooltip {
  right: 0;
  left: auto;
  top: calc(100% + 8px);
  bottom: auto;
  transform: none;
  min-width: 100px;
}

.metric-with-tooltip .tooltip-inline .tooltip::before {
  left: auto;
  right: 20px;
}

/* Prevent text wrapping in tenants-table action/key button tooltips */
#tenants-table .tooltip-inline .tooltip {
  white-space: nowrap;
  /* Use fixed positioning so tooltips escape the overflow:auto scroll wrapper */
  position: fixed;
  top: auto;
  left: auto;
  transform: none;
  z-index: 99999;
}

#tenants-table .tooltip-inline .tooltip::before {
  display: none; /* arrow doesn't make sense with fixed positioning */
}

/* Left-edge tooltips — prevent overflow on mobile */
#sources-open-sidebar-wrap .tooltip,
.ai-insights-sidebar-toggle.tooltip-inline .tooltip {
  left: 0;
  transform: none;
}

#sources-open-sidebar-wrap .tooltip::before,
.ai-insights-sidebar-toggle.tooltip-inline .tooltip::before {
  left: 16px;
  transform: none;
}

/* Scrollable wrapper so tenants-table never overflows its panel */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#tenants-table {
  min-width: 820px;
}

/* ============================================
   AI INSIGHTS — RESPONSIVE CHAT LAYOUT
   ============================================ */

.ai-insights-shell {
  display: flex;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 600px;
  background: var(--white);
  border-radius: 12px;
  overflow: visible;
  border: 1px solid var(--border);
  position: relative;
}

/* Conversation sidebar */
.ai-insights-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--white);
  transition: transform 0.25s ease;
  z-index: 10;
  border-top-left-radius:12px;
  border-bottom-left-radius: 12px;
}

/* Main chat column */
.ai-insights-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Mobile sidebar toggle button — hidden on desktop */
.ai-insights-sidebar-toggle {
  display: none;
  padding: 8px;
}

/* Backdrop overlay for mobile sidebar */
.ai-insights-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9;
}

@media (max-width: 768px) {
  .ai-insights-shell {
    height: calc(100vh - 160px);
    min-height: 400px;
    overflow: hidden;
  }

  .ai-insights-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

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

  .ai-insights-backdrop.is-open {
    display: block;
  }

  .ai-insights-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

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

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

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

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

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

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

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch:hover .toggle-slider {
  background-color: #d4d4d4;
}

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

/* Demo Mode Banner Styles */
.demo-mode-banner {
  background: var(--color-green-500);
  color: white;
  padding: 8px;
  font-size: 14px;
  /* z-index: 1000; */
  text-overflow: ellipsis;
}

.demo-mode-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  
}

.demo-mode-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-mode-text strong {
  font-weight: 600;
}

.demo-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Demo Mode Indicator Badge (for cards/components) */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Security Events Demo Styles */
.security-event {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.security-event:last-child {
  border-bottom: none;
}

.security-event-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-event-icon.critical {
  background: #fef2f2;
  color: #dc2626;
}

.security-event-icon.high {
  background: #fff7ed;
  color: #ea580c;
}

.security-event-icon.medium {
  background: #fefce8;
  color: #ca8a04;
}

.security-event-icon.low {
  background: #f0fdf4;
  color: #16a34a;
}

.security-event-content {
  flex: 1;
  min-width: 0;
}

.security-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.security-event-type {
  font-weight: 600;
  font-size: 13px;
}

.security-event-time {
  font-size: 12px;
  color: var(--text-muted);
}

.security-event-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.security-event-user {
  font-size: 12px;
  color: var(--text-muted);
}

.security-event-action {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.security-event-action.blocked {
  background: #fef2f2;
  color: #dc2626;
}

.security-event-action.redacted {
  background: #fff7ed;
  color: #ea580c;
}

.security-event-action.warned {
  background: #fefce8;
  color: #ca8a04;
}

.security-event-action.logged {
  background: #f0fdf4;
  color: #16a34a;
}

/* ============================================
   SETUP WIZARD STYLES
   ============================================ */

/* Overlay */
.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal - Force light theme for readability */
.wizard-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 92%;
  max-width: 1060px;
  height: 90vh;
  max-height: 780px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
  position: relative;
  color: #1a1a2e;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress Bar */
.wizard-progress-bar {
  height: 4px;
  background: var(--color-neutral-200);
  position: relative;
  border-radius:4px;
}

.wizard-progress-fill {
  height: 100%;
  background: var(--color-green-500);
  transition: width 0.5s ease;
  border-radius: 4px;
}

/* Sidebar */
.wizard-sidebar {
  width: 25%;
  min-width: 190px;
  flex-direction: column;
  background: var(--color-neutral-100);
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  padding:24px;
}

/* Main content wrapper */
.wizard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Completion counter */
.wizard-completion-counter {
  padding: 12px 12px 12px 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}

/* Step list */
.wizard-step-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 8px;
}

.wizard-step-item:hover {
  background: var(--color-neutral-200);
}

.step-item-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-neutral-200);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-item-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
}

.wizard-step-item.active {
  opacity: 1;
}

.wizard-step-item.active .step-item-number {
  background: transparent;
  border: 1px dashed var(--color-green-500);
  color: var(--color-green-500);
}

.wizard-step-item.active .step-item-label {
  color: var(--text-primary);
}

.wizard-step-item.completed {
  opacity: 1;
}

.wizard-step-item.completed .step-item-number {
  background: var(--success);
  color: white;
}

.step-check {
  display: none;
}

.wizard-step-item.completed .step-num,
.wizard-mobile-step-dot.completed .step-num {
  display: none;
}

.wizard-step-item.completed .step-check,
.wizard-mobile-step-dot.completed .step-check {
  display: block;
}

.wizard-step-item.completed .step-item-label {
  color: var(--text-primary);
}

/* Content Area */
.wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Step Container */
.wizard-step {
  display: none;
  animation: fadeInStep 0.4s ease;
}

.wizard-step.active {
  display: flex;
  flex-direction: column;
  justify-content: start;
  flex: 1;
}

.wizard-step.active[data-step="1"] {
  justify-content: center;
  align-items: center;
  text-align: center;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Step Icon */
.wizard-step-icon {
  text-align: center;
  align-self: center;
  margin-bottom: 20px;
  color: #1f2937;
}

.wizard-step-icon i {
  color: #22c55e;
}

.wizard-step-icon.success-animation i {
  animation: successPop 0.6s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.welcome-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Titles */
.wizard-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.wizard-subtitle {
  font-size: 18px;
  margin: 0 0 24px 0;
}

/* Checklist */
.wizard-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 24px auto;
}

.wizard-checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #1f2937;
}

.wizard-checklist-item i {
  color: var(--color-green-500);
}

/* Time Estimate */
.wizard-time-estimate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-neutral-100);
  border-radius: 8px;
  font-size: 13px;
  max-width: fit-content;
  margin: 24px auto 0;
}

.wizard-time-estimate i {
  color: #6b7280;
}

/* Demo Status */
.wizard-demo-status {
  margin: 20px 0;
}

.demo-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-orange-100);
  border: 1px solid var(--color-orange-300);
  border-radius: 12px;
}

.demo-status-card .demo-status-icon {
  color: var(--color-orange-500);
}

.demo-status-card .demo-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-status-card .demo-status-text strong {
  color: #92400e;
}

.demo-status-card .demo-status-text span {
  font-size: 12px;
  color: #a16207;
}

/* Demo Options */
.wizard-demo-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.wizard-option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-neutral-100);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.wizard-option-card:hover {
  border-color: var(--color-blue-500);
}

.wizard-option-card.selected {
  border-color: var(--color-blue-500);
  background: var(--color-blue-50);
}

.wizard-option-card .option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral-200);
  border-radius: 10px;
  color: var(--color-neutral-500);
  flex-shrink: 0;
}

.wizard-option-card.selected .option-icon {
  background: var(--color-blue-500);
  color: white;
}

.wizard-option-card .option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-option-card .option-content strong {
  font-size: 14px;
  color: #111827;
}

.wizard-option-card .option-content span {
  font-size: 12px;
  color: var(--text-muted)
}

.wizard-option-card .option-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.wizard-option-card.selected .option-check {
  border-color: var(--color-blue-500);
  background: var(--color-blue-500);
  color: white;
}

/* Form Styles */


.wizard-form-group {
  margin-bottom: 20px;
}

.wizard-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.wizard-form-group input,
.wizard-form-group select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  transition: all 0.2s ease;
}

.wizard-form-group input:focus,
.wizard-form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.wizard-form-group input::placeholder {
  color: #9ca3af;
}

.wizard-form-hint {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
}

/* Size Options */
.wizard-size-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.size-option {
  padding: 14px 8px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.size-option:hover {
  border-color: #3b82f6;
}

.size-option.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.size-option .size-number {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.size-option .size-label {
  font-size: 10px;
  color: #6b7280;
}

/* Import Options */
.wizard-import-options {
  display: flex;
  flex-direction: column; /* Vertical layout */
  gap: 16px;
  /* align-items: stretch is default */
}

.wizard-import-card {
  flex: 1;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.wizard-import-card h3 {
  margin: 0;
  font-size: 15px;
  color: #111827;
}

.wizard-import-card p {
  font-size: 12px;
  color: #6b7280;
  margin: 8px 0 16px;
}

.import-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.import-card-header i {
  color: #6b7280;
}

.wizard-import-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #9ca3af;
  font-size: 12px;
  margin: 8px 0;
  align-self: center;
}

/* CSV Upload */
.csv-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--white);
}

.csv-upload-zone i {
  color: var(--text-muted);
}

.csv-upload-zone:hover {
  border-color: var(--color-blue-500);
  background: var(--color-blue-50);
}

.csv-upload-zone.dragover {
  border-color: var(--color-blue-500);
  background: var(--color-blue-50);
}

.csv-template-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-blue-500);
  margin-top: 12px;
  text-decoration: none;
}

.csv-template-link:hover {
  text-decoration: underline;
}

.csv-preview {
  margin-top: 16px;
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

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

.csv-preview-count {
  font-size: 13px;
  color: var(--text-primary);
}

.csv-preview-table {
  max-height: 150px;
  overflow-y: auto;
  font-size: 12px;
}

.csv-preview-table table {
  width: 100%;
  border-collapse: collapse;
}

.csv-preview-table th,
.csv-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text-primary);
}

.csv-preview-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--color-neutral-50);
}

/* Manual Form */
.manual-user-form {
  margin-top: 12px;
}

.wizard-form-row {
  display: flex;
  gap: 8px;
}

.wizard-form-row input,
.wizard-form-row select {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-primary);
}

.wizard-form-row input::placeholder {
  color: var(--text-muted);
}

.wizard-form-row button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wizard-add-team {
  width: auto;
  height: auto;
  padding: 10px 16px;
  gap: 6px;
  white-space: nowrap;
}

.manual-users-list {
  margin-top: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.manual-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--white);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.manual-user-item .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.manual-user-item .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-blue-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.manual-user-item .remove-user {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.manual-user-item .remove-user:hover {
  color: var(--color-red-500);
}

.wizard-skip-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Step validation messages */
.wizard-validation-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.wizard-validation-msg.error {
background: var(--color-red-50);
  border: 1px solid var(--color-red-300);
  color: var(--color-red-700);
}
.wizard-validation-msg.warning {
background: var(--color-yellow-50);
  border: 1px solid var(--color-yellow-300);
  color: var(--color-yellow-700);
}
.wizard-validation-msg.info {
  background: var(--color-blue-50);
  border: 1px solid var(--color-blue-300);
  color: var(--color-blue-700);
}
.wizard-validation-msg.success {
  background: var(--color-green-50);
  border: 1px solid var(--color-green-300);
  color: var(--color-green-700);
}
.wizard-validation-msg i {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Providers Grid */
.wizard-providers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.wizard-provider-card {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.wizard-provider-card:hover {
  border-color: #9ca3af;
}

.wizard-provider-card.enabled {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.provider-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.provider-logo {
  width: 40px;
  height: 40px;
}

.provider-logo img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.provider-info {
  flex: 1;
}

.provider-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.provider-info .provider-type {
  font-size: 11px;
  color: #6b7280;
}

.provider-toggle {
  position: relative;
}

.toggle-input {
  display: none;
}

.toggle-label {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--color-neutral-300);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.toggle-label::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
  background: var(--color-green-500);
}

.toggle-input:checked + .toggle-label::after {
  transform: translateX(20px);
}

.provider-card-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.provider-card-body .wizard-form-group {
  margin-bottom: 12px;
}

.provider-card-body .wizard-form-group label {
  font-size: 11px;
}

.provider-card-body .wizard-form-group input {
  padding: 10px 12px;
  font-size: 13px;
}

.test-connection {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.connection-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  display: none;
}

.connection-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.connection-status.error {
  display: block;
  background: var;
  color: var(--color-red-500);
}

.provider-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.provider-badge.local {
  background: var(--color-blue-50);
  color: var(--color-blue-700);
}

.provider-badge.popular {
  background: var(--color-orange-50);
  color: var(--color-orange-700);
}

.provider-badge.enterprise {
  background: var(--color-violet-50);
  color: var(--color-violet-700);
}

.wizard-providers-summary {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  background: var(--color-yellow-50);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-yellow-800);
  border: 1px solid var(--color-yellow-300);
}

.wizard-providers-summary .summary-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  flex-shrink: 0;
}

.wizard-providers-summary.ready {
  background: var(--color-green-50);
  border: 1px solid var(--color-green-300);
  color: var(--color-green-700);
}


.test-config {
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 20px;
}

.test-config .wizard-form-group {
  margin-bottom: 16px;
}

.btn.large {
  padding: 14px 24px;
  font-size: 15px;
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.test-results {
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.test-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.test-status {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-status.success {
  color: #22c55e;
}

.test-status.error {
  color: #CF2525;
}

#test-status-text {
  font-weight: 600;
  color: #111827;
}

.test-result-details {
  margin-bottom: 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.result-label {
  color: #6b7280;
}

.result-value {
  color: #111827;
  font-weight: 500;
}

.test-response label {
  font-size: 12px;
  color: #6b7280;
  display: block;
  margin-bottom: 8px;
}

.response-content {
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  max-height: 100px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
}

/* Summary Cards */
.wizard-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--color-neutral-50);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.summary-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-200);
  border-radius: 10px;
  color: var(--color-blue-500);
}

.summary-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
}

.summary-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Next Steps */
.wizard-next-steps {
  margin-top: 32px;
}

.wizard-next-steps h3 {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0 0 16px;
  text-align: center;
}

.next-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-neutral-50);
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.next-step-item:hover {
  border-color: var(--color-blue-500);
  background: rgba(59, 130, 246, 0.05);
}

.next-step-item span {
  flex: 1;
  font-size: 14px;
}

.next-step-item i:first-child {
  color: var(--color-blue-500);
}

.next-step-item i:last-child {
  color: var(--text-muted);
}

/* Footer */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.wizard-footer.last-step {
  justify-content: flex-end;
}

.wizard-btn-skip {
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.wizard-btn-skip:hover {
  color: var(--text-primary);
  background: transparent;
}

.wizard-nav-buttons {
  display: flex;
  gap: 10px;
}

.wizard-nav-buttons .btn {
  min-width: 100px;
  justify-content: center;
  gap: 6px;
}

/* Close Button */
.wizard-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #e5e7eb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s ease;
}

.wizard-close:hover {
  background: #d1d5db;
  color: #374151;
}

/* Wizard Button in Header */
.wizard-btn {
  background: var(--color-orange-500);
  border-color: transparent;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wizard-btn:hover {
  background: var(--color-orange-600);
}

.wizard-btn:disabled {
  background: var(--color-neutral-500);
  cursor: not-allowed;
  opacity: 0.7;
}

.wizard-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.wizard-progress-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 4px;
}

/* Main top bar — always in flow, holds close button on desktop and full nav on mobile */
.wizard-main-top {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.wizard-main-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px 0;
}

/* Left side: progress bar + counter — hidden on desktop */
.wizard-main-top-left {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding-right: 12px;
}

.wizard-mobile-counter {
  font-size: 12px;
  color: var(--text-muted);
}

/* Step dots row — hidden on desktop */
.wizard-mobile-steps {
  display: none;
}

.wizard-mobile-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  opacity: 0.45;
}

.wizard-mobile-step-dot.active {
  background: #111827;
  color: white;
  opacity: 1;
}

.wizard-mobile-step-dot.completed {
  background: var(--success);
  color: white;
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .wizard-modal {
    width: 95%;
    height: 95vh;
    max-height: 95vh;
  }

  .wizard-modal {
    flex-direction: column;
  }

  .wizard-sidebar {
    display: none !important;
  }

  .wizard-main-top {
    background: transparent;
  }

  .wizard-main-top.active {
    background: var(--color-neutral-100);
  }

  .wizard-main-top .wizard-main-top-row {
    padding: 8px 12px;
    align-items: flex-start;
  }

  .wizard-main-top.active .wizard-main-top-row {
    justify-content: space-between;
  }

  .wizard-main-top.active .wizard-main-top-left {
    display: flex;
    padding:16px 12px;
    max-width: fit-content;
  }

  .wizard-main-top.active .wizard-mobile-steps {
    display: flex;
    justify-content: start;
    gap: 16px;
    padding-top: 6px;
  }

  .wizard-content {
    padding: 24px 20px;
  }
  

  .wizard-import-options {
    flex-direction: column;
  }

  .wizard-import-divider {
    padding: 16px 0;
  }

  .wizard-providers-grid {
    grid-template-columns: 1fr;
  }

  .wizard-size-options {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* ============================================================================
   Gateway Routes (Cloudflare DNS-style UI)
   ============================================================================ */

.gw-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
}

.gw-add-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  padding: 16px 20px;
  animation: gw-slide-down 0.2s ease-out;
}

@keyframes gw-slide-down {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 300px;
  }
}

.gw-form-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.gw-form-grid {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.gw-form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.gw-form-field input,
.gw-form-field select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
}

.gw-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.gw-table-container {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background-color: var(--white);
}

.gw-table-container .data-table {
  margin: 0;
  border: none;
  border-radius: 0;
  background-color: var(--white);
}


.gw-table-container .data-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 10px 14px;
}

.gw-table-container .data-table td {
  padding: 10px 14px;
  font-size: 13px;
  vertical-align: middle;
}

.gw-table-container .data-table tbody tr {
  transition: background 0.1s;
}

.gw-table-container .data-table tbody tr:hover {
  background: var(--bg-secondary, #f9fafb);
}

/* Type badge */
.gw-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  background: var(--color-neutral-50);
  color: var(--color-neutral-500);
}

.gw-type-badge[data-type="openai-compatible"] {
  background: var(--color-green-50);
  color: var(--color-green-500);
}
.gw-type-badge[data-type="anthropic"] {
  background: var(--color-orange-50);
  color: var(--color-orange-500);
}
.gw-type-badge[data-type="google"] {
  background: var(--color-blue-50);
  color: var(--color-blue-500);
}
.gw-type-badge[data-type="cohere"] {
  background: var(--color-violet-50);
  color: var(--color-violet-500);
}
.gw-type-badge[data-type="custom"] {
  background: var(--color-gray-50);
  color: var(--color-gray-500);
}

/* Proxy status indicator */
.gw-proxy-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
}

.gw-proxy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.2s;
}

.gw-proxy-icon.active {
  color: #f48120;
}

.gw-proxy-icon.passthrough {
  color: #999;
}

.gw-proxy-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.gw-proxy-status-cell .gw-cloud-icon {
  width: 20px;
  height: 20px;
}

.gw-proxy-status-cell.active .gw-cloud-icon {
  color: var(--color-orange-500)
}
.gw-proxy-status-cell.passthrough .gw-cloud-icon {
  color: var(--color-neutral-500);
}
.gw-proxy-icon.enriched {
  color: var(--color-violet-500);
}
.gw-proxy-status-cell.enriched .gw-cloud-icon {
  color: var(--color-violet-500);
}
.gw-proxy-icon.post-process {
  color: var(--color-blue-500);
}
.gw-proxy-status-cell.post-process .gw-cloud-icon {
  color: var(--color-blue-500);
}

/* Route actions */
.gw-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.gw-actions button {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s;
}

.gw-actions button:hover {
  background: var(--bg-secondary, #f0f0f0);
}

.gw-actions button.danger {
  color: var(--danger);
  border-color: transparent;
}

.gw-actions button.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.gw-url-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.gw-path-cell {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text);
}

/* ============================================================================
   Gateway Enhanced: Tabs, Health, Analytics, Bulk, Import, Detail
   ============================================================================ */

/* Form Tabs */
.gw-form-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  overflow-x: auto;
}
.gw-form-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.gw-form-tab:hover {
  color: var(--text);
}
.gw-form-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.gw-form-tab-content {
  animation: fadeIn 0.15s ease;
}
.gw-form-tab-content textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

/* Key-Value (Header) Editor */
.gw-kv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gw-kv-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.gw-kv-row input {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
.gw-kv-row button {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--danger, #CF2525);
  cursor: pointer;
  font-size: 14px;
}
.gw-kv-row button:hover {
  background: var(--danger, #CF2525);
  color: white;
}

/* Bulk Action Bar */
.gw-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
}
.gw-bulk-bar .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11px;
  padding: 4px 10px;
}
.gw-bulk-bar .btn:hover {
  background: rgba(255, 255, 255, 0.35);
}
.gw-bulk-bar .btn.danger {
  background: rgba(239, 68, 68, 0.5);
}

/* Import Modal */
.gw-import-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-import-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Health Dot */
.gw-health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.gw-health-dot.healthy {
  background: var(--color-green-500);
  box-shadow: 0 0 4px var(--color-green-500);
}
.gw-health-dot.degraded {
  background: var(--color-orange-500);
  box-shadow: 0 0 4px var(--color-orange-500);
}
.gw-health-dot.unhealthy {
  background: var(--color-red-500);
  box-shadow: 0 0 4px var(--color-red-500);
}
.gw-health-dot.unknown {
  background: var(--color-neutral-500);
}

/* Circuit Breaker Badge */
.gw-circuit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.gw-circuit-badge.closed {
  background: color-mix(in srgb, var(--color-green-500) 15%, transparent);
  color: var(--color-green-500);
}
.gw-circuit-badge.open {
  background: color-mix(in srgb, var(--color-red-500) 15%, transparent);
  color: var(--color-red-500);
}
.gw-circuit-badge.half_open {
  background: color-mix(in srgb, var(--color-yellow-500) 15%, transparent);
  color: var(--color-yellow-500);
}

/* Drag Handle */
.gw-drag-handle {
  cursor: grab;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-drag-handle:active {
  cursor: grabbing;
}
.sortable-ghost {
  opacity: 0.4;
  background: var(--primary) !important;
}

/* Route Detail Panel */
.gw-route-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.gw-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.gw-detail-body {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gw-detail-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gw-detail-section {
  font-size: 12px;
}
.gw-detail-kv {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.gw-detail-kv:last-child {
  border-bottom: none;
}
.gw-detail-kv .label {
  color: var(--muted);
}
.gw-detail-kv .value {
  font-weight: 500;
}

/* Gateway Analytics Summary Cards */
.gw-analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.gw-summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.gw-summary-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.gw-summary-value {
  font-size: 24px;
  font-weight: 700;
}
.gw-health-healthy {
  color: #22c55e;
}
.gw-health-degraded {
  color: #f59e0b;
}
.gw-health-unhealthy {
  color: #CF2525;
}

/* Traffic Charts Grid */
.gw-traffic-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
}
.gw-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.gw-chart-card h4 {
  font-size: 13px;
  margin: 0 0 8px;
  font-weight: 600;
}

/* Small button variant */
.btn-sm {
  font-size: 11px !important;
  padding: 4px 10px !important;
}

/* Health table uptime bar */
.gw-uptime-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.gw-uptime-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #22c55e;
  transition: width 0.3s;
}

/* Row checkbox column */
.gw-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

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


/* Apex Chart color overrides */
.apexcharts-legend {
  justify-content: flex-start !important;
}

.apexcharts-menu-icon svg, .apexcharts-reset-icon svg, .apexcharts-zoom-icon svg, .apexcharts-zoomin-icon svg, .apexcharts-zoomout-icon svg {
    fill: var(--color-neutral-500) !important;
}

.apexcharts-menu-icon:hover svg, .apexcharts-reset-icon:hover svg, .apexcharts-zoom-icon:hover svg, .apexcharts-zoomin-icon:hover svg, .apexcharts-zoomout-icon:hover svg {
    fill: var(--color-neutral-950) !important;
}

.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg, .apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg, .apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {
    fill: var(--color-orange-500) !important;
}
.apexcharts-pan-icon svg {
    fill: var(--white);
    stroke: var(--color-neutral-500);
    stroke-width: 2;
}
.apexcharts-pan-icon:hover svg {
    stroke: var(--color-neutral-950);
}
/* Bedrock auth method toggle */
.bedrock-auth-opt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bedrock-auth-opt.active-auth-opt {
  background: var(--bg, #fff);
  color: var(--text, #111);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* JSON response block in AI Insights chat */
.json-response-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0;
  font-size: 13px;
}
.json-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-secondary, #f3f4f6);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.json-response-pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg, #fff);
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}
.json-response-pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  background: none;
  padding: 0;
  border-radius: 0;
  white-space: pre;
}
.json-copy-btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
  height: auto !important;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  cursor: pointer;
}
.json-copy-btn:hover {
  background: var(--accent, #336FE4) !important;
  color: #fff !important;
  border-color: var(--accent, #336FE4) !important;
}

/* Dashboard chart grid — responsive breakpoints */
.dashboard-chart-grid {
  overflow: hidden;
}

.dashboard-chart-grid .panel {
  min-width: 0;
  overflow: hidden;
}

.dashboard-chart-grid [id^="chart-"] {
  width: 100%;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .dashboard-chart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MODELS TABLE — MOBILE CARD LAYOUT
   ============================================ */

/* Hide expand button on desktop */
.mobile-expand-cell { display: none !important; }

@media (max-width: 640px) {
  /* Stack the catalog grid to single column */
  #model-catalog .grid {
    grid-template-columns: 1fr !important;
  }

  /* Transform table into card list */
  #models-table thead { display: none; }

  #models-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    gap: 0 8px;
    background: var(--panel);
  }

  #models-table td {
    border: none;
    padding: 2px 0;
    vertical-align: middle;
  }

  /* Row 1: model name spans full width */
  #models-table td:nth-child(1) {
    grid-column: 1 / -1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
  }

  /* Row 2: provider, enabled toggle, expand button */
  #models-table td:nth-child(2) { grid-column: 1; grid-row: 2; align-self: center; }
  #models-table td:nth-child(5) { grid-column: 2; grid-row: 2; align-self: center; }
  .mobile-expand-cell          { display: table-cell !important; grid-column: 3; grid-row: 2; align-self: center; }

  /* Hide context, cost, actions until row is expanded */
  #models-table td:nth-child(3),
  #models-table td:nth-child(4),
  #models-table td:nth-child(6) {
    display: none;
    grid-column: 1 / -1;
  }

  /* Expanded state: show hidden cells */
  #models-table tr.mobile-expanded td:nth-child(3),
  #models-table tr.mobile-expanded td:nth-child(4),
  #models-table tr.mobile-expanded td:nth-child(6) {
    display: flex;
    align-items: center;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    gap: 8px;
  }

  /* Labels for expanded detail rows */
  #models-table td:nth-child(3)::before { content: "Context"; font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 90px; }
  #models-table td:nth-child(4)::before { content: "$/1M Tokens"; font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 90px; }
  #models-table td:nth-child(6)::before { content: "Actions"; font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 90px; }
}

/* ===== Guard Level Selector (Low / Medium / High) — vertical stack ===== */
.guard-level-control {
  margin-top: 10px;
}

.guard-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.guard-level-header span:first-child {
  font-size: 11px;
  color: var(--text-muted);
}

.guard-level-value {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
  opacity: 0.55;
}

.guard-level-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guard-level-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.guard-level-row:hover:not(.active) {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.guard-radio {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.guard-radio::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.guard-level-row-body {
  flex: 1;
  min-width: 0;
}

.guard-level-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1px;
  transition: color 0.15s;
}

.guard-level-row-desc {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
  opacity: 0.9;
  transition: color 0.15s, opacity 0.15s;
}

/* Low — light blue tint */
.guard-level-row.active[data-level="low"] {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}
.guard-level-row.active[data-level="low"] .guard-radio {
  border-color: #3b82f6;
}
.guard-level-row.active[data-level="low"] .guard-radio::after {
  background: #3b82f6;
}
.guard-level-row.active[data-level="low"] .guard-level-name {
  color: #3b82f6;
}
.guard-level-row.active[data-level="low"] .guard-level-row-desc {
  color: var(--text-muted);
  opacity: 1;
}

/* Medium — light orange tint */
.guard-level-row.active[data-level="medium"] {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}
.guard-level-row.active[data-level="medium"] .guard-radio {
  border-color: #f97316;
}
.guard-level-row.active[data-level="medium"] .guard-radio::after {
  background: #f97316;
}
.guard-level-row.active[data-level="medium"] .guard-level-name {
  color: #f97316;
}
.guard-level-row.active[data-level="medium"] .guard-level-row-desc {
  color: var(--text-muted);
  opacity: 1;
}

/* High — light red tint */
.guard-level-row.active[data-level="high"] {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.guard-level-row.active[data-level="high"] .guard-radio {
  border-color: #ef4444;
}
.guard-level-row.active[data-level="high"] .guard-radio::after {
  background: #ef4444;
}
.guard-level-row.active[data-level="high"] .guard-level-name {
  color: #ef4444;
}
.guard-level-row.active[data-level="high"] .guard-level-row-desc {
  color: var(--text-muted);
  opacity: 1;
}

/* ===== Guardrail Master Toggle Switch ===== */
.guard-master-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.guard-master-track {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}

.guard-master-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s, background 0.2s;
}

.guard-master-toggle.on .guard-master-track {
  background: #22c55e;
}

.guard-master-toggle.on .guard-master-thumb {
  transform: translateX(16px);
}

/* ===== Company Settings Sticky Save Footer ===== */
#cs-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 265px;
  right: 0;
  min-height: 52px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.22s ease;
}

#cs-sticky-footer.visible {
  transform: translateY(0);
}

/* Shift footer when sidebar is collapsed */
body.sidebar-collapsed #cs-sticky-footer {
  left: 52px;
}

.cs-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cs-footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f97316;
  flex-shrink: 0;
}

.cs-footer-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-footer-pills {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.cs-dirty-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--color-neutral-100);
  border: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
}

.cs-dirty-pill.error {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}

.cs-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

#cs-discard-btn {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#cs-discard-btn:hover {
  color: var(--text);
}

#cs-save-all-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: var(--color-neutral-950);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  min-width: 130px;
}

#cs-save-all-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#cs-save-all-btn.success {
  background: #22c55e;
}

/* Dirty dot on section h3 headers */
.cs-dirty-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Nav guard modal */
#cs-nav-guard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1999;
  display: none;
  align-items: center;
  justify-content: center;
}

#cs-nav-guard-backdrop.visible {
  display: flex;
}

#cs-nav-guard-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.cs-guard-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.cs-guard-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cs-guard-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
}

.cs-guard-list li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0 2px 14px;
  position: relative;
}

.cs-guard-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  font-weight: 700;
}

.cs-guard-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  margin-top: 4px;
}

.cs-guard-actions button {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--color-neutral-100);
  color: var(--text-primary);
  transition: background 0.15s;
  white-space: nowrap;
}

.cs-guard-actions button:hover {
  background: var(--color-neutral-200);
}

#cs-guard-save-leave {
  background: var(--color-neutral-950);
  border-color: var(--color-neutral-950);
  color: #fff;
}

#cs-guard-save-leave:hover {
  background: var(--color-neutral-700);
  border-color: var(--color-neutral-700);
  opacity: 1;
}
