:root {
  --azul: #1e4d7b;
  --azul-osc: #143552;
  --gris-bg: #f4f6f8;
  --borde: #dbe2ea;
  --rojo: #b3261e;
  --verde: #1b7a3d;
  --amarillo: #b8860b;
  --texto: #1f2d3d;
}

* { box-sizing: border-box; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--gris-bg);
  color: var(--texto);
  margin: 0;
  font-size: 14px;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--azul-osc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: bold; font-size: 17px; color: #fff; }
.topbar nav a {
  color: #dce7f2;
  margin-left: 16px;
  font-size: 13.5px;
}
.topbar nav a:hover { color: #fff; }
.topbar .user-box { font-size: 13px; color: #b8c9db; }

.container {
  max-width: 1180px;
  margin: 20px auto;
  padding: 0 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

h1 { font-size: 21px; color: var(--azul-osc); margin: 0 0 14px; }
h2 { font-size: 17px; color: var(--azul-osc); margin: 0 0 10px; }
h3 { font-size: 14.5px; color: var(--azul-osc); margin: 14px 0 6px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns repeat(4, 1fr); grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

label { display: block; font-size: 12.5px; font-weight: bold; margin-bottom: 4px; color: #445; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--borde);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
}
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 12px; }
.hint { font-size: 11.5px; color: #789; margin-top: 3px; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 4px;
  border: 1px solid var(--azul);
  background: var(--azul);
  color: #fff;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: bold;
}
.btn:hover { background: var(--azul-osc); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--azul); }
.btn.danger { background: var(--rojo); border-color: var(--rojo); }
.btn.small { padding: 5px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--borde); text-align: left; font-size: 13px; vertical-align: top; }
th { background: #f0f3f7; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: #567; }
tr:hover td { background: #fafcff; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: bold; }
.badge.abierto { background: #fde3e0; color: var(--rojo); }
.badge.proceso { background: #fdf1d6; color: var(--amarillo); }
.badge.cerrado { background: #dff3e4; color: var(--verde); }
.badge.victima { background: #dfeaf9; color: #1e4d7b; }
.badge.victimario { background: #fbe0df; color: var(--rojo); }
.badge.testigo { background: #eee; color: #555; }
.badge.reincidente { background: #2a2a2a; color:#ffcc00; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtros select, .filtros input { width: auto; }

.involucrado-row {
  border: 1px solid var(--borde);
  border-radius: 5px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafbfc;
  position: relative;
}
.involucrado-row .quitar {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; color: var(--rojo); font-weight: bold; cursor: pointer; font-size: 13px;
}

.kpi { text-align: center; padding: 16px 10px; }
.kpi .num { font-size: 30px; font-weight: bold; color: var(--azul-osc); }
.kpi .lbl { font-size: 12px; color: #678; margin-top: 4px; }

.alert { padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; font-size: 13.5px; }
.alert.ok { background: #dff3e4; color: var(--verde); }
.alert.error { background: #fde3e0; color: var(--rojo); }

footer { text-align: center; color: #99a; font-size: 11.5px; padding: 30px 0 16px; }

/* ---------- Vista de acta (para impresión) ---------- */
.acta {
  background: #fff;
  max-width: 820px;
  margin: 20px auto;
  padding: 40px 50px;
  border: 1px solid var(--borde);
}
.acta .acta-header { text-align: center; margin-bottom: 24px; border-bottom: 2px solid var(--azul-osc); padding-bottom: 14px; }
.acta .acta-header h1 { font-size: 18px; margin-bottom: 2px; }
.acta .acta-header .sub { font-size: 12.5px; color: #678; }
.acta .campo { margin-bottom: 14px; }
.acta .campo .etiqueta { font-weight: bold; font-size: 12px; text-transform: uppercase; color: #567; margin-bottom: 3px; }
.acta .campo .valor { font-size: 13.5px; white-space: pre-wrap; }
.acta .firma-box { margin-top: 50px; display: flex; justify-content: space-between; }
.acta .firma-box div { width: 45%; text-align: center; border-top: 1px solid #333; padding-top: 6px; font-size: 12.5px; }
.acta .print-actions { text-align: center; margin: 16px 0; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .acta { border: none; margin: 0; padding: 0; max-width: 100%; }
  .container { margin: 0; padding: 0; max-width: 100%; }
}
