* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1b1f24;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #003876; /* Rotary blue */
  color: white;
}
header h1 { margin: 0; font-size: 1.2rem; }
header nav a { color: white; margin-left: 1rem; text-decoration: none; }
header nav span { opacity: 0.8; font-size: 0.9rem; }
main { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
  margin: 3rem auto;
}
.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.login-form input { padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; }
.login-form button {
  padding: 0.6rem;
  background: #f7a81b; /* Rotary gold */
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.error { color: #b00020; }
.run-now { margin-bottom: 1.5rem; }
.run-now button {
  padding: 0.5rem 1rem;
  background: #003876;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.cards { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.card {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  min-width: 140px;
}
.card .label { font-size: 0.75rem; color: #666; text-transform: uppercase; }
.card .value { font-size: 1.6rem; font-weight: 700; }
canvas { background: white; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; }

/* ---------------------------------------------- reporte mensual ------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.page-head .sub { margin: 0; color: #666; font-size: 0.85rem; max-width: 46ch; }
.acciones { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.acciones button {
  padding: 0.5rem 1rem; background: #003876; color: white;
  border: none; border-radius: 4px; cursor: pointer;
}
.acciones button.secundario { background: white; color: #003876; border: 1px solid #003876; }
.aviso {
  background: #fff6e2; border-left: 4px solid #f7a81b;
  padding: 0.8rem 1rem; border-radius: 4px; font-size: 0.9rem; margin-bottom: 1.5rem;
}
.card .pie { font-size: 0.72rem; color: #666; margin-top: 0.25rem; }
.cards.compactas .card { min-width: 118px; padding: 0.8rem 1rem; }
.cards.compactas .card .value { font-size: 1.15rem; }
.delta { font-weight: 600; }
.delta.up { color: #0f6b3f; }
.delta.down { color: #c02020; }
h3 { font-size: 1rem; margin: 2rem 0 0.8rem; }
.tabla-scroll { overflow-x: auto; background: white; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
table.datos { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.datos th {
  text-align: left; padding: 0.6rem 0.7rem; font-size: 0.68rem; color: #666;
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid #003876;
  white-space: nowrap;
}
table.datos td { padding: 0.5rem 0.7rem; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
table.datos th.n, table.datos td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.datos tbody tr:hover { background: #f7f9fc; }
.destacada { background: white; border-radius: 8px; padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.destacada .meta { font-size: 0.78rem; color: #666; margin: 0 0 0.5rem; }
.destacada p { margin: 0 0 0.4rem; font-size: 0.9rem; }
.nota-pie { font-size: 0.75rem; color: #777; margin-top: 2rem; line-height: 1.5; }

/* ------------------------------------------------ interacciones -------- */
.filtros { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1.2rem 0; }
.filtros a {
  padding: 0.35rem 0.8rem; border-radius: 999px; text-decoration: none;
  font-size: 0.8rem; color: #003876; background: white; border: 1px solid #d6dbe2;
}
.filtros a.activo { background: #003876; color: white; border-color: #003876; }
.lista-inter { display: flex; flex-direction: column; gap: 0.8rem; }
.inter {
  background: white; border-radius: 8px; padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #d6dbe2;
}
.inter.estado-aplicada { border-left-color: #0f6b3f; }
.inter.estado-pendiente { border-left-color: #f7a81b; }
.inter.estado-fallida { border-left-color: #c02020; }
.inter.estado-retirada { border-left-color: #7a5ea8; }
.inter header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.75rem; color: #666; margin-bottom: 0.5rem; }
.inter .tipo { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: #003876; }
.inter .autor { font-weight: 600; color: #1b1f24; }
.inter .texto { font-size: 0.92rem; margin: 0 0 0.5rem; line-height: 1.45; }
.inter .texto.vacio { color: #999; font-style: italic; }
.inter .razon { font-size: 0.78rem; color: #4d545c; margin: 0 0 0.4rem; }
.inter .sent { color: #858b93; margin-left: 0.5rem; }
.inter .contexto { font-size: 0.74rem; color: #858b93; margin: 0 0 0.4rem; }
.inter .error-inter { font-size: 0.78rem; color: #c02020; margin: 0 0 0.4rem; }
.inter .revision { font-size: 0.76rem; color: #7a5ea8; margin: 0 0 0.4rem; }
.badge { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.05em; background: #eef1f5; color: #4d545c; }
.badge.b-aplicada { background: #e3f3ea; color: #0f6b3f; }
.badge.b-pendiente { background: #fff4de; color: #8a6100; }
.badge.b-fallida { background: #fdeaea; color: #c02020; }
.badge.b-retirada { background: #f0eafa; color: #7a5ea8; }
.badge.b-reaccion { background: #003876; color: white; }
.etiqueta.duelo { background: #f0eafa; color: #5b4a7d; padding: 0.1rem 0.5rem;
  border-radius: 999px; font-size: 0.68rem; font-weight: 600; }
.acciones-inter { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem;
  align-items: center; }
.acciones-inter input[type=text] { flex: 1; min-width: 160px; padding: 0.35rem 0.5rem;
  border: 1px solid #d6dbe2; border-radius: 4px; font-size: 0.8rem; }
.acciones-inter button { padding: 0.35rem 0.7rem; border: 1px solid #003876;
  background: white; color: #003876; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.acciones-inter button.peligro { border-color: #c02020; color: #c02020; }
