/* Soma · Consulta — identidad «Petróleo y melocotón». Reglas en DESIGN.md.
   Pantallas de referencia: lienzo «Soma Consulta · pantallas». */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fuentes/instrument-sans-latin-400-normal.c178fc5e2d41.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fuentes/instrument-sans-latin-500-normal.552cbb998bb6.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fuentes/instrument-sans-latin-600-normal.36a59be54659.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("fuentes/newsreader-latin-400-normal.48b72fa720bf.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 500; font-display: swap; src: url("fuentes/newsreader-latin-500-normal.398a694b44c1.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("fuentes/newsreader-latin-400-italic.a6974fdd8f8b.woff2") format("woff2"); }

:root {
  --fondo: #ffffff;
  --panel: #ffffff;
  --panel-suave: #f5f3f1;   /* gris pastel: cajas y carril */
  --hover: #faf9f7;
  --tinta: #141210;
  --tinta-2: #4a4440;
  --tinta-3: #5c5550;
  --suave: #756e67;
  --linea: #e4dfda;
  --linea-fuerte: #d3cdc7;
  --petroleo: #0e6468;
  --petroleo-hover: #0a4f52;
  --petroleo-suave: #e3f1f0;
  --melocoton: #f2a27a;
  --melocoton-suave: #fcede4;
  --subrayado: #f8d5c0;
  --ok: #2f6b3f;
  --ok-suave: #e9f1eb;
  --aviso: #8a5a12;
  --aviso-suave: #fbf1e2;
  --error: #9f332d;
  --error-suave: #f6e1df;
  --privado: #3f6477;
  --privado-suave: #e2ebf0;

  --serif: Newsreader, "Source Serif 4", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  color-scheme: light;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--tinta);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #161514;
    --panel: #1c1a19;
    --panel-suave: #23211f;
    --hover: #22201e;
    --tinta: #f1ede8;
    --tinta-2: #d4cdc5;
    --tinta-3: #bdb5ac;
    --suave: #a29a91;
    --linea: #34312e;
    --linea-fuerte: #4a4642;
    --petroleo: #6cbcb8;
    --petroleo-hover: #8bd0cc;
    --petroleo-suave: #1d3433;
    --melocoton-suave: #3d2a20;
    --subrayado: #5a3a28;
    --ok: #8fcaa0;
    --ok-suave: #203026;
    --aviso: #e6b26c;
    --aviso-suave: #3a2e1e;
    --error: #e8928a;
    --error-suave: #3e2422;
    --privado: #8fb5c9;
    --privado-suave: #1f2c33;
    color-scheme: dark;
  }
  .marca img, .logo-oscuro { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
  .boton.primario { color: #0d1514; }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); line-height: 24px; }
a { color: var(--petroleo); text-decoration: none; }
a:hover { color: var(--petroleo-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--petroleo); outline-offset: 2px; border-radius: var(--r-sm); }
code, .codigo { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
.codigo { color: var(--tinta-3); white-space: nowrap; }

h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 46px; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 19px; line-height: 28px; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 .5rem; }
.panel > h2, .panel .cabecera h2, h2.serif { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 30px; }
.subrayado, .marca-texto { background: linear-gradient(transparent 62%, var(--subrayado) 62%, var(--subrayado) 94%, transparent 94%); }
.antetitulo { display: block; font-size: 12px; line-height: 16px; letter-spacing: .1em; text-transform: uppercase; color: var(--petroleo); font-weight: 600; margin-bottom: 6px; }
.etiqueta-seccion { font-size: 12px; line-height: 16px; color: var(--suave); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* --- esqueleto --- */
.marco { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral { background: var(--panel); border-right: 1px solid var(--linea); padding: 28px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.marca { display: block; padding: 0 12px 22px; color: var(--tinta); }
.marca:hover { text-decoration: none; }
.marca img { display: block; height: 26px; width: auto; margin-bottom: 4px; }
.marca small { display: block; font-size: 12px; line-height: 16px; letter-spacing: .1em; text-transform: uppercase; color: var(--suave); font-weight: 600; }
.lateral a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); color: var(--tinta-3); font-weight: 500; font-size: 15px; }
.lateral a.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.lateral a.nav:hover { background: var(--panel-suave); color: var(--tinta); text-decoration: none; }
.lateral a.nav.activo { background: var(--petroleo-suave); color: var(--petroleo); font-weight: 600; }
.lateral a.nav .contador { margin-left: auto; font-size: 12.5px; line-height: 20px; font-weight: 600; padding: 0 8px; border-radius: var(--r-sm); background: var(--panel-suave); color: var(--tinta-3); }
.lateral a.nav.activo .contador { background: var(--panel); color: var(--petroleo); }
.lateral .separador { flex-grow: 1; min-height: 24px; }
.lateral .pie { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--linea); font-size: 12.5px; color: var(--suave); margin-top: 8px; }
.lateral .pie .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--melocoton-suave); color: var(--tinta); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.lateral .pie strong { color: var(--tinta); font-weight: 600; display: block; font-size: 14px; line-height: 18px; }
.lateral .pie form { display: inline; }
.contenido { padding: 36px 40px 64px; max-width: 1220px; width: 100%; min-width: 0; }

.cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; border-top: 3px solid var(--tinta); padding-top: 18px; }
.cabecera .sub { font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 28px; color: var(--tinta-3); margin-top: 6px; }
.panel .cabecera { border-top: 0; padding-top: 0; margin-bottom: .6rem; align-items: center; }
.panel .cabecera h2 { margin: 0; }
.panel .cabecera .sub { font-family: var(--sans); font-style: normal; font-size: 14px; line-height: 20px; margin-top: 2px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.migas { font-size: 14px; color: var(--tinta-3); margin-bottom: 14px; }

.panel { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; }
.panel.destacado { border-color: var(--petroleo); }
/* «caja»: fondo gris pastel con la tarjeta blanca dentro (resúmenes, lo que hay que cerrar) */
.caja { background: var(--panel-suave); border-radius: var(--r-xl); padding: 6px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.caja > .panel, .caja > .tarjeta { border: 0; margin: 0; border-radius: var(--r-lg); }
.caja > .titulo-caja { padding: 10px 14px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.caja > .titulo-caja h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 30px; }
.tarjeta { background: var(--panel); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: var(--tinta); }
a.tarjeta:hover { text-decoration: none; background: var(--hover); }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.cifra { background: var(--panel-suave); border-radius: var(--r-xl); padding: 6px; color: var(--tinta); }
.cifra > div { background: var(--panel); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; height: 100%; }
a.cifra:hover { text-decoration: none; }
a.cifra:hover > div { background: var(--hover); }
.cifra .nombre { font-size: 13.5px; color: var(--tinta-3); }
.cifra .valor { font-size: 34px; line-height: 40px; font-weight: 600; }
.cifra .detalle { font-size: 12px; line-height: 18px; color: var(--suave); }
.cifra .detalle.aviso { color: var(--aviso); font-weight: 600; }

.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.rejilla-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .rejilla-2-1, .marco { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 2px; border-right: 0; border-bottom: 1px solid var(--linea); }
  .marca { padding: 0 8px 0 4px; } .marca small { display: none; } .marca img { margin: 0; height: 22px; }
  .lateral a.nav { padding: 8px 10px; font-size: 14px; }
  .lateral a.nav svg { display: none; }
  .lateral .pie { margin: 0 0 0 auto; border: 0; padding: 4px; }
  .lateral .separador { display: none; }
  .contenido { padding: 20px 16px 48px; }
  h1 { font-size: 32px; line-height: 38px; }
}

/* --- botones --- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--linea-fuerte); background: var(--panel); color: var(--tinta); padding: 0 16px; border-radius: var(--r-md); cursor: pointer; font: 600 14px/20px var(--sans); text-decoration: none; white-space: nowrap; }
.boton:hover { border-color: var(--tinta-3); color: var(--tinta); text-decoration: none; }
.boton.primario { background: var(--petroleo); border-color: var(--petroleo); color: #fff; }
.boton.primario:hover { background: var(--petroleo-hover); border-color: var(--petroleo-hover); color: #fff; }
.boton.sel, .boton[aria-pressed="true"] { background: var(--petroleo-suave); border-color: var(--petroleo); color: var(--petroleo); }
.boton.peligro { color: var(--error); border-color: var(--error-suave); }
.boton.peligro:hover { background: var(--error-suave); border-color: var(--error); }
.boton.pequeno { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
button.enlace { background: none; border: 0; color: var(--petroleo); cursor: pointer; padding: 0; font: inherit; }

/* --- tablas --- */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); font-weight: 600; padding-top: 10px; padding-bottom: 10px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--hover); }
.panel > table:first-child, .panel > h2 + table { margin-top: -4px; }
.tabla-caja { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--r-lg); margin-bottom: 18px; }

/* --- etiquetas --- */
.etiqueta { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 20px; font-weight: 600; background: var(--petroleo-suave); color: var(--petroleo); white-space: nowrap; vertical-align: middle; }
.etiqueta.ok { background: var(--ok-suave); color: var(--ok); }
.etiqueta.aviso { background: var(--aviso-suave); color: var(--aviso); }
.etiqueta.error { background: var(--error-suave); color: var(--error); }
.etiqueta.gris { background: var(--panel-suave); color: var(--tinta-3); }
.etiqueta.calida { background: var(--melocoton-suave); color: var(--tinta); }
.etiqueta.privado { background: var(--privado-suave); color: var(--privado); }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.suave { color: var(--suave); }
.vacio { color: var(--suave); font-style: italic; margin: 0; }

dl.datos { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
dl.datos dt { color: var(--suave); font-size: 12px; line-height: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
dl.datos dd { margin: 0; }
aside dl.datos { grid-template-columns: 1fr; gap: 0; }
aside dl.datos dd { margin-bottom: 10px; }

/* --- notas --- */
.texto-nota { white-space: pre-wrap; margin: .5rem 0 0; font-family: var(--serif); font-size: 17px; line-height: 27px; color: var(--tinta); max-width: 72ch; }
.nota { border: 1px solid var(--linea); border-radius: var(--r-lg); padding: 16px 18px; margin: 12px 0; }
.nota.personal { border-color: var(--aviso-suave); background: color-mix(in srgb, var(--aviso-suave) 40%, var(--panel)); }
.nota.individual { border-color: var(--privado-suave); background: color-mix(in srgb, var(--privado-suave) 40%, var(--panel)); }
.nota .meta { font-size: 13px; color: var(--suave); }
.nota .meta strong { color: var(--tinta); font-size: 15px; }
.linea-tiempo .sesion { border-bottom: 1px solid var(--linea); padding: 1rem 0; }
.linea-tiempo .sesion:first-child { padding-top: .2rem; }
.linea-tiempo .sesion:last-child { border-bottom: 0; }

/* --- formularios --- */
form.formulario { display: grid; gap: 18px; }
form.formulario .campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
fieldset.bloque { border: 1px solid var(--linea); border-radius: var(--r-lg); padding: 20px 22px; margin: 0; display: grid; gap: 14px; }
fieldset.bloque > legend { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 30px; padding: 0 6px; }
.campo label { display: block; font-size: 14px; font-weight: 600; color: var(--tinta); margin-bottom: 6px; }
.campo.ancho { grid-column: 1 / -1; }
.campo .ayuda, .ayuda { font-size: 12.5px; line-height: 18px; color: var(--tinta-3); margin-top: 6px; }
.campo .errorlist, .errorlist { color: var(--error); margin: 6px 0 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month],
input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--linea-fuerte); border-radius: var(--r-md);
  background: var(--panel); color: var(--tinta); font: 400 14.5px/21px var(--sans);
}
textarea { resize: vertical; line-height: 22px; }
textarea.nota-texto { min-height: 24rem; font-family: var(--serif); font-size: 17px; line-height: 27px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--petroleo); box-shadow: 0 0 0 3px var(--petroleo-suave); }
.campo ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.campo ul li label { color: var(--tinta); font-size: 14.5px; font-weight: 400; display: inline-flex; gap: 8px; align-items: center; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--petroleo); width: 18px; height: 18px; }

/* --- avisos y listados --- */
.mensajes { list-style: none; padding: 0; margin: 0 0 20px; }
.mensajes li { padding: 12px 16px; border-radius: var(--r-md); background: var(--ok-suave); color: var(--ok); margin-bottom: 6px; font-weight: 500; }
.mensajes li.info { background: var(--petroleo-suave); color: var(--petroleo); }
.mensajes li.error { background: var(--error-suave); color: var(--error); }
.mensajes li.warning { background: var(--aviso-suave); color: var(--aviso); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filtros input[type=search] { flex: 1 1 320px; max-width: 520px; }
.filtros select { width: auto; }
.paginacion { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 14px; color: var(--tinta-3); }
.guion { font-family: var(--serif); font-style: italic; font-size: 16.5px; line-height: 25px; color: var(--tinta-2); background: var(--panel-suave); border-radius: var(--r-md); padding: 10px 14px; margin: 0 0 18px; }

/* --- acceso (login, doble verificación) --- */
.acceso { max-width: 420px; margin: 9vh auto; padding: 0 1rem; }
.acceso .marca { padding: 0 0 22px; }
.acceso .marca img { height: 30px; }
.acceso h1 { font-size: 36px; line-height: 42px; border-top: 3px solid var(--tinta); padding-top: 16px; margin-bottom: 18px; }
.acceso form { display: grid; gap: 14px; }
.acceso form p { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.acceso button[type=submit] { min-height: 48px; border-radius: var(--r-md); border: 1px solid var(--petroleo); background: var(--petroleo); color: #fff; font: 600 15px/20px var(--sans); cursor: pointer; }

/* --- agenda: semana en columnas --- */
.semana { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)) repeat(2, minmax(120px, .7fr)); gap: 8px; min-width: 1000px; }
.semana .dia { border: 1px solid var(--linea); border-radius: var(--r-md); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 320px; }
.semana .dia.hoy { border-color: var(--petroleo); }
.semana .dia.finde { background: var(--panel-suave); }
.semana .dia h2 { font-size: 15px; line-height: 22px; margin: 0 0 4px; font-family: var(--sans); font-weight: 600; text-transform: capitalize; }
.semana .cita, .semana .otro, .semana .bloque-dia { display: flex; flex-direction: column; gap: 1px; border-left: 4px solid var(--petroleo); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; line-height: 17px; color: var(--tinta); background: var(--petroleo-suave); text-decoration: none; }
.semana .cita:hover { text-decoration: none; filter: brightness(.97); }
.semana .cita strong { font-size: 13px; }
.semana .cita span, .semana .otro span { color: var(--tinta-3); }
.semana .cita .codigo { font-size: 11.5px; }
.semana .cita.cancelada { background: var(--panel-suave); text-decoration: line-through; color: var(--suave); }
.semana .cita.falta { background: var(--aviso-suave); }
.semana .otro { background: var(--panel); border: 1px solid var(--linea); border-left-width: 4px; }
.semana .otro.aviso { background: var(--aviso-suave); border-color: var(--aviso-suave); border-left-color: var(--aviso); }
.semana .bloque-dia { background: var(--panel); border: 1px solid var(--linea); border-left-width: 4px; font-weight: 600; }
