/* ════════════════════════════════════════════════════════ */
/*                            APP                           */
/* ════════════════════════════════════════════════════════ */

#app{display:none;width:100%;height:100vh}
#app.show{display:flex!important}

.sb{
  width:var(--sidebar);
  min-width:var(--sidebar);
  background:var(--bg2);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  height:100vh;}

.sb-brand{
  padding:16px 14px 12px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:10px;}

.sb-ic{
  width:32px;height:32px;
  background:var(--acc);
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  box-shadow:var(--shadow-sm);}

.sb-nm{
  font-size:12.5px;
  font-weight:700}

.sb-sub{font-size:10px;
  color:var(--text2)}

.sb-nav{flex:1;
  padding:10px 8px;
  overflow-y:auto;}

.ni{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  color:var(--text2);
  font-size:12px;
  margin-bottom:2px;
  user-select:none;
  transition:all var(--tr-slow);}

.ni:hover{
  background:var(--bg3);
  color:var(--text);
  transform:translateX(2px);}

.ni.on{
  background:var(--acc);
  color:#fff;
  font-weight:600;
  box-shadow:0 6px 18px rgba(232,96,44,.22);}

.ni svg{
  width:14px;
  height:14px;
  flex-shrink:0;}

.ni-ai{
  background:linear-gradient(135deg,rgba(139,92,246,.2),rgba(232,96,44,.2));
  border:1px solid rgba(139,92,246,.3);
  color:var(--purple);}

.ni-ai.on,
.ni-ai:hover{
  background:linear-gradient(135deg,#8b5cf6,var(--acc));
  color:#fff;}

.sep{
  height:1px;
  background:var(--border);
  margin:10px 2px;}

.sb-foot{
  padding:10px 12px;
  border-top:1px solid var(--border);}

.sb-user{
  display:flex;
  align-items:center;
  gap:9px;
  padding:6px 4px 8px;
  cursor:pointer;
  border-radius:8px;
  position:relative;
  transition:all var(--tr);}

.sb-user:hover{
  background:var(--bg3);
  transform:translateY(-1px);}

.uav{
  width:28px;height:28px;
  background:var(--acc);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:800;
  color:#fff;
  position:relative;
  flex-shrink:0;}

.uav-status{
  position:absolute;
  right:-1px;
  bottom:0;
  width:9px;
  height:9px;
  border-radius:50%;
  border:2px solid var(--bg2);}

.un{font-size:12px;font-weight:600}
.ur{font-size:10px;color:var(--text3)}

.logout{
  width:100%;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:7px;
  padding:7px;
  font-size:11.5px;
  color:var(--text2);
  margin-top:6px;
  transition:all var(--tr);}

.logout:hover{
  background:var(--bg4);
  color:var(--text);}


/* ════════════════════════════════════════════════════════ */
/*                         TOPBAR                           */
/* ════════════════════════════════════════════════════════ */
.main{flex:1;display:flex;flex-direction:column;height:100vh;overflow:hidden;min-width:0}
.topbar{height:50px;padding:0 22px;background:var(--bg2);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.tb-l{font-size:14px;font-weight:700}
.tb-r{display:flex;align-items:center;gap:8px}

.date-chip,.weather-chip{
  padding:4px 10px;border-radius:20px;font-size:11px;
  background:var(--bg3);display:inline-flex;align-items:center}

.date-chip{color:var(--text2)}
.weather-chip{color:var(--text);border:1px solid var(--border);gap:5px}

.tbtn{
  padding:5px 11px;border-radius:7px;
  background:var(--bg3);border:1px solid var(--border);
  color:var(--text2);font-size:11.5px;
  transition:.15s}
.tbtn:hover{background:var(--bg4);color:var(--text)}

.content{flex:1;overflow-y:auto;padding:22px}
.page{display:none}
.page.active{display:block}
.page.active .fade-in{animation:fadeUp .3s ease both}

.ph{
  display:flex;align-items:flex-start;
  justify-content:space-between;
  margin-bottom:20px}
.ph-title{font-size:22px;font-weight:800;letter-spacing:-.3px}
.ph-sub{margin-top:3px;font-size:12px;color:var(--text2)}


/* ════════════════════════════════════════════════════════ */
/*                        RESPONSIVE                        */
/* ════════════════════════════════════════════════════════ */

@media(max-width:1050px){

  .metrics,
  .cats-g,
  .cg,
  .mkt-g,
  .tpl-g,
  .dev-grid,
  .team-grid{grid-template-columns:1fr 1fr}
  .grid2,
  .bal-charts{grid-template-columns:1fr}
  .pjud,
  .ai-fields,
  .intake-cols{grid-template-columns:1fr 1fr}}

@media(max-width:760px){
  :root{--sidebar:66px}
  .sb-brand>div:not(.sb-ic),
  .ni span,
  .sb-user>div:not(.uav),
  .logout,
  .date-chip{display:none}
  .content{padding:14px}
  .metrics,
  .cats-g,
  .cg,
  .mkt-g,
  .tpl-g,
  .ai-fields,
  .marco-g,
  .fr,
  .ingreso-cols,
  .room-grid,
  .team-grid{grid-template-columns:1fr}}