/* =============================================
   Sistema de Auditorías — Estilo v2
   Diseño: Executive Dashboard
   Fuentes: DM Sans + DM Mono (Google Fonts)
============================================= */
 
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');
 
/* ── Variables ──────────────────────────────── */
:root {
  --navy:       #0f1b2d;
  --navy-mid:   #1a2d47;
  --navy-light: #243a58;
  --accent:     #3b82f6;
  --accent-glow:#60a5fa;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --text-main:  #1e293b;
  --text-muted: #64748b;
  --border:     #e2e8f0;
  --surface:    #ffffff;
  --bg:         #f1f5f9;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:  0 20px 40px rgba(0,0,0,.14);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --font-body:  'DM Sans', system-ui, sans-serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;
}
 
/* ── Reset & Base ───────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
 
/* ── Layout ─────────────────────────────────── */
.contenedor {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
 
/* ── Header ─────────────────────────────────── */
header {
  background: var(--navy);
  margin: 0 -24px 32px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
header h1::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
}
nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
nav a {
  text-decoration: none;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  transition: all .2s ease;
  letter-spacing: .01em;
}
nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
nav a.activo {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,.4);
}
 
/* ── Section Title ──────────────────────────── */
.seccion-titulo {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 8px;
}
 
/* ── Filtros ─────────────────────────────────── */
.filtros {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.form-filtros {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-filtros label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
select,
input[type="number"],
input[type="text"] {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-main);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  min-width: 130px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
 
/* ── Buttons ─────────────────────────────────── */
.btn,
.btn-chico {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .01em;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}
.btn:active { transform: translateY(0); }
 
.btn-chico {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
.btn-chico:hover {
  background: var(--accent);
  color: #fff;
  transform: none;
  box-shadow: none;
}
 
/* ── Tarjetas KPI ───────────────────────────── */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.tarjeta {
  background: var(--surface);
  padding: 22px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
  animation: fadeUp .4s ease both;
}
.tarjeta:nth-child(1) { border-top-color: var(--accent); animation-delay: .05s; }
.tarjeta:nth-child(2) { border-top-color: var(--success); animation-delay: .10s; }
.tarjeta:nth-child(3) { border-top-color: var(--warning); animation-delay: .15s; }
.tarjeta:nth-child(4) { border-top-color: #8b5cf6;        animation-delay: .20s; }
 
.tarjeta::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: currentColor;
  opacity: .03;
}
.tarjeta .etiqueta {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}
.tarjeta .valor {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  display: block;
  letter-spacing: -1px;
}
.tarjeta small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 7px;
  font-weight: 500;
}
 
/* ── Gráfica ─────────────────────────────────── */
.grafica-contenedor {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 28px;
  animation: fadeUp .4s .25s ease both;
}
.grafica-contenedor h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grafica-contenedor h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 4px;
}
 
/* ── Tabla ───────────────────────────────────── */
.tabla-contenedor {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  animation: fadeUp .4s .3s ease both;
}
.tabla-contenedor h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tabla-contenedor h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--success);
  border-radius: 4px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead tr {
  border-bottom: 2px solid var(--border);
}
th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  background: transparent;
}
td {
  padding: 13px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr {
  transition: background .15s;
}
tbody tr:hover {
  background: #f8fafc;
}
tbody tr:last-child td {
  border-bottom: none;
}
 
/* Columna de porcentaje con barra inline */
.td-porcentaje {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.barra-mini {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  width: 80px;
}
.barra-mini-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}
 
/* Números en tabla con mono */
td.num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
 
/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge.exito {
  background: #d1fae5;
  color: #065f46;
}
.badge.fallo {
  background: #fee2e2;
  color: #991b1b;
}
.badge.exito::before { content: '✓'; }
.badge.fallo::before  { content: '✕'; }
 
/* ── Modal ───────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,27,45,.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeBg .2s ease;
}
.modal-contenido {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
.modal-contenido h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 22px;
  padding-right: 24px;
  line-height: 1.3;
}
.cerrar {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  line-height: 1;
}
.cerrar:hover {
  background: #f1f5f9;
  color: var(--text-main);
}
.modal-contenido label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.modal-contenido input {
  width: 100%;
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: border-color .2s, box-shadow .2s;
  background-image: none;
}
.modal-contenido input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.modal-contenido .btn {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 15px;
}
 
/* ── Alerta ──────────────────────────────────── */
.alerta {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeUp .3s ease;
}
.alerta.exito {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}
 
/* ── Animaciones ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}
 
/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
  .contenedor { padding: 0 14px 32px; }
  header { margin: 0 -14px 24px; padding: 0 14px; }
  header h1 { font-size: 15px; }
  nav a { padding: 6px 10px; font-size: 13px; }
  .tarjeta .valor { font-size: 26px; }
  th, td { padding: 10px 10px; }
  .barra-mini { display: none; }
  .grafica-contenedor, .tabla-contenedor, .filtros { padding: 16px; }
}