/* ══════════════════════════════════════
   CRÉDITOS JS — Estilos globales
   Compartidos por todas las páginas
══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&family=Courier+Prime:wght@400;700&family=Bebas+Neue&display=swap');

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

/* ── MODO NOCHE (default) ── */
:root {
  --bg:       #05080f;
  --surface:  #0b0e18;
  --s2:       #0f1220;
  --border:   #252a3a;
  --accent:   #d4af37;
  --accent-light: #fbe28a;
  --accent-dark:  #b8941f;
  --cyan:     #fbe28a;
  --amber:    #d4af37;
  --red:      #f87171;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --sans:     'Syne', sans-serif;
  --mono:     'DM Mono', monospace;
  --courier:  'Courier Prime', 'Courier New', monospace;
  --bebas:    'Bebas Neue', sans-serif;
}

/* ── MODO DÍA ── */
body.modo-dia {
  --bg:      #f1f5f9;
  --surface: #ffffff;
  --s2:      #f8fafc;
  --border:  #cbd5e1;
  --accent:  #16a34a;
  --cyan:    #0891b2;
  --amber:   #d97706;
  --red:     #dc2626;
  --text:    #0f172a;
  --muted:   #64748b;
}

body.modo-dia { background: var(--bg) !important; color: var(--text) !important; }

/* ── NAV día ── */
body.modo-dia nav {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
body.modo-dia .nav-logo       { color: #0f172a !important; }
body.modo-dia .nav-sep        { color: #e2e8f0 !important; }
body.modo-dia .nav-link       { color: #64748b !important; border-bottom-color: transparent !important; background: none !important; border-left: none !important; border-right: none !important; border-top: none !important; }
body.modo-dia .nav-link:hover { color: #0f172a !important; border-bottom-color: #94a3b8 !important; background: none !important; }
body.modo-dia .nav-link.active{ color: #16a34a !important; border-bottom-color: #16a34a !important; background: none !important; }

/* ── HEADER / HERO día ── */
body.modo-dia header,
body.modo-dia .hero {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.modo-dia h1          { color: #0f172a !important; }
body.modo-dia h1 span     { color: #16a34a !important; }
body.modo-dia h1 em       { color: #16a34a !important; }
body.modo-dia .header-sub { color: #64748b !important; }
body.modo-dia .hero p     { color: #64748b !important; }

/* Stats */
body.modo-dia .stat       { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.modo-dia .stat-label { color: #64748b !important; }

/* ── TOOLBAR día ── */
body.modo-dia .toolbar { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .count-info { color: #64748b !important; }

/* Inputs y selects */
body.modo-dia input,
body.modo-dia select {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
body.modo-dia input::placeholder { color: #94a3b8 !important; }
body.modo-dia input:focus,
body.modo-dia select:focus { border-color: #16a34a !important; box-shadow: 0 0 0 3px rgba(22,163,74,.1) !important; }
body.modo-dia .search-wrap svg,
body.modo-dia .search-icon { color: #94a3b8 !important; }

/* ── TARJETAS día ── */
body.modo-dia .card      { background: #ffffff !important; border-color: #e2e8f0 !important; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
body.modo-dia .card:hover{ border-color: #94a3b8 !important; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
body.modo-dia .card.expanded { border-color: #16a34a !important; }
body.modo-dia .card-name { color: #0f172a !important; }
body.modo-dia .card-detail { border-color: #e2e8f0 !important; }
body.modo-dia .ck        { color: #64748b !important; }
body.modo-dia .cv        { color: #1e293b !important; }
body.modo-dia .nv        { color: #94a3b8 !important; }
body.modo-dia .id-badge,
body.modo-dia [style*="background:var(--s2)"] { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #16a34a !important; }

/* ── TABLA día ── */
body.modo-dia table     { color: #0f172a !important; }
body.modo-dia thead th  { color: #64748b !important; border-color: #e2e8f0 !important; background: #f8fafc !important; }
body.modo-dia tbody tr  { border-color: #e2e8f0 !important; }
body.modo-dia tbody tr:hover { background: #f8fafc !important; }
body.modo-dia td.name   { color: #0f172a !important; }
body.modo-dia td.mono   { color: #475569 !important; }
body.modo-dia td        { color: #1e293b !important; }

/* ── MODAL / BUSCADOR día ── */
body.modo-dia .result-item  { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .result-item:hover { background: #f8fafc !important; border-color: #16a34a !important; }
body.modo-dia .ri-name      { color: #0f172a !important; }
body.modo-dia .ri-tag       { color: #64748b !important; }
body.modo-dia .ri-num       { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.modo-dia .overlay      { background: rgba(0,0,0,.5) !important; }
body.modo-dia .modal        { background: #ffffff !important; border-color: #e2e8f0 !important; box-shadow: 0 20px 60px rgba(0,0,0,.2) !important; }
body.modo-dia .modal-handle { background: #e2e8f0 !important; }
body.modo-dia .modal-name   { color: #0f172a !important; }
body.modo-dia .modal-id     { color: #64748b !important; }
body.modo-dia .mg-cell      { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.modo-dia .mg-key       { color: #64748b !important; }
body.modo-dia .mg-val       { color: #1e293b !important; }
/* Clases de fecha — máxima especificidad para ganar a td y .mg-val */
.fecha-vencida,
td.fecha-vencida,
.mg-val.fecha-vencida,
.cv.fecha-vencida             { color: #f87171 !important; }

.fecha-hoy,
td.fecha-hoy,
.mg-val.fecha-hoy,
.cv.fecha-hoy                 { color: #f59e0b !important; }

.fecha-normal,
td.fecha-normal,
.mg-val.fecha-normal,
.cv.fecha-normal              { color: #64748b !important; }

body.modo-dia .fecha-vencida,
body.modo-dia td.fecha-vencida,
body.modo-dia .mg-val.fecha-vencida,
body.modo-dia .cv.fecha-vencida { color: #dc2626 !important; }

body.modo-dia .fecha-hoy,
body.modo-dia td.fecha-hoy,
body.modo-dia .mg-val.fecha-hoy,
body.modo-dia .cv.fecha-hoy     { color: #d97706 !important; }

body.modo-dia .fecha-normal,
body.modo-dia td.fecha-normal,
body.modo-dia .mg-val.fecha-normal,
body.modo-dia .cv.fecha-normal  { color: #64748b !important; }
body.modo-dia .close-btn    { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.modo-dia .mf-btn       { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #1e293b !important; }
body.modo-dia .mf-btn.primary { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
body.modo-dia .modal-footer { border-color: #e2e8f0 !important; }

/* Hint / empty */
body.modo-dia .hint         { color: #64748b !important; }
body.modo-dia .hint strong  { color: #0f172a !important; }
body.modo-dia .status-bar   { color: #64748b !important; }
body.modo-dia .filter-chip  { background: #ffffff !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.modo-dia .filter-chip.on { background: rgba(22,163,74,.1) !important; border-color: #16a34a !important; color: #16a34a !important; }

/* Formulario recibo */
body.modo-dia .receipt-form  { border-color: #e2e8f0 !important; }
body.modo-dia .rf-label      { color: #64748b !important; }
body.modo-dia .rf-input      { background: #f8fafc !important; color: #0f172a !important; border-color: #cbd5e1 !important; }
body.modo-dia .rf-title      { color: #64748b !important; }

/* Paginación */
body.modo-dia .pbtn          { background: #ffffff !important; border-color: #e2e8f0 !important; color: #475569 !important; }
body.modo-dia .pbtn:hover:not(:disabled) { background: #f1f5f9 !important; }
body.modo-dia .pbtn.active   { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
body.modo-dia .pagination    { border-color: #e2e8f0 !important; }

/* Admin */
body.modo-dia .admin-wrap    { color: #0f172a !important; }
body.modo-dia .admin-header h1 { color: #0f172a !important; }
body.modo-dia .admin-sub     { color: #64748b !important; }
body.modo-dia .users-table-wrap { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .users-table thead th { color: #64748b !important; border-color: #e2e8f0 !important; background: #f8fafc !important; }
body.modo-dia .users-table tbody tr { border-color: #e2e8f0 !important; }
body.modo-dia .users-table tbody tr:hover { background: #f8fafc !important; }
body.modo-dia .user-name     { color: #0f172a !important; }
body.modo-dia .user-handle   { color: #64748b !important; }
body.modo-dia .action-btn    { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }

/* Convertir BD */
body.modo-dia .conv-header h1  { color: #0f172a !important; }
body.modo-dia .drop-zone       { background: #ffffff !important; border-color: #cbd5e1 !important; }
body.modo-dia .drop-zone:hover { background: #f8fafc !important; border-color: #16a34a !important; }
body.modo-dia .drop-title      { color: #0f172a !important; }
body.modo-dia .cols-info       { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .sql-wrap        { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .sql-header      { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.modo-dia .sql-code        { color: #1e293b !important; background: #f8fafc !important; }
body.modo-dia .preview-wrap    { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.modo-dia .preview-table th { background: #f1f5f9 !important; color: #64748b !important; }
body.modo-dia .preview-table td { color: #1e293b !important; border-color: #e2e8f0 !important; }
body.modo-dia .status-box.ok   { background: rgba(22,163,74,.08) !important; }
body.modo-dia .status-box.err  { background: rgba(220,38,38,.08) !important; }

/* Scrollbar */
body.modo-dia ::-webkit-scrollbar-track { background: #f1f5f9 !important; }
body.modo-dia ::-webkit-scrollbar-thumb { background: #cbd5e1 !important; }

/* ── BOTÓN TEMA ── */
.theme-btn {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: .38rem .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
  margin-left: auto;
}
.theme-btn:hover { border-color: #d4af37; color: #d4af37; background: rgba(212,175,55,.08); }
body.modo-dia .theme-btn       { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.modo-dia .theme-btn:hover { border-color: #d97706 !important; color: #d97706 !important; background: rgba(217,119,6,.08) !important; }

/* ── BOTÓN HUELLA (barra de escritorio) ── */
.huella-nav-btn {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: .38rem .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
  margin-left: .4rem;
}
.huella-nav-btn:hover { border-color: #d4af37; color: #d4af37; background: rgba(212,175,55,.08); }
.huella-nav-btn.active { border-color: #d4af37; color: #d4af37; background: rgba(212,175,55,.15); }
body.modo-dia .huella-nav-btn         { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.modo-dia .huella-nav-btn:hover   { border-color: #d97706 !important; color: #d97706 !important; background: rgba(217,119,6,.08) !important; }
body.modo-dia .huella-nav-btn.active  { border-color: #16a34a !important; color: #16a34a !important; background: rgba(22,163,74,.12) !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(212,175,55,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: .14rem .48rem;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 500;
  white-space: nowrap;
}
.b-green { background: rgba(74,222,128,.12);  color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.b-cyan  { background: rgba(34,211,238,.12);  color: #22d3ee; border: 1px solid rgba(34,211,238,.25); }
.b-amber { background: rgba(245,158,11,.12); color: var(--amber);  border: 1px solid rgba(245,158,11,.25); }
.b-red   { background: rgba(248,113,113,.12); color: var(--red);   border: 1px solid rgba(248,113,113,.25); }
.b-gray  { background: rgba(100,116,139,.12); color: var(--muted); border: 1px solid rgba(100,116,139,.2); }
.nv      { color: var(--border); font-family: var(--mono); font-size: .7rem; }

/* ── NAV ── */
/* ══════════════════════════════
   NAV — Desktop barra + Mobile hamburguesa
══════════════════════════════ */
nav {
  display: flex;
  align-items: stretch;
  height: 48px;
  padding: 0 1rem;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-logo {
  font-weight: 800; font-size: 1rem; letter-spacing: -0.02em;
  display: flex; align-items: center;
  flex-shrink: 0;
}
.nav-logo span { background: linear-gradient(135deg, #fbe28a 0%, #d4af37 50%, #b8941f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-logo-block { display: flex; flex-direction: column; justify-content: center; padding-right: 1.25rem; margin-right: .25rem; flex-shrink: 0; }

/* ── Mensaje de última carga ── */
.nav-carga {
  font-family: var(--mono);
  font-size: .58rem;
  display: flex; align-items: center; gap: .35rem;
  margin-top: .15rem;
  white-space: nowrap;
}
.nav-carga.ok  { color: #4ade80; }
.nav-carga.old { color: #fb7185; }
.nav-carga-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.nav-carga.ok  .nav-carga-dot { box-shadow: 0 0 6px rgba(74,222,128,.5); }
.nav-carga.old .nav-carga-dot { box-shadow: 0 0 6px rgba(251,113,133,.5); }
/* En el drawer móvil el mensaje va con un pequeño margen superior */
.drawer-logo-block { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.drawer-header .nav-carga { margin-top: .4rem; white-space: normal; }
.nav-sep { color: var(--border); font-size: 1.2rem; display: flex; align-items: center; margin: 0 .5rem; }
.nav-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0 .85rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  border-radius: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  height: 100%;
}
.nav-link:hover { color: var(--text); border-bottom-color: var(--muted); background: none; }
.nav-link.active { color: #d4af37; border-bottom-color: #d4af37; background: none; }

/* ── BOTÓN HAMBURGUESA (solo móvil) ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: .45rem .25rem;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  flex-shrink: 0;
}
.nav-hamburger:hover { color: var(--text); }
.nav-hamburger svg  { width: 20px; height: 20px; display: block; }

/* ── MENÚ LATERAL (drawer) ── */
.nav-drawer {
  position: fixed;
  top: 0; left: 0;
  width: min(280px, 80vw);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.25,.46,.45,.94);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }

/* Glassmorphism en móvil */
@media (max-width: 768px) {
  .nav-drawer {
    background: rgba(5,8,15,0.45);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-right: 1px solid rgba(255,255,255,0.06);
  }
  .drawer-header { border-bottom-color: rgba(255,255,255,0.07); }
  .drawer-sep { background: rgba(255,255,255,0.07); }
  .drawer-link:hover { background: rgba(255,255,255,0.06); }
}

.nav-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.nav-drawer-backdrop.open { opacity: 1; pointer-events: all; }

/* Header del drawer */
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-close { flex-shrink: 0; }
.drawer-logo { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.drawer-logo span { background: linear-gradient(135deg, #fbe28a 0%, #d4af37 50%, #b8941f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.drawer-close {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: .4rem;
  display: flex; align-items: center;
  transition: all .15s;
}
.drawer-close:hover { color: var(--text); }
.drawer-close svg { width: 18px; height: 18px; }

/* Links dentro del drawer */
.drawer-links {
  display: flex;
  flex-direction: column;
  padding: .75rem .75rem;
  gap: .35rem;
  flex: 1;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 500;
  transition: all .15s;
  border: 1px solid transparent;
}
.drawer-link:hover  { background: var(--s2); color: var(--text); border-color: var(--border); }
.drawer-link.active { background: rgba(212,175,55,.1); color: #d4af37; border-color: rgba(212,175,55,.25); }
.drawer-link.danger { color: #f87171; }
.drawer-link.danger:hover { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.25); }
.drawer-sep { height: 1px; background: var(--border); margin: .4rem 0; }

/* Cartera dentro del drawer */
.drawer-cartera {
  padding: .75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-cartera-label {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
  padding: 0 .25rem;
}
.drawer-cartera select {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  padding: .6rem .75rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* ── RESPONSIVE: ocultar links en móvil, mostrar hamburguesa ── */
@media (max-width: 767px) {
  .nav-hamburger { display: flex !important; }
  .nav-sep,
  .nav-link,
  .cartera-wrap,
  .nav-carga-desktop,
  .theme-btn,
  .huella-nav-btn { display: none !important; }
  /* Solo mostrar logo + hamburguesa + theme en mobile nav */
  nav { justify-content: space-between; gap: .5rem; }
  /* theme-btn sí visible dentro del drawer, no en nav */
  .drawer-theme { display: flex !important; }
}

/* ── Desktop: ocultar drawer ── */
@media (min-width: 768px) {
  .nav-hamburger     { display: none !important; }
  .nav-drawer        { display: none !important; }
  .nav-drawer-backdrop { display: none !important; }
}

/* Modo día — drawer */
body.modo-dia .nav-drawer        { background: #ffffff !important; border-color: #e2e8f0 !important; }
@media (max-width: 768px) {
  body.modo-dia .nav-drawer { background: rgba(255,255,255,0.75) !important; backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border-right-color: rgba(0,0,0,0.1) !important; }
}
body.modo-dia .drawer-header     { border-color: #e2e8f0 !important; }
body.modo-dia .drawer-logo       { color: #0f172a !important; }
body.modo-dia .drawer-link       { color: #64748b !important; }
body.modo-dia .drawer-link:hover { background: #f8fafc !important; color: #0f172a !important; border-color: #e2e8f0 !important; }
body.modo-dia .drawer-link.active{ background: rgba(22,163,74,.08) !important; color: #16a34a !important; border-color: rgba(22,163,74,.2) !important; }
body.modo-dia .drawer-sep        { background: #e2e8f0 !important; }
body.modo-dia .drawer-cartera    { border-color: #e2e8f0 !important; }

/* ── ANIMACIONES ── */
@keyframes fu   { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }
@keyframes spin { to   { transform: rotate(360deg); } }

/* ── PAGINACIÓN ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pbtn {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .74rem;
  padding: .45rem .65rem;
  cursor: pointer;
  transition: background .15s;
  min-width: 36px;
  text-align: center;
}
.pbtn:hover:not(:disabled) { background: var(--border); }
.pbtn.active { background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%); color: #0a0a0a; border-color: #d4af37; font-weight: 700; }
.pbtn:disabled { opacity: .3; cursor: not-allowed; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-family: var(--mono); font-size: .82rem; }

/* ── LOADING ── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8rem;
  gap: .75rem;
}
.loading-spinner::before {
  content: '';
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@media (min-width: 768px) {
  nav { padding: 0.8rem 2rem; }
}

/* ── SELECTOR DE CARTERA (admin) ── */
.cartera-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 8px;
  padding: .3rem .6rem .3rem .5rem;
  color: #d4af37;
  flex-shrink: 0;
}
.cartera-wrap svg { flex-shrink: 0; }
.cartera-select {
  background: transparent;
  border: none;
  color: #d4af37;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: .04em;
}
.cartera-select option { background: var(--surface); color: var(--text); }

body.modo-dia .cartera-wrap  { background: rgba(22,163,74,.08); border-color: #16a34a; color: #16a34a; }
body.modo-dia .cartera-select { color: #16a34a; }
body.modo-dia .cartera-select option { background: #fff; color: #0f172a; }

/* Botón tema dentro del drawer */
#drawerThemeBtn {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
}
#drawerThemeBtn:hover { color: var(--amber) !important; border-color: rgba(245,158,11,.3) !important; background: rgba(245,158,11,.06) !important; }
body.modo-dia #drawerThemeBtn { color: #64748b !important; }
body.modo-dia #drawerThemeBtn:hover { color: #d97706 !important; }

/* ── HUELLA / FACE ID EN EL DRAWER ── */
.drawer-huella-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem; gap: .6rem;
}
.drawer-huella-label {
  display: flex; align-items: center; gap: .6rem;
  color: var(--muted); font-family: var(--mono); font-size: .82rem;
}
.drawer-huella-label small {
  display: block; font-size: .68rem; color: var(--muted); opacity: .75; margin-top: 1px;
}
.huella-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.huella-switch input { opacity: 0; width: 0; height: 0; }
.huella-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  border-radius: 11px; transition: all .2s;
}
.huella-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 2px; top: 2px; background: var(--muted); border-radius: 50%;
  transition: all .2s;
}
.huella-switch input:checked + .huella-slider {
  background: rgba(212,175,55,.25); border-color: var(--accent);
}
.huella-switch input:checked + .huella-slider::before {
  transform: translateX(16px); background: var(--accent);
}
body.modo-dia .huella-slider { background: rgba(0,0,0,.06); }
body.modo-dia .huella-switch input:checked + .huella-slider { background: rgba(22,163,74,.15); }
body.modo-dia .huella-switch input:checked + .huella-slider::before { background: #16a34a; }

/* ── MODAL CERRAR SESIÓN ── */
.logout-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.logout-modal-backdrop.show { display: flex; }
.logout-modal {
  width: 90%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(212,175,55,.08), 0 20px 40px rgba(0,0,0,.4);
}
.logout-modal-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.logout-modal-title {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-light, var(--accent));
  margin-bottom: 1.5rem;
}
.logout-modal-actions { display: flex; gap: 10px; }
.logout-modal-cancel,
.logout-modal-confirm {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.logout-modal-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.logout-modal-cancel:hover { background: var(--s2); }
.logout-modal-confirm {
  border: 1px solid var(--accent);
  background: rgba(212,175,55,.15);
  color: var(--accent-light, var(--accent));
}
.logout-modal-confirm:hover { background: rgba(212,175,55,.25); }
body.modo-dia .logout-modal-icon { background: rgba(22,163,74,.1); border-color: rgba(22,163,74,.4); }
body.modo-dia .logout-modal-confirm { background: rgba(22,163,74,.15); }
body.modo-dia .logout-modal-confirm:hover { background: rgba(22,163,74,.25); }
