/* ─── VARIABLES ─────────────────────────────────────────────────── */
:root {
  --bg: #0e0f11;
  --bg-2: #16181c;
  --bg-3: #1e2028;
  --bg-4: #262830;
  --border: #2e3038;
  --border-2: #3a3d4a;
  --text: #e8eaf0;
  --text-2: #9ba0b0;
  --text-3: #5e6375;
  --accent: #4f8ef7;
  --accent-dim: #1e3a6e;
  --green: #2dd4a0;
  --green-dim: #0d3326;
  --yellow: #f5c842;
  --yellow-dim: #3a2e0a;
  --red: #f25757;
  --red-dim: #3a1111;
  --orange: #f2913a;
  --orange-dim: #3a2210;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --sidebar-w: 240px;
  --topbar-h: 58px;
  --trans: .18s ease;
}

/* ─── MODO DÍA ───────────────────────────────────────────────────── */
body.light {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --bg-3: #eef0f4;
  --bg-4: #e2e5eb;
  --border: #d0d5de;
  --border-2: #b8bfcc;
  --text: #1a1d24;
  --text-2: #4a5068;
  --text-3: #8a91a8;
  --accent: #2563eb;
  --accent-dim: #dbeafe;
  --green: #059669;
  --green-dim: #d1fae5;
  --yellow: #d97706;
  --yellow-dim: #fef3c7;
  --red: #dc2626;
  --red-dim: #fee2e2;
  --orange: #ea580c;
  --orange-dim: #ffedd5;
  --shadow: 0 4px 24px rgba(0,0,0,.1);
}

/* ─── BOTÓN TEMA ─────────────────────────────────────────────────── */
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  flex-shrink: 0;
}
.btn-theme:hover { background: var(--bg-4); color: var(--text); }

/* ─── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { text-decoration: none; cursor: pointer; }
button { cursor: pointer; font-family: var(--sans); }
input, select, textarea {
  font-family: var(--sans);
  font-size: .9rem;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  width: 100%;
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option { background: var(--bg-3); }
textarea { resize: vertical; }
code { font-family: var(--mono); background: var(--bg-4); padding: .1em .4em; border-radius: 3px; font-size: .82em; }

.hidden { display: none !important; }

/* ─── SCROLLBAR ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ─── LOGIN ─────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(79,142,247,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(45,212,160,.08) 0%, transparent 60%);
}
.login-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, var(--border) 39px, var(--border) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, var(--border) 39px, var(--border) 40px);
  opacity: .18;
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp .4s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: none; } }
.login-logo { text-align: center; margin-bottom: 2rem; }
#app-logo-login { max-width: 220px; height: auto; display: inline-block; }
.sidebar-logo-img { max-width: 140px; max-height: 48px; object-fit: contain; display: block; }
.logo-mark {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -2px;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: .2em .5em;
  border-radius: var(--radius);
}
.logo-mark.sm { font-size: 1.1rem; padding: .15em .4em; }
.login-logo p { color: var(--text-2); font-size: .85rem; margin-top: .6rem; }
.login-hint { text-align: center; color: var(--text-3); font-size: .78rem; margin-top: 1rem; }

/* ─── APP LAYOUT ─────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--trans);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-close { display: none; background: none; border: none; color: var(--text-2); font-size: 1.1rem; }
.sidebar-nav {
  flex: 1;
  padding: .8rem 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.2rem;
  color: var(--text-2);
  font-size: .88rem;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--trans), color var(--trans);
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); border-left-color: var(--accent); }
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
}
.user-chip { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--bg); flex-shrink: 0;
}
.user-name { font-size: .85rem; font-weight: 600; }
.user-role { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }
.btn-logout {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: .45rem;
  border-radius: var(--radius);
  font-size: .82rem;
  transition: background var(--trans), color var(--trans);
}
.btn-logout:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }

/* MAIN */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
}
.menu-toggle svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.topbar-title { font-size: 1rem; font-weight: 600; font-family: var(--mono); flex: 1; }
.view { padding: 1.5rem; flex: 1; }

/* ─── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--trans);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: #6ba3f9; }
.btn-secondary { background: var(--bg-3); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-4); color: var(--text); }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-pdf-ok { background: var(--green-dim); color: var(--green); border-color: var(--green); }
.btn-pdf-ok:hover { background: var(--green); color: #000; }
.btn-pdf-missing { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.btn-pdf-missing:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; padding: .7rem; }

/* ─── STATS CARDS ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--trans);
}
.stat-card:hover { border-color: var(--border-2); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.red::before { background: var(--red); }
.stat-card.orange::before { background: var(--orange); }
.stat-num { font-family: var(--mono); font-size: 2rem; font-weight: 600; line-height: 1; margin-bottom: .25rem; }
.stat-card.blue .stat-num { color: var(--accent); }
.stat-card.green .stat-num { color: var(--green); }
.stat-card.yellow .stat-num { color: var(--yellow); }
.stat-card.red .stat-num { color: var(--red); }
.stat-card.orange .stat-num { color: var(--orange); }
.stat-label { font-size: .75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }

/* ─── FILTERS ────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.2rem;
  align-items: center;
}
.filter-input { flex: 1; min-width: 200px; max-width: 320px; }
.filter-select { width: auto; min-width: 140px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .5rem .9rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  transition: all var(--trans);
  cursor: pointer;
}
.filter-btn.active { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.filter-btn:hover { background: var(--bg-4); }

/* ─── TABLE ──────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
thead th {
  background: var(--bg-3);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--trans);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-3); }
td { padding: .7rem 1rem; vertical-align: middle; }
.td-actions { display: flex; gap: .4rem; flex-wrap: nowrap; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
}
.empty-state svg { width: 48px; height: 48px; fill: var(--text-3); margin-bottom: 1rem; opacity: .4; }

/* ─── BADGES ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18em .65em;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-recibido { background: var(--accent-dim); color: var(--accent); }
.badge-en-proceso { background: var(--yellow-dim); color: var(--yellow); }
.badge-atendido { background: var(--green-dim); color: var(--green); }
.badge-vencido { background: var(--red-dim); color: var(--red); }
.badge-baja { background: var(--bg-4); color: var(--text-3); }
.badge-normal { background: var(--bg-4); color: var(--text-2); }
.badge-alta { background: var(--orange-dim); color: var(--orange); }
.badge-urgente { background: var(--red-dim); color: var(--red); animation: pulse-badge 1.5s infinite; }
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:.6} }
.badge-admin { background: var(--accent-dim); color: var(--accent); }
.badge-capturista { background: var(--green-dim); color: var(--green); }
.badge-consulta { background: var(--bg-4); color: var(--text-3); }
.badge-activo { background: var(--green-dim); color: var(--green); }
.badge-inactivo { background: var(--red-dim); color: var(--red); }

/* ─── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 800px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; font-weight: 600; font-family: var(--mono); }
.modal-close {
  background: none; border: none;
  color: var(--text-3); font-size: 1rem;
  line-height: 1;
  transition: color var(--trans);
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 1.4rem; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ─── FORMS ──────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }
.span-2 { grid-column: span 2; }

/* FILE DROP */
.file-drop {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  color: var(--text-3);
  font-size: .85rem;
}
.file-drop svg { width: 32px; height: 32px; fill: var(--text-3); }
.file-drop:hover, .file-drop.drag { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.file-drop.has-file { border-color: var(--green); background: var(--green-dim); color: var(--green); }

/* ─── ALERT ──────────────────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }

/* ─── TOAST ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: .75rem 1.2rem;
  border-radius: 8px;
  font-size: .85rem;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.toast.error { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ─── HISTORIAL ──────────────────────────────────────────────────── */
.historial-list { display: flex; flex-direction: column; gap: .6rem; }
.historial-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}
.hist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.hist-accion { font-weight: 600; font-size: .85rem; }
.hist-fecha { font-size: .72rem; color: var(--text-3); font-family: var(--mono); }
.hist-user { font-size: .78rem; color: var(--text-2); }
.hist-nota { font-size: .82rem; color: var(--text-2); margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.estado-arrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-family: var(--mono); }

/* ─── DETAIL GRID ────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.5rem; margin-bottom: 1.5rem; }
.detail-item label { font-size: .7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); display: block; margin-bottom: .2rem; }
.detail-item span { font-size: .88rem; }
.detail-full { grid-column: span 2; }
.section-title {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* ─── SWITCH ─────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: .5rem; }
.switch input { display: none; }
.switch-track {
  width: 36px; height: 20px;
  background: var(--bg-4);
  border-radius: 10px;
  border: 1px solid var(--border-2);
  position: relative;
  transition: background var(--trans);
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--text-3);
  border-radius: 50%;
  transition: transform var(--trans), background var(--trans);
}
.switch input:checked + .switch-track { background: var(--green-dim); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--green); }

/* ─── SECTION HEADER ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: .6rem;
}
.section-header h2 { font-size: 1.1rem; font-family: var(--mono); }

/* ─── PDF LINK ───────────────────────────────────────────────────── */
.pdf-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--accent);
  font-size: .82rem;
  font-family: var(--mono);
  padding: .3rem .6rem;
  background: var(--accent-dim);
  border-radius: var(--radius);
  transition: background var(--trans);
}
.pdf-link:hover { background: rgba(79,142,247,.25); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.6); }
  .sidebar-close { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-full { grid-column: span 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-input { min-width: 100%; }
  .filter-select { min-width: 120px; }
  thead th:nth-child(n+5) { display: none; }
  td:nth-child(n+5):not(:last-child) { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { max-height: 95vh; }
  .topbar { padding: 0 1rem; }
  .view { padding: 1rem; }
}

/* ─── OVERLAY FOR MOBILE SIDEBAR ─────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ─── TIPO TOGGLE ─────────────────────────────────────────────────── */
.tipo-toggle {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.2rem;
  background: var(--bg-2);
  border-radius: 8px;
  padding: .25rem;
}
.tipo-btn {
  flex: 1;
  padding: .5rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tipo-btn.active {
  background: var(--accent);
  color: #fff;
}
.tipo-btn:not(.active):hover {
  background: var(--bg-3);
}

/* ─── REFERENCIA BANNER ───────────────────────────────────────────── */
.referencia-banner {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 6px;
  padding: .5rem .9rem;
  font-size: .82rem;
  color: var(--text-1);
  margin-bottom: 1rem;
}

/* ─── BADGES TIPO ─────────────────────────────────────────────────── */
.badge-tipo-recibido { background: #1e3a5f; color: #90cdf4; }
.badge-tipo-emitido  { background: #2d1b5e; color: #c4b5fd; }
body.light .badge-tipo-recibido { background: #dbeafe; color: #1d4ed8; }
body.light .badge-tipo-emitido  { background: #ede9fe; color: #6d28d9; }

/* ─── STAT CARDS NUEVOS COLORES ───────────────────────────────────── */
.stat-card.purple { border-top-color: #7c3aed; }
.stat-card.purple .stat-num { color: #a78bfa; }
.stat-card.teal   { border-top-color: #0d9488; }
.stat-card.teal   .stat-num { color: #2dd4bf; }
body.light .stat-card.purple .stat-num { color: #7c3aed; }
body.light .stat-card.teal   .stat-num { color: #0d9488; }

/* ─── STAT CARDS CLICKABLES ────────────────────────────────────────── */
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.stat-card.selected { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── PAGINADOR DASHBOARD ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .75rem 0 .25rem; }

/* ─── CONFIGURACIÓN ────────────────────────────────────────────────── */
.config-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.config-section h3 {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.img-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.img-upload-slot {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
  position: relative;
}
.img-upload-slot:hover { border-color: var(--accent); background: var(--accent-dim); }
.img-upload-slot.has-img { border-style: solid; border-color: var(--green); }
.img-upload-slot input[type=file] { display: none; }
.img-upload-slot img.preview {
  max-width: 100%; max-height: 80px;
  object-fit: contain;
  margin-bottom: .5rem;
  border-radius: 4px;
}
.img-slot-label { font-size: .78rem; color: var(--text-3); font-family: var(--mono); margin-bottom: .5rem; display: block; }
.img-slot-actions { display: flex; gap: .4rem; justify-content: center; margin-top: .5rem; }
.dirs-config-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.dirs-config-table th { text-align: left; padding: .5rem .7rem; color: var(--text-3); font-family: var(--mono); font-size: .72rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.dirs-config-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--border); }
.dirs-config-table tr:last-child td { border-bottom: none; }
.dirs-config-table input { width: 100%; }
.folio-preview { font-family: var(--mono); font-size: .8rem; color: var(--accent); background: var(--accent-dim); padding: .15em .5em; border-radius: 4px; display: inline-block; }
