/* TallerStatus — Panel del administrador (dueño de la plataforma). Paleta navy · blanco · verde. */
:root {
  --navy-950: #0B1220; --navy-900: #111B2E; --navy-800: #1B2A41;
  --green-600: #159A67; --green-700: #118456; --green-100: #E8F6EF;
  --canvas: #F4F7FA; --white: #FFFFFF; --ink: #172235; --muted: #68758A; --border: #E3E9F0;
  --amber-600: #B96A08; --amber-100: #FFF4D9; --red-600: #C43D4B; --red-100: #FCEBED;
  --blue-600: #3269C8; --blue-100: #EAF1FF;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sombra: 0 2px 10px rgb(15 30 50 / 4%); --sombra-pop: 0 12px 32px rgb(11 18 32 / 22%);
  --lateral: 15.5rem;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button, input, select { min-height: 2.5rem; }
:focus-visible { outline: 3px solid #55B5ED; outline-offset: 2px; }
svg.ic { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.oculto { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ENTRADA ---------- */
#login { min-height: 100dvh; display: grid; background: radial-gradient(ellipse at 15% 0%, #17406A 0%, transparent 55%), radial-gradient(ellipse at 100% 100%, #0F4D3A 0%, transparent 50%), var(--navy-950); }
.login-marca { color: #fff; padding: calc(2rem + env(safe-area-inset-top)) 1.5rem 1.5rem; text-align: center; display: grid; justify-items: center; gap: .8rem; }
.login-marca svg.marca { width: 4.6rem; height: 4.6rem; }
.login-marca h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: .01em; line-height: 1.1; }
.login-marca h1 b { color: #3FD28A; }
.login-marca .rol { color: #9FB3C6; font-size: .8rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
.login-marca p.lema { color: #B9C9D8; max-width: 22rem; }
.login-marca .puntos { display: none; }
.login-caja { padding: 0 1.2rem 2rem; display: grid; align-content: start; }
.login-card { background: var(--white); border-radius: 1.25rem; box-shadow: var(--sombra-pop); padding: 1.8rem 1.5rem; max-width: 26rem; width: 100%; margin: 0 auto; }
.login-card h2 { font-size: 1.35rem; font-weight: 800; }
.login-card .s { color: var(--muted); margin: .2rem 0 1.2rem; }
label { display: block; font-size: .8rem; font-weight: 700; margin: .9rem 0 .3rem; }
input, select { width: 100%; padding: .55rem .8rem; border: 1.5px solid var(--border); border-radius: .5rem; background: var(--white); color: var(--ink); font: inherit; }
input:focus, select:focus { border-color: var(--blue-600); outline: none; box-shadow: 0 0 0 3px rgb(85 181 237 / 30%); }
.pass { position: relative; }
.pass input { padding-right: 3rem; }
.pass button { position: absolute; right: .2rem; top: 0; width: 2.5rem; height: 100%; display: grid; place-items: center; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .5rem 1rem; border-radius: .5rem; background: var(--white); border: 1px solid var(--border); font-weight: 650; color: var(--ink); }
.btn:hover { background: var(--canvas); }
.btn.pri { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn.pri:hover { background: var(--green-700); }
.btn.ancho { width: 100%; margin-top: 1.1rem; min-height: 2.8rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
@media (min-width: 900px) {
  #login { grid-template-columns: 1.1fr minmax(24rem, 30rem); align-items: center; padding: 0 5vw; gap: 4vw; }
  .login-marca { text-align: left; justify-items: start; padding: 0; }
  .login-marca svg.marca { width: 5.6rem; height: 5.6rem; }
  .login-marca h1 { font-size: 2.6rem; }
  .login-marca .puntos { display: grid; gap: .9rem; margin-top: 1.4rem; list-style: none; }
  .login-marca .puntos li { display: flex; gap: .7rem; align-items: center; color: #E6EEF5; font-weight: 600; font-size: 1rem; }
  .login-marca .puntos svg.ic { color: #3FD28A; }
  .login-caja { padding: 2rem 0; }
}

/* ---------- ESTRUCTURA ---------- */
#panel { min-height: 100dvh; }
#lateral { position: fixed; inset: 0 auto 0 0; width: var(--lateral); background: var(--navy-950); color: #fff; padding: 1.25rem .75rem 1rem; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; }
body.menu-abierto #lateral { transform: none; }
#velo { display: none; position: fixed; inset: 0; background: rgb(11 18 32 / 55%); z-index: 35; }
body.menu-abierto #velo { display: block; }
.marca-lat { display: flex; align-items: center; gap: .7rem; padding: 0 .6rem 1.3rem; }
.marca-lat svg.marca { width: 2.6rem; height: 2.6rem; flex: none; }
.marca-lat b { display: block; font-size: 1.1rem; font-weight: 800; line-height: 1.1; }
.marca-lat b span { color: #3FD28A; }
.marca-lat small { color: #8FA0B6; font-size: .65rem; letter-spacing: .14em; font-weight: 700; }
.nav-grupo { font-size: .65rem; font-weight: 750; letter-spacing: .14em; color: #718096; padding: .8rem .8rem .4rem; text-transform: uppercase; }
#lateral nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.nav-item { position: relative; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: 0 .8rem; border-radius: .6rem; color: #B4C0D1; font-weight: 600; text-align: left; }
.nav-item:hover { background: var(--navy-900); color: #fff; }
.nav-item.on { background: var(--navy-900); color: #fff; }
.nav-item.on::before { content: ''; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 3px; border-radius: 2px; background: #21B77E; }
.nav-item.on svg.ic { color: #3FD28A; }
.nav-item .cuenta { margin-left: auto; min-width: 1.5rem; height: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--green-600); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.nav-item .cuenta.amb { background: var(--amber-600); }
.perfil-lat { margin-top: .8rem; padding: .8rem .6rem 0; border-top: 1px solid #26364D; display: flex; align-items: center; gap: .7rem; }
.perfil-lat .av { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #203752; display: grid; place-items: center; font-weight: 800; font-size: .75rem; flex: none; }
.perfil-lat .q { flex: 1; min-width: 0; line-height: 1.25; }
.perfil-lat .q b { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perfil-lat .q small { color: #8FA0B6; font-size: .68rem; }
.perfil-lat button { width: 2.3rem; height: 2.3rem; min-height: 0; display: grid; place-items: center; border-radius: .5rem; color: #B4C0D1; }
.perfil-lat button:hover { background: var(--navy-900); color: #fff; }
#principal { min-width: 0; }
.barra-sup { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .7rem; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; background: var(--navy-950); color: #fff; }
.barra-sup .menu { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: .6rem; }
.barra-sup .tit { flex: 1; font-weight: 800; font-size: 1.05rem; }
.barra-sup .campana { position: relative; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: .6rem; }
.barra-sup .campana i { position: absolute; top: .3rem; right: .25rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem; border-radius: 999px; background: var(--amber-600); color: #fff; font: 800 .65rem/1.1rem var(--font); text-align: center; font-style: normal; }
.contenido { padding: 1rem; max-width: 92rem; margin: 0 auto; }
.cab-pag { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.cab-pag h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.cab-pag p { color: var(--muted); margin-top: .15rem; }
.acciones { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sup-desk { display: none; }
@media (min-width: 1024px) {
  #lateral { transform: none; }
  #principal { margin-left: var(--lateral); }
  .barra-sup { display: none; }
  .contenido { padding: 1.8rem 2rem 3rem; }
  .cab-pag h2 { font-size: 1.75rem; }
  .sup-desk { display: flex; }
}

/* ---------- TARJETAS Y KPI ---------- */
.card { background: var(--white); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--sombra); padding: 1.1rem; margin-bottom: 1rem; min-width: 0; }
.card h3 { font-size: 1rem; font-weight: 700; }
.card .sub { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.card-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: var(--white); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--sombra); padding: 1rem 1.1rem; display: grid; gap: .25rem; min-width: 0; text-align: left; }
.kpi .et { font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi .det { font-size: .75rem; color: var(--muted); }
.kpi .val.ok { color: var(--green-700); }
.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; }
.mini .m { background: var(--canvas); border: 1px solid transparent; border-radius: .6rem; padding: .7rem .8rem; text-align: left; min-height: 0; }
.mini .m b { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.mini .m small { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
button.m:hover { border-color: var(--green-600); }
.mini .m.ok b { color: var(--green-700); } .mini .m.mal b { color: var(--red-600); } .mini .m.alerta b { color: var(--amber-600); }
.dos { display: grid; gap: 1rem; }
@media (min-width: 1024px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
  .kpi .val { font-size: 1.85rem; }
  .dos { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .dos.igual { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dos > .card { margin: 0; }
}

/* ---------- ESTADOS (chips) ---------- */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.chip.activa, .chip.aprobado, .chip.pagado { background: var(--green-100); color: #11784E; }
.chip.prueba, .chip.pendiente { background: var(--amber-100); color: #9A5A05; }
.chip.vencida, .chip.rechazado { background: var(--red-100); color: #B53543; }
.chip.info { background: var(--blue-100); color: #285AB0; }
.chip.vence { background: var(--blue-100); color: #285AB0; margin-left: .35rem; }
.chip::before { content: ''; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }

/* ---------- FILTROS ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; align-items: center; }
.filtros input[type=search] { flex: 2 1 14rem; width: auto; }
.filtros select { flex: 1 1 9rem; width: auto; }
.pestanas { display: flex; gap: .3rem; background: var(--canvas); border-radius: .6rem; padding: .25rem; margin-bottom: .9rem; overflow-x: auto; }
.pestanas button { flex: 1 0 auto; padding: .4rem .9rem; border-radius: .45rem; font-weight: 650; color: var(--muted); white-space: nowrap; min-height: 2.4rem; }
.pestanas button.on { background: var(--white); color: var(--green-700); box-shadow: var(--sombra); }
.pestanas button b { margin-left: .3rem; font-size: .72rem; background: var(--border); border-radius: 999px; padding: .05rem .45rem; color: var(--ink); }
.ayuda { color: var(--muted); font-size: .78rem; margin-top: .5rem; }

/* ---------- TABLAS (en celular se vuelven tarjetas) ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
td { padding: .7rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.clic { cursor: pointer; }
tbody tr.clic:hover { background: var(--canvas); }
td b { font-weight: 700; }
.ver { padding: 0 .5rem; min-height: 1.6rem; font-size: .72rem; border-radius: .4rem; margin-left: .4rem; color: var(--muted); border: 1px solid var(--border); }
@media (max-width: 767px) {
  table, thead, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { border: 1px solid var(--border); border-radius: .7rem; padding: .35rem .8rem; margin-bottom: .7rem; background: var(--white); }
  td { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border: 0; text-align: right; }
  td::before { content: attr(data-l); color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; flex: none; padding-top: .15rem; }
  td.num { text-align: right; }
  td[data-l=""]::before { content: none; }
}

/* ---------- GRÁFICOS ---------- */
.grafico { width: 100%; height: auto; display: block; }
.grafico .eje { stroke: var(--border); }
.grafico .rej { stroke: #EDF1F5; }
.grafico text { font-family: var(--font); font-size: 10px; fill: var(--muted); text-anchor: middle; }
.grafico text.v { fill: var(--ink); font-weight: 700; }
.leyenda { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .75rem; color: var(--muted); }
.leyenda i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05rem; }
details.tabla-alt summary { cursor: pointer; font-size: .78rem; font-weight: 650; color: var(--blue-600); min-height: 2.4rem; display: flex; align-items: center; }
details.tabla-alt table { font-size: .8rem; }

/* ---------- LISTAS ---------- */
.fila-aten { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-top: 1px solid var(--border); width: 100%; text-align: left; min-height: 3.2rem; }
.fila-aten:first-of-type { border-top: 0; }
.fila-aten .ico { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; flex: none; }
.fila-aten .ico.amb { background: var(--amber-100); color: var(--amber-600); } .fila-aten .ico.rojo { background: var(--red-100); color: var(--red-600); } .fila-aten .ico.azul { background: var(--blue-100); color: var(--blue-600); } .fila-aten .ico.verde { background: var(--green-100); color: var(--green-700); }
.fila-aten .tx { flex: 1; min-width: 0; line-height: 1.3; }
.fila-aten .tx b { display: block; font-size: .88rem; }
.fila-aten .tx small { color: var(--muted); font-size: .75rem; }
.fila-aten .ir { color: var(--green-600); font-weight: 700; font-size: .8rem; flex: none; }
.actividad { display: grid; gap: 0; }
.actividad .a { display: flex; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--border); font-size: .85rem; }
.actividad .a:first-child { border-top: 0; }
.actividad .a .pt { width: .55rem; height: .55rem; border-radius: 50%; margin-top: .45rem; flex: none; background: var(--green-600); }
.actividad .a .pt.amb { background: var(--amber-600); } .actividad .a .pt.rojo { background: var(--red-600); } .actividad .a .pt.azul { background: var(--blue-600); }
.actividad .a small { display: block; color: var(--muted); font-size: .72rem; }

/* ---------- ESTADOS DE PANTALLA ---------- */
.esq { border-radius: .75rem; background: linear-gradient(90deg, #EAEFF4 25%, #F6F8FA 50%, #EAEFF4 75%); background-size: 200% 100%; animation: brillo 1.4s linear infinite; height: 6rem; margin-bottom: .8rem; }
@keyframes brillo { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .esq { animation: none; } * { scroll-behavior: auto !important; } }
.vacio { text-align: center; color: var(--muted); padding: 2rem 1rem; display: grid; gap: .4rem; justify-items: center; }
.vacio b { color: var(--ink); font-size: 1rem; }
.error-caja { background: var(--red-100); color: #8F2A36; border-radius: .6rem; padding: .8rem 1rem; display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---------- PANEL LATERAL DE DETALLE Y VENTANA ---------- */
.cajon { position: fixed; inset: 0; z-index: 60; display: none; background: rgb(11 18 32 / 55%); justify-content: flex-end; }
.cajon.on { display: flex; }
.cajon > div { background: var(--white); width: 100%; max-width: 30rem; height: 100%; overflow-y: auto; padding: 1.2rem; box-shadow: var(--sombra-pop); }
.cajon h3 { font-size: 1.15rem; font-weight: 800; }
.cajon .cerrar { float: right; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .5rem; margin: -.4rem -.4rem 0 0; }
.cajon .fila { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--border); font-size: .88rem; }
.cajon .fila span:first-child { color: var(--muted); }
.cajon h4 { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .3rem; }
.modal { position: fixed; inset: 0; z-index: 70; display: none; background: rgb(11 18 32 / 70%); align-items: center; justify-content: center; padding: 1rem; }
.modal.on { display: flex; }
.modal > div { background: var(--white); border-radius: 1rem; padding: 1rem; max-width: 34rem; width: 100%; max-height: 92vh; overflow: auto; }
.modal img { max-width: 100%; max-height: 70vh; display: block; margin: .6rem auto; border-radius: .5rem; }
#msg { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 30rem; margin: 0 auto; padding: .8rem 1rem; border-radius: .6rem; text-align: center; font-weight: 700; z-index: 90; transform: translateY(200%); transition: transform .25s; box-shadow: var(--sombra-pop); }
#msg.ok { background: var(--green-600); color: #fff; transform: none; } #msg.mal { background: var(--red-600); color: #fff; transform: none; }
.instalar { position: fixed; left: .8rem; right: .8rem; bottom: calc(.8rem + env(safe-area-inset-bottom)); z-index: 80; display: none; align-items: center; gap: .6rem; background: var(--white); border: 1px solid var(--green-600); border-radius: .8rem; padding: .7rem .8rem; box-shadow: var(--sombra-pop); max-width: 30rem; margin: 0 auto; }
.instalar b { flex: 1; font-size: .88rem; }
.instalar button { border-radius: .5rem; padding: .5rem .9rem; font-weight: 750; color: #fff; background: var(--green-600); }
.instalar .x { background: none; color: var(--muted); padding: .4rem .5rem; font-size: 1.1rem; }
.cfg-fila { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cfg-fila:first-of-type { border-top: 0; }
.cfg-fila span:first-child { color: var(--muted); }

/* WhatsApp en la lista de talleres */
.wa-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #1FA855; text-decoration: none; flex: none; }
.wa-btn:hover, .wa-btn:focus-visible { background: #178C46; }
.wa-btn svg { width: 1.2rem; height: 1.2rem; }
.btn.wa-grande { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .8rem 0; background: #1FA855; color: #fff; text-decoration: none; }
.btn.wa-grande:hover { background: #178C46; }
.btn.wa-grande svg { width: 1.2rem; height: 1.2rem; }
