/* ============================================================
   Global CBRN Benchmark — Design System
   Ported from Manus React/shadcn/Tailwind frontend
   ============================================================ */

/* --- CSS Variables (Green + Light theme) --- */
:root {
  --radius: 0.5rem;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --primary: #059669;
  --primary-fg: #ffffff;
  --primary-light: #d1fae5;
  --primary-hover: #047857;
  --background: #f0fdf4;
  --foreground: #1a2e1a;
  --card: #ffffff;
  --card-fg: #1a2e1a;
  --muted: #ecfdf5;
  --muted-fg: #4b6b5a;
  --border: #d1e7dd;
  --input: #d1e7dd;
  --destructive: #dc2626;
  --sidebar-bg: #065f46;
  --sidebar-fg: #d1fae5;
  --sidebar-primary: #34d399;
  --sidebar-accent: #047857;
  --sidebar-border: #047857;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 3px rgba(5,150,105,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
h1, h2 { font-family: var(--font-serif); letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   LAYOUT: Dark sidebar + light content
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px; min-height: 100vh; background: var(--sidebar-bg);
  display: flex; flex-direction: column; position: fixed; left: 0; top: 0; z-index: 40;
  transition: width 0.2s ease, transform 0.2s ease; overflow: hidden;
  border-right: none;
}
.sidebar.collapsed { width: 56px; }
.sidebar-header {
  height: 64px; display: flex; align-items: center; padding: 0 12px; gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-toggle {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; color: var(--sidebar-fg);
  opacity: 0.6; transition: all 0.15s; flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--sidebar-accent); opacity: 1; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sidebar-brand-icon { color: var(--sidebar-primary); flex-shrink: 0; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-name {
  font-size: 14px; font-weight: 600; color: var(--sidebar-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.3;
}
.sidebar-brand-sub {
  font-size: 10px; color: var(--sidebar-fg); opacity: 0.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.3;
}
.sidebar.collapsed .sidebar-brand { display: none; }

/* Sidebar nav */
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--sidebar-fg); opacity: 0.4; padding: 12px 12px 6px; display: block;
}
.sidebar.collapsed .sidebar-section-label { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--sidebar-fg); opacity: 0.8;
  transition: all 0.15s; font-weight: 400; white-space: nowrap; border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-accent); opacity: 1; }
.nav-item.active { background: var(--sidebar-accent); opacity: 1; font-weight: 500; }
.nav-item.active .nav-icon { color: var(--sidebar-primary); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px;
  transition: background 0.15s; cursor: default;
}
.sidebar-user:hover { background: var(--sidebar-accent); }
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--sidebar-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white; flex-shrink: 0;
  border: 1px solid var(--sidebar-border);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 500; color: var(--sidebar-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.sidebar-user-role {
  font-size: 11px; color: var(--sidebar-fg); opacity: 0.5; line-height: 1.3;
}
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--destructive); background: none; border: none;
  width: 100%; text-align: left; transition: background 0.15s; margin-top: 6px;
  cursor: pointer; opacity: 0.8;
}
.sidebar-logout:hover { background: rgba(220,38,38,0.08); opacity: 1; }
.sidebar.collapsed .sidebar-logout span { display: none; }

/* Sidebar overlay (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 35; }
.sidebar-overlay.active { display: block; }

/* Main content */
.main-content {
  flex: 1; margin-left: 260px; min-height: 100vh;
  transition: margin-left 0.2s ease;
}
.sidebar.collapsed ~ .main-content { margin-left: 56px; }
.main-inner { padding: 24px; max-width: 1400px; }

/* Mobile header */
.mobile-header {
  display: none; height: 56px; align-items: center; justify-content: space-between;
  padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.mobile-header-title { font-weight: 500; font-size: 15px; }

/* ============================================================
   COMPONENTS: Cards, Badges, Buttons, Forms, Tables
   ============================================================ */

/* Card */
.card {
  background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow-card); border: none;
}
.card-pad { padding: 20px; }
.card-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--foreground);
  padding: 20px 20px 0;
}
.card-header-icon { width: 16px; height: 16px; color: var(--primary); }
.card-header-right { margin-left: auto; }
.card-content { padding: 16px 20px 20px; }
.card-content:first-child { padding-top: 20px; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px;
  font-size: 11px; font-weight: 600; border: 1px solid; white-space: nowrap;
}
.badge-platinum { background: rgba(168,85,247,0.15); color: #a855f7; border-color: rgba(168,85,247,0.3); }
.badge-gold { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.badge-silver { background: rgba(100,116,139,0.15); color: #94a3b8; border-color: rgba(100,116,139,0.3); }
.badge-bronze { background: rgba(249,115,22,0.15); color: #f97316; border-color: rgba(249,115,22,0.3); }
.badge-defence { background: rgba(59,130,246,0.15); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
.badge-civilian { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.3); }
.badge-opcw { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: rgba(139,92,246,0.3); }
.badge-bsl4 { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.badge-outline { background: transparent; color: var(--muted-fg); border-color: var(--border); }
.badge-primary { background: rgba(5,150,105,0.1); color: var(--primary); border-color: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s;
  line-height: 1.4;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost { background: transparent; color: var(--muted-fg); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.btn-outline { background: var(--card); color: var(--foreground); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-danger { background: transparent; color: var(--destructive); }
.btn-danger:hover { background: rgba(220,38,38,0.06); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { width: 28px; height: 28px; padding: 0; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.15s;
  background: var(--background); color: var(--foreground);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,150,105,0.15); }
.input-icon { padding-left: 36px; }
.select {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: var(--card); color: var(--foreground);
  cursor: pointer; outline: none; min-width: 140px; height: 36px;
}
.select:focus { border-color: var(--primary); }
.textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; resize: vertical; min-height: 60px;
  background: var(--background); color: var(--foreground);
}
.textarea:focus { border-color: var(--primary); }
.label { display: block; font-size: 12px; font-weight: 500; color: var(--foreground); margin-bottom: 4px; }

/* Data Table */
.data-table { width: 100%; font-size: 13px; }
.data-table th {
  text-align: left; padding: 8px 12px; font-weight: 500; color: var(--muted-fg);
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--muted); }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover td { background: rgba(0,0,0,0.02); }
.data-table tbody tr.clickable { cursor: pointer; }

/* Tabs */
.tabs-list {
  display: inline-flex; gap: 4px; background: var(--muted); padding: 4px;
  border-radius: 10px;
}
.tab-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--muted-fg); transition: all 0.15s;
  border: none; background: none;
}
.tab-trigger.active { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.tab-trigger:hover:not(.active) { color: var(--foreground); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Progress bar */
.progress { height: 8px; border-radius: 4px; background: var(--muted); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-sm { height: 6px; }

/* Modal / Dialog */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--card); border-radius: 16px; padding: 24px;
  max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: scaleIn 0.15s ease;
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: toastIn 0.3s ease;
}
.toast-success { background: #059669; color: white; }
.toast-error { background: var(--destructive); color: white; }
@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Stat card icon container */
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ============================================================
   PAGE: Login
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--background); padding: 16px; position: relative;
}
.login-grid-bg {
  position: absolute; inset: 0; opacity: 0.25; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 4rem 4rem;
}
.login-wrapper { position: relative; width: 100%; max-width: 420px; }
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px;
}
.login-logo-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(5,150,105,0.1); border: 1px solid rgba(5,150,105,0.2);
  display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.login-logo-text { text-align: left; }
.login-logo-title { font-size: 22px; font-weight: 700; color: var(--foreground); letter-spacing: 0.01em; }
.login-logo-subtitle {
  font-size: 10px; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.2em;
}
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}
.login-card-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.login-card-sub { font-size: 13px; color: var(--muted-fg); margin-bottom: 24px; }
.login-field { position: relative; margin-bottom: 20px; }
.login-field-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-fg);
}
.login-error {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px;
  background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.15);
  color: var(--destructive); font-size: 13px; margin-bottom: 16px;
}
.login-submit {
  width: 100%; padding: 10px; border-radius: 8px; background: var(--primary);
  color: white; border: none; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: filter 0.15s;
}
.login-submit:hover { filter: brightness(1.15); }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center; font-size: 11px; color: var(--muted-fg);
}
.login-notice { margin-top: 16px; text-align: center; font-size: 11px; color: var(--muted-fg); opacity: 0.6; }

/* ============================================================
   GLOBAL: Smooth Page Transitions & Elevated Motion
   ============================================================ */
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.main-inner { animation: pageSlideIn 0.45s cubic-bezier(0.23, 1, 0.32, 1); }
.card { transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04); }
.nav-item { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* ============================================================
   PAGE: Dashboard / Home
   ============================================================ */
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
}
.page-title-icon { width: 24px; height: 24px; color: var(--primary); }
.page-subtitle { color: var(--muted-fg); font-size: 14px; margin-top: 4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card-content { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 13px; color: var(--muted-fg); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; line-height: 1.1; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.top-facility-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; background: var(--muted); cursor: pointer;
  transition: all 0.15s;
}
.top-facility-row:hover { filter: brightness(0.97); }
.top-rank { font-size: 13px; font-weight: 700; color: var(--muted-fg); width: 24px; text-align: center; font-variant-numeric: tabular-nums; }

/* ============================================================
   HOME PAGE: Elevated Hero + Domain-First Layout
   ============================================================ */
.hp { }

/* ── HERO BANNER — Cinematic Dark Gradient ── */
.hp-hero {
  position: relative; border-radius: 24px; overflow: hidden;
  margin-bottom: 32px; min-height: 280px;
  background: linear-gradient(135deg, #0c1220 0%, #0f172a 25%, #064e3b 55%, #065f46 100%);
}
.hp-hero-aurora {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(5,150,105,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 25%, rgba(52,211,153,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 55% 80%, rgba(124,58,237,0.08) 0%, transparent 40%);
  animation: hpAuroraShift 12s ease-in-out infinite alternate;
}
@keyframes hpAuroraShift {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
.hp-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hp-hero-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(60px);
}
.hp-hero-orb1 {
  width: 300px; height: 300px; top: -80px; right: -60px;
  background: radial-gradient(circle, rgba(52,211,153,0.15), transparent 70%);
  animation: hpOrb1 15s ease-in-out infinite alternate;
}
.hp-hero-orb2 {
  width: 200px; height: 200px; bottom: -60px; left: 20%;
  background: radial-gradient(circle, rgba(124,58,237,0.12), transparent 70%);
  animation: hpOrb2 12s ease-in-out infinite alternate-reverse;
}
@keyframes hpOrb1 { 0% { transform: translate(0,0); } 100% { transform: translate(-30px, 20px); } }
@keyframes hpOrb2 { 0% { transform: translate(0,0); } 100% { transform: translate(20px, -15px); } }

.hp-hero-inner {
  position: relative; z-index: 1; padding: 48px 44px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.hp-hero-text { flex: 1; min-width: 340px; }
.hp-hero-badges { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.hp-badge-v {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #d1fae5;
  background: rgba(255,255,255,0.08); backdrop-filter: blur(12px);
  padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
}
.hp-badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; color: #34d399;
  background: rgba(52,211,153,0.08); padding: 6px 14px; border-radius: 20px;
  letter-spacing: 0.08em; border: 1px solid rgba(52,211,153,0.2);
}
.hp-pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; animation: hpPulse 2s ease-in-out infinite;
}
@keyframes hpPulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

.hp-hero-h1 {
  font-size: 44px; font-weight: 900; color: #fff; margin: 0 0 14px;
  font-family: var(--font-serif); line-height: 1.08;
  letter-spacing: -0.02em;
}
.hp-hero-accent {
  background: linear-gradient(135deg, #34d399 0%, #a78bfa 50%, #67e8f9 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hp-hero-p {
  font-size: 15px; color: rgba(255,255,255,0.6); line-height: 1.8;
  max-width: 540px; margin: 0;
}
.hp-hero-p strong { color: rgba(255,255,255,0.9); }

/* Hero Stats — Glass KPI Cards */
.hp-hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hp-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 96px; padding: 18px 10px 14px; border-radius: 18px;
  background: rgba(255,255,255,0.06); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), background 0.3s, box-shadow 0.3s;
  animation: hpStatIn 0.5s ease both;
}
@keyframes hpStatIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: none; } }
.hp-stat:hover {
  transform: translateY(-6px) scale(1.04);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.hp-stat-ic { margin-bottom: 2px; }
.hp-stat-ic .icon { width: 16px; height: 16px; }
.hp-stat-num { font-size: 26px; font-weight: 900; color: #fff; line-height: 1; font-family: var(--font-serif); }
.hp-stat-label { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Section Headers ── */
.hp-section-head { margin-bottom: 20px; padding-top: 8px; }
.hp-sh-title {
  font-size: 18px; font-weight: 800; color: var(--foreground);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
}
.hp-sh-title .icon { width: 20px; height: 20px; color: var(--primary); }
.hp-sh-sub { font-size: 13px; color: var(--muted-fg); margin-top: 4px; }

/* ── 6 DOMAIN CARDS — The Cornerstone ── */
.hp-domain-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-bottom: 36px;
}
.hp-dcard {
  border-radius: 18px; overflow: hidden; cursor: pointer;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), box-shadow 0.35s;
  animation: hpDCardIn 0.5s ease both;
  position: relative;
}
@keyframes hpDCardIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.hp-dcard:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.hp-dcard-glow {
  position: absolute; inset: -1px; border-radius: 18px;
  background: var(--dpg); opacity: 0;
  transition: opacity 0.4s; z-index: 0;
}
.hp-dcard:hover .hp-dcard-glow { opacity: 0.08; }

.hp-dcard-header {
  position: relative; padding: 20px; min-height: 90px; overflow: hidden;
}
.hp-dcard-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(255,255,255,0.12), transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(255,255,255,0.06), transparent 40%);
  pointer-events: none;
}
.hp-dcard-h-inner {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px;
}
.hp-dcard-emoji { font-size: 28px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); flex-shrink: 0; }
.hp-dcard-h-text { flex: 1; min-width: 0; }
.hp-dcard-key {
  font-size: 14px; font-weight: 900; color: #fff; letter-spacing: 0.04em;
  display: block; text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.hp-dcard-role {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em; display: block; margin-top: 2px;
}
.hp-dcard-weight {
  position: relative; width: 48px; height: 48px; flex-shrink: 0;
}
.hp-dcard-ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.hp-dcard-wpct {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 12px; font-weight: 900; color: #fff;
}

.hp-dcard-body {
  padding: 16px 20px 18px; background: var(--card); position: relative; z-index: 1;
}
.hp-dcard-name {
  font-size: 13px; font-weight: 700; color: var(--foreground); margin-bottom: 6px;
  line-height: 1.3;
}
.hp-dcard-desc {
  font-size: 12px; color: var(--muted-fg); line-height: 1.6; margin-bottom: 10px;
}
.hp-dcard-footer {
  display: flex; align-items: center; justify-content: flex-end;
}
.hp-dcard-link {
  font-size: 11px; font-weight: 700; color: var(--dpc, var(--primary));
  display: inline-flex; align-items: center; gap: 4px;
  transition: gap 0.2s;
}
.hp-dcard:hover .hp-dcard-link { gap: 8px; }
.hp-dcard-link .icon { width: 12px; height: 12px; }

/* ── Performance Overview: Two-col panels ── */
.hp-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.hp-panel {
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-card); border: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.hp-panel:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.hp-panel-head {
  padding: 16px 20px; font-size: 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border); color: var(--foreground);
}
.hp-panel-head .icon { width: 16px; height: 16px; color: var(--primary); }
.hp-panel-body { padding: 16px 20px; }

.hp-tier-row { margin-bottom: 14px; }
.hp-tier-row:last-child { margin-bottom: 0; }
.hp-tier-info {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.hp-tier-em { font-size: 16px; }
.hp-tier-ct { font-size: 12px; color: var(--muted-fg); margin-left: auto; font-variant-numeric: tabular-nums; }

.hp-top-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 6px;
}
.hp-top-row:last-child { margin-bottom: 0; }
.hp-top-row:hover { background: var(--muted); transform: translateX(4px); }
[dir="rtl"] .hp-top-row:hover { transform: translateX(-4px); }
.hp-top-left { display: flex; align-items: center; gap: 10px; }
.hp-top-rank {
  font-size: 14px; font-weight: 800; color: var(--primary); width: 28px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.hp-top-name { font-size: 13px; font-weight: 600; color: var(--foreground); }
.hp-top-country { font-size: 11px; color: var(--muted-fg); }
.hp-top-right { display: flex; align-items: center; gap: 8px; }
.hp-top-ues { font-size: 13px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ── Quick Actions ── */
.hp-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 8px;
}
.hp-action {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: hpActionIn 0.4s ease both;
}
@keyframes hpActionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hp-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
}
.hp-action-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.hp-action-ic .icon { width: 18px; height: 18px; }
.hp-action-text { flex: 1; min-width: 0; }
.hp-action-label { font-size: 13px; font-weight: 700; color: var(--foreground); display: block; }
.hp-action-sub { font-size: 11px; color: var(--muted-fg); display: block; margin-top: 2px; }
.hp-action-arrow { color: var(--muted-fg); transition: transform 0.2s; }
.hp-action-arrow .icon { width: 14px; height: 14px; }
.hp-action:hover .hp-action-arrow { transform: translateX(3px); color: var(--primary); }
[dir="rtl"] .hp-action:hover .hp-action-arrow { transform: translateX(-3px); }

/* ── Home Page Responsive ── */
@media (max-width: 1100px) {
  .hp-domain-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hp-hero-inner { flex-direction: column; padding: 32px 24px; gap: 28px; }
  .hp-hero-h1 { font-size: 32px; }
  .hp-hero-stats { width: 100%; justify-content: center; }
  .hp-domain-grid { grid-template-columns: 1fr; }
  .hp-two-col { grid-template-columns: 1fr; }
  .hp-actions { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hp-hero-h1 { font-size: 26px; }
  .hp-stat { width: 76px; padding: 14px 8px 10px; }
  .hp-stat-num { font-size: 22px; }
}

/* ============================================================
   LOGIN PAGE: Elevated Design with Aurora + Orbs
   ============================================================ */
.login-aurora {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(5,150,105,0.08), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.06), transparent 45%);
  animation: loginAurora 10s ease-in-out infinite alternate;
}
@keyframes loginAurora { 0% { opacity: 0.6; } 100% { opacity: 1; } }
.login-orb {
  position: absolute; border-radius: 50%; pointer-events: none; filter: blur(80px);
}
.login-orb1 {
  width: 250px; height: 250px; top: 10%; left: 5%;
  background: rgba(5,150,105,0.08);
  animation: loginOrb1 18s ease-in-out infinite alternate;
}
.login-orb2 {
  width: 200px; height: 200px; bottom: 10%; right: 10%;
  background: rgba(124,58,237,0.06);
  animation: loginOrb2 14s ease-in-out infinite alternate-reverse;
}
.login-orb3 {
  width: 150px; height: 150px; top: 60%; left: 50%;
  background: rgba(52,211,153,0.05);
  animation: loginOrb3 16s ease-in-out infinite alternate;
}
@keyframes loginOrb1 { 0% { transform: translate(0,0); } 100% { transform: translate(40px,-20px); } }
@keyframes loginOrb2 { 0% { transform: translate(0,0); } 100% { transform: translate(-30px,25px); } }
@keyframes loginOrb3 { 0% { transform: translate(0,0); } 100% { transform: translate(15px,-30px); } }

.login-tagline {
  font-size: 13px; color: var(--muted-fg); margin-top: 8px; letter-spacing: 0.02em;
}
.login-domains-strip {
  display: flex; gap: 6px; margin-top: 16px; justify-content: center; flex-wrap: wrap;
}
.login-domain-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: rgba(5,150,105,0.08); border: 1px solid rgba(5,150,105,0.15);
  transition: all 0.25s;
}
.login-domain-chip:hover {
  background: rgba(5,150,105,0.15); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5,150,105,0.1);
}
.login-card-glow {
  position: absolute; top: -40px; right: -40px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(5,150,105,0.06), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.login-card { position: relative; overflow: hidden; }
.login-lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted-fg); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.login-lang-btn:hover { background: var(--muted); color: var(--foreground); }

/* ============================================================
   PAGE: Facilities list
   ============================================================ */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.filter-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-fg);
}
.facility-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.facility-card {
  cursor: pointer; transition: box-shadow 0.15s;
}
.facility-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.facility-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; transition: color 0.15s; }
.facility-card:hover .facility-card-name { color: var(--primary); }
.facility-card-loc {
  font-size: 12px; color: var(--muted-fg); display: flex; align-items: center; gap: 4px; margin-bottom: 10px;
}
.facility-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.facility-card-ues { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ============================================================
   PAGE: Facility Detail
   ============================================================ */
.detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.detail-nav-btns { display: flex; align-items: center; gap: 8px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.detail-tier-box {
  padding: 12px 20px; border-radius: 12px; border: 1px solid; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.detail-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.detail-full-col { grid-column: 1 / -1; }
.domain-score-row { margin-bottom: 12px; }
.domain-score-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.domain-score-label { font-size: 13px; font-weight: 600; }
.domain-score-sublabel { font-size: 12px; color: var(--muted-fg); margin-left: 8px; }
.domain-score-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.justification-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.justification-card {
  padding: 16px; border-radius: 10px; background: var(--muted);
  border: 1px solid var(--border); opacity: 0.85;
}
.justification-card-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.justification-text { font-size: 13px; color: var(--muted-fg); line-height: 1.6; }

/* Radar chart (SVG) */
.radar-label { font-size: 12px; font-weight: 600; fill: #64748b; }

/* ============================================================
   PAGE: Benchmarking — bar charts via HTML/CSS
   ============================================================ */
.bar-chart { padding: 8px 0; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bar-label { width: 160px; font-size: 12px; color: var(--muted-fg); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.bar-track { flex: 1; height: 20px; background: var(--muted); border-radius: 0 4px 4px 0; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; transition: width 0.5s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.bar-fill span { font-size: 11px; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.bar-chart-vertical { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 0 20px; }
.bar-v-item { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar-v-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height 0.5s ease; min-width: 32px; max-width: 48px; }
.bar-v-label { font-size: 12px; font-weight: 600; color: var(--muted-fg); margin-top: 6px; }
.bar-v-value { font-size: 11px; font-weight: 700; margin-bottom: 4px; }

/* ============================================================
   PAGE: Standards & Framework
   ============================================================ */
.tier-group-badge-1 { background: rgba(59,130,246,0.12); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
.tier-group-badge-2 { background: rgba(16,185,129,0.12); color: #10b981; border-color: rgba(16,185,129,0.3); }
.tier-group-badge-3 { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.tier-group-badge-4 { background: rgba(168,85,247,0.12); color: #a855f7; border-color: rgba(168,85,247,0.3); }
.tier-group-badge-5 { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.tier-group-badge-6 { background: rgba(100,116,139,0.12); color: #94a3b8; border-color: rgba(100,116,139,0.3); }

/* Framework section */
.framework-block {
  padding: 16px; border-radius: 10px; background: var(--muted); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.framework-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.formula-box {
  padding: 16px; border-radius: 10px; background: var(--muted); border: 1px solid var(--border);
  font-family: 'Courier New', monospace; text-align: center; font-size: 16px; margin: 16px 0;
}
.separator { height: 1px; background: var(--muted); margin: 20px 0; }

/* ============================================================
   PAGE: Domain Matrix
   ============================================================ */
.heatmap-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.heatmap-0 { background: transparent; color: var(--muted-fg); opacity: 0.4; }
.heatmap-1 { background: rgba(5,150,105,0.12); color: var(--foreground); }
.heatmap-2 { background: rgba(5,150,105,0.25); color: var(--foreground); }
.heatmap-3 { background: rgba(5,150,105,0.4); color: white; }
.heatmap-4 { background: rgba(5,150,105,0.6); color: white; }
.domain-badge-TLEI { background: rgba(139,92,246,0.15); color: #8b5cf6; border-color: rgba(139,92,246,0.35); }
.domain-badge-CEI { background: rgba(6,182,212,0.15); color: #06b6d4; border-color: rgba(6,182,212,0.35); }
.domain-badge-RTDI { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.domain-badge-RNDI { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.domain-badge-QMSEI { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.35); }
.domain-badge-GOSEI { background: rgba(236,72,153,0.15); color: #ec4899; border-color: rgba(236,72,153,0.35); }
.domain-badge-REI { background: rgba(59,130,246,0.15); color: #3b82f6; border-color: rgba(59,130,246,0.35); }
.domain-badge-BEI { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.35); }
.domain-badge-ETCI { background: rgba(244,63,94,0.15); color: #f43f5e; border-color: rgba(244,63,94,0.35); }
.domain-badge-ORM { background: rgba(244,63,94,0.15); color: #f43f5e; border-color: rgba(244,63,94,0.35); }

/* ============================================================
   PAGE: Executive Cards — Premium Redesign v3
   Glass morphism, enhanced hierarchy, micro-interactions
   ============================================================ */

/* ── Page Header ── */
.exec-page-header {
  display:flex; align-items:flex-end; justify-content:space-between; gap:16px;
  margin-bottom:24px; padding-bottom:20px; border-bottom:1px solid var(--border);
}
.exec-page-title { font-size:24px; font-weight:800; letter-spacing:-0.02em; display:flex; align-items:center; gap:10px; }
.exec-page-title .icon { width:28px; height:28px; color:var(--primary); }
.exec-page-subtitle { font-size:13px; color:var(--muted-fg); margin-top:4px; }
.exec-page-stats { display:flex; gap:16px; flex-shrink:0; }
.exec-page-stat {
  text-align:center; padding:8px 16px; border-radius:12px;
  background:var(--muted); border:1px solid var(--border);
}
.exec-page-stat-value { font-size:20px; font-weight:800; color:var(--primary); font-variant-numeric:tabular-nums; }
.exec-page-stat-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted-fg); margin-top:2px; }

/* ── Layout: Sidebar + Main Card ── */
.exec-layout { display:grid; grid-template-columns:300px 1fr; gap:20px; min-height:calc(100vh - 220px); align-items:start; }

/* ── Sidebar ── */
.exec-sidebar {
  display:flex; flex-direction:column; gap:10px;
  background:var(--card); border-radius:18px; padding:14px;
  box-shadow:0 4px 20px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  border:1px solid var(--border);
  position:sticky; top:24px; max-height:calc(100vh - 130px);
  transition:box-shadow 0.3s;
}
.exec-sidebar:hover { box-shadow:0 8px 32px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.03); }
.exec-sidebar-search { position:relative; }
.exec-sidebar-search input {
  width:100%; padding:10px 12px 10px 38px; border:1.5px solid var(--border); border-radius:12px;
  font-size:13px; background:var(--background); color:var(--foreground); outline:none; transition:all 0.25s;
}
.exec-sidebar-search input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(5,150,105,0.12); background:var(--card); }
.exec-sidebar-search .exec-search-icon {
  position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted-fg);
  transition:color 0.2s;
}
.exec-sidebar-search input:focus ~ .exec-search-icon,
.exec-sidebar-search:focus-within .exec-search-icon { color:var(--primary); }
[dir="rtl"] .exec-sidebar-search .exec-search-icon { left:auto; right:12px; }
[dir="rtl"] .exec-sidebar-search input { padding:10px 38px 10px 12px; }
.exec-sidebar-filters { display:flex; gap:6px; }
.exec-sidebar-filters select {
  flex:1; padding:7px 8px; border:1.5px solid var(--border); border-radius:10px;
  font-size:11px; background:var(--background); color:var(--foreground); cursor:pointer; outline:none;
  transition:border-color 0.15s;
}
.exec-sidebar-filters select:focus { border-color:var(--primary); }

/* ── Sidebar Count ── */
.exec-sidebar-count {
  font-size:11px; color:var(--muted-fg); padding:6px 8px; text-align:center;
  border-bottom:1px solid var(--border); margin-bottom:2px;
  font-weight:600; letter-spacing:0.02em;
  background:linear-gradient(135deg, rgba(5,150,105,0.03), transparent);
  border-radius:8px 8px 0 0;
}

/* ── Sidebar List ── */
.exec-list {
  flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:2px;
  max-height:calc(100vh - 330px); padding-right:2px;
  scrollbar-width:thin; scrollbar-color:rgba(0,0,0,0.08) transparent;
}
.exec-list::-webkit-scrollbar { width:4px; }
.exec-list::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.08); border-radius:4px; }
.exec-list::-webkit-scrollbar-thumb:hover { background:rgba(0,0,0,0.15); }
.exec-list-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  cursor:pointer; transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border:1.5px solid transparent; background:transparent;
  position:relative; overflow:hidden; flex-shrink:0;
}
.exec-list-item:hover { background:var(--muted); border-color:var(--border); }
.exec-list-item.active {
  background:linear-gradient(135deg, rgba(5,150,105,0.1), rgba(5,150,105,0.04));
  border-color:rgba(5,150,105,0.35);
  box-shadow:0 2px 12px rgba(5,150,105,0.1), inset 0 0 0 1px rgba(5,150,105,0.05);
}
.exec-list-item.active::before {
  content:''; position:absolute; left:0; top:6px; bottom:6px; width:3px;
  background:linear-gradient(180deg, var(--primary), #34d399);
  border-radius:0 3px 3px 0;
}
[dir="rtl"] .exec-list-item.active::before { left:auto; right:0; border-radius:3px 0 0 3px; }
.exec-list-flag { font-size:22px; flex-shrink:0; line-height:1; }
.exec-list-info { flex:1; min-width:0; }
.exec-list-name {
  font-size:12px; font-weight:600; color:var(--foreground); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; line-height:1.3;
  transition:color 0.15s;
}
.exec-list-item:hover .exec-list-name { color:var(--primary); }
.exec-list-item.active .exec-list-name { color:var(--primary); font-weight:700; }
.exec-list-meta {
  font-size:10px; color:var(--muted-fg); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.exec-list-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.exec-list-rank {
  font-size:10px; font-weight:800; color:var(--primary); background:rgba(5,150,105,0.1);
  padding:2px 7px; border-radius:6px; font-variant-numeric:tabular-nums;
}
.exec-list-item.active .exec-list-rank { background:rgba(5,150,105,0.2); }
.exec-list-tier-dot {
  width:8px; height:8px; border-radius:50%; flex-shrink:0;
  box-shadow:0 0 0 2px rgba(255,255,255,0.9), 0 0 4px rgba(0,0,0,0.1);
}
.exec-list-ues-mini {
  font-size:9px; font-weight:700; color:var(--muted-fg);
  font-variant-numeric:tabular-nums; min-width:28px; text-align:right;
}

/* ── Main Card ── */
.exec-card {
  border-radius:20px; overflow:hidden; background:var(--card);
  box-shadow:0 8px 40px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  border:1px solid var(--border); display:flex; flex-direction:column;
  transition:box-shadow 0.3s, border-color 0.3s;
}
.exec-card:hover { box-shadow:0 12px 48px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04); }

/* ── Hero Section ── */
.exec-hero {
  position:relative; min-height:210px; overflow:hidden; display:flex; align-items:flex-end;
}
.exec-hero-bg {
  position:absolute; inset:0;
  background:linear-gradient(135deg, #064e3b 0%, #065f46 30%, #047857 60%, #059669 100%);
}
.exec-hero-pattern {
  position:absolute; inset:0; opacity:0.06;
  background-image:
    radial-gradient(circle at 15% 50%, white 1.5px, transparent 1.5px),
    radial-gradient(circle at 85% 15%, white 1px, transparent 1px),
    radial-gradient(circle at 55% 85%, white 1px, transparent 1px),
    radial-gradient(circle at 40% 20%, white 0.5px, transparent 0.5px);
  background-size:60px 60px, 80px 80px, 50px 50px, 40px 40px;
  animation:execPatternDrift 40s linear infinite;
}
@keyframes execPatternDrift {
  0% { transform:translate(0, 0); }
  100% { transform:translate(60px, 60px); }
}
.exec-hero-gradient {
  position:absolute; inset:0;
  background:linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.02) 100%);
}

/* Hero top bar — tier + rank */
.exec-hero-top {
  position:absolute; top:0; left:0; right:0; z-index:3;
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:16px 20px;
}
.exec-tier-label {
  padding:5px 16px; border-radius:9999px;
  color:white; font-size:10px; font-weight:700; letter-spacing:0.06em;
  text-transform:uppercase; backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,0.2);
  box-shadow:0 4px 16px rgba(0,0,0,0.2);
  animation:execTierPulse 3s ease-in-out infinite;
}
@keyframes execTierPulse {
  0%, 100% { box-shadow:0 4px 16px rgba(0,0,0,0.2); }
  50% { box-shadow:0 4px 24px rgba(0,0,0,0.3); }
}
.exec-rank-badge {
  width:56px; height:56px; border-radius:16px;
  background:rgba(0,0,0,0.4); border:1.5px solid rgba(255,255,255,0.2);
  color:#fbbf24; display:flex; flex-direction:column; align-items:center; justify-content:center;
  line-height:1.1; backdrop-filter:blur(16px);
  box-shadow:0 4px 16px rgba(0,0,0,0.25);
}
.exec-rank-badge .exec-rank-star { font-size:13px; margin-bottom:1px; }
.exec-rank-badge .exec-rank-num { font-size:18px; font-weight:900; }

/* Hero content */
.exec-hero-content {
  position:relative; z-index:2; display:flex; align-items:flex-end; gap:16px;
  padding:60px 24px 22px; width:100%;
}
.exec-flag {
  font-size:52px; flex-shrink:0; filter:drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  transition:transform 0.3s; line-height:1;
}
.exec-card:hover .exec-flag { transform:scale(1.05); }
.exec-hero-info { flex:1; min-width:0; }
.exec-hero-name {
  font-size:24px; font-weight:800; color:white; line-height:1.2;
  text-shadow:0 2px 8px rgba(0,0,0,0.5); letter-spacing:-0.015em;
}
.exec-hero-abbrev { font-size:13px; font-weight:400; opacity:0.55; margin-left:8px; }
[dir="rtl"] .exec-hero-abbrev { margin-left:0; margin-right:8px; }
.exec-hero-loc {
  font-size:13px; color:rgba(255,255,255,0.9); margin-top:6px;
  display:flex; align-items:center; gap:5px;
}
.exec-hero-loc .icon { width:13px; height:13px; opacity:0.7; }
.exec-hero-org { font-size:11px; color:rgba(255,255,255,0.45); margin-top:5px; letter-spacing:0.02em; }
.exec-hero-parent { font-size:10px; color:rgba(255,255,255,0.35); margin-top:2px; font-style:italic; }
.exec-hero-ues { text-align:right; flex-shrink:0; padding-bottom:2px; }
.exec-ues-score {
  font-size:46px; font-weight:900; line-height:1; letter-spacing:-0.03em;
  background:linear-gradient(135deg, #4ade80 0%, #22d3ee 50%, #a78bfa 100%);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.exec-ues-label { font-size:10px; color:rgba(255,255,255,0.45); text-transform:uppercase; letter-spacing:0.14em; font-weight:700; }
.exec-ues-max { font-size:10px; color:rgba(255,255,255,0.25); margin-top:1px; }

/* ── Quick Stats Strip ── */
.exec-stats-strip {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:1px;
  background:var(--border);
}
.exec-stat {
  display:flex; align-items:center; gap:10px; padding:14px 16px; background:var(--card);
  transition:all 0.2s;
}
.exec-stat:hover { background:var(--muted); }
.exec-stat-icon {
  width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; transition:transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.exec-stat:hover .exec-stat-icon { transform:scale(1.08) rotate(-2deg); }
.exec-stat-icon .icon { width:16px; height:16px; }
.exec-stat-info { min-width:0; }
.exec-stat-label { font-size:9px; color:var(--muted-fg); text-transform:uppercase; letter-spacing:0.08em; font-weight:600; }
.exec-stat-value {
  font-size:14px; font-weight:700; color:var(--foreground); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px;
}

/* ── Tab Bar ── */
.exec-tab-bar {
  display:flex; gap:3px; padding:8px 16px; border-bottom:2px solid var(--border);
  overflow-x:auto; background:var(--card);
  scrollbar-width:none;
}
.exec-tab-bar::-webkit-scrollbar { display:none; }
.exec-tab {
  display:inline-flex; align-items:center; gap:5px; padding:9px 16px; border-radius:10px;
  font-size:12px; font-weight:500; cursor:pointer; color:var(--muted-fg);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border:none; background:none; white-space:nowrap;
  position:relative;
}
.exec-tab:hover { color:var(--foreground); background:var(--muted); }
.exec-tab.active {
  color:white; background:var(--primary); font-weight:600;
  box-shadow:0 2px 8px rgba(5,150,105,0.25);
}
.exec-tab.active .icon { color:white; }
.exec-tab .icon { width:14px; height:14px; transition:color 0.15s; }
.exec-tab .exec-tab-count {
  font-size:9px; font-weight:700; background:rgba(0,0,0,0.15); padding:1px 5px;
  border-radius:6px; margin-left:2px;
}
.exec-tab.active .exec-tab-count { background:rgba(255,255,255,0.25); color:white; }

/* ── Section Content ── */
.exec-section-wrap { padding:24px; min-height:300px; animation:execFadeIn 0.35s ease; }
@keyframes execFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

.exec-section {
  margin-bottom:24px; padding-left:14px;
  border-left:3px solid transparent; border-radius:0 8px 8px 0;
  transition:background 0.2s, border-color 0.2s;
}
[dir="rtl"] .exec-section { padding-left:0; padding-right:14px; border-left:none; border-right:3px solid transparent; border-radius:8px 0 0 8px; }
.exec-section:last-child { margin-bottom:0; }
.exec-section:hover { background:rgba(0,0,0,0.01); }
.exec-section-header {
  display:flex; align-items:center; gap:10px; font-size:15px; font-weight:700;
  color:var(--foreground); margin-bottom:14px; padding-bottom:10px;
  border-bottom:1.5px solid var(--border); letter-spacing:-0.01em;
}
.exec-section-icon {
  width:20px; height:20px; color:var(--primary); display:inline-flex;
  padding:3px; background:rgba(5,150,105,0.08); border-radius:6px;
}
.exec-section-body { font-size:13px; color:var(--muted-fg); line-height:1.75; }

/* ── Description block ── */
.exec-description {
  padding:22px 26px; border-radius:16px; margin-bottom:22px;
  background:linear-gradient(135deg, rgba(5,150,105,0.06), rgba(5,150,105,0.02), rgba(34,211,238,0.02));
  border:1px solid rgba(5,150,105,0.12); border-left:4px solid var(--primary);
  position:relative; overflow:hidden;
}
[dir="rtl"] .exec-description { border-left:1px solid rgba(5,150,105,0.12); border-right:4px solid var(--primary); }
.exec-description::before {
  content:'\201C'; position:absolute; top:2px; left:10px; font-size:64px;
  font-family:Georgia,serif; color:rgba(5,150,105,0.08); line-height:1;
}
[dir="rtl"] .exec-description::before { left:auto; right:10px; }
.exec-description::after {
  content:''; position:absolute; bottom:-30px; right:-30px; width:100px; height:100px;
  background:radial-gradient(circle, rgba(5,150,105,0.06), transparent 70%);
  border-radius:50%;
}
.exec-description p {
  font-size:13.5px; color:#475569; line-height:1.9; position:relative; z-index:1;
}

/* ── Mission callout ── */
.exec-mission {
  padding:20px 24px; border-radius:16px; margin-bottom:22px;
  background:linear-gradient(135deg, rgba(5,150,105,0.07), rgba(34,211,238,0.04), rgba(139,92,246,0.03));
  border:1px solid rgba(5,150,105,0.1); position:relative; overflow:hidden;
}
.exec-mission::before {
  content:''; position:absolute; top:-30px; right:-30px; width:100px; height:100px;
  background:radial-gradient(circle, rgba(5,150,105,0.1), transparent 70%);
  border-radius:50%;
}
.exec-mission::after {
  content:''; position:absolute; bottom:-20px; left:-20px; width:60px; height:60px;
  background:radial-gradient(circle, rgba(34,211,238,0.06), transparent 70%);
  border-radius:50%;
}
.exec-mission-label {
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.12em;
  color:var(--primary); margin-bottom:10px; display:flex; align-items:center; gap:7px;
  position:relative; z-index:1;
}
.exec-mission-label .icon { width:14px; height:14px; }
.exec-mission p {
  font-size:13.5px; color:#475569; line-height:1.8; font-style:italic; position:relative; z-index:1;
}

/* ── Info Grid (Parent Org + Budget) ── */
.exec-info-grid {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:14px; margin-bottom:22px;
}
.exec-info-card {
  display:flex; align-items:flex-start; gap:14px; padding:18px 20px;
  border-radius:14px; background:var(--card); border:1px solid var(--border);
  transition:all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:0 1px 3px rgba(0,0,0,0.02);
}
.exec-info-card:hover { box-shadow:0 8px 24px rgba(0,0,0,0.06); transform:translateY(-2px); border-color:rgba(5,150,105,0.2); }
.exec-info-card-icon {
  width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.exec-info-card-icon .icon { width:18px; height:18px; }
.exec-info-card-body { flex:1; min-width:0; }
.exec-info-card-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.07em; color:var(--muted-fg); margin-bottom:5px; }
.exec-info-card-value { font-size:14px; font-weight:700; color:var(--foreground); line-height:1.4; word-wrap:break-word; }

/* ── Bullet list ── */
.exec-bullet-list { list-style:none; padding:0; margin:0; counter-reset:exec-bullet; }
.exec-bullet-list li {
  position:relative; padding:10px 0 10px 28px; font-size:13px; color:var(--muted-fg); line-height:1.7;
  border-bottom:1px solid rgba(0,0,0,0.03);
  animation:execBulletIn 0.35s ease both;
  transition:all 0.15s;
}
@keyframes execBulletIn { from { opacity:0; transform:translateX(-8px); } to { opacity:1; transform:translateX(0); } }
[dir="rtl"] .exec-bullet-list li { padding:10px 28px 10px 0; }
[dir="rtl"] @keyframes execBulletIn { from { opacity:0; transform:translateX(8px); } to { opacity:1; transform:translateX(0); } }
.exec-bullet-list li:last-child { border-bottom:none; }
.exec-bullet-list li::before {
  content:''; position:absolute; left:6px; top:18px; width:8px; height:8px;
  border-radius:50%; border:2px solid var(--primary); opacity:0.4;
  transition:all 0.2s;
}
[dir="rtl"] .exec-bullet-list li::before { left:auto; right:6px; }
.exec-bullet-list li:hover { color:var(--foreground); background:rgba(5,150,105,0.02); border-radius:6px; }
.exec-bullet-list li:hover::before { opacity:0.9; background:var(--primary); border-color:var(--primary); transform:scale(1.15); }

/* ── Pills/tags ── */
.exec-pills-list { display:flex; flex-wrap:wrap; gap:8px; }
.exec-info-pill {
  display:inline-flex; align-items:center; gap:5px; padding:7px 14px; border-radius:10px;
  font-size:12px; font-weight:500; border:1px solid; transition:all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation:execPillIn 0.35s ease both;
  position:relative; overflow:hidden;
}
@keyframes execPillIn { from { opacity:0; transform:scale(0.9) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }
.exec-info-pill .icon { width:12px; height:12px; opacity:0.6; }
.exec-info-pill:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,0.08); }
.exec-info-pill::after {
  content:''; position:absolute; inset:0; opacity:0;
  background:linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  transition:opacity 0.2s;
}
.exec-info-pill:hover::after { opacity:1; }

/* ── Domain Performance (Radar + Bars) ── */
.exec-perf-grid { display:grid; grid-template-columns:260px 1fr; gap:20px; align-items:start; }
.exec-radar-wrap {
  display:flex; align-items:center; justify-content:center; padding:16px;
  background:linear-gradient(135deg, var(--muted), var(--card));
  border-radius:16px; border:1px solid var(--border);
  box-shadow:inset 0 1px 3px rgba(0,0,0,0.02);
}
.exec-domain-bars { display:flex; flex-direction:column; gap:14px; }
.exec-domain-bar-item { transition:transform 0.15s; }
.exec-domain-bar-item:hover { transform:translateX(2px); }
[dir="rtl"] .exec-domain-bar-item:hover { transform:translateX(-2px); }
.exec-domain-bar-header {
  display:flex; align-items:baseline; justify-content:space-between; margin-bottom:6px;
}
.exec-domain-bar-label { font-size:12px; font-weight:700; }
.exec-domain-bar-sublabel { font-size:10px; color:var(--muted-fg); margin-left:6px; font-weight:400; }
[dir="rtl"] .exec-domain-bar-sublabel { margin-left:0; margin-right:6px; }
.exec-domain-bar-value { font-size:13px; font-weight:800; font-variant-numeric:tabular-nums; }
.exec-domain-bar-track {
  height:10px; border-radius:5px; background:var(--muted); overflow:hidden; position:relative;
  box-shadow:inset 0 1px 2px rgba(0,0,0,0.04);
}
.exec-domain-bar-fill {
  height:100%; border-radius:5px; transition:width 0.8s cubic-bezier(0.34,1.56,0.64,1);
  position:relative;
}
.exec-domain-bar-fill::after {
  content:''; position:absolute; inset:0; border-radius:5px;
  background:linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation:execBarShimmer 2.5s ease-in-out infinite;
}
@keyframes execBarShimmer {
  0% { transform:translateX(-100%); }
  100% { transform:translateX(100%); }
}

/* ── Card Footer Nav ── */
.exec-card-nav {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 20px; border-top:1px solid var(--border);
  background:linear-gradient(to top, var(--muted), var(--card));
  border-radius:0 0 20px 20px;
}
.exec-card-nav .btn { transition:all 0.2s; }
.exec-card-nav .btn:not(:disabled):hover { transform:translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,0.08); }

/* ── No data placeholder ── */
.exec-empty {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:56px 24px; color:var(--muted-fg); text-align:center;
}
.exec-empty .icon { width:40px; height:40px; opacity:0.2; margin-bottom:14px; }
.exec-empty p { font-size:14px; line-height:1.6; }

/* ── Budget highlight ── */
.exec-budget {
  display:inline-flex; align-items:center; gap:10px; padding:12px 20px;
  border-radius:12px; background:var(--muted); border:1px solid var(--border);
  margin-bottom:16px;
}
.exec-budget-value { font-size:18px; font-weight:800; color:var(--foreground); }
.exec-budget-label { font-size:11px; color:var(--muted-fg); }

/* ── Data Completeness Indicator ── */
.exec-completeness {
  display:flex; align-items:center; gap:8px; padding:10px 14px;
  border-radius:10px; background:var(--muted); border:1px solid var(--border);
  margin-bottom:18px; font-size:11px; color:var(--muted-fg);
}
.exec-completeness-bar { flex:1; height:4px; border-radius:2px; background:var(--border); overflow:hidden; }
.exec-completeness-fill { height:100%; border-radius:2px; transition:width 0.5s ease; }
.exec-completeness-label { font-weight:700; font-variant-numeric:tabular-nums; min-width:32px; text-align:right; }

/* ── Exec Responsive ── */
@media (max-width:1200px) {
  .exec-layout { grid-template-columns:280px 1fr; gap:16px; }
  .exec-perf-grid { grid-template-columns:1fr; }
  .exec-page-stats { display:none; }
}
@media (max-width:1024px) {
  .exec-layout { grid-template-columns:260px 1fr; }
  .exec-hero { min-height:190px; }
  .exec-hero-name { font-size:20px; }
  .exec-ues-score { font-size:38px; }
  .exec-stat { padding:12px 14px; }
}
@media (max-width:768px) {
  .exec-layout { grid-template-columns:1fr; }
  .exec-sidebar {
    position:static; max-height:none; padding:12px;
    flex-direction:column;
  }
  .exec-list {
    max-height:180px; flex-direction:row; overflow-x:auto; overflow-y:hidden;
    gap:8px; padding-bottom:8px;
  }
  .exec-list-item { min-width:200px; flex-shrink:0; }
  .exec-hero-content { flex-direction:column; align-items:flex-start; }
  .exec-hero-ues { text-align:left; }
  [dir="rtl"] .exec-hero-ues { text-align:right; }
  .exec-stats-strip { grid-template-columns:repeat(2, 1fr); }
  .exec-perf-grid { grid-template-columns:1fr; }
  .exec-tab-bar { padding:8px 12px; }
  .exec-section-wrap { padding:16px; }
  .exec-info-grid { grid-template-columns:1fr; }
  .exec-page-header { flex-direction:column; align-items:flex-start; }
}
@media (max-width:480px) {
  .exec-stats-strip { grid-template-columns:1fr; }
  .exec-hero-name { font-size:17px; }
  .exec-ues-score { font-size:32px; }
  .exec-rank-badge { width:46px; height:46px; border-radius:12px; }
  .exec-rank-badge .exec-rank-num { font-size:15px; }
}

/* ============================================================
   PAGE: Map (Leaflet)
   ============================================================ */
.map-container { height: calc(100vh - 320px); min-height: 500px; border-radius: 12px; overflow: hidden; }
.leaflet-container { background: #d1fae5; }
.leaflet-popup-content-wrapper { border-radius: 10px !important; box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; background: var(--card) !important; color: var(--foreground) !important; }
.leaflet-popup-content { margin: 10px 14px !important; font-family: var(--font-sans) !important; }
.leaflet-popup-tip { background: var(--card) !important; }
.map-legend { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; margin-top: 16px; }
.map-legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ============================================================
   UTILITIES
   ============================================================ */
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-2 > * + * { margin-top: 8px; }
.font-mono { font-family: 'Courier New', monospace; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--muted-fg); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.inline-flex { display: inline-flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.min-w-0 { min-width: 0; }
.ml-auto { margin-left: auto; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted-fg); }

/* --- Modal / Dialog --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  background: var(--card); border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; max-width: 640px; max-height: 85vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; font-weight: 600; font-family: var(--font-sans); }
.modal-header .modal-close {
  width: 32px; height: 32px; border: none; background: none;
  color: var(--muted-fg); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-header .modal-close:hover { background: var(--muted); }
.modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.form-group .input, .form-group .select, .form-group textarea {
  width: 100%; font-size: 13px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--foreground);
  transition: border-color 0.15s;
}
.form-group .input:focus, .form-group .select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.15);
}
.form-group textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.form-group .form-hint { font-size: 11px; color: var(--muted-fg); }
.form-section-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted-fg);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  grid-column: 1 / -1; margin-top: 8px;
}
.ues-preview {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: 10px;
  background: var(--muted); border: 1px solid var(--border);
}
.ues-preview-score {
  font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ues-preview-tier { font-size: 13px; font-weight: 600; }

@media (max-width: 640px) {
  .modal-panel { max-height: 95vh; margin: 8px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .detail-two-col { grid-template-columns: 1fr; }
  .facility-grid { grid-template-columns: repeat(2, 1fr); }
  .justification-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-260px); width: 260px !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-260px); }
  .main-content { margin-left: 0 !important; }
  .mobile-header { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .facility-grid { grid-template-columns: 1fr; }
  .exec-hero-content { flex-direction:column;align-items:flex-start; }
  .exec-hero-ues { text-align:left; }
  .exec-domains-grid { grid-template-columns:repeat(2,1fr); }
  .exec-pills { flex-direction:column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { max-width: none; }
  .detail-header { flex-direction: column; }
  .page-title { font-size: 18px; }
  .bar-label { width: 100px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .exec-domains-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RTL (Arabic) Support
   ============================================================ */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] body { font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2 { font-family: 'Noto Sans Arabic', 'Playfair Display', 'Georgia', serif; }

/* Sidebar RTL */
[dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: none; }
[dir="rtl"] .main-content { margin-left: 0; margin-right: 260px; }
[dir="rtl"] .sidebar.collapsed ~ .main-content { margin-left: 0; margin-right: 56px; }
[dir="rtl"] .nav-item { text-align: right; }
[dir="rtl"] .sidebar-logout { text-align: right; }

/* Filter & forms RTL */
[dir="rtl"] .filter-search-icon { left: auto; right: 12px; }
[dir="rtl"] .input-icon { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] .login-field-icon { left: auto; right: 12px; }
[dir="rtl"] .login-field .input-icon { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] #login-toggle-pw { right: auto; left: 10px; }

/* Table RTL */
[dir="rtl"] .data-table th { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .text-center { text-align: center; }

/* Bar chart RTL */
[dir="rtl"] .bar-label { text-align: left; }
[dir="rtl"] .bar-fill { border-radius: 4px 0 0 4px; justify-content: flex-start; padding-left: 6px; padding-right: 0; }
[dir="rtl"] .bar-track { border-radius: 4px 0 0 4px; }

/* Misc RTL */
[dir="rtl"] .ml-auto { margin-left: 0; margin-right: auto; }
[dir="rtl"] .domain-score-sublabel { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .detail-tier-box { direction: rtl; }
[dir="rtl"] .card-header-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .toast-container { right: auto; left: 20px; }
@keyframes toastInRtl { from { transform: translateX(-100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
[dir="rtl"] .toast { animation: toastInRtl 0.3s ease; }

/* Mobile RTL */
@media (max-width: 768px) {
  [dir="rtl"] .sidebar { transform: translateX(260px); }
  [dir="rtl"] .sidebar.mobile-open { transform: translateX(0); }
  [dir="rtl"] .sidebar.collapsed { transform: translateX(260px); }
  [dir="rtl"] .main-content { margin-right: 0 !important; }
}

/* Language toggle button */
.lang-toggle {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--sidebar-fg); background: none; border: none;
  width: 100%; text-align: left; transition: background 0.15s; cursor: pointer; opacity: 0.8;
}
.lang-toggle:hover { background: var(--sidebar-accent); opacity: 1; }
[dir="rtl"] .lang-toggle { text-align: right; }
.sidebar.collapsed .lang-toggle span:not(.lang-icon) { display: none; }

/* ============================================================
   ENHANCED: Criteria Explorer Hero Additions — Aurora, Stars, Orbs, Chips
   ============================================================ */
.ace-hero-aurora {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(124,58,237,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(16,185,129,0.1) 0%, transparent 40%);
  animation: aceAuroraShift 14s ease-in-out infinite alternate;
}
@keyframes aceAuroraShift {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
.ace-hero-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 25%, rgba(255,255,255,0.15) 1px, transparent 1px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.1) 0.8px, transparent 0.8px),
    radial-gradient(circle at 45% 72%, rgba(255,255,255,0.08) 0.6px, transparent 0.6px),
    radial-gradient(circle at 88% 65%, rgba(255,255,255,0.12) 0.5px, transparent 0.5px),
    radial-gradient(circle at 25% 85%, rgba(255,255,255,0.06) 1px, transparent 1px),
    radial-gradient(circle at 62% 38%, rgba(255,255,255,0.09) 0.7px, transparent 0.7px);
  background-size: 120px 120px, 160px 160px, 100px 100px, 140px 140px, 180px 180px, 110px 110px;
  animation: aceStarsTwinkle 8s ease-in-out infinite alternate;
}
@keyframes aceStarsTwinkle { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.6; } }
.ace-hero-orb {
  position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px);
}
.ace-hero-orb1 {
  width: 250px; height: 250px; top: -60px; right: -40px;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
  animation: aceOrb1 16s ease-in-out infinite alternate;
}
.ace-hero-orb2 {
  width: 180px; height: 180px; bottom: -40px; left: 15%;
  background: radial-gradient(circle, rgba(6,182,212,0.12), transparent 70%);
  animation: aceOrb2 12s ease-in-out infinite alternate-reverse;
}
.ace-hero-orb3 {
  width: 120px; height: 120px; top: 40%; left: 50%;
  background: radial-gradient(circle, rgba(52,211,153,0.08), transparent 70%);
  animation: aceOrb3 14s ease-in-out infinite alternate;
}
@keyframes aceOrb1 { 0% { transform: translate(0,0); } 100% { transform: translate(-25px,15px); } }
@keyframes aceOrb2 { 0% { transform: translate(0,0); } 100% { transform: translate(20px,-10px); } }
@keyframes aceOrb3 { 0% { transform: translate(0,0); } 100% { transform: translate(10px,-20px); } }

/* Ace Hero H1 Accent */
.ace-hero-h1-accent {
  background: linear-gradient(135deg, #a5b4fc 0%, #67e8f9 50%, #34d399 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ace Hero Domain Chips */
.ace-hero-chips { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.ace-hero-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px); letter-spacing: 0.03em;
}
.ace-hero-chip:hover {
  background: var(--hcc, rgba(255,255,255,0.18));
  border-color: var(--hcc, rgba(255,255,255,0.3));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  color: #fff;
}

/* Badge enhancements */
.ace-badge-v { position: relative; overflow: hidden; }
.ace-badge-v-glow {
  position: absolute; inset: -2px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(52,211,153,0.2));
  opacity: 0; transition: opacity 0.3s; filter: blur(6px);
}
.ace-badge-v:hover .ace-badge-v-glow { opacity: 1; }
.ace-badge-shimmer {
  position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: aceShimmer 3s ease-in-out infinite;
}
@keyframes aceShimmer { 0% { left: -100%; } 100% { left: 200%; } }

/* KPI Ring Enhancement */
.ace-kpi-ring { position: relative; width: 80px; height: 80px; margin-bottom: 4px; }
.ace-kpi-ring svg { position: absolute; inset: 0; }
.ace-kpi-ring .ace-kpi-icon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center;
}
.ace-kpi-ring .ace-kpi-icon .icon { width: 14px; height: 14px; }

/* Ace Architecture Bar enhancements */
.ace-arch-seg-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; width: 100%; height: 100%;
  border-radius: 6px;
}
.ace-arch-seg-glow {
  position: absolute; bottom: -4px; left: 10%; right: 10%; height: 8px;
  filter: blur(8px); opacity: 0; transition: opacity 0.3s; border-radius: 50%;
}
.ace-arch-seg:hover .ace-arch-seg-glow { opacity: 0.4; }
.ace-arch-emoji { font-size: 14px; margin-bottom: 1px; position: relative; }
.ace-arch-legend {
  display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center;
}
.ace-arch-leg-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--muted-fg); cursor: pointer;
  transition: color 0.2s;
}
.ace-arch-leg-item:hover { color: var(--foreground); }
.ace-arch-leg-item i {
  display: inline-block; width: 8px; height: 8px; border-radius: 3px;
}
.ace-arch-leg-item small { font-weight: 700; opacity: 0.7; }
.ace-arch-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.ace-arch-title-group { display: flex; align-items: center; gap: 10px; }
.ace-arch-icon-wrap { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(5,150,105,0.08); color: var(--primary); }
.ace-arch-icon-wrap .icon { width: 16px; height: 16px; }
.ace-arch-hint { font-size: 11px; color: var(--muted-fg); font-weight: 500; }

/* Sub-criteria enhancements */
.ace-sc-bar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ace-sc-bar-total { font-size: 11px; font-weight: 700; color: var(--muted-fg); }
.ace-sc-border-glow { display: none; }
.ace-sc:hover .ace-sc-border-glow { display: none; }
.ace-sc-num-text { position: relative; z-index: 1; }
.ace-sc-num-shine {
  position: absolute; inset: 0; border-radius: 13px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.2), transparent 55%);
  pointer-events: none;
}

/* Domain header enhancements */
.ace-dh-icon-wrap { position: relative; }
.ace-dh-icon-glow {
  position: absolute; inset: -8px; border-radius: 24px;
  filter: blur(12px); opacity: 0.15; transition: opacity 0.3s;
}
.ace-dh:hover .ace-dh-icon-glow { opacity: 0.3; }
.ace-dh-emoji { font-size: 22px; position: relative; z-index: 1; line-height: 1; }
.ace-dh-particles { position: absolute; inset: 0; pointer-events: none; }
.ace-dh-meta { display: flex; gap: 14px; margin-top: 8px; }
.ace-dh-meta-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.4);
}
.ace-dh-meta-item .icon { width: 11px; height: 11px; }
.ace-dh-expand-inner { display: flex; align-items: center; gap: 6px; }

/* Rubric Score Bar */
.ace-rb-score-wrap { display: flex; align-items: center; gap: 8px; }
.ace-rb-score-bar { width: 60px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.ace-rb-score-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.ace-rb-badge-emoji { font-size: 12px; }

/* Footer card enhancements */
.ace-fc-icon-shine {
  position: absolute; inset: 0; border-radius: 14px;
  background: radial-gradient(ellipse at 25% 25%, rgba(255,255,255,0.25), transparent 55%);
  pointer-events: none;
}
.ace-fc-evidence, .ace-fc-tiers { }
.ace-evt-glow {
  position: absolute; bottom: -10px; left: 10%; right: 10%; height: 20px;
  background: var(--etc, #3b82f6); filter: blur(16px); opacity: 0;
  transition: opacity 0.3s; border-radius: 50%;
}
.ace-evt:hover .ace-evt-glow { opacity: 0.08; }
.ace-evt-badge {
  font-size: 9px; font-weight: 700; color: var(--muted-fg);
  background: var(--muted); padding: 3px 8px; border-radius: 6px;
  margin-left: auto;
}
.ace-tier-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0.5px, transparent 0.5px),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,0.1) 0.8px, transparent 0.8px);
  background-size: 40px 40px, 60px 60px;
}
.ace-tier-content { position: relative; z-index: 1; }
.ace-tier-emoji { font-size: 28px; display: block; margin-bottom: 8px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }

/* Ace Scale Strip enhanced */
.ace-scale-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 12px; font-weight: 700; color: var(--foreground);
}
.ace-scale-header .icon { width: 14px; height: 14px; color: var(--primary); }
.ace-scale-header span { font-weight: 400; color: var(--muted-fg); margin-left: 4px; }
.ace-scale-bar-track {
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--slbg, var(--muted)); overflow: hidden; margin-bottom: 6px;
}
.ace-scale-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.ace-scale-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ace-scale-emoji { font-size: 14px; }

/* ============================================================
   PAGE: Assessment Criteria Explorer — A+++ Premium v5
   ============================================================ */

/* ── Page ── */
.ace { max-width: 100%; }

/* ── HERO — Cinematic dark gradient with animated mesh ── */
.ace-hero {
  position: relative; border-radius: 24px; overflow: hidden;
  margin-bottom: 28px; min-height: 240px;
  background: linear-gradient(135deg, #0c1220 0%, #0f172a 25%, #1e1b4b 55%, #312e81 80%, #1e3a5f 100%);
}
.ace-hero-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(124,58,237,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 30%, rgba(6,182,212,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 80%, rgba(16,185,129,0.08) 0%, transparent 40%);
  animation: aceHeroShift 12s ease-in-out infinite alternate;
}
@keyframes aceHeroShift {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}
.ace-hero-glow {
  position: absolute; top: -40%; right: -10%; width: 55%; height: 180%;
  background: radial-gradient(ellipse, rgba(124,58,237,0.12) 0%, transparent 65%);
  pointer-events: none; animation: aceGlow 8s ease-in-out infinite alternate;
}
@keyframes aceGlow { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-3%,5%) scale(1.08); } }
.ace-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.ace-hero-inner {
  position: relative; z-index: 1; padding: 48px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.ace-hero-text { flex: 1; min-width: 320px; }
.ace-hero-badges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.ace-badge-v {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #e0e7ff;
  background: rgba(255,255,255,0.08); backdrop-filter: blur(12px);
  padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
}
.ace-badge-cls {
  font-size: 10px; font-weight: 800; color: #fbbf24;
  background: rgba(251,191,36,0.1); padding: 6px 14px; border-radius: 20px;
  letter-spacing: 0.14em; border: 1px solid rgba(251,191,36,0.2);
}
.ace-badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; color: #34d399;
  background: rgba(52,211,153,0.08); padding: 6px 14px; border-radius: 20px;
  letter-spacing: 0.08em; border: 1px solid rgba(52,211,153,0.2);
}
.ace-pulse-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; animation: acePulse 2s ease-in-out infinite;
}
@keyframes acePulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,0.5); } 50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(52,211,153,0); } }
.ace-hero-h1 {
  font-size: 40px; font-weight: 900; color: #fff; margin: 0 0 14px;
  font-family: var(--font-serif); line-height: 1.1;
  background: linear-gradient(135deg, #fff 40%, #a5b4fc 70%, #67e8f9 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ace-hero-p {
  font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.8;
  max-width: 560px; margin: 0;
}
.ace-hero-p strong { color: rgba(255,255,255,0.9); }

/* Hero KPI Glassmorphism Cards */
.ace-hero-kpis { display: flex; gap: 14px; flex-wrap: wrap; }
.ace-kpi {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100px; padding: 18px 10px 14px; border-radius: 18px;
  background: rgba(255,255,255,0.06); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), background 0.3s, box-shadow 0.3s;
}
.ace-kpi:hover {
  transform: translateY(-6px) scale(1.04);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.ace-kpi-icon { margin-bottom: 2px; }
.ace-kpi-icon .icon { width: 18px; height: 18px; }
.ace-kpi-num { font-size: 28px; font-weight: 900; color: #fff; line-height: 1; font-family: var(--font-serif); }
.ace-kpi-l1 { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }
.ace-kpi-l2 { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }

/* ── Toolbar ── */
.ace-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.ace-toolbar-left { flex: 1; min-width: 260px; }
.ace-search-wrap {
  display: flex; align-items: center; gap: 10px; position: relative;
  padding: 10px 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.ace-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(5,150,105,0.08), 0 4px 16px rgba(0,0,0,0.04);
}
.ace-search-icon .icon { width: 16px; height: 16px; color: var(--muted-fg); }
.ace-search-input {
  border: none; background: none; outline: none; font-size: 14px;
  color: var(--foreground); width: 100%; font-family: inherit;
}
.ace-search-input::placeholder { color: var(--muted-fg); }
.ace-search-clear {
  background: none; border: none; cursor: pointer; padding: 2px; color: var(--muted-fg);
  transition: color 0.2s;
}
.ace-search-clear:hover { color: var(--foreground); }
.ace-search-clear .icon { width: 14px; height: 14px; }
.ace-toolbar-right { display: flex; gap: 8px; }
.ace-tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 12px; font-weight: 700;
  color: var(--muted-fg); background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.ace-tool-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--background); }
.ace-tool-btn .icon { width: 14px; height: 14px; }

/* ── Scoring Scale Strip ── */
.ace-scale-strip {
  margin-bottom: 20px; padding: 14px 20px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.ace-scale-track { display: flex; gap: 8px; }
.ace-scale-seg {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px; border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ace-scale-seg:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.ace-scale-bar { width: 100%; height: 6px; border-radius: 3px; }
.ace-scale-label { font-size: 11px; font-weight: 700; color: var(--slc); }
.ace-scale-range {
  font-size: 10px; font-weight: 700; color: var(--muted-fg);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Weight Architecture Bar ── */
.ace-arch {
  margin-bottom: 28px; padding: 20px 24px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.ace-arch-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.ace-arch-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--foreground);
}
.ace-arch-title .icon { width: 14px; height: 14px; color: var(--primary); }
.ace-arch-sub { font-size: 11px; color: var(--muted-fg); }
.ace-arch-bar {
  display: flex; height: 52px; border-radius: 14px; overflow: hidden; gap: 3px;
}
.ace-arch-seg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; transition: all 0.3s cubic-bezier(.34,1.56,.64,1);
  border-radius: 6px; min-width: 52px; position: relative; overflow: hidden;
}
.ace-arch-seg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}
.ace-arch-seg:hover { transform: scaleY(1.18) scaleX(1.02); filter: brightness(1.12); box-shadow: 0 6px 24px rgba(0,0,0,0.25); z-index: 2; }
.ace-arch-seg.active { transform: scaleY(1.2); box-shadow: 0 0 0 3px var(--asc), 0 6px 24px rgba(0,0,0,0.3); z-index: 3; }
.ace-arch-key { font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-shadow: 0 1px 4px rgba(0,0,0,0.3); position: relative; }
.ace-arch-pct { font-size: 10px; font-weight: 700; opacity: 0.85; position: relative; }

/* ── Domain Cards ── */
.ace-domains { display: flex; flex-direction: column; gap: 24px; margin-bottom: 36px; }

.ace-domain {
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  transition: box-shadow 0.4s, transform 0.3s;
  animation: aceCardIn 0.5s ease both;
}
@keyframes aceCardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ace-domain:hover { box-shadow: 0 12px 48px rgba(0,0,0,0.08); }
.ace-domain-open { box-shadow: 0 8px 40px rgba(0,0,0,0.1); border-color: var(--dp); }

/* Domain Header — gradient bar with mesh overlay */
.ace-dh {
  cursor: pointer; position: relative; overflow: hidden;
}
.ace-dh-gradient { position: absolute; inset: 0; }
.ace-dh-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}
.ace-dh-content {
  position: relative; z-index: 1; padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.ace-dh-left { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.ace-dh-icon-ring {
  width: 58px; height: 58px; border-radius: 18px; flex-shrink: 0;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform 0.3s;
}
.ace-dh:hover .ace-dh-icon-ring { transform: scale(1.08) rotate(-4deg); }
.ace-dh-icon { color: #fff; }
.ace-dh-icon .icon { width: 24px; height: 24px; }
.ace-dh-info { flex: 1; min-width: 0; }
.ace-dh-tag-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ace-dh-num {
  font-size: 10px; font-weight: 900; color: rgba(255,255,255,0.5);
  font-family: 'SF Mono', 'Fira Code', monospace; letter-spacing: 0.06em;
}
.ace-dh-key {
  font-size: 11px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,0.18); padding: 3px 12px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2); letter-spacing: 0.05em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-dh-role {
  font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 6px;
  letter-spacing: 0.04em;
}
.ace-role-agent { background: rgba(37,99,235,0.2); color: #93c5fd; border: 1px solid rgba(37,99,235,0.3); }
.ace-role-enabler { background: rgba(124,58,237,0.2); color: #c4b5fd; border: 1px solid rgba(124,58,237,0.3); }
.ace-role-outcome { background: rgba(5,150,105,0.2); color: #6ee7b7; border: 1px solid rgba(5,150,105,0.3); }
.ace-role-foundation { background: rgba(217,119,6,0.2); color: #fde68a; border: 1px solid rgba(217,119,6,0.3); }
.ace-dh-title {
  font-size: 22px; font-weight: 900; color: #fff; margin: 0;
  line-height: 1.25; font-family: var(--font-serif);
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.ace-dh-desc {
  font-size: 12.5px; color: rgba(255,255,255,0.6); line-height: 1.7;
  margin: 8px 0 0;
}

/* Domain Header Right — Ring + Stats */
.ace-dh-right {
  display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0;
}
.ace-dh-ring-wrap { position: relative; width: 88px; height: 88px; }
.ace-dh-ring { width: 88px; height: 88px; transform: rotate(-90deg); }
.ace-dh-ring-progress { transition: stroke-dasharray 0.6s ease; }
.ace-dh-ring-inner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  display: flex; align-items: baseline; gap: 1px;
}
.ace-dh-ring-val { font-size: 24px; font-weight: 900; color: #fff; font-family: var(--font-serif); }
.ace-dh-ring-unit { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.6); }
.ace-dh-mini-stats {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ace-dh-mini-stats span {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.5); white-space: nowrap;
}

/* Domain Expand Toggle */
.ace-dh-expand {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 0; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.55); background: rgba(0,0,0,0.15);
  backdrop-filter: blur(4px); transition: all 0.2s; cursor: pointer;
}
.ace-dh-expand .icon { width: 14px; height: 14px; }
.ace-dh-expand:hover { color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.25); }

/* ── Sub-Criteria Section ── */
.ace-sc-section {
  background: var(--background); padding: 28px; border-top: none;
  animation: aceSectionIn 0.4s ease both;
}
@keyframes aceSectionIn { from { opacity: 0; } to { opacity: 1; } }

.ace-sc-bar-wrap {
  margin-bottom: 24px; padding: 14px 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
}
.ace-sc-bar-label {
  display: block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted-fg); margin-bottom: 10px;
}
.ace-sc-bar { display: flex; height: 24px; border-radius: 8px; overflow: hidden; gap: 2px; }
.ace-sc-bar-seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 800; min-width: 26px;
  border-radius: 4px; transition: all 0.2s;
}
.ace-sc-bar-seg:hover { opacity: 1 !important; filter: brightness(1.15); transform: scaleY(1.2); }

/* Sub-criteria Grid */
.ace-sc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 18px;
}

/* ── Sub-Criteria Card ── */
.ace-sc {
  background: var(--card); border-radius: 18px; padding: 24px;
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: box-shadow 0.3s, transform 0.25s, border-color 0.3s;
  animation: aceScIn 0.4s ease both;
}
@keyframes aceScIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ace-sc-accent {
  position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  opacity: 0; transition: opacity 0.3s;
}
.ace-sc:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: translateY(-3px); border-color: var(--dp);
}
.ace-sc:hover .ace-sc-accent { opacity: 1; }

.ace-sc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ace-sc-num {
  width: 42px; height: 42px; border-radius: 13px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-sc-meta { flex: 1; min-width: 0; }
.ace-sc-meta-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.ace-sc-code {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px;
  border: 1px solid; font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-sc-pills { display: flex; gap: 6px; margin-left: auto; }
.ace-sc-pill-w {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-sc-pill-e {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  background: var(--muted); color: var(--muted-fg);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-sc-title { font-size: 16px; font-weight: 700; color: var(--foreground); margin: 0; line-height: 1.35; }
.ace-sc-desc { font-size: 13px; color: var(--muted-fg); line-height: 1.85; margin: 0 0 16px; }

/* ── Rubric Button ── */
.ace-rb-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--background); cursor: pointer; transition: all 0.25s;
  font-family: inherit; font-size: 12px; color: var(--foreground);
}
.ace-rb-btn:hover { border-color: var(--dp); background: var(--db); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.ace-rb-btn.open { border-color: var(--dp); background: var(--db); }
.ace-rb-btn-left {
  display: flex; align-items: center; gap: 8px; color: var(--dp);
}
.ace-rb-btn-left .icon { width: 14px; height: 14px; }
.ace-rb-btn-left strong { font-weight: 700; }
.ace-rb-btn-left small { font-weight: 500; color: var(--muted-fg); margin-left: 4px; }
.ace-rb-btn-right { display: flex; align-items: center; gap: 10px; color: var(--muted-fg); }
.ace-rb-pips { display: flex; gap: 3px; }
.ace-rb-pips i { display: block; width: 18px; height: 8px; border-radius: 4px; transition: transform 0.2s; }
.ace-rb-btn:hover .ace-rb-pips i { transform: scaleY(1.3); }

/* ── Rubric Panel ── */
.ace-rb-panel {
  margin-top: 12px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: var(--card);
  animation: aceRbIn 0.3s ease both;
}
@keyframes aceRbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ace-rb-row {
  position: relative; padding: 16px 20px; overflow: hidden;
  border-bottom: 1px solid var(--border); transition: background 0.2s;
}
.ace-rb-row:last-child { border-bottom: none; }
.ace-rb-row:hover { background: color-mix(in srgb, var(--rlc) 4%, var(--card)); }
.ace-rb-row-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--rlc); opacity: 0.04; transition: opacity 0.2s;
  border-radius: 0;
}
.ace-rb-row:hover .ace-rb-row-bar { opacity: 0.07; }
.ace-rb-row-content { position: relative; z-index: 1; }
.ace-rb-row-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.ace-rb-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 5px 14px; border-radius: 8px;
  border: 1px solid;
}
.ace-rb-badge .icon { width: 12px; height: 12px; }
.ace-rb-score {
  font-size: 14px; font-weight: 900;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.ace-rb-text { font-size: 13px; color: var(--muted-fg); line-height: 1.85; margin: 0; }

/* ── Evidence ── */
.ace-ev { margin-top: 16px; }
.ace-ev-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted-fg); margin-bottom: 10px;
}
.ace-ev-head .icon { width: 13px; height: 13px; }
.ace-ev-badge {
  margin-left: 4px; font-size: 10px; font-weight: 800;
  background: var(--dp); color: #fff; padding: 2px 8px; border-radius: 10px;
}
.ace-ev-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.ace-ev-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 9px; font-size: 11.5px; font-weight: 500;
  background: var(--background); border: 1px solid var(--border);
  color: var(--muted-fg); line-height: 1.4; transition: all 0.25s;
}
.ace-ev-pill:hover { border-color: var(--dp); background: var(--db); color: var(--foreground); transform: translateY(-1px); }
.ace-ev-pill i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── Footer Cards ── */
.ace-footer-card {
  margin-bottom: 28px; background: var(--card); border-radius: 22px;
  padding: 32px; border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.ace-fc-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px;
}
.ace-fc-icon-wrap {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.ace-fc-icon-wrap .icon { width: 22px; height: 22px; }
.ace-fc-title { font-size: 20px; font-weight: 800; color: var(--foreground); margin: 0 0 4px; font-family: var(--font-serif); }
.ace-fc-sub { font-size: 13px; color: var(--muted-fg); line-height: 1.7; margin: 0; }
.ace-fc-sub strong { color: var(--foreground); }

/* Evidence Type Grid */
.ace-evt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.ace-evt {
  border-radius: 16px; overflow: hidden;
  background: var(--background); border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s; animation: aceCardIn 0.4s ease both;
}
.ace-evt:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.07); }
.ace-evt-top { padding: 18px 18px 14px; display: flex; align-items: center; gap: 12px; }
.ace-evt-ic {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.ace-evt-ic .icon { width: 18px; height: 18px; }
.ace-evt-name { font-size: 15px; font-weight: 700; color: var(--foreground); margin: 0; }
.ace-evt-desc { font-size: 12px; color: var(--muted-fg); line-height: 1.75; margin: 0; padding: 0 18px 18px; }

/* ── Tier Cards ── */
.ace-tier-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.ace-tier {
  position: relative; overflow: hidden;
  padding: 28px 20px; border-radius: 18px; color: #fff;
  text-align: center; transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s;
  animation: aceCardIn 0.5s ease both;
}
.ace-tier:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 16px 48px rgba(0,0,0,0.25); }
.ace-tier-shine {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 25% 20%, rgba(255,255,255,0.2), transparent 55%);
  pointer-events: none;
}
.ace-tier-icon { position: relative; margin-bottom: 6px; }
.ace-tier-icon .icon { width: 24px; height: 24px; opacity: 0.7; }
.ace-tier-name {
  display: block; font-size: 20px; font-weight: 900; margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2); position: relative;
  font-family: var(--font-serif);
}
.ace-tier-range {
  display: block; font-size: 14px; font-weight: 700; opacity: 0.9;
  font-family: 'SF Mono', 'Fira Code', monospace; position: relative;
  margin-bottom: 10px;
}
.ace-tier-desc {
  font-size: 11px; font-weight: 500; opacity: 0.75; line-height: 1.55;
  position: relative; margin: 0;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ace-sc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .ace-hero-inner { flex-direction: column; padding: 36px 28px; gap: 28px; }
  .ace-hero-kpis { width: 100%; justify-content: center; }
  .ace-hero-h1 { font-size: 30px; }
  .ace-dh-content { flex-direction: column; align-items: flex-start; gap: 20px; }
  .ace-dh-right { flex-direction: row; align-items: center; gap: 16px; width: 100%; }
  .ace-dh-title { font-size: 18px; }
  .ace-scale-track { flex-wrap: wrap; }
  .ace-scale-seg { min-width: calc(50% - 4px); }
  .ace-toolbar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 600px) {
  .ace-hero-inner { padding: 28px 20px; }
  .ace-hero-h1 { font-size: 24px; }
  .ace-hero-kpis { gap: 8px; }
  .ace-kpi { width: 76px; padding: 14px 8px 10px; }
  .ace-kpi-num { font-size: 22px; }
  .ace-arch-bar { height: 40px; }
  .ace-arch-key { font-size: 9px; }
  .ace-arch-pct { font-size: 8px; }
  .ace-dh-content { padding: 20px 20px; }
  .ace-dh-icon-ring { width: 44px; height: 44px; border-radius: 14px; }
  .ace-dh-icon .icon { width: 18px; height: 18px; }
  .ace-dh-title { font-size: 16px; }
  .ace-dh-desc { display: none; }
  .ace-dh-ring-wrap { width: 68px; height: 68px; }
  .ace-dh-ring { width: 68px; height: 68px; }
  .ace-dh-ring-val { font-size: 18px; }
  .ace-sc { padding: 18px; }
  .ace-sc-grid { grid-template-columns: 1fr; }
  .ace-rb-row { padding: 12px 16px; }
  .ace-evt-grid { grid-template-columns: 1fr; }
  .ace-tier-grid { grid-template-columns: 1fr 1fr; }
  .ace-footer-card { padding: 22px; }
  .ace-sc-section { padding: 20px; }
  .ace-scale-seg { min-width: calc(50% - 4px); }
  .ace-fc-head { flex-direction: column; }
}
@media (max-width: 420px) {
  .ace-tier-grid { grid-template-columns: 1fr; }
  .ace-hero-h1 { font-size: 22px; }
}

/* ── Missing utility & component classes ─────────────────── */
.ace-tool-btn-expand { font-weight: 600; }
.ace-y-2 > * + * { margin-top: 8px; }
.ace-y-3 > * + * { margin-top: 12px; }
.ace-y-4 > * + * { margin-top: 16px; }
.ace-y-6 > * + * { margin-top: 24px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.hp-hero-chips { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.fw-tab { cursor: pointer; }
.admin-tab { cursor: pointer; }
.ad-score {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; background: var(--background);
  color: var(--foreground); outline: none; transition: border-color 0.2s;
}
.ad-score:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,150,105,0.12); }
.crit-evidence-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 640px) {
  .crit-evidence-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   MULTI-FACILITY COMPARISON PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Selector Card */
.compare-selector-card .card-content { padding: 16px 20px 20px; }

/* Quick Presets */
.compare-presets {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.compare-presets .btn { font-size: 12px; padding: 4px 10px; }

/* Selected Chips */
.compare-selected-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.compare-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 20px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--chip-color, var(--border));
  font-size: 12px; transition: all 0.2s;
}
.compare-chip:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 0 1px var(--chip-color); }
.compare-chip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.compare-chip-name { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-chip-ues { font-weight: 700; font-size: 11px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.compare-chip-remove {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: none; background: none;
  color: var(--muted-fg); cursor: pointer; border-radius: 50%; padding: 0;
  transition: all 0.15s;
}
.compare-chip-remove:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.compare-chip-remove svg { width: 12px; height: 12px; }

/* Search Row */
.compare-search-row {
  display: flex; gap: 12px; align-items: center; margin-bottom: 14px;
}
.compare-search-wrap {
  flex: 1; position: relative;
}
.compare-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-fg); display: flex; width: 16px; height: 16px;
}
.compare-search-input {
  width: 100%; padding: 8px 12px 8px 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--background); color: var(--foreground);
  outline: none; transition: border-color 0.2s;
}
.compare-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,150,105,0.12); }

/* Facility Grid Selector */
.compare-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.compare-grid-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius); cursor: pointer;
  transition: all 0.15s; border: 1px solid transparent;
}
.compare-grid-item:hover { background: rgba(5,150,105,0.06); }
.compare-grid-item.selected {
  background: rgba(5,150,105,0.08); border-color: var(--primary);
}
.compare-grid-check {
  display: flex; width: 20px; height: 20px; flex-shrink: 0;
  color: var(--muted-fg); transition: color 0.15s;
}
.compare-grid-check svg { width: 20px; height: 20px; }
.compare-grid-item.selected .compare-grid-check { color: var(--primary); }
.compare-grid-info { flex: 1; min-width: 0; }
.compare-grid-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-grid-meta { font-size: 11px; color: var(--muted-fg); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.compare-grid-meta .badge { font-size: 10px; padding: 1px 5px; }
.compare-grid-ues {
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--primary); flex-shrink: 0;
}
.compare-grid-more {
  grid-column: 1 / -1; text-align: center; padding: 12px;
  font-size: 12px; color: var(--muted-fg); font-style: italic;
}

/* Radar Chart */
.compare-radar-card .card-content { padding: 20px; }
.compare-radar-wrap {
  display: flex; gap: 32px; align-items: center;
}
.compare-radar-chart { flex: 1; min-width: 300px; max-width: 460px; }
.compare-radar-svg { width: 100%; height: auto; }
.compare-radar-legend {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  min-width: 220px;
}
.compare-legend-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 6px 10px; border-radius: var(--radius);
  transition: background 0.15s;
}
.compare-legend-item:hover { background: rgba(0,0,0,0.03); }
.compare-legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.compare-legend-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-legend-ues { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.compare-legend-item .badge { font-size: 10px; }

/* Domain Score Matrix */
.compare-matrix-table { font-size: 13px; }
.compare-matrix-table th { font-size: 12px; white-space: nowrap; padding: 8px 10px; }
.compare-matrix-table td { padding: 8px 10px; }
.compare-matrix-table tfoot td { padding: 6px 10px; }
.compare-matrix-row { transition: background 0.15s; }
.compare-matrix-row:hover { background: rgba(5,150,105,0.04); }
.compare-rank-badge {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: white; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.compare-cell-best { font-weight: 700; color: #16a34a; }
.compare-cell-worst { color: #dc2626; }

/* Domain Gap Analysis */
.compare-gap-bars { display: flex; flex-direction: column; gap: 16px; }
.compare-gap-row { display: flex; align-items: center; gap: 16px; }
.compare-gap-label {
  flex: 0 0 280px; font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.compare-gap-bar-wrap { flex: 1; display: flex; align-items: center; gap: 12px; }
.compare-gap-bar-track {
  flex: 1; height: 28px; position: relative;
  background: var(--background); border-radius: 4px;
  border: 1px solid var(--border); overflow: visible;
}
.compare-gap-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 2; cursor: pointer; transition: transform 0.15s;
}
.compare-gap-marker:hover { transform: translate(-50%, -50%) scale(1.3); z-index: 3; }
.compare-gap-range {
  position: absolute; top: 4px; bottom: 4px;
  border-radius: 2px; z-index: 1;
}
.compare-gap-stats {
  flex: 0 0 100px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-variant-numeric: tabular-nums;
}

/* Facility Intelligence Profiles */
.compare-profiles { display: flex; flex-direction: column; gap: 16px; }
.compare-profile-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow 0.2s;
  border-left: 4px solid var(--profile-color);
}
.compare-profile-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.compare-profile-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; background: rgba(0,0,0,0.01);
  border-bottom: 1px solid var(--border);
}
.compare-profile-rank {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  color: white; font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.compare-profile-info { flex: 1; min-width: 0; }
.compare-profile-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.compare-profile-meta {
  font-size: 12px; color: var(--muted-fg); margin-top: 4px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.compare-profile-meta .badge { font-size: 10px; }
.compare-profile-meta svg { width: 13px; height: 13px; }
.compare-profile-body { padding: 16px 20px; }
.compare-profile-stats {
  display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px;
}
.compare-profile-stat { display: flex; flex-direction: column; gap: 2px; }
.compare-stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-fg); }
.compare-stat-value { font-size: 13px; font-weight: 600; }
.compare-profile-domains { margin-bottom: 0; }
.compare-profile-sw {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.compare-sw-section { display: flex; flex-direction: column; gap: 6px; }
.compare-sw-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 4px;
}
.compare-sw-label svg { width: 13px; height: 13px; }
.compare-sw-item {
  font-size: 12px; padding: 3px 8px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.compare-sw-strength { background: rgba(34,197,94,0.08); color: #16a34a; }
.compare-sw-weakness { background: rgba(245,158,11,0.08); color: #d97706; }
.compare-profile-bar {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
}
.compare-bar-segment { transition: opacity 0.3s; }

/* Responsive */
@media (max-width: 1024px) {
  .compare-radar-wrap { flex-direction: column; align-items: stretch; }
  .compare-radar-legend { min-width: auto; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .compare-gap-label { flex: 0 0 140px; font-size: 11px; }
  .compare-gap-stats { flex: 0 0 80px; }
}
@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr; max-height: 280px; }
  .compare-search-row { flex-direction: column; }
  .compare-gap-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .compare-gap-label { flex: none; }
  .compare-gap-stats { flex: none; justify-content: center; }
  .compare-profile-stats { gap: 12px; }
  .compare-profile-sw { flex-direction: column; gap: 12px; }
  .compare-presets { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .compare-chip-name { max-width: 120px; }
  .compare-legend-name { max-width: 120px; }
}

/* RTL Support for Compare */
[dir="rtl"] .compare-chip { flex-direction: row-reverse; }
[dir="rtl"] .compare-grid-item { flex-direction: row-reverse; }
[dir="rtl"] .compare-profile-header { flex-direction: row-reverse; }
[dir="rtl"] .compare-profile-card { border-left: none; border-right: 4px solid var(--profile-color); }
[dir="rtl"] .compare-search-icon { left: auto; right: 12px; }
[dir="rtl"] .compare-search-input { padding: 8px 36px 8px 12px; }
[dir="rtl"] .compare-matrix-table th:first-child,
[dir="rtl"] .compare-matrix-table td:first-child { position: sticky; right: 0; left: auto; }

