:root {
  --fondo: #faf9f5;
  --superficie: #ffffff;
  --lateral: #f3f1ea;
  --texto: #1f1e1d;
  --tenue: #73726c;
  --borde: #e6e3da;
  --borde-fuerte: #d4d0c4;
  --acento: #c96442;
  --acento-texto: #ffffff;
  --activo-bg: #e9e6dc;
  --esperando: #a1631a;
  --esperando-bg: #fbf0dc;
  --completado: #3f7a4a;
  --completado-bg: #e5f1e6;
  --peligro: #b3261e;
  --serif: "Tiempos Headline", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radio: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #262624;
    --superficie: #30302e;
    --lateral: #1f1e1d;
    --texto: #f5f4ef;
    --tenue: #a6a49b;
    --borde: #3e3d39;
    --borde-fuerte: #55534d;
    --acento: #d97757;
    --activo-bg: #3a3936;
    --esperando: #f0b45a;
    --esperando-bg: #45361f;
    --completado: #8cc796;
    --completado-bg: #263a2a;
    --peligro: #f28b82;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fondo);
  color: var(--texto);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1rem; margin-bottom: 0.6rem; }
h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tenue); margin: 1rem 0 0.3rem; }
h3:first-child { margin-top: 0; }
p { margin: 0.2rem 0; }
pre { background: var(--lateral); border: 1px solid var(--borde); border-radius: 10px; padding: 0.8rem 1rem; overflow-x: auto; font-size: 0.85rem; }

.tenue { color: var(--tenue); }
.pequeno { font-size: 0.8rem; }
.vacio { color: var(--tenue); padding: 0.8rem 0; margin: 0; list-style: none; }
.error { color: var(--peligro); }
.vencida { color: var(--peligro); font-weight: 600; }
.texto-largo { white-space: pre-wrap; }
.recorte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.lateral {
  background: var(--lateral);
  border-right: 1px solid var(--borde);
  padding: 1.1rem 0.75rem;
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marca { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; padding: 0 0.6rem; display: flex; align-items: center; gap: 0.45rem; }
.marca-logo { color: var(--acento); font-size: 1rem; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-titulo { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tenue); padding: 1rem 0.6rem 0.3rem; }
.nav-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.6rem; border-radius: 8px; text-decoration: none; }
.nav-item:hover { background: var(--activo-bg); }
.nav-item.activo { background: var(--activo-bg); font-weight: 600; }
.nav-nombre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-contador { font-size: 0.75rem; color: var(--tenue); }
.nav-nuevo { color: var(--tenue); }
.sesion { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem; border-top: 1px solid var(--borde); font-size: 0.85rem; }
.punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.contenido { padding: 2.5rem 3rem 4rem; max-width: 1100px; width: 100%; min-width: 0; }
.cabecera { margin-bottom: 1.6rem; }
.cabecera p { margin-top: 0.4rem; }
.cabecera a, .miga a { color: var(--tenue); }
.miga { margin: 0 0 0.8rem; font-size: 0.9rem; }
.miga a { text-decoration: none; }
.titulo-proyecto { font-size: 2.6rem; }

/* ---------- Controles ---------- */
.boton {
  background: var(--texto); color: var(--fondo);
  border: 0; border-radius: 10px; padding: 0.5rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.boton:hover { opacity: 0.88; }
.boton.secundario { background: transparent; color: var(--texto); border: 1px solid var(--borde-fuerte); font-weight: 500; }
.boton.secundario:hover { background: var(--activo-bg); }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--tenue); cursor: pointer; text-decoration: underline; }
.enlace.peligro { color: var(--peligro); }

input, textarea, select {
  font: inherit; color: var(--texto); background: var(--superficie);
  border: 1px solid var(--borde-fuerte); border-radius: 10px; padding: 0.55rem 0.75rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acento); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
input[type="color"] { width: 4rem; height: 2.4rem; padding: 0.2rem; }
input[type="date"] { width: auto; }

.formulario { display: flex; flex-direction: column; gap: 1rem; max-width: 380px; }
.formulario.ancho { max-width: 640px; }
.formulario label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; font-size: 0.9rem; }
.acciones { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.acciones a { color: var(--tenue); }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--borde);
  background: transparent; color: var(--tenue); font: inherit; font-size: 0.85rem;
  text-decoration: none; cursor: pointer;
}
.chip span { font-size: 0.75rem; opacity: 0.75; }
.chip:hover { border-color: var(--borde-fuerte); color: var(--texto); }
.chip.activa { background: var(--activo-bg); border-color: var(--activo-bg); color: var(--texto); font-weight: 600; }

.estado { font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--activo-bg); color: var(--tenue); vertical-align: middle; white-space: nowrap; }
.estado-esperando { background: var(--esperando-bg); color: var(--esperando); }
.estado-completado { background: var(--completado-bg); color: var(--completado); }
.contador { font-size: 0.72rem; font-weight: 600; min-width: 1.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid var(--borde-fuerte); color: var(--tenue); text-align: center; }

/* ---------- Alta rápida (como la caja de "¿Cómo puedo ayudarte hoy?") ---------- */
.alta-rapida {
  background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 20px;
  padding: 1rem 1.1rem 0.8rem; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05); margin-bottom: 2rem;
}
.alta-rapida textarea { border: 0; padding: 0.2rem; font-size: 1.05rem; background: transparent; }
.alta-rapida textarea:focus { outline: none; }
.alta-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }

/* ---------- Pestañas y filtros ---------- */
.pestanas { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.pestanas a { padding: 0.45rem 0.9rem; border-radius: 10px; text-decoration: none; color: var(--tenue); font-size: 1.02rem; }
.pestanas a.activa { background: var(--activo-bg); color: var(--texto); font-weight: 500; }
.filtros { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }

/* ---------- Listas tipo "chats y tareas" ---------- */
.lista { border-top: 1px solid var(--borde); }
.fila {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.85rem 0.3rem; border-bottom: 1px solid var(--borde); text-decoration: none;
}
.fila:hover { background: color-mix(in srgb, var(--activo-bg) 45%, transparent); }
.fila-texto { flex: 1; min-width: 0; }
.fila-titulo { font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.fila-resumen { color: var(--tenue); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-fecha { color: var(--tenue); white-space: nowrap; font-size: 0.95rem; }
.fila-hecha .fila-titulo { color: var(--tenue); }

/* ---------- Inicio ---------- */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 2.2rem; }
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.1rem 1.2rem; text-decoration: none; display: flex; flex-direction: column; gap: 0.5rem;
}
.tarjeta:hover { border-color: var(--borde-fuerte); }
.tarjeta-titulo { font-family: var(--serif); font-size: 1.25rem; display: flex; align-items: center; gap: 0.55rem; }
.tarjeta-vacia { align-items: center; justify-content: center; color: var(--tenue); border-style: dashed; min-height: 140px; }
.cifras { display: flex; gap: 1.4rem; margin: 0.3rem 0; }
.cifras div { display: flex; flex-direction: column; }
.cifras strong { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.cifras span { font-size: 0.78rem; color: var(--tenue); }
.columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.bloque { margin-bottom: 2rem; }
.bloque .fila:first-of-type { border-top: 1px solid var(--borde); }

/* ---------- Historial ---------- */
.historial { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--borde); }
.evento { position: relative; padding: 0.15rem 0 1.1rem 1.1rem; }
.evento::before {
  content: ""; position: absolute; left: -6px; top: 0.45rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--borde-fuerte); border: 2px solid var(--fondo);
}
.evento-nota::before { background: var(--acento); }
.evento-meta { font-size: 0.8rem; color: var(--tenue); }
.evento-meta a { color: inherit; }
.evento-texto { white-space: pre-wrap; }
.evento-cambio .evento-texto { color: var(--tenue); font-size: 0.92rem; }
.evento-nota .evento-texto { background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: 0.55rem 0.8rem; margin-top: 0.25rem; }

/* ---------- Detalle de línea ---------- */
.detalle { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.detalle-lateral { position: sticky; top: 1.5rem; }
.caja { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem 1.2rem; }
.selector-estado { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tareas { list-style: none; padding: 0; margin: 0 0 0.7rem; }
.tareas li { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--borde); }
.tareas form { margin: 0; display: contents; }
.tarea-texto { flex: 1; }
.tareas li.hecha .tarea-texto { text-decoration: line-through; color: var(--tenue); }
.check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--borde-fuerte);
  background: transparent; color: var(--acento-texto); font-size: 0.75rem; line-height: 1;
  cursor: pointer; padding: 0; flex: none;
}
.tareas li.hecha .check { background: var(--completado); border-color: var(--completado); }
.quitar { text-decoration: none; font-size: 1.1rem; opacity: 0; }
.tareas li:hover .quitar, .quitar:focus { opacity: 1; }
.en-linea { display: flex; gap: 0.5rem; }
.en-linea input[name="texto"] { flex: 1; }
.nota { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; margin-bottom: 1.4rem; }

/* ---------- Login ---------- */
.pantalla-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.caja-login { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 1rem; }
.caja-login .marca { padding: 0; }
.caja-login .formulario { max-width: none; }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--borde); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.7rem 16px; }
  .lateral nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; order: 3; }
  .nav-titulo { display: none; }
  .sesion { border: 0; margin-left: auto; padding: 0; gap: 0.8rem; }
  .contenido { padding: 1.5rem 16px 3rem; }
  .titulo-proyecto { font-size: 2rem; }
  .columnas, .detalle { grid-template-columns: 1fr; }
  .detalle-lateral { position: static; order: -1; }
  .en-linea { flex-wrap: wrap; }
  .quitar { opacity: 1; }
}

/* ---------- Módulo email marketing ---------- */
.subnav { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--borde); margin-bottom: 1.4rem; }
.subnav a { padding: 0.4rem 0; text-decoration: none; color: var(--tenue); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.activa { color: var(--texto); border-color: var(--acento); font-weight: 600; }

.prioridades { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 0.8rem; }
.prio-tarjeta {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 1rem; text-decoration: none;
  background: var(--superficie); border: 1px solid var(--borde); border-left: 4px solid var(--prio); border-radius: 12px;
}
.prio-tarjeta:hover { border-color: var(--borde-fuerte); border-left-color: var(--prio); }
.prio-tarjeta strong { font-size: 1.7rem; line-height: 1.1; }
.prio-letra { font-weight: 700; color: var(--prio); font-size: 0.85rem; }
.prio-nombre { font-weight: 600; font-size: 0.9rem; }
.prio-A { --prio: #3f7a4a; } .prio-B { --prio: #2f6db3; } .prio-C { --prio: #c96442; }
.prio-D { --prio: #8a877d; } .prio-E { --prio: #b3261e; } .prio-X { --prio: #6b1d1d; } .prio-\? { --prio: #8a877d; }
.prio-mini {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 6px;
  background: var(--prio); color: #fff; font-weight: 700; font-size: 0.78rem;
}

.aviso { background: var(--esperando-bg); color: var(--texto); border: 1px solid color-mix(in srgb, var(--esperando) 35%, transparent); border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 1.4rem; }
.aviso a { color: var(--esperando); font-weight: 600; }
.aviso-peligro { background: color-mix(in srgb, var(--peligro) 12%, var(--fondo)); border-color: color-mix(in srgb, var(--peligro) 40%, transparent); }
.cifras.grandes strong { font-size: 2rem; }

.barras { list-style: none; padding: 0; margin: 0; }
.barras a { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 2.5rem; align-items: center; gap: 0.7rem; padding: 0.3rem 0; text-decoration: none; font-size: 0.9rem; }
.barras a:hover .barra-nombre { text-decoration: underline; }
.barra-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra { height: 0.6rem; background: var(--activo-bg); border-radius: 999px; overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--acento); border-radius: 999px; }
.barra-n { text-align: right; color: var(--tenue); font-variant-numeric: tabular-nums; }

.reglas { border: 1px solid var(--borde); border-radius: 12px; padding: 0.8rem 1rem; background: var(--superficie); }
.reglas summary { cursor: pointer; font-weight: 600; }
.reglas ul { margin: 0.6rem 0 0; padding-left: 1.2rem; }
.reglas li { margin: 0.3rem 0; }

.filtro-contactos { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filtro-contactos input[type="search"] { flex: 1 1 260px; }
.filtro-contactos select { width: auto; max-width: 13rem; padding: 0.45rem 0.6rem; font-size: 0.88rem; }
.check-campana { display: flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; white-space: nowrap; }
.check-campana input { width: auto; }
.barra-resultados { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }

.tabla-envoltorio { overflow-x: auto; margin-top: 0.8rem; border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie); }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabla th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tenue); font-weight: 600; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover { background: color-mix(in srgb, var(--activo-bg) 45%, transparent); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla a { text-decoration: none; }
.nowrap { white-space: nowrap; }
.etiqueta-revisar, .etiqueta-baja { display: inline-block; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--esperando-bg); color: var(--esperando); }
.etiqueta-baja { background: color-mix(in srgb, var(--peligro) 15%, var(--fondo)); color: var(--peligro); }

.datos { display: grid; grid-template-columns: 11rem 1fr; gap: 0.45rem 1rem; margin: 0; }
.datos dt { color: var(--tenue); font-size: 0.88rem; }
.datos dd { margin: 0; }
.interno { font-size: 0.85rem; color: var(--peligro); background: color-mix(in srgb, var(--peligro) 8%, var(--fondo)); border-radius: 8px; padding: 0.4rem 0.7rem; display: inline-block; }
.caja.formulario { max-width: none; gap: 0.8rem; }

@media (max-width: 860px) {
  .datos { grid-template-columns: 1fr; gap: 0.1rem; }
  .datos dd { margin-bottom: 0.5rem; }
  .filtro-contactos select { max-width: none; flex: 1 1 45%; }
}

/* ---------- Módulo packaging ---------- */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla th.num { text-align: right; }
.campos-fila { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: flex-end; }
.campos-fila > label { flex: 1 1 140px; }
fieldset { border: 1px solid var(--borde); border-radius: 12px; padding: 0.8rem 1rem 1rem; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
fieldset.campos-fila { flex-direction: row; }
legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.3rem; }
.calculadora { align-items: center; margin-bottom: 0.4rem; flex-wrap: wrap; }
.calculadora label { font-weight: 500; font-size: 0.9rem; white-space: nowrap; }
.calculadora input { max-width: 9rem; }

/* ---------- Ofertas Orpi ---------- */
.nav-destacado { font-weight: 600; }
.accesos { margin-bottom: 1.6rem; }
.acceso { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.2rem; border: 1px solid var(--borde);
  border-left: 4px solid var(--acento); border-radius: var(--radio); background: var(--superficie); text-decoration: none; }
.acceso:hover { border-color: var(--borde-fuerte); border-left-color: var(--acento); }
.acceso-titulo { font-family: var(--serif); font-size: 1.3rem; display: flex; align-items: center; gap: 0.5rem; }
.aviso-ok { background: var(--completado-bg); border-color: color-mix(in srgb, var(--completado) 35%, transparent); }
.chip-opcion { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem; border: 1px solid var(--borde); border-radius: 999px; font-weight: 400 !important; cursor: pointer; }
.chip-opcion input { width: auto; margin: 0; }
.chip-opcion[hidden] { display: none !important; }
.chip-opcion:has(input:checked) { background: var(--activo-bg); border-color: var(--borde-fuerte); font-weight: 600 !important; }
.reclamo { display: flex; flex-direction: column; gap: 0.5rem; }
.reclamo-emojis { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.reclamo-emojis button { font-size: 1.15rem; line-height: 1; padding: 0.3rem 0.5rem; border: 1px solid var(--borde);
  border-radius: 999px; background: transparent; cursor: pointer; }
.reclamo-emojis button:hover { background: var(--activo-bg); border-color: var(--borde-fuerte); }
.marcas-lista { display: flex; flex-wrap: wrap; gap: 0.4rem; max-height: 16rem; overflow-y: auto; padding: 0.2rem 0; }
.titulo-oferta { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.vista-email { width: 100%; height: 760px; border: 1px solid var(--borde); border-radius: var(--radio); background: #fff; }
.lista-destinatarios { max-height: 30rem; overflow-y: auto; }
.lista-destinatarios tbody tr { cursor: default; }
.lista-destinatarios input[type="checkbox"] { width: auto; }
.datos-compactos { grid-template-columns: 7.5rem 1fr; font-size: 0.88rem; }
.estado-of-terminada { background: var(--completado-bg); color: var(--completado); }
.estado-of-enviando, .estado-of-preparada { background: var(--esperando-bg); color: var(--esperando); }
.estado-of-error, .estado-of-interrumpida, .estado-of-parcial { background: color-mix(in srgb, var(--peligro) 15%, var(--fondo)); color: var(--peligro); }
.filtros-excel { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.5rem 0.8rem; margin: 0.6rem 0 0.8rem; }
.filtro-excel { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; padding: 0.45rem 0.6rem;
  border: 1px solid var(--borde); border-radius: 10px; background: var(--superficie); }
.filtro-excel select { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.filtro-activo { border-color: var(--acento); box-shadow: inset 3px 0 0 var(--acento); }
.marca-base { display: inline-block; padding: 0 0.35rem; margin: 0 0.15rem 0.15rem 0; border-radius: 6px; background: var(--activo-bg); font-size: 0.75rem; white-space: nowrap; }
.marca-interna { background: transparent; border: 1px dashed var(--borde-fuerte); color: var(--tenue); }
.casillas-filtro { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.casillas-filtro legend { font-size: 0.85rem; }
.chip-excluir:has(input:checked) { background: color-mix(in srgb, var(--peligro) 14%, var(--fondo)); border-color: var(--peligro); }
.ancho-completo { flex-basis: 100%; margin: 0.2rem 0 0; }

/* ---------- Dolphin Group: semáforo, áreas y ritmos ---------- */
:root { --ambar: #d9952b; --verde: #3f8a50; }
@media (prefers-color-scheme: dark) { :root { --ambar: #f0b45a; --verde: #8cc796; } }

.pestanas { flex-wrap: wrap; }
.luz { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; vertical-align: middle; }
.luz-rojo { background: var(--peligro); box-shadow: 0 0 0 3px color-mix(in srgb, var(--peligro) 18%, transparent); }
.luz-ambar { background: var(--ambar); }
.luz-verde { background: var(--verde); }
.luz-gris { background: transparent; border: 1.5px solid var(--borde-fuerte); }
.punto-grande { width: 14px; height: 14px; vertical-align: middle; }
.etiqueta-area { font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--activo-bg); color: var(--tenue); white-space: nowrap; }

.tarjeta-empresa { border-top: 3px solid var(--color, var(--borde)); }
.cifra-principal { display: flex; flex-direction: column; padding: 0.2rem 0; }
.cifra-principal strong { font-size: 1.7rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cifra-principal span { font-size: 0.8rem; color: var(--tenue); }

.matriz th, .matriz td { text-align: center; padding: 0.55rem 0.4rem; }
.matriz th:first-child, .matriz td:first-child { text-align: left; }
.matriz tbody tr { cursor: default; }
.celda { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.5rem; border-radius: 8px; }
.celda:hover { background: var(--activo-bg); }
.celda-n { font-size: 0.8rem; color: var(--tenue); font-variant-numeric: tabular-nums; }
.leyenda { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.6rem; }
.leyenda > span { display: inline-flex; align-items: center; gap: 0.4rem; }

.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.area-tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.1rem;
  text-decoration: none; display: flex; flex-direction: column; gap: 0.45rem; }
.area-tarjeta:hover { border-color: var(--borde-fuerte); }
.area-titulo { font-family: var(--serif); font-size: 1.25rem; display: flex; align-items: center; gap: 0.55rem; }
.area-incluye { color: var(--tenue); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.area-cifra { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.88rem; border-top: 1px solid var(--borde); padding-top: 0.35rem; }
.area-cifra span { color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-cifra strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.area-pie { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; font-size: 0.78rem; color: var(--tenue); margin-top: auto; }

.ritmos { border-top: 1px solid var(--borde); margin-bottom: 0.6rem; }
.ritmo { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--borde); }
.ritmo form { margin: 0; display: contents; }
.ritmo-texto { flex: 1; min-width: 0; }
.ritmo-titulo { font-size: 1rem; }
.ritmo-meta { font-size: 0.82rem; color: var(--tenue); display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.ritmo-meta a { color: inherit; }
.ritmo-cuando { font-size: 0.85rem; color: var(--tenue); white-space: nowrap; }
.ritmo-atrasado .ritmo-cuando { color: var(--peligro); font-weight: 600; }
.ritmo-hoy .ritmo-cuando { color: var(--ambar); font-weight: 600; }
.ritmo-al_dia .ritmo-titulo { color: var(--tenue); }
.check:hover { border-color: var(--completado); }
.check-hecho { background: var(--completado); border-color: var(--completado); }
.quitar.visible { opacity: 1; }
.pestanas-areas a { font-size: 0.92rem; }
.desplegable { margin-top: 0.8rem; }
.desplegable summary { cursor: pointer; color: var(--tenue); font-size: 0.92rem; }
.desplegable[open] summary { margin-bottom: 0.8rem; color: var(--texto); }
.campo-corto { width: 7rem; }
.en-linea-simple { display: inline; margin: 0; }
.cifras-lista { border-top: 1px solid var(--borde); }
.cifra-fila { padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--borde); display: flex; flex-direction: column; gap: 0.35rem; }
.cifra-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.cifra-acciones { display: flex; align-items: center; gap: 0.8rem; }
.cifra-datos { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.cifra-datos strong { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cifra-fila .en-linea { flex-wrap: wrap; }

/* ---------- Carátula (estilo de la web de Orpi: negro, dorado y letra fina espaciada) ---------- */
.pantalla-caratula {
  --oro: #d4af37; --claro: #f5f4ef; --apagado: rgba(245, 244, 239, 0.6); --raya: rgba(245, 244, 239, 0.1);
  --letra: "Helvetica Neue", Helvetica, Arial, sans-serif;
  min-height: 100vh; color: var(--claro); font-family: var(--letra); font-weight: 300; color-scheme: dark;
  background: #0f0f0f linear-gradient(-45deg, #0f0f0f, #2c2c2c, #1a1a1a, #000) 0 0 / 400% 400% fixed;
  animation: fondo-orpi 15s ease infinite;
}
.pantalla-caratula::before { content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.06) 0%, transparent 70%); }
@keyframes fondo-orpi { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.caratula-barra { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem clamp(16px, 3vw, 2rem); border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
.caratula-marca { font-size: 0.8rem; letter-spacing: 5px; color: var(--apagado); }
.caratula { position: relative; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 5rem; }
.caratula a { color: inherit; }

.menu-oculto { position: relative; }
.menu-oculto summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 0.6rem;
  opacity: 0.35; transition: opacity 0.3s; }
.menu-oculto summary::-webkit-details-marker { display: none; }
.menu-oculto summary span { display: block; width: 20px; height: 1px; background: var(--oro); }
.menu-oculto summary:hover, .menu-oculto[open] summary { opacity: 1; }
.menu-oculto-panel { position: absolute; right: 0; top: calc(100% + 0.4rem); width: 280px; background: #141414;
  border: 1px solid rgba(212, 175, 55, 0.25); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); padding: 0.7rem;
  display: flex; flex-direction: column; gap: 1px; color: var(--claro); }
.menu-oculto-panel a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; text-decoration: none; font-size: 0.92rem; }
.menu-oculto-panel a:hover { background: rgba(212, 175, 55, 0.08); }
.menu-oculto-panel .nav-titulo { color: var(--apagado); letter-spacing: 3px; font-size: 0.65rem; padding: 0.9rem 0.6rem 0.25rem; }
.menu-oculto-panel form { padding: 0.7rem 0.6rem 0.2rem; border-top: 1px solid var(--raya); margin-top: 0.5rem; }
.menu-oculto-panel .enlace { color: var(--apagado); }
.menu-oculto-principal { justify-content: space-between; color: var(--oro); letter-spacing: 3px; text-transform: uppercase;
  font-size: 0.78rem !important; border: 1px solid rgba(212, 175, 55, 0.35); }

/* Portada: ocupa la primera pantalla, con la pregunta del día a la vista */
.portada { min-height: calc(100svh - 64px); display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; position: relative; padding: 2rem 0 4rem; }
.portada-interior { width: 100%; display: flex; flex-direction: column; align-items: center; }
.portada-saludo, .portada-lema { text-transform: uppercase; letter-spacing: 5px; color: var(--apagado); margin: 0; }
.portada-saludo { font-size: 0.9rem; }
.portada-lema { font-size: 0.7rem; margin-top: 2rem; line-height: 2; }
.portada-linea { width: 100px; height: 1px; background: var(--oro); margin: 1.8rem auto; }
.portada h1 { font-family: var(--letra); font-weight: 200; text-transform: uppercase; letter-spacing: 0.16em;
  font-size: clamp(2.2rem, 7.5vw, 5.6rem); line-height: 1.1; margin-right: -0.16em; }
.portada h1 span { background: linear-gradient(to right, #fff 20%, var(--oro) 40%, var(--oro) 60%, #fff 80%) 0 0 / 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: brillo 5s linear infinite; }
@keyframes brillo { to { background-position: 200% center; } }
.portada-baja { position: absolute; bottom: 1.2rem; left: 50%; width: 1px; height: 46px; overflow: hidden;
  background: linear-gradient(var(--oro), transparent); opacity: 0.5; }

.pregunta { width: min(760px, 100%); margin-top: clamp(2.5rem, 7vh, 4.5rem); display: flex; flex-direction: column;
  align-items: center; gap: 1.2rem; }
.pregunta-titulo { text-transform: uppercase; letter-spacing: 5px; font-size: 0.8rem; color: var(--apagado); }
.pregunta-caja { width: 100%; display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid rgba(212, 175, 55, 0.5);
  padding: 0.3rem 0.2rem; transition: border-color 0.3s; }
.pregunta-caja:focus-within { border-color: var(--oro); }
.pregunta-caja input { border: 0; border-radius: 0; background: transparent; color: var(--claro); padding: 0.7rem 0;
  font: 300 1.3rem var(--letra); text-align: center; }
.pregunta-caja input::placeholder { color: rgba(245, 244, 239, 0.3); font-size: 1rem; }
.pregunta-caja input:focus { outline: none; }
.pregunta-boton { flex: none; width: 2.6rem; height: 2.6rem; border: 1px solid var(--oro); border-radius: 50%;
  background: transparent; color: var(--oro); font-size: 1.15rem; cursor: pointer; transition: background 0.3s, color 0.3s; }
.pregunta-boton:hover { background: var(--oro); color: #000; }

/* Marcas: el rótulo de cada una mientras no haya logo; los logos se ven en blanco, como en la web de Orpi */
.marcas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem 0;
  padding: 1.6rem 0; border-top: 1px solid var(--raya); border-bottom: 1px solid var(--raya); }
.marca-caja { display: flex; align-items: center; justify-content: center; height: 2.8rem; padding: 0 clamp(0.9rem, 2.2vw, 1.6rem); }
.marca-caja + .marca-caja { border-left: 1px solid rgba(212, 175, 55, 0.3); }
.marca-caja img { height: var(--alto-logo, 2rem); width: auto; max-width: 9rem; object-fit: contain;
  filter: brightness(0) invert(1); opacity: 0.75;
  transition: opacity 0.3s; }
.marca-caja:hover img, .marca-caja:hover .rotulo { opacity: 1; }
.rotulo { color: var(--claro); text-transform: uppercase; white-space: nowrap; font-size: 0.82rem; letter-spacing: 4px;
  opacity: 0.75; transition: opacity 0.3s; }
.rotulo-serif { font-family: var(--serif); letter-spacing: 6px; font-size: 1rem; }
.rotulo-orpi { font-weight: 300; letter-spacing: 4px; font-size: 0.78rem; }
.marca-broxo { --alto-logo: 2.7rem; }
.marca-brands-democracy { --alto-logo: 2.3rem; }
.rotulo-sans { font-weight: 500; }
.rotulo-espaciada { font-weight: 200; letter-spacing: 5px; }
.rotulo-cursiva { font-style: italic; font-weight: 500; letter-spacing: 3px; }
.rotulo-pesada { font-weight: 700; letter-spacing: 5px; }

/* Manifiesto: la frase del Soul que se enciende palabra a palabra al bajar */
.manifiesto { padding: clamp(5rem, 22vh, 11rem) 0; view-timeline-name: --manifiesto; view-timeline-axis: block; }
.manifiesto p { font-weight: 200; font-size: clamp(1.9rem, 4.8vw, 3.7rem); line-height: 1.22; letter-spacing: -0.01em;
  text-align: center; max-width: 900px; margin: 0 auto; }
.manifiesto span:nth-last-child(-n+2) { color: var(--oro); }

.caratula-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.caratula h2 { font-weight: 300; text-transform: uppercase; letter-spacing: 4px; font-size: 0.75rem; color: var(--oro); margin-bottom: 0.9rem; }
.caratula .vacio, .caratula .tenue, .caratula .ritmo-meta, .caratula .ritmo-cuando, .caratula .intencion-meta { color: var(--apagado); }
.caratula .ritmos, .intenciones { border-top: 1px solid var(--raya); }
.caratula .ritmo, .intenciones li { border-bottom: 1px solid var(--raya); }
.caratula .check { border-color: rgba(212, 175, 55, 0.6); border-radius: 50%; color: #000; }
.caratula .check:hover { border-color: var(--oro); background: rgba(212, 175, 55, 0.15); }
.caratula .check-hecho, .intenciones li.hecha .check { background: var(--oro); border-color: var(--oro); }
.caratula .ritmo-atrasado .ritmo-cuando { color: #f28b82; }
.caratula .ritmo-hoy .ritmo-cuando { color: var(--oro); }
.caratula .vencida { color: #f28b82; }
.intenciones { list-style: none; padding: 0; margin: 0; }
.intenciones li { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.2rem; }
.intenciones li.vacio { display: block; border: 0; line-height: 1.6; }
.intenciones form { margin: 0; display: contents; }
.intencion-texto { flex: 1; min-width: 0; }
.intencion-meta { font-size: 0.82rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.intencion-meta .atajo { color: var(--oro); text-decoration: none; }
.caratula .ritmo-meta a, .caratula .intencion-meta a:not(.atajo) { text-decoration: none; border-bottom: 1px solid var(--raya); }
.intenciones li.hecha .intencion-texto > div:first-child { text-decoration: line-through; color: var(--apagado); }
.intenciones li:hover .quitar { opacity: 1; }
.caratula .quitar { color: var(--apagado); }

/* ---------- Movimiento al estilo Apple ----------
   Al entrar: cada pieza aparece desenfocada y sube, una detrás de otra.
   Al bajar (si el navegador lo admite): la portada se aleja, los logos suben en cascada, la frase se enciende
   palabra a palabra y la barra se vuelve translúcida. Sin soporte o con «reducir movimiento», todo se ve quieto. */
@media (prefers-reduced-motion: no-preference) {
  .aparece { animation: aparecer 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--n, 0) * 0.16s + 0.1s); }
  .portada-linea.aparece { animation: abrir-linea 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 0.3s; }
  .portada-baja { animation: aparecer 1s 1.2s both, gotear 2.4s 2.2s ease-in-out infinite; }
  @keyframes aparecer { from { opacity: 0; filter: blur(12px); transform: translateY(18px); } }
  @keyframes abrir-linea { from { width: 0; opacity: 0; } }
  @keyframes gotear { 0% { clip-path: inset(0 0 100% 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(100% 0 0 0); } }

  @supports (animation-timeline: view()) {
    .caratula-barra { animation: barra-solida linear both; animation-timeline: scroll(root); animation-range: 0 120px; }
    @keyframes barra-solida { to { background: rgba(12, 12, 12, 0.72); border-bottom-color: rgba(245, 244, 239, 0.08); } }

    .portada-interior { animation: alejar linear both; animation-timeline: scroll(root); animation-range: 0 75svh; }
    @keyframes alejar { to { opacity: 0; transform: scale(0.88) translateY(-6vh); filter: blur(4px); } }

    .marca-caja { animation: subir linear both; animation-timeline: view();
      animation-range: entry calc(var(--i) * 9%) entry calc(70% + var(--i) * 9%); }
    @keyframes subir { from { opacity: 0; transform: translateY(40px); } }

    .manifiesto span { animation: encender linear both; animation-timeline: --manifiesto;
      animation-range: cover calc(22% + var(--i) * 2.6%) cover calc(28% + var(--i) * 2.6%); }
    @keyframes encender { from { opacity: 0.14; } }

    .revela { animation: subir linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  }
}

@media (max-width: 860px) {
  .caratula { padding: 0 16px 3rem; }
  .portada-saludo, .portada-lema { letter-spacing: 3px; }
  .portada h1 { letter-spacing: 0.1em; margin-right: -0.1em; }
  .marca-caja { padding: 0 0.9rem; }
  .marca-caja + .marca-caja { border-left: 0; }
  .rotulo { font-size: 0.72rem; letter-spacing: 3px; }
  .caratula-columnas { grid-template-columns: 1fr; gap: 1rem; }
  .pregunta-caja input { font-size: 1.05rem; }
  .menu-oculto-panel { width: min(280px, calc(100vw - 32px)); }
  .pestanas-areas { flex-wrap: nowrap; overflow-x: auto; }
  .ritmo { flex-wrap: wrap; }
  .ritmo-cuando { margin-left: calc(20px + 0.75rem); }
}
.estado-minoristas { background: color-mix(in srgb, var(--acento) 14%, var(--fondo)); color: var(--acento); }
.aviso label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 400; }
.aviso input[name="precio_minoristas"] { max-width: 36rem; font-weight: 600; }
.guardado-ok { color: var(--completado); font-weight: 600; font-size: 0.85rem; margin-left: 0.4rem; }
.fila-quitada td { opacity: 0.5; }

/* Ofertas · temporada de pre-order */
.temporada-elegir { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.temporada-elegir select { width: auto; padding: 0.3rem 0.5rem; }
strong.temporada { color: var(--acento); }

/* Agente de email marketing */
.agente { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.agente-lista ol { list-style: none; padding: 0; margin: 0.8rem 0 0; }
.agente-lista a { display: flex; flex-direction: column; padding: 0.45rem 0.6rem; border-radius: 8px; text-decoration: none; }
.agente-lista a:hover, .agente-lista a.activa { background: var(--activo-bg); }
.agente-bienvenida h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: 0.4rem; }
.sugerencias { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.4rem; }
.sugerencias form { margin: 0; }
.sugerencias .chip { text-align: left; }
.agente-cabecera { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.agente-cabecera h2 { margin: 0; }
.agente-turnos { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.turno-usuario { align-self: flex-end; max-width: 80%; }
.turno-usuario .burbuja { background: var(--activo-bg); border-radius: 14px; padding: 0.6rem 0.9rem; white-space: pre-wrap; }
.turno-agente .respuesta { line-height: 1.55; }
.turno-agente .respuesta table { border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9rem; }
.turno-agente .respuesta th, .turno-agente .respuesta td { border: 1px solid var(--borde); padding: 0.3rem 0.6rem; text-align: left; }
.turno-agente .respuesta p { margin: 0.4rem 0; }
.turno-agente .respuesta code { background: var(--activo-bg); padding: 0 0.3rem; border-radius: 4px; }
.agente-caja { background: var(--superficie); border: 1px solid var(--borde-fuerte); border-radius: 16px; padding: 0.8rem 1rem; }
.agente-caja textarea { border: 0; background: transparent; padding: 0.2rem; }
.agente-caja textarea:focus { outline: none; }
.propuesta-aplicada td, .propuesta-descartada td { color: var(--tenue); }
.propuesta-descartada td { text-decoration: line-through; }
@media (max-width: 860px) { .agente { grid-template-columns: 1fr; } .turno-usuario { max-width: 100%; } }
.turno-firma { color: var(--acento); font-weight: 600; margin-bottom: 0.2rem; }
.comite { margin: 0.6rem 0 0.3rem; border: 1px solid var(--borde); border-radius: 12px; padding: 0.5rem 0.9rem; background: var(--superficie); }
.comite summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.comite-opiniones { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; margin-top: 0.7rem; }
.comite-opinion { border-left: 3px solid var(--borde-fuerte); padding-left: 0.7rem; font-size: 0.9rem; }
.comite-opinion h4 { margin: 0 0 0.2rem; font-size: 0.85rem; }
.comite-opinion p { margin: 0.25rem 0; }
.comite-marketing { border-color: #2f6db3; } .comite-finanzas { border-color: #3f7a4a; }
.comite-comercial { border-color: #c96442; } .comite-usuario { border-color: #8a877d; }

/* Ofertas programadas */
.estado-programada { background: color-mix(in srgb, #2f6db3 14%, var(--fondo)); color: #2f6db3; }
@media (prefers-color-scheme: dark) { .estado-programada { color: #8db4e8; } }

/* Finanzas */
.fin-nota { font-size: 0.88rem; }
.fin-kpis strong { font-size: 1.5rem; }
.fin-var { font-weight: 600; }
.fin-var.sube { color: var(--completado); } .fin-var.baja { color: var(--peligro); }
.fin-tabla td, .fin-tabla th { padding: 0.35rem 0.6rem; }
.fin-total td { font-weight: 600; border-top: 1px solid var(--borde-fuerte); }
.fin-neg { color: var(--peligro); }
.fin-estado { font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--activo-bg); }
.fin-activo { background: var(--completado-bg); color: var(--completado); }
.fin-dormido { background: var(--esperando-bg); color: var(--esperando); }
.fin-perdido { color: var(--tenue); }
.fin-docs { columns: 2; padding-left: 1.2rem; font-size: 0.9rem; }
.grafico { width: 100%; height: auto; display: block; }
.grafico .g-rejilla { stroke: var(--borde); stroke-width: 1; }
.grafico .g-cero { stroke: var(--borde-fuerte); stroke-width: 1; }
.grafico .g-eje { fill: var(--tenue); font-size: 11px; }
.grafico path { stroke: var(--superficie); stroke-width: 1; }
.grafico path:hover { opacity: 0.8; }
.g-serie-1 { fill: #2a78d6; } .g-serie-2 { fill: #eb6834; }
.g-positivo { fill: #2a78d6; } .g-negativo { fill: #e34948; }
.leyenda { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.3rem; color: var(--tenue); }
.g-muestra { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.g-muestra.g-serie-1, .g-muestra.g-positivo { background: #2a78d6; } .g-muestra.g-serie-2 { background: #eb6834; }
.g-muestra.g-negativo { background: #e34948; }
@media (prefers-color-scheme: dark) {
  .g-serie-1, .g-positivo { fill: #3987e5; } .g-serie-2 { fill: #d95926; } .g-negativo { fill: #e66767; }
  .g-muestra.g-serie-1, .g-muestra.g-positivo { background: #3987e5; } .g-muestra.g-serie-2 { background: #d95926; }
  .g-muestra.g-negativo { background: #e66767; }
}
/* Salud financiera */
.salud-cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.salud-cabecera h2 { margin: 0; }
.salud-periodo { display: flex; gap: 0.4rem; }
.salud-periodo select { width: auto; }
.salud-resumen { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.salud-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--borde); }
.salud-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; }
.salud-tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-top: 4px solid var(--sem); border-radius: 12px; padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.salud-tit { font-size: 0.85rem; color: var(--tenue); font-weight: 600; }
.salud-valor { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.salud-detalle { line-height: 1.35; }
.salud-estado { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; margin-top: auto; }
.sem-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--sem); display: inline-block; }
.sem-verde { --sem: #0ca30c; } .sem-ambar { --sem: #fab219; } .sem-rojo { --sem: #d03b3b; } .sem-gris { --sem: var(--borde-fuerte); } .sem-info { --sem: var(--borde); }
.sem-gris .salud-valor { color: var(--tenue); }
.spark { width: 100%; height: 44px; display: block; }
.spark-cero { stroke: var(--borde); stroke-width: 1; }
.spark-act { fill: none; stroke: #2a78d6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-ant { fill: none; stroke: #eb6834; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }
.spark-punto { fill: #2a78d6; stroke: var(--superficie); stroke-width: 1.5; }
@media (prefers-color-scheme: dark) {
  .spark-act { stroke: #3987e5; } .spark-ant { stroke: #d95926; } .spark-punto { fill: #3987e5; }
}

/* Finanzas · Impuestos (modelos de la AEAT) */
.fis-anio { border-top: 1px solid var(--borde); padding: 0.6rem 0; }
.fis-anio h4 { margin: 0 0 0.4rem; }
.fis-fila { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 0.4rem 1rem; align-items: baseline; padding: 0.2rem 0; }
.fis-docs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fis-docs .chip { font-size: 0.8rem; padding: 0.1rem 0.55rem; }
.fis-sin-leer { opacity: 0.6; }
@media (max-width: 640px) { .fis-fila { grid-template-columns: 1fr; } }

/* Finanzas · Comparativa mes a mes (desvío frente al año anterior) */
.dv-matriz td, .dv-matriz th { white-space: nowrap; }
.dv-matriz td:first-child { white-space: normal; min-width: 12rem; }
.dv-fuente td { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tenue); padding-top: 0.8rem; }
.dv-sel td:first-child { font-weight: 600; }
.dv-bien { background: color-mix(in srgb, var(--completado) 14%, transparent); }
.dv-mal { background: color-mix(in srgb, var(--peligro) 14%, transparent); }
.dv-bien.dv-fuerte { background: color-mix(in srgb, var(--completado) 30%, transparent); }
.dv-mal.dv-fuerte { background: color-mix(in srgb, var(--peligro) 30%, transparent); }
.dv-neutro { background: color-mix(in srgb, var(--borde) 60%, transparent); }
.dv-texto.dv-bien, .dv-texto.dv-mal, .dv-texto.dv-neutro { background: none; }
.dv-texto.dv-bien { color: var(--completado); } .dv-texto.dv-mal { color: var(--peligro); }
