/* =============================================
   Neoxis — Design System
   ============================================= */

/* ---- Design Tokens ---- */
:root {
  --primary: #146356;
  --primary-dark: #0F4B41;
  --primary-light: #E3F1EE;
  --primary-50: #F2F8F7;
  --primary-100: #D7EAE6;
  --primary-600: #146356;
  --primary-700: #0F4B41;
  --primary-800: #0B3A32;
  --accent: #C6741F;
  --accent-light: #FBEEE3;
  --success: #1F8A4C;
  --success-light: #EAF7EF;
  --warning: #B45309;
  --warning-light: #FEF3E2;
  --error: #B42318;
  --error-light: #FDEDEB;
  --bg: #F6F7F5;
  --card: #ffffff;
  --text: #16191C;
  --text-muted: #5B6570;
  --text-light: #939CA6;
  --border: #E2E5E1;
  --border-light: #EEF0EE;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(15,23,20,0.06);
  --shadow-md: 0 2px 8px rgba(15,23,20,0.08);
  --shadow-lg: 0 8px 24px rgba(15,23,20,0.10);
  --shadow-xl: 0 16px 40px rgba(15,23,20,0.14);
  --glass: rgba(255,255,255,0.85);
  --glass-border: rgba(255,255,255,0.4);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --bg: #12171A;
  --card: #1B2124;
  --text: #F1F3F2;
  --text-muted: #9AA3A8;
  --text-light: #6B7378;
  --border: #313A3E;
  --border-light: #1F2629;
  --glass: rgba(27,33,36,0.85);
  --glass-border: rgba(49,58,62,0.5);
  --primary-light: #0F332C;
  --primary-50: #0A2622;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* ---- Global ---- */
* { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-normal), color var(--transition-normal);
}

/* ---- Container — centered max-width ---- */
.container,
main.container {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes circleProgress { from { stroke-dashoffset: 283; } }
@keyframes spin { to { transform: rotate(360deg); } }

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

.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 20px; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 120px; }

/* =============================================
   LOGIN PAGE — Premium 2026
   ============================================= */
#view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #0B3A32, #146356, #2BAE94, #0F4B41);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
}

/* Animated orbs background */
#view-login::before,
#view-login::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 8s ease-in-out infinite;
}

#view-login::before {
  width: 400px; height: 400px;
  background: #2BAE94;
  top: -100px; left: -100px;
}

#view-login::after {
  width: 300px; height: 300px;
  background: #7FCBBA;
  bottom: -80px; right: -80px;
  animation-delay: -4s;
}

.login-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.5s ease both;
  position: relative;
  z-index: 1;
}

.login-card h1 {
  font-family: var(--font);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 16px 0 8px;
}

.login-card > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-logo svg {
  width: 40px;
  height: 40px;
  color: var(--primary);
  filter: drop-shadow(0 4px 12px rgba(20,99,86,0.3));
}

/* Empty state SVG size */
.empty-state svg {
  width: 80px;
  height: 80px;
}

.auth-tabs {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px;
  margin: 24px 0 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.google-btn {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all var(--transition-fast);
}

.google-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.email-submit-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: white;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.email-submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5,150,105,0.4);
}

/* Ripple effect */
.email-submit-btn::after, .btn-primary::after, .google-btn::after {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
}

.email-submit-btn:active::after, .btn-primary:active::after {
  animation: ripple 0.6s linear;
}

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  background: white;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(5,150,105,0.1);
}

/* =============================================
   NAVBAR — Dark Slate
   ============================================= */
#app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: #14191C;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand svg { width: 22px; height: 22px; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  padding: 3px;
  border-radius: var(--radius-full);
}

.nav-link {
  padding: 7px 18px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.08); }

.nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}

/* ---- Nav User ---- */
#nav-user-section { position: relative; }

.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-user-trigger:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }

.nav-avatar, .nav-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-avatar-placeholder {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-user-name {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credits-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px; height: 24px;
  padding: 0 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font);
}

.credits-badge.credits-zero { background: var(--error-light); color: var(--error); }

/* ---- Profile Panel ---- */
.nav-user-dropdown {
  position: fixed;
  top: 0; right: -380px;
  width: 360px; height: 100vh;
  background: var(--card);
  box-shadow: var(--shadow-xl);
  z-index: 10000;
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-user-dropdown.open { right: 0; }

.nav-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.nav-panel-backdrop.active { opacity: 1; pointer-events: auto; }

.nav-dropdown-header {
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-dropdown-avatar img, .nav-dropdown-avatar-ph {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-dropdown-avatar-ph {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.nav-dropdown-name { font-family: var(--font); font-size: 1.05rem; font-weight: 700; }
.nav-dropdown-email { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.nav-dropdown-divider { height: 1px; background: var(--border); }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
}

.nav-dropdown-item-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.nav-dropdown-item-value { font-size: 0.9rem; font-weight: 600; color: var(--text); }

.nav-credits-gauge { width: 100%; padding: 16px 24px 20px; border-bottom: 1px solid var(--border-light); }
.nav-credits-gauge-label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.nav-credits-gauge-bar { height: 8px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden; }
.nav-credits-gauge-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: var(--radius-full); transition: width var(--transition-normal); }
.nav-credits-gauge-fill.low { background: linear-gradient(90deg, var(--warning), var(--error)); }

.nav-role-badge { padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.nav-role-user { background: var(--border-light); color: var(--text-muted); }
.nav-role-manager { background: #DBEAFE; color: #1E40AF; }
.nav-role-admin { background: #D7EAE6; color: #0F4B41; }
.nav-role-super_admin { background: linear-gradient(135deg, #FDE68A, #FCA5A5); color: #92400E; }

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.nav-dropdown-btn:hover { background: var(--border-light); }
.nav-dropdown-btn svg { color: var(--text-muted); flex-shrink: 0; }

.nav-dropdown-logout { color: var(--error) !important; margin-top: auto; border-top: 1px solid var(--border); }
.nav-dropdown-logout:hover { background: var(--error-light) !important; }
.nav-dropdown-logout svg { color: var(--error) !important; }

.nav-panel-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  z-index: 1;
}

.nav-panel-close:hover { background: rgba(0,0,0,0.1); color: var(--text); }

/* Profile fields */
.nav-profile-field { margin-bottom: 10px; }
.nav-profile-field label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.nav-profile-field input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font); font-size: 0.85rem; color: var(--text); background: var(--border-light); transition: all var(--transition-fast); box-sizing: border-box; }
.nav-profile-field input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(5,150,105,0.1); }
.nav-profile-save { width: 100%; padding: 10px; border: none; border-radius: var(--radius-md); background: var(--primary); color: white; font-family: var(--font); font-weight: 600; font-size: 0.85rem; cursor: pointer; margin-top: 8px; transition: all var(--transition-fast); }
.nav-profile-save:hover { background: var(--primary-dark); }

/* =============================================
   CARDS — Modern with subtle depth
   ============================================= */
.match-card, .search-card, .dash-project-card, .stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.match-card:hover, .dash-project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* 3D hover effect */
.match-card-grid {
  animation: slideInUp var(--transition-normal) ease both;
  perspective: 1000px;
}

.match-card-grid:nth-child(2) { animation-delay: 60ms; }
.match-card-grid:nth-child(3) { animation-delay: 120ms; }
.match-card-grid:nth-child(4) { animation-delay: 180ms; }
.match-card-grid:nth-child(5) { animation-delay: 240ms; }
.match-card-grid:nth-child(6) { animation-delay: 300ms; }

/* ---- Score Badge (keep comparison.css styling) ---- */
/* score-badge-grid styles are in styles-comparison.css */

/* ---- Source Card ---- */
.source-card {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border: 1px solid #BFE0D8;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* ---- Glassmorphism Overlays ---- */
.global-loading-overlay {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-loading-content {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--glass-border);
}

.global-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.7s linear infinite;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--primary);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 700;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(20, 99, 86, 0.35);
  transform: translateY(-2px);
}

/* ---- Recent Searches ---- */
.dash-recent-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.dash-recent-title { padding: 16px 20px 12px; font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; border-bottom: 1px solid var(--border-light); }

.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dash-recent-item:last-child { border-bottom: none; }
.dash-recent-item:hover { background: var(--border-light); }
.dash-recent-query { font-weight: 600; font-size: 0.88rem; flex: 1; }
.dash-recent-date { font-size: 0.75rem; color: var(--text-light); }
.dash-recent-score { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full); }

/* ---- Empty State ---- */
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.5s ease;
}

.dash-empty svg {
  width: 64px; height: 64px;
  color: var(--text-light);
  opacity: 0.4;
  margin-bottom: 16px;
}

.dash-empty h3 {
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.dash-empty p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto 20px;
}

/* ---- Toast ---- */
.toast-notification {
  animation: slideInUp var(--transition-normal) ease both !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: blur(8px);
  font-family: var(--font) !important;
}

/* ---- Dark mode toggle ---- */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition-fast);
}

.dark-mode-toggle:hover { background: var(--border-light); }

.dark-mode-switch {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.dark-mode-switch::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .dark-mode-switch {
  background: var(--primary);
}

[data-theme="dark"] .dark-mode-switch::after {
  transform: translateX(18px);
}

/* =============================================
   RESPONSIVE — Mobile Bottom Bar
   ============================================= */
@media (max-width: 768px) {
  #app-navbar {
    position: fixed;
    bottom: 0; top: auto;
    left: 0; right: 0;
    height: 60px;
    padding: 0;
    border-top: 1px solid var(--border);
    border-bottom: none;
    z-index: 1000;
  }

  .nav-brand { display: none; }

  .nav-links {
    flex: 1;
    justify-content: center;
    background: transparent;
    padding: 0;
    gap: 0;
  }

  .nav-link {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 0.72rem;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .nav-user-trigger { padding: 8px 12px; }
  .nav-user-name, .nav-chevron { display: none; }
  .nav-user-dropdown { width: 100%; right: -100%; }
  .nav-user-dropdown.open { right: 0; }
  body { padding-bottom: 68px; }
}

/* =============================================
   ADDITIONS — Nav, Sub-nav, Login, Loading
   ============================================= */

/* Nav user name in dark navbar */
.nav-user-name { color: rgba(255,255,255,0.9); }
.credits-badge { background: rgba(165,180,252,0.2); color: #BFE0D8; }
.credits-badge.credits-zero { background: rgba(239,68,68,0.2); color: #FCA5A5; }

/* Search Sub-Navbar */
.search-subnav {
  position: sticky;
  top: 56px;
  z-index: 999;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.subnav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 28px;
}
.subnav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: white;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
  flex-shrink: 0;
}
.subnav-back:hover { background: var(--border-light); color: var(--text); }
.subnav-tabs {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-full);
}
.subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
  white-space: nowrap;
}
.subnav-tab svg { flex-shrink: 0; opacity: 0.5; width: 15px; height: 15px; }
.subnav-tab:hover { background: #e2e8f0; color: #334155; }
.subnav-tab:hover svg { opacity: 0.7; }
.subnav-tab.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(20,99,86,0.25);
}
.subnav-tab.active svg { opacity: 1; }

/* Legacy hidden */
.search-mode-tabs { display: none !important; }
.search-back-btn { display: none !important; }
#search-breadcrumb { display: none !important; }
#search-mode-chooser { display: none !important; }

/* Global loading overlay */
.global-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.global-loading-overlay.active { display: flex; }
.global-loading-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

/* Login V3 card styles */
.login-card-v3 {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.25);
  animation: scaleIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.login-bg {
  position: absolute;
  inset: 0;
  background: #12171A;
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.28; }
.login-orb-1 { width: 500px; height: 500px; background: #2BAE94; top: -15%; right: -10%; animation: float 12s ease-in-out infinite; }
.login-orb-2 { width: 400px; height: 400px; background: #E8A33D; bottom: -10%; left: -8%; animation: float 10s ease-in-out infinite reverse; }
.login-card-logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: var(--primary); }
.login-card-logo svg { width: 44px; height: 44px; }
.login-card-title { font-family: var(--font); font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; margin: 0 0 4px; }
.login-card-subtitle { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 32px; }
.login-card-form { display: flex; flex-direction: column; gap: 20px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.login-field input { padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.95rem; font-family: var(--font); color: var(--text); transition: all 150ms; background: white; }
.login-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,99,86,0.08); }
.login-field input::placeholder { color: var(--text-light); }
.login-error { padding: 10px 14px; background: var(--error-light); border: 1px solid #FCA5A5; border-radius: 8px; font-size: 0.82rem; color: var(--error); }
.login-submit-btn-v3 { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; border-radius: 10px; background: var(--primary); color: white; font-family: var(--font); font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 150ms; margin-top: 4px; }
.login-submit-btn-v3:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(20,99,86,0.3); transform: translateY(-1px); }
.login-submit-btn-v3:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.login-submit-btn-v3:disabled { opacity: 0.5; cursor: not-allowed; }
.login-card-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; font-size: 0.78rem; color: var(--text-light); }

/* ---- Results cleanup ---- */
.analysis-section { display: none; }

.results-with-sidebar {
  display: block;
}

.filters-sidebar {
  display: none;
}

.results-main-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filters-toggle-btn { display: none; }

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

.results {
  margin-top: 16px;
}

/* Buttons — export/save */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
}
.btn-export:hover { background: var(--border-light); color: var(--text); }
.btn-export svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Grid gap tuning */
.results-grid-horizontal {
  gap: 16px !important;
}

/* Cards — breathing room */
.cert-card-grid {
  border-radius: var(--radius-lg) !important;
  border-width: 1px !important;
  border-left-width: 3px !important;
}

.cert-body-grid h4 {
  font-size: 0.92rem !important;
  min-height: 48px !important;
  line-height: 1.4 !important;
}

.cert-body-grid {
  padding: 14px 16px !important;
}

.cert-header-grid {
  padding: 10px 14px !important;
}

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

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .subnav-inner { padding: 6px 12px; gap: 8px; }
  .subnav-tab { padding: 6px 12px; font-size: 0.78rem; gap: 4px; }
  .subnav-tab svg { width: 13px; height: 13px; }
  .login-card-v3 { margin: 16px; padding: 36px 28px; border-radius: 20px; }
  .container, main.container { padding-left: 12px; padding-right: 12px; }
}
