/* Pagos Rapidos - Sistema de Gestión de Caja */
:root {
  --primary: #1a3a8c;
  --primary-dark: #122880;
  --accent: #f5a623;
  --accent-dark: #e09510;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f0f4ff;
  --card-bg: #ffffff;
  --sidebar-w: 260px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #1e293b;
  min-height: 100vh;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== LAYOUT ===== */
#app { display: flex; min-height: 100vh; }

/* ===== LOGIN ===== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, #1a3a8c 0%, #122880 50%, #0d1e5e 100%);
  position: fixed; top: 0; left: 0; z-index: 100;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 160px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(26,58,140,0.3));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
}

.login-subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  color: #1e293b;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,140,0.1);
  background: white;
}

.form-textarea { resize: vertical; min-height: 80px; }

.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper .form-input {
  padding-left: 44px;
}
.input-icon-wrapper .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,58,140,0.3); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }
.btn-full { width: 100%; }

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary) 0%, #122880 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  transition: transform 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar-logo img {
  width: 110px;
  height: auto;
  display: block;
  margin: 0 auto 8px auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255,255,255,0.2));
}

.sidebar-logo-text {
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-user {
  padding: 16px 20px;
  background: rgba(255,255,255,0.08);
  margin: 12px;
  border-radius: 12px;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  padding: 12px 8px 4px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.15);
  opacity: 1;
}

.nav-item.active {
  background: rgba(255,255,255,0.2);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-item .icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== MAIN CONTENT ===== */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
#topbar {
  background: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 0.85rem;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
}

/* ===== PAGE CONTENT ===== */
#page-content {
  padding: 28px;
  flex: 1;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-content { flex: 1; min-width: 0; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: #1e293b; }
.stat-label { font-size: 0.8rem; color: #64748b; font-weight: 500; margin-top: 2px; }
.stat-change { font-size: 0.75rem; margin-top: 4px; font-weight: 600; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-responsive { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; border-radius: 12px; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  color: #1e293b;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8faff; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-primary { background: #ede9fe; color: #4c1d95; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #64748b;
  transition: background 0.2s;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }

.modal-body { padding: 20px 28px; }
.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: white;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 1.1rem; }
.toast-msg { flex: 1; font-size: 0.9rem; font-weight: 500; }
.toast-close { cursor: pointer; color: #94a3b8; font-size: 1rem; }

/* ===== LOADING ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.spinner-dark {
  border-color: rgba(26,58,140,0.2);
  border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.loading-box {
  background: white;
  padding: 32px 48px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
}

.loading-box .spinner-dark { width: 40px; height: 40px; border-width: 4px; }
.loading-box p { margin-top: 16px; color: #64748b; font-weight: 500; }

/* ===== DENOMINATIONS ===== */
.denom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.denom-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s;
}

.denom-item:focus-within { border-color: var(--primary); background: white; }

.denom-label {
  font-weight: 700;
  color: var(--primary);
  min-width: 50px;
  font-size: 0.9rem;
}

.denom-input {
  width: 70px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
}

.denom-input:focus { border-color: var(--primary); }

.denom-subtotal {
  font-size: 0.8rem;
  color: #64748b;
  margin-left: auto;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== FILE UPLOAD ===== */
.file-drop {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}

.file-drop:hover, .file-drop.drag-over {
  border-color: var(--primary);
  background: #eff6ff;
}

.file-drop .upload-icon { font-size: 2.5rem; color: #94a3b8; margin-bottom: 12px; }
.file-drop p { color: #64748b; font-size: 0.9rem; }
.file-drop strong { color: var(--primary); }

/* ===== SEARCH ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 16px;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--primary); background: white; }
.search-bar input { border: none; background: transparent; outline: none; flex: 1; font-size: 0.9rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-260px); width: 260px; }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  #page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== PRINT ===== */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #main { margin: 0; }
  #page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #e2e8f0; }
}

/* ===== CUSTOM ===== */
.money { font-family: 'Courier New', monospace; font-weight: 700; }
.text-ingreso { color: #10b981; }
.text-egreso { color: #ef4444; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

.divider { height: 1px; background: #f1f5f9; margin: 16px 0; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { color: #64748b; margin-bottom: 8px; }

/* Análisis IA */
.ai-analysis {
  background: linear-gradient(135deg, #f0f4ff, #fef3c7);
  border: 1px solid #c7d2fe;
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== CONFIG PANEL ===== */
.config-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
}

.config-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
}

.key-display {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 0.9rem;
  color: #475569;
  word-break: break-all;
}

.model-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.model-card:hover { border-color: var(--primary); background: #f0f4ff; }
.model-card.selected { border-color: var(--primary); background: #f0f4ff; }
.model-card .model-name { font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.model-card .model-desc { color: #64748b; font-size: 0.8rem; margin-top: 4px; }
.model-card .recomendado-badge {
  display: inline-block;
  background: var(--success);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  font-weight: 600;
}

/* ===== NOTAS/COMPROBANTES ===== */
.nota-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.nota-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.nota-card.tipo-impresion { border-left-color: var(--accent); }
.nota-card.tipo-comprobante { border-left-color: var(--success); }
.nota-card.tipo-recibo { border-left-color: #8b5cf6; }

.nota-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.nota-titulo {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
}

.nota-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.nota-tipo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.nota-tipo-badge.impresion { background: #fef3c7; color: #92400e; }
.nota-tipo-badge.comprobante { background: #d1fae5; color: #065f46; }
.nota-tipo-badge.nota { background: #e0e7ff; color: #3730a3; }
.nota-tipo-badge.recibo { background: #f3e8ff; color: #6b21a8; }
.nota-tipo-badge.reporte { background: #fee2e2; color: #991b1b; }

.nota-contenido {
  color: #475569;
  font-size: 0.875rem;
  margin-top: 8px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== HISTORIAL ===== */
.historial-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.historial-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.historial-fecha {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.historial-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .historial-stats { grid-template-columns: repeat(2, 1fr); }
}

.historial-stat {
  text-align: center;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
}

.historial-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
}

.historial-stat-val.positive { color: var(--success); }
.historial-stat-val.negative { color: var(--danger); }

.historial-stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== MENSUAL REPORT ===== */
.mes-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border-left: 5px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 14px;
}

.mes-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
}

.mes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .mes-grid { grid-template-columns: repeat(2, 1fr); }
}

.mes-stat { text-align: center; }
.mes-stat-val { font-size: 1.2rem; font-weight: 800; }
.mes-stat-label { font-size: 0.75rem; color: #64748b; }

/* ===== PRINT DETECTION INDICATOR ===== */
.print-capture-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  display: none;
  animation: slideUp 0.3s ease;
  box-shadow: 0 4px 20px rgba(26,58,140,0.4);
}

.print-capture-indicator.show { display: flex; align-items: center; gap: 8px; }

/* ===== MULTIPLE EXCEL UPLOADS ===== */
.excel-file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.excel-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.excel-file-item.success { border-color: var(--success); background: #f0fdf4; }
.excel-file-item.error { border-color: var(--danger); background: #fef2f2; }
.excel-file-item.processing { border-color: var(--warning); background: #fffbeb; }

.excel-file-icon { font-size: 1.5rem; }
.excel-file-name { flex: 1; font-size: 0.875rem; font-weight: 600; color: #374151; }
.excel-file-status { font-size: 0.75rem; color: #64748b; }
