/* Panel de correo: modo «operar». Un fondo, una tinta, un acento. */
:root {
  --fondo: #f6f6f4;
  --superficie: #ffffff;
  --tono: #eeeeea;
  --linea: #dcdcd6;
  --tinta: #1b1c1e;
  --suave: #55585e;
  --acento: #0d5c57;
  --acento-fuerte: #094641;
  --ok: #1f6b3a;      --ok-fondo: #e3f1e7;
  --mal: #a3261c;     --mal-fondo: #f8e5e2;
  --ojo: #7a4b00;     --ojo-fondo: #f7edd9;
  --radio: 8px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  accent-color: var(--acento);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--fondo); color: var(--tinta);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  scrollbar-color: #b9b9b2 var(--fondo);
}
::selection { background: #cfe5e2; }
a { color: var(--acento); text-underline-offset: 3px; }
a:hover { color: var(--acento-fuerte); }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.5rem; }
p { text-wrap: pretty; margin: 0 0 .75rem; }
.sub { color: var(--suave); margin-bottom: 1.5rem; }
.nota { color: var(--suave); font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .875rem; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem max(1.25rem, env(safe-area-inset-left)); background: var(--superficie);
  border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 2;
}
.marca { font-weight: 700; color: var(--tinta); text-decoration: none; }
.barra nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.barra nav a { color: var(--suave); text-decoration: none; }
.barra nav a:hover { color: var(--tinta); }
.barra nav form { margin: 0; }

main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
main.estrecho { max-width: 420px; padding-top: 12dvh; }
section { margin-top: 2.5rem; }
.migas { color: var(--suave); font-size: .875rem; margin-bottom: .5rem; }
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: .8rem; font-weight: 600; color: var(--suave); background: var(--tono); }
tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num, td.num { text-align: right; }
td.acciones { text-align: right; white-space: nowrap; }
td.acciones > * { margin-left: .75rem; }
.corta { max-width: 28rem; overflow-wrap: anywhere; }
.largo { overflow-wrap: anywhere; word-break: break-all; }
tr.igual td { color: var(--suave); }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 550; }
label.check { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
input, select {
  font: inherit; color: var(--tinta); background: var(--superficie); caret-color: var(--acento);
  border: 1px solid #c4c4bd; border-radius: 6px; padding: .55rem .7rem; min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--acento); outline-offset: 2px;
}
input.codigo { font-family: var(--mono); font-size: 1.25rem; letter-spacing: .2em; text-align: center; }
.con-sufijo { display: flex; align-items: stretch; }
.con-sufijo input { flex: 1; border-radius: 6px 0 0 6px; }
.con-sufijo span { display: flex; align-items: center; padding: 0 .7rem; background: var(--tono); border: 1px solid #c4c4bd; border-left: 0; border-radius: 0 6px 6px 0; color: var(--suave); font-weight: 400; white-space: nowrap; }

.pila { display: flex; flex-direction: column; gap: 1rem; }
.pila.estrecha { max-width: 420px; }
.linea { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.linea input { flex: 1 1 16rem; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; align-items: end; }

button, .boton {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: .55rem 1rem;
  border: 1px solid #c4c4bd; background: var(--superficie); color: var(--tinta); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 120ms cubic-bezier(.23,1,.32,1), background-color 120ms cubic-bezier(.23,1,.32,1);
}
button:active, .boton:active { transform: scale(.97); }
button.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
button.principal:hover { background: var(--acento-fuerte); }
button.peligro { color: var(--mal); border-color: #d9a49e; }
button.enlace { background: none; border: 0; padding: 0; font-weight: 400; color: var(--suave); }
button.enlace:hover { color: var(--tinta); }
button.enlace.peligro { color: var(--mal); }
@media (hover: hover) and (pointer: fine) {
  button:not(.principal):not(.enlace):hover, .boton:hover { background: var(--tono); }
}

details { display: inline-block; text-align: left; }
details summary { cursor: pointer; color: var(--acento); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] { display: block; margin: .5rem 0 .25rem; padding: 1rem; background: var(--tono); border-radius: var(--radio); white-space: normal; min-width: min(22rem, 80vw); }
details[open] summary { margin-bottom: .75rem; font-weight: 600; }

.aviso, .error, .pendiente, .secreto { padding: .75rem 1rem; border-radius: var(--radio); margin-bottom: 1.25rem; }
.aviso { background: var(--ok-fondo); color: var(--ok); }
.error { background: var(--mal-fondo); color: var(--mal); }
.pendiente { background: var(--ojo-fondo); color: var(--tinta); }
.secreto { background: var(--superficie); border: 1px solid var(--acento); }
.secreto .grande { font-size: 1.15rem; user-select: all; margin: 0; }
.vacio { color: var(--suave); padding: 1rem 0; }

.estado { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.estado.ok, .estado.igual { background: var(--ok-fondo); color: var(--ok); }
.estado.falta, .estado.borrar { background: var(--mal-fondo); color: var(--mal); }
.estado.distinto, .estado.cambiar, .estado.crear { background: var(--ojo-fondo); color: var(--ojo); }

.qr { display: block; margin: 1rem 0; border: 1px solid var(--linea); border-radius: var(--radio); background: #fff; image-rendering: pixelated; }
.clave-totp { user-select: all; font-size: 1rem; letter-spacing: .05em; }
.codigos { columns: 2; padding-left: 1.25rem; margin: .5rem 0 0; user-select: all; }

@media (max-width: 640px) {
  main { padding: 1.25rem 1rem 3rem; }
  th, td { padding: .5rem .55rem; }
  table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
