/* ============================================================
   SISTEMA DE DISEÑO v5 — Identificador de Depósitos
   Tema consolidado. Reemplaza a tema.css (Opción B).
   Dirección: sobrio, denso, tablas como instrumento de trabajo.
   Usa los nombres de clase reales de la app (.stat-card,
   .sidebar-nav-link, .table-container, etc.).
   ============================================================ */

:root {
  /* Superficies */
  --canvas:      #F6F6F4;
  --paper:       #FFFFFF;
  --line:        #E4E4DF;
  --line-soft:   #EFEFEB;
  --header-bg:   #F5F5F2;

  /* Tinta */
  --ink:         #17191E;
  --ink-2:       #464B55;
  --ink-3:       #6B7280;

  /* Acción (morado institucional) */
  --action:        #5B4BC4;
  --action-hover:  #4E3FB5;
  --action-soft:   #F1EEFC;
  --action-line:   #7A6BD0;

  /* Estados */
  --success:       #047857;
  --success-soft:  #E7F4EF;
  --warning:       #B45309;
  --warning-soft:  #FCF0E2;
  --danger:        #B91C1C;
  --danger-soft:   #FBEAEA;
  --info:          #1D4ED8;
  --info-soft:     #E8EFFC;

  /* Sidebar */
  --sidebar:        #17191E;
  --sidebar-2:      #202329;
  --sidebar-active: #2A2E38;
  --sidebar-text:   #B8BCC4;
  --sidebar-text-hi:#FFFFFF;

  /* Tipografía */
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Espaciado */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem;
  --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem;

  /* Radio */
  --r-sm: 4px; --r-md: 6px; --r-lg: 10px;

  /* Sombras (mínimas) */
  --shadow-1: 0 1px 2px rgba(23,25,30,0.06);
  --shadow-2: 0 4px 12px rgba(23,25,30,0.10);
  --shadow-3: 0 12px 32px rgba(23,25,30,0.16);

  --ease: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }

/* Cifras y códigos: mono + tabular */
.monto, .codigo, .fecha, .num, .stat-number, .stat-value, .dash-stat-value, .kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============ Shell (fondo + superficies) ============ */
body, .app-container, .main-content, .content-area { background: var(--canvas); }

.card, .stat-card, .dash-stat-card, .modal-content, .kpi {
  background: var(--paper);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
}
.card:hover, .stat-card:hover, .dash-stat-card:hover { transform: none; box-shadow: none; border-color: #D4D4CD; }

/* ============ Header ============ */
.main-header {
  background: var(--paper);
  backdrop-filter: none !important;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

/* ============ Sidebar ============ */
.sidebar {
  background: var(--sidebar);
  box-shadow: none;
  border-right: 1px solid #24262C;
}
.sidebar-nav-link, .sidebar-submenu-link {
  border-radius: var(--r-md);
  font-size: 0.875rem;
  color: var(--sidebar-text);
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}
.sidebar-nav-link:hover, .sidebar-submenu-link:hover { background: var(--sidebar-2); color: var(--sidebar-text-hi); }
.sidebar-nav-link.active { background: var(--sidebar-active); color: var(--sidebar-text-hi); }
.sidebar-nav-link.active::before { display: none; }
.sidebar-nav-icon { color: inherit; }
.sidebar-nav-icon svg, .sidebar-brand-icon svg { width: 18px; height: 18px; display: block; flex: none; }
.sidebar-brand-icon svg { width: 20px; height: 20px; }

/* ============ Títulos ============ */
.section-title {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); text-shadow: none;
}
.card-header h3, .card h3 { font-size: 1.0625rem; font-weight: 600; color: var(--ink); }

/* ============ KPIs / stat cards ============ */
.card-content h3 { font-size: 0.9rem; color: var(--ink-3); font-weight: 500; }
.stat-number, .stat-value, .dash-stat-value, .kpi-value {
  font-size: 1.75rem; font-weight: 600; color: var(--ink);
  letter-spacing: -0.02em;
}
.kpi-label { font-size: 12px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============ Tablas ============ */
.table, table.table { border-collapse: collapse; font-size: 0.875rem; }
.table-container, .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
.table thead, .table thead tr, table thead {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.table th, table th {
  padding: 0.6875rem 0.875rem;
  color: var(--ink-2); text-align: left;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 0; white-space: nowrap;
}
.table td, table td { padding: 0.8125rem 0.875rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover, table tbody tr:hover { background: #FAFAF8; }
.table td.monto, table td.monto, .monto { text-align: right; font-size: 0.9375rem; font-weight: 500; white-space: nowrap; color: var(--ink); }
.table td.codigo, table td.codigo, .table td.fecha, table td.fecha, .codigo, .fecha { font-size: 0.8125rem; color: var(--ink-2); }
.table tfoot tr, table tfoot tr { background: var(--header-bg); border-top: 2px solid var(--ink); }
.table tfoot td, table tfoot td { padding: 0.8125rem 0.875rem; font-weight: 600; border-bottom: 0; }
.table tfoot td.monto { text-align: right; }

/* ============ Botones ============ */
.btn {
  border-radius: var(--r-md);
  font-size: 0.875rem;
  padding: 0.5625rem 1.125rem;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), filter var(--ease);
}
.btn:hover { transform: none !important; box-shadow: none !important; filter: brightness(0.94); }
.btn-primary { background: var(--action); }
.btn-primary:hover { background: var(--action-hover); filter: none; }
.btn-secondary, .btn-outline-primary { background: var(--paper); color: var(--action); border: 1px solid var(--action-line); }
.btn-secondary:hover, .btn-outline-primary:hover { background: var(--action-soft); border-color: var(--action); color: var(--action); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }

/* ============ Píldoras de estado ============ */
.badge {
  border-radius: var(--r-sm);
  text-transform: none !important;
  letter-spacing: 0 !important;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}
.badge-no-identificado { border-color: #92400E; }

/* ============ Formularios ============ */
.input, .input-control,
input[type="text"], input[type="date"], input[type="number"],
input[type="search"], input[type="email"], input[type="password"],
select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  font-size: 0.875rem;
  color: var(--ink);
}
.input:focus, .input-control:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-soft);
}
.field label, .form-group label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* ============ Tarjetas de mes (archivador) ============ */
.mes-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.mes-card.mes-con-cartolas { border-left: 4px solid #047857; }
.mes-card.mes-sin-cartolas { border-left: 4px solid #CFCFC8; }
.mes-card:not([disabled]):hover { background: #FAFAF8; }
.mes-card .mes-icono { color: #047857; }
.mes-card.mes-sin-cartolas .mes-icono { color: #87877F; }
.mes-card .mes-nombre { font-size: 1rem; font-weight: 600; color: var(--ink); }
.mes-card .mes-detalle { font-size: 0.8125rem; color: var(--ink-3); }

/* ============ Tabla densa del dashboard ============ */
#dashboard .dashboard-no-ident-table td, #dashboard .dashboard-no-ident-table th { padding: 0.38rem 0.42rem; }
#dashboard .dashboard-no-ident-table td:last-child { white-space: normal; }
#dashboard .dashboard-no-ident-table .badge { padding: 0.1875rem 0.4375rem; margin-bottom: 0.1875rem; max-width: 100%; flex-wrap: wrap; }
