/* ============================================
   PROBANTO — MVP Demo Styles
   Premium dark theme SaaS UI with light mode
   ============================================ */

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

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #0f172a;
  --bg-card: #111827;
  --bg-card-hover: #1a2340;
  --bg-input: #0c1220;
  --bg-surface: #1e293b;
  --border: #2a3654;
  --border-light: #334466;
  --text-primary: #e8edf5;
  --text-secondary: #8899b4;
  --text-muted: #5a6d8a;
  --accent-blue: #0891b2;
  --accent-cyan: #10b981;
  --accent-gradient: linear-gradient(135deg, #0891b2, #10b981);
  --accent-gradient-text: linear-gradient(135deg, #22d3ee, #34d399);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info-bg: rgba(8, 145, 178, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-full: 9999px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(8, 145, 178, 0.15);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Light Mode Overrides --- */
body.light-mode {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-surface: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-blue: #0891b2;
  --accent-cyan: #10b981;
  --accent-gradient: linear-gradient(135deg, #0891b2, #10b981);
  --accent-gradient-text: linear-gradient(135deg, #0891b2, #10b981);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info-bg: rgba(8, 145, 178, 0.1);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(8, 145, 178, 0.1);
}

body.light-mode .login-logo-icon {
  box-shadow: 0 8px 32px rgba(8, 145, 178, 0.25);
}

body.light-mode .login-logo h1 {
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
  background: none;
}

body.light-mode .sidebar-logo-text {
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
  background: none;
}

body.light-mode .data-table th {
  background: #f1f5f9;
}

body.light-mode .provenance-table th {
  background: #f1f5f9;
}

body.light-mode .report-table th {
  background: #f1f5f9;
}

body.light-mode .data-table td {
  border-bottom-color: #e2e8f0;
}

body.light-mode .data-table tr:hover {
  background: rgba(8, 145, 178, 0.04);
}

body.light-mode .nav-item:hover {
  background: rgba(8, 145, 178, 0.06);
}

body.light-mode .nav-item.active {
  background: rgba(8, 145, 178, 0.08);
}

body.light-mode .sidebar-user:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .activity-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

body.light-mode .case-tab:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
}

body.light-mode .report-brand-text {
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
  background: none;
}

/* --- Report Always-Light-Mode Overrides --- */
.report-view {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 24px;
}

.report-document {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

.report-document * {
  color: #0f172a;
}

.report-document .report-meta,
.report-document .report-meta div,
.report-document .report-title p,
.report-document .report-score-sublabel,
.report-document .report-footer,
.report-document .report-footer p {
  color: #475569 !important;
}

.report-document .report-section h3 {
  color: #0f172a !important;
  border-bottom-color: #e2e8f0 !important;
}

.report-document .report-section p {
  color: #475569 !important;
}

.report-document .report-table th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom-color: #e2e8f0 !important;
}

.report-document .report-table td {
  color: #0f172a !important;
  border-bottom-color: #e2e8f0 !important;
}

.report-document .report-letterhead {
  border-bottom-color: #e2e8f0 !important;
}

.report-document .report-footer {
  border-top-color: #e2e8f0 !important;
}

.report-document .report-score-section {
  background: #f1f5f9 !important;
}

.report-document .report-score-big.high { color: #059669 !important; }
.report-document .report-score-big.moderate { color: #d97706 !important; }
.report-document .report-score-big.low { color: #dc2626 !important; }

.report-document .chip.severity-high { background: rgba(220, 38, 38, 0.1) !important; color: #dc2626 !important; }
.report-document .chip.severity-moderate { background: rgba(217, 119, 6, 0.1) !important; color: #d97706 !important; }
.report-document .chip.severity-low { background: rgba(5, 150, 105, 0.1) !important; color: #059669 !important; }
.report-document .chip.severity-info { background: rgba(8, 145, 178, 0.1) !important; color: #0891b2 !important; }

.report-document div[style*="background:var(--bg-surface)"] {
  background: #f1f5f9 !important;
}

.report-document .note-author,
.report-document strong {
  color: #0f172a !important;
}

.report-document .note-time,
.report-document .note-text {
  color: #475569 !important;
}

.report-document .report-brand-text {
  -webkit-text-fill-color: unset !important;
  color: #0f172a !important;
  background: none !important;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

body.light-mode .theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-input);
}

body.light-mode .theme-toggle:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* --- Theme Transition --- */
body, body .sidebar, body .main-content, body .content-header, body .card,
body .stat-card, body .form-card, body .form-input, body .login-card,
body .timeline-container, body .finding-card, body .report-document,
body .case-tab, body .nav-item, body .btn-secondary {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

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

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes drawCircle {
  from { stroke-dashoffset: 283; }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

.animate-in { animation: fadeInUp 0.5s ease-out forwards; opacity: 0; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }

/* --- Screen Management --- */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
#login-screen {
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(8, 145, 178, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
  animation: pulse 8s ease-in-out infinite;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
  animation: scaleIn 0.6s ease-out;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-gradient);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(8, 145, 178, 0.3);
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

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

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238899b4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.form-check label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transition: width 0.4s, height 0.4s, top 0.4s, left 0.4s;
}

.btn:active::after {
  width: 200px;
  height: 200px;
  top: calc(50% - 100px);
  left: calc(50% - 100px);
  opacity: 0;
  transition: 0s;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(8, 145, 178, 0.45);
  transform: translateY(-1px);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

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

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-block { width: 100%; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-xs);
  font-size: 1rem;
}

/* ============================================
   APP LAYOUT
   ============================================ */
#app-screen {
  flex-direction: column;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(8, 145, 178, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(8, 145, 178, 0.12);
  color: var(--accent-blue);
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--accent-blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

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

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.content-header {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.content-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.content-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  position: relative;
}

.header-search input {
  padding: 8px 16px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  width: 240px;
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--accent-blue);
  width: 300px;
}

.header-search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
}

.content-body {
  padding: 32px 40px;
}

/* --- Page Sections --- */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease-out; }

/* ============================================
   DASHBOARD
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-light);
}

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

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

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-card-icon.blue { background: var(--info-bg); }
.stat-card-icon.green { background: var(--success-bg); }
.stat-card-icon.yellow { background: var(--warning-bg); }
.stat-card-icon.red { background: var(--danger-bg); }

.stat-card-trend {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  animation: countUp 0.6s ease-out;
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

/* --- Case Table --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 0;
}

.card-body.padded {
  padding: 24px;
}

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

.data-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(42, 54, 84, 0.5);
  vertical-align: middle;
}

.data-table tr {
  transition: var(--transition);
  cursor: pointer;
}

.data-table tr:hover {
  background: rgba(8, 145, 178, 0.05);
}

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

/* --- Status Chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.chip.completed { background: var(--success-bg); color: var(--success); }
.chip.completed .chip-dot { background: var(--success); }

.chip.in-progress { background: var(--info-bg); color: var(--accent-blue); }
.chip.in-progress .chip-dot { background: var(--accent-blue); animation: pulse 2s infinite; }

.chip.flagged { background: var(--warning-bg); color: var(--warning); }
.chip.flagged .chip-dot { background: var(--warning); }

.chip.critical { background: var(--danger-bg); color: var(--danger); }
.chip.critical .chip-dot { background: var(--danger); }

.chip.pending { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.chip.pending .chip-dot { background: #94a3b8; }

/* Severity chips */
.severity-low { background: var(--success-bg); color: var(--success); }
.severity-moderate { background: var(--warning-bg); color: var(--warning); }
.severity-high { background: var(--danger-bg); color: var(--danger); }

/* --- Score Badge --- */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
}

.score-badge.high { background: var(--success-bg); color: var(--success); }
.score-badge.moderate { background: var(--warning-bg); color: var(--warning); }
.score-badge.low { background: var(--danger-bg); color: var(--danger); }

/* --- Activity Feed --- */
.activity-feed {
  padding: 8px 0;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 24px;
  transition: var(--transition);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

.activity-dot.blue { background: var(--accent-blue); }
.activity-dot.green { background: var(--success); }
.activity-dot.yellow { background: var(--warning); }
.activity-dot.red { background: var(--danger); }

.activity-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}

/* ============================================
   NEW VERIFICATION FORM
   ============================================ */
.form-container {
  max-width: 720px;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.form-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-card h3 .step-number {
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.employment-entry {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}

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

.employment-entry-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ============================================
   CASE DETAIL
   ============================================ */
.case-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.case-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.case-avatar {
  width: 64px;
  height: 64px;
  background: var(--accent-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.25);
}

.case-title h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.case-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.case-meta-sep {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

.case-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-score-display {
  text-align: center;
}

.case-score-circle {
  position: relative;
  width: 80px;
  height: 80px;
}

.case-score-circle svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.case-score-circle .bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.case-score-circle .progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  transition: stroke-dashoffset 1s ease-out;
}

.case-score-circle .progress.high { stroke: var(--success); }
.case-score-circle .progress.moderate { stroke: var(--warning); }
.case-score-circle .progress.low { stroke: var(--danger); }

.case-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  font-weight: 800;
}

.case-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* --- Tab Navigation --- */
.case-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  overflow-x: auto;
}

.case-tab {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
  background: none;
  font-family: var(--font);
}

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

.case-tab.active {
  background: var(--accent-blue);
  color: white;
}

.tab-content { display: none; }
.tab-content.active { display: block; opacity: 1; transform: translateY(0); animation: fadeIn 0.3s ease-out forwards; }

/* --- Timeline Visualization --- */
.timeline-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

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

.timeline-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-legend {
  display: flex;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-color.claimed { background: var(--accent-blue); }
.legend-color.verified { background: var(--success); }
.legend-color.undisclosed { background: var(--danger); }
.legend-color.overlap { background: repeating-linear-gradient(45deg, var(--danger), var(--danger) 3px, rgba(239,68,68,0.3) 3px, rgba(239,68,68,0.3) 6px); }

.timeline-chart {
  position: relative;
  padding: 0 0 0 180px;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 180px;
  margin-bottom: 16px;
  position: relative;
}

.timeline-axis::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 180px;
  right: 0;
  height: 1px;
  background: var(--border);
}

.timeline-axis-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
  min-height: 44px;
}

.timeline-row-label {
  position: absolute;
  left: -180px;
  width: 170px;
  text-align: right;
  padding-right: 16px;
}

.timeline-row-label .role-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.timeline-row-label .company-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.timeline-track {
  flex: 1;
  height: 36px;
  position: relative;
  border-radius: 6px;
}

.timeline-bar {
  position: absolute;
  height: 100%;
  border-radius: 6px;
  transition: opacity 0.3s;
  cursor: pointer;
  min-width: 4px;
}

.timeline-bar:hover {
  opacity: 0.85;
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.3);
}

.timeline-bar.claimed {
  background: var(--accent-blue);
  opacity: 0.7;
}

.timeline-bar.verified {
  background: var(--success);
  opacity: 0.85;
}

.timeline-bar.undisclosed {
  background: var(--danger);
  opacity: 0.85;
}

.timeline-bar.overlap-zone {
  background: repeating-linear-gradient(
    45deg,
    rgba(239, 68, 68, 0.5),
    rgba(239, 68, 68, 0.5) 4px,
    rgba(239, 68, 68, 0.2) 4px,
    rgba(239, 68, 68, 0.2) 8px
  );
  border: 2px solid var(--danger);
  z-index: 5;
  animation: pulse 2s infinite;
}

.timeline-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.timeline-bar:hover .timeline-bar-tooltip {
  opacity: 1;
}

.overlap-indicator {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.overlap-indicator-icon {
  font-size: 1.5rem;
}

.overlap-indicator-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 2px;
}

.overlap-indicator-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* --- Findings Panel --- */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: var(--transition);
}

.finding-card:hover {
  border-color: var(--border-light);
}

.finding-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.finding-card.severity-info::before { background: var(--accent-blue); }
.finding-card.severity-low::before { background: var(--success); }
.finding-card.severity-moderate::before { background: var(--warning); }
.finding-card.severity-high::before { background: var(--danger); }

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

.finding-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.finding-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.finding-evidence {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--info-bg);
  color: var(--accent-blue);
}

/* --- Source Provenance --- */
.provenance-table {
  width: 100%;
  border-collapse: collapse;
}

.provenance-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.15);
}

.provenance-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(42, 54, 84, 0.5);
}

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

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

.source-status-icon {
  font-size: 0.9rem;
}

/* --- Reviewer Notes --- */
.notes-area {
  margin-top: 24px;
}

.note-entry {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.note-entry:last-child { border-bottom: none; }

.note-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.note-content {
  flex: 1;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.note-author {
  font-size: 0.85rem;
  font-weight: 600;
}

.note-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.note-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.add-note-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.add-note-form .form-input {
  flex: 1;
}

/* ============================================
   REPORT VIEW
   ============================================ */
.report-view {
  max-width: 900px;
  margin: 0 auto;
}

.report-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 24px;
}

.report-document {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow-lg);
}

.report-letterhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 32px;
}

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

.report-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.report-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.report-meta {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.report-meta div { margin-bottom: 3px; }

.report-title {
  text-align: center;
  margin-bottom: 36px;
}

.report-title h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.report-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.report-score-section {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
  padding: 28px;
  background: var(--bg-surface);
  border-radius: var(--radius);
}

.report-score-main {
  text-align: center;
}

.report-score-big {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.report-score-big.high { color: var(--success); }
.report-score-big.moderate { color: var(--warning); }
.report-score-big.low { color: var(--danger); }

.report-score-sublabel {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.report-section {
  margin-bottom: 32px;
}

.report-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.report-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(42, 54, 84, 0.4);
}

.report-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

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

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.open {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .content-header {
    padding: 16px 20px;
  }
  
  .content-body {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .case-header {
    flex-direction: column;
    gap: 20px;
  }
  
  .timeline-chart {
    padding-left: 0;
  }
  
  .timeline-axis {
    padding-left: 0;
  }
  
  .timeline-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .timeline-row-label {
    position: static;
    width: auto;
    text-align: left;
    padding-right: 0;
    margin-bottom: 6px;
  }
  
  .report-document {
    padding: 24px;
  }
  
  .report-letterhead {
    flex-direction: column;
    gap: 16px;
  }
  
  .report-meta {
    text-align: left;
  }
  
  .header-search input {
    width: 160px;
  }
  
  .header-search input:focus {
    width: 200px;
  }
}

/* --- Print Styles --- */
@media print {
  body { background: white; color: #1a1a1a; }
  .sidebar, .content-header, .case-tabs, .report-controls, .add-note-form, .btn { display: none !important; }
  .main-content { margin-left: 0; }
  .report-document { border: none; box-shadow: none; padding: 0; background: white; color: #1a1a1a; }
  .report-document * { color: #1a1a1a !important; }
  .report-table th { background: #f3f4f6 !important; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* --- Back button --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
  border: none;
  background: none;
  font-family: var(--font);
}

.back-link:hover {
  color: var(--accent-blue);
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

/* ============================================
   REPORTS LIBRARY
   ============================================ */
.report-filters {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: none;
  font-family: var(--font);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.filter-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.actions-cell {
  display: flex;
  gap: 4px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-xs);
}

.chip.archived {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.chip.archived .chip-dot {
  background: #94a3b8;
}

/* ============================================
   OVERLAP SCANNER
   ============================================ */
.section-intro {
  margin-bottom: 24px;
}

.section-intro h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-chart-label {
  width: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.bar-chart-track {
  flex: 1;
  height: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  transition: width 0.8s ease-out;
}

.bar-chart-fill.green {
  background: var(--success);
  opacity: 0.7;
}

.bar-chart-fill.yellow {
  background: var(--warning);
  opacity: 0.7;
}

.bar-chart-value {
  width: 42px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ============================================
   CONFIGURATION
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info {
  flex: 1;
}

.setting-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 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: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

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

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

/* API key display */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.api-key-display code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Usage bar */
.usage-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: var(--radius-full);
}

/* ============================================
   TEAM
   ============================================ */
.member-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.member-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.permissions-table td,
.permissions-table th {
  text-align: center;
}

.permissions-table td:first-child,
.permissions-table th:first-child {
  text-align: left;
}

/* ============================================
   INTEGRATIONS
   ============================================ */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.integration-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.integration-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.integration-card.connected {
  border-left: 3px solid var(--success);
}

.integration-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.integration-info {
  flex: 1;
  min-width: 0;
}

.integration-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.integration-type {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 1px;
}

.integration-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  max-width: 360px;
  font-family: var(--font);
}

.toast.visible {
  transform: translateX(0);
  opacity: 1;
}

/* ============================================
   LIGHT MODE ADDITIONS
   ============================================ */
body.light-mode .filter-btn {
  border-color: var(--border);
}

body.light-mode .filter-btn:hover {
  border-color: var(--border-light);
}

body.light-mode .toggle-slider {
  background: #cbd5e1;
}

body.light-mode .bar-chart-track {
  background: #e2e8f0;
}

body.light-mode .integration-icon {
  background: #f1f5f9;
}

body.light-mode .api-key-display {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body.light-mode .permissions-table th {
  background: #f1f5f9;
}

body.light-mode .toast {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PREMIUM INLINE REPORT (rpt- prefixed)
   Forces light mode regardless of dashboard theme
   ============================================ */

/* --- Container --- */
.rpt-wrapper {
  max-width: 900px !important;
  margin: 0 auto !important;
  background: #f8fafc !important;
  border-radius: 16px !important;
  padding: 32px 24px !important;
}

.rpt-controls {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  margin-bottom: 24px !important;
}

/* --- Document shell --- */
.rpt-doc {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 48px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
}

.rpt-doc *, .rpt-doc *::before, .rpt-doc *::after {
  box-sizing: border-box !important;
}

/* --- Letterhead --- */
.rpt-letterhead {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  padding-bottom: 28px !important;
  margin-bottom: 28px !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

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

.rpt-brand-icon {
  width: 44px !important;
  height: 44px !important;
  background: linear-gradient(135deg, #0891b2, #10b981) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.rpt-brand-name {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.5px !important;
}

.rpt-brand-tagline {
  font-size: 0.78rem !important;
  color: #94a3b8 !important;
  margin-top: 2px !important;
  font-weight: 400 !important;
}

.rpt-meta-block {
  text-align: right !important;
}

.rpt-meta-id {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 6px !important;
}

.rpt-meta-line {
  font-size: 0.82rem !important;
  color: #475569 !important;
  margin-bottom: 3px !important;
}

.rpt-meta-line strong {
  color: #0f172a !important;
}

.rpt-confidential {
  display: inline-block !important;
  margin-top: 8px !important;
  padding: 3px 10px !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* --- Title block --- */
.rpt-title-block {
  text-align: center !important;
  margin-bottom: 28px !important;
}

.rpt-title-block h1 {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 4px 0 !important;
  letter-spacing: -0.5px !important;
}

.rpt-title-block .rpt-subtitle {
  font-size: 0.92rem !important;
  color: #475569 !important;
}

/* --- Score hero section --- */
.rpt-score-hero {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 60px !important;
  background: #f1f5f9 !important;
  border-radius: 8px !important;
  padding: 28px 40px !important;
  margin-bottom: 0 !important;
}

.rpt-score-main {
  text-align: center !important;
}

.rpt-score-ring {
  position: relative !important;
  width: 120px !important;
  height: 120px !important;
  margin: 0 auto 10px !important;
}

.rpt-score-ring svg {
  width: 120px !important;
  height: 120px !important;
  transform: rotate(-90deg) !important;
}

.rpt-score-ring .rpt-ring-track {
  fill: none !important;
  stroke: #e2e8f0 !important;
  stroke-width: 8 !important;
}

.rpt-score-ring .rpt-ring-fill {
  fill: none !important;
  stroke-width: 8 !important;
  stroke-linecap: round !important;
  stroke-dasharray: 283 !important;
  transition: stroke-dashoffset 1s ease-out !important;
}

.rpt-score-ring .rpt-ring-fill.rpt-high { stroke: #059669 !important; }
.rpt-score-ring .rpt-ring-fill.rpt-moderate { stroke: #d97706 !important; }
.rpt-score-ring .rpt-ring-fill.rpt-low { stroke: #dc2626 !important; }

.rpt-score-number {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: 2rem !important;
  font-weight: 800 !important;
}

.rpt-score-number.rpt-high { color: #059669 !important; }
.rpt-score-number.rpt-moderate { color: #d97706 !important; }
.rpt-score-number.rpt-low { color: #dc2626 !important; }

.rpt-score-label {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
}

.rpt-score-label.rpt-high { color: #059669 !important; }
.rpt-score-label.rpt-moderate { color: #d97706 !important; }
.rpt-score-label.rpt-low { color: #dc2626 !important; }

.rpt-score-sublabel {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
  margin-top: 2px !important;
}

.rpt-score-sublabel strong {
  color: #475569 !important;
}

/* --- Score indicators --- */
.rpt-indicators {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.rpt-indicator {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.rpt-indicator-label {
  font-size: 0.82rem !important;
  color: #475569 !important;
  width: 140px !important;
}

.rpt-indicator-bar {
  flex: 1 !important;
  height: 6px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  min-width: 80px !important;
}

.rpt-indicator-fill {
  height: 100% !important;
  border-radius: 3px !important;
  background: linear-gradient(135deg, #0891b2, #10b981) !important;
}

.rpt-indicator-fill.rpt-warn {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
}

.rpt-indicator-fill.rpt-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

.rpt-indicator-value {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  width: 40px !important;
  text-align: right !important;
}

/* --- Summary stats strip --- */
.rpt-stats {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin: 24px 0 !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.rpt-stat {
  padding: 20px 24px !important;
  text-align: center !important;
  border-right: 1px solid #e2e8f0 !important;
}

.rpt-stat:last-child {
  border-right: none !important;
}

.rpt-stat-value {
  font-size: 1.8rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1 !important;
  margin-bottom: 4px !important;
}

.rpt-stat-value.rpt-success { color: #059669 !important; }
.rpt-stat-value.rpt-warn { color: #d97706 !important; }
.rpt-stat-value.rpt-danger { color: #dc2626 !important; }

.rpt-stat-label {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
}

/* --- Decision panel --- */
.rpt-decision {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 24px 28px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
}

.rpt-decision-icon {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.5rem !important;
  flex-shrink: 0 !important;
}

.rpt-decision-icon.rpt-high { background: #ecfdf5 !important; }
.rpt-decision-icon.rpt-moderate { background: #fffbeb !important; }
.rpt-decision-icon.rpt-low { background: #fef2f2 !important; }

.rpt-decision h3 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 0 6px 0 !important;
  border: none !important;
  padding: 0 !important;
}

.rpt-decision p {
  font-size: 0.88rem !important;
  color: #475569 !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}

/* --- Section blocks --- */
.rpt-section {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.rpt-section-head {
  padding: 16px 28px !important;
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.rpt-section-head h2 {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

.rpt-section-body {
  padding: 24px 28px !important;
}

.rpt-section-body.rpt-no-pad {
  padding: 0 !important;
}

/* --- Candidate info grid --- */
.rpt-candidate-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}

.rpt-field {
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 12px !important;
}

.rpt-field-label {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 4px !important;
}

.rpt-field-value {
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  color: #0f172a !important;
}

/* --- Data table --- */
.rpt-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.rpt-table th {
  padding: 10px 16px !important;
  text-align: left !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #94a3b8 !important;
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.rpt-table td {
  padding: 12px 16px !important;
  font-size: 0.85rem !important;
  border-bottom: 1px solid #e2e8f0 !important;
  vertical-align: middle !important;
  color: #0f172a !important;
}

.rpt-table tr:last-child td {
  border-bottom: none !important;
}

.rpt-table tr:hover td {
  background: #fafbff !important;
}

.rpt-table td strong {
  color: #0f172a !important;
}

.rpt-table td .rpt-muted {
  color: #94a3b8 !important;
}

.rpt-table td .rpt-secondary {
  color: #475569 !important;
}

/* --- Chips/Badges --- */
.rpt-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

.rpt-chip-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

.rpt-chip.rpt-verified { background: #ecfdf5 !important; color: #059669 !important; }
.rpt-chip.rpt-verified .rpt-chip-dot { background: #059669 !important; }

.rpt-chip.rpt-mismatch { background: #fffbeb !important; color: #d97706 !important; }
.rpt-chip.rpt-mismatch .rpt-chip-dot { background: #d97706 !important; }

.rpt-chip.rpt-not-verified { background: #fef2f2 !important; color: #dc2626 !important; }
.rpt-chip.rpt-not-verified .rpt-chip-dot { background: #dc2626 !important; }

.rpt-chip.rpt-undisclosed { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca !important; }
.rpt-chip.rpt-undisclosed .rpt-chip-dot { background: #dc2626 !important; }

.rpt-badge {
  display: inline-block !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.rpt-badge.rpt-sev-high { background: #fef2f2 !important; color: #dc2626 !important; }
.rpt-badge.rpt-sev-moderate { background: #fffbeb !important; color: #d97706 !important; }
.rpt-badge.rpt-sev-low { background: #ecfdf5 !important; color: #059669 !important; }
.rpt-badge.rpt-sev-info { background: #ecfeff !important; color: #0891b2 !important; }

/* --- Timeline --- */
.rpt-timeline {
  margin: 8px 0 !important;
}

.rpt-tl-axis {
  display: flex !important;
  justify-content: space-between !important;
  padding-left: 200px !important;
  margin-bottom: 10px !important;
}

.rpt-tl-axis span {
  font-size: 0.7rem !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
}

.rpt-tl-entry {
  display: flex !important;
  align-items: center !important;
  margin-bottom: 12px !important;
  min-height: 38px !important;
}

.rpt-tl-label {
  width: 200px !important;
  padding-right: 16px !important;
  text-align: right !important;
  flex-shrink: 0 !important;
}

.rpt-tl-label .rpt-tl-role {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.rpt-tl-label .rpt-tl-role.rpt-danger {
  color: #dc2626 !important;
}

.rpt-tl-label .rpt-tl-company {
  font-size: 0.72rem !important;
  color: #475569 !important;
}

.rpt-tl-track {
  flex: 1 !important;
  height: 32px !important;
  background: #f1f5f9 !important;
  border-radius: 6px !important;
  position: relative !important;
  overflow: visible !important;
}

.rpt-tl-bar {
  position: absolute !important;
  top: 4px !important;
  height: 24px !important;
  border-radius: 5px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 6px !important;
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.rpt-tl-bar.rpt-claimed {
  background: #cffafe !important;
  color: #0e7490 !important;
  opacity: 0.8 !important;
}

.rpt-tl-bar.rpt-verified {
  background: #d1fae5 !important;
  color: #065f46 !important;
}

.rpt-tl-bar.rpt-undisclosed {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.rpt-tl-bar.rpt-overlap {
  background: repeating-linear-gradient(45deg, rgba(220,38,38,0.25), rgba(220,38,38,0.25) 4px, rgba(220,38,38,0.1) 4px, rgba(220,38,38,0.1) 8px) !important;
  border: 1.5px solid #dc2626 !important;
  color: #991b1b !important;
}

.rpt-tl-legend {
  display: flex !important;
  gap: 20px !important;
  margin-top: 14px !important;
  padding-top: 14px !important;
  border-top: 1px solid #e2e8f0 !important;
}

.rpt-tl-legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.75rem !important;
  color: #475569 !important;
}

.rpt-tl-swatch {
  width: 14px !important;
  height: 10px !important;
  border-radius: 3px !important;
}

.rpt-tl-swatch.rpt-claimed { background: #cffafe !important; border: 1px solid #67e8f9 !important; }
.rpt-tl-swatch.rpt-verified { background: #d1fae5 !important; border: 1px solid #6ee7b7 !important; }
.rpt-tl-swatch.rpt-undisclosed { background: #fee2e2 !important; border: 1px solid #fca5a5 !important; }
.rpt-tl-swatch.rpt-overlap { background: repeating-linear-gradient(45deg, rgba(220,38,38,0.25), rgba(220,38,38,0.25) 3px, rgba(220,38,38,0.1) 3px, rgba(220,38,38,0.1) 6px) !important; border: 1px solid #dc2626 !important; }

/* --- Overlap alert --- */
.rpt-overlap-alert {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-left: 4px solid #dc2626 !important;
  border-radius: 8px !important;
  padding: 16px 20px !important;
  margin-top: 16px !important;
  display: flex !important;
  gap: 12px !important;
  align-items: flex-start !important;
}

.rpt-overlap-alert-icon {
  font-size: 1.2rem !important;
  flex-shrink: 0 !important;
}

.rpt-overlap-alert h4 {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: #dc2626 !important;
  margin: 0 0 4px 0 !important;
  border: none !important;
  padding: 0 !important;
}

.rpt-overlap-alert p {
  font-size: 0.83rem !important;
  color: #7f1d1d !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

/* --- Findings --- */
.rpt-finding {
  padding: 20px 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.rpt-finding:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.rpt-finding:first-child {
  padding-top: 0 !important;
}

.rpt-finding-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
  gap: 16px !important;
}

.rpt-finding-title {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.rpt-finding-detail {
  font-size: 0.85rem !important;
  color: #475569 !important;
  line-height: 1.65 !important;
  margin-bottom: 10px !important;
}

.rpt-finding-evidence {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}

.rpt-evidence-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 10px !important;
  background: #ecfeff !important;
  color: #0891b2 !important;
  border-radius: 999px !important;
  font-size: 0.73rem !important;
  font-weight: 500 !important;
}

.rpt-confidence-inline {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
  margin-left: auto !important;
}

.rpt-confidence-inline strong {
  color: #0f172a !important;
}

/* --- Source confidence bars --- */
.rpt-conf {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.rpt-conf-bar {
  width: 60px !important;
  height: 5px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  overflow: hidden !important;
}

.rpt-conf-fill {
  height: 100% !important;
  border-radius: 3px !important;
}

.rpt-conf-fill.rpt-conf-high { background: #059669 !important; }
.rpt-conf-fill.rpt-conf-med { background: #d97706 !important; }
.rpt-conf-fill.rpt-conf-low { background: #dc2626 !important; }

/* --- Notes --- */
.rpt-note {
  padding: 16px !important;
  background: #f1f5f9 !important;
  border-radius: 8px !important;
  margin-bottom: 12px !important;
}

.rpt-note:last-child {
  margin-bottom: 0 !important;
}

.rpt-note-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
}

.rpt-note-author-block {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.rpt-note-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  background: linear-gradient(135deg, #0891b2, #10b981) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: white !important;
}

.rpt-note-author {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.rpt-note-time {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
}

.rpt-note-text {
  font-size: 0.85rem !important;
  color: #475569 !important;
  line-height: 1.6 !important;
}

/* --- Executive summary --- */
.rpt-summary-text {
  font-size: 0.9rem !important;
  color: #475569 !important;
  line-height: 1.8 !important;
}

/* --- Footer --- */
.rpt-footer {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 24px 28px !important;
  text-align: center !important;
  margin-top: 24px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.rpt-footer-text {
  font-size: 0.78rem !important;
  color: #94a3b8 !important;
  line-height: 1.7 !important;
  max-width: 700px !important;
  margin: 0 auto !important;
}

.rpt-footer-ref {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  margin-top: 12px !important;
}

/* --- Status text helpers --- */
.rpt-text-success { color: #059669 !important; }
.rpt-text-warn { color: #d97706 !important; }
.rpt-text-danger { color: #dc2626 !important; }
.rpt-text-muted { color: #94a3b8 !important; }

/* --- Responsive --- */
@media (max-width: 720px) {
  .rpt-candidate-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .rpt-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .rpt-stat { border-bottom: 1px solid #e2e8f0 !important; }
  .rpt-score-hero { flex-direction: column !important; gap: 24px !important; }
  .rpt-tl-axis { padding-left: 120px !important; }
  .rpt-tl-label { width: 120px !important; }
  .rpt-doc { padding: 24px !important; }
  .rpt-letterhead { flex-direction: column !important; gap: 16px !important; }
  .rpt-meta-block { text-align: left !important; }
  .rpt-section-body { padding: 16px !important; }
}

/* --- Print overrides for premium report --- */
@media print {
  .rpt-wrapper { background: white !important; padding: 0 !important; }
  .rpt-controls { display: none !important; }
  .rpt-doc { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .rpt-section, .rpt-decision, .rpt-stats, .rpt-footer { break-inside: avoid !important; }
  .rpt-tl-bar.rpt-overlap {
    background: repeating-linear-gradient(45deg, rgba(220,38,38,0.4), rgba(220,38,38,0.4) 4px, rgba(220,38,38,0.15) 4px, rgba(220,38,38,0.15) 8px) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .rpt-doc * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* Click-outside hint for report view */
#page-report.active {
  cursor: pointer;
}
#page-report .rpt-document,
#page-report .report-document,
#page-report .rpt-controls,
#page-report .report-controls {
  cursor: default;
}

/* Version label in sidebar */
.sidebar-version {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 20px 8px;
  opacity: 0.5;
}

/* Report view: make the background area clickable */
#page-report.active .rpt-view,
#page-report.active .report-view {
  cursor: pointer;
  min-height: 100%;
}
#page-report.active .rpt-document,
#page-report.active .report-document,
#page-report.active .rpt-controls,
#page-report.active .report-controls {
  cursor: default;
}

/* Case detail: also clickable background */
#page-case-detail.active {
  cursor: pointer;
}
#page-case-detail.active > * {
  cursor: default;
}

/* ============================================
   PREMIUM UPGRADE — Phase 3 Quality Match
   ============================================ */

/* --- Login: Animated gradient mesh (matches landing hero) --- */
#login-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 25% 30%, rgba(8,145,178,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 70%, rgba(16,185,129,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(8,145,178,0.06) 0%, transparent 70%);
  animation: loginMeshPulse 10s ease-in-out infinite alternate;
}

@keyframes loginMeshPulse {
  0% { opacity: 0.7; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 0.8; transform: scale(1.02) rotate(-0.5deg); }
}

.login-logo-icon {
  box-shadow: 0 8px 40px rgba(8,145,178,0.35), 0 0 60px rgba(8,145,178,0.1) !important;
}

.login-card {
  backdrop-filter: blur(20px);
  background: rgba(26, 35, 64, 0.7) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(8,145,178,0.05) !important;
}

body.light-mode .login-card {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1) !important;
}

/* --- Stat Cards: Glassmorphism + Always-on gradient accent --- */
.stat-card {
  background: rgba(26, 35, 64, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-card::before {
  opacity: 0.6 !important;
}

.stat-card:hover {
  background: rgba(26, 35, 64, 0.7);
  box-shadow: 0 0 40px rgba(8, 145, 178, 0.12), 0 12px 40px rgba(0,0,0,0.25);
}

.stat-card:hover::before {
  opacity: 1 !important;
}

body.light-mode .stat-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
}

body.light-mode .stat-card:hover {
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 30px rgba(8,145,178,0.08), 0 8px 30px rgba(0,0,0,0.06);
}

.stat-card-value {
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.2rem;
}

body.light-mode .stat-card-value {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Cards: Enhanced glass effect --- */
.card {
  background: rgba(26, 35, 64, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(8,145,178,0.15);
  box-shadow: 0 0 30px rgba(8,145,178,0.06);
}

body.light-mode .card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
}

body.light-mode .card:hover {
  border-color: rgba(8,145,178,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* --- Sidebar: Premium glow on active item --- */
.nav-item.active {
  background: rgba(8, 145, 178, 0.15);
  box-shadow: inset 3px 0 0 var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-item:hover {
  background: rgba(8, 145, 178, 0.08);
  transform: translateX(2px);
}

/* --- Content Header: Glass effect --- */
.content-header {
  background: rgba(21, 29, 50, 0.8) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

body.light-mode .content-header {
  background: rgba(255,255,255,0.85) !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
}

/* --- Table Rows: Smoother hover with left accent --- */
.data-table tr {
  position: relative;
  transition: all 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(8, 145, 178, 0.06);
  box-shadow: inset 3px 0 0 var(--accent-blue);
}

body.light-mode .data-table tbody tr:hover {
  background: rgba(8, 145, 178, 0.04);
  box-shadow: inset 3px 0 0 var(--accent-blue);
}

/* --- Score Badge: Enhanced with glow --- */
.score-badge {
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.score-badge.high { box-shadow: 0 0 12px rgba(16,185,129,0.2); }
.score-badge.moderate { box-shadow: 0 0 12px rgba(245,158,11,0.2); }
.score-badge.low { box-shadow: 0 0 12px rgba(239,68,68,0.2); }

/* --- Activity Feed: Better visual rhythm --- */
.activity-item {
  border-left: 2px solid transparent;
  padding-left: 20px;
  margin-left: 4px;
  transition: all 0.2s ease;
}

.activity-item:hover {
  border-left-color: var(--accent-blue);
  background: rgba(8, 145, 178, 0.03);
}

.activity-dot {
  box-shadow: 0 0 8px currentColor;
}

/* --- Form Cards: Glass + subtle glow --- */
.form-card {
  background: rgba(26, 35, 64, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
}

body.light-mode .form-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
}

.form-card h3 .step-number {
  box-shadow: 0 4px 16px rgba(8,145,178,0.3);
}

/* --- Finding Cards: Enhanced severity accents --- */
.finding-card {
  background: rgba(26, 35, 64, 0.5);
  backdrop-filter: blur(8px);
}

.finding-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

body.light-mode .finding-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
}

/* --- Case Score Circle: Glow effect --- */
.case-score-circle .progress.high { filter: drop-shadow(0 0 6px rgba(16,185,129,0.4)); }
.case-score-circle .progress.moderate { filter: drop-shadow(0 0 6px rgba(245,158,11,0.4)); }
.case-score-circle .progress.low { filter: drop-shadow(0 0 6px rgba(239,68,68,0.4)); }

/* --- Case Avatar: Enhanced glow --- */
.case-avatar {
  box-shadow: 0 8px 32px rgba(8, 145, 178, 0.3), 0 0 0 3px rgba(8,145,178,0.1);
}

/* --- Integration Cards: Better connected state --- */
.integration-card {
  backdrop-filter: blur(8px);
  background: rgba(26, 35, 64, 0.5);
}

.integration-card.connected {
  border-left: 3px solid var(--success);
  box-shadow: inset 0 0 20px rgba(16,185,129,0.03);
}

.integration-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

body.light-mode .integration-card {
  background: rgba(255,255,255,0.7);
}

/* --- Button: Smoother primary glow --- */
.btn-primary {
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(8, 145, 178, 0.45);
  transform: translateY(-2px);
}

/* --- Chip animation: Pulse on critical/flagged --- */
.chip.critical .chip-dot { animation: chipPulse 2s infinite; }
.chip.flagged .chip-dot { animation: chipPulse 3s infinite; }

@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 0 4px transparent; }
}

/* --- Timeline bars: Smoother animation on load --- */
.timeline-bar {
  animation: barSlideIn 0.6s ease-out forwards;
  transform-origin: left center;
}

@keyframes barSlideIn {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.timeline-bar.overlap-zone {
  animation: barSlideIn 0.6s ease-out forwards, pulse 2s infinite 0.6s;
}

/* --- Header search: Glass effect --- */
.header-search input {
  backdrop-filter: blur(8px);
  background: rgba(17, 26, 46, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}

.header-search input:focus {
  background: rgba(17, 26, 46, 0.9);
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(8,145,178,0.15);
}

body.light-mode .header-search input {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(0,0,0,0.08);
}

body.light-mode .header-search input:focus {
  background: #ffffff;
  box-shadow: 0 0 15px rgba(8,145,178,0.1);
}

/* --- Sidebar: Subtle gradient at bottom --- */
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, rgba(0,0,0,0.2));
  pointer-events: none;
  z-index: 0;
}

body.light-mode .sidebar::after {
  background: linear-gradient(transparent, rgba(0,0,0,0.03));
}

.sidebar-footer {
  position: relative;
  z-index: 1;
}

/* --- Settings toggle: Better glow on checked --- */
.toggle-switch input:checked + .toggle-slider {
  box-shadow: 0 0 12px rgba(16,185,129,0.3);
}

/* --- Dashboard: Activity text gradient highlight --- */
.activity-text strong {
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

body.light-mode .activity-text strong {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Bar chart: Animated fill on load --- */
.bar-chart-fill {
  animation: barGrow 0.8s ease-out forwards;
  transform-origin: left;
}

@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* --- Smooth page transitions --- */
.page-section.active {
  animation: pageReveal 0.35s ease-out;
}

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

/* --- Case tabs: Enhanced active state --- */
.case-tab.active {
  background: var(--accent-gradient) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(8,145,178,0.25);
}

/* --- Form input: Better focus glow --- */
.form-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.12), 0 0 20px rgba(8,145,178,0.06);
}

/* --- Reduced motion: Disable all enhancements --- */
@media (prefers-reduced-motion: reduce) {
  .stat-card, .card, .finding-card, .integration-card, .btn-primary,
  .activity-item, .nav-item, .timeline-bar, .bar-chart-fill {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  #login-screen::before { animation: none !important; }
  .chip.critical .chip-dot, .chip.flagged .chip-dot { animation: none !important; }
}
