/* ============================================================================
 * AIM ÆGIS — Component Stylesheet
 * ============================================================================
 * Built on top of tokens.css. Component-driven, classical-sovereign aesthetic.
 * ========================================================================= */

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  background: var(--bg-base);
  color: var(--fg-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top left, rgba(201, 169, 97, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(91, 127, 217, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-soft); }

img, svg { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, textarea, select {
  font: inherit;
  background: var(--bg-elevated);
  color: var(--fg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}
input::placeholder { color: var(--fg-tertiary); }

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--fg-primary);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

.display-hero {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(var(--fs-3xl), 7vw, var(--fs-5xl));
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.serif-accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--accent);
}

.mono { font-family: var(--font-mono); }

/* ===== Layout ===== */
.container { max-width: var(--container-base); margin: 0 auto; padding: 0 var(--sp-6); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--sp-6); }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--sp-6); }

.section { padding: var(--sp-24) 0; }
.section-sm { padding: var(--sp-12) 0; }
.section-lg { padding: var(--sp-24) 0 var(--sp-20); }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
  margin: var(--sp-12) 0;
}

/* ===== Brand Logo ===== */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: var(--ls-tight);
  color: var(--fg-primary);
  text-transform: uppercase;
}
.brand .brand-aim { color: var(--fg-primary); }
.brand .brand-space { width: 0.4em; }
.brand .brand-aegis { color: var(--fg-primary); }
.brand .brand-ae {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}

/* Large brand for hero contexts */
.brand-large { font-size: var(--fs-3xl); letter-spacing: -0.04em; }

/* ===== Top Navigation ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--topnav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  max-width: var(--container-wide);
  margin: 0 auto;
}
.topnav-links {
  display: flex;
  gap: var(--sp-8);
  align-items: center;
}
.topnav-link {
  color: var(--fg-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.topnav-link:hover { color: var(--fg-primary); }

/* Botón hamburguesa: oculto en desktop, visible en móvil (media query abajo) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle .nav-toggle-close { display: none; }
.nav-toggle.is-open .nav-toggle-open { display: none; }
.nav-toggle.is-open .nav-toggle-close { display: block; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: var(--ls-wide);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--bg-deep);
  box-shadow: var(--shadow-gold);
}

.btn-secondary {
  background: transparent;
  color: var(--fg-primary);
  border-color: var(--border-bright);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
}
.btn-ghost:hover { color: var(--accent); }

.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: var(--fs-base); }
.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: all var(--transition-base);
}
.card:hover { border-color: var(--border-bright); }

.card-accent {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-gold);
}

.card-header {
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}

/* ===== Module Cards (Dashboard) ===== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.module-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.module-card:hover::before { opacity: 1; }
.module-code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.module-title { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.module-description { font-size: var(--fs-sm); color: var(--fg-secondary); line-height: var(--lh-relaxed); }

/* ===== Status Pills ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-wide);
  border-radius: var(--r-full);
  text-transform: uppercase;
}
.pill-draft { background: rgba(107, 114, 134, 0.15); color: var(--fg-secondary); }
.pill-review { background: var(--amber-soft); color: var(--amber); }
.pill-approved { background: var(--green-soft); color: var(--green); }
.pill-rejected { background: var(--red-soft); color: var(--red); }
.pill-signed { background: var(--accent-glow); color: var(--accent); }

/* ===== Forms ===== */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: var(--sp-2);
}
.form-help { font-size: var(--fs-xs); color: var(--fg-tertiary); margin-top: var(--sp-2); }

/* ===== Flash messages ===== */
.flash-messages { margin-bottom: var(--sp-6); }
.flash {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  border-left: 3px solid;
  margin-bottom: var(--sp-3);
}
.flash-info { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.flash-error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.flash-success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.flash-warning { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

/* ===== Hero (Landing) ===== */
.hero {
  padding: var(--sp-24) 0 var(--sp-20);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow { margin-bottom: var(--sp-6); }
.hero-title { margin-bottom: var(--sp-6); }
.hero-subtitle {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-secondary);
  margin-bottom: var(--sp-10);
}
.hero-cta { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-24);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-6);
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-tertiary);
  letter-spacing: var(--ls-wide);
}
.footer-links { display: flex; gap: var(--sp-6); }
.footer-link { font-size: var(--fs-sm); color: var(--fg-secondary); }
.footer-link:hover { color: var(--accent); }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-secondary { color: var(--fg-secondary); }
.text-tertiary { color: var(--fg-tertiary); }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.hidden { display: none; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .topnav-inner { position: relative; }
  .topnav-links {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--sp-6);
    background: var(--bg-base);
    border-bottom: 1px solid transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base, 240ms) ease,
                padding var(--transition-base, 240ms) ease,
                border-color var(--transition-base, 240ms) ease;
  }
  .topnav-links.open {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: var(--sp-2) var(--sp-6) var(--sp-4);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-lg);
  }
  .topnav-links > * { flex-shrink: 0; }
  .topnav-link {
    display: block;
    padding: var(--sp-3) 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border);
  }
  .topnav-links .btn {
    width: 100%;
    margin-top: var(--sp-3);
  }
  .topnav-links .cmdk-trigger {
    align-self: flex-start;
    margin: var(--sp-3) 0;
  }
  .section { padding: var(--sp-16) 0; }
  .hero { padding: var(--sp-16) 0; }
  .module-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .topnav-links { transition: none; }
}

/* ===== Cockpit & motion (v1.47) ===== */
/* Reveal-on-scroll: starts hidden, animates in when .is-revealed is added. */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .7s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* The living command center. */
.cockpit {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) 1.3fr 1.1fr;
  gap: var(--sp-6);
  align-items: stretch;
  padding: var(--sp-6) var(--sp-7);
}
.cockpit-cell { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cockpit-divider { border-left: 1px solid var(--border); }

/* Radial gauge */
.gauge { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); display: block; }
.gauge-track { fill: none; stroke: var(--border); }
.gauge-arc   { fill: none; stroke: var(--accent); stroke-linecap: round; }
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.gauge-value { font-size: 40px; font-weight: 800; line-height: 1; color: var(--fg-primary); letter-spacing: -1px; }
.gauge-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-wide); color: var(--fg-tertiary); margin-top: 6px; text-transform: uppercase; }

/* Segmented distribution bar */
.seg-bar { display: flex; height: 12px; border-radius: 7px; overflow: hidden; background: var(--bg-elevated); }
.seg { height: 100%; width: 0; }
.seg + .seg { box-shadow: -1px 0 0 var(--bg-card); }
.seg-legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); }
.seg-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--fg-secondary); }
.seg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Mini coverage bar */
.mini-bar { height: 8px; border-radius: 5px; background: var(--bg-elevated); overflow: hidden; }
.mini-bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; }

/* Runway (regulatory timeline) */
.runway { display: flex; flex-direction: column; gap: 2px; }
.runway-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border);
}
.runway-row:last-child { border-bottom: 0; }
.runway-date { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; color: var(--fg-primary); min-width: 58px; }
.runway-fw { font-size: var(--fs-xs); color: var(--fg-secondary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runway-days { font-family: var(--font-mono); font-size: 10px; letter-spacing: .5px; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; }

.module-card, .card { transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .25s ease, box-shadow .25s ease; }

@media (max-width: 860px) {
  .cockpit { grid-template-columns: 1fr; gap: var(--sp-5); }
  .cockpit-divider { border-left: 0; border-top: 1px solid var(--border); padding-top: var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ===== Coverage heatmap (v1.47) ===== */
.heatmap-wrap { overflow-x: auto; padding-bottom: var(--sp-2); }
.heatmap { display: grid; gap: 5px 5px; align-items: center; min-width: max-content; }
.heat-head { font-family: var(--font-mono); font-size: 9px; letter-spacing: .5px; color: var(--fg-tertiary); text-align: center; padding-bottom: 6px; white-space: nowrap; }
.heat-name { font-size: var(--fs-xs); color: var(--fg-primary); white-space: nowrap; padding-right: var(--sp-3); text-align: right; overflow: hidden; text-overflow: ellipsis; }
.heat-cell { height: 26px; border-radius: 5px; border: 1px solid var(--border); transition: transform .12s ease; cursor: default; }
.heat-cell:hover { transform: scale(1.18); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.heat-pct { font-family: var(--font-mono); font-size: 11px; font-weight: 800; padding-left: var(--sp-3); white-space: nowrap; }
.heat-legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-5); }
.heat-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--fg-secondary); }
.heat-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0; }

/* ===== Radar runway (horizontal timeline, v1.49) ===== */
.runway-track-wrap { overflow-x: auto; padding-bottom: var(--sp-3); }
.runway-track {
  position: relative; display: flex; align-items: flex-start; gap: var(--sp-5);
  min-width: max-content; padding: var(--sp-2) var(--sp-4) 28px;
}
.runway-track::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 16px; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--accent) 45%, var(--border));
  border-radius: 2px;
}
.runway-now {
  align-self: flex-end; font-family: var(--font-mono); font-size: 9px; font-weight: 800;
  letter-spacing: var(--ls-wide); color: var(--fg-primary); background: var(--bg-elevated);
  border: 1px solid var(--border-bright); padding: 3px 8px; border-radius: 20px;
  margin-bottom: 6px; position: relative; z-index: 2; white-space: nowrap;
}
.runway-node { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.runway-node-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-top-width: 2px;
  border-radius: var(--r-sm); padding: 8px 10px; text-align: center; width: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.runway-node:hover .runway-node-card { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.runway-stem { width: 2px; height: 14px; margin-top: 2px; }
.runway-dot { width: 11px; height: 11px; border-radius: 50%; position: relative; z-index: 2; }

/* ===== Page transitions + motion polish + atmosphere (v1.50) ===== */
/* Cross-document view transitions (progressive: ignored where unsupported). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* Smooth in-page scrolling. */
html { scroll-behavior: smooth; }

/* Tasteful lift on interactive (link-wrapped) cards. */
a:hover > .card { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.16); border-color: var(--border-accent); }

/* Atmosphere: a faint brand glow behind the whole app (adapts to theme). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 82% -12%, var(--accent-glow), transparent 62%),
    radial-gradient(820px 460px at -12% 112%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ===== Command palette ⌘K (v1.51) ===== */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--fg-tertiary); border-radius: 20px; padding: 5px 10px;
  font-family: var(--font-mono); transition: color .15s ease, border-color .15s ease;
}
.cmdk-trigger:hover { color: var(--fg-primary); border-color: var(--border-accent); }
.cmdk-trigger-kbd { font-size: 10px; letter-spacing: .5px; font-weight: 700; }

.cmdk-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: center;
  align-items: flex-start; padding-top: 12vh;
  background: color-mix(in srgb, var(--bg-base) 55%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .16s ease;
}
.cmdk-overlay.is-open { opacity: 1; }
.cmdk-panel {
  width: min(560px, 92vw); max-height: 64vh; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border-bright);
  border-radius: var(--r-md); box-shadow: 0 24px 64px rgba(0,0,0,.4);
  overflow: hidden; transform: translateY(-8px) scale(.99); transition: transform .16s cubic-bezier(.22,1,.36,1);
}
.cmdk-overlay.is-open .cmdk-panel { transform: none; }
.cmdk-search { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.cmdk-kbd { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .5px; flex-shrink: 0; }
.cmdk-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--fg-primary); font-size: var(--fs-md); font-family: var(--font-sans); }
.cmdk-input::placeholder { color: var(--fg-tertiary); }
.cmdk-esc { font-family: var(--font-mono); font-size: 9px; color: var(--fg-tertiary); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }
.cmdk-list { overflow-y: auto; padding: var(--sp-2); }
.cmdk-item {
  display: flex; align-items: baseline; gap: var(--sp-3); justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); text-decoration: none;
  color: var(--fg-secondary); cursor: pointer;
}
.cmdk-item.is-active { background: var(--accent-glow); color: var(--fg-primary); box-shadow: inset 2px 0 0 var(--accent); }
.cmdk-item-label { font-size: var(--fs-sm); font-weight: 600; }
.cmdk-item-hint { font-size: var(--fs-xs); color: var(--fg-tertiary); font-family: var(--font-mono); }
.cmdk-empty { padding: var(--sp-6); text-align: center; color: var(--fg-tertiary); font-size: var(--fs-sm); }

@media (max-width: 640px) { .cmdk-trigger-kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .cmdk-overlay, .cmdk-panel { transition: none; }
}

/* ===== Empty states (v1.52) ===== */
.empty-state { text-align: center; padding: var(--sp-12) var(--sp-6); }
.empty-state-icon { width: 46px; height: 46px; margin: 0 auto var(--sp-4); color: var(--accent); opacity: .65; }
.empty-state-icon svg { width: 100%; height: 100%; }
.empty-state-title { font-size: var(--fs-md); font-weight: 700; color: var(--fg-secondary); margin-bottom: var(--sp-2); }
.empty-state-body { max-width: 440px; margin: 0 auto var(--sp-5); color: var(--fg-tertiary); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }

/* ============================================================================
 * Indicadores de carga (feedback de respuesta) — identidad ÆGIS
 * Evitan la sensación de "app bloqueada" en navegación y envío de formularios,
 * especialmente durante el arranque en frío del servidor.
 * ============================================================================ */

/* Barra de progreso superior (navegación entre páginas) */
#aegis-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-soft));
  box-shadow: 0 0 8px var(--accent-glow);
  z-index: 99999;
  opacity: 0;
  transition: width 200ms ease-out, opacity 300ms ease-out;
  pointer-events: none;
}
#aegis-progress.active { opacity: 1; }

/* Spinner reutilizable */
.aegis-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: aegis-spin 600ms linear infinite;
}
@keyframes aegis-spin { to { transform: rotate(360deg); } }

/* Botón en estado "cargando": atenúa y bloquea interacción */
button.is-loading, .btn.is-loading, [type="submit"].is-loading {
  cursor: progress;
  opacity: 0.85;
  pointer-events: none;
}
button.is-loading .aegis-spinner, .btn.is-loading .aegis-spinner { margin-right: 0.5em; }

/* Overlay de "despertando" (arranque en frío, navegación lenta) */
#aegis-waking {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  backdrop-filter: blur(2px);
}
#aegis-waking.show { display: flex; }
#aegis-waking .wake-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: 12px;
  color: var(--text, #ECEEF2);
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
#aegis-waking .aegis-spinner {
  width: 20px; height: 20px;
  border-width: 3px;
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .aegis-spinner { animation-duration: 1200ms; }
  #aegis-progress { transition: opacity 300ms ease-out; }
}
