@font-face {
  font-family: "Manrope";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/manrope-400.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/manrope-600.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/manrope-700.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope";
  font-weight: 800;
  font-display: swap;
  src: url("/static/fonts/manrope-800.ttf") format("truetype");
}
@font-face {
  font-family: "Newsreader";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/newsreader-400.ttf") format("truetype");
}
@font-face {
  font-family: "Newsreader";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/newsreader-600.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/plex-400.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/plex-500.ttf") format("truetype");
}

:root {
  --red: #E10600;
  --bg: #070708;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-fill: rgba(255, 255, 255, 0.10);
  --glass-fill-2: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #F5F5F7;
  --mute: rgba(255, 255, 255, 0.48);
  --danger: #FF4D4D;
  --ok: #F5F5F7;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --glass-blur: blur(20px) saturate(160%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
html { color-scheme: dark; }
body {
  font-family: var(--ui);
  font-size: 15px;
  letter-spacing: -0.011em;
  font-weight: 400;
  background:
    radial-gradient(ellipse 70% 55% at 92% -8%, rgba(225, 6, 0, 0.32), transparent 58%),
    radial-gradient(ellipse 40% 30% at 0% 100%, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--bg);
}
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}
::selection { background: rgba(225, 6, 0, 0.45); color: #fff; }
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.hidden { display: none !important; }

/* —— Glass shared —— */
.gate-card,
.top,
.rail,
.ctx,
.composer,
.agent-drawer,
.modal-bar,
.stat-pill,
.dept-island,
.kpi,
.cal-month,
.cal-week,
.cal-rules,
.red-card,
.hoy-strip,
.bubble.user .body {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* —— Login —— */
.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 88% 8%, rgba(225, 6, 0, 0.38), transparent 52%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(255, 255, 255, 0.05), transparent 55%),
    var(--bg);
}
.gate-card {
  width: min(420px, 100%);
  padding: 40px 36px 32px;
  border-radius: 22px;
  position: relative;
}
.gate-mark {
  display: block;
  margin-bottom: 22px;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--red);
  margin: 0 0 10px;
}
.gate h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 46px;
  margin: 0 0 8px;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.lede { color: var(--mute); margin: 0 0 22px; line-height: 1.5; }
.gate input, .gate button, .composer textarea, .composer button[type="submit"],
.rail input, .save input, .save textarea, .save select, .save button {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.gate input:focus, .rail input:focus, .save input:focus, .save textarea:focus, .save select:focus,
.composer textarea:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.65);
  background: rgba(255, 255, 255, 0.08);
}
.gate button, .composer button[type="submit"], .save button {
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  border: 0;
  cursor: pointer;
  margin-top: 10px;
  letter-spacing: -0.02em;
}
.gate button:hover, .composer button[type="submit"]:hover, .save button:hover {
  filter: brightness(1.08);
}
.err { color: var(--danger); min-height: 1.2em; font-size: 14px; }

/* —— App shell —— */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 196px 220px minmax(0, 1fr);
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidenav top top"
    "sidenav rail stage";
}
.app.chat-ctx-on {
  grid-template-columns: 196px 220px minmax(0, 1fr) 240px;
  grid-template-areas:
    "sidenav top top top"
    "sidenav rail stage ctx";
}
.ctx { display: none; }
.app.chat-ctx-on .ctx { display: block; }

.side-nav {
  grid-area: sidenav;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px 24px;
  background: rgba(7, 7, 8, 0.48);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  z-index: 6;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  color: var(--mute);
  border: 0;
  padding: 11px 12px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.side-item svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  flex-shrink: 0;
}
.side-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.side-item.on {
  color: #fff;
  background: var(--red);
  box-shadow: 0 0 22px rgba(225, 6, 0, 0.28);
}
.side-group { margin: 0 0 2px; }
.side-group-head {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.side-item-grow { flex: 1; min-width: 0; }
.side-chevron {
  flex-shrink: 0;
  width: 28px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mute);
  font-size: 10px;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.side-chevron:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.side-chevron.open { transform: rotate(180deg); color: var(--ink); }
.side-depts {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 8px;
  max-height: 52vh;
  overflow-y: auto;
}
.side-depts.hidden { display: none; }
.side-dept-floor {
  margin: 8px 0 4px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6a6358;
}
.side-dept-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #a39a8e;
  font-family: var(--ui);
  font-size: 12px;
  padding: 7px 10px 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.side-dept-item:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border-left-color: rgba(34,167,196,0.5);
}
.side-dept-item.on {
  color: #f4efe6;
  background: rgba(34,167,196,0.12);
  border-left-color: #22a7c4;
  font-weight: 600;
}
.top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  z-index: 4;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand strong {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  font-weight: 800;
}
.brand em { font-style: normal; color: var(--mute); font-size: 11px; font-family: var(--mono); }
.mark {
  width: 10px; height: 10px;
  background: var(--red);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(225, 6, 0, 0.7);
  flex-shrink: 0;
}
.icon {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid var(--line);
  width: 36px; height: 36px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 200ms var(--ease);
}
#btn-map.icon { display: grid; place-items: center; }
.icon:hover { background: rgba(255, 255, 255, 0.1); }
#live-pulse { margin: 0 8px 0 auto; }

.rail, .ctx {
  overflow: auto;
  padding: 18px 16px 36px;
  border-radius: 0;
}
.rail { grid-area: rail; border-top: 0; border-left: 0; border-bottom: 0; }
.ctx { grid-area: ctx; border-top: 0; border-right: 0; border-bottom: 0; }
.rail-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 14px;
}
.rail input { margin-bottom: 8px; }
#note-list button, #cites button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 6px 13px;
  cursor: pointer;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.35;
  border-radius: 0;
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
#note-list button:hover, #cites button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
#note-list small, #cites small {
  display: block;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 0.02em;
}

.stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(225, 6, 0, 0.08), transparent 50%),
    linear-gradient(180deg, #0c0c0e 0%, var(--bg) 42%);
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 36px min(7vw, 72px) 24px;
}
.bubble {
  max-width: 62ch;
  margin: 0 auto 32px;
}
.bubble.user { text-align: right; }
.bubble .who {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.bubble.user .who { color: var(--mute); }
.bubble .body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.bubble .body.pulse {
  color: var(--red);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  animation: pulse 1.15s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.bubble.user .body {
  display: inline-block;
  padding: 14px 16px;
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 16px;
  max-width: 100%;
  border-radius: 16px 16px 4px 16px;
}

.prose { color: var(--ink); }
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
  margin: 1.4em 0 0.55em;
}
.prose h1 { font-size: 1.55em; }
.prose h2 { font-size: 1.22em; }
.prose h3 {
  font-size: 0.95em;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 1.6em;
}
.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.2em;
}
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--red); }
.prose a { color: var(--red); text-underline-offset: 3px; }
.prose em { color: rgba(255, 255, 255, 0.78); }
.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6em 0;
}
.caret {
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 2px;
  background: var(--red);
  vertical-align: text-bottom;
  animation: pulse 1s ease-in-out infinite;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8vw 16px;
  position: relative;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}
.compose-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  font-size: 16px;
  width: auto;
  margin: 0;
}
.composer button[type="submit"] {
  width: auto;
  padding: 0 22px;
  margin: 0;
  min-height: 48px;
  border-radius: 12px;
}
.composer button[type="submit"]:disabled { opacity: 0.45; cursor: wait; }
.icon-btn {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--mute);
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.chip button {
  all: unset;
  cursor: pointer;
  color: var(--danger);
}
.hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.drop-veil {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(7, 7, 8, 0.72);
  backdrop-filter: blur(12px);
  border: 2px dashed var(--red);
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  pointer-events: none;
}
.bubble.status .body { color: var(--mute); font-family: var(--mono); font-size: 13px; }

.save { margin-top: 24px; }
.save input, .save select, .save textarea { margin-bottom: 8px; }

.modal {
  position: fixed; inset: 0;
  background: rgba(7, 7, 8, 0.88);
  backdrop-filter: blur(16px);
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 0;
  border-left: 0; border-right: 0; border-top: 0;
  font-family: var(--display);
}
.modal-bar button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
  font-family: var(--ui);
  transition: background 200ms var(--ease);
}
.modal-bar button:hover { background: rgba(255, 255, 255, 0.06); }
#graph { flex: 1; width: 100%; }

.desk-nav { display: none; }
.desk-tab.side-item { /* sidebar owns the tab look */ }

.app.floor-on {
  grid-template-columns: 196px minmax(0, 1fr);
  grid-template-areas:
    "sidenav top"
    "sidenav floor";
}
.app.floor-on.drawer-on {
  grid-template-columns: 196px minmax(0, 1fr) 320px;
  grid-template-areas:
    "sidenav top top"
    "sidenav floor drawer";
}
.app.hq-on {
  grid-template-columns: 196px 1fr;
  grid-template-areas:
    "sidenav top"
    "sidenav hq";
}
.app.floor-on .rail,
.app.floor-on .stage,
.app.floor-on .ctx,
.app.hq-on .rail,
.app.hq-on .stage,
.app.hq-on .ctx,
.app.hq-on .floor { display: none; }
.app.floor-on .floor { display: flex; }
.app.floor-on .agent-drawer:not(.hidden) { display: flex; }
.app.hq-on .hq-pane:not(.hidden) { display: flex; }
.app.depto-on {
  grid-template-columns: 196px minmax(0, 1fr);
  grid-template-areas:
    "sidenav top"
    "sidenav depto";
}
.app.depto-on .rail,
.app.depto-on .stage,
.app.depto-on .ctx,
.app.depto-on .floor,
.app.depto-on .hq-pane { display: none !important; }
.app.depto-on .depto-pane:not(.hidden) { display: flex; }

/* —— Departamentos / entregables —— */
.depto-pane {
  grid-area: depto;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background: #0a0a0c;
}
.depto-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 28px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.depto-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
}
.depto-sub { margin: 6px 0 0; color: var(--mute); font-size: 13px; }
.depto-back {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--ui);
  font-size: 12px;
  white-space: nowrap;
}
.depto-back:hover { background: rgba(255,255,255,0.06); }
.depto-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}
.depto-body {
  overflow-y: auto;
  padding: 12px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: start;
  border-right: 1px solid var(--line);
  background: #08080a;
}
.depto-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  font-family: inherit;
}
.depto-card:hover {
  border-color: rgba(34,167,196,0.45);
  background: rgba(34,167,196,0.06);
}
.depto-card.on {
  border-color: #22a7c4;
  background: rgba(34,167,196,0.12);
}
.depto-card-head { padding: 10px 12px 6px; }
.depto-card-preview {
  padding: 0 12px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #a39a8e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.depto-card-open { display: none; }
.depto-reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #0a0a0c;
}
.depto-reader.hidden { display: none; }
.depto-reader-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.depto-reader-bar h3 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 18px;
}
.depto-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 64px;
  max-width: 860px;
  font-size: 15px;
  line-height: 1.65;
  color: #d8d0c6;
}
.depto-reader-body h1,.depto-reader-body h2,.depto-reader-body h3 {
  font-family: var(--display);
  color: var(--ink);
  margin: 16px 0 8px;
}
.depto-reader-body h1 { font-size: 22px; }
.depto-reader-body h2 { font-size: 18px; }
.depto-reader-body p { margin: 0 0 10px; }
.depto-reader-body ul,.depto-reader-body ol { padding-left: 22px; margin: 6px 0 12px; }
.depto-reader-body strong { color: #f4efe6; }
.depto-reader-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.depto-reader-body th,.depto-reader-body td { border: 1px solid var(--line); padding: 6px 8px; }
.depto-reader-body pre { background: rgba(255,255,255,0.05); padding: 12px; border-radius: 10px; overflow: auto; }

/* —— Pepita Jarvis home —— */
.pepita-https-banner {
  width: min(480px, 100%);
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(225, 6, 0, 0.4);
  background: rgba(225, 6, 0, 0.1);
  text-align: left;
}
.pepita-https-banner.hidden { display: none; }
.pepita-https-banner p { margin: 0 0 10px; font-size: 13px; color: #f0d0d0; line-height: 1.4; }
.pepita-https-banner .px-btn { display: inline-block; text-decoration: none; }
.pepita-shell {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  min-height: 0;
}
.pepita-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px 40px;
  min-height: 0;
  overflow: auto;
}
.pepita-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7eb8c9;
}
.pepita-hello {
  margin: 10px 0 6px;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.pepita-lead {
  margin: 0 0 28px;
  color: var(--mute);
  font-size: 15px;
  max-width: 420px;
}
.pepita-orb {
  position: relative;
  width: 168px;
  height: 168px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}
.pepita-orb .orb-core {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff6, transparent 40%),
    radial-gradient(circle at 50% 55%, #22a7c4, #0b5f72 70%, #061820);
  box-shadow: 0 0 40px rgba(34,167,196,0.45), inset 0 0 20px rgba(255,255,255,0.12);
  transition: transform 240ms var(--ease);
}
.pepita-orb:hover .orb-core { transform: scale(1.04); }
.pepita-orb .orb-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f4efe6;
  z-index: 2;
  pointer-events: none;
}
.pepita-orb .orb-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(34,167,196,0.35);
  opacity: 0.35;
}
.pepita-orb .r2 { inset: 0; opacity: 0.2; }
.pepita-orb .r3 { inset: -12%; opacity: 0.12; }
.pepita-orb[data-mode="listening"] .orb-ring,
.pepita-orb[data-mode="speaking"] .orb-ring {
  animation: pepita-wave 1.8s ease-out infinite;
}
.pepita-orb[data-mode="listening"] .r2 { animation-delay: 0.25s; }
.pepita-orb[data-mode="listening"] .r3 { animation-delay: 0.5s; }
.pepita-orb[data-mode="speaking"] .orb-core {
  animation: pepita-pulse 1.1s ease-in-out infinite;
}
.pepita-orb[data-mode="thinking"] .orb-core {
  filter: hue-rotate(20deg);
  animation: pepita-pulse 0.7s ease-in-out infinite;
}
@keyframes pepita-wave {
  0% { transform: scale(0.92); opacity: 0.55; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes pepita-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.pepita-status-line {
  margin: 18px 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a39a8e;
}
.pepita-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 80;
  max-width: min(520px, 92vw);
  padding: 12px 16px;
  background: #1a2228;
  border: 1px solid rgba(34, 167, 196, 0.55);
  color: #e8efe8;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.pepita-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.pepita-orb.has-aviso .orb-core {
  box-shadow: 0 0 0 3px rgba(34, 167, 196, 0.55);
}
.pepita-caption {
  margin: 0 auto 22px;
  max-width: 520px;
  min-height: 1.2em;
  font-size: 14px;
  line-height: 1.45;
  color: #8a8378;
  text-align: center;
  opacity: 0.8;
}
.pepita-home-form {
  display: flex;
  gap: 8px;
  width: min(520px, 100%);
}
.pepita-home-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 12px 14px;
  font-family: var(--ui);
}
.pepita-home-form button {
  border: 0;
  border-radius: 12px;
  background: #22a7c4;
  color: #041018;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
}
.pepita-side {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,0.25);
}
.pepita-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
}
.pepita-chip.warn { border-color: rgba(225,6,0,0.35); }
.pepita-chip .px-label { margin: 0 0 8px; }
.pepita-chip > p { margin: 0; font-size: 13px; line-height: 1.45; color: #c8c0b8; }
.pepita-mini { list-style: none; margin: 0; padding: 0; }
.pepita-mini li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
  line-height: 1.35;
}
.pepita-mini li:last-child { border-bottom: 0; }
.pepita-mini b { display: block; color: #f4efe6; font-size: 12px; }
.pepita-mini span { color: #9a9388; }
.pepita-mini .mute { color: #6a6358; }
.pepita-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* Floating Pepita wave (other views) */
.pepita-float {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: 120px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.pepita-float[hidden] { display: none !important; }
.pepita-float-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8, #22a7c4 55%, #0a4a58);
  box-shadow: 0 0 18px rgba(34,167,196,0.55);
  z-index: 2;
}
.pepita-float-wave {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 88px;
  height: 44px;
  margin-left: -44px;
  border-radius: 0 0 50% 50%;
  border: 1px solid rgba(34,167,196,0.45);
  border-top: 0;
  background: linear-gradient(180deg, transparent, rgba(34,167,196,0.12));
  animation: pepita-drip 2.4s ease-in-out infinite;
}
.pepita-float-wave.delay { animation-delay: 0.7s; width: 64px; margin-left: -32px; opacity: 0.55; }
.pepita-float-label {
  position: absolute;
  bottom: -2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7eb8c9;
}
.pepita-float.live .pepita-float-core { animation: pepita-pulse 1s ease-in-out infinite; }
.pepita-float.live .pepita-float-wave { border-color: rgba(34,167,196,0.8); }
@keyframes pepita-drip {
  0%, 100% { transform: translateY(-4px) scaleY(0.9); opacity: 0.45; }
  50% { transform: translateY(2px) scaleY(1.05); opacity: 0.9; }
}
@media (max-width: 960px) {
  .pepita-shell { grid-template-columns: 1fr; }
  .pepita-side { border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; }
  .pepita-orb { width: 140px; height: 140px; }
}
.depto-card-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.depto-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  margin-bottom: 6px;
}
.depto-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(34,167,196,0.15);
  color: #7eb8c9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.depto-badge.encargo { background: rgba(225,6,0,0.12); color: #e88; }
.depto-badge.vault { background: rgba(255,255,255,0.08); color: #c8c0b8; }
.depto-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.depto-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  overflow: auto;
  max-height: 420px;
  font-size: 13px;
  line-height: 1.55;
  color: #c8c0b8;
}
.depto-card-body h1,.depto-card-body h2,.depto-card-body h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 4px;
}
.depto-card-body p { margin: 0 0 8px; }
.depto-card-body ul,.depto-card-body ol { padding-left: 18px; margin: 4px 0 8px; }
.depto-card-body strong { color: #f4efe6; }
.depto-card-body table { border-collapse: collapse; font-size: 12px; width: 100%; margin: 8px 0; }
.depto-card-body th,.depto-card-body td { border: 1px solid var(--line); padding: 5px 8px; }
.depto-card-foot {
  padding: 8px 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: var(--mono);
  font-size: 10px;
  color: #6a6358;
}
.depto-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--mute);
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.depto-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 8px; }

/* —— La Oficina (skin rico: paredes, ventanas, glow, pins) —— */
.floor {
  --of-cyan: #22a7c4;
  grid-area: floor;
  display: none;
  flex-direction: column;
  overflow: auto;
  padding: 14px 18px 32px;
  position: relative;
  background:
    radial-gradient(ellipse 48% 40% at 50% 46%, rgba(34, 167, 196, 0.18), transparent 56%),
    radial-gradient(ellipse 90% 70% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
    #08080a;
  color: #e8e2d6;
  font-family: var(--ui);
}
.floor .kicker { color: var(--of-cyan); letter-spacing: 0.16em; }
.floor-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 8px;
  z-index: 2;
}
.floor-head h2 {
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 30px;
  margin: 0;
  color: #f4efe6;
}
.floor-honesty {
  margin: 8px 0 0;
  max-width: 56ch;
  color: #9a9388;
  font-size: 13px;
  line-height: 1.45;
}
.floor-pulse {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3ecf8e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.floor-pulse::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fbf71;
  animation: of-breathe 1.7s ease-in-out infinite;
}
@keyframes of-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}
.floor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
  align-items: center;
  z-index: 2;
}
.floor-elevator {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 4px;
}
.floor-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #c8c0b4;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--ui);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.floor-tab b {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}
.floor-tab span {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.floor-tab:hover {
  color: #f4efe6;
  border-color: rgba(225, 6, 0, 0.35);
}
.floor-tab.on {
  color: #fff;
  background: rgba(225, 6, 0, 0.9);
  border-color: transparent;
}
.floor-tab.on b { background: rgba(0, 0, 0, 0.22); }
.iso-tag.mute {
  opacity: 0.55;
}
.iso-tag.mute i { background: #6a6560; }
.of-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-right: 8px;
  font-size: 12px;
  color: #9a9388;
}
.of-legend span { display: inline-flex; align-items: center; gap: 6px; }
.of-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.of-legend .dot.on { background: #2fbf71; animation: of-breathe 1.7s ease-in-out infinite; }
.of-legend .dot.off { background: #6a6560; }
.of-legend .dot.bad { background: #d64545; }
.floor .stat-pill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 96px;
  padding: 7px 12px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.floor .stat-pill b {
  font-size: 18px;
  letter-spacing: -0.04em;
  font-weight: 750;
  line-height: 1;
  color: #f4efe6;
}
.floor .stat-pill span {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a9388;
}
.floor .stat-pill.hot b { color: var(--of-cyan); }
.floor .stat-pill.bad b { color: #d64545; }

.floor-grid {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.office-empty { color: #9a9388; margin: 40px 0; }

.iso-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4px 8px 120px;
  overflow: auto;
}
.iso-map-slot {
  position: relative;
  flex: 0 0 auto;
  margin: 0 auto;
}
.iso-map {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: top left;
}
.iso-svg { display: block; position: absolute; inset: 0; pointer-events: none; }

.iso-building {
  fill: #a8906c;
  stroke: #5c4830;
  stroke-width: 2.5;
}
.iso-floor-poly {
  stroke: #7a6444;
  stroke-width: 1.2;
}
.iso-floor-poly.busy { stroke: #22a7c4; stroke-width: 2; }

.iso-wall-face { fill: url(#wallFace); opacity: 0.97; }
.iso-wall-face.outer { fill: url(#wallOuter); }
.iso-wall-shade { fill: rgba(0, 0, 0, 0.28); }
.iso-wall-base { stroke: #4a3824; stroke-width: 2; }
.iso-wall-top { stroke: #f4e8d0; stroke-width: 2; }
.iso-wall-panel {
  stroke: rgba(45, 30, 16, 0.6);
  stroke-width: 1.6;
  pointer-events: none;
}
.iso-wall-panel-lite {
  stroke: rgba(255, 248, 230, 0.55);
  stroke-width: 1.2;
  pointer-events: none;
}

.iso-window {
  fill: #9fdcf0;
  stroke: #5a8fa0;
  stroke-width: 1;
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(120, 210, 240, 0.7));
}

.iso-prop-shadow { fill: rgba(0, 0, 0, 0.28); }
.iso-desk-top { fill: #e8d5b4; stroke: #5c4030; stroke-width: 1.1; }
.iso-desk-side { fill: #8a6540; stroke: #4a3020; stroke-width: 0.9; }
.iso-desk-front { fill: #6e4e30; stroke: #3a2818; stroke-width: 0.9; }
.iso-monitor.off {
  /* refuerzo CSS; el fill principal va en atributos SVG en drawDesk() */
  fill: #0f1419;
  stroke: #05070a;
}
.iso-monitor.on {
  fill: #7dd3fc;
  stroke: #e0f2fe;
}
.iso-mon-halo {
  animation: mon-halo-pulse 2.2s ease-in-out infinite;
}
@keyframes mon-halo-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.72; }
}
.iso-pot { fill: #8a5530; }
.iso-stem { stroke: #3d6b3a; stroke-width: 2; }
.iso-leaf { fill: #2f8f4e; stroke: #1f6a38; stroke-width: 1; }
.iso-sofa-seat {
  fill: #7a3a42;
  stroke: #4a2228;
  stroke-width: 1.2;
}
.iso-sofa-back {
  fill: #5c2c34;
  stroke: #3a181e;
  stroke-width: 1.1;
}
.iso-sofa-side { fill: #4e262c; stroke: #2e1418; stroke-width: 0.9; }
.iso-sofa-front { fill: #6a3238; stroke: #3a181e; stroke-width: 0.9; }
.iso-sofa-arm {
  fill: #8a4850;
  stroke: #4a2228;
  stroke-width: 0.9;
}
.iso-sofa-seam {
  stroke: rgba(40, 16, 20, 0.45);
  stroke-width: 1.2;
  stroke-linecap: round;
}
.iso-rug-outer {
  fill: #5c3a28;
  stroke: #3a2418;
  stroke-width: 1.2;
  opacity: 0.9;
}
.iso-rug {
  fill: #8b5a3c;
  stroke: #5a3824;
  stroke-width: 1.5;
  opacity: 0.92;
}
.iso-rug-stripe {
  fill: none;
  stroke: #c4a078;
  stroke-width: 1.4;
  opacity: 0.55;
}
.iso-board-frame {
  fill: #6b4a32;
  stroke: #3a2818;
  stroke-width: 1.4;
}
.iso-board-face {
  fill: #f2efe6;
  stroke: #c8c0b0;
  stroke-width: 0.8;
}
.iso-board-mark {
  stroke: #5a6a78;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.7;
}

.iso-hub-glow { animation: iso-hub-pulse 2.8s ease-in-out infinite; }
.iso-hub-ring {
  fill: none;
  stroke: rgba(127, 227, 245, 0.55);
  stroke-width: 2;
  animation: iso-hub-pulse 2.8s ease-in-out infinite;
}
.iso-hub-orb {
  fill: #9eecff;
  stroke: #eafcff;
  stroke-width: 2;
  filter: drop-shadow(0 0 10px #22a7c4);
  animation: iso-hub-pulse 2.8s ease-in-out infinite;
}
@keyframes iso-hub-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.iso-layer { position: absolute; inset: 0; pointer-events: none; }

.iso-tag {
  position: absolute;
  transform: translate(-10%, -130%);
  pointer-events: none;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.iso-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6a6560;
  flex: 0 0 auto;
}
.iso-tag.on i {
  background: #2fbf71;
  box-shadow: 0 0 7px rgba(47, 191, 113, 0.75);
}
.iso-tag.bad i { background: #d64545; }
.iso-tag span {
  font-size: 11px;
  font-weight: 650;
  color: #f0ebe3;
  letter-spacing: 0.02em;
}

.iso-entrada {
  position: absolute;
  transform: translate(-50%, 0);
  z-index: 28;
  pointer-events: none;
  padding: 4px 12px;
  border-radius: 6px;
  background: #10233f;
  border: 1px solid #22a7c4;
  color: #9ee7f5;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.2em;
  box-shadow: 0 0 16px rgba(34, 167, 196, 0.35);
}

.iso-agent {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  transform: translate(-50%, -92%);
  width: 58px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.iso-agent:hover { z-index: 60; transform: translate(-50%, -96%); }
.iso-agent.selected { z-index: 50; }
.iso-agent.selected .iso-pin-body {
  filter: drop-shadow(0 0 6px rgba(34, 167, 196, 0.95));
}
.iso-agent:focus-visible { outline: 2px solid #22a7c4; outline-offset: 2px; }

.iso-pin {
  position: relative;
  width: 28px;
  height: 40px;
}
.iso-pin-shadow {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 20px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}
.iso-pin-body {
  position: absolute;
  left: 5px;
  top: 14px;
  width: 18px;
  height: 22px;
  background: #8a939e;
  border: 1.5px solid #1a1410;
  clip-path: polygon(18% 0, 82% 0, 100% 38%, 50% 100%, 0 38%);
}
.iso-pin-head {
  position: absolute;
  left: 5px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f0c9a0;
  border: 1.5px solid #1a1410;
  z-index: 2;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.08);
}
.iso-badge {
  position: absolute;
  right: -1px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8a939e;
  border: 2px solid #fff;
  z-index: 6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.iso-agent.esperando .iso-pin-body { background: #8a939e; }
.iso-agent.esperando .iso-badge { background: #8a939e; }
.iso-agent.trabajando .iso-pin-body { background: #2fbf71; }
.iso-agent.trabajando .iso-badge {
  background: #2fbf71;
  box-shadow: 0 0 6px rgba(47, 191, 113, 0.8);
  animation: of-breathe 1.6s ease-in-out infinite;
}
.iso-agent.bloqueado .iso-pin-body { background: #d64545; }
.iso-agent.bloqueado .iso-badge { background: #d64545; }

.iso-name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #1a1410;
  border-radius: 5px;
  padding: 1px 5px;
  color: #1a1410;
  line-height: 1.3;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
/* Salas densas (>4): nombres ocultos hasta hover — evita el choclo de Marketing */
.iso-agent.dense .iso-name {
  opacity: 0;
  visibility: hidden;
  max-width: 90px;
  transition: opacity 120ms ease;
}
.iso-agent.dense:hover .iso-name,
.iso-agent.dense:focus-visible .iso-name,
.iso-agent.dense.selected .iso-name {
  opacity: 1;
  visibility: visible;
}

.iso-bubble {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 104px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #fff;
  border: 1.5px solid #1a1410;
  font-size: 9px;
  line-height: 1.2;
  color: #1a1410;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  z-index: 8;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.iso-agent:hover .iso-bubble,
.iso-agent:focus-visible .iso-bubble {
  opacity: 1;
  visibility: visible;
}

.iso-hoy {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(280px, 34vw);
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(10, 10, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  z-index: 70;
  color: #e8e2d6;
  pointer-events: auto;
}
.iso-hoy h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--of-cyan);
  font-weight: 750;
}
.iso-hoy ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
}
.iso-hoy li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}
.iso-hoy li:last-child { border-bottom: 0; }
.iso-hoy li b { color: #f4efe6; font-weight: 700; }
.iso-hoy li span { color: #a39a8e; font-size: 11px; line-height: 1.35; }
.iso-hoy li.mute { color: #9a9388; border: 0; }
.iso-hoy li.delegado span { color: #7eb8c9; }

.iso-pepita {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(340px, 42vw);
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(10, 10, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  z-index: 70;
  color: #e8e2d6;
  pointer-events: auto;
}
.iso-pepita h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f0c878;
  font-weight: 750;
}
.pepita-status {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #c8c0b4;
  min-height: 1.4em;
}
.pepita-status.mute { color: #8a8378; }
.pepita-status.ask { color: #f0e6d4; }
.pepita-status.ask b { color: #f0c878; }
.pepita-status.ok {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #d8f0e0;
}
.pepita-status.ok b { color: #8fd4a8; }
.pepita-status.ok span { color: #a39a8e; font-size: 11px; }
.pepita-status.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ec9d8;
}
.pepita-spin {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(158, 201, 216, 0.25);
  border-top-color: #9ec9d8;
  border-radius: 50%;
  animation: pepita-spin 0.7s linear infinite;
  flex: 0 0 auto;
}
@keyframes pepita-spin {
  to { transform: rotate(360deg); }
}
.pepita-form {
  display: flex;
  gap: 8px;
}
.pepita-form input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #f4efe6;
  padding: 9px 11px;
  font-size: 13px;
}
.pepita-form input:focus {
  outline: none;
  border-color: rgba(240, 200, 120, 0.55);
}
.pepita-form button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  background: #c4a060;
  color: #1a140c;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.pepita-form button:disabled,
.pepita-form input:disabled {
  opacity: 0.55;
  cursor: wait;
}

.encargo-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.encargo-form label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.encargo-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  line-height: 1.4;
}
.encargo-form button {
  align-self: flex-start;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: #22a7c4;
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}
.encargo-form button:disabled { opacity: 0.55; cursor: wait; }
.encargo-status { margin: 0; font-size: 13px; color: var(--mute); }
.encargo-result {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(34, 167, 196, 0.08);
  border: 1px solid rgba(34, 167, 196, 0.25);
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
  max-height: 72vh;
  overflow-y: auto;
}

.hoy-strip,
.office-window { display: none !important; }
.entrada-prop, .door-frame, .recep-desk, .room-tag { display: none !important; }

@keyframes core-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.agent-drawer {
  grid-area: drawer;
  display: none;
  flex-direction: column;
  overflow: auto;
  min-width: 0;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--line);
  background: #0a0a0c;
  animation: drawer-in 240ms var(--ease);
}
@keyframes drawer-in {
  from { transform: translateX(16px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.drawer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
}
.drawer-bar button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 10px;
  font-family: var(--ui);
  transition: background 200ms var(--ease);
}
.drawer-bar button:hover { background: rgba(255, 255, 255, 0.06); }
.drawer-block {
  margin: 0;
  padding: 12px 16px;
  color: var(--danger);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
#drawer-log {
  list-style: none;
  margin: 0;
  padding: 8px 16px 32px;
}
#drawer-log li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
#drawer-log time {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  margin-bottom: 4px;
}
#drawer-log .task-label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
#drawer-log .task { color: #c8c0b8; margin-top: 2px; font-size: 13px; line-height: 1.55; white-space: normal; }
#drawer-log .md-result { white-space: normal; }
#drawer-log .md-result h1,
#drawer-log .md-result h2,
#drawer-log .md-result h3 { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ink); margin: 10px 0 4px; }
#drawer-log .md-result h4,
#drawer-log .md-result h5,
#drawer-log .md-result h6 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 8px 0 3px; }
#drawer-log .md-result p { margin: 0 0 8px; }
#drawer-log .md-result ul,
#drawer-log .md-result ol { padding-left: 18px; margin: 4px 0 8px; }
#drawer-log .md-result li { margin-bottom: 3px; }
#drawer-log .md-result strong { color: #f4efe6; font-weight: 700; }
#drawer-log .md-result em { font-style: italic; color: #c8c0b8; }
#drawer-log .md-result code { font-family: var(--mono); background: rgba(255,255,255,0.07); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
#drawer-log .md-result pre { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 10px; overflow: auto; margin: 8px 0; }
#drawer-log .md-result pre code { background: none; padding: 0; }
#drawer-log .md-result table { border-collapse: collapse; font-size: 12px; margin: 8px 0; width: 100%; }
#drawer-log .md-result th,
#drawer-log .md-result td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
#drawer-log .md-result th { background: rgba(255,255,255,0.06); font-weight: 700; }
#drawer-log .md-result hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
/* same styles for encargo-result */
.encargo-result h1,.encargo-result h2,.encargo-result h3 { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ink); margin: 10px 0 4px; }
.encargo-result p { margin: 0 0 8px; }
.encargo-result ul,.encargo-result ol { padding-left: 18px; margin: 4px 0 8px; }
.encargo-result li { margin-bottom: 3px; }
.encargo-result strong { color: #f4efe6; font-weight: 700; }
.encargo-result code { font-family: var(--mono); background: rgba(255,255,255,0.07); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.encargo-result pre { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 10px; overflow: auto; margin: 8px 0; }
.encargo-result table { border-collapse: collapse; font-size: 12px; margin: 8px 0; width: 100%; }
.encargo-result th,.encargo-result td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.encargo-result th { background: rgba(255,255,255,0.06); font-weight: 700; }

/* —— Panel / Cal / Redes —— */
.hq-pane {
  grid-area: hq;
  display: none;
  flex-direction: column;
  overflow: auto;
  padding: 28px 32px 56px;
  background:
    radial-gradient(ellipse 80% 45% at 100% 0%, rgba(225, 6, 0, 0.18), transparent 55%),
    linear-gradient(#0b0b0d, var(--bg));
}
.hq-head { margin-bottom: 22px; }
.hq-pane.crm-pane-root > .hq-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.crm-kpis-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
  min-width: min(420px, 100%);
}
.crm-cobro {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--mute);
  max-width: 52ch;
  line-height: 1.4;
}
.crm-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.crm-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 8px;
}
.crm-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.crm-sec-head h3 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.crm-sec-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--mute);
  max-width: 48ch;
}
.crm-tabs, .crm-tab, .crm-top, .crm-actions { display: none !important; }
.hq-head h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 32px;
  margin: 0;
}
.hq-empty { color: var(--mute); font-family: var(--mono); }

/* —— Panel: decisión del día (no KPIs vanidosos) —— */
.hq-pane.panel-bento {
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(225, 6, 0, 0.14), transparent 55%),
    linear-gradient(#0b0b0d, var(--bg));
  padding: 28px 28px 48px;
}
.bento-hq {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  max-width: 920px;
  width: 100%;
}

/* —— CRM dashboard (card grid) —— */
.hq-pane.crm-pane-root {
  padding: 22px 26px 64px;
  background:
    radial-gradient(ellipse 55% 40% at 8% 0%, rgba(225, 6, 0, 0.12), transparent 55%),
    linear-gradient(#0a0a0c, var(--bg));
}
.hq-pane.crm-pane-root > .hq-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  width: 100%;
}
.hq-pane.crm-pane-root > .hq-head .kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.hq-pane.crm-pane-root > .hq-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 36px);
  letter-spacing: -0.035em;
}
.crm-head-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.px-btn.sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.crm-body { width: 100%; max-width: none; }

.crm-pane.fx {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fx-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.fx-mid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 14px;
}
.fx-card {
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  min-width: 0;
}
.fx-card.fx-hero {
  background:
    linear-gradient(145deg, rgba(225, 6, 0, 0.92) 0%, #9a0400 55%, #5c0200 100%);
  border-color: transparent;
  box-shadow: 0 14px 40px rgba(225, 6, 0, 0.28);
}
.fx-card.fx-hero .fx-k,
.fx-card.fx-hero .fx-s,
.fx-card.fx-hero .fx-n small { color: rgba(255, 255, 255, 0.78); }
.fx-card.fx-hero .fx-n { color: #fff; }
.fx-card.fx-hero .fx-link { color: #fff; }
.fx-card.fx-hero .fx-link:hover { opacity: 0.85; }

.fx-k {
  margin: 0;
  font-size: 12px;
  color: var(--mute);
  font-weight: 600;
}
.fx-n {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 2.8vw, 32px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.fx-n small {
  font-size: 0.42em;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0;
}
.fx-s {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--mute);
  line-height: 1.35;
}
.fx-link {
  margin-top: 14px;
  border: 0;
  background: none;
  padding: 0;
  color: rgba(245, 245, 247, 0.72);
  font-size: 12px;
  font-family: var(--ui);
  font-weight: 600;
  cursor: pointer;
}
.fx-link:hover { color: var(--ink); }

.fx-card-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.fx-card-h h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.025em;
}
.fx-card-h p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--mute);
}
.fx-empty {
  margin: 12px 0;
  color: var(--mute);
  font-size: 13px;
}

.fx-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.fx-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 12px 12px 10px;
}
.fx-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-flag {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(225, 6, 0, 0.16);
  color: #ffc9c9;
  font-size: 12px;
  font-weight: 800;
}
.fx-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mute);
}
.fx-chip.on {
  background: rgba(61, 214, 140, 0.14);
  color: #8ef0bc;
}
.fx-tile-k {
  margin: 0;
  font-size: 12px;
  color: var(--mute);
}
.fx-tile-n {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.fx-tile-s {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--mute);
}
.fx-add {
  margin-top: 12px;
  width: 100%;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--mute);
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  font-family: var(--ui);
  font-weight: 600;
  cursor: pointer;
}
.fx-add:hover {
  color: var(--ink);
  border-color: rgba(225, 6, 0, 0.45);
  background: rgba(225, 6, 0, 0.06);
}

.fx-cash-total {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.035em;
}
.fx-cash-total small {
  font-size: 0.42em;
  color: var(--mute);
  font-weight: 600;
}
.fx-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 170px;
  padding-top: 8px;
}
.fx-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.fx-bar i {
  display: block;
  width: 100%;
  max-width: 36px;
  border-radius: 10px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.fx-bar.hot i {
  background: linear-gradient(180deg, #ff4d45, var(--red));
  box-shadow: 0 0 22px rgba(225, 6, 0, 0.45);
}
.fx-bar b {
  font-size: 10px;
  font-weight: 600;
  color: var(--mute);
}
.fx-tip {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translate(-50%, -100%);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms var(--ease);
}
.fx-bar.hot .fx-tip,
.fx-bar:hover .fx-tip { opacity: 1; }

.fx-card .crm-table-wrap,
.fx-card .crm-table-wrap.flat {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.crm-table-wrap,
.crm-table-wrap.flat {
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 4px 8px;
  margin: 0;
  overflow-x: auto;
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.crm-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 10px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}
.crm-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table tr[data-kind] { cursor: pointer; }
.crm-table tr[data-kind]:hover td { background: rgba(255, 255, 255, 0.03); }
.crm-table .warn { color: #ffc9c9; }
.crm-table .mute { color: var(--mute); text-align: center; }
.crm-act { display: flex; align-items: center; gap: 10px; }
.crm-act-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(225, 6, 0, 0.14);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.crm-act strong { display: block; font-size: 13px; }
.crm-act em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.crm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: capitalize;
  color: rgba(245, 245, 247, 0.8);
}
.crm-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.crm-status.ok i { background: #3dd68c; }
.crm-status.mid i { background: #f5c542; }
.crm-status.wait i { background: #7aa2ff; }
.crm-status.bad i { background: #ff5c5c; }

.crm-debt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-debt-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
}
.crm-debt-item:hover { border-color: rgba(225, 6, 0, 0.4); }
.crm-debt-item strong { display: block; font-size: 13px; }
.crm-debt-item span {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin-top: 2px;
}
.crm-debt-right { text-align: right; }
.crm-debt-right b { display: block; font-size: 13px; }
.crm-debt-right em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.crm-empty.soft {
  margin: 8px 0;
  color: var(--mute);
  font-size: 13px;
}

.fx-card .crm-board {
  margin: 0 -4px;
  padding-bottom: 4px;
}
.crm-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(148px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.crm-col {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  min-width: 148px;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.crm-col.drag-over {
  border-color: rgba(225, 6, 0, 0.65);
  background: rgba(225, 6, 0, 0.07);
}
.crm-col header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.crm-col h3 { margin: 0; font-size: 13px; font-weight: 700; }
.crm-col header span { font-size: 11px; color: var(--mute); }
.crm-col-body {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  min-height: 100px;
}
.crm-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #161618;
  border-radius: 11px;
  padding: 10px;
  color: var(--ink);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--ui);
  touch-action: none;
  user-select: none;
}
.crm-card:active { cursor: grabbing; }
.crm-card.dragging { opacity: 0.35; }
.crm-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-9999px, -9999px);
}
body.crm-dragging { cursor: grabbing; }
.crm-card strong { font-size: 13px; font-weight: 700; }
.crm-handle,
.crm-dolor,
.crm-card time {
  font-size: 11px;
  color: var(--mute);
  line-height: 1.35;
}
.crm-add-col {
  margin: 0 8px 8px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  padding: 6px 4px;
}
.crm-add-col:hover { color: var(--ink); }
.crm-empty { margin: 8px; color: var(--mute); font-size: 12px; }

.crm-dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: #121214;
  color: var(--ink);
  width: min(420px, 94vw);
}
.crm-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.crm-form { display: grid; gap: 10px; padding: 20px; }
.crm-form h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.crm-form label { display: grid; gap: 6px; font-size: 12px; color: var(--mute); }
.crm-form input,
.crm-form select,
.crm-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 10px 12px;
  font-family: var(--ui);
  font-size: 14px;
}
.crm-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.px-btn.danger { color: #ffb4b4; border-color: rgba(255, 77, 77, 0.45); }
.px-link {
  border: 0;
  background: none;
  color: var(--mute);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: var(--mono);
}
.px-link:hover { color: var(--ink); }

@media (max-width: 980px) {
  .fx-overview { grid-template-columns: 1fr; }
  .fx-mid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hq-pane.crm-pane-root { padding: 16px 14px 48px; }
  .fx-tiles { grid-template-columns: 1fr; }
}


.px-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.px-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.px-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1.05;
}
.px-date {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--mute);
  max-width: 42ch;
  line-height: 1.4;
}
.px-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.px-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--ui);
  cursor: pointer;
  background: var(--red);
  color: #fff;
  letter-spacing: -0.01em;
}
.px-btn.ghost {
  background: var(--glass-fill);
  color: var(--ink);
  border: 1px solid var(--line);
}
.px-card {
  background: var(--glass-fill);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.px-card.hoy {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(225, 6, 0, 0.12), transparent 55%),
    var(--glass-fill);
}
.px-card.warn { box-shadow: inset 0 0 0 1px rgba(255, 77, 77, 0.4); }
.px-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.px-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
.px-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(245, 245, 247, 0.82);
}
.px-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.px-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  color: var(--ink);
}
.px-chip b {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
}
.px-next {
  display: grid;
  gap: 12px;
  margin: 0;
}
.px-next div {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.px-next div:last-child { border-bottom: 0; padding-bottom: 0; }
.px-next strong {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.px-next span { font-size: 13px; color: var(--mute); }
.px-list, .px-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.px-list li {
  font-size: 14px;
  color: rgba(245,245,247,0.82);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}
.px-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.px-list li.agent b {
  display: block;
  font-size: 12px;
  color: var(--mute);
  font-weight: 600;
  margin-bottom: 2px;
}
.px-recent li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.px-recent li:last-child { border-bottom: 0; padding-bottom: 0; }
.px-recent b { color: var(--ink); font-weight: 700; }
.px-recent span { color: var(--mute); }
.px-recent li.mute { border: 0; color: var(--mute); }
.px-empty { margin: 0; color: var(--mute); font-size: 14px; }

@media (max-width: 820px) {
  .bento-hq { grid-template-columns: 1fr; }
}

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  padding: 18px 18px 16px;
  border-radius: 18px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi.span-2 { grid-column: span 2; }
.kpi.hot { box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 0 28px rgba(225,6,0,0.12); }
.kpi.bad { box-shadow: inset 0 0 0 1px var(--danger); }
.kpi-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}
.kpi-n {
  font-family: var(--display);
  font-weight: 600;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
}
.kpi-n.sm { font-size: 26px; letter-spacing: -0.02em; }
.kpi-sub {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
}
.state-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 68px;
  margin: 4px 0;
}
.state-bars .bar {
  display: block;
  width: 18px;
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.22);
}
.state-bars .bar.hot { background: var(--red); }
.state-bars .bar.wait { background: rgba(245, 245, 247, 0.45); }
.state-bars .bar.bad { background: var(--danger); }
.warn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.warn-chips span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 77, 77, 0.45);
  color: #ffd0d0;
  background: rgba(255, 77, 77, 0.08);
}
.week-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.dot-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 52px;
  padding: 8px 8px 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.dot-day b { font-family: var(--mono); font-size: 11px; }
.dot-day i { font-style: normal; font-size: 10px; color: var(--mute); }
.dot-day.first { border-color: var(--red); color: #fff; }

.cal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.cal-intro {
  grid-column: 1 / -1;
  margin: -6px 0 4px;
  font-size: 15px;
  color: var(--mute);
  max-width: 62ch;
  line-height: 1.45;
}
.cal-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}
.cal-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(245,245,247,0.72);
}
.cal-months { display: grid; gap: 16px; }
.cal-month { padding: 16px 16px 18px; border-radius: 18px; }
.cal-month h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-size: 22px;
}
.cal-dow, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-dow span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: center;
  padding-bottom: 4px;
}
.cal-cell {
  min-height: 58px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}
.cal-cell.pad { background: transparent; }
.cal-cell b { display: block; font-size: 13px; font-weight: 600; }
.cal-cell.has { border-color: var(--line); }
.cal-cell.today {
  box-shadow: inset 0 0 0 1px #fff;
}
.cal-cell.first-post {
  background: rgba(225, 6, 0, 0.18);
  border-color: var(--red);
}
.cal-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.mark-kind {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.kind-sube, .mark-kind.kind-sube { background: var(--red); }
.kind-youtube, .mark-kind.kind-youtube { background: var(--red); box-shadow: 0 0 8px var(--red); }
.kind-grabar, .mark-kind.kind-grabar { background: #fff; }
.kind-editar, .mark-kind.kind-editar { background: rgba(245, 245, 247, 0.4); }
.kind-story, .mark-kind.kind-story { background: transparent; box-shadow: inset 0 0 0 1px #fff; }
.kind-setup, .mark-kind.kind-setup { background: rgba(255, 255, 255, 0.22); }
.cal-side { display: flex; flex-direction: column; gap: 14px; }
.cal-week, .cal-rules { padding: 16px; border-radius: 18px; }
.cal-week ol, .cal-rules ul { list-style: none; margin: 8px 0 0; padding: 0; }
.cal-week li, .cal-rules li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}
.cal-week li:last-child, .cal-rules li:last-child { border-bottom: 0; }
.cal-week time {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  margin-bottom: 2px;
}
.cal-week .cal-kind {
  display: inline-block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--red);
  margin-right: 6px;
}
.cal-week .cal-title { color: rgba(245,245,247,0.85); }

.redes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.red-card { padding: 22px 20px; border-radius: 18px; min-height: 200px; }
.red-card-wide { grid-column: 1 / -1; min-height: 0; }
.red-state {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 8px 0 12px;
}
.red-how { color: var(--mute); font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
.red-tasks {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
}
.red-bars { margin-top: 14px; display: grid; gap: 8px; }
.red-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.red-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mute);
}
.red-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.red-bar-track i {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 99px;
}
.red-bar-n { font-family: var(--mono); font-size: 10px; color: var(--mute); }
.red-next {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.5;
}
.red-later {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 8px 0 0;
}

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-hq { grid-template-columns: 1fr 1fr; }
  .px-card.span-2 { grid-column: span 2; }
  .kpi.span-2 { grid-column: span 2; }
  .cal-body { grid-template-columns: 1fr; }
  .redes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
    grid-template-areas:
      "top"
      "sidenav"
      "stage";
  }
  .side-nav {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    gap: 6px;
  }
  .side-brand { display: none; }
  .side-item {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 12px;
    letter-spacing: 0.08em;
  }
  .rail, .ctx {
    display: none;
    position: fixed;
    top: 56px; bottom: 0;
    width: min(86vw, 360px);
    z-index: 10;
  }
  .rail.open, .ctx.open { display: block; }
  .icon { display: grid; place-items: center; }
  .app.floor-on,
  .app.hq-on {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
    grid-template-areas:
      "top"
      "sidenav"
      "floor";
  }
  .app.hq-on {
    grid-template-areas:
      "top"
      "sidenav"
      "hq";
  }
  .app.floor-on .agent-drawer:not(.hidden) {
    display: flex;
    position: fixed;
    top: 56px; right: 0; bottom: 0;
    width: min(92vw, 360px);
    z-index: 12;
    border-left: 1px solid var(--line);
  }
  #live-pulse { display: none; }
  .messages { padding: 22px 16px; }
  .composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .bubble .body { font-size: 16.5px; }
  .prose h1 { font-size: 1.35em; }
  .floor { padding: 12px 8px 28px; }
  .floor-head h2, .hq-head h2 { font-size: 26px; }
  .hq-pane { padding: 18px 14px 40px; }
  .iso-stage { min-height: 420px; padding: 8px 4px 96px; }
  .iso-hoy { width: min(200px, 52vw); font-size: 11px; right: 6px; bottom: 6px; }
  .iso-pepita { width: min(240px, 56vw); font-size: 11px; left: 6px; bottom: 6px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento-hq { grid-template-columns: 1fr; }
  .px-card.span-2 { grid-column: span 1; }
}

@media (max-width: 390px) {
  .iso-hoy { display: none; }
  .gate h1 { font-size: 38px; }
  .stat-pill { min-width: calc(50% - 6px); }
  .bento { grid-template-columns: 1fr; }
  .kpi.span-2 { grid-column: span 1; }
  .kpi.span-2 { grid-column: span 1; }
  .kpi-n { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
