:root {
  --fondo: #f6f7f8;
  --superficie: #ffffff;
  --texto: #1a1f24;
  --suave: #66707a;
  --linea: #e4e7ea;
  --acento: #0b6e99;
  --error: #b3261e;
  --ok: #1b6e3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.pagina {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.detalle {
  margin: 4px 0 0;
  color: var(--suave);
  font-size: 14px;
}

.acciones {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="search"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--linea);
  border-radius: 8px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
}

.buscador { max-width: 320px; }

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

button {
  padding: 10px 16px;
  border: 1px solid var(--acento);
  border-radius: 8px;
  background: var(--acento);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secundario {
  background: var(--superficie);
  border-color: var(--linea);
  color: var(--texto);
}

button:disabled { opacity: 0.6; cursor: default; }

.enlace { color: var(--acento); }

.tabla-marco {
  overflow-x: auto;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--linea);
}

th {
  position: sticky;
  top: 0;
  background: var(--superficie);
  color: var(--suave);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td:first-child { white-space: normal; min-width: 220px; font-weight: 500; }
th.num, td.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }

.aviso {
  margin: 24px 0 0;
  text-align: center;
  color: var(--suave);
}

.aviso.error { color: var(--error); }
.aviso.ok { color: var(--ok); }

.tarjeta {
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 24px;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 10px;
}

.tarjeta.ancha { max-width: none; margin: 0 0 24px; }
.tarjeta h1 { margin-bottom: 16px; font-size: 20px; }
.tarjeta label { display: block; margin-bottom: 6px; font-weight: 600; }
.tarjeta form button { width: 100%; margin-top: 16px; }
.ayuda { margin: 10px 0 0; color: var(--suave); font-size: 14px; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .pagina { padding: 20px 12px 32px; }
  h1 { font-size: 20px; }
  .buscador { max-width: none; }
  th, td { padding: 9px 10px; font-size: 14px; }
  td:first-child { min-width: 170px; }
}

@media print {
  body { background: #fff; font-size: 11px; }
  .pagina { max-width: none; padding: 0; }
  .buscador { display: none !important; }
  .tabla-marco { border: 0; overflow: visible; }
  th { position: static; }
  th, td { padding: 4px 6px; }
}
