/* ==============================================
   Directorio Institucional · CESFAM La Unión
   Design System unificado con Portal de Herramientas
   ============================================== */

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

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

/* ══════════════════════════════════════════════
   DESIGN TOKENS — Light Mode
   ══════════════════════════════════════════════ */
:root {
  --bg-body: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-header: #0F172A;
  --bg-nav: #1E293B;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;

  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-subtle: #DBEAFE;
  --gold: #D97706;

  --success: #059669;
  --warning: #D97706;

  --border: #E2E8F0;
  --border-hover: #CBD5E1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02),
    0 4px 8px rgba(0, 0, 0, 0.03), 0 8px 16px rgba(0, 0, 0, 0.03),
    0 16px 32px rgba(0, 0, 0, 0.03);
  --shadow-glow-gold: 0 0 20px rgba(217, 119, 6, 0.2);

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.6875rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);

  --max-w: 1400px;
  --header-h: 60px;
  --sidebar-w: 240px;
}

/* ══════════════════════════════════════════════
   DESIGN TOKENS — Dark Mode
   ══════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg-body: #0B1120;
  --bg-surface: #151D2E;
  --bg-elevated: #1C2640;
  --bg-header: #080E1A;
  --bg-nav: #0F1629;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;

  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-subtle: rgba(59, 130, 246, 0.12);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-glow-gold: 0 0 24px rgba(245, 158, 11, 0.12);
}

/* ══════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════ */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-body);
  transition: background var(--t-base), color var(--t-base);
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

/* ══════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════ */
.header {
  position: relative;
  z-index: 100;
  background: #0F172A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .header {
  background: #080E1A;
}

.header-top-bar {
  position: sticky;
  top: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  height: 42px;
}

@supports (backdrop-filter: blur(12px)) {
  .header-top-bar {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
  }
}

[data-theme="dark"] .header-top-bar {
  background: rgba(8, 14, 26, 0.92);
}

@supports (backdrop-filter: blur(12px)) {
  [data-theme="dark"] .header-top-bar {
    background: rgba(8, 14, 26, 0.78);
  }
}

.header-top-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.header-clock {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.clock-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
}

.clock-time {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: var(--fs-base);
}

.header-actions {
  display: flex;
  align-items: center;
}

/* THEME TOGGLE */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background var(--t-base);
  display: flex;
  align-items: center;
  padding: 3px;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.toggle-thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FBBF24;
  left: 3px;
  transition: transform var(--t-base), background var(--t-base);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-thumb svg {
  width: 12px;
  height: 12px;
  color: #78350F;
  transition: color var(--t-base);
}

[data-theme="dark"] .toggle-thumb {
  transform: translateX(24px);
  background: #334155;
}

[data-theme="dark"] .toggle-thumb svg {
  color: #CBD5E1;
}

/* NAVBAR */
.navbar {
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.navbar::-webkit-scrollbar {
  display: none;
}

.navbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.navbar .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  transition: all var(--t-fast);
  text-decoration: none;
}

.navbar .nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.navbar .nav-btn:active {
  transform: scale(0.97);
}

.navbar .nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.navbar .nav-btn--gold {
  background: rgba(217, 119, 6, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.navbar .nav-btn--gold:hover {
  background: rgba(217, 119, 6, 0.25);
  color: #FDE68A;
  box-shadow: var(--shadow-glow-gold);
}

/* HEADER MAIN */
.header-main {
  background: #0F172A;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
}

[data-theme="dark"] .header-main {
  background: #080E1A;
}

.header-main-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--sp-8);
}

.header-brand {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.header-logo {
  height: 120px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: height var(--t-base), transform var(--t-base);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-logo:hover {
  transform: translateY(-1px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  justify-content: flex-start;
  width: 100%;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-pill);
  color: #34D399;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.05);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* HEADER SEARCH */
.header-search-container {
  flex: 1;
  max-width: 640px;
  min-width: 320px;
}

.header-search-container .search-bar {
  position: relative;
  margin-bottom: 0;
}

.header-search-container .search-input {
  width: 100%;
  padding: 11px 60px 11px 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: var(--fs-sm);
  transition: all var(--t-fast);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.header-search-container .search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.header-search-container .search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.header-search-container .search-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 1;
}

.search-kbd-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
  transition: opacity var(--t-fast);
  z-index: 1;
}

.header-search-container .search-input:focus~.search-kbd-hint,
.header-search-container .search-input:not(:placeholder-shown)~.search-kbd-hint {
  opacity: 0;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: all var(--t-fast);
  z-index: 2;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.clear-btn svg {
  width: 14px;
  height: 14px;
}

@keyframes search-attract {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.28);
  }
}

.header-search-container.attract .search-input {
  animation: search-attract 1.6s ease-out 1;
}

/* ══════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h, 150px));
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: var(--header-h, 0px);
  height: calc(100vh - var(--header-h, 0px));
  overflow-y: auto;
  z-index: 90;
  transition: background var(--t-base), border-color var(--t-base);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.side-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.side-nav-btn .material-icons-round {
  font-size: 20px;
  opacity: .6;
  transition: opacity var(--t-fast);
}

.side-nav-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.side-nav-btn:hover .material-icons-round {
  opacity: 1;
}

.side-nav-btn.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.side-nav-btn.active .material-icons-round {
  opacity: 1;
}

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

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--text-tertiary);
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-body);
  border-radius: 20px;
}

/* MAIN CONTENT */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px;
  min-width: 0;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-content: start;
}

/* CONTACT CARD (scoped to avoid conflicts with any generic .card-* names) */
.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-base);
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

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

.contact-card .card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-card .card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-card .card-avatar .material-icons-round {
  font-size: 20px;
}

.contact-card .card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.contact-card .card-subtitle {
  font-size: .73rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 1px;
}

.contact-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contact-card .card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.contact-card .card-row .material-icons-round {
  font-size: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

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

/* Search-highlight on a contact card after picking from cmdk */
.contact-card.search-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-md);
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  color: var(--text-tertiary);
  text-align: center;
}

.empty-state .material-icons-round {
  font-size: 56px;
  opacity: .35;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: .85rem;
}

.hidden {
  display: none !important;
}

/* MOBILE MENU */
.mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(59, 130, 246, .35);
  place-items: center;
  color: #fff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 90;
  backdrop-filter: blur(3px);
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.footer {
  background: var(--bg-header);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6) var(--sp-8);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-8);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer-brand img,
.footer-logo {
  height: auto;
  width: auto;
  max-height: 96px;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.9;
  align-self: flex-start;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: var(--fs-sm);
  line-height: 1.6;
  opacity: 0.6;
}

.footer h4 {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer li {
  font-size: var(--fs-sm);
}

.footer li span {
  opacity: 0.5;
}

.footer a {
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--t-fast);
  text-decoration: none;
}

.footer a:hover {
  color: #FFFFFF;
}

.footer-social-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-social-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer-social-link:hover {
  color: #FFFFFF;
}

.footer-social-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--fs-xs);
  opacity: 0.35;
}

/* ══════════════════════════════════════════════
   SCROLLBAR + ACCESSIBILITY
   ══════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .header-search-container.attract .search-input {
    animation: none;
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8) var(--sp-6);
  }
}

@media (max-width: 768px) {
  .header-main-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .header-brand {
    justify-content: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: flex-start;
    gap: var(--sp-4);
  }

  .header-search-container {
    max-width: 100%;
    flex: 1;
    min-width: 0;
  }

  .header-logo {
    height: 70px;
  }

  .navbar-inner {
    padding: var(--sp-2) var(--sp-4);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    transition: transform .28s var(--ease);
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }
}

/* ══════════════════════════════════════════════
   COMMAND PALETTE (Ctrl+K)
   ══════════════════════════════════════════════ */
.cmdk[hidden] {
  display: none;
}

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.cmdk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cmdk-fade-in 160ms ease-out;
}

.cmdk-panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(37, 99, 235, 0.15);
  overflow: hidden;
  animation: cmdk-pop-in 180ms cubic-bezier(.2, .9, .3, 1.2);
}

[data-theme="light"] .cmdk-panel {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.10);
}

@keyframes cmdk-fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes cmdk-pop-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cmdk-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .cmdk-search {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.65);
}

.cmdk-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 16px;
  padding: 4px 0;
}

[data-theme="light"] .cmdk-input {
  color: #0F172A;
}

.cmdk-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .cmdk-input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

.cmdk-esc {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .cmdk-esc {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.15);
  color: rgba(15, 23, 42, 0.7);
}

.cmdk-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.cmdk-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 12px 6px;
}

[data-theme="light"] .cmdk-group-label {
  color: rgba(15, 23, 42, 0.5);
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.92);
  transition: background 80ms ease;
}

[data-theme="light"] .cmdk-item {
  color: #0F172A;
}

.cmdk-item:hover,
.cmdk-item[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .cmdk-item:hover,
[data-theme="light"] .cmdk-item[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.10);
}

.cmdk-item-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  flex-shrink: 0;
}

[data-theme="light"] .cmdk-item-icon {
  background: rgba(15, 23, 42, 0.05);
  color: #0F172A;
}

.cmdk-item-icon .material-icons-round {
  font-size: 18px;
}

.cmdk-item-body {
  flex: 1;
  min-width: 0;
}

.cmdk-item-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmdk-item-title mark {
  background: rgba(37, 99, 235, 0.35);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.cmdk-item-desc {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.cmdk-item-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
}

[data-theme="light"] .cmdk-item-tag {
  background: var(--accent-subtle);
  color: var(--accent);
}

.cmdk-empty {
  padding: 32px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

[data-theme="light"] .cmdk-empty {
  color: rgba(15, 23, 42, 0.55);
}

.cmdk-footer {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .cmdk-footer {
  border-top-color: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.55);
  background: rgba(15, 23, 42, 0.02);
}

.cmdk-footer kbd {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
}

[data-theme="light"] .cmdk-footer kbd {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {

  .cmdk-backdrop,
  .cmdk-panel {
    animation: none;
  }
}

@media (max-width: 640px) {
  .cmdk {
    padding-top: 8vh;
  }

  .cmdk-panel {
    width: calc(100vw - 16px);
    max-height: 80vh;
  }

  .cmdk-item-desc {
    display: none;
  }
}
