:root {
  --bg: #F4F8FB;
  --text: #303030;
  --text-2: #5A5859;
  --border: #DCE3E9;
  --brand: #C10230;
  --brand-dark: #303030;
  --accent: #9B0505;
  --accent-hover: #9B0505;
  --brand-tint: #FBE6EB;
  --brand-soft: #FDF3F5;
  --line-strong: #CCCBCC;
  --on-dark-2: #F3DDE2;
  --warn-bg: #FFF1D6;
  --warn-text: #6B4300;
  --danger: #B3123F;
  --card: #FFFFFF;
  --radius: 14px;
  --side-w: 232px;
  --gutter: 32px;
  --font-brand: "Kumbh Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .logo, .price strong {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  line-height: 1.15;
  margin: 0;
}

.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* Botones */
.btn {
  font: 600 15px Inter, system-ui, sans-serif;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .pick:focus-visible, .toggle button:focus-visible, .room-card:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-amber { background: var(--brand); color: #fff; width: 100%; padding: 13px 18px; }
.btn-amber:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #fff; border-color: var(--line-strong); }
.btn:disabled { opacity: .4; cursor: default; }

/* Encabezado */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; padding: 0 var(--gutter); }
.logo { white-space: nowrap; font-weight: 700; font-size: 18px; color: var(--brand-dark); text-decoration: none; letter-spacing: .02em; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--brand); }

/* Cabecera de propiedad */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 40px 0 28px; }
.tag { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 700; max-width: 16ch; letter-spacing: -.02em; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.facts li { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--text-2); }
.facts b { color: var(--text); font-weight: 600; }
.price { text-align: right; flex-shrink: 0; }
.price span { display: block; font-size: 13px; color: var(--text-2); }
.price strong { font-size: 30px; font-weight: 700; color: var(--brand-dark); }

/* Visor y panel */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  font: 500 14px Inter, system-ui, sans-serif;
  background: var(--card); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { border-color: var(--brand); color: var(--text); }
.tab[aria-selected="true"] { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.frame { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #ECE8F6; }
.image, .image svg { width: 100%; height: 100%; display: block; }
.image { animation: fade .3s ease; }
@keyframes fade { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .image { animation: none; } }

.badge {
  position: absolute; top: 14px; left: 14px;
  background: rgba(48, 48, 48, .88); color: #fff;
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.toggle {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 4px;
  box-shadow: 0 4px 16px rgba(26, 20, 51, .18); white-space: nowrap;
}
.toggle button {
  font: 600 14px Inter, system-ui, sans-serif; color: var(--text-2);
  border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.toggle button:disabled { opacity: .45; cursor: default; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--text-2); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.panel h2 span { color: var(--brand); }
.card-list { display: grid; gap: 10px; }
.pick {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  text-align: left; width: 100%;
  background: var(--bg); border: 2px solid transparent; border-radius: 12px;
  padding: 12px; cursor: pointer; font-family: inherit; color: inherit;
}
.pick:hover { border-color: var(--border); background: #fff; }
.pick[aria-pressed="true"] { border-color: var(--brand); background: #fff; }
.pick strong { display: block; font-size: 15px; }
.pick small { color: var(--text-2); font-size: 13px; }
.check-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; color: transparent; }
.pick[aria-pressed="true"] .check-mark { background: var(--brand); border-color: var(--brand); color: #fff; }

.cta { margin-top: 18px; background: var(--brand-dark); color: #fff; border-radius: 12px; padding: 18px; }
.cta-title { margin: 0 0 4px; font: 600 17px "Space Grotesk", Inter, sans-serif; }
.cta-text { margin: 0 0 14px; font-size: 14px; color: var(--on-dark-2); }
.cta-agent { margin: 12px 0 0; font-size: 13px; color: var(--on-dark-2); text-align: center; }

/* Resumen */
.summary { padding: 56px 0 64px; }
.summary h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -.01em; }
.summary-sub { color: var(--text-2); margin: 8px 0 22px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.room-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; padding: 0; text-align: left; font-family: inherit; color: inherit;
}
.room-card:hover { border-color: var(--brand); }
.room-card .thumb { aspect-ratio: 16 / 10; }
.room-card .thumb svg { width: 100%; height: 100%; display: block; }
.room-card .info { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.room-card strong { font-size: 15px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); white-space: nowrap; }
.pill.none { background: var(--bg); color: var(--text-2); }

/* Pie */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; }
.site-footer p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 70ch; }

/* Diálogo */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(440px, calc(100vw - 32px)); color: var(--text); box-shadow: 0 24px 64px rgba(26, 20, 51, .3); }
dialog::backdrop { background: rgba(48, 48, 48, .6); }
dialog form, .sent { padding: 24px; display: grid; gap: 14px; }
dialog h3 { font-size: 20px; }
dialog label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
dialog input:not([type="checkbox"]), dialog textarea {
  font: 400 15px Inter, system-ui, sans-serif; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff; width: 100%;
}
dialog input:focus, dialog textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
dialog label.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.dialog-summary { list-style: none; margin: 0; padding: 12px 14px; background: var(--bg); border-radius: 10px; font-size: 14px; display: grid; gap: 4px; }
.dialog-summary li { display: flex; justify-content: space-between; gap: 12px; }
.dialog-summary span { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sent p { margin: 0; color: var(--text-2); }
.demo-note { font-size: 13px; background: var(--warn-bg); color: var(--warn-text) !important; padding: 10px 12px; border-radius: 10px; }
[hidden] { display: none !important; }

/* Celular */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .header-row { justify-content: space-between; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 28px; }
  .price { text-align: left; }
}
@media (max-width: 560px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .grid { grid-template-columns: 1fr; }
  .pager span { display: none; }
  .pager .btn { padding: 9px 12px; font-size: 13px; }
  .toggle button { padding: 8px 12px; font-size: 13px; }
}

/* ---------- Portal del vendedor ---------- */

.project-chip { font-size: 13px; font-weight: 600; color: var(--brand); border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

.page-head { padding: 36px 0 22px; }
.page-head h1 { max-width: none; font-size: clamp(28px, 4vw, 42px); }
.lead { color: var(--text-2); max-width: 62ch; margin: 12px 0 0; }
.typ-tabs { margin: 20px 0 0; }
.typ-tabs .tab { font-weight: 600; padding: 10px 16px; }

/* Agregar tipología */
.typ-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.typ-toolbar .banner-ok { margin: 0; }
#typ-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.td-help { font-weight: 400; color: var(--text-2); }
.td-columns { font-size: 14px; color: var(--text-2); }
.td-columns summary { cursor: pointer; font-weight: 600; color: var(--text); }
.td-columns ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; }
.td-columns p { margin: 0; }
.td-error { white-space: pre-line; }
.banner-ok { margin: 18px 0; padding: 12px 16px; border-radius: 10px; background: #E4F3EB; color: #14532D; font-size: 15px; }

.typ-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.typ-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.typ-card h2 { font-size: 24px; font-weight: 700; }
.typ-card .facts { margin-top: 10px; }
.typ-card .facts li { background: var(--bg); }
.note { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.status-ok { flex-shrink: 0; font-size: 13px; font-weight: 600; color: #14663D; background: #E4F3EB; border-radius: 999px; padding: 6px 12px; }
.typ-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.plans { display: grid; gap: 12px; }
.plans-2 { grid-template-columns: 1fr 1fr; }
.plans figure { margin: 0; background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; }
.plans img { width: 100%; max-height: 340px; object-fit: contain; display: block; }
.plans figcaption { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.rooms-table table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.rooms-table th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px 0; border-bottom: 1px solid var(--border); }
.rooms-table td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--border); }
.rooms-table td:nth-child(n+2), .rooms-table th:nth-child(n+2) { text-align: right; white-space: nowrap; padding-right: 0; padding-left: 8px; }
.rooms-table small { color: var(--text-2); margin-left: 4px; }
.rooms-table .btn { display: inline-block; text-decoration: none; }

/* Visualización */
.badge-right { left: auto; right: 14px; background: rgba(255, 255, 255, .92); color: var(--text); }

.panel h2 { margin-top: 18px; }
.panel > h2:first-child, #use-block h2 { margin-top: 0; }
#use-block { margin-bottom: 4px; }
.pick { grid-template-columns: 1fr auto; }
.plan-mini { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.plan-mini p { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.plan-mini img { width: 100%; max-height: 220px; object-fit: contain; display: block; background: var(--bg); border-radius: 10px; padding: 10px; }

.summary-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.summary-head .summary-sub { margin-bottom: 0; }
.summary-head .btn-amber { width: auto; flex-shrink: 0; }
.room-card .info small { display: block; color: var(--text-2); font-size: 13px; }

@media (max-width: 900px) {
  .typ-body { grid-template-columns: 1fr; }
  .project-chip { display: none; }
  .summary-head { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
  .typ-card { padding: 16px; }
  .typ-card header { flex-direction: column; }
  .badge { font-size: 11px; padding: 5px 9px; top: 10px; left: 10px; }
  .badge-right { top: auto; bottom: 10px; right: auto; left: 10px; }
}

/* ---------- Login ---------- */

.login {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.login-brand {
  position: relative; overflow: hidden; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding-block: 40px;
  padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: 40px;
}
.login-logo { font: 700 30px "Space Grotesk", Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.login-copy { position: relative; z-index: 1; max-width: 30ch; }
.login-brand h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em; max-width: 14ch; }
.login-brand p { margin: 14px 0 0; color: var(--on-dark-2); font-size: 17px; }
.login-plan { position: absolute; right: -50px; top: 70px; width: min(80%, 480px); opacity: .22; pointer-events: none; }
.login-plan * { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.login-brand .login-logo, .login-copy { position: relative; z-index: 1; }

.login-panel {
  display: grid; place-items: center; background: var(--bg);
  padding-block: 40px;
  padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px));
}
#login-form { width: min(380px, 100%); display: grid; gap: 16px; }
#login-form h2 { font-size: 26px; font-weight: 700; }
#login-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
#login-form input {
  font: 400 16px Inter, system-ui, sans-serif; padding: 12px 14px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: #fff;
}
#login-form input:focus { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
#login-form .btn { width: 100%; padding: 13px 18px; font-size: 16px; }
.login-error { margin: 0; font-size: 14px; color: var(--danger); background: #FDECF1; border-radius: 10px; padding: 10px 12px; }
.login-note { margin: 0; font-size: 13px; color: var(--text-2); text-align: center; }

.user-chip { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .btn { padding: 7px 14px; font-size: 14px; }

@media (max-width: 800px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding-block: 28px 36px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; min-height: 230px; }
  .login-plan { width: 240px; right: -30px; top: 24px; }
  .login-panel { align-items: start; padding-block: 28px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .user-chip { display: none; }
}

@media (max-width: 560px) {
  .header-row { gap: 8px; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { padding: 6px 12px; }
}


/* ---------- Chat del agente ---------- */






@media (max-width: 800px) {
}
@media (max-width: 560px) {
}

/* ---------- Publicación por ambiente ---------- */

#pub-count { font-weight: 600; color: var(--brand); }
#pub-count.warn { color: var(--danger); }
.link-btn { font: 600 13px Inter, system-ui, sans-serif; color: var(--brand); background: none; border: 0; padding: 4px 2px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--brand-dark); }
.link-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }



.room-card .info small.publine { color: var(--brand); font-weight: 600; margin-top: 2px; }
.room-card .info small.publine.warn { color: var(--danger); }

/* ---------- Barra de publicación ---------- */

.pubbar {
  position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 9;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(26, 20, 51, .06);
}
.pubbar-main { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; min-width: 0; flex: 1 1 320px; }
.pubbar-meta { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.pubbar-where { font-size: 12px; color: var(--text-2); }
.pubbar .btn { width: auto; padding: 10px 18px; font-size: 15px; flex-shrink: 0; }
.pubbar .btn:disabled { background: var(--brand-tint); color: var(--text-2); opacity: 1; }

.state { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.state-none { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.state-ok { background: #E4F3EB; color: #14663D; }
.state-pending { background: var(--warn-bg); color: var(--warn-text); }

.pd-warn { margin: 0; font-size: 14px; color: var(--warn-text) !important; background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; }
.pd-note { margin: 0; font-size: 13px; }

@media (max-width: 560px) {
  .pubbar { padding: 12px; }
  .pubbar .btn { width: 100%; }
}

.pubbar-main .link-btn { font-size: 12px; }
.room-card .info small.publine { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 900px) {
  .pubbar { position: static; }
}

/* ---------- Panel de clientes (agente) ---------- */

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.banner-demo { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; max-width: 78ch; }
.cli-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.cli-block h2 { font-size: 22px; font-weight: 700; }
.cli-block h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.cli-hint { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }

.stock-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stock-chip { display: flex; align-items: center; gap: 12px; text-align: left; font-family: inherit; color: var(--text); background: var(--bg); border: 2px solid transparent; border-radius: 12px; padding: 10px 16px 10px 12px; cursor: pointer; }
.stock-chip:hover { border-color: var(--line-strong); }
.stock-chip strong { display: block; font-size: 15px; }
.stock-chip small { color: var(--text-2); font-size: 13px; }
.stock-chip .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.stock-chip .dot.ok { background: #1E7A4B; }
.stock-chip .dot.off { background: var(--line-strong); }
.stock-chip[aria-pressed="false"] { background: #fff; border: 2px dashed var(--line-strong); }
.stock-chip:focus-visible, .cli-row .btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.kpis div { background: var(--bg); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.kpis strong { font: 700 30px "Space Grotesk", Inter, system-ui, sans-serif; color: var(--brand); line-height: 1.1; }
.kpis span { font-size: 13px; color: var(--text-2); }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 28px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 14px; }
.bars .bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.tag-off { font-style: normal; font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--bg); border-radius: 999px; padding: 1px 7px; }
.kinds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kinds li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.kinds strong { color: var(--brand); }
.kinds small { color: var(--text-2); }

.cli-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.cli-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cli-tools input[type="search"] { font: 400 15px Inter, system-ui, sans-serif; padding: 10px 14px; width: min(340px, 100%); border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); }
.cli-tools input[type="search"]:focus { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
.cli-empty { margin: 8px 0; padding: 22px; text-align: center; color: var(--text-2); background: var(--bg); border-radius: 12px; }
.cli-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1.1fr) minmax(180px, 1.5fr) 110px auto; gap: 8px 18px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--border); }
.cli-row:first-child { border-top: 0; }
.cli-who strong, .cli-contact span, .cli-last span { display: block; overflow-wrap: anywhere; }
.cli-who small, .cli-last small, .cli-like small { display: block; color: var(--text-2); font-size: 12px; }
.cli-contact { font-size: 14px; }
.cli-like { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cli-like .chip { font-size: 13px; font-weight: 600; background: var(--brand-tint); color: var(--brand); border-radius: 999px; padding: 3px 10px; }
.cli-like .chip.off { background: var(--bg); color: var(--text-2); text-decoration: line-through; }
.cli-none { font-size: 13px; color: var(--text-2); }
.cli-act { display: grid; gap: 6px; justify-items: stretch; }
.cli-act .btn { padding: 8px 16px; font-size: 14px; white-space: nowrap; }
.cli-samples { margin: 14px 0 0; font-size: 13px; color: var(--text-2); }

/* Detalle de un cliente */
.cd { border: 0; padding: 0; margin: auto; width: min(860px, 100vw); max-height: min(920px, 100dvh); border-radius: 20px; overflow: hidden; background: #fff; color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .4); }
.cd::backdrop { background: rgba(48, 48, 48, .6); }
.cd-shell { display: flex; flex-direction: column; max-height: min(920px, 100dvh); }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.cd-head h2 { font-size: 28px; font-weight: 700; margin-top: 2px; }
.cd-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 28px; display: flex; flex-direction: column; gap: 4px; }
.cd-body > * { flex-shrink: 0; }
.cd-sec { padding: 16px 0; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.cd-sec:last-child { border-bottom: 0; }
.cd-sec h3 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 0; }
.cd-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: 15px; }
.cd-dl dt { color: var(--text-2); }
.cd-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cd-input { width: 100%; font: 500 14px Inter, system-ui, sans-serif; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--text); resize: vertical; }
.cd-input:focus { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
.cd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cd-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.cd-typ { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cd-typ > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); }
.cd-typ ul { list-style: none; margin: 0; padding: 8px 10px 10px; display: grid; gap: 6px; }
.cd-typ li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; }
.cd-typ li .t { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg); }
.cd-typ li .t svg { width: 100%; height: 100%; display: block; }
.cd-typ li strong { display: block; font-size: 15px; }
.cd-typ li small { color: var(--text-2); font-size: 13px; }
.cd-typ > .cli-hint { padding: 0 14px 12px; }
.pill-av { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.pill-av.ok { background: #E4F3EB; color: #14663D; }
.pill-av.off { background: var(--bg); color: var(--text-2); }
.cd-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.cd-log li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.cd-log time { color: var(--text-2); font-size: 13px; }
.cd-danger { justify-items: start; }

@media (max-width: 900px) {
  .cli-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cli-contact, .cli-like { grid-column: 1 / -1; }
  .cli-last { grid-column: 1; }
  .cli-act { grid-column: 2; grid-row: 1; }
  .cd { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .cd-shell { max-height: 100dvh; height: 100%; }
  .cd-log li { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 560px) {
  .cd-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cd-dl dt { margin-top: 10px; font-size: 13px; }
  .cd-dl dd { overflow-wrap: break-word; word-break: normal; }
}

/* Pantalla de arranque: se ve mientras se pide el catálogo a la API (js/main.js) */
.boot {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  color: var(--text-2);
  text-align: center;
}
.boot[hidden] { display: none; }
.boot[data-state="error"] p { color: var(--danger); }

/* Imágenes realistas de los ambientes */
.room-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-note { height: 100%; display: grid; place-content: center; gap: 6px; padding: 24px; text-align: center; color: var(--text-2); background: var(--bg); }
.image-note b { color: var(--text); font-size: 17px; }
.image-note-error b { color: var(--danger); }
.design-thumb { width: 64px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.design-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.design-empty { margin: 0; font-size: 14px; color: var(--text-2); }
.pick:has(.design-thumb) { grid-template-columns: auto 1fr auto; }
.render-status { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.render-status-ok { color: #14663D; }
.render-status-warn { color: var(--warn-text); }

/* Chat del asistente (Visualizar) */
.chat { margin-top: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; }
.chat[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.chat-head h2 { font-size: 22px; font-weight: 700; }
.chat-head p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; max-width: 60ch; }
.chat-room { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--bg); border-radius: 999px; padding: 5px 11px; }
.chat-log { display: grid; gap: 14px; align-content: start; max-height: 560px; overflow-y: auto; padding: 14px; background: var(--bg); border-radius: 12px; }
.msg { max-width: min(78ch, 100%); display: grid; gap: 4px; justify-items: start; }
.msg .who { font-size: 12px; font-weight: 600; color: var(--text-2); }
.msg p { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 15px; background: #fff; border: 1px solid var(--border); overflow-wrap: anywhere; }
.msg-agent { justify-self: end; justify-items: end; }
.msg-agent p { background: var(--brand); border-color: var(--brand); color: #fff; }
.typing { color: var(--text-2); font-style: italic; }
.chat-img { position: relative; display: block; width: min(440px, 100%); aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); cursor: zoom-in; }
.chat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-img:focus-visible, #chat-input:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; font: 600 12px Inter, system-ui, sans-serif; color: #fff; background: rgba(26, 20, 51, .72); border-radius: 999px; padding: 4px 10px; }
.chat-img-wait { display: grid; place-content: center; cursor: default; color: var(--text-2); font-size: 14px; animation: chat-pulse 1.4s ease-in-out infinite; }
@keyframes chat-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .chat-img-wait { animation: none; } }
.chat-img-error { color: var(--danger) !important; background: #FDECF1 !important; border-color: #FDECF1 !important; }
.chat-added { font-size: 13px; font-weight: 600; color: #14663D; }
.chat-add { font-size: 14px; padding: 8px 14px; }
.chat-form { display: grid; gap: 12px; }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: stretch; }
.chat-field, .chat-side { display: grid; gap: 6px; align-content: start; }
.chat-side { align-content: end; }
.chat-form label { font-size: 14px; font-weight: 500; }
#chat-input { font: 400 15px Inter, system-ui, sans-serif; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical; min-height: 92px; }
#chat-input:disabled { background: var(--bg); }
.chat-side .btn { width: 100%; }
@media (max-width: 700px) {
  .chat { padding: 16px; }
  .chat-compose { grid-template-columns: 1fr; }
  .chat-head { flex-direction: column; }
  .chat-log { max-height: 480px; }
}
.lightbox { width: min(1100px, 96vw); max-height: 96dvh; padding: 12px; background: #15121f; color: #fff; }
.lightbox[open] { display: grid; gap: 10px; justify-items: end; }
.lightbox img { width: 100%; height: auto; max-height: 78dvh; object-fit: contain; display: block; border-radius: 8px; }
.lightbox p { margin: 0; width: 100%; font-size: 14px; color: #D9D6E3; }
.cd-typ li .t img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* --- Proyectos (pantalla inicial) y marca --- */
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.logo img { display: block; max-height: 36px; width: auto; }
.login-logo img { display: block; max-height: 48px; width: auto; background: #fff; padding: 6px 10px; border-radius: 8px; }

.pj-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.pj-facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: 760px; }
.pj-card, .pj-brand-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; align-content: start; }
.pj-brand-card { margin: 20px 0 48px; }
.pj-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pj-card-head h2 { font-size: 26px; }
.pj-status { font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; padding: 4px 12px; }
.pj-addr, .pj-line { margin: 0; color: var(--text-2); }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 4px 0; }
.pj-facts div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.pj-facts dt { font-size: 12px; color: var(--text-2); }
.pj-facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pj-chips li { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--brand-dark); }
.pj-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.pj-actions:empty { display: none; }
.pj-logo { max-height: 44px; width: auto; max-width: 160px; object-fit: contain; }
.pj-swatches, .br-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.pj-swatches li, .br-swatches li { display: grid; grid-template-columns: 32px 1fr; align-items: center; column-gap: 10px; font-size: 13px; }
.pj-swatches span, .br-swatches span { grid-row: span 2; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); }
.pj-swatches code, .br-swatches code { color: var(--text-2); }
.pj-note { margin: 12px 0; color: var(--text-2); font-size: 15px; }
.pj-alert { margin: 12px 0; padding: 12px 16px; border-radius: 10px; background: #FBE6EB; color: var(--danger); font-size: 15px; white-space: pre-line; }
.pj-alert--warn { background: var(--warn-bg); color: var(--warn-text); }

.pj-form { display: grid; gap: 20px; padding-bottom: 56px; max-width: 860px; }
.pj-form fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px 24px; margin: 0; }
.pj-form legend { font-weight: 600; padding: 0 8px; }
.pj-hint { font-weight: 400; font-size: 13px; color: var(--text-2); margin-left: 6px; }
.pj-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; align-content: start; }
.pj-form label.wide, .pj-form .wide, .br-logo, .br-preview, #br-contrast { grid-column: 1 / -1; }
.pj-form label.check { display: flex; align-items: center; gap: 10px; }
.pj-form input:not([type="checkbox"]):not([type="color"]), .pj-form select, .pj-form textarea { font: 400 16px Inter, system-ui, sans-serif; padding: 10px 12px; width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--text); }
.pj-form input:focus-visible, .pj-form select:focus-visible, .pj-form textarea:focus-visible { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
.pj-checks-box { display: grid; gap: 8px; }
.pj-checks-label { margin: 0; font-size: 14px; font-weight: 500; }
.pj-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.pj-form .pj-checks label.check { font-weight: 400; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.pj-form .pj-checks label.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pj-form .pj-checks input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.br-color { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.br-color-row { display: flex; gap: 10px; align-items: center; }
.br-color-row input[type="color"] { width: 48px; height: 42px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
.br-color-row input[type="text"], .br-color-row input:not([type]) { flex: 1; min-width: 0; }
.br-preview { display: grid; gap: 14px; background: var(--bg); border-radius: 12px; padding: 16px; font-family: var(--font-brand); }
.br-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; background: #fff; border-radius: 10px; }
.br-sample-logo { font-weight: 700; font-size: 22px; color: var(--brand-dark); }
.br-sample-btn { font: 700 15px var(--font-brand); color: #fff; background: var(--brand); border: 0; border-radius: 999px; padding: 10px 20px; }
.br-sample-chip { font-size: 14px; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 999px; padding: 4px 12px; }
.br-sample-text { color: var(--brand-dark); }
.br-logo-label { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.br-logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.br-logo-box { display: grid; place-items: center; min-width: 160px; min-height: 64px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--text-2); font-size: 14px; background: #fff; }
.br-logo-box img { max-height: 56px; max-width: 220px; object-fit: contain; }
.br-logo-pick { cursor: pointer; }
.br-logo-pick:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }

@media (max-width: 600px) {
  .pj-card, .pj-brand-card { padding: 18px; }
  .pj-form fieldset { padding: 16px; }
  .pj-actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}


/* --- Estructura del portal: barra lateral izquierda y contenido a todo el ancho --- */
#app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
#app[hidden] { display: none; }
.app-body { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.app-body .view { flex: 1 0 auto; width: 100%; }
.app-body .wrap { max-width: none; padding-left: var(--gutter); padding-right: var(--gutter); }

.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; }
.side-logo { display: block; padding: 4px 12px; }
.side-nav { display: grid; gap: 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: var(--text-2); font-size: 15px; font-weight: 600; }
.side-nav a svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover { background: var(--brand-tint); color: var(--brand); }
.side-nav a.active { background: var(--brand-dark); color: #fff; }
.side-nav a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.app-body .site-footer .wrap { max-width: none; }
.pj-form { max-width: 1100px; }

/* Pantallas medianas: la barra se reduce a íconos */
@media (max-width: 1000px) {
  :root { --side-w: 76px; --gutter: 24px; }
  .side { padding: 18px 10px; align-items: center; }
  .side-logo { padding: 0; max-width: 56px; overflow: hidden; font-size: 15px; text-align: center; }
  .side-logo img { max-width: 52px; }
  .side-nav a { justify-content: center; padding: 12px; }
  .side-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Celular: la barra pasa abajo, con ícono y nombre de cada apartado */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  #app { display: block; }
  .app-body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 0; border-right: 0; border-top: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(26, 20, 51, .08); overflow: visible; }
  .side-logo { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 4px; }
  .side-nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 12px; border-radius: 10px; }
  .side-nav a span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}


/* --- Qué opciones ve el cliente --- */
.design-hint { margin: -4px 0 10px; font-size: 13px; color: var(--text-2); }
.pick-row { display: grid; gap: 4px; }
.vis-toggle { display: flex; align-items: center; gap: 8px; padding: 0 6px 4px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.vis-toggle input { width: 16px; height: 16px; accent-color: var(--brand); }
.vis-toggle:has(input:checked) { color: var(--brand); }
.pubbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
dialog.vis { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.vis-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.vis-count { font-size: 14px; font-weight: 600; color: var(--brand); }
.vis-body { display: grid; gap: 18px; }
.vis-room { display: grid; gap: 10px; }
.vis-room header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.vis-room h4 { margin: 0; font-size: 16px; }
.vis-room-actions { display: flex; gap: 14px; }
.vis-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vis-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.vis-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.vis-thumb { grid-column: 1 / -1; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); }
.vis-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vis-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.vis-card input { width: 20px; height: 20px; accent-color: var(--brand); }
@media (max-width: 560px) {
  .pubbar-actions { width: 100%; }
  .pubbar-actions .btn { flex: 1 1 auto; }
  .vis-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Menú Clientes (desplegable) y secciones --- */
.side-group { display: grid; gap: 4px; }
.side-group > a { position: relative; }
.side-chev { width: 16px !important; height: 16px !important; margin-left: auto; transition: transform .15s; }
.side-group.open .side-chev { transform: rotate(180deg); }
.side-sub { display: none; gap: 2px; margin: 0 0 4px 22px; padding-left: 12px; border-left: 2px solid var(--border); }
.side-group.open .side-sub { display: grid; }
.side-sub a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.side-sub a:hover { background: var(--brand-tint); color: var(--brand); }
.side-sub a.active { color: var(--brand); background: var(--brand-soft); }
.side-sub a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.cli-tabs { display: none; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.cli-tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.cli-tabs a.active { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.cli-tabs a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-width: 1000px) {
  .side-sub, .side-chev { display: none !important; }
  .cli-tabs { display: flex; }
}

/* --- Análisis de clientes --- */
.an-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.period { display: flex; gap: 8px; }
.period .tab { margin: 0; }
.period .tab[aria-pressed="true"] { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.kpis small { font-size: 12px; color: var(--text-2); }
.an-two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 18px; }
.cli-block h3 { margin-top: 18px; }
.ch { display: block; width: 100%; height: auto; max-height: 280px; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-tick { fill: var(--text-2); font-size: 11px; }
.ch-val { fill: var(--text); font-size: 11px; font-weight: 600; }
.ch-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-s0 { stroke: var(--brand); fill: var(--brand); }
.ch-s1 { stroke: var(--brand-dark); fill: var(--brand-dark); }
.ch-line.ch-s0, .ch-line.ch-s1 { fill: none; }
.ch-bar, .ch-cell { fill: var(--brand); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--text-2); }
.ch-key { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ch-key.ch-s0 { background: var(--brand); }
.ch-key.ch-s1 { background: var(--brand-dark); }
.bars li.muted .bar i { background: var(--line-strong); }
.bars li.muted span { color: var(--text-2); }
.bars li { grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 34px; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel li { display: grid; gap: 4px; }
.funnel-bar { background: var(--brand); color: #fff; border-radius: 8px; padding: 6px 10px; min-width: 44px; }
.funnel-bar b { font-variant-numeric: tabular-nums; }
.funnel-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 14px; }
.funnel-text small { color: var(--text-2); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.recent li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.recent time { color: var(--text-2); font-size: 12px; padding-top: 2px; }
.fl-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; align-items: end; margin-top: 14px; }
.fl-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.fl-form .fl-wide { grid-column: span 2; }
.fl-form input, .fl-form select { font: 400 15px Inter, system-ui, sans-serif; padding: 9px 12px; width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--text); }
.fl-form input:focus-visible, .fl-form select:focus-visible { outline: 3px solid var(--brand-tint); border-color: var(--brand); }
.fl-count { font-weight: 700; color: var(--brand); font-size: 15px; }
.tbl-wrap { position: relative; overflow-x: auto; margin: 6px 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.tbl th button { font: inherit; text-transform: inherit; letter-spacing: inherit; color: var(--text-2); background: none; border: 0; padding: 0; cursor: pointer; }
.tbl th button:hover, .tbl th[aria-sort="ascending"] button, .tbl th[aria-sort="descending"] button { color: var(--brand); }
.tbl td small { display: block; color: var(--text-2); font-size: 12px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.cli-nodata { color: var(--warn-text) !important; }
@media (max-width: 640px) {
  .fl-form .fl-wide { grid-column: 1 / -1; }
  .recent li { grid-template-columns: 1fr; gap: 0; }
}
