/* ==========================================================================
   layout.css · Shell de la aplicación
   Columna 1 navegación · Columna 2 lista de trabajo · Columna 3 detalle
   ========================================================================== */

.app{ display:flex; height:100vh; overflow:hidden; }

/* ==========================================================================
   COLUMNA 1 · NAVEGACIÓN
   ========================================================================== */
.nav{
  width:var(--nav-w); flex:none; background:var(--surface);
  border-right:1px solid var(--bd); display:flex; flex-direction:column; z-index:40;
}

/* --- Marca --------------------------------------------------------------- */
.nav .brand{ padding:16px 18px 13px; border-bottom:1px solid var(--bd2); }
.nav .brand .lg{ display:flex; align-items:center; gap:9px; }
.nav .brand svg.mk{ width:27px; height:27px; flex:none; }
.nav .brand .nm{ font-size:1.42rem; font-weight:600; color:var(--navy); letter-spacing:-.4px; }
.nav .brand .un{
  margin-top:8px; font-size:.75rem; letter-spacing:.11em; color:var(--soft);
  text-transform:uppercase; font-weight:700; display:flex; align-items:center; gap:6px;
}
.nav .brand .un .ver{
  margin-left:auto; background:var(--bd2); color:var(--mut);
  border-radius:99px; padding:1px 7px; letter-spacing:0; font-size:.7rem;
}

/* --- Buscador global ----------------------------------------------------- */
.gsearch{ padding:12px 14px 4px; position:relative; }
.gsearch input{
  width:100%; padding:9px 12px 9px 33px; border:1px solid var(--bd);
  border-radius:var(--r); background:var(--surface-3); font-size:.96rem;
}
.gsearch input:focus{ outline:none; background:var(--surface); border-color:var(--blue); box-shadow:var(--ring); }
.gsearch .si{ position:absolute; left:23px; top:21px; width:15px; height:15px; color:var(--soft); pointer-events:none; }
.gsearch .kb{
  position:absolute; right:23px; top:19px; font-size:.72rem; color:var(--soft);
  background:var(--bd2); border-radius:4px; padding:2px 5px; font-weight:700; pointer-events:none;
}
.gres{
  position:absolute; left:14px; right:14px; top:46px; background:var(--surface);
  border:1px solid var(--bd); border-radius:9px; box-shadow:var(--sh3); z-index:90;
  max-height:330px; overflow-y:auto; display:none;
}
.gres.on{ display:block; }
.gres .gr{ padding:9px 12px; cursor:pointer; border-bottom:1px solid var(--bd2); }
.gres .gr:last-child{ border-bottom:none; }
.gres .gr:hover,.gres .gr.cur{ background:var(--tint2); }
.gres .gt{ font-size:.96rem; font-weight:600; color:var(--navy); }
.gres .gs{ font-size:.82rem; color:var(--mut); margin-top:1px; }
.gres .gh{
  padding:6px 12px; font-size:.72rem; font-weight:700; letter-spacing:.09em;
  text-transform:uppercase; color:var(--soft); background:var(--surface-3);
}

/* --- Resumen del turno --------------------------------------------------- */
.turno{ margin:12px 14px; border:1px solid var(--bd); border-radius:var(--r-md); overflow:hidden; background:var(--surface); }
.turno .th{
  padding:9px 12px; background:linear-gradient(135deg,#F3F9FC,#EAF3F9); border-bottom:1px solid var(--bd2);
  font-size:.72rem; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--mut);
  display:flex; align-items:center; gap:6px;
}
.turno .occ{ padding:11px 12px 9px; }
.turno .occ .v{ font-size:1.55rem; font-weight:600; color:var(--navy); line-height:1; }
.turno .occ .v small{ font-size:.82rem; font-weight:400; color:var(--mut); margin-left:5px; }
.turno .occ .bar{ height:5px; background:#E7EDF2; border-radius:3px; overflow:hidden; margin-top:8px; }
.turno .occ .bar i{ display:block; height:5px; border-radius:3px; transition:width .4s; }
.turno .mini{ display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--bd2); }
.turno .mini div{ padding:8px 12px; cursor:pointer; transition:background var(--t-fast); }
.turno .mini div:nth-child(odd){ border-right:1px solid var(--bd2); }
.turno .mini div:nth-child(-n+2){ border-bottom:1px solid var(--bd2); }
.turno .mini div:hover{ background:var(--tint2); }
.turno .mini .n{ font-size:1.14rem; font-weight:600; color:var(--navy); line-height:1.1; }
.turno .mini .n.al{ color:var(--orange); }
.turno .mini .n.dg{ color:var(--red); }
.turno .mini .l{ font-size:.75rem; color:var(--mut); margin-top:1px; }

/* --- Lista de módulos ---------------------------------------------------- */
.navscroll{ flex:1; overflow-y:auto; padding-bottom:8px; }
.ngrp{ padding:0 10px; }
.ngrp .gl{
  font-size:.72rem; letter-spacing:.11em; color:var(--soft); text-transform:uppercase;
  font-weight:700; padding:14px 10px 6px; display:flex; align-items:center; gap:6px;
  width:100%; background:none; border:none; cursor:pointer; text-align:left;
}
.ngrp .gl:hover{ color:var(--mut); }
.ngrp .gl .cv{ margin-left:auto; transition:transform var(--t-fast); width:13px; height:13px; }
.ngrp.cl .gl .cv{ transform:rotate(-90deg); }
.ngrp.cl .gi{ display:none; }
.ngrp .gl .cnt{
  background:var(--bd2); color:var(--mut); border-radius:99px; padding:0 6px;
  font-size:.68rem; letter-spacing:0; display:none;
}
.ngrp.cl .gl .cnt.on{ display:inline-block; background:#FDEEDC; color:#B65A00; }

.ni{
  display:flex; align-items:center; gap:11px; width:100%; background:none; border:none;
  padding:8px 10px; border-radius:var(--r); cursor:pointer; text-align:left;
  font-size:.985rem; color:#3C4A59; margin-bottom:1px; position:relative;
  transition:background var(--t-fast),color var(--t-fast);
}
.ni:hover{ background:var(--surface-3); }
.ni.on{ background:var(--tint); color:var(--blue-d); font-weight:600; }
.ni.on::before{
  content:''; position:absolute; left:-10px; top:6px; bottom:6px; width:3px;
  border-radius:0 3px 3px 0; background:var(--blue);
}
.ni svg{ width:18px; height:18px; flex:none; color:var(--soft); }
.ni.on svg{ color:var(--blue); }
.ni span{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ni .bg{ font-size:.75rem; font-weight:700; border-radius:9px; padding:1px 7px; background:var(--bd2); color:var(--mut); }
.ni .bg.w{ background:#FDEEDC; color:#B65A00; }
.ni .bg.d{ background:#FBE5E5; color:#A72E2E; }
.ni.hi{ background:var(--tint-green); color:var(--green-d); font-weight:600; }
.ni.hi svg{ color:var(--green); }
.ni.hi.on{ background:#E5F3D9; }
.ni.hi.on::before{ background:var(--green); }

/* --- Accesos rápidos ----------------------------------------------------- */
.qa{ padding:10px 14px; border-top:1px solid var(--bd2); display:grid; gap:6px; }
.qa .qt{
  font-size:.72rem; letter-spacing:.11em; text-transform:uppercase;
  color:var(--soft); font-weight:700; margin-bottom:2px;
}
.qa button{
  display:flex; align-items:center; gap:9px; padding:8px 11px; border:1px solid var(--bd);
  background:var(--surface); border-radius:var(--r); cursor:pointer; font-size:.93rem;
  font-weight:600; color:#3C4A59; text-align:left; transition:all var(--t-fast);
}
.qa button:hover{ border-color:var(--blue); color:var(--blue); background:var(--tint2); }
.qa button svg{ width:16px; height:16px; flex:none; }

/* --- Pie de navegación --------------------------------------------------- */
.navfoot{ padding:10px 14px; border-top:1px solid var(--bd2); display:flex; align-items:center; gap:10px; }
.navfoot .av{
  width:32px; height:32px; flex:none; border-radius:50%; background:var(--navy); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:.89rem; font-weight:700;
}
.navfoot .who{ flex:1; min-width:0; }
.navfoot .who .n{ font-size:.93rem; font-weight:600; color:var(--navy); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.navfoot .who .r{ font-size:.79rem; color:var(--mut); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.navfoot .out{ background:none; border:none; cursor:pointer; color:var(--soft); padding:5px; border-radius:var(--r-sm); }
.navfoot .out:hover{ background:var(--surface-3); color:var(--red); }

/* Controles de tamaño de letra (uso en campo) */
.escala{ display:flex; gap:4px; padding:0 14px 10px; }
.escala button{
  flex:1; border:1px solid var(--bd); background:var(--surface); border-radius:var(--r-sm);
  padding:5px 0; font-size:.79rem; font-weight:700; color:var(--mut); cursor:pointer;
}
.escala button:hover{ border-color:var(--blue-m); color:var(--blue); }
.escala button.on{ background:var(--navy); border-color:var(--navy); color:#fff; }

/* ==========================================================================
   COLUMNA 2 · PANEL DE TRABAJO
   ========================================================================== */
.panel{
  width:var(--panel-w); flex:none; background:var(--surface-2);
  border-right:1px solid var(--bd); display:flex; flex-direction:column; z-index:30;
}
.panel.hide{ display:none; }
.panel .ph{ padding:14px 16px 11px; border-bottom:1px solid var(--bd2); background:var(--surface); }
.panel .ph .t{ font-size:1.03rem; font-weight:700; color:var(--navy); display:flex; align-items:center; gap:8px; }
.panel .ph .t .c{
  margin-left:auto; font-size:.79rem; font-weight:700; color:var(--mut);
  background:var(--bd2); border-radius:9px; padding:1px 8px;
}
.panel .ph .d{ font-size:.82rem; color:var(--mut); margin-top:3px; line-height:1.45; }

.psearch{ padding:10px 14px 6px; }
.psearch input{ width:100%; padding:8px 11px; border:1px solid var(--bd); border-radius:var(--r); font-size:.96rem; background:var(--surface); }
.psearch input:focus{ outline:none; border-color:var(--blue); box-shadow:var(--ring); }

.chips{ display:flex; gap:5px; flex-wrap:wrap; padding:8px 14px 4px; }
.chip{
  border:1px solid var(--bd); background:var(--surface); border-radius:99px; padding:4px 11px;
  font-size:.82rem; font-weight:600; color:var(--mut); cursor:pointer; white-space:nowrap;
  transition:all var(--t-fast);
}
.chip:hover{ border-color:var(--blue-m); color:var(--blue); }
.chip.on{ background:var(--navy); border-color:var(--navy); color:#fff; }

.plist{ flex:1; overflow-y:auto; padding:8px 10px 16px; }
.pi{
  display:block; width:100%; text-align:left; background:var(--surface); border:1px solid var(--bd);
  border-radius:9px; padding:10px 12px; margin-bottom:6px; cursor:pointer; position:relative;
  transition:border-color var(--t-fast),box-shadow var(--t-fast);
}
.pi:hover{ border-color:var(--blue-m); box-shadow:var(--sh1); }
.pi.on{ border-color:var(--blue); background:var(--tint); box-shadow:0 0 0 1px var(--blue) inset; }
.pi .t{ font-size:.96rem; font-weight:600; color:var(--navy); display:flex; align-items:center; gap:7px; }
.pi .t .r{ margin-left:auto; font-size:.79rem; font-weight:600; color:var(--mut); }
.pi .s{ font-size:.82rem; color:var(--mut); margin-top:2px; }
.pi .m{ margin-top:6px; display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
.pi .stripe{ position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; }
.pempty{ padding:34px 18px; text-align:center; color:var(--soft); font-size:.93rem; }
.pempty svg{ width:34px; height:34px; opacity:.4; margin-bottom:9px; }
.pfoot{ padding:10px 14px; border-top:1px solid var(--bd2); background:var(--surface); }

/* ==========================================================================
   COLUMNA 3 · DETALLE
   ========================================================================== */
.work{ flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }

.top{
  background:var(--surface); border-bottom:1px solid var(--bd); padding:0 26px;
  height:var(--top-h); display:flex; align-items:center; gap:14px; flex:none;
}
.top .bc{
  font-size:.82rem; color:var(--soft); font-weight:600; letter-spacing:.03em;
  text-transform:uppercase; background:none; border:none; padding:0; cursor:default;
}
.top h1{ margin:0; font-size:1.36rem; font-weight:600; color:var(--navy); letter-spacing:-.3px; line-height:1.2; }
.top .sp{ flex:1; }
.top .tset{ display:flex; align-items:center; gap:8px; }

.st{ display:flex; align-items:center; gap:7px; font-size:.89rem; color:var(--mut); font-weight:600; }
.st i{ width:8px; height:8px; border-radius:50%; background:var(--green); flex:none; }
.st i.off{ background:var(--orange); }
.st i.pend{ background:var(--yellow); animation:pulse 1.4s infinite; }
@keyframes pulse{ 0%,100%{opacity:1} 50%{opacity:.35} }

.tbtn{
  width:34px; height:34px; border-radius:var(--r); border:1px solid var(--bd); background:var(--surface);
  color:var(--mut); cursor:pointer; display:flex; align-items:center; justify-content:center; flex:none;
  transition:all var(--t-fast);
}
.tbtn:hover{ border-color:var(--blue); color:var(--blue); }
.tbtn.burger{ display:none; }

.scroll{ flex:1; overflow-y:auto; padding:22px 26px calc(60px + var(--bottom-h)); }

/* ==========================================================================
   PANTALLA DE ACCESO (usa las tres columnas, no una tarjeta suelta)
   ========================================================================== */
.gate{ display:grid; grid-template-columns:1.05fr .95fr; gap:26px; align-items:start; max-width:1020px; }
.gate .intro .h{ font-size:1.85rem; font-weight:600; color:var(--navy); letter-spacing:-.6px; line-height:1.2; }
.gate .intro .p{ color:var(--mut); font-size:1rem; line-height:1.65; margin-top:12px; max-width:52ch; }
.gate .fl{ margin-top:20px; display:grid; gap:10px; }
.gate .fl .f{ display:flex; gap:11px; align-items:flex-start; }
.gate .fl .f .ic{
  width:28px; height:28px; flex:none; border-radius:var(--r-sm); background:var(--tint);
  color:var(--blue); display:flex; align-items:center; justify-content:center;
}
.gate .fl .f .ic svg{ width:15px; height:15px; }
.gate .fl .f .tx{ font-size:.93rem; color:#3C4A59; line-height:1.5; }
.gate .fl .f .tx b{ color:var(--navy); }

/* ==========================================================================
   BARRA INFERIOR EN MÓVIL
   ========================================================================== */
.mbar{
  display:none; position:fixed; left:0; right:0; bottom:0; z-index:60;
  background:var(--surface); border-top:1px solid var(--bd);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  grid-auto-flow:column; grid-auto-columns:1fr; box-shadow:0 -4px 16px -10px rgba(16,40,64,.4);
}
.mbar button{
  background:none; border:none; cursor:pointer; padding:5px 2px; display:flex;
  flex-direction:column; align-items:center; gap:3px; color:var(--soft); position:relative;
}
.mbar button svg{ width:20px; height:20px; }
.mbar button span{ font-size:.68rem; font-weight:600; letter-spacing:.01em; }
.mbar button.on{ color:var(--blue); }
.mbar button .dot{
  position:absolute; top:3px; right:calc(50% - 15px); min-width:15px; height:15px; border-radius:9px;
  background:var(--orange); color:#fff; font-size:.62rem; font-weight:700; line-height:15px; padding:0 3px;
}

/* ==========================================================================
   CAPAS FLOTANTES
   ========================================================================== */
.scrim{ display:none; position:fixed; inset:0; background:rgba(11,35,58,.45); z-index:35; }
.scrim.on{ display:block; }

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media(max-width:1240px){ :root{ --panel-w:284px; } }

@media(max-width:1080px){
  .nav{ position:fixed; left:0; top:0; bottom:0; transform:translateX(-100%); transition:transform var(--t); box-shadow:var(--sh3); }
  .nav.open{ transform:none; }
  .tbtn.burger{ display:flex; }
  .panel{ width:272px; }
  .gate{ grid-template-columns:1fr; }
}

@media(max-width:820px){
  :root{ --bottom-h:60px; }
  .panel{
    position:fixed; left:0; top:0; bottom:0; width:min(90vw,300px); transform:translateX(-100%);
    transition:transform var(--t); box-shadow:var(--sh3); z-index:45;
  }
  .panel.open{ transform:none; }
  .top{ padding:0 12px; height:56px; gap:10px; }
  .top h1{ font-size:1.14rem; }
  .top .bc{ display:none; }
  .scroll{ padding:16px 13px calc(46px + var(--bottom-h)); }
  .st span{ display:none; }
  .mbar{ display:grid; }
  .toast{ bottom:calc(16px + var(--bottom-h)); }
}

@media(max-width:520px){
  .top .tset .tbtn.opt{ display:none; }
}
