:root {
  --navy: #264971;
  --navy-oscuro: #1a3352;
  --azul: #1f63c6;
  --azul-fondo: #e6effb;
  --oro: #F0D451; /* solo en el logo */
  --fondo: #f4f6fa;
  --tarjeta: #ffffff;
  --texto: #1c2430;
  --tenue: #667085;
  --borde: #e2e6ee;
  --verde: #12805c;
  --verde-fondo: #e3f5ee;
  --rojo: #b42318;
  --rojo-fondo: #fdecea;
  --gris-fondo: #eceff3;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.5 "Helvetica Neue", Arial, sans-serif; }
a { color: var(--azul); }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

.cabecera { background: var(--navy); color: #fff; padding: .75rem 1rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: .5rem; }
.marca { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: .5rem; }
.marca img { width: 28px; height: 28px; }
.marca small { font-weight: 400; font-size: .85rem; opacity: .8; }
.punto { color: var(--oro); }
.menu { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.menu a { color: #fff; text-decoration: none; font-size: .95rem; }
.menu .tenue { opacity: .7; color: #fff; }

.contenido { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
.estrecha { max-width: 440px; margin: 2rem auto; }
.tenue { color: var(--tenue); }
.pequeno { font-size: .85rem; }
.cabecera-seccion { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.aviso { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; }
.aviso-ok { background: var(--verde-fondo); color: var(--verde); }
.aviso-error { background: var(--rojo-fondo); color: var(--rojo); }
.aviso-info { background: var(--azul-fondo); color: var(--navy); }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .5rem .9rem;
  border-radius: 8px; border: 1px solid var(--borde); background: #fff; color: var(--texto); font: inherit;
  font-weight: 500; cursor: pointer; text-decoration: none; }
.boton:hover { border-color: var(--navy); }
.boton-primario { background: var(--navy); border-color: var(--navy); color: #fff; }
.boton-primario:hover { background: var(--navy-oscuro); }
.boton-peligro { color: var(--rojo); }
.boton-pequeno { padding: .25rem .6rem; font-size: .85rem; }

form.campos { display: grid; gap: .75rem; }
label { display: grid; gap: .25rem; font-weight: 500; font-size: .92rem; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--borde); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-fondo); border-color: var(--azul); }
.codigo-2fa { font-size: 1.5rem; letter-spacing: .4rem; text-align: center; }
.en-linea { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.en-linea > * { flex: 1 1 160px; }
.en-linea > .boton { flex: 0 0 auto; }

.tabla-envoltorio { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--tenue); font-weight: 600; }
tr:hover td { background: #fafbfd; }
.nif { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cifra { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 1rem; text-decoration: none; color: var(--texto); }
.cifra strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.cifra span { color: var(--tenue); font-size: .9rem; }
.cifra.caducado strong { color: var(--tenue); }
.cifra.urgente strong { color: var(--rojo); }
.cifra.pronto strong { color: var(--azul); }

.etiqueta { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.etiqueta.caducado { background: var(--gris-fondo); color: var(--tenue); }
.etiqueta.urgente { background: var(--rojo-fondo); color: var(--rojo); }
.etiqueta.pronto { background: var(--azul-fondo); color: var(--azul); }
.etiqueta.vigente { background: var(--verde-fondo); color: var(--verde); }
.etiqueta.neutra { background: var(--gris-fondo); color: var(--texto); }

dl.datos { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.datos dt { color: var(--tenue); }
dl.datos dd { margin: 0; word-break: break-word; }

.clave-revelada { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; background: var(--azul-fondo);
  padding: .75rem 1rem; border-radius: 8px; display: inline-block; letter-spacing: .05em; }
.oculta { filter: blur(6px); }
.qr { text-align: center; }
.qr svg { width: 220px; height: 220px; }
.secreto { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: var(--gris-fondo); padding: .4rem .6rem; border-radius: 6px; }
.pie { text-align: center; color: var(--tenue); font-size: .8rem; padding: 1.5rem 1rem; }
