/* Panel del jefe: diseño de escritorio a pantalla completa. Negro profundo + verde esmeralda. */
.boss-root {
  --b-bg: #030806;
  --b-card: #07110d;
  --b-card2: #0a1913;
  --b-line: #14382b;
  --b-line2: #1d5a43;
  --b-accent: #19e58a;
  --b-accent2: #0fa968;
  --b-text: #e9fff5;
  --b-muted: #9bc0af;
  --b-warn: #ffc857;
  --b-bad: #ff5d6c;
  --b-run: #6fe9ff;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
  color: var(--b-text);
  font-size: 15px;
  line-height: 1.5;
  background: radial-gradient(1400px 600px at 15% -10%, rgba(25, 229, 138, 0.1), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(25, 229, 138, 0.07), transparent 60%), var(--b-bg);
  min-height: 100%;
  box-sizing: border-box;
  align-content: start;
}
.boss-legacy[hidden] { display: none; }
.boss-root * { box-sizing: border-box; }
.b-card {
  background: linear-gradient(180deg, var(--b-card2), var(--b-card));
  border: 1px solid var(--b-line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 0 0 1px rgba(25, 229, 138, 0.04), 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 28px rgba(25, 229, 138, 0.05);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.b-card:hover { border-color: rgba(25, 229, 138, 0.4); box-shadow: 0 0 30px rgba(25, 229, 138, 0.1); }
.b-card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-card h2 { margin: 0; font-size: 1.2rem; letter-spacing: 0.01em; }
.b-card h3 { margin: 0; font-size: 1.05rem; }
.b-muted { color: var(--b-muted); }
.b-small { font-size: 0.9rem; }
.b-grow { flex: 1; }
.b-ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.b-card > header .b-ico { color: var(--b-accent); width: 26px; height: 26px; }

/* Cabecera con imagen */
.b-hero { grid-column: span 8; position: relative; overflow: hidden; min-height: 340px; padding: 0; justify-content: center;
  background: #02100a url('/img/demo/hero-ciudad-cabecera.jpg') center / cover no-repeat; }
.b-hero::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.05) 100%); }
.b-hero-in { position: relative; padding: 32px 36px; display: flex; flex-direction: column; gap: 14px; max-width: 700px; }
.b-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--b-accent); font-size: 0.95rem; }
.b-logo i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-style: normal; color: #00170d;
  background: linear-gradient(135deg, var(--b-accent), var(--b-accent2)); box-shadow: 0 0 18px rgba(25, 229, 138, 0.6); }
.b-hero h1 { margin: 0; font-size: clamp(2.2rem, 4.2vw, 3.9rem); line-height: 1.04; text-shadow: 0 2px 20px #000; font-weight: 800; }
.b-hero h1 em { display: block; font-style: normal; color: var(--b-accent); text-shadow: 0 0 28px rgba(25, 229, 138, 0.55); }
.b-hero .b-sub { margin: 0; font-size: 1.2rem; font-weight: 600; color: #f1fff8; }
.b-hero .b-desc { margin: 0; font-size: 1rem; color: #cfeee0; max-width: 560px; }
.b-quote { position: absolute; right: 28px; top: 32px; text-align: right; font-style: italic; font-size: 1.2rem; line-height: 1.35; color: #fff;
  text-shadow: 0 2px 14px #000; max-width: 220px; margin: 0; }
.b-quote small { display: block; font-style: normal; letter-spacing: 0.3em; font-size: 0.7rem; color: #cfeee0; margin-top: 6px; }
.b-note { font-size: 0.8rem; color: #b5d6c6; }
.b-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.b-btn { appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem; padding: 13px 22px; min-height: 46px; border-radius: 12px; color: var(--b-text);
  background: rgba(10, 30, 22, 0.85); border: 1px solid var(--b-line2); display: inline-flex; align-items: center; gap: 10px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.b-btn:hover { transform: translateY(-1px); border-color: var(--b-accent); box-shadow: 0 0 18px rgba(25, 229, 138, 0.28); }
.b-btn:focus-visible, .b-tab:focus-visible, .b-chip:focus-visible, .b-row:focus-visible, .b-tile:focus-visible { outline: 2px solid var(--b-accent); outline-offset: 2px; }
.b-btn.primary { color: #00170d; border-color: transparent; background: linear-gradient(135deg, var(--b-accent), var(--b-accent2)); box-shadow: 0 0 22px rgba(25, 229, 138, 0.35); }
.b-btn.sm { padding: 7px 14px; min-height: 36px; font-size: 0.9rem; border-radius: 9px; }
.b-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Estado del sistema */
.b-sys { grid-column: span 4; }
.b-gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.b-gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 8px 2px; border: 1px solid var(--b-line); border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.b-gauge svg { width: 84px; height: 84px; }
.b-gauge strong { font-size: 0.95rem; }
.b-gauge .ring { fill: none; stroke: #0f2a21; stroke-width: 8; }
.b-gauge .val { fill: none; stroke: var(--b-accent); stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%;
  filter: drop-shadow(0 0 4px rgba(25, 229, 138, 0.7)); transition: stroke-dashoffset 0.6s; }
.b-gauge .val.warn { stroke: var(--b-warn); }
.b-gauge .val.bad { stroke: var(--b-bad); }
.b-gauge .val.na { stroke: #2b4a3f; filter: none; }
.b-gauge text { fill: var(--b-text); font-size: 20px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.b-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.b-kv li { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border: 1px solid var(--b-line); border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 0.9rem; }
.b-kv li > span:first-child { color: var(--b-muted); }

.b-proj { grid-column: span 4; }
.b-agents { grid-column: span 4; }
.b-queue { grid-column: span 4; }
.b-gal { grid-column: span 5; }
.b-act { grid-column: span 4; }
.b-plan { grid-column: span 3; }
.b-list { display: grid; gap: 10px; margin: 0; padding: 0 4px 0 0; list-style: none; max-height: 480px; overflow: auto; }
.b-row { border: 1px solid var(--b-line); border-radius: 12px; background: rgba(0, 0, 0, 0.3); padding: 12px; display: grid; gap: 7px; }
.b-row[role='button'] { cursor: pointer; }
.b-row[role='button']:hover, .b-row[aria-pressed='true'] { border-color: var(--b-accent); box-shadow: 0 0 16px rgba(25, 229, 138, 0.2); }
.b-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Proyectos */
.b-proj-row { grid-template-columns: 84px minmax(0, 1fr); align-items: center; column-gap: 14px; }
.b-proj-row > .b-body { display: grid; gap: 6px; min-width: 0; }
.b-cover { width: 84px; height: 72px; border-radius: 10px; border: 1px solid var(--b-line2); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: var(--b-accent);
  background: radial-gradient(circle at 30% 20%, rgba(25, 229, 138, 0.35), transparent 60%), linear-gradient(135deg, #0b2a20, #02100a); object-fit: cover; }

/* Agentes */
.b-agent { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; align-items: center; }
.b-agent-ico { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; color: var(--b-accent); border: 1px solid var(--b-line2);
  background: linear-gradient(135deg, rgba(25, 229, 138, 0.16), rgba(0, 0, 0, 0.3)); }
.b-agent-ico .b-ico { width: 28px; height: 28px; }
.b-agent.off .b-agent-ico { color: #5f8576; }
.b-agent > div { display: grid; gap: 4px; min-width: 0; }
.b-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3a5a4d; margin-right: 6px; }
.b-dot.on { background: var(--b-accent); box-shadow: 0 0 8px var(--b-accent); }

.b-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; border: 1px solid var(--b-line2); color: var(--b-muted); white-space: nowrap; }
.b-tag.ok { color: var(--b-accent); border-color: rgba(25, 229, 138, 0.5); background: rgba(25, 229, 138, 0.08); }
.b-tag.run { color: var(--b-run); border-color: rgba(111, 233, 255, 0.5); }
.b-tag.bad { color: var(--b-bad); border-color: rgba(255, 93, 108, 0.5); }
.b-tag.pend { color: var(--b-warn); border-color: rgba(255, 200, 87, 0.45); }
.b-tag.ex { color: #0b1a14; background: var(--b-warn); border-color: var(--b-warn); }
.b-bar { height: 8px; border-radius: 99px; background: #0f2a21; overflow: hidden; }
.b-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--b-accent2), var(--b-accent)); box-shadow: 0 0 8px var(--b-accent); }
.b-bar.act > i { width: 35%; animation: b-slide 1.3s ease-in-out infinite alternate; }
@keyframes b-slide { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .b-bar.act > i { animation: none; margin-left: 30%; } }
.b-empty { border: 1px dashed var(--b-line2); border-radius: 12px; padding: 24px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--b-muted); }
.b-empty strong { color: var(--b-text); font-size: 1.1rem; }
.b-details { font-size: 0.9rem; color: var(--b-muted); display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--b-line); }
.b-details pre { margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; color: var(--b-text); }
.b-qnum { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; border: 1px solid var(--b-line2); color: var(--b-accent); flex: none; }

/* Pestañas y galería */
.b-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.b-tab, .b-chip { appearance: none; cursor: pointer; font: inherit; font-size: 0.9rem; padding: 7px 14px; min-height: 36px; border-radius: 999px; color: var(--b-muted);
  background: transparent; border: 1px solid var(--b-line2); transition: color 0.15s, border-color 0.15s; }
.b-tab:hover, .b-chip:hover { color: var(--b-text); border-color: var(--b-accent); }
.b-tab[aria-selected='true'], .b-chip[aria-pressed='true'] { color: #00170d; background: var(--b-accent); border-color: var(--b-accent); font-weight: 700; }
.b-banner { border: 1px solid rgba(255, 200, 87, 0.5); background: rgba(255, 200, 87, 0.08); color: var(--b-warn); border-radius: 10px; padding: 8px 12px; font-size: 0.9rem; font-weight: 600; }
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.b-tile { position: relative; appearance: none; padding: 0; cursor: zoom-in; border: 1px solid var(--b-line2); border-radius: 12px; overflow: hidden; background: #02100a; color: inherit; font: inherit; text-align: left; aspect-ratio: 4 / 3; }
.b-tile:hover { border-color: var(--b-accent); box-shadow: 0 0 18px rgba(25, 229, 138, 0.3); }
.b-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: 0.85rem; font-weight: 600; display: flex; gap: 6px; align-items: center; justify-content: space-between;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92), transparent); }
.b-lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.88); display: grid; place-items: center; padding: 24px; }
.b-lightbox figure { margin: 0; max-width: min(1100px, 100%); display: grid; gap: 12px; justify-items: center; }
.b-lightbox img { max-width: 100%; max-height: 72vh; border-radius: 14px; border: 1px solid var(--b-accent); }
.b-lightbox figcaption { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 1.05rem; }

.b-panel-box { border: 1px solid var(--b-line); border-radius: 10px; background: #020604; padding: 14px; min-height: 180px; font-family: Consolas, 'Courier New', monospace; font-size: 0.9rem; overflow: auto; max-height: 300px; }

/* Planificador vertical */
.b-phases { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--b-line2); display: grid; gap: 16px; }
.b-phase { position: relative; display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--b-line); border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.b-phase::before { content: ''; position: absolute; left: -38px; top: 14px; width: 18px; height: 18px; border-radius: 50%; background: #0f2a21; border: 2px solid var(--ph, var(--b-line2)); }
.b-phase.done::before { background: var(--ph); box-shadow: 0 0 12px var(--ph); }
.b-phase.doing { border-color: var(--ph); }
.b-phase.doing::before { box-shadow: 0 0 12px var(--ph); background: #02100a; }
.b-phase.p1 { --ph: #19e58a; } .b-phase.p2 { --ph: #6fe9ff; } .b-phase.p3 { --ph: #ffc857; } .b-phase.p4 { --ph: #c58bff; } .b-phase.p5 { --ph: #ff8a5c; }
.b-phase .b-bar > i { background: var(--ph); box-shadow: 0 0 8px var(--ph); }
.b-ptasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.9rem; }
.b-ptasks li { display: flex; gap: 8px; align-items: center; color: var(--b-muted); }
.b-ptasks li.ok { color: var(--b-text); }
.b-ptasks .b-ico { width: 16px; height: 16px; }

.top-search { background: #04100b; color: #e7fff4; border: 1px solid #14382b; border-radius: 9px; padding: 8px 12px; min-width: 200px; max-width: 320px; font: inherit; font-size: 15px; }
.top-search:focus-visible { outline: 2px solid #19e58a; outline-offset: 1px; }
.top-bell { position: relative; cursor: pointer; background: transparent; color: #e7fff4; border: 1px solid #14382b; border-radius: 9px; padding: 7px 11px; font: inherit; font-size: 15px; }
.top-bell:hover { border-color: #19e58a; }
.top-bell b { margin-left: 6px; min-width: 20px; display: inline-block; text-align: center; border-radius: 99px; background: #0f2a21; color: #9bc0af; font-size: 0.8rem; padding: 1px 6px; }
.top-bell b.has { background: #ff5d6c; color: #200006; }
.navbtn { font-size: 15px; }
.btn { font-size: 14px; }

/* ===== Rejilla compacta de tres filas (escritorio) ===== */
.boss-root {
  gap: 12px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.4;
  grid-template-rows: clamp(210px, 27vh, 250px) clamp(230px, 29vh, 270px) clamp(270px, 38vh, 330px);
  align-content: start;
  background: radial-gradient(1200px 500px at 15% -10%, rgba(25, 229, 138, 0.08), transparent 60%), #020504;
}
.b-card { padding: 12px 14px; gap: 8px; overflow: hidden; min-height: 0; border-radius: 12px; border-color: rgba(25, 229, 138, 0.28); }
.b-card h2 { font-size: 17px; }
.b-card > header { flex-wrap: nowrap; flex: none; }
.b-card > header .b-ico { width: 22px; height: 22px; }
.b-hero { min-height: 0; justify-content: flex-end; }
.b-hero-in { padding: 18px 26px; gap: 8px; max-width: 640px; }
.b-hero h1 { font-size: clamp(28px, 2.8vw, 44px); line-height: 1.02; }
.b-hero h1 em { display: inline; margin-left: 0.25em; }
.b-hero .b-sub { font-size: 16px; }
.b-hero .b-desc { font-size: 14px; max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-logo, .b-note { display: none; }
.b-quote { top: 18px; right: 22px; font-size: 16px; max-width: 200px; }
.b-btn { padding: 8px 16px; min-height: 40px; font-size: 15px; border-radius: 10px; }
.b-btn.sm { padding: 4px 10px; min-height: 32px; font-size: 14px; }
.b-gauges { grid-template-columns: repeat(3, 1fr); gap: 8px; flex: none; }
.b-gauge { padding: 4px 2px; }
.b-gauge svg { width: 68px; height: 68px; }
.b-gauge strong { font-size: 14px; }
.b-kv { gap: 6px; flex: 1; min-height: 0; align-content: start; }
.b-kv li { flex-direction: row; justify-content: space-between; align-items: center; padding: 5px 9px; font-size: 14px; }
.b-list { gap: 6px; max-height: none; flex: 1; min-height: 0; overflow: auto; }
.b-row { padding: 8px 10px; gap: 4px; }
.b-proj-row { grid-template-columns: 72px minmax(0, 1fr); }
.b-cover { width: 72px; height: 56px; }
.b-agent { grid-template-columns: 40px minmax(0, 1fr); }
.b-agent-ico { width: 40px; height: 40px; }
.b-agent-ico .b-ico { width: 22px; height: 22px; }
.b-empty { padding: 12px; gap: 6px; flex: 1; align-content: center; min-height: 0; }
.b-empty strong { font-size: 16px; }
.b-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; overflow: auto; min-height: 0; flex: 1; }
.b-gal { overflow: hidden; }
.b-gal .b-tabs { scrollbar-width: none; }
.b-gal .b-tabs::-webkit-scrollbar { display: none; }
.b-tabs { flex: none; gap: 6px; }
.b-tab, .b-chip { padding: 3px 12px; min-height: 30px; font-size: 14px; }
.b-panel-box { min-height: 0; max-height: none; flex: 1; padding: 10px; font-size: 14px; }
.b-phases { overflow: auto; flex: 1; min-height: 0; gap: 10px; padding-right: 4px; }
.b-phase { padding: 7px 10px; }
.b-tag { font-size: 13px; padding: 2px 9px; }
.b-small { font-size: 14px; }
.b-banner { font-size: 13px; padding: 5px 10px; }
.b-hero.b-card { padding: 0; }

/* Estado del sistema compacto: indicador a la izquierda, texto a la derecha */
.b-gauges { gap: 6px; }
.b-gauge { display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "s l" "s u"; column-gap: 8px; align-items: center; text-align: left; padding: 5px 8px; }
.b-gauge svg { grid-area: s; width: 60px; height: 60px; }
.b-gauge strong { grid-area: l; align-self: end; font-size: 15px; }
.b-gauge > span { grid-area: u; align-self: start; font-size: 12px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.b-gauge text { font-size: 21px; }
.b-kv { grid-template-columns: 1fr 1fr; flex: none; }
.b-kv li { min-width: 0; gap: 6px; }
.b-kv li > span:first-child { white-space: nowrap; min-width: 0; }
.b-kv .b-tag { flex: none; white-space: nowrap; }

/* Galería compacta: una fila de miniaturas con desplazamiento horizontal */
.b-gal > header { gap: 8px; }
.b-gal > header .b-tabs { flex-wrap: nowrap; }
.b-gal .b-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.b-gal .b-chip { flex: none; white-space: nowrap; }
.b-gal > header h2 { flex: none; white-space: nowrap; }
.b-gal > header > .b-grow { flex: 0 1 0; }
.b-gal > header > .b-tabs { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
.b-gal .b-grid { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; flex: 1; min-height: 0; }
.b-gal .b-tile { flex: none; width: 150px; aspect-ratio: auto; min-height: 70px; align-self: stretch; }
.b-gal .b-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-gal .b-tile .cap { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 3px; padding: 16px 8px 6px; font-size: 0.78rem; line-height: 1.2; }
.b-gal .b-tile .cap > span:first-child { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-gal .b-tile .cap > :not(:first-child) { flex: none; font-size: 0.65rem; padding: 1px 6px; }

/* Planificador compacto */
.b-phases { gap: 6px; }
.b-phase { padding: 5px 10px; gap: 3px; }
.b-phase::before { top: 9px; }

/* Equipo de IA compacto: la lista de agentes tiene prioridad y se desplaza */
.b-agents > p.b-small { display: none; }
.b-agents .b-list { flex: 1 1 auto; min-height: 96px; }
.b-agent { padding: 6px 10px; align-items: center; }
.b-agent > div:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.b-agent > div:last-child > .b-small.b-muted { display: none; }
.b-agent .b-line { min-width: 0; }
.b-agent .b-line strong { white-space: nowrap; }
.b-agent .b-line .b-tag { flex: none; white-space: nowrap; }
.b-agent .b-small { line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.b-agents > .b-row:last-child { flex: none; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; padding: 6px 10px; gap: 8px; }
.b-agents > .b-row:last-child > strong { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-agents > .b-row:last-child > .b-tag { flex: none; white-space: nowrap; }
.b-agents .b-list { overflow-y: auto; min-height: 0; }
.b-agents > .b-row:last-child > .b-small { display: none; }

/* Barra superior: el logo nunca se parte y la navegación cabe */
.topbar { gap: 12px; }
.brand { flex: none; white-space: nowrap; }
.nav { flex: 0 1 auto; }
.navbtn { white-space: nowrap; flex: none; padding: 6px 10px; }
#ctx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; flex: 0 1 auto; }
.conn, #logout-btn, .top-bell { flex: none; white-space: nowrap; }
.top-search { flex: 0 1 260px; min-width: 140px; }
@media (max-width: 1700px) { #ctx { display: none; } .top-search { flex-basis: 200px; } }

@media (min-width: 1900px) {
  .boss-root { font-size: 16px; gap: 14px; padding: 14px; }
}
@media (max-width: 1500px) {
  .b-hero { grid-column: span 7; }
  .b-sys { grid-column: span 5; }
  .b-gal { grid-column: span 5; }
  .b-act { grid-column: span 4; }
  .b-plan { grid-column: span 3; }
}
@media (max-height: 760px) {
  .boss-root { grid-template-rows: 210px 230px 235px; }
  .b-hero .b-desc { -webkit-line-clamp: 1; }
}
@media (max-width: 1180px) {
  .boss-root { grid-template-rows: none; grid-auto-rows: minmax(200px, auto); }
  .b-hero, .b-sys, .b-proj, .b-agents, .b-queue, .b-gal, .b-act, .b-plan { grid-column: span 12; }
  .b-card { overflow: visible; }
  .b-list, .b-phases { max-height: 360px; }
  .b-quote { display: none; }
}
@media (max-width: 760px) {
  .boss-root { padding: 10px; gap: 12px; }
  .b-gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-kv { grid-template-columns: 1fr; }
  .b-hero-in { padding: 22px 18px; }
  .top-search { min-width: 110px; }
  .top-kbd { display: none; }
}

/* ===== Cabecera según el diseño definitivo ===== */
.topbar { align-items: center; min-height: 54px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 26px; letter-spacing: -0.01em; color: #fff; }
.brand-ov { color: #19e58a; text-shadow: 0 0 18px rgba(25, 229, 138, 0.6); font-size: 30px; }
.nav-ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.navbtn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; }
.navbtn[aria-current='page'], .navbtn.active { color: #19e58a; border-color: #19e58a; background: rgba(25, 229, 138, 0.1); box-shadow: 0 0 14px rgba(25, 229, 138, 0.25); }
.top-search-wrap { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 380px; min-width: 160px; padding: 0 10px; border: 1px solid #14382b; border-radius: 12px; background: #04100b; color: #9bc0af; }
.top-search-wrap:focus-within { border-color: #19e58a; box-shadow: 0 0 14px rgba(25, 229, 138, 0.25); }
.top-search-wrap .top-search { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 9px 0; max-width: none; }
.top-search-wrap .top-search:focus-visible { outline: none; }
.top-kbd { font: 600 12px/1 inherit; padding: 4px 6px; border: 1px solid #1d5a43; border-radius: 6px; color: #9bc0af; }
.top-bell { display: inline-flex; align-items: center; border-radius: 50%; padding: 8px; }
.top-bell b { position: absolute; top: -4px; right: -4px; margin: 0; min-width: 18px; font-size: 11px; }
.top-bell b:not(.has) { display: none; }
.top-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #00170d; background: linear-gradient(135deg, #19e58a, #0fa968); }
.top-win { flex: none; cursor: pointer; background: transparent; color: #e7fff4; border: 1px solid #14382b; border-radius: 9px; padding: 6px; display: grid; place-items: center; }
.top-win:hover { border-color: #19e58a; color: #19e58a; }

/* ===== Barra lateral según el diseño definitivo ===== */
.side-new { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid #19e58a; background: linear-gradient(180deg, #19e58a, #0fa968); color: #00170d; font: 700 15px/1 inherit; cursor: pointer; box-shadow: 0 0 18px rgba(25, 229, 138, 0.35); }
.side-new:hover { filter: brightness(1.08); }
.side-new:focus-visible, .side-link:focus-visible { outline: 2px solid #6fe9ff; outline-offset: 2px; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: #cfe9dd; font: inherit; text-align: start; cursor: pointer; }
.side-link span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link b { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(25, 229, 138, 0.14); color: #19e58a; }
.side-link:hover { background: rgba(25, 229, 138, 0.08); }
.side-link[aria-pressed='true'] { color: #19e58a; border-color: #1d5a43; background: rgba(25, 229, 138, 0.12); }
.side-title { margin: 12px 14px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #9bc0af; }
.side-recent { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; gap: 2px; }
.side-recent button { display: block; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: #cfe9dd; font: inherit; font-size: 13px; text-align: start; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-recent button:hover { background: rgba(25, 229, 138, 0.08); }
.side-recent .empty { padding: 5px 8px; font-size: 13px; color: #9bc0af; }
.side-storage { display: grid; gap: 6px; margin: 8px 14px 14px; padding: 12px; border: 1px solid #14382b; border-radius: 12px; background: #04100b; }
.side-st-lbl { font-size: 12px; font-weight: 700; color: #9bc0af; }
.side-st-bar { display: block; height: 8px; border-radius: 999px; background: #0a1913; overflow: hidden; }
.side-st-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #0fa968, #19e58a); box-shadow: 0 0 10px rgba(25, 229, 138, 0.5); transition: width 0.3s; }
.side-st-txt { font-size: 12px; color: #cfe9dd; }
@media (prefers-reduced-motion: reduce) { .side-st-bar i { transition: none; } }

/* Chevron en los títulos de sección del lateral (según el diseño definitivo) */
.side-title { display: flex; align-items: center; justify-content: space-between; }
.side-title::after { content: ''; width: 6px; height: 6px; border-inline-end: 2px solid #9bc0af; border-block-end: 2px solid #9bc0af; transform: rotate(45deg); margin-block-start: -3px; }

/* Lista fija de herramientas activas */
.side-active { display: grid; gap: 2px; margin: 0 8px; }
.side-act { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: #cfe9dd; font: inherit; text-align: start; cursor: pointer; }
.side-act span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-act:hover { background: rgba(25, 229, 138, 0.08); }
.side-act:focus-visible { outline: 2px solid #6fe9ff; outline-offset: 2px; }
.side-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #19e58a; box-shadow: 0 0 8px rgba(25, 229, 138, 0.6); }
.side-pend { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 999px; color: #ffc857; border: 1px solid rgba(255, 200, 87, 0.45); flex: none; }
.side-note { margin: 4px 4px 0; padding: 6px 8px; font-size: 12px; line-height: 1.35; color: #ffc857; border: 1px solid rgba(255, 200, 87, 0.4); border-radius: 8px; background: rgba(255, 200, 87, 0.07); }
.side-sub { display: grid; gap: 2px; margin: 0 0 4px 22px; padding-left: 8px; border-left: 1px solid #1d5a43; }
.side-sub[hidden] { display: none; }
.side-sub button { display: block; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: #cfe9dd; font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.side-sub button:hover { background: rgba(25, 229, 138, 0.08); color: #19e58a; }
.side-sub button:focus-visible { outline: 2px solid #6fe9ff; outline-offset: 2px; }

/* ===== Composición en 100 columnas: proporciones de la referencia ===== */
.boss-root {
  --b-avail: calc(100vh - 102px);
  grid-template-columns: repeat(100, minmax(0, 1fr));
  grid-template-rows:
    minmax(230px, calc(var(--b-avail) * 0.28))
    minmax(240px, calc(var(--b-avail) * 0.30))
    minmax(280px, calc(var(--b-avail) * 0.42));
}
.b-hero { grid-column: span 66; }
.b-sys { grid-column: span 34; }
.b-proj { grid-column: span 35; }
.b-agents { grid-column: span 27; }
.b-queue { grid-column: span 38; }
.b-gal { grid-column: span 46; }
.b-act { grid-column: span 25; }
.b-plan { grid-column: span 29; }

/* Proyectos con fotografía más grande */
.b-proj-row { grid-template-columns: 116px minmax(0, 1fr); }
.b-cover { width: 116px; height: 86px; }

/* Galería grande: rejilla de 3 columnas en lugar de tiras estrechas */
.b-gal .b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(110px, 1fr); gap: 8px; overflow-x: hidden; overflow-y: auto; }
.b-gal .b-tile { width: auto; min-height: 0; }

@media (max-width: 1500px) {
  .b-hero { grid-column: span 62; }
  .b-sys { grid-column: span 38; }
  .b-proj { grid-column: span 36; }
  .b-agents { grid-column: span 28; }
  .b-queue { grid-column: span 36; }
  .b-gal { grid-column: span 44; }
  .b-act { grid-column: span 28; }
  .b-plan { grid-column: span 28; }
}
@media (max-width: 1180px) {
  .boss-root { grid-template-rows: none; grid-auto-rows: minmax(200px, auto); }
  .b-hero, .b-sys, .b-proj, .b-agents, .b-queue, .b-gal, .b-act, .b-plan { grid-column: span 100; }
  .b-gal .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
