:root {
  /* Identidad de KGB Telecomunicaciones (igual que kgbtelecomunicaciones.com) */
  --azul: #263688; --azul2: #2C4BB0; --azul-osc: #1B2766; --acento: #00DDF6; --celeste: #2EB6DD; --oscuro: #08121C;
  --fondo: #F3F6FA; --borde: #D9E1EC;
  --texto: #16202C; --gris: #5E6B7B; --ok: #1d8a4e; --mal: #c0392b; --info: #2EB6DD; --fibra: #6c3fb5;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fondo); color: var(--texto); font-size: 15px; }
a { color: var(--azul2); }
h1 { font-family: 'Acme', 'Trebuchet MS', system-ui, sans-serif; font-weight: 400; font-size: 1.6rem; margin: .2rem 0 1rem; color: var(--azul); }
h2 { font-family: 'Acme', 'Trebuchet MS', system-ui, sans-serif; font-weight: 400; font-size: 1.22rem; margin: 1.4rem 0 .6rem; color: var(--azul); }
h3 { font-size: 1rem; }
.top { background: #fff; color: var(--azul); border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--azul), var(--celeste), var(--acento)) 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .6rem 1.2rem; }
.marca { font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: .6rem; }
.logo-img { height: 36px; width: auto; display: block; }
.marca-txt { font-family: 'Acme', 'Trebuchet MS', system-ui, sans-serif; font-weight: 400; font-size: 1.12rem; color: var(--azul); padding-left: .6rem; border-left: 2px solid var(--borde); }
.logo { background: var(--azul); color: #fff; font-weight: 800; padding: .1rem .4rem; border-radius: 4px; margin-right: .3rem; letter-spacing: .5px; }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.top nav a { color: #d6e4f0; text-decoration: none; padding: .35rem .6rem; border-radius: 5px; font-size: .92rem; }
.top nav a:hover, .top nav a.act { background: rgba(255,255,255,.14); color: #fff; }
.yo { font-size: .88rem; white-space: nowrap; }
.yo small { color: var(--gris); }
.yo a { color: var(--azul2); margin-left: .5rem; font-weight: 600; text-decoration: none; }
.yo a:hover { color: var(--celeste); }
.badge { background: var(--acento); color: var(--oscuro); border-radius: 10px; padding: 0 .4rem; font-size: .75rem; font-weight: 700; }
main { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
footer { text-align: center; color: var(--gris); font-size: .8rem; padding: 1.5rem; }
.cab { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.tarjeta h2:first-child, .tarjeta .cab h2 { margin-top: 0; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .dos-col { grid-template-columns: 1fr; } }
label { display: block; margin-bottom: .7rem; font-size: .9rem; color: #3b4754; }
.lbl { display: block; font-size: .9rem; color: #3b4754; margin-bottom: .3rem; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid #c5cfda; border-radius: 6px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8eebf8; border-color: var(--celeste); }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin: 0 .3rem 0 0; }
input.corto { display: inline-block; width: 5.5rem; }
label.chk { display: flex; align-items: flex-start; gap: .3rem; }
small { color: var(--gris); font-size: .8rem; }
.fila { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.campo { flex: 1 1 160px; }
.campo.ancho { flex: 3 1 280px; }
fieldset { border: 1px solid var(--borde); border-radius: 8px; margin: 0 0 1rem; padding: .6rem 1rem; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.btn { display: inline-block; background: var(--azul); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--azul-osc); }
.btn.sec { background: #e4f8fc; color: var(--azul); box-shadow: inset 0 0 0 1px #b6eaf5; }
.btn.sec:hover { background: #ccf3fa; }
.btn.link { background: none; color: var(--gris); }
.btn.peligro { background: #fbe9e7; color: var(--mal); }
.btn.mini { padding: .25rem .55rem; font-size: .8rem; }
.btn-x { border: 0; background: none; color: var(--mal); cursor: pointer; font-size: 1rem; }
form.inline { display: inline; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.alerta { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; }
.alerta ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.alerta.ok { background: #e8f6ee; border-color: var(--ok); }
.alerta.error { background: #fdecea; border-color: var(--mal); }
.alerta.info { background: #eaf2fa; border-color: var(--info); }
.ayuda { color: #4e5b69; font-size: .9rem; background: #fff8e6; border-radius: 8px; padding: .6rem .9rem; }
.ayuda.roles p { margin: .3rem 0; }
.filtros { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: flex-end; }
.filtros label { margin: 0; flex: 1 1 140px; }
.filtros .btn { margin-bottom: 1px; }
.tabla-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--borde); border-radius: 10px; margin-bottom: 1rem; }
.tabla { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
.tabla th { background: #eef2f6; text-align: left; padding: .5rem .55rem; font-weight: 600; color: #34414e; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: .45rem .55rem; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.tabla tr:hover td { background: #fafcfe; }
.tabla.num td, .tabla.num th { text-align: right; }
.tabla .izq, .tabla.num .izq { text-align: left; }
.der { text-align: right; }
.tabla tr.total td { font-weight: 700; background: #f4f7fa; border-top: 2px solid var(--borde); }
.tabla tr.inactivo td { color: #9aa5b1; }
.tabla tr.vigente td { background: #f1faf4; }
.tabla tr.fila-fibra td { background: #f7f3fd; }
.tabla.peq, .peq { font-size: .8rem; }
.nw { white-space: nowrap; }
.gris { color: var(--gris); }
.vacio { text-align: center !important; color: var(--gris); padding: 1.5rem !important; }
.tag { display: inline-block; font-size: .72rem; padding: .05rem .4rem; border-radius: 4px; background: #e9eef3; color: #44515e; font-weight: 600; }
.tag.ok { background: #e1f4e8; color: var(--ok); }
.tag.mal { background: #fbe4e1; color: var(--mal); }
.tag.espera { background: #fff1d6; color: #9a6400; }
.tag.dom { background: #e3eefa; color: var(--info); }
.tag.fest { background: #fde8d7; color: #b4500a; }
.tag.fibra { background: #eee6fa; color: var(--fibra); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--borde); border-top: 3px solid var(--acento); border-radius: 10px; padding: .8rem 1rem; }
.kpi span { display: block; color: var(--gris); font-size: .82rem; }
.kpi b { font-size: 1.35rem; color: var(--azul); }
.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; margin: 0; border: 1px solid #c5cfda; border-radius: 20px; padding: .3rem .7rem; background: #fff; cursor: pointer; }
.chip:has(input:checked) { background: #e3eefa; border-color: var(--azul2); color: var(--azul); font-weight: 600; }
.seg { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg label { margin: 0; border: 1px solid #c5cfda; border-radius: 6px; padding: .45rem .8rem; cursor: pointer; background: #fff; }
.seg label:has(input:checked) { background: #e3eefa; border-color: var(--azul2); font-weight: 600; }
.form-registro .bloque-fibra, .form-registro .nota-fibra { display: none; }
.form-registro.es-fibra .bloque-fibra { display: block; border-color: #cdb8ee; background: #faf7fe; }
.form-registro.es-fibra .nota-fibra { display: block; color: var(--fibra); margin-top: .4rem; }
.pausas { width: 100%; max-width: 520px; border-collapse: collapse; margin-bottom: .5rem; }
.pausas th { text-align: left; font-size: .8rem; color: var(--gris); font-weight: 600; }
.pausas td { padding: .15rem .3rem .15rem 0; }
.pausas input, .pausas select { margin: 0; }
.resumen-vivo { background: #eef5fb; border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; font-size: .9rem; }
.resumen-vivo:empty { display: none; }
#info-dia { display: block; margin-top: .2rem; text-transform: capitalize; }
#info-dia.resalta { color: #b4500a; font-weight: 700; }
.aprobar { display: flex; flex-wrap: wrap; gap: .3rem; }
.aprobar input { width: 160px; margin: 0; padding: .25rem .4rem; font-size: .8rem; }
.barra { height: 5px; background: #eef2f6; border-radius: 3px; margin-top: 3px; }
.barra i { display: block; height: 100%; background: var(--fibra); border-radius: 3px; }
.tarifa-form { margin-top: 1rem; align-items: flex-end; }
.tarifa-form .campo { flex: 1 1 100px; }
.tarifa-form input.corto { width: 100%; }
.comprobante { page-break-inside: avoid; }
.firmas { display: flex; gap: 3rem; margin-top: 2.5rem; }
.firmas div { flex: 1; border-top: 1px solid #555; padding-top: .3rem; font-size: .8rem; color: var(--gris); }
body.login { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 85% 10%, rgba(0,221,246,.35), transparent 45%), linear-gradient(135deg, var(--oscuro), var(--azul) 55%, var(--celeste)); }
.login-logo { text-align: center; margin-bottom: .8rem; }
.logo-login { height: 70px; width: auto; display: inline-block; }
.login-logo .logo { font-size: 1.6rem; }
.login .caja { background: #fff; padding: 2rem; border-radius: 12px; width: min(380px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login h1 { margin-top: 0; text-align: center; }
.login .sub { text-align: center; }
.login .sub { color: var(--gris); margin-top: -.6rem; }
.login .btn { width: 100%; padding: .7rem; }
.solo-print { display: none; }
@media print {
  .top, footer, .no-print, .filtros, .btn { display: none !important; }
  .solo-print { display: block; }
  body { background: #fff; font-size: 11px; }
  main { padding: 0; max-width: none; }
  .tabla-wrap, .tarjeta { border: 0; padding: 0; }
  .tabla { font-size: 10px; }
  .comprobante { border: 1px solid #999 !important; padding: .8rem !important; margin-bottom: 1rem; }
}
details.corregir { margin-bottom: .3rem; }
details.corregir summary { list-style: none; display: inline-block; }
details.corregir summary::-webkit-details-marker { display: none; }
.mini-form { background: #faf7fe; border: 1px solid #cdb8ee; border-radius: 8px; padding: .5rem; margin: .3rem 0; min-width: 220px; }
.mini-form label { margin-bottom: .4rem; font-size: .8rem; }
.mini-form input { padding: .3rem .4rem; }
.mini-form small { display: block; margin-top: .3rem; }
/* Menú agrupado */
.top nav { align-items: center; }
.top .grupo { position: relative; }
.top .grupo > span { display: inline-block; color: #d6e4f0; padding: .35rem .6rem; border-radius: 5px; font-size: .92rem; cursor: pointer; }
.top .grupo.act > span, .top .grupo:hover > span, .top .grupo:focus-within > span { background: rgba(255,255,255,.14); color: #fff; }
.top .grupo .sub { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--borde); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 220px; z-index: 20; padding: .3rem; }
.top .grupo:hover .sub, .top .grupo:focus-within .sub { display: block; }
.top .grupo .sub a { display: block; color: var(--texto); padding: .45rem .7rem; border-radius: 5px; }
.top .grupo .sub a:hover { background: #eef2f6; color: var(--azul); }
.yo a { margin-left: .4rem; }
.semaforo-rojo { color: var(--mal); font-weight: 700; }
.semaforo-amarillo { color: #9a6400; font-weight: 700; }
.semaforo-verde { color: var(--ok); }
.pestanas { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1rem; }
.pestanas a { padding: .4rem .8rem; border-radius: 6px; background: #e6edf4; color: var(--azul); text-decoration: none; font-weight: 600; font-size: .9rem; }
.pestanas a.act { background: var(--azul2); color: #fff; }
.mini-adj input[type=file] { font-size: .72rem; padding: .1rem; margin-top: .2rem; max-width: 170px; }
pre.cmd { background: #0b3a5b; color: #e8f1f8; padding: .7rem 1rem; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: .82rem; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--azul2); }

/* ---------- Menú lateral por áreas ---------- */
body.con-menu .top { position: fixed; top: 0; left: 0; right: 0; height: 55px; z-index: 40; flex-wrap: nowrap; gap: 1rem; padding: 0 1rem; }
.top .marca { color: var(--azul); text-decoration: none; }
.top .yo { margin-left: auto; }
.hamburguesa { display: none; background: none; border: 0; color: var(--azul); font-size: 1.4rem; cursor: pointer; padding: .2rem .4rem; }
.lateral { position: fixed; top: 55px; left: 0; bottom: 0; width: 240px; background: #fff; border-right: 1px solid var(--borde); overflow-y: auto; padding: .7rem .5rem 2rem; z-index: 30; }
.lateral .ico { display: inline-block; width: 1.5rem; text-align: center; }
.lateral a, .lateral summary { display: flex; align-items: center; gap: .2rem; padding: .5rem .6rem; border-radius: 7px; color: var(--texto); text-decoration: none; font-size: .92rem; }
.lateral .item-inicio { font-weight: 600; margin-bottom: .3rem; }
.lateral summary { font-weight: 600; cursor: pointer; list-style: none; color: var(--azul); }
.lateral summary::-webkit-details-marker { display: none; }
.lateral summary::after { content: '▸'; margin-left: auto; color: var(--gris); font-size: .8rem; transition: transform .15s; }
.lateral details[open] > summary::after { transform: rotate(90deg); }
.lateral summary .badge { margin-left: .3rem; }
.lateral details a { padding-left: 2.3rem; font-size: .88rem; }
.lateral a:hover, .lateral summary:hover { background: #eef9fc; }
.lateral a.act { background: #dff8fc; color: var(--azul); font-weight: 600; box-shadow: inset 3px 0 0 var(--acento); }
.lateral .area { margin-bottom: .15rem; }
body.con-menu main { margin-left: 240px; padding-top: calc(55px + 1.2rem); max-width: none; }
body.con-menu main > * { max-width: 1280px; }
body.con-menu footer { margin-left: 240px; }
.velo { display: none; }
@media (max-width: 900px) {
  .hamburguesa { display: block; }
  .top .yo-nombre { display: none; }
  .lateral { transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.15); width: 270px; }
  body.menu-abierto .lateral { transform: none; }
  body.menu-abierto .velo { display: block; position: fixed; inset: 55px 0 0 0; background: rgba(0,0,0,.3); z-index: 25; }
  body.con-menu main, body.con-menu footer { margin-left: 0; }
}
@media print {
  .lateral, .velo, .hamburguesa { display: none !important; }
  body.con-menu main, body.con-menu footer { margin-left: 0; padding-top: 0; }
}
@media (max-width: 520px) {
  .top .marca-txt { display: none; }
  .logo-img { height: 30px; }
  .top .yo { font-size: .82rem; white-space: nowrap; }
  body.con-menu .top { gap: .5rem; padding: 0 .6rem; }
}
.badge.gris-badge { background: #dde3ea; color: #34414e; }
