/* ============================================================
   SISTEMA BASE — Suite de Remuneraciones
   Paleta: tinta institucional + papel + terracota (sello) + verde libro
============================================================ */

:root {
  --tinta: #0F2A4A;
  --tinta-2: #163A60;
  --papel: #F7F4EC;
  --papel-2: #FBF9F3;
  --texto: #1C1C1C;
  --texto-suave: #5B5650;
  --linea: #DAD3C2;
  --terracota: #C75D3D;
  --terracota-suave: #F3E0D6;
  --verde: #2D7D6E;
  --verde-suave: #DCEFE9;
  --rojo: #B23B2E;
  --rojo-suave: #F6E1DC;
  --blanco: #FFFFFF;

  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --radius: 3px;
  --shadow-card: 0 1px 2px rgba(15,42,74,0.06), 0 8px 24px -12px rgba(15,42,74,0.18);
}

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

body {
  background: var(--papel);
  color: var(--texto);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--terracota-suave); }

a { color: inherit; }

/* ---- Tipografía utilitaria ---- */
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.folio-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--terracota);
}

/* ---- Scrollbar fino (estética de regla) ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--linea); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #c8bfa4; }

/* ---- Foco accesible visible ---- */
:focus-visible {
  outline: 2px solid var(--terracota);
  outline-offset: 2px;
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   COMPONENTES COMPARTIDOS
============================================================ */

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--tinta);
  color: var(--papel-2);
}
.btn-primary:hover { background: var(--tinta-2); }

.btn-accent {
  background: var(--terracota);
  color: var(--blanco);
}
.btn-accent:hover { background: #b34f32; }

.btn-ghost {
  background: transparent;
  color: var(--tinta);
  border: 1px solid var(--linea);
}
.btn-ghost:hover { border-color: var(--tinta); }

.btn-success {
  background: var(--verde);
  color: var(--blanco);
}
.btn-success:hover { background: #256a5d; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-suave);
}
.field input[type="text"],
.field input[type="number"],
.field select {
  font-family: var(--sans);
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  background: var(--blanco);
  color: var(--texto);
}
.field input.mono-input { font-family: var(--mono); }
.field input:focus, .field select:focus {
  border-color: var(--tinta);
}
.field .hint { font-size: 11.5px; color: var(--texto-suave); }
.field .rut-status { font-size: 11.5px; font-weight: 600; }
.field .rut-status.ok { color: var(--verde); }
.field .rut-status.bad { color: var(--rojo); }

.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--linea);
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  display: inline-block;
}
.tag-verde { background: var(--verde-suave); color: var(--verde); }
.tag-terracota { background: var(--terracota-suave); color: var(--terracota); }
.tag-rojo { background: var(--rojo-suave); color: var(--rojo); }
