/* ── EDIT INLINE (maestro) ──────────────────────── */
.ei{display:flex;align-items:center;gap:6px}
.sbtn{
  padding:3px 9px;border:1px solid var(--success);
  background:var(--success-bg);color:var(--success);
  border-radius:5px;cursor:pointer;font-size:11px;font-weight:700;
  transition:all .15s;
}
.sbtn:hover{background:var(--success);color:#fff}
.cbtn{
  padding:3px 9px;border:1px solid var(--border);
  background:var(--surface2);color:var(--text3);
  border-radius:5px;cursor:pointer;font-size:11px;
  transition:all .15s;
}
.cbtn:hover{background:var(--danger-bg);border-color:var(--danger);color:var(--danger)}

/* ── RENDER BARS ────────────────────────────────── */
.vbar-chart{display:flex;align-items:flex-end;gap:4px;height:100px;padding:4px 0}
.vbar-chart-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.vbar-chart-label{font-size:9px;color:var(--text3);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.vbar-chart-val{font-size:9px;font-weight:700;color:var(--text2);text-align:center;font-family:var(--font-mono)}
.vbar-chart-bar{width:100%;border-radius:3px 3px 0 0;min-height:3px;transition:opacity .2s}
.vbar-chart-bar:hover{opacity:.8}

/* ── CHAT IA ────────────────────────────────────── */
.ia-chat-area{
  flex:1;overflow-y:auto;padding:16px;
  display:flex;flex-direction:column;gap:12px;
  min-height:200px;
}
.ia-bubble{
  max-width:80%;padding:12px 16px;border-radius:14px;
  font-size:13px;line-height:1.55;
}
.ia-bubble.ia-user{
  background:linear-gradient(135deg,var(--accent),#0891b2);
  color:#fff;margin-left:auto;border-radius:14px 14px 4px 14px;
}
.ia-bubble.ia-bot{
  background:var(--surface2);color:var(--text);
  border:1px solid var(--border);border-radius:14px 14px 14px 4px;
}
.ia-dot-loader{display:inline-block;width:14px;height:14px;border:2px solid #bfdbfe;border-top-color:#3b93c9;border-radius:50%;animation:ia-spin .7s linear infinite;flex-shrink:0}
@keyframes ia-spin{to{transform:rotate(360deg)}}
.ia-quick-btns{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.ia-quick-btn{
  padding:5px 12px;border:1px solid var(--border);
  border-radius:var(--r-pill);background:var(--surface2);
  color:var(--text2);font-size:11px;font-weight:600;
  cursor:pointer;transition:all .15s;font-family:inherit;
}
.ia-quick-btn:hover{border-color:var(--accent-light);color:var(--accent);background:var(--accent-glow)}

/* ── TABS DE ANÁLISIS ───────────────────────────── */
.seg-bar{height:10px;border-radius:5px;overflow:hidden;display:flex;gap:1px;margin:8px 0}
.seg-bar-item{height:100%;border-radius:3px;transition:.3s}

/* ── ZONA / CECO CARDS ──────────────────────────── */
.ceco-card{
  background:var(--surface2);border:1px solid var(--border);
  border-radius:var(--r-sm);padding:12px 14px;
  cursor:pointer;transition:all .15s;
}
.ceco-card:hover{background:var(--surface);border-color:var(--accent-light);box-shadow:var(--shadow)}

/* ── DASH PILLS (gráficas) ──────────────────────── */
.dash-pill{
  padding:3px 10px;border-radius:var(--r-pill);
  border:1px solid var(--border);background:var(--surface2);
  color:var(--text3);font-size:10.5px;font-weight:600;
  cursor:pointer;transition:all .14s;font-family:inherit;
}
.dash-pill:hover{border-color:var(--accent-light);color:var(--accent)}
.dash-pill.on{
  background:var(--accent);border-color:var(--accent);
  color:#fff;box-shadow:0 2px 6px rgba(26,111,170,.25);
}
.dash-sync-btn{
  padding:5px 12px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface2);color:var(--text2);font-size:11.5px;
  font-weight:600;cursor:pointer;transition:all .15s;font-family:inherit;
}
.dash-sync-btn:hover{background:var(--surface);color:var(--text);box-shadow:var(--shadow-xs)}
.dash-sync-pill{
  display:flex;align-items:center;gap:5px;font-size:11px;
  color:var(--text2);padding:5px 12px;border:1px solid var(--border);
  border-radius:var(--r-pill);background:var(--surface2);
}
.dash-sync-dot{width:7px;height:7px;border-radius:50%;background:var(--success);flex-shrink:0;animation:dot-pulse 2s ease-in-out infinite}
@keyframes dot-pulse{0%,100%{opacity:1}50%{opacity:.4}}

/* ── DASHBOARD EJECUTIVO HEADER ─────────────────── */
.dash-exec-header{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:18px;padding-bottom:14px;
  border-bottom:1px solid var(--border);
}
.dash-exec-title{font-size:22px;font-weight:900;color:var(--text);letter-spacing:-.04em}
.dash-exec-sub{font-size:12px;color:var(--text3);margin-top:3px;font-weight:500}
.dash-exec-actions{display:flex;align-items:center;gap:10px}
#dash-fecha-hoy{color:var(--accent);font-weight:700}

/* ── BARRA DE MANTENIMIENTO ALERTAS ────────────── */
.mnt-row-venc{background:var(--danger-bg) !important}
.mnt-row-prox{background:var(--warning-bg) !important}

/* ── RENDIMIENTO CHIPS ──────────────────────────── */
.rend-chip{
  display:inline-block;padding:2px 8px;border-radius:4px;
  font-size:10px;font-weight:700;font-family:var(--font-mono);
}
.rend-ok  {background:#dcfce7;color:#15803d}
.rend-warn{background:#fef3c7;color:#92400e}
.rend-bad {background:#fee2e2;color:#b91c1c}

/* ── TOPBAR BADGE APK ───────────────────────────── */
#apk-sync-badge,.apk-badge-pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 12px;border-radius:var(--r-pill);
  background:linear-gradient(135deg,var(--success-bg),rgba(8,145,178,.1));
  border:1px solid rgba(21,128,61,.2);
  font-size:11px;font-weight:700;color:var(--success);
  cursor:pointer;
}

/* ── REPORT PREVIEW ─────────────────────────────── */
.report-section{margin-bottom:16px}

/* ── CARD INFO BLUE ─────────────────────────────── */
.card-info{
  background:linear-gradient(135deg,#eff6ff,#e0f2fe);
  border:1px solid rgba(26,111,170,.12);border-radius:var(--r-sm);
  padding:14px 16px;
}

/* ── CONFIRM / SUCCESS STATES ───────────────────── */
.toast-msg{
  position:fixed;bottom:20px;right:20px;z-index:9998;
  padding:12px 20px;border-radius:var(--r-sm);
  font-size:13px;font-weight:600;
  box-shadow:var(--shadow-md);
  animation:toast-in .3s ease;max-width:380px;
}
@keyframes toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.toast-ok  {background:#15803d;color:#fff}
.toast-warn{background:#b45309;color:#fff}
.toast-err {background:#b91c1c;color:#fff}

/* ── TOAST (aviso flotante real, usado por toast() en app.js) — sin esta
   regla el mensaje se genera pero nunca se ve, no tiene ni posición ni capa. ── */
.toast{
  position:fixed;bottom:26px;left:50%;
  transform:translateX(-50%) translateY(16px);
  background:#1e293b;color:#fff;padding:12px 22px;border-radius:var(--r-sm);
  font-size:13px;font-weight:600;box-shadow:var(--shadow-md);
  z-index:999999;opacity:0;pointer-events:none;
  transition:opacity .25s ease,transform .25s ease;
  max-width:90vw;text-align:center;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto}

/* ── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--text3)}

/* ── RESPONSIVE ─────────────────────────────────── */
#main.expanded{margin-left:0}
@media(max-width:720px){
  #tabArea{padding:14px 14px}
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .grid-2,.grid-3{grid-template-columns:1fr}
}


/* ══════════════════════════════════════════════════
   HUB DE OPERACIONES — Concepto 3 Dark Premium
══════════════════════════════════════════════════ */

/* Resetear body para modo hub */
body { background: #08090f; }
#app { display: block !important; height: 100vh; overflow: hidden; }
#sidebar { display: none !important; }
#main {
  width: 100%; height: 100vh;
  display: flex; flex-direction: column;
  background: transparent;
}

/* ── HUB SCREEN ──────────────────────────────────── */
#hub-screen {
  flex: 1; display: flex; flex-direction: column;
  background: #08090f;
  height: 100vh; overflow: hidden;
  position: relative;
}

/* Topbar del hub */
.hub-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; height: 88px; flex-shrink: 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(7,55,99,0.12);
  box-shadow: 0 2px 8px rgba(7,55,99,0.07);
}
.hub-topbar-left { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.hub-logo { display: flex; align-items: center; flex-shrink: 0; }
.hub-logo img { height: 64px; width: auto; display: block; }
.hub-logo-fallback {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, #073763, #0e81c5);
  color: #fff; font-size: 20px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: 'Montserrat', sans-serif;
}
.hub-brand-name { font-size: 15px; font-weight: 800; color: #073763; letter-spacing: -.02em; font-family: 'Montserrat', sans-serif; line-height: 1.2; }
.hub-brand-sub { font-size: 10px; color: rgba(7,55,99,.75); text-transform: uppercase; letter-spacing: .12em; margin-top: 3px; font-weight: 700; font-family: 'Montserrat', sans-serif; }

.hub-search-wrap {
  flex: 1; max-width: 440px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: #f4f7fb;
  border: 1px solid rgba(7,55,99,0.12);
  border-radius: 10px; padding: 0 16px; height: 40px;
  transition: border-color .15s, background .15s;
}
.hub-search-wrap:focus-within {
  border-color: rgba(14,129,197,0.50);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14,129,197,0.10);
}
.hub-search-icon { font-size: 14px; opacity: .4; }
.hub-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: #1a2740; font-size: 13px; font-family: inherit; font-weight: 500;
}
.hub-search-input::placeholder { color: rgba(7,55,99,.75); }

.hub-topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hub-apk-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(15,157,110,0.10);
  border: 1px solid rgba(15,157,110,0.25);
  color: #0b7a52; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all .15s; font-family: 'Montserrat', sans-serif;
}
.hub-apk-pill:hover { background: rgba(15,157,110,0.18); }
.hub-apk-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0f9d6e; flex-shrink: 0;
  animation: dot-pulse 2s ease-in-out infinite;
}
.hub-bell {
  position: relative; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(7,55,99,0.12);
  background: transparent; transition: background .15s; flex-shrink: 0;
}
.hub-bell svg { width: 18px; height: 18px; stroke: #4a5e78; fill: none; stroke-width: 1.8; }
.hub-bell:hover { background: rgba(7,55,99,0.06); }
.hub-bell-badge {
  position: absolute; top: 4px; right: 4px;
  background: #c5282a; color: #fff;
  font-size: 8px; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1; border: 2px solid #fff;
}
.hub-user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 30px;
  background: transparent; border: 1px solid rgba(7,55,99,0.14);
  cursor: pointer; transition: background .15s;
}
.hub-user-chip:hover { background: rgba(7,55,99,0.06); }
.hub-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #073763, #0e81c5);
  color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: 'Montserrat', sans-serif;
}
.hub-user-info { display: flex; flex-direction: column; }
.hub-user-name { font-size: 12px; font-weight: 700; color: #073763; font-family: 'Montserrat', sans-serif; line-height: 1.2; }
.hub-user-role { font-size: 9px; font-weight: 700; color: #0e81c5; text-transform: uppercase; letter-spacing: .08em; font-family: 'Montserrat', sans-serif; }

/* ── SUBNAV NAVY — propuesta B ───────────────────── */
.hub-navbar {
  height: 48px; background: #073763; flex-shrink: 0;
  display: flex; align-items: stretch;
  padding: 0 20px; gap: 2px; overflow-x: auto;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  cursor: grab;
}
.hub-navbar::-webkit-scrollbar { display: none; }
.hub-nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px; border-radius: 6px; margin: 6px 0;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.65);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all .16s; font-family: 'Montserrat', sans-serif;
  border: 1px solid transparent;
}
.hub-nav-item:hover { background: rgba(255,255,255,0.10); color: #fff; }
.hub-nav-item.active { background: rgba(255,255,255,0.16); color: #fff; border-color: rgba(255,255,255,0.15); }
.hub-nav-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.hub-nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; margin-left: 2px; flex-shrink: 0; }
.hub-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ff6b6b; color: #fff; font-size: 10px; font-weight: 800; margin-left: 4px; flex-shrink: 0; }

/* ── HUB BODY ─────────────────────────────────────── */
.hub-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 28px 16px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.08) transparent;
}

/* Saludo */
.hub-greeting-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.hub-greeting {
  font-size: 28px; font-weight: 900; color: #fff;
  letter-spacing: -.04em; line-height: 1.1;
}
.hub-subgreeting {
  font-size: 13px; color: rgba(255,255,255,.4);
  font-weight: 500; margin-top: 5px;
}
.hub-status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.hsp-green { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }
.hsp-amber { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25); color: #fcd34d; }
.hsp-red   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
