/* Electa — estilos (Alba, 16/11/2026, #9007). Sobrio, legible en el celular, sin colores de partido. */
:root {
  --tinta: #17304f; --tinta-2: #24476f; --acento: #f0a63a; --acento-2: #c97f12; --papel: #f5f3ee; --blanco: #fff;
  --texto: #1d2733; --suave: #5d6b7a; --linea: #e2ded5; --ok: #1f7a4d; --ok-f: #e3f3ea; --alerta: #a86400; --alerta-f: #fdf1d8;
  --mal: #b3261e; --mal-f: #fbe6e4; --info-f: #e6eef8; --radio: 12px; --sombra: 0 1px 2px rgba(23,48,79,.06), 0 4px 16px rgba(23,48,79,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; font-size: 15px; line-height: 1.5; color: var(--texto); background: var(--papel); }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; color: var(--tinta); margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
a { color: var(--tinta-2); }
p { margin: 0 0 .6rem; }
small, .suave { color: var(--suave); }
.cargando { padding: 3rem 1rem; text-align: center; color: var(--suave); }
[hidden] { display: none !important; }

/* Botones y campos */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem .95rem; border: 1px solid var(--linea); border-radius: 10px; background: var(--blanco); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--tinta); white-space: nowrap; }
.btn:hover { border-color: var(--tinta-2); }
.btn.pri { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.btn.pri:hover { background: var(--tinta-2); }
.btn.oro { background: var(--acento); border-color: var(--acento); color: #2b1c00; }
.btn.mal { color: var(--mal); border-color: #e8c4c1; }
.btn.chico { min-height: 32px; padding: .2rem .6rem; font-size: .85rem; }
.btn.plano { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn svg { width: 18px; height: 18px; flex: none; }
label { display: block; font-size: .82rem; font-weight: 500; color: var(--suave); margin-bottom: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: .5rem .7rem; border: 1px solid #cfcabd; border-radius: 10px; background: #fff; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; border-color: var(--tinta-2); }
.campo { margin-bottom: .8rem; min-width: 0; }
.campo .ayuda { font-size: .78rem; color: var(--suave); margin-top: .2rem; }
.campo.check label { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; color: var(--texto); font-weight: 400; cursor: pointer; }
.campo.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--tinta); }
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .9rem; }
.rejilla .todo { grid-column: 1 / -1; }

/* Ingreso */
.ingreso { min-height: 100dvh; display: grid; place-items: center; padding: 1.2rem; background: linear-gradient(160deg, #17304f 0%, #24476f 55%, #2f5c8a 100%); }
.ingreso .caja { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 2rem 1.6rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.marca { display: flex; align-items: center; gap: .6rem; font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 500; color: var(--tinta); letter-spacing: -.01em; }
.marca img { width: 38px; height: 38px; }
.marca small { display: block; font-family: 'Poppins', sans-serif; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); font-weight: 500; }

/* Estructura */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100dvh; }
.app > div { min-width: 0; }
.lado { background: var(--tinta); color: #dfe7f1; padding: 1rem .8rem; display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.lado .marca { color: #fff; font-size: 1.45rem; padding: 0 .4rem; }
.lado .marca small { color: #9fb3c9; }
.lado select { background: var(--tinta-2); color: #fff; border-color: #3b5d86; min-height: 38px; font-size: .88rem; }
.lado nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lado nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 10px; color: #dfe7f1; text-decoration: none; font-size: .93rem; }
.lado nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.lado nav a:hover { background: rgba(255,255,255,.08); }
.lado nav a.activo { background: #fff; color: var(--tinta); font-weight: 600; }
.lado .pie { font-size: .8rem; color: #9fb3c9; border-top: 1px solid #2c4a6e; padding-top: .7rem; }
.lado .pie b { color: #fff; font-weight: 500; display: block; }
.lado .pie button { background: none; border: 0; color: #cfe0f3; text-decoration: underline; cursor: pointer; padding: .2rem 0; margin-right: .8rem; font-size: .8rem; }
.principal { padding: 1.3rem 1.5rem 4rem; min-width: 0; }
.barra-movil { display: none; }
.demo-franja { background: repeating-linear-gradient(-45deg, #fdf1d8, #fdf1d8 12px, #fbe4b4 12px, #fbe4b4 24px); color: #6b4300; text-align: center; font-size: .8rem; font-weight: 600; padding: .3rem .6rem; border-radius: 8px; margin-bottom: 1rem; }
.cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.cab .acc { display: flex; flex-wrap: wrap; gap: .5rem; }
.pestanas { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 1px solid var(--linea); margin-bottom: 1rem; scrollbar-width: none; }
.pestanas a { padding: .55rem .9rem; text-decoration: none; color: var(--suave); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; font-size: .92rem; }
.pestanas a.activo { color: var(--tinta); border-color: var(--acento); }

/* Tarjetas, tablas */
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem 1.1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.tarjeta > h2, .tarjeta > h3 { margin-bottom: .6rem; }
.cuadros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.cuadro { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: .85rem 1rem; box-shadow: var(--sombra); }
.cuadro .n { font-family: 'Fraunces', serif; font-size: 1.9rem; color: var(--tinta); line-height: 1.1; }
.cuadro .t { font-size: .8rem; color: var(--suave); }
.cuadro.destaca { background: var(--tinta); border-color: var(--tinta); }
.cuadro.destaca .n { color: var(--acento); } .cuadro.destaca .t { color: #cfe0f3; }
.dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.tabla-caja { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); background: #fff; box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 600; padding: .6rem .8rem; background: #faf9f6; border-bottom: 1px solid var(--linea); white-space: nowrap; }
td { padding: .6rem .8rem; border-bottom: 1px solid #efece5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: #faf8f2; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vacio { padding: 2rem 1rem; text-align: center; color: var(--suave); }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.filtros input, .filtros select { min-height: 38px; font-size: .88rem; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: .55rem 0; border-bottom: 1px solid #efece5; display: flex; gap: .7rem; justify-content: space-between; align-items: flex-start; }
.lista li:last-child { border-bottom: 0; }

/* Etiquetas y avisos */
.et { display: inline-block; padding: .08rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 600; background: #eceae4; color: #4b5563; white-space: nowrap; }
.et.ok { background: var(--ok-f); color: var(--ok); } .et.alerta { background: var(--alerta-f); color: var(--alerta); } .et.mal { background: var(--mal-f); color: var(--mal); }
.et.info { background: var(--info-f); color: var(--tinta-2); } .et.ia { background: #ede7f9; color: #5b3aa6; }
.aviso { border-radius: 10px; padding: .65rem .85rem; margin-bottom: .8rem; font-size: .9rem; background: var(--info-f); border: 1px solid #c8d8ec; }
.aviso.alerta { background: var(--alerta-f); border-color: #f0d79c; } .aviso.mal { background: var(--mal-f); border-color: #efc2be; } .aviso.ok { background: var(--ok-f); border-color: #bfe0cd; }
.aviso.ia { background: #f3effb; border-color: #d9cdf2; }
.barra { height: 10px; background: #ebe8e0; border-radius: 99px; overflow: hidden; min-width: 80px; }
.barra i { display: block; height: 100%; background: var(--tinta-2); border-radius: 99px; }
.barra.ok i { background: var(--ok); } .barra.alerta i { background: var(--acento-2); } .barra.mal i { background: var(--mal); }

/* Modal */
.velo { position: fixed; inset: 0; background: rgba(15,28,45,.55); display: grid; place-items: center; padding: 1rem; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: min(680px, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.ancho { width: min(940px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--linea); }
.modal .cuerpo { padding: 1.1rem 1.2rem; overflow-y: auto; }
.modal footer { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding: .8rem 1.2rem; border-top: 1px solid var(--linea); }
.modal footer .izq { margin-right: auto; }
.cerrar { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--suave); padding: .2rem .5rem; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 99; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--tinta); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--sombra); font-size: .9rem; }
.toast.mal { background: var(--mal); } .toast.ok { background: var(--ok); }

/* Seguimiento de lo prometido, usuarios en casillas y duración de guiones (Alba, 17/11/2026, #9019, #9020 y #9022) */
.velo + .velo { background: rgba(15,28,45,.4); }
.casillas-usr { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .15rem .8rem; border: 1px solid #cfcabd; border-radius: 10px; padding: .5rem .7rem; max-height: 190px; overflow-y: auto; background: #fff; }
.casilla { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; color: var(--texto); font-weight: 400; cursor: pointer; margin: 0; padding: .25rem 0; min-width: 0; }
.casilla input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--tinta); }
.casilla span { overflow-wrap: anywhere; }
.datos { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: .3rem .9rem; margin: .6rem 0 0; font-size: .92rem; }
.datos dt { color: var(--suave); font-size: .82rem; font-weight: 500; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.historial { list-style: none; margin: 0; padding: 0 0 0 .2rem; border-left: 3px solid var(--linea); }
.historial li { position: relative; padding: .1rem 0 .9rem 1rem; }
.historial li::before { content: ''; position: absolute; left: -8px; top: .45rem; width: 11px; height: 11px; border-radius: 50%; background: var(--acento); border: 2px solid #fff; }
.historial .quien { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.historial .nota { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .15rem; }
.globo { margin-left: auto; min-width: 22px; padding: 0 .4rem; border-radius: 99px; background: var(--acento); color: #2b1c00; font-size: .74rem; font-weight: 600; text-align: center; line-height: 22px; }
.globo.mal { background: var(--mal); color: #fff; }
.atajos { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.atajos input { flex: 1 1 150px; width: auto; min-width: 0; min-height: 36px; }
select:disabled { background: #f3f1eb; color: var(--suave); }
.modal .cab h3 { margin: 0; }

/* Estructura del guion: fichas en fila que se agregan, repiten, quitan y reordenan (Alba, 17/11/2026, #9023) */
.fichas, .estr-fila { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ficha { display: inline-flex; align-items: center; gap: .15rem; min-height: 34px; padding: .15rem .6rem; border-radius: 9px; background: var(--info-f); border: 1px solid #c8d8ec; color: var(--tinta); font-size: .86rem; font-weight: 500; max-width: 100%; }
.ficha small { color: var(--tinta-2); font-weight: 600; margin-right: .3rem; white-space: nowrap; }
.ficha.b-full_candidato { background: #e6eef8; border-color: #c8d8ec; } .ficha.b-apoyo { background: #eceae4; border-color: #d9d5ca; }
.ficha.b-full_comunidad { background: var(--ok-f); border-color: #bfe0cd; } .ficha.b-texto { background: #f3effb; border-color: #d9cdf2; }
.ficha.b-entrevista { background: #e3f1f3; border-color: #bcdde1; } .ficha.b-dato { background: var(--alerta-f); border-color: #f0d79c; } .ficha.b-cierre { background: #fde9df; border-color: #f1c9b5; }
.estr { border: 1px solid #cfcabd; border-radius: 10px; background: #fff; padding: .6rem .7rem; }
.estr-fila { min-height: 44px; padding-bottom: .5rem; }
.estr-fila .ficha { padding: .15rem .2rem .15rem .55rem; cursor: grab; touch-action: manipulation; }
.estr-fila .ficha b { font-weight: 500; margin-right: .2rem; overflow-wrap: anywhere; }
.estr-fila .ficha.arrastra { opacity: .4; } .estr-fila .ficha.sobre { outline: 2px dashed var(--acento-2); outline-offset: 1px; }
.ficha button { width: 30px; height: 30px; flex: none; border: 0; border-radius: 7px; background: rgba(255,255,255,.7); color: var(--tinta); cursor: pointer; font-size: .8rem; line-height: 1; padding: 0; }
.ficha button:hover:not(:disabled) { background: #fff; box-shadow: 0 0 0 1px var(--tinta-2); }
.ficha button:disabled { opacity: .3; cursor: default; }
.ficha button.x { font-size: 1.15rem; color: var(--mal); }
/* Con ratón las fichas se arrastran: las flechas van delgadas para que quepan más fichas por fila; en pantallas táctiles son botones de 34 px */
@media (hover: hover) and (pointer: fine) { .estr-fila .ficha { padding-left: .25rem; font-size: .82rem; } .estr-fila .ficha button { width: 18px; height: 28px; background: transparent; font-size: .62rem; } .estr-fila .ficha button.x { width: 22px; font-size: 1.05rem; } }
.estr-paleta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; border-top: 1px dashed var(--linea); padding-top: .55rem; }
.estr-paleta > small { flex-basis: 100%; }
.estr-pie { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: space-between; align-items: center; margin-top: .45rem; }

/* Cartelera: gestión (Alba, 17/11/2026, #9024) */
.cart-previa { width: 100%; max-width: 560px; aspect-ratio: 16 / 9; border-radius: 10px; }
.cart-avance { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cart-avance .barra { flex: 1 1 200px; }
.cart-avance small { flex: 1 1 100%; order: 3; overflow-wrap: anywhere; }
input[type=file] { width: 100%; padding: .45rem; border: 1px dashed #cfcabd; border-radius: 10px; background: #fff; }
.cart-item { display: grid; grid-template-columns: 44px 128px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid #efece5; }
.cart-item:last-child { border-bottom: 0; }
.cart-item.vencido, .cart-item.pausado { background: #faf9f6; }
.cart-item.vencido .cart-mini, .cart-item.pausado .cart-mini { opacity: .55; }
.cart-orden { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.cart-orden b { font-family: 'Fraunces', serif; font-size: 1.1rem; color: var(--tinta); }
.cart-orden .btn { min-height: 30px; width: 40px; padding: 0; }
.cart-mini { width: 128px; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: #9fb3c9; font-size: .72rem; }
.cart-mini img, .cart-mini video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.cart-datos { min-width: 0; }
.cart-datos b { display: block; overflow-wrap: anywhere; }
.cart-datos small { display: block; }
.cart-estado { margin-top: .25rem; display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.cart-acc { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }

/* Mapa de barrios (mosaico) y árbol */
.comuna { margin-bottom: 1rem; }
.mosaico { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.mosaico .celda { border-radius: 10px; padding: .55rem .6rem; background: #eef2f7; border: 1px solid #dde5ee; min-height: 70px; cursor: pointer; text-align: left; }
.mosaico .celda b { display: block; font-size: .82rem; font-weight: 600; line-height: 1.2; }
.mosaico .celda span { font-family: 'Fraunces', serif; font-size: 1.35rem; }
.mosaico .celda small { display: block; font-size: .7rem; color: inherit; opacity: .85; }
.arbol, .arbol ul { list-style: none; margin: 0; padding-left: 1.1rem; }
.arbol { padding-left: 0; }
.arbol ul { border-left: 2px solid var(--linea); margin-left: .5rem; }
.arbol li { padding: .25rem 0; }
.arbol summary { cursor: pointer; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendario .d { background: #fff; border: 1px solid var(--linea); border-radius: 8px; min-height: 84px; padding: .3rem; font-size: .74rem; overflow: hidden; }
.calendario .d.hoy { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }
.calendario .d.fuera { opacity: .45; }
.calendario .d b { display: block; color: var(--suave); font-weight: 600; }
.calendario .d button { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; background: var(--info-f); padding: 1px 4px; margin-top: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.calendario .sem { font-size: .7rem; text-transform: uppercase; color: var(--suave); text-align: center; font-weight: 600; }
pre.texto { white-space: pre-wrap; font: inherit; margin: 0; background: #faf9f6; border: 1px solid var(--linea); border-radius: 10px; padding: .8rem; }
.foto-e14 { max-width: 100%; border-radius: 10px; border: 1px solid var(--linea); }
.casillas { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: .45rem .7rem; align-items: center; }
.casillas input { text-align: right; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.casillas .sep { grid-column: 1 / -1; border-top: 1px dashed var(--linea); }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lado { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s; z-index: 40; }
  .app.menu .lado { transform: none; box-shadow: 0 0 0 100vw rgba(15,28,45,.5); }
  .barra-movil { display: flex; align-items: center; gap: .7rem; position: sticky; top: 0; z-index: 30; background: var(--tinta); color: #fff; padding: .55rem .9rem; }
  .barra-movil button { background: none; border: 0; color: #fff; padding: .3rem; cursor: pointer; display: flex; }
  .barra-movil button svg { width: 26px; height: 26px; }
  .barra-movil .marca { color: #fff; font-size: 1.25rem; }
  .principal { padding: 1rem .9rem 5rem; }
  .rejilla { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  .calendario .d { min-height: 60px; }
  .ocultar-movil { display: none; }
  .velo { padding: .6rem; }
  .modal { max-height: calc(100dvh - 1.2rem); }
  .modal header, .modal .cuerpo, .modal footer { padding-left: .9rem; padding-right: .9rem; }
  .modal footer .btn { flex: 1 1 auto; }
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dd { margin-bottom: .45rem; }
  .casillas-usr { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 40px 96px minmax(0, 1fr); gap: .6rem; padding: .6rem; }
  .cart-mini { width: 96px; }
  .cart-acc { grid-column: 1 / -1; justify-content: flex-start; }
  .cart-acc .btn { flex: 1 1 auto; min-height: 38px; }
  .estr-fila .ficha button, .estr-fila .ficha button.x { width: 34px; height: 34px; background: rgba(255,255,255,.7); font-size: .8rem; }
  .estr-fila .ficha button.x { font-size: 1.15rem; }
}
@media print { .lado, .barra-movil, .acc, #toasts { display: none !important; } .app { display: block; } }
