/* ═══════════════════════════════════════════════════════════════
   LLMGUARD — GLOBAL DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Custom Properties ── */
:root {
  /* Backgrounds */
  --bg-base:        #050810;
  --bg-surface:     #0d1117;
  --bg-elevated:    #161b22;
  --bg-hover:       #1c2330;

  /* Accent Colors */
  --accent-primary:   #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #22d3ee;
  --accent-secondary-glow: rgba(34, 211, 238, 0.25);

  /* Risk Colors */
  --risk-high:      #f43f5e;
  --risk-high-bg:   rgba(244, 63, 94, 0.12);
  --risk-high-glow: rgba(244, 63, 94, 0.35);
  --risk-medium:    #f59e0b;
  --risk-medium-bg: rgba(245, 158, 11, 0.12);
  --risk-low:       #10b981;
  --risk-low-bg:    rgba(16, 185, 129, 0.12);
  --risk-low-glow:  rgba(16, 185, 129, 0.3);
  --risk-creative:  #a855f7;
  --risk-creative-bg: rgba(168, 85, 247, 0.12);
  --risk-neutral:   #6b7280;
  --risk-neutral-bg: rgba(107, 114, 128, 0.12);

  /* Text */
  --text-primary:   #f0f6ff;
  --text-secondary: #8b92a5;
  --text-muted:     #4b5563;
  --text-code:      #22d3ee;

  /* Borders */
  --border:         #21262d;
  --border-bright:  #30363d;
  --border-accent:  rgba(99, 102, 241, 0.4);

  /* Typography */
  --font-ui:   'Inter', -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-primary: 0 0 20px rgba(99, 102, 241, 0.25);
  --shadow-glow-danger:  0 0 20px rgba(244, 63, 94, 0.25);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --max-content: 1200px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
ul, ol { list-style: none; }
code, pre { font-family: var(--font-code); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════════ */
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 700; line-height: 1.3; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
p { color: var(--text-secondary); line-height: 1.7; }

.gradient-text {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--t-base) var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #818cf8);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px var(--accent-primary-glow), 0 0 40px rgba(99,102,241,0.15);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: rgba(99,102,241,0.06);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.btn-danger {
  background: var(--risk-high-bg);
  color: var(--risk-high);
  border: 1px solid rgba(244,63,94,0.3);
}
.btn-danger:hover { background: rgba(244,63,94,0.2); }

.btn-sm  { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xl  { padding: 1rem 2.25rem; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-md); }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-danger  { background: var(--risk-high-bg);    color: var(--risk-high);    border: 1px solid rgba(244,63,94,0.25); }
.badge-warning { background: var(--risk-medium-bg);  color: var(--risk-medium);  border: 1px solid rgba(245,158,11,0.25); }
.badge-success { background: var(--risk-low-bg);     color: var(--risk-low);     border: 1px solid rgba(16,185,129,0.25); }
.badge-purple  { background: var(--risk-creative-bg);color: var(--risk-creative);border: 1px solid rgba(168,85,247,0.25); }
.badge-neutral { background: var(--risk-neutral-bg); color: var(--text-secondary);border: 1px solid var(--border); }
.badge-primary { background: rgba(99,102,241,0.15);  color: var(--accent-primary);border: 1px solid var(--border-accent); }
.badge-cyan    { background: rgba(34,211,238,0.1);   color: var(--accent-secondary);border: 1px solid rgba(34,211,238,0.25); }

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--t-base) var(--ease-smooth),
              box-shadow var(--t-base) var(--ease-smooth);
}
.card:hover { border-color: var(--border-bright); }
.card-glow:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-primary);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

.glass {
  background: rgba(13, 17, 23, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════════ */
.container { width: 100%; max-width: var(--max-content); margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }    .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }  .gap-16 { gap: 4rem; }
.grid { display: grid; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1{margin-top:0.25rem} .mt-2{margin-top:0.5rem} .mt-3{margin-top:0.75rem}
.mt-4{margin-top:1rem}    .mt-6{margin-top:1.5rem} .mt-8{margin-top:2rem}
.mt-12{margin-top:3rem}   .mt-16{margin-top:4rem}
.mb-1{margin-bottom:0.25rem} .mb-2{margin-bottom:0.5rem} .mb-3{margin-bottom:0.75rem}
.mb-4{margin-bottom:1rem}    .mb-6{margin-bottom:1.5rem} .mb-8{margin-bottom:2rem}
.p-4{padding:1rem} .p-6{padding:1.5rem} .p-8{padding:2rem}
.px-4{padding-left:1rem;padding-right:1rem}
.py-2{padding-top:0.5rem;padding-bottom:0.5rem}
.py-4{padding-top:1rem;padding-bottom:1rem}
.py-6{padding-top:1.5rem;padding-bottom:1.5rem}
.section { padding: 5rem 0; }
.section-lg { padding: 8rem 0; }
.divider { border: none; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════════
   INPUTS & FORM ELEMENTS
══════════════════════════════════════════ */
.input {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
.input::placeholder { color: var(--text-muted); }

.select {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  appearance: none;
  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='%238b92a5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-glow); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }

/* ══════════════════════════════════════════
   TABLES
══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.015); }
.td-mono { font-family: var(--font-code); font-size: 0.82rem; color: var(--text-code); }
.td-muted { color: var(--text-secondary); }

/* ══════════════════════════════════════════
   CODE BLOCKS
══════════════════════════════════════════ */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.code-block-lang {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-code);
}
.code-block-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}
.code-block-copy:hover { color: var(--accent-secondary); }
.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #e6edf3;
}
.code-block code .kw  { color: #ff7b72; }   /* keywords */
.code-block code .str { color: #a5d6ff; }   /* strings */
.code-block code .num { color: #79c0ff; }   /* numbers */
.code-block code .cmt { color: #6e7681; font-style: italic; } /* comments */
.code-block code .fn  { color: #d2a8ff; }   /* function names */
.code-block code .var { color: #ffa657; }   /* variables */
.code-block code .op  { color: #22d3ee; }   /* operators/punctuation */

/* ══════════════════════════════════════════
   RISK SCORE VISUALS
══════════════════════════════════════════ */
.risk-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-code);
  font-weight: 600;
  font-size: 0.9rem;
}
.risk-score-bar {
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.risk-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width var(--t-slow) var(--ease-smooth);
}
.risk-high   { color: var(--risk-high); }
.risk-medium { color: var(--risk-medium); }
.risk-low    { color: var(--risk-low); }

.delta-positive { color: var(--risk-high); }
.delta-negative { color: var(--risk-low); }
.delta-neutral  { color: var(--text-secondary); }

/* ══════════════════════════════════════════
   PROGRESS & LOADERS
══════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width var(--t-slow) var(--ease-smooth);
}
.progress-fill-animated {
  animation: progress-pulse 2s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background var(--t-base), border-color var(--t-base);
}
.nav.scrolled {
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}
.nav-link:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ══════════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════════ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.05rem;
}
.sidebar-logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900; color: white; flex-shrink: 0;
}
.sidebar-section { padding: 0.75rem 0; }
.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1rem;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-fast);
  cursor: pointer;
}
.sidebar-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidebar-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99,102,241,0.2);
}
.sidebar-item svg { flex-shrink: 0; }
.sidebar-item-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-elevated); }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; color: white; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); truncate: ellipsis; }
.sidebar-user-plan { font-size: 0.72rem; color: var(--text-muted); }

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(5,8,16,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 40;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Main content area */
.dashboard-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  flex: 1;
  padding: 2rem;
  min-height: calc(100vh - var(--topbar-h));
  max-width: calc(100vw - var(--sidebar-w));
}
.page-header { margin-bottom: 2rem; }
.page-title { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); margin-top: 0.25rem; font-size: 0.9rem; }

/* ══════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base), transform var(--t-base);
}
.kpi-card:hover { border-color: var(--border-bright); transform: translateY(-1px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
}
.kpi-card.kpi-primary::before { background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); }
.kpi-card.kpi-danger::before  { background: linear-gradient(90deg, var(--risk-high), #f97316); }
.kpi-card.kpi-success::before { background: linear-gradient(90deg, var(--risk-low), #06b6d4); }
.kpi-card.kpi-warning::before { background: linear-gradient(90deg, var(--risk-medium), #facc15); }
.kpi-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }
.kpi-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin-top: 0.5rem; line-height: 1; }
.kpi-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.kpi-change.up   { color: var(--risk-high); }
.kpi-change.down { color: var(--risk-low); }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ══════════════════════════════════════════
   RECOMMENDATION BANNER
══════════════════════════════════════════ */
.rec-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin-bottom: 1.5rem;
}
.rec-banner.rec-block {
  background: rgba(244,63,94,0.08);
  border-color: rgba(244,63,94,0.3);
}
.rec-banner.rec-warn {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
}
.rec-banner.rec-approve {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
}
.rec-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.rec-block  .rec-icon { background: rgba(244,63,94,0.15); }
.rec-warn   .rec-icon { background: rgba(245,158,11,0.15); }
.rec-approve .rec-icon { background: rgba(16,185,129,0.15); }
.rec-title { font-weight: 700; font-size: 1rem; }
.rec-block  .rec-title { color: var(--risk-high); }
.rec-warn   .rec-title { color: var(--risk-medium); }
.rec-approve .rec-title { color: var(--risk-low); }
.rec-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

/* ══════════════════════════════════════════
   DOMAIN BREAKDOWN TABLE
══════════════════════════════════════════ */
.domain-cell-high   { color: var(--risk-high);   font-weight: 600; }
.domain-cell-medium { color: var(--risk-medium);  font-weight: 600; }
.domain-cell-low    { color: var(--risk-low);     font-weight: 600; }
.domain-cell-neutral{ color: var(--text-secondary); }

/* ══════════════════════════════════════════
   STATUS DOTS & INDICATORS
══════════════════════════════════════════ */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.running  { background: var(--accent-primary); animation: pulse-primary 1.5s ease-in-out infinite; }
.status-dot.complete { background: var(--risk-low); }
.status-dot.failed   { background: var(--risk-high); }
.status-dot.pending  { background: var(--text-muted); }
@keyframes pulse-primary {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(99,102,241,0); }
}

/* ══════════════════════════════════════════
   TOOLTIPS
══════════════════════════════════════════ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown{ from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(99,102,241,0.2); }
  50% { box-shadow: 0 0 35px rgba(99,102,241,0.4); }
}
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.animate-fade-in   { animation: fadeIn 0.5s var(--ease-smooth) forwards; }
.animate-fade-up   { animation: fadeInUp 0.6s var(--ease-smooth) forwards; }
.animate-scale-in  { animation: scaleIn 0.4s var(--ease-spring) forwards; }
.animate-float     { animation: float 4s ease-in-out infinite; }
.animate-delay-1   { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2   { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3   { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4   { animation-delay: 0.4s; opacity: 0; }
.animate-delay-5   { animation-delay: 0.5s; opacity: 0; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════
   LANDING-SPECIFIC
══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 7rem 1.5rem 5rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 80% 50%, rgba(34,211,238,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}
.hero-ctas { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); }
.hero-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.hero-stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Feature cards */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--t-base);
  cursor: default;
}
.feature-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; max-width: 1100px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: all var(--t-base);
}
.pricing-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }
.pricing-card.popular {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-primary-glow);
}
.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.pricing-price { display: flex; align-items: baseline; gap: 4px; margin: 1rem 0; }
.pricing-amount { font-size: 2.5rem; font-weight: 900; color: var(--text-primary); }
.pricing-period { color: var(--text-muted); font-size: 0.9rem; }
.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 6px 0;
}
.pricing-check { color: var(--risk-low); flex-shrink: 0; margin-top: 2px; }
.pricing-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* Competitor table */
.competitor-table-wrap { overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--border); }
.competitor-table th { min-width: 120px; }
.competitor-table .winner { color: var(--risk-low); font-weight: 700; }
.competitor-table .loser  { color: var(--risk-high); }
.competitor-table .row-llmguard { background: rgba(99,102,241,0.04); }
.competitor-table .row-llmguard td { font-weight: 600; }

/* Section headers */
.section-header { text-align: center; max-width: 700px; margin: 0 auto 4rem; }
.section-header h2 { margin-bottom: 1rem; }
.section-header p { font-size: 1.05rem; }

/* Testimonials */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.testimonial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.testimonial-quote { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 10px; margin-top: 1.25rem; }
.testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: white; flex-shrink: 0;
}
.testimonial-name { font-weight: 600; font-size: 0.9rem; }
.testimonial-role { font-size: 0.78rem; color: var(--text-muted); }

/* How it works steps */
.steps-list { display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; }
.step { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: white;
  flex-shrink: 0; margin-top: 4px;
}
.step-content h3 { margin-bottom: 0.5rem; }
.step-connector {
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, var(--accent-primary), transparent);
  margin-left: 19px;
}

/* ══════════════════════════════════════════
   TABS
══════════════════════════════════════════ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.tab {
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.tab-panel { display: none; padding-top: 1.5rem; }
.tab-panel.active { display: block; }

/* ══════════════════════════════════════════
   DOCS PAGE
══════════════════════════════════════════ */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 60px); }
.docs-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.docs-nav-section { margin-bottom: 1.5rem; }
.docs-nav-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 1.25rem 0.5rem; }
.docs-nav-item {
  display: block;
  padding: 0.45rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  border-left: 2px solid transparent;
}
.docs-nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.docs-nav-item.active { color: var(--accent-primary); border-left-color: var(--accent-primary); background: rgba(99,102,241,0.05); }
.docs-content { padding: 2.5rem; max-width: 860px; }
.docs-content h2 { margin-top: 3rem; margin-bottom: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.docs-content h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.docs-content h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.docs-content p { margin-bottom: 1rem; }

/* API endpoint blocks */
.api-endpoint {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.api-method {
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.method-post { background: rgba(34,211,238,0.15); color: var(--accent-secondary); }
.method-get  { background: rgba(16,185,129,0.15); color: var(--risk-low); }
.api-path    { font-family: var(--font-code); font-size: 0.88rem; color: var(--text-primary); }
.api-desc    { font-size: 0.82rem; color: var(--text-secondary); margin-left: auto; }
.api-endpoint-body { padding: 1.25rem; }

/* ══════════════════════════════════════════
   TOKEN PROBABILITY VISUALIZATION
══════════════════════════════════════════ */
.token-viz-canvas {
  width: 100%;
  height: 120px;
  display: block;
}
.token-viz-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  overflow: hidden;
  position: relative;
}
.token-viz-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.token-viz-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.token-viz-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ══════════════════════════════════════════
   ALERT / NOTIFICATION BANNERS
══════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-info    { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.25); color: var(--accent-primary); }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: var(--risk-medium); }
.alert-error   { background: rgba(244,63,94,0.08);  border-color: rgba(244,63,94,0.25);  color: var(--risk-high); }
.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.25); color: var(--risk-low); }
.alert-text    { color: var(--text-secondary); line-height: 1.6; }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,8,16,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--t-base) var(--ease-spring);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  background: var(--bg-surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand { max-width: 340px; }
.footer-brand p { margin-top: 0.75rem; font-size: 0.875rem; }
.footer-col h5 { margin-bottom: 1rem; }
.footer-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color var(--t-fast);
}
.footer-link:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--risk-low);
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--t-base); }
  .sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; max-width: 100vw; padding: 1.25rem; }
  .topbar { left: 0; }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .features-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-divider { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   UTILITY OVERRIDES & HELPERS
══════════════════════════════════════════ */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.no-select { user-select: none; }
.pointer { cursor: pointer; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.opacity-50 { opacity: 0.5; }
.font-mono { font-family: var(--font-code); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.78rem; }
.text-lg  { font-size: 1.05rem; }
.text-xl  { font-size: 1.25rem; }
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-primary); }
.text-cyan      { color: var(--accent-secondary); }
.text-danger    { color: var(--risk-high); }
.text-success   { color: var(--risk-low); }
.text-warning   { color: var(--risk-medium); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded   { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-glow-primary { box-shadow: var(--shadow-glow-primary); }
