/* ============================================================
   Minimi Dashboard — Design System
   Monocromatico + acento unico. Sin sombras. Sin iconos externos.
   ============================================================ */

/* === Tokens === */
:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --surface-2: #eeeeee;
  --border: #e0e0e0;
  --text: #0a0a0a;
  --text-2: #555555;
  --text-3: #999999;
  --accent: #0055ff;
  --accent-dim: #e8eeff;
  --danger: #cc2200;
  --danger-dim: #fff0ee;
  --success: #007a2b;
  --success-dim: #e8f5ed;
  --warning: #b06000;
  --warning-dim: #fff8e8;

  --r: 4px;
  --gap: 16px;
  --gap-sm: 8px;
  --gap-lg: 32px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", "Menlo", monospace;
  --fs: 14px;
  --fs-sm: 12px;
  --fs-lg: 20px;
  --fs-xl: 28px;

  --nav-w: 200px;
  --radius: var(--r);

  /* Aliases para compatibilidad con componentes */
  --card: var(--surface);          /* usado en templates inline — mapea a --surface */
  --muted: #999999;
  --bg-secondary: #f6f6f6;
  --text-primary: #0a0a0a;
  --text-muted: #999999;
  --accent-soft: #e8eeff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1e1e1e;
    --border: #2a2a2a;
    --text: #f0f0f0;
    --text-2: #999999;
    --text-3: #555555;
    --accent-dim: #0d1f40;
    --danger-dim: #2a0800;
    --success-dim: #001a0a;
    --warning-dim: #1f1200;

    --muted: #555555;
    --bg-secondary: #141414;
    --text-primary: #f0f0f0;
    --text-muted: #555555;
    --accent-soft: #0d1f40;
  }
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--fs); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.layout {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

/* === Nav lateral === */
.nav {
  background: #171717;
  color: #f0f0f0;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.nav-logo {
  display: block;
  padding: var(--gap-sm) 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo-img {
  width: 120px;
  display: block;
}

/* === Estado del clon — pill picker en nav (.ne) === */
.ne {
  position: relative;
  margin-bottom: 8px;
}

/* Pill (estado cerrado) */
.ne-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.ne-pill:hover { background: rgba(255,255,255,.11); color: #fff; }

.ne-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.ne-label { flex: 1; }
.ne-auto {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .4;
}
.ne-chevron {
  opacity: .4;
  transition: transform .2s;
  flex-shrink: 0;
}

/* Panel (estado abierto) */
.ne-panel {
  display: none;
  flex-direction: column;
  background: #1a1a1f;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

.ne--open .ne-pill  { display: none; }
.ne--open .ne-panel { display: flex; animation: ne-in .18s ease; }

@keyframes ne-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.ne-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.ne-head-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
}
.ne-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.5);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
  padding: 0;
  line-height: 1;
}
.ne-close:hover { background: rgba(255,255,255,.15); color: #fff; }

.ne-opts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 6px 4px;
}

.ne-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.ne-opt:hover { background: rgba(255,255,255,.09); color: #fff; }
.ne-cur {
  background: rgba(255,255,255,.1);
  color: #fff;
  font-weight: 700;
}

.ne-opt-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ne-cur .ne-opt-icon { background: rgba(255,255,255,.14); }

.ne-footer-link {
  display: block;
  padding: 7px 12px 9px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.3) !important;
  border-top: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.ne-footer-link:hover {
  color: rgba(255,255,255,.7) !important;
  background: rgba(255,255,255,.04);
  text-decoration: none;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: var(--gap-sm) 0 4px;
  margin-top: var(--gap-sm);
}

.nav a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: var(--fs-sm);
  padding: 7px 10px;
  border-radius: var(--r);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav a.active {
  background: var(--accent);
  color: #fff;
}

/* Nav hint — microcopy bajo cada ítem del nav, visible al hover */
.nav-hint {
  display: none;
  font-size: 9px;
  line-height: 1.3;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-top: 1px;
}
.nav a:hover .nav-hint { display: block; }

/* Ayuda — ítem especial al fondo del nav */
.nav-help { font-size: 12px !important; opacity: .6; }
.nav-help:hover { opacity: 1; }

/* Auto-subtitle — se inyecta automáticamente desde _PAGE_SUBTITLES */
.auto-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Sub-ítem de módulo (ej: Pagos bajo Negocio) */
.nav-subitem {
  padding-left: 20px !important;
  font-size: calc(var(--fs-sm) - 1px) !important;
  opacity: .85;
}

/* Módulo bloqueado en el nav (suscripción requerida) */
.nav-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  padding: 7px 10px;
  border-radius: var(--r);
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.nav-spacer { flex: 1; }

.nav-footer {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  padding-top: var(--gap);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-footer a {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

/* === Main content === */
.main {
  padding: var(--gap-lg);
  max-width: 1200px;
  overflow-x: hidden;
}

.page-header {
  margin-bottom: var(--gap-lg);
}

.page-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 4px;
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--gap);
}

.card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: var(--gap-sm);
}

/* Cuando el título está dentro de un header-row, el row maneja el spacing */
.card-header-row .card-title { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

/* Grid compacto para stats dentro de una card */
.card-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gap-sm);
  margin-bottom: 0;
}

/* === Stats === */
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}

.stat-value.accent { color: var(--accent); }
.stat-value.danger { color: var(--danger); }
.stat-value.success { color: var(--success); }

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.4;
}

/* === Tables === */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

thead th {
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: var(--text-2);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

.num { font-family: var(--font-mono); text-align: right; }
.right { text-align: right; }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-sm { padding: 1px 6px; font-size: 10px; }
.badge-active  { background: var(--success-dim); color: var(--success); }
.badge-pending { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-neutral { background: var(--surface-2);   color: var(--text-2); }
.badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.badge-admin   { background: var(--text);        color: var(--bg); }
.badge-fundador { background: var(--text-2);     color: var(--bg); }
.badge-success  { background: #d1fae5;           color: #065f46; }
.badge-warning  { background: var(--warning-dim); color: var(--warning); }
.badge-secondary { background: var(--surface-2);  color: var(--text-2); }
/* Payment signal badges */
.pay-dir { font-size: 10px; }
.pay-bank { font-size: 10px; }
/* Image category badges in media grid */
.media-cat-row { margin-bottom: 4px; }
.img-cat-badge { font-size: 10px; }
/* Tiers de módulos */
.badge-tier-free       { background: var(--success-dim); color: var(--success); }
.badge-tier-starter    { background: var(--warning-dim); color: var(--warning); }
.badge-tier-pro        { background: #f0e8ff;            color: #6b21a8; }
.badge-tier-enterprise { background: var(--surface-2);   color: var(--text-2); }

@media (prefers-color-scheme: dark) {
  .badge-tier-pro { background: #2d0f5e; color: #c084fc; }
  .badge-success  { background: #064e3b; color: #6ee7b7; }
}

/* admin_client — gestión de módulos y skills */
.module-card-inactive { opacity: 0.75; }

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.module-header-left { flex: 1; min-width: 0; }
.module-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.module-title-row .card-title { margin: 0; }
.module-desc { margin-top: 4px; }
.module-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.skill-item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.skill-item-meta {
  font-size: 10px;
  opacity: 0.55;
  font-family: var(--font-mono);
}
.skill-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  flex-shrink: 0;
}
.skill-badge-adn { font-size: 10px; vertical-align: middle; }

/* === Progress bar === */
.progress-wrap { margin-top: 6px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-fill.danger { background: var(--danger); }
.progress-fill.success { background: var(--success); }

/* === Bar chart (CSS puro) === */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  margin-top: var(--gap-sm);
}

.bar-chart-bar {
  flex: 1;
  background: var(--accent);
  opacity: 0.6;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: opacity 0.15s;
  position: relative;
}

.bar-chart-bar:hover { opacity: 1; }

.bar-chart-labels {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.bar-chart-labels span { flex: 1; text-align: center; overflow: hidden; }

/* === Forms === */
.form-group { margin-bottom: var(--gap); }

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: var(--fs);
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: var(--fs);
  font-family: var(--font);
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #0044dd; border-color: #0044dd; text-decoration: none; color: #fff; }

.btn-dark {
  background: var(--text);
  color: var(--bg);
}
.btn-dark:hover { background: #333; text-decoration: none; color: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-ghost-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-ghost-danger:hover { background: var(--danger-dim); text-decoration: none; }

.btn-sm { padding: 5px 12px; font-size: var(--fs-sm); }
.btn-full { width: 100%; justify-content: center; }

/* === Login page === */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  width: 100%;
  max-width: 360px;
  padding: var(--gap-lg);
}

.login-logo {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: var(--gap-lg);
}

.login-tagline {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 4px;
  margin-bottom: var(--gap-lg);
}

/* === Alerts / flash messages === */
.alert {
  padding: var(--gap-sm) var(--gap);
  border-radius: var(--r);
  font-size: var(--fs-sm);
  margin-bottom: var(--gap);
  border: 1px solid transparent;
}
.alert-error   { background: var(--danger-dim);  color: var(--danger);  border-color: #f8c5bb; }
.alert-success { background: var(--success-dim); color: var(--success); border-color: #b5d9bf; }
.alert-info    { background: var(--accent-dim);  color: var(--accent);  border-color: #b0c8ff; }

/* === Divider === */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--gap) 0;
}

/* === List === */
.item-list { list-style: none; }
.item-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--gap-sm);
}
.item-list li:last-child { border-bottom: none; }

.item-primary { font-weight: 500; color: var(--text); }
.item-secondary { color: var(--text-2); font-size: 12px; }
.item-meta { margin-left: auto; color: var(--text-3); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.item-content { flex: 1; min-width: 0; }

/* === Skill chips === */
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.skill-chip {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-2);
  background: var(--surface);
  font-family: var(--font-mono);
}

/* === Pipeline kanban === */
.pipeline {
  display: flex;
  gap: var(--gap-sm);
  overflow-x: auto;
  padding-bottom: var(--gap-sm);
}

.pipeline-col {
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--gap-sm);
  flex-shrink: 0;
}

.pipeline-col-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: var(--gap-sm);
}

.pipeline-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--gap-sm);
  margin-bottom: 6px;
  font-size: var(--fs-sm);
}

.pipeline-card:last-child { margin-bottom: 0; }

/* === Mono text === */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: 11px; }

/* === Section heading === */
.section-heading {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: var(--gap);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === HTMX loading indicator === */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* === Responsive === */
@media (max-width: 768px) {

  /* ── Layout ── */
  .layout { grid-template-columns: 1fr; }

  /* ── Nav → barra horizontal sticky ── */
  .nav {
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 0 var(--gap);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 2px;
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
    mask-image: linear-gradient(to right, black 88%, transparent 100%);
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav-logo {
    padding: 0;
    padding-right: var(--gap);
    margin: 0;
    font-size: 13px;
    border-bottom: none;
    flex-shrink: 0;
    letter-spacing: -0.3px;
  }

  .nav-label  { display: none; }
  .nav-spacer { display: none; }
  .nav-footer { display: none; }

  /* Touch target mínimo 44px (Apple HIG) */
  .nav a {
    white-space: nowrap;
    scroll-snap-align: start;
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    font-size: var(--fs-sm);
  }

  /* Sub-ítems: mismo tamaño que ítems normales en móvil */
  .nav-subitem {
    padding-left: 11px !important;
    font-size: var(--fs-sm) !important;
    opacity: 1;
  }

  /* ── Main ── */
  .main { padding: var(--gap); }

  /* ── Page header ── */
  .page-header { margin-bottom: var(--gap); }

  /* ── Cards ── */
  .card-grid, .card-grid-2    { grid-template-columns: 1fr; }
  .card-grid-compact          { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid             { grid-template-columns: 1fr; }

  /* ── Pipeline kanban ── */
  .pipeline     { flex-direction: column; }
  .pipeline-col { min-width: unset; }

  /* ── Tabs — scrollables, touch targets grandes ── */
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 16px;
  }

  /* ── Inputs: font-size 16px evita zoom automático en iOS Safari ── */
  .form-input,
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }

  /* ── Chat: usar svh (small viewport height) para iOS Chrome dinámico ── */
  .chat-scroll {
    height: calc(100svh - 200px);
    height: calc(100vh - 200px); /* fallback navegadores viejos */
    max-height: none;
    min-height: 280px;
  }

  /* ── Impersonation banner ── */
  .impersonation-banner {
    flex-wrap: wrap;
    padding: .5rem var(--gap);
    margin: calc(-1 * var(--gap)) calc(-1 * var(--gap)) var(--gap);
    font-size: var(--fs-sm);
  }

  /* ── Filtros ── */
  .filter-contact-select { max-width: 100%; }
  .filter-label          { min-width: 44px; }

  /* ── Botones: target táctil mínimo ── */
  .btn    { min-height: 44px; }
  .btn-sm { min-height: 38px; }

}

/* === Card header con acción inline === */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--gap-sm);
}

/* === Clone summary text === */
.clone-summary {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: var(--gap-sm);
}

.clone-detail { margin-top: var(--gap-sm); }
.clone-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.clone-sample {
  font-size: var(--fs-sm); color: var(--text-2);
  background: var(--surface-2); border-left: 3px solid var(--border);
  padding: 6px 10px; border-radius: 0 4px 4px 0; font-style: italic;
}

.clone-form-hidden { display: none; }

/* Clone form sections */
.clone-section {
  border-top: 1px solid var(--border);
  padding-top: var(--gap-sm);
  margin-top: var(--gap-sm);
}
.clone-section-title {
  font-size: 0.72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: var(--gap-sm);
}
.clone-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap-sm);
}
.form-hint { font-weight: 400; color: var(--text-3); font-size: 0.78rem; }
.form-hint-inline { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 4px; }

/* Alert variants */
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--text);
  padding: 10px 14px; border-radius: var(--r); font-size: var(--fs-sm);
}

/* === Badge row (chips en línea) === */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* === Skill chips === */
.skill-chip {
  display: inline-block;
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 12px;
  color: var(--text-2);
}

.muted-chip { opacity: 0.5; }

/* === Form fields internos de tarjeta (no full-page forms) === */
.form-field { display: flex; flex-direction: column; gap: 4px; }

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.form-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: var(--font);
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.form-input { resize: vertical; min-height: 72px; }

.form-grid { gap: var(--gap-sm); margin-bottom: 0; }

/* === WA Conexión status === */
.wa-status-row { display: flex; flex-direction: column; gap: 6px; }
.wa-status-item { display: flex; align-items: center; }

/* === Connect guide (instrucciones inline sin tarjeta) === */
.connect-guide {
  border-top: 1px solid var(--border);
  padding-top: var(--gap-sm);
}

/* === Item primary accent (mensajes del clon) === */
.item-primary.accent { color: var(--accent); }

/* === Sub-nav (WhatsApp y otros módulos con sub-secciones) === */
.subnav {
  display: flex;
  gap: 4px;
  margin-bottom: var(--gap);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--gap-sm);
}

.subnav-item {
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--r);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.subnav-item:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.subnav-item.active {
  background: var(--accent);
  color: #fff;
}

/* === Pareto chart === */
.pareto-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Versión clásica (con opacidad para no-vital) */
.pareto-item { opacity: 0.55; }
.pareto-item.pareto-vital { opacity: 1; }

/* Versión sin opacidad — todos visibles, solo diferencia la barra */
.pareto-list-full { gap: 10px; }
.pareto-item-full { list-style: none; }

.pareto-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.pareto-name {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.pareto-item.pareto-vital .pareto-name {
  color: var(--text);
}

.pareto-count {
  color: var(--text-2);
}

.pareto-bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.pareto-bar-fill {
  height: 100%;
  background: var(--border);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.pareto-bar-vital {
  background: var(--accent);
}

/* === Reciprocidad: balance bars === */
.insight-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.balance-bar {
  width: 44px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  align-self: center;
}

.balance-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* === Utility spacing === */
.mt-xs  { margin-top: 6px; }
.mb-xs  { margin-bottom: 6px; }
.mt-sm  { margin-top: var(--gap-sm); }
.mt-md  { margin-top: var(--gap); }
.ml-sm  { margin-left: var(--gap-sm); }

/* === Connection instructions list === */
.connect-steps {
  margin-top: var(--gap-sm);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === Button row === */
.btn-row {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

/* === HTMX indicator === */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }
.htmx-indicator-block { display: none; }
.htmx-request .htmx-indicator-block { display: block; }

/* === Índice de Mensajes (admin_client) === */
.index-stats-grid { margin-bottom: var(--gap); }
.index-notice {
  padding: var(--gap-sm) var(--gap);
  border-radius: var(--r);
  margin-bottom: var(--gap);
}
.index-notice-ok { background: var(--success-dim); color: var(--success); }
.index-notice-err { background: var(--danger-dim); color: var(--danger); }

.reindex-quick-row {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--gap-sm);
}
.reindex-advanced-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.reindex-advanced { display: none; margin-top: var(--gap); }
.reindex-advanced.reindex-advanced-open { display: block; }
.reindex-form {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: flex-end;
}
.reindex-field { display: flex; flex-direction: column; gap: 4px; }
.reindex-input-narrow { width: 100px; }
.reindex-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}
.rebuild-checkbox { accent-color: var(--danger); }
.rebuild-label { color: var(--danger); }

/* === Analytics (admin_index_analytics) === */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.bar-row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: 6px;
}
.bar-label { min-width: 120px; font-size: var(--fs-sm); }
.bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}
.bar-count { font-size: var(--fs-sm); color: var(--text-2); min-width: 30px; text-align: right; }
.sentiment-positive { background: var(--success); }
.sentiment-negative { background: var(--danger); }
.sentiment-neutral   { background: var(--text-3); }
.contact-rank-badge {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--r);
  font-size: var(--fs-sm);
  padding: 1px 5px;
}
.importance-bar {
  display: inline-block;
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

/* === Media index (imágenes y audios) === */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.media-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.media-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.media-card a { display: block; }
.media-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.media-icon-image { color: var(--accent); }
.media-desc {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-primary);
}
.media-caption {
  font-size: var(--fs-xs, 0.72rem);
  color: var(--text-muted);
}
.media-meta {
  font-size: var(--fs-xs, 0.72rem);
  color: var(--text-muted);
  font-family: monospace;
}
.media-icon-inline {
  margin-right: 4px;
}

/* === Chat de WhatsApp === */
.chat-wrap {
  padding: 0;
  overflow: hidden;
}

.chat-scroll {
  height: calc(100vh - 260px);
  min-height: 320px;
  max-height: 660px;
  overflow-y: auto;
  padding: var(--gap);
  scroll-behavior: smooth;
}

#chat-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-day-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 8px 0 4px;
  -webkit-user-select: none;
  user-select: none;
}

.chat-bubble {
  max-width: 74%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.bubble-user { align-self: flex-end; }
.bubble-clon { align-self: flex-start; }

.bubble-body {
  padding: 8px 13px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-user .bubble-body {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 14px 3px 14px;
}

.bubble-clon .bubble-body {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 14px 14px 14px 3px;
}

.bubble-meta {
  font-size: 11px;
  color: var(--text-3);
  padding: 0 4px;
}

.bubble-user .bubble-meta { text-align: right; }

.bubble-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 4px 2px;
  letter-spacing: 0.02em;
}

.bubble-skill {
  font-size: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.bubble-label {
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.bubble-ann {
  display: inline;
}

.bubble-ann summary {
  display: inline;
  list-style: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-3);
  padding: 0 3px;
  opacity: 0;
  transition: opacity 0.1s;
  -webkit-user-select: none;
  user-select: none;
}
.bubble-ann summary::-webkit-details-marker { display: none; }

.chat-bubble:hover .bubble-ann summary,
.bubble-ann[open] summary {
  opacity: 1;
}

.bubble-ann-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}

.ann-pill {
  padding: 2px 8px;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.ann-pill:hover { background: var(--surface-2); }

.ann-active {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.ann-clear {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

.chat-empty {
  text-align: center;
  padding: var(--gap-lg);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.chat-error {
  font-size: var(--fs-sm);
  color: var(--danger);
  background: var(--danger-dim);
  border-radius: var(--r);
  padding: 6px 10px;
  margin-bottom: 8px;
}

.chat-input-row {
  display: flex;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap);
  border-top: 1px solid var(--border);
  align-items: center;
}

.chat-input {
  flex: 1;
  border-radius: 20px !important;
  padding: 9px 14px !important;
}

.chat-send-btn {
  flex-shrink: 0;
  border-radius: 20px !important;
  padding: 9px 18px !important;
  position: relative;
}

.chat-spinner { display: none; }
.htmx-request .chat-spinner { display: inline; }
.htmx-request .chat-send-label { display: none; }

/* === Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap);
}

.tab {
  padding: 8px 16px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--text); }

.tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

/* === Message review rows === */
.msg-review-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-review-empty {
  text-align: center;
  padding: var(--gap-lg);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.msg-row {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface);
  transition: background 0.1s;
}

.msg-row:hover { background: var(--surface-2); }

.msg-labeled { border-left: 3px solid var(--accent); }

.msg-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.msg-client { font-weight: 600; color: var(--text); }

.dir-out { color: var(--accent); font-size: 11px; }
.dir-in  { color: var(--text-3); font-size: 11px; }

.msg-type {
  font-size: 10px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.msg-time { font-size: 11px; color: var(--text-3); margin-left: auto; }

.msg-row-body {
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 80px;
  overflow: hidden;
  margin: 4px 0 6px;
}

.msg-direction-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-arrow {
  font-size: 11px;
  color: var(--muted);
  margin: 0 2px;
}

.msg-contact-name {
  font-weight: 600;
  color: var(--text);
}

.msg-contact-role {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent-soft, #e8f0fe);
  color: var(--accent, #4a7cdc);
  font-weight: 500;
  text-transform: capitalize;
}

.msg-media-preview {
  margin: 6px 0;
}

.msg-img-thumb {
  display: block;
  max-height: 180px;
  max-width: 280px;
  border-radius: var(--r);
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.msg-img-thumb:hover { opacity: 0.85; }

.msg-audio-player {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 36px;
  margin-bottom: 4px;
}

.msg-media-icon {
  font-size: 20px;
  display: inline-block;
  margin-bottom: 4px;
}

.msg-media-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin: 4px 0 0;
  font-style: italic;
  line-height: 1.4;
}

.msg-media-caption {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin: 4px 0 0;
}

.msg-media-caption.muted { color: var(--text-3); }

.msg-row-cats {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.cat-pill {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.cat-pill:hover { background: var(--surface-2); color: var(--text-2); }

.cat-active {
  background: var(--accent-soft, #e8f0fe);
  border-color: var(--accent, #4a7cdc);
  color: var(--accent, #4a7cdc);
  font-weight: 600;
}

.msg-row-ann {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* === Filter bar === */
.filter-bar {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--gap);
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  min-width: 60px;
  flex-shrink: 0;
}

.filter-select { width: auto; }

.filter-contact-select {
  flex: 1;
  max-width: 340px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  font-size: var(--fs-sm);
  cursor: pointer;
  outline: none;
}
.filter-contact-select:focus {
  border-color: var(--accent, #4a7cdc);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
}

.filter-checks-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-check-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.filter-check-pill:has(input:checked) {
  background: var(--accent-soft, #e8f0fe);
  border-color: var(--accent, #4a7cdc);
  color: var(--accent, #4a7cdc);
  font-weight: 500;
}

.filter-check-pill input[type="checkbox"],
.filter-check-pill input[type="radio"] {
  display: none;
}

.filter-check-pill:has(input[type="radio"]:checked) {
  background: var(--accent-soft, #e8f0fe);
  border-color: var(--accent, #4a7cdc);
  color: var(--accent, #4a7cdc);
  font-weight: 500;
}

.filter-check-pill-dim {
  border-style: dashed;
  color: var(--text-3);
}
.filter-check-pill-dim:has(input:checked) {
  border-style: solid;
}

.pill-count {
  font-size: 10px;
  opacity: 0.65;
  font-weight: 400;
  margin-left: 2px;
}

/* === Autopilot — estado requerido === */
.rule-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.rule-status-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: background .1s, border-color .1s, color .1s;
}
.rule-status-pill:has(input:checked) {
  background: var(--accent-soft, #e8f0fe);
  border-color: var(--accent, #4a7cdc);
  color: var(--accent, #4a7cdc);
  font-weight: 600;
}
.rule-status-pill input { display: none; }

/* === Autopilot — template select === */
.tpl-select { margin-bottom: 6px; font-size: 13px; }

/* === Autopilot — confirmación inline de eliminación === */
.rule-del-wrap { display: flex; align-items: center; gap: 4px; }
.rule-del-confirm { display: flex; align-items: center; gap: 4px; }
.rule-del-hidden { display: none !important; }
.rule-del-form { display: inline; }

/* Badge de estado en regla */
.badge-status {
  background: var(--surface-2);
  color: var(--text-2);
  text-transform: none;
  font-weight: 500;
}

/* === CRM Badge (en tabla de Contactos) === */
.btn-crm-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: .75rem;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  line-height: 1.4;
}
.btn-crm-badge:hover { background: var(--surface-alt); text-decoration: none; }
.btn-crm-empty { opacity: .5; font-size: .7rem; }
.btn-crm-empty:hover { opacity: 1; }

/* === Print === */
@media print {
  .nav { display: none; }
  .layout { display: block; }
  .main { padding: 0; }
}


/* === Impersonation Banner === */
.impersonation-banner {
  background: #fef3c7;
  border-bottom: 1px solid #fbbf24;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  color: #92400e;
  margin: -1.5rem -1.5rem 1.5rem;
}
.impersonation-banner strong { font-weight: 600; }
.impersonation-banner .impersonation-exit {
  margin-left: auto;
  color: #92400e;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #fbbf24;
  padding: .25rem .6rem;
  border-radius: 4px;
}
.impersonation-banner .impersonation-exit:hover { background: #fbbf24; text-decoration: none; }

/* === Button Group (flex row of buttons) === */
.btn-group { display: flex; gap: .5rem; align-items: center; }

/* === WA Copilot sub-tabs === */
.wac-tabs {
  display: flex;
  gap: .35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.wac-tab {
  font-size: .78rem;
  font-weight: 500;
  padding: .45rem .9rem;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  color: var(--muted);
  position: relative;
  bottom: -1px;
}
.wac-tab--active {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}

/* === Admin / Cerebro tab navigation === */
.admin-tab-nav {
  display: flex; gap: .25rem; flex-wrap: wrap;
  margin-bottom: var(--gap);
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.admin-tab-link {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; padding: .3rem .75rem;
  border: 1px solid transparent; border-radius: var(--r);
  text-decoration: none; color: var(--text-2);
  background: transparent; transition: all .15s; white-space: nowrap;
}
.admin-tab-link:hover { border-color: var(--border); color: var(--text); }
.admin-tab-link.active {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
