/* Boot shell — per-panel skeleton mirroring real layout (PC + mobile) */

:root{
  --sk-ease:cubic-bezier(0.23,1,0.32,1);
  --sk-dur:1.15s;
}

#app-boot.app-boot-shell{
  position:fixed;inset:0;z-index:99999;
  display:flex;flex-direction:column;
  background:var(--bg,#111416);
  overflow:hidden;
  transition:opacity 220ms var(--sk-ease);
}
#app-boot.app-boot-shell.app-boot-out{
  opacity:0;pointer-events:none;
}

#app-boot .app-boot-layout{
  flex:1;min-height:0;width:100%;
}

#app-boot .app-boot-main{
  flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;
}

#app-boot .app-boot-body{
  flex:1;min-height:0;overflow:hidden;
  display:flex;flex-direction:column;
}

#app-boot .app-boot-panel{
  flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;
}

/* Shimmer */
#app-boot .sk{
  position:relative;overflow:hidden;
  background:color-mix(in srgb,var(--bg3,#222) 88%,var(--bg2,#181c1f));
  border-radius:8px;
  color:transparent!important;
  border:none!important;
  pointer-events:none;
}
#app-boot .sk::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(
    105deg,
    transparent 0%,
    color-mix(in srgb,var(--bg2,#2a2f33) 55%,transparent) 48%,
    transparent 100%
  );
  transform:translateX(-100%);
  animation:sk-shimmer var(--sk-dur) var(--sk-ease) infinite;
  will-change:transform;
}
#app-boot .sk--pill{border-radius:999px;}
#app-boot .sk--circle{border-radius:50%;}

@keyframes sk-shimmer{
  100%{transform:translateX(100%);}
}

/* Topbar — mirrors production single-row layout */
#app-boot .app-boot-topbar{
  grid-template-rows:auto!important;
  row-gap:0!important;
  min-height:50px;
  padding:6px 12px;
  align-items:center;
}
#app-boot .app-boot-topbar .app-sidebar-toggle{
  pointer-events:none;
  color:var(--tx2);
}
#app-boot .app-boot-kronzen-slot{
  flex-shrink:0;
  display:flex;
  align-items:center;
  line-height:0;
}
#app-boot .app-boot-kronzen-icon{
  width:32px;
  height:32px;
  border-radius:8px;
  object-fit:contain;
  display:none;
}
#app-boot .app-boot-sk-wordmark{
  height:26px;
  width:min(200px,28vw);
  border-radius:6px;
  flex-shrink:0;
  display:none;
}
#app-boot .app-boot-sk-accent{
  width:3px;
  min-height:26px;
  border-radius:99px;
  align-self:stretch;
  flex-shrink:0;
}
#app-boot .app-boot-section-title{
  margin:0;
  font-size:16px;
  font-weight:650;
  color:var(--tx3);
  letter-spacing:-.03em;
  line-height:1.15;
  opacity:.55;
}
#app-boot .app-boot-tbr{
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}
#app-boot .app-boot-sk-user{width:32px;height:32px;border-radius:50%;}
#app-boot .app-boot-sk-notif{width:56px;height:32px;}
#app-boot .app-boot-sk-lang{width:72px;height:32px;display:none;}
#app-boot .app-boot-sk-theme{width:44px;height:26px;border-radius:999px;}
#app-boot .app-boot-sk-logout{width:56px;height:32px;}

@media(min-width:861px){
  #app-boot .app-boot-kronzen-icon{display:none!important;}
  #app-boot .app-boot-sk-wordmark{display:block!important;}
  #app-boot .app-boot-sk-lang{display:block;}
  #app-boot .app-boot-sk-logout{width:64px;}
}

@media(max-width:860px){
  #app-boot .app-boot-topbar{
    grid-template-columns:auto minmax(0,1fr) auto;
    padding:6px 10px;
    min-height:50px;
  }
  #app-boot .app-boot-sk-wordmark{display:none!important;}
  #app-boot .app-boot-kronzen-icon{display:block!important;}
  #app-boot .app-boot-sk-accent{display:none!important;}
  #app-boot .app-boot-sk-user{width:28px;height:28px;}
  #app-boot .app-boot-sk-notif{width:44px;height:32px;}
  #app-boot .app-boot-sk-logout{display:none;}
  #app-boot .app-boot-section-title{font-size:15px;}
}

/* Sidebar — tenant logo placeholder, not Kronzen */
#app-boot .app-boot-sidebar .app-sidebar-brand{padding:12px 8px;}
#app-boot .app-boot-sk-empresa-logo{
  width:28px;height:28px;border-radius:8px;margin:0 auto;
}
#app-boot .app-boot-sk-empresa-name{
  display:none;height:10px;width:80%;margin:8px auto 0;border-radius:5px;
}
#app-boot .app-boot-sidebar-nav .ni{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:8px 4px;border:none;background:transparent;width:100%;
}
#app-boot .app-boot-sk-ni-ico{width:20px;height:20px;border-radius:6px;}
#app-boot .app-boot-sk-ni-txt{display:none;width:24px;height:6px;border-radius:4px;}

/* Bottom nav */
#app-boot .app-boot-nav-bottom{
  display:grid;flex-shrink:0;
  border-top:1px solid var(--bd,#2a2f33);
  background:var(--bg2,#181c1f);
  padding:8px 6px calc(8px + env(safe-area-inset-bottom,0px));
  gap:4px;
}
#app-boot .app-boot-shell--gestor .app-boot-nav-bottom{
  grid-template-columns:repeat(7,minmax(0,1fr));
}
#app-boot .app-boot-shell--planificador .app-boot-nav-bottom{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
#app-boot .app-boot-nav-bottom .ni-b{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:4px 2px;border:none;background:transparent;
}
#app-boot .app-boot-sk-nib-ico{width:22px;height:22px;border-radius:7px;margin:0 auto;}
#app-boot .app-boot-sk-nib-lbl{width:36px;height:7px;border-radius:4px;margin:0 auto;}

/* ── Gestor Registro ── */
#app-boot .app-boot-reg-toolbar{margin-bottom:12px;flex-shrink:0;}
#app-boot .app-boot-month-nav{display:flex;align-items:center;gap:6px;}
#app-boot .app-boot-mnb{width:34px;height:34px;border-radius:8px;flex-shrink:0;}
#app-boot .app-boot-mtitle{width:min(120px,28vw);height:18px;border-radius:6px;}
#app-boot .app-boot-hoy{width:48px;height:30px;border-radius:8px;}
#app-boot .app-boot-vista-seg{display:flex;gap:4px;}
#app-boot .app-boot-vista-btn{width:88px;height:32px;border-radius:8px;}
#app-boot .app-boot-reg-kpis{margin-left:auto;}
#app-boot .app-boot-reg-kpi{min-width:72px;padding:8px 10px;border-radius:var(--radius-md,10px);border:1px solid var(--bd);background:var(--bg2);}
#app-boot .app-boot-kpi-val{display:block;height:18px;width:48px;margin:0 auto 6px;border-radius:5px;}
#app-boot .app-boot-kpi-lbl{display:block;height:8px;width:56px;margin:0 auto;border-radius:4px;}
#app-boot .app-boot-reg-filters{display:flex;flex-wrap:wrap;gap:6px;}
#app-boot .app-boot-reg-filter{width:64px;height:28px;border-radius:999px;}
#app-boot .app-boot-reg-filter:nth-child(2){width:72px;}
#app-boot .app-boot-reg-filter:nth-child(3){width:58px;}
#app-boot .app-boot-reg-filter:nth-child(4){width:66px;}
#app-boot .app-boot-reg-filter:nth-child(5){width:54px;}

#app-boot .app-boot-reg-cal{
  flex:1;min-height:0;overflow:auto;
  display:grid;grid-template-columns:1fr;gap:8px;
  align-content:start;
}
@media(min-width:900px){
  #app-boot .app-boot-reg-cal{grid-template-columns:1fr 1fr;}
}

#app-boot .app-boot-reg-day{
  display:flex;
  gap:12px;
  padding:12px;
  border:1px solid var(--bd);
  border-radius:10px;
  background:var(--bg2);
  min-height:100px;
  box-sizing:border-box;
  pointer-events:none;
}
#app-boot .app-boot-reg-day .reg-day-side{
  width:44px;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
#app-boot .app-boot-reg-day .reg-day-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
#app-boot .app-boot-reg-num{width:28px;height:24px;border-radius:5px;margin:0 auto;}
#app-boot .app-boot-reg-wd{width:22px;height:10px;border-radius:4px;margin:0 auto;}
#app-boot .app-boot-reg-bar{height:4px;border-radius:3px;margin-bottom:0;}
#app-boot .app-boot-reg-entry{height:28px;border-radius:8px;flex-shrink:0;}

@media(max-width:860px){
  #app-boot .app-boot-reg-toolbar .reg-toolbar-row{gap:8px;}
  #app-boot .app-boot-reg-kpis{
    width:100%;margin-left:0!important;
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;
  }
  #app-boot .app-boot-reg-kpi{min-width:0;padding:6px 4px;}
  #app-boot .app-boot-kpi-val{height:15px;width:40px;}
  #app-boot .app-boot-kpi-lbl{width:48px;}
}

@media(max-width:480px){
  #app-boot .app-boot-reg-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* ── Gestor Balance / generic ── */
#app-boot .app-boot-hrow{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px;flex-shrink:0;
}
#app-boot .app-boot-hrow-spacer{flex:1;min-width:12px;}
#app-boot .app-boot-fsel{width:140px;height:36px;border-radius:8px;}
#app-boot .app-boot-fsel--sm{width:110px;height:34px;}
#app-boot .app-boot-fsel--wide{flex:1;min-width:120px;height:36px;}
#app-boot .app-boot-btn{width:120px;height:36px;}
#app-boot .app-boot-btn-primary{width:min(160px,42vw);}
#app-boot .app-boot-herr-title{width:120px;height:18px;border-radius:6px;}

#app-boot .app-boot-table-wrap{
  flex:1;min-height:0;overflow:hidden;
  border:1px solid var(--bd);border-radius:12px;background:var(--bg2);padding:10px;
  display:flex;flex-direction:column;gap:6px;
}
#app-boot .app-boot-table-head{display:flex;gap:6px;}
#app-boot .app-boot-th{flex:1;height:28px;border-radius:6px;}
#app-boot .app-boot-table-row{display:flex;gap:6px;}
#app-boot .app-boot-td{flex:1;height:40px;border-radius:8px;}

#app-boot .app-boot-card-list{
  flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:10px;
}
#app-boot .app-boot-card{
  padding:14px;border:1px solid var(--bd);border-radius:var(--radius-md,10px);background:var(--bg2);
  display:flex;flex-direction:column;gap:8px;
}
#app-boot .app-boot-card-title{height:14px;width:45%;border-radius:5px;}
#app-boot .app-boot-card-line{height:10px;width:90%;border-radius:5px;}
#app-boot .app-boot-card-line--short{width:55%;}

/* ── Herramientas (compact mobile) ── */
#app-boot .app-boot-herr-intro{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;flex-shrink:0;}
#app-boot .app-boot-herr-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
#app-boot .app-boot-herr-lbl{width:88px;height:14px;flex-shrink:0;border-radius:5px;}
#app-boot .app-boot-herr-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
#app-boot .app-boot-herr-kpi{height:52px;border-radius:10px;}
#app-boot .app-boot-herr-steps{display:flex;flex-wrap:wrap;gap:6px;}
#app-boot .app-boot-herr-step{height:28px;width:min(140px,44vw);border-radius:999px;}
#app-boot .app-boot-herr-list{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px;}
#app-boot .app-boot-herr-row{
  display:flex;align-items:center;gap:10px;padding:10px 12px;
  border:1px solid var(--bd);border-radius:10px;background:var(--bg2);
}
#app-boot .app-boot-herr-check{width:20px;height:20px;border-radius:6px;flex-shrink:0;}
#app-boot .app-boot-herr-name{width:120px;height:14px;flex-shrink:0;border-radius:5px;}
#app-boot .app-boot-herr-meta{flex:1;height:12px;border-radius:5px;}

@media(max-width:860px){
  #app-boot .app-boot-herr-steps{display:none;}
  #app-boot .app-boot-herr-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
  #app-boot .app-boot-herr-obra .app-boot-herr-lbl{width:72px;}
  #app-boot .app-boot-btn-primary{width:44px;height:36px;border-radius:8px;}
}

/* ── Planificador Gantt / Calendario ── */
#app-boot .app-boot-gantt-toolbar{
  display:flex;flex-direction:column;gap:10px;margin-bottom:12px;flex-shrink:0;
}
#app-boot .app-boot-gantt-period{display:flex;align-items:center;gap:6px;}
#app-boot .app-boot-period-title{width:min(160px,36vw);height:18px;}
#app-boot .app-boot-gantt-controls{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
}
#app-boot .app-boot-zoom-btns,#app-boot .app-boot-vista-btns{display:flex;gap:4px;}
#app-boot .app-boot-zb{width:52px;height:30px;border-radius:8px;}
#app-boot .app-boot-zb--wide{width:min(108px,30vw);}
#app-boot .app-boot-gantt-new{width:min(150px,40vw);}
#app-boot .app-boot-gantt-legend{display:flex;flex-wrap:wrap;gap:6px;}
#app-boot .app-boot-leg{height:24px;width:72px;}
#app-boot .app-boot-leg:nth-child(2){width:58px;}
#app-boot .app-boot-leg:nth-child(3){width:64px;}

#app-boot .app-boot-gantt-wrap{
  flex:1;min-height:0;overflow:hidden;
  border:1px solid var(--bd);border-radius:var(--radius-md,10px);background:var(--bg2);
  padding:10px;display:flex;flex-direction:column;gap:6px;
}
#app-boot .app-boot-gantt-head{display:flex;gap:4px;margin-bottom:2px;}
#app-boot .app-boot-gantt-head-cell{flex:1;height:24px;border-radius:5px;min-width:28px;}
#app-boot .app-boot-gantt-head-cell:first-child{flex:0 0 88px;max-width:88px;}
#app-boot .app-boot-gantt-row{display:flex;gap:4px;align-items:stretch;}
#app-boot .app-boot-gantt-row-label{flex:0 0 88px;max-width:88px;height:44px;border-radius:8px;}
#app-boot .app-boot-gantt-cells{flex:1;display:flex;gap:4px;min-width:0;}
#app-boot .app-boot-gantt-cell{flex:1;min-width:24px;height:44px;border-radius:8px;}

#app-boot .app-boot-mobile-list{
  flex:1;min-height:0;overflow:auto;display:none;
}
#app-boot .app-boot-mobile-day{margin-bottom:10px;pointer-events:none;}
#app-boot .app-boot-mobile-day-name{width:120px;height:14px;border-radius:5px;}
#app-boot .app-boot-mobile-day-tag{width:48px;height:18px;}
#app-boot .app-boot-mobile-obra{
  display:flex;flex-direction:column;gap:4px;margin-top:8px;
}
#app-boot .app-boot-mobile-obra-line{height:10px;width:100%;border-radius:5px;}
#app-boot .app-boot-mobile-obra-line--short{width:65%;}

#app-boot .app-boot-worker-rail{display:none;}

.modo-pc #app-boot .app-boot-gantt-wrap{display:flex;}
.modo-pc #app-boot .app-boot-mobile-list{display:none!important;}
.modo-pc #app-boot .app-boot-gantt-new{display:block;}
.modo-movil #app-boot .app-boot-gantt-wrap{display:none!important;}
.modo-movil #app-boot .app-boot-mobile-list{display:block!important;}
.modo-movil #app-boot .app-boot-gantt-new{display:none;}
.modo-movil #app-boot .app-boot-vista-btns{display:none;}
.modo-movil #app-boot .app-boot-panel--planificar .app-boot-worker-rail{
  display:block;position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:2;
}
.modo-movil #app-boot .app-boot-rail-tab{
  width:36px;height:88px;border-radius:12px 0 0 12px;
}

/* ── Planificador Obras / Equipo ── */
#app-boot .app-boot-obra-grid{
  flex:1;min-height:0;overflow:auto;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;
  align-content:start;
}
#app-boot .app-boot-obra-card{display:flex;flex-direction:column;gap:8px;padding:12px;}
#app-boot .app-boot-obra-cover{height:88px;border-radius:8px;}
#app-boot .app-boot-obra-title{height:14px;width:70%;border-radius:5px;}
#app-boot .app-boot-obra-meta{height:10px;width:50%;border-radius:5px;}

#app-boot .app-boot-equipo-list{
  flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px;
}
#app-boot .app-boot-equipo-row{
  display:flex;align-items:center;gap:12px;padding:12px;
  border:1px solid var(--bd);border-radius:10px;background:var(--bg2);
}
#app-boot .app-boot-equipo-avatar{width:40px;height:40px;flex-shrink:0;}
#app-boot .app-boot-equipo-name{width:120px;height:14px;flex-shrink:0;border-radius:5px;}
#app-boot .app-boot-equipo-meta{flex:1;height:12px;border-radius:5px;}

#app-boot .app-boot-anot-compose{margin-bottom:12px;flex-shrink:0;padding:14px;}

#app-boot .app-boot-settings{
  flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:12px;
}
#app-boot .app-boot-settings-block{padding:16px;display:flex;flex-direction:column;gap:10px;}

/* Desktop shell visibility */
@media(min-width:861px){
  #app-boot .app-boot-nav-bottom{display:none!important;}
}

@media(max-width:860px){
  #app-boot .app-boot-sidebar{display:none!important;}
  #app-boot .body{padding-bottom:4px;}
}

@media(prefers-reduced-motion:reduce){
  #app-boot .sk::after{animation:none;opacity:.35;}
  #app-boot.app-boot-shell{transition-duration:120ms;}
}
