@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ===== Focus outline programatico (FocusOnNavigate en Routes.razor) =====
   Blazor enfoca el primer <h1> al cambiar de ruta (para anunciar el titulo a lectores de
   pantalla), lo que provoca un outline visible alrededor del titulo. Eliminamos
   completamente el outline en titulos y en cualquier elemento con tabindex="-1"
   (que es el patron exacto que usa FocusOnNavigate). Los inputs/botones interactivos
   conservan su outline normal porque tienen tabindex >= 0 por defecto. */
h1:focus,
h2:focus,
h3:focus,
[tabindex="-1"]:focus { outline: 0 !important; box-shadow: none !important; }

/* ===== Tokens (alineados al prototipo CUBOT.travels) ===== */
:root {
  --radius: 0.875rem;
  --background: oklch(0.985 0.003 280);
  --foreground: oklch(0.2 0.04 280);
  --card: oklch(1 0 0);
  --primary: oklch(0.55 0.22 285);
  --primary-foreground: oklch(0.99 0.005 280);
  --primary-soft: oklch(0.96 0.025 285);
  --muted: oklch(0.97 0.008 280);
  --muted-foreground: oklch(0.5 0.025 280);
  --accent-foreground: oklch(0.4 0.18 285);
  --gold: oklch(0.78 0.14 70);
  --gold-foreground: oklch(0.22 0.04 70);
  --destructive: oklch(0.6 0.22 22);
  --warning: oklch(0.74 0.16 65);
  --warning-foreground: oklch(0.22 0.05 65);
  --success: oklch(0.62 0.16 155);
  --border: oklch(0.93 0.008 280);
  --sidebar: oklch(1 0 0);
  --sidebar-border: oklch(0.94 0.008 280);
  --shadow-soft: 0 1px 2px oklch(0.4 0.15 280 / 0.04), 0 1px 3px oklch(0.4 0.15 280 / 0.05);
  --shadow-card: 0 4px 24px -8px oklch(0.4 0.15 280 / 0.10);
  --gradient-violet: linear-gradient(135deg, oklch(0.6 0.22 285), oklch(0.45 0.24 290));
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

a, .btn-link { color: var(--primary); }
h1, h2, h3 { letter-spacing: -0.01em; }

/* ===== Layout shell ===== */
.cubot-shell { display: flex; min-height: 100vh; }

.cubot-sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.cubot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.cubot-topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: oklch(1 0 0 / 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.cubot-content { padding: 26px 30px; width: 100%; }

/* Piezas del menu movil: ocultas en escritorio. */
.cubot-nav-toggle { display: none; }
.cubot-nav-overlay { display: none; }
.cubot-hamburger { display: none; }
.cubot-topbar-brand { display: none; }

/* ===== Sidebar header / brand ===== */
.cubot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.cubot-logo {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--gradient-violet);
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  color: #fff;
}
.cubot-logo svg { width: 18px; height: 18px; transform: rotate(-45deg); }
.cubot-logo::after {
  content: ""; position: absolute; bottom: -2px; right: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--sidebar);
}
.cubot-brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; line-height: 1; }
.cubot-brand-name span { color: var(--primary); }
.cubot-brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-foreground); font-weight: 600; margin-top: 3px; }

.cubot-agency {
  margin: 12px 14px 4px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid oklch(0.55 0.22 285 / 0.15);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cubot-agency-logo {
  width: 38px; height: 38px;
  border-radius: 9px;
  object-fit: cover;
  background: #fff;
  border: 1px solid oklch(0.55 0.22 285 / 0.15);
  flex: none;
}
.cubot-agency-info { min-width: 0; }
.cubot-agency .lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: oklch(0.55 0.22 285 / 0.85); }
.cubot-agency .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cubot-agency .meta { font-size: 11px; color: var(--muted-foreground); }

/* ===== Sidebar nav ===== */
.cubot-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.cubot-nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: oklch(0.5 0.025 280 / 0.8); padding: 14px 8px 6px;
}
.cubot-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: oklch(0.35 0.04 280); text-decoration: none;
  font-size: 13.5px; font-weight: 500; line-height: 1.2;
  transition: background .12s, color .12s;
}
.cubot-nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.cubot-nav-link:hover { background: var(--muted); color: var(--foreground); }
.cubot-nav-link.active { background: var(--primary-soft); color: var(--accent-foreground); font-weight: 600; }
.cubot-nav-link.active svg { opacity: 1; color: var(--primary); }
.cubot-nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 7px; background: oklch(0.55 0.22 285 / 0.12); color: var(--primary); }

/* ===== Sidebar footer (user) ===== */
.cubot-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--sidebar-border); }
.cubot-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, oklch(0.82 0.13 70), oklch(0.74 0.15 70)); color: var(--gold-foreground); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.cubot-user .nm { font-size: 12.5px; font-weight: 600; }
.cubot-user .rl { font-size: 11px; color: var(--muted-foreground); }
.cubot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-left: auto; }

/* topbar user chip */
.cubot-user-chip { font-size: 13px; color: var(--muted-foreground); }
.cubot-user-chip strong { color: var(--foreground); font-weight: 600; }

/* ===== Page header ===== */
.page-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--primary); }
.page-title { font-size: 1.7rem; font-weight: 800; margin: 4px 0 2px; }
.page-title span { color: var(--primary); }
.page-sub { font-size: 0.9rem; color: var(--muted-foreground); margin-bottom: 22px; }

/* ===== KPI cards ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; max-width: 1000px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: 1.25rem; padding: 18px 20px; box-shadow: var(--shadow-soft); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon.tone-primary { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.tone-gold { background: oklch(0.78 0.14 70 / 0.16); color: var(--gold-foreground); }
.kpi-icon.tone-success { background: oklch(0.62 0.16 155 / 0.15); color: var(--success); }
.kpi-icon.tone-danger { background: oklch(0.6 0.22 22 / 0.10); color: var(--destructive); }
.kpi-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); font-weight: 700; margin-top: 14px; }
.kpi-value { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-hint { font-size: 11px; color: var(--muted-foreground); }

/* ===== Cards (override bootstrap) ===== */
.card { border: 1px solid var(--border); border-radius: 1.1rem; box-shadow: var(--shadow-card); }
.card-title { font-weight: 700; letter-spacing: -0.01em; }

/* ===== Buttons (override bootstrap) ===== */
.btn { border-radius: 0.6rem; font-weight: 600; font-size: 0.875rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover, .btn-primary:focus { background: oklch(0.5 0.22 285); border-color: oklch(0.5 0.22 285); color: #fff; }
.btn-outline-secondary { color: var(--foreground); border-color: var(--border); background: var(--card); }
.btn-outline-secondary:hover { background: var(--muted); color: var(--foreground); }
.btn-outline-success { color: var(--success); border-color: oklch(0.62 0.16 155 / 0.5); }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-danger { color: var(--destructive); border-color: oklch(0.6 0.22 22 / 0.5); }
.btn-outline-danger:hover { background: var(--destructive); color: #fff; }
.btn:focus, .btn:active:focus, .form-control:focus { box-shadow: 0 0 0 3px oklch(0.55 0.22 285 / 0.25); }

/* ===== Forms (override bootstrap) ===== */
.form-control { border-radius: 0.55rem; border-color: var(--border); font-size: 0.9rem; }
.form-control:focus { border-color: var(--primary); }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--muted-foreground); }

/* ===== Tables (override bootstrap) ===== */
.table { --bs-table-bg: transparent; color: var(--foreground); }
.table > thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.table > tbody td { border-bottom: 1px solid var(--border); padding: 12px 8px; vertical-align: middle; }
.table.table-hover > tbody > tr:hover > * { background: var(--muted); }

/* ===== Badges (override bootstrap bg-*) ===== */
.badge { font-weight: 700; font-size: 10.5px; padding: 4px 9px; border-radius: 7px; letter-spacing: 0.02em; }
.badge.bg-success { background: oklch(0.62 0.16 155 / 0.15) !important; color: var(--success) !important; }
.badge.bg-info { background: var(--primary-soft) !important; color: var(--primary) !important; }
.badge.bg-danger { background: oklch(0.6 0.22 22 / 0.12) !important; color: var(--destructive) !important; }
.badge.bg-warning { background: oklch(0.78 0.14 70 / 0.18) !important; color: var(--warning-foreground) !important; }
.badge.bg-secondary { background: var(--muted) !important; color: var(--muted-foreground) !important; }

.text-muted { color: var(--muted-foreground) !important; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background:
  radial-gradient(1200px 600px at 50% -10%, oklch(0.93 0.05 285), transparent), var(--background); }
.login-card { width: 380px; background: var(--card); padding: 34px; border-radius: 1.25rem; box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.login-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--gradient-violet); display: grid; place-items: center; color: #fff; margin-bottom: 16px; }
.login-logo svg { width: 22px; height: 22px; transform: rotate(-45deg); }
.login-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.login-title span { color: var(--primary); }

/* ===== Auth (login + registro autogestion, diseno de dos paneles) ===== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none !important; } }

/* Panel izquierdo morado */
.auth-aside { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(-45deg, #4f46e5, #6366f1, #7c3aed, #4338ca); background-size: 300% 300%; animation: authGradient 14s ease infinite; }
@keyframes authGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.auth-aside-deco { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); pointer-events: none; }
.auth-deco-tr { top: -60px; right: -60px; }
.auth-deco-bl { bottom: -60px; left: -60px; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand-logo { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; backdrop-filter: blur(6px); }
.auth-brand-logo svg { width: 22px; height: 22px; transform: rotate(-45deg); }
.auth-brand-logo-img { height: 46px; max-width: 180px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.92); padding: 6px 10px; }
.auth-brand-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-aside-body { position: relative; z-index: 1; max-width: 420px; }
.auth-aside-body h2 { font-size: 2.1rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
.auth-aside-body p { font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,.9); margin: 0 0 22px; }
.auth-dots { display: flex; gap: 8px; }
.auth-dots span { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.45); }
.auth-dots span:first-child { width: 22px; background: #fff; }

/* Panel derecho formularios */
.auth-main { display: flex; flex-direction: column; padding: 40px clamp(24px, 6vw, 80px); }
.auth-form-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 440px; width: 100%; margin: 0 auto; }
.auth-pane-signup { display: none; }
.auth-shell.is-signup .auth-pane-login { display: none; }
.auth-shell.is-signup .auth-pane-signup { display: block; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--foreground); margin: 0 0 6px; }
.auth-head p { font-size: .92rem; color: var(--muted-foreground); margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.auth-field input { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--background); font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
.auth-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.62 0.2 285 / .15); background: #fff; }
.auth-input-icon { position: relative; }
.auth-input-icon input { padding-right: 78px; }
.auth-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--muted-foreground); cursor: pointer; }
.auth-eye:hover { color: var(--primary); }
.auth-submit { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; border-radius: 12px; background: var(--gradient-violet, #4f46e5); color: #fff; font-size: .98rem; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(79,70,229,.6); transition: transform .12s, box-shadow .15s; }
.auth-submit:hover { box-shadow: 0 14px 30px -10px rgba(79,70,229,.7); }
.auth-submit:active { transform: scale(.99); }
.auth-submit svg { width: 16px; height: 16px; }
.auth-switch { margin-top: 24px; text-align: center; font-size: .9rem; color: var(--muted-foreground); }
.auth-switch button { background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; margin-left: 4px; }
.auth-switch button:hover { text-decoration: underline; }
.auth-alert { padding: 11px 14px; border-radius: 10px; font-size: .88rem; margin-bottom: 18px; }
.auth-alert-error { background: oklch(0.95 0.04 25); color: oklch(0.5 0.2 25); border: 1px solid oklch(0.85 0.08 25); }
.auth-alert-ok { background: oklch(0.95 0.05 150); color: oklch(0.45 0.13 150); border: 1px solid oklch(0.85 0.09 150); }
.auth-label-row { display: flex; justify-content: space-between; align-items: center; }
.auth-forgot { font-size: .72rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.auth-legal { font-size: .76rem; line-height: 1.5; color: var(--muted-foreground); margin: 2px 0 0; }
.auth-footer { text-align: center; font-size: .76rem; color: var(--muted-foreground); padding-top: 24px; border-top: 1px solid var(--border); margin-top: 24px; }
.auth-providers { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
.auth-provider { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--background); font-size: .9rem; font-weight: 600; color: var(--foreground); cursor: pointer; }
.auth-provider[disabled] { opacity: .65; cursor: not-allowed; }
.auth-provider small { font-size: .68rem; color: var(--muted-foreground); font-weight: 600; }
.auth-hint { margin: -8px 0 14px; font-size: .8rem; color: #dc2626; }
.auth-input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.auth-divider { position: relative; text-align: center; margin: 18px 0; }
.auth-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { position: relative; background: #fff; padding: 0 12px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted-foreground); }

/* ===== Pagina Marca (branding super admin) ===== */
.brand-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .brand-cols { grid-template-columns: 1fr; } }
.brand-form { padding: 22px; }
.brand-logo-current { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; }
.brand-logo-current img { height: 46px; max-width: 200px; object-fit: contain; }
.brand-preview { position: relative; }
.brand-preview-aside { border-radius: 16px; overflow: hidden; color: #fff; padding: 32px; min-height: 320px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(-45deg, #4f46e5, #6366f1, #7c3aed, #4338ca); background-size: 300% 300%; animation: authGradient 14s ease infinite; }
.bp-brand { display: flex; align-items: center; gap: 10px; }
.bp-brand img { height: 40px; max-width: 160px; object-fit: contain; background: rgba(255,255,255,.92); padding: 5px 9px; border-radius: 9px; }
.bp-logo { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; }
.bp-logo svg { width: 19px; height: 19px; transform: rotate(-45deg); }
.bp-brand span { font-size: 1.2rem; font-weight: 800; }
.bp-body h3 { font-size: 1.6rem; font-weight: 800; line-height: 1.15; margin: 0 0 10px; }
.bp-body p { font-size: .92rem; line-height: 1.55; color: rgba(255,255,255,.9); margin: 0; }
.brand-preview-label { text-align: center; font-size: .76rem; color: var(--muted-foreground); margin-top: 10px; }
.brand-suggested { display: flex; gap: 10px; flex-wrap: wrap; }
.brand-suggested-item { padding: 8px; border: 2px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; }
.brand-suggested-item.active { border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.62 0.2 285 / .15); }
.brand-suggested-item img { height: 40px; max-width: 130px; object-fit: contain; display: block; }

/* error boundary (keep functional) */
.blazor-error-boundary { background: var(--destructive); padding: 1rem; color: white; border-radius: 8px; }
.blazor-error-boundary::after { content: "Ha ocurrido un error."; }
.validation-message { color: var(--destructive); }

/* ===== Module header (icono + eyebrow + titulo + acciones), estilo prototipo ===== */
.module-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.module-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.module-icon svg { width: 19px; height: 19px; }
.module-eyebrow { display: flex; align-items: center; gap: 10px; }
.module-eyebrow span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--primary); }

/* ===== Plan cards (estilo prototipo) ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 1100px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: 1.25rem; box-shadow: var(--shadow-soft); padding: 24px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: oklch(0.55 0.22 285 / 0.4); box-shadow: 0 0 0 1px oklch(0.55 0.22 285 / 0.3), var(--shadow-card); }
.plan-card.gold { border-color: oklch(0.78 0.14 70 / 0.45); }
.plan-card .pname { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); font-weight: 700; }
.plan-card .pprice { font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.plan-card .pprice small { font-size: 0.85rem; font-weight: 600; color: var(--muted-foreground); }
.plan-features { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 9px; font-size: 0.9rem; }
.plan-features li { display: flex; align-items: center; gap: 8px; }
.plan-check { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }
.plan-edit { margin-top: 22px; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: oklch(0.2 0.04 280 / 0.45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 20px; }
/* pointer-events:auto anula el .modal-dialog de Bootstrap (que lo pone en none para
   dejar pasar el clic al backdrop); sin esto no se puede enfocar/escribir en los inputs. */
.modal-dialog { pointer-events: auto; background: var(--card); border-radius: 1.1rem; box-shadow: 0 16px 40px -12px oklch(0.42 0.22 285 / 0.28); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; margin: -6px -6px -6px 0; border-radius: 0.6rem; background: none; border: none; font-size: 1.4rem; color: var(--muted-foreground); cursor: pointer; line-height: 1; transition: background .15s, color .15s; }
.modal-close:hover { background: var(--muted); color: var(--foreground); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--border); }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== Placeholder "Proximamente" ===== */
.coming-soon { max-width: 1040px; border: 1px dashed var(--border); border-radius: 1.25rem; background: var(--card); padding: 56px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.coming-soon-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 16px; }
.coming-soon-icon svg { width: 26px; height: 26px; }
.coming-soon h3 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.coming-soon p { font-size: 0.9rem; color: var(--muted-foreground); margin: 6px 0 0; max-width: 420px; }

/* ===== Pares etiqueta/valor (config Wompi) ===== */
.wlbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); font-weight: 700; }
.wval { font-size: 0.92rem; font-weight: 600; margin-top: 2px; margin-bottom: 4px; }

/* ===== Mi cuenta (tenant) ===== */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; max-width: 1040px; }
.acct-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); background: var(--card); flex-shrink: 0; }
.acct-logo-empty { display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: var(--primary); background: var(--primary-soft); }

/* ===== Pipeline Kanban ===== */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kb-col { flex: 0 0 270px; background: var(--muted); border: 1px solid var(--border); border-radius: 1rem; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kb-col.drop-hover { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kb-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-col-title { font-weight: 700; font-size: 0.92rem; }
.kb-col-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
.kb-col-count { font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.kb-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1; min-height: 60px; }
.kb-card { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 11px 12px; box-shadow: var(--shadow-soft); cursor: pointer; }
.kb-card:hover { border-color: oklch(0.55 0.22 285 / 0.4); }
.kb-card .nm { font-weight: 700; font-size: 0.9rem; }
.kb-card .meta { font-size: 11.5px; color: var(--muted-foreground); margin-top: 3px; }
.kb-card .val { font-weight: 700; font-size: 0.92rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kb-card .ase { width: 22px; height: 22px; border-radius: 50%; background: var(--gradient-violet); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.kb-cardrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kb-empty { font-size: 12px; color: var(--muted-foreground); text-align: center; padding: 14px 0; }

/* ===== Pipeline: tarjeta enriquecida (estilo prototipo) ===== */
.kb-card.stale { box-shadow: var(--shadow-soft), -3px 0 0 var(--destructive) inset; padding-left: 15px; border-color: oklch(0.6 0.22 22 / 0.35); }
/* Lead nuevo que el asesor AUN NO ha abierto (marca por navegador): tinte gris + acento lateral gris */
.kb-card.unseen { background: oklch(0.965 0.004 285); box-shadow: var(--shadow-soft), -3px 0 0 oklch(0.78 0.012 285) inset; padding-left: 15px; }
.kb-card.unseen:hover { border-color: oklch(0.72 0.02 285 / 0.5); }
.kb-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted-foreground); font-weight: 600; margin-bottom: 8px; gap: 8px; }
.kb-time { display: inline-flex; align-items: center; gap: 5px; }
.kb-time svg { width: 11px; height: 11px; }
.kb-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.kb-badge.stale { background: oklch(0.6 0.22 22 / 0.10); color: var(--destructive); }
.kb-badge svg { width: 10px; height: 10px; }
.kb-archive { margin-left: auto; background: none; border: none; padding: 2px; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; display: inline-grid; place-items: center; opacity: 0.5; }
.kb-card:hover .kb-archive { opacity: 1; }
.kb-archive:hover { background: var(--muted); color: var(--destructive); }
.kb-archive svg { width: 14px; height: 14px; }

/* Lead con mensaje del cliente sin responder */
.kb-card.needsreply { background: oklch(0.97 0.045 50); border-color: oklch(0.72 0.16 55 / 0.55); box-shadow: var(--shadow-soft), -3px 0 0 oklch(0.7 0.17 50) inset; padding-left: 15px; }
.kb-card.needsreply:hover { border-color: oklch(0.7 0.17 50); }
.kb-badge.reply { background: oklch(0.7 0.17 50 / 0.16); color: oklch(0.5 0.16 45); }
.kb-unread { display: inline-flex; align-items: center; gap: 5px; margin: 4px 0 2px; font-size: 11px; font-weight: 700; color: oklch(0.5 0.16 45); }
.kb-unread svg { width: 12px; height: 12px; }

/* Barra de busqueda + orden + filtros */
.pl-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; max-width: 840px; }
.pl-search { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.pl-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-foreground); }
.pl-search input { width: 100%; padding: 9px 32px 9px 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font-size: 13px; }
.pl-search-clear { position: absolute; right: 8px; border: none; background: none; font-size: 18px; line-height: 1; color: var(--muted-foreground); cursor: pointer; }
.pl-sort { display: flex; align-items: center; gap: 6px; }
.pl-sort-lbl { font-size: 12px; color: var(--muted-foreground); }
.pl-sort select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: var(--card); max-width: 230px; }
.pl-filt-anchor { flex-shrink: 0; }
/* Vista lista: anchos de columna configurables (Pequeno / Medio / Grande) */
.pl-list-table th.pl-col-sm, .pl-list-table td.pl-col-sm { width: 80px; }
.pl-list-table th.pl-col-md, .pl-list-table td.pl-col-md { width: 150px; }
.pl-list-table th.pl-col-lg, .pl-list-table td.pl-col-lg { width: 240px; }
/* Panel para elegir/ordenar/dimensionar las columnas de la lista */
.pl-cols-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 12px 14px; margin-bottom: 10px; max-width: 540px; box-shadow: var(--shadow-soft); }
.pl-cols-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.pl-cols-row:last-child { border-bottom: none; }
.pl-cols-w { border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 11.5px; background: var(--card); }
.pl-cols-mv { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; color: var(--muted-foreground); display: inline-grid; place-items: center; font-size: 9px; padding: 0; }
.pl-cols-mv:hover { border-color: var(--primary); color: var(--primary); }
.btn.pl-filt-on { border-color: var(--primary); color: var(--primary); }

.pl-filt-anchor { position: relative; }
.pl-filters { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 600px; max-width: 88vw; border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 16px 18px; box-shadow: var(--shadow-lg); }
.pl-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pl-filters-head > span { font-weight: 700; font-size: 13px; }
.pl-link { border: none; background: none; color: var(--primary); font-size: 12px; cursor: pointer; }
.pl-filt-group { margin-bottom: 12px; }
.pl-filt-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted-foreground); margin-bottom: 7px; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pl-fchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 12px; cursor: pointer; color: var(--foreground); }
.pl-fchip:hover { border-color: var(--primary); }
.pl-fchip.on { background: var(--accent); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.pl-fchip .dot { width: 8px; height: 8px; border-radius: 50%; }
.pl-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* ===== Agentes IA ===== */
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; max-width: 1040px; }
.ag-card { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 16px 18px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 6px; }
.ag-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
/* Boton de eliminar agente en la esquina superior derecha de la tarjeta. */
.ag-card-del { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted-foreground); font-size: 16px; line-height: 1; display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: all 0.15s; }
.ag-card-del:hover { border-color: var(--destructive); color: var(--destructive); background: oklch(0.97 0.03 25); }
.ag-card-del:disabled { opacity: 0.4; cursor: not-allowed; }
.ag-provider { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }
.ag-provider.p-claude { background: oklch(0.95 0.05 40); color: oklch(0.5 0.16 40); }
.ag-provider.p-gemini { background: oklch(0.95 0.05 255); color: oklch(0.5 0.16 255); }
.ag-provider.p-gpt { background: oklch(0.95 0.05 160); color: oklch(0.45 0.13 160); }
.ag-name { font-weight: 700; font-size: 15px; margin-top: 4px; }
.ag-role { font-size: 12px; color: var(--muted-foreground); }
.ag-prompt { font-size: 12px; color: var(--muted-foreground); margin: 6px 0; line-height: 1.45; min-height: 34px; }
.ag-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.ag-res { font-size: 11.5px; color: var(--muted-foreground); }
.ag-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.ag-switch input { opacity: 0; width: 0; height: 0; }
.ag-slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.ag-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.ag-switch input:checked + .ag-slider { background: oklch(0.6 0.16 150); }
.ag-switch input:checked + .ag-slider::before { transform: translateX(18px); }
.ag-res-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ag-res-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); padding: 6px 6px; border-bottom: 1px solid var(--border); }
.ag-res-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.form-control-sm { padding: 5px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 7px; width: 100%; background: var(--card); }
.ag-file { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.ag-fileinput { font-size: 11px; }

/* ===== Automatizaciones (workflows) ===== */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; max-width: 980px; }
.auto-card { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 16px 18px; box-shadow: var(--shadow-soft); cursor: pointer; transition: border-color .15s; }
.auto-card:hover { border-color: oklch(0.55 0.22 285 / 0.4); }
.auto-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.auto-name { font-weight: 700; font-size: 14.5px; }
.auto-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto-trig { background: var(--accent); color: var(--primary); border-radius: 9px; padding: 7px 11px; font-size: 12px; font-weight: 600; }
.auto-arrow { color: var(--muted-foreground); }
.auto-act { background: oklch(0.95 0.05 60); color: oklch(0.5 0.14 55); border-radius: 9px; padding: 7px 11px; font-size: 12px; font-weight: 600; }
.auto-exec { font-size: 11.5px; color: var(--muted-foreground); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.kb-route { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px dashed var(--border); border-radius: 8px; padding: 7px 10px; margin: 10px 0; background: var(--muted); font-size: 11.5px; }
.kb-route .codes { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.kb-route .codes .arr { color: var(--muted-foreground); }
.kb-route .date { color: var(--muted-foreground); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.kb-route .date svg { width: 11px; height: 11px; flex-shrink: 0; }
.kb-comment { font-size: 12px; color: var(--muted-foreground); line-height: 1.4; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 9px; border-top: 1px dashed var(--border); }
.kb-ase { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--foreground); font-weight: 600; min-width: 0; }
.kb-ase .nmtxt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-ase-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.kb-pax { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted-foreground); font-weight: 600; white-space: nowrap; }
.kb-pax svg { width: 11px; height: 11px; }

/* ===== Ficha de lead con chat (estilo prototipo) ===== */
.pl-lead-dialog { max-width: 1400px; width: 96vw; display: flex; padding: 0; overflow: hidden; max-height: 94vh; height: 94vh; }
.pl-lead-left { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; max-height: 94vh; }
.pl-lead-left .modal-body { flex: 1; overflow-y: auto; }
.pl-chat { flex: 1 1 45%; min-width: 0; display: flex; flex-direction: column; max-height: 94vh; border-left: 1px solid var(--border); background: var(--muted); }
.pl-chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.pl-chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gradient-violet); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.pl-chat-head .nm { font-weight: 700; font-size: 13px; line-height: 1.2; }
.pl-chat-head .sub { font-size: 11px; color: var(--muted-foreground); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.pl-chat-head .sub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4f8a60; box-shadow: 0 0 0 2px rgba(79,138,96,0.2); }
.pl-chat-more { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--muted); font-size: 11px; color: var(--muted-foreground); cursor: default; flex-shrink: 0; }
.pl-chat-more svg { width: 12px; height: 12px; }
.pl-chat-line { margin-top: 6px; }
.pl-chat-line select { font-size: 11px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); width: 100%; }

/* Pestañas de la columna de datos del lead */
.pl-lead-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pl-lead-tab { background: none; border: none; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pl-lead-tab:hover { color: var(--foreground); }
.pl-lead-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Timeline de actividad */
.pl-timeline { display: flex; flex-direction: column; }
.pl-tl-item { display: flex; gap: 12px; padding: 4px 0; }
.pl-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; position: relative; }
.pl-tl-item:not(:last-child) .pl-tl-dot::after { content: ''; position: absolute; left: 50%; top: 13px; transform: translateX(-50%); width: 2px; height: calc(100% + 8px); background: var(--border); }
.pl-tl-body { padding-bottom: 14px; }
.pl-tl-desc { font-size: 13px; color: var(--foreground); }
.pl-tl-meta { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; }
.pl-tl-actor { font-weight: 600; color: var(--primary); }

/* Chips de cabecera del lead */
.pl-tags { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pl-state-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; background: var(--accent); color: var(--primary); border: 1px solid var(--border); }
.pl-state-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.pl-chip { background: var(--card); border: 1px solid var(--border); color: var(--muted-foreground); padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.pl-chip svg { width: 10px; height: 10px; }

/* Conmutador de vista Kanban / Lista */
.pl-view { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.pl-view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: none; background: none; color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pl-view-btn + .pl-view-btn { border-left: 1px solid var(--border); }
.pl-view-btn svg { width: 15px; height: 15px; }
.pl-view-btn.on { background: var(--primary); color: #fff; }

/* Vista lista del tablero */
.pl-list { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.pl-list-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pl-list-table th { text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.pl-list-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pl-list-table tbody tr:last-child td { border-bottom: none; }
.pl-list-table tbody tr:hover { background: var(--muted); }
.pl-list-table tr.pl-row-reply { background: color-mix(in srgb, var(--destructive) 6%, transparent); }
.pl-row-tag { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--destructive); }

/* Filtros del modal de historial */
.pl-hist-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pl-hist-table th { white-space: nowrap; }

.btn-icon { background: none; border: none; padding: 5px; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; display: inline-grid; place-items: center; }
.btn-icon:hover { background: var(--muted); color: var(--destructive); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Notas de seguimiento del lead */
.pl-notes-composer { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--card); margin-bottom: 14px; }
.pl-notes-composer textarea { resize: vertical; }
.pl-notes-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pl-notes-colors { display: flex; gap: 6px; }
.pl-note-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.pl-note-swatch.on { border-color: var(--foreground); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--foreground); }
.pl-notes-list { display: flex; flex-direction: column; gap: 10px; }
.pl-note { position: relative; border: 1px solid; border-radius: 10px; padding: 10px 30px 8px 12px; }
.pl-note-text { font-size: 13px; line-height: 1.45; color: #2a2a2a; white-space: pre-wrap; word-wrap: break-word; }
.pl-note-meta { margin-top: 6px; font-size: 11px; color: rgba(0,0,0,0.5); font-weight: 600; }
.pl-note-del { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 17px; line-height: 1; color: rgba(0,0,0,0.35); cursor: pointer; }
.pl-note-del:hover { color: var(--destructive); }

/* Archivos del lead */
.pl-files-upload { margin-bottom: 14px; }
.pl-files-drop { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border: 1.5px dashed var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); font-size: 13px; font-weight: 600; cursor: pointer; }
.pl-files-drop:hover { border-color: var(--primary); color: var(--primary); }
.pl-files-drop svg { width: 18px; height: 18px; }
.pl-files-list { display: flex; flex-direction: column; gap: 8px; }
.pl-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; background: var(--card); }
.pl-file-ico { width: 38px; height: 38px; flex: none; border-radius: 8px; background: var(--accent); color: var(--primary); display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; }
.pl-file-info { flex: 1; min-width: 0; }
.pl-file-name { display: block; font-size: 13px; font-weight: 600; color: var(--foreground); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-file-name:hover { color: var(--primary); text-decoration: underline; }
.pl-file-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }

/* ===== Conversaciones (bandeja unificada) ===== */
.cv-warn { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; font-size: 13px; color: var(--muted-foreground); }
.cv-warn a { color: var(--primary); font-weight: 600; }
.cv-grid { display: grid; grid-template-columns: 320px 1fr 300px; gap: 16px; height: calc(100vh - 270px); min-height: 480px; }
@media (max-width: 1100px) { .cv-grid { grid-template-columns: 280px 1fr; } .cv-side-col { display: none; } }
.cv-back { display: none; }
@media (max-width: 768px) {
  /* Una sola columna a la vez: lista por defecto, hilo al elegir un chat. */
  .cv-grid { grid-template-columns: 1fr; height: auto; }
  .cv-list-col, .cv-thread-col { height: calc(100vh - 210px); min-height: 420px; }
  .cv-grid:not(.cv-has-active) .cv-thread-col { display: none; }
  .cv-grid.cv-has-active .cv-list-col { display: none; }
  .cv-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: none; margin-left: -2px;
    border: 1px solid var(--border); border-radius: 9px; background: var(--card);
    color: var(--foreground); cursor: pointer;
  }
  .cv-back svg { width: 18px; height: 18px; }
}

.cv-list-col, .cv-thread-col, .cv-side-col { background: var(--card); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.cv-side-col { padding: 14px; gap: 14px; overflow-y: auto; }

.cv-search { position: relative; padding: 12px; border-bottom: 1px solid var(--border); }
.cv-search svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-foreground); }
.cv-search input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); padding: 0 10px 0 32px; font-size: 12.5px; }

.cv-list { flex: 1; overflow-y: auto; }
.cv-empty, .cv-side-empty { padding: 18px; font-size: 12.5px; color: var(--muted-foreground); }
.cv-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 11px 12px; cursor: pointer; }
.cv-item:hover { background: var(--muted); }
.cv-item.on { background: var(--accent); }
.cv-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--gradient-violet, linear-gradient(135deg,#7c4dff,#a78bfa)); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.cv-avatar.lg { width: 42px; height: 42px; font-size: 13px; }
.cv-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cv-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-item-time { font-size: 10px; color: var(--muted-foreground); flex: none; }
.cv-item-last { font-size: 11.5px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-item-tags { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.cv-line-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--muted); color: var(--muted-foreground); }
.cv-unread { font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--destructive); color: #fff; display: grid; place-items: center; }

.cv-thread-empty, .cv-side-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted-foreground); font-size: 13px; text-align: center; padding: 24px; }
.cv-thread-empty svg { width: 46px; height: 46px; opacity: 0.4; }
.cv-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cv-th-name { font-size: 14px; font-weight: 700; }
.cv-th-sub { font-size: 11px; color: var(--muted-foreground); }
.cv-line-select { border: 1px solid var(--border); border-radius: 8px; font-size: 11.5px; padding: 5px 8px; background: var(--card); max-width: 150px; }
.cv-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; background: var(--muted); }
.cv-composer { padding: 12px; border-top: 1px solid var(--border); }
.cv-composer-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--background, var(--card)); padding: 8px; }
.cv-composer-box textarea { flex: 1; border: none; background: transparent; resize: none; font-size: 13px; outline: none; max-height: 120px; }
.cv-send { width: 38px; height: 38px; flex: none; border: none; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cv-send:disabled { opacity: 0.5; cursor: not-allowed; }
.cv-send svg { width: 17px; height: 17px; }

.cv-context { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.cv-ctx-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--muted-foreground); }
.cv-ctx-name { font-size: 15px; font-weight: 700; margin-top: 3px; }
.cv-ctx-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.cv-ctx-rows > div { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.cv-ctx-rows span { color: var(--muted-foreground); }
.cv-copilot { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.cv-copilot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cv-bot { width: 26px; height: 26px; border-radius: 7px; background: var(--gold, #e9b949); color: #3a2c00; display: grid; place-items: center; }
.cv-bot svg { width: 15px; height: 15px; }
.cv-copilot-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); }
.cv-soon { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }
.cv-copilot-note { font-size: 11.5px; color: var(--muted-foreground); line-height: 1.5; }
.cv-copilot-note a { color: var(--primary); font-weight: 600; }
.cv-dl { display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 600; text-decoration: none; opacity: 0.85; }
.pl-bubble.in .cv-dl { color: var(--primary); }
.pl-bubble.out .cv-dl { color: rgba(255,255,255,0.92); text-decoration: underline; }

/* ===== Metricas / reportes ===== */
.rep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: 1fr; } }
.rep-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.rep-card.rep-wide { grid-column: 1 / -1; }
.rep-title { font-size: 14px; font-weight: 700; }
.rep-sub { font-size: 11.5px; color: var(--muted-foreground); margin-bottom: 12px; }
.rep-empty { font-size: 12.5px; color: var(--muted-foreground); padding: 10px 0; }

.rep-bars { display: flex; flex-direction: column; gap: 9px; }
.rep-bar-row { display: grid; grid-template-columns: 120px 1fr 38px; align-items: center; gap: 10px; }
.rep-bar-lbl { font-size: 12px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-bar-track { height: 16px; background: var(--muted); border-radius: 6px; overflow: hidden; }
.rep-bar { height: 100%; border-radius: 6px; min-width: 2px; background: var(--primary); transition: width .3s; }
.rep-bar.k-won { background: #3fae6b; }
.rep-bar.k-lost { background: #d0455f; }
.rep-bar.k-open { background: var(--primary); }
.rep-bar.k-loss { background: #d89a36; }
.rep-bar.k-dest { background: #4e80b5; }
.rep-bar-val { font-size: 12.5px; font-weight: 700; text-align: right; }

.rep-cols { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.rep-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.rep-col-val { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.rep-col-bar-track { flex: 1; width: 60%; display: flex; align-items: flex-end; }
.rep-col-bar { width: 100%; min-height: 3px; background: var(--gradient-violet, linear-gradient(180deg,#7c4dff,#a78bfa)); border-radius: 6px 6px 0 0; transition: height .3s; }
.rep-col-lbl { font-size: 11px; font-weight: 600; margin-top: 6px; text-transform: capitalize; }
.rep-col-sub { font-size: 10px; color: var(--muted-foreground); }

.rep-mini-kpis { display: flex; gap: 10px; }
.rep-mini-kpis > div { flex: 1; background: var(--muted); border-radius: 10px; padding: 10px; text-align: center; }
.rep-mini-kpis .n { display: block; font-size: 20px; font-weight: 800; }
.rep-mini-kpis .l { display: block; font-size: 10.5px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ===== Servidores de IA ===== */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 1100px; }
.ai-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.ai-card-head { display: flex; align-items: center; gap: 11px; }
.ai-logo { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; background: var(--primary); }
.ai-logo.p-claude { background: #d97757; }
.ai-logo.p-gemini { background: #4e80b5; }
.ai-logo.p-gpt { background: #10a37f; }
.ai-logo.p-deepseek { background: #4d6bfe; }
.ai-name { font-size: 14.5px; font-weight: 700; }
.ai-prov { font-size: 11px; color: var(--muted-foreground); }
.ai-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.ai-rows span { color: var(--muted-foreground); }
.ai-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 6px 0 2px; cursor: pointer; }

/* Barra de cupo mensual de tokens */
.ag-quota-bar { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; margin: 6px 0 4px; }
.ag-quota-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.ag-quota-fill.over { background: var(--destructive); }

/* Editor de agente en dos columnas */
.ag-editor-cols { display: flex; gap: 18px; align-items: flex-start; }
.ag-editor-left { flex: 1; min-width: 0; }
.ag-editor-right { width: 380px; flex: none; border-left: 1px solid var(--border); padding-left: 18px; align-self: stretch; }
@media (max-width: 980px) { .ag-editor-cols { flex-direction: column; } .ag-editor-right { width: 100%; border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 14px; } }

/* Toolbar de editor de texto (prompts) */
.rt-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 5px; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--muted); position: relative; }
.rt-btn { min-width: 28px; height: 26px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); cursor: pointer; font-size: 12px; line-height: 1; display: inline-grid; place-items: center; }
.rt-btn:hover { border-color: var(--primary); }
.rt-btn.on { background: var(--primary); color: #fff; }
.rt-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.rt-emojis { position: absolute; top: 34px; left: 5px; z-index: 5; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.rt-emoji { width: 28px; height: 28px; border: none; background: none; cursor: pointer; font-size: 16px; border-radius: 6px; }
.rt-emoji:hover { background: var(--muted); }

/* Listas de prompts y recursos del agente */
.ag-list { display: flex; flex-direction: column; gap: 8px; }
.ag-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.ag-item-main { flex: 1; min-width: 0; }
.ag-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-item-sub { font-size: 11.5px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-rtype { flex: none; width: 38px; height: 26px; border-radius: 6px; background: var(--accent); color: var(--primary); font-size: 9.5px; font-weight: 800; display: grid; place-items: center; letter-spacing: 0.04em; }
/* Pill que marca un campo de cache como sticky (no actualizable durante la conversacion). */
.ag-pill-sticky { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; background: oklch(0.94 0.04 80); color: oklch(0.45 0.12 60); border: 1px solid oklch(0.85 0.07 80); vertical-align: middle; }

/* === Modulo Tableros (Kanban) === */
/* Vista lista de tableros (board picker). */
.tb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; max-width: 1280px; }
.tb-card { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 18px 20px; cursor: pointer; transition: all 0.15s; }
.tb-card:hover { border-color: var(--primary); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.tb-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tb-card-color { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tb-card-name { font-weight: 700; font-size: 15.5px; }
.tb-card-desc { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 12px; min-height: 32px; }
.tb-card-foot { display: flex; gap: 8px; font-size: 11px; color: var(--muted-foreground); }
.tb-card-stat { background: var(--accent); padding: 3px 10px; border-radius: 999px; }

/* Toolbar superior del tablero (search + sort + view + filtros). */
.tb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; margin-bottom: 18px; box-shadow: var(--shadow-soft); flex-wrap: wrap; }
.tb-toolbar-search { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.tb-toolbar-search input { width: 100%; padding: 8px 12px 8px 36px; background: var(--muted); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.tb-toolbar-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tb-toolbar-search .tb-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); width: 16px; height: 16px; }
.tb-toolbar-right { display: flex; align-items: center; gap: 12px; }
.tb-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); }
.tb-sort select { background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; }
.tb-view { display: flex; background: var(--muted); padding: 3px; border-radius: 8px; border: 1px solid var(--border); }
.tb-view button { background: transparent; border: 0; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tb-view button.active { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-soft); }
.tb-view svg { width: 14px; height: 14px; }

/* Tablero Kanban (vista detalle). */
.tb-board { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 14px; min-height: 480px; }
.tb-col { width: 320px; min-width: 320px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 320px); }
.tb-col-drag { background: oklch(0.97 0.04 290); border: 2px dashed var(--primary); }
.tb-col-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: oklch(0.985 0 0); border-radius: 14px 14px 0 0; }
.tb-col-name { font-weight: 600; font-size: 14px; color: var(--foreground); }
.tb-col-count { background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tb-col-body { padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: oklch(0.99 0 0); }
.tb-col-empty { text-align: center; padding: 24px 12px; font-size: 12.5px; color: var(--muted-foreground); font-style: italic; }
.tb-col-foot { padding: 12px; border-top: 1px solid var(--border); background: var(--card); border-radius: 0 0 14px 14px; }
/* Boton compacto en el footer de cada columna: solo abre el modal de nueva tarea. */
.tb-col-add { width: 100%; padding: 6px 10px; border: 1px dashed var(--border); background: transparent; color: var(--muted-foreground); border-radius: 8px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; }
.tb-col-add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.tb-col-add-plus { font-size: 14px; font-weight: 700; line-height: 1; }
.tb-col-add svg { width: 12px; height: 12px; flex: none; }

/* Asegura que cualquier SVG inline en botones/listas del modulo Tableros no se infle. */
.tb-toolbar svg { width: 14px; height: 14px; flex: none; }
.tb-card-meta-item svg { width: 12px; height: 12px; flex: none; }
.tb-due svg { width: 12px; height: 12px; flex: none; }
.tb-modal-side-btn svg { width: 14px; height: 14px; flex: none; }
.tb-modal-add-btn svg { width: 14px; height: 14px; flex: none; }
.tb-modal-close svg { width: 18px; height: 18px; flex: none; }
.tb-pop svg { width: 14px; height: 14px; flex: none; }
.tb-check-item input[type="checkbox"] { flex: none; }
.tb-check-item-del svg { width: 14px; height: 14px; flex: none; }
.tb-modal-head-icon { width: 26px !important; height: 26px !important; }
.tb-modal-section-icon { width: 22px !important; height: 22px !important; }
/* Avatar SVG fallback (cuando no hay miembros). */
.tb-avatar.empty svg { width: 12px; height: 12px; flex: none; }

/* Tarjetas dentro de las columnas del Kanban. */
.tb-card-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all 0.15s; box-shadow: 0 1px 2px oklch(0 0 0 / 0.04); }
.tb-card-item:hover { border-color: var(--primary); box-shadow: var(--shadow-soft); }
.tb-card-item.dragging { opacity: 0.5; }
.tb-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tb-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: oklch(0.94 0 0); color: oklch(0.4 0.02 240); }
.tb-card-title { font-size: 13.5px; font-weight: 500; margin-bottom: 10px; line-height: 1.35; color: var(--foreground); }
.tb-card-meta { display: flex; gap: 12px; color: var(--muted-foreground); font-size: 11px; margin-bottom: 10px; align-items: center; }
.tb-card-meta-item { display: flex; align-items: center; gap: 3px; }
.tb-card-meta-item svg { width: 12px; height: 12px; }
.tb-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tb-members { display: flex; }
.tb-avatar { width: 24px; height: 24px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; margin-left: -6px; border: 2px solid var(--card); }
.tb-avatar:first-child { margin-left: 0; }
.tb-avatar.empty { background: transparent; border: 2px dashed var(--border); color: var(--muted-foreground); }
.tb-avatar.lg { width: 32px; height: 32px; font-size: 11.5px; }
.tb-due { font-size: 11px; color: var(--muted-foreground); display: flex; align-items: center; gap: 3px; }
.tb-due svg { width: 12px; height: 12px; }
.tb-due.late { color: var(--destructive); background: oklch(0.96 0.03 25); padding: 2px 7px; border-radius: 4px; }
.tb-card-new { background: var(--card); border: 1px solid var(--primary); border-radius: 10px; padding: 12px; }
.tb-card-new textarea { width: 100%; border: 0; outline: 0; font-size: 13.5px; resize: none; min-height: 60px; background: transparent; }
.tb-card-new-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* Vista Lista (sustituye al Kanban cuando se elige). */
.tb-list { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.tb-list table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tb-list thead th { text-align: left; padding: 12px 16px; background: oklch(0.985 0 0); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.tb-list tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tb-list tbody tr:hover { background: var(--muted); cursor: pointer; }
.tb-list tbody tr:last-child td { border-bottom: 0; }
.tb-list-empty { padding: 32px; text-align: center; color: var(--muted-foreground); font-style: italic; }
.tb-status { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tb-status.todo { background: var(--muted); color: var(--muted-foreground); }
.tb-status.progress { background: oklch(0.94 0.05 240); color: oklch(0.4 0.18 240); }
.tb-status.review { background: oklch(0.94 0.06 65); color: oklch(0.45 0.18 65); }
.tb-status.done { background: oklch(0.94 0.07 145); color: oklch(0.4 0.17 145); }

/* Modal detalle de tarjeta (2 columnas: contenido + sidebar). */
.tb-modal { width: 100%; max-width: 880px; background: oklch(0.98 0 0); border-radius: 14px; position: relative; }
.tb-modal-head { padding: 22px 28px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.tb-modal-head-icon { width: 26px; height: 26px; color: var(--muted-foreground); flex: none; margin-top: 2px; }
.tb-modal-head-content { flex: 1; }
.tb-modal-title { font-size: 1.4rem; font-weight: 700; line-height: 1.2; margin: 0 0 4px; color: var(--foreground); }
.tb-modal-subtitle { font-size: 13px; color: var(--muted-foreground); margin: 0; }
.tb-modal-subtitle strong { color: var(--foreground); text-decoration: underline; cursor: pointer; }
.tb-modal-close { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 999px; color: var(--muted-foreground); cursor: pointer; display: grid; place-items: center; transition: background 0.15s; flex: none; }
.tb-modal-close:hover { background: var(--muted); }
.tb-modal-body { display: flex; gap: 32px; padding: 8px 28px 28px; }
.tb-modal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.tb-modal-side { width: 200px; flex: none; display: flex; flex-direction: column; gap: 22px; }
.tb-modal-side h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); margin: 0 0 8px; }
.tb-modal-side-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: oklch(0.93 0 0); color: var(--foreground); border: 0; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.tb-modal-side-btn:hover { background: oklch(0.88 0 0); }
.tb-modal-side-btn svg { width: 14px; height: 14px; flex: none; }
.tb-modal-side-btn.danger { color: var(--foreground); }
.tb-modal-side-btn.danger:hover { background: oklch(0.95 0.04 25); color: var(--destructive); }
.tb-modal-side-btn.danger svg { color: var(--destructive); }
.tb-modal-side-divider { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* Secciones dentro del modal (members/tags/desc/checklist/activity). */
.tb-modal-section { display: flex; gap: 16px; align-items: flex-start; }
.tb-modal-section-icon { width: 22px; height: 22px; color: var(--muted-foreground); flex: none; margin-top: 4px; }
.tb-modal-section-body { flex: 1; min-width: 0; }
.tb-modal-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tb-modal-section-title { font-size: 1rem; font-weight: 600; color: var(--foreground); margin: 0; }
.tb-modal-section-action { padding: 5px 12px; background: oklch(0.93 0 0); color: var(--foreground); border: 0; border-radius: 4px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.tb-modal-section-action:hover { background: oklch(0.88 0 0); }
.tb-modal-inline-row { display: flex; flex-wrap: wrap; gap: 24px; padding-left: 38px; }
.tb-modal-mini-h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); margin: 0 0 8px; }
.tb-modal-add-btn { width: 32px; height: 32px; border-radius: 999px; background: oklch(0.93 0 0); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--muted-foreground); transition: background 0.15s; }
.tb-modal-add-btn:hover { background: oklch(0.88 0 0); }
.tb-modal-add-btn.sq { border-radius: 4px; width: 32px; height: 28px; }
.tb-modal-tag { font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 4px; background: oklch(0.91 0 0); color: var(--foreground); cursor: pointer; }
.tb-modal-tag:hover { opacity: 0.85; }

/* Descripcion. */
.tb-desc-empty { padding: 12px 14px; background: oklch(0.93 0 0); border-radius: 6px; color: var(--muted-foreground); font-size: 13px; cursor: pointer; transition: background 0.15s; }
.tb-desc-empty:hover { background: oklch(0.88 0 0); }
.tb-desc-text { font-size: 13.5px; color: var(--foreground); white-space: pre-wrap; line-height: 1.55; cursor: pointer; }
.tb-desc-edit { display: flex; flex-direction: column; gap: 8px; }
.tb-desc-edit textarea { width: 100%; min-height: 100px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13.5px; font-family: inherit; resize: vertical; }
.tb-desc-edit-actions { display: flex; gap: 8px; }

/* Checklist. */
.tb-check-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tb-check-progress-label { font-size: 11.5px; color: var(--muted-foreground); width: 36px; }
.tb-check-bar { flex: 1; height: 8px; background: oklch(0.92 0 0); border-radius: 999px; overflow: hidden; }
.tb-check-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s; }
.tb-check-list { display: flex; flex-direction: column; gap: 4px; }
.tb-check-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; transition: background 0.15s; }
.tb-check-item:hover { background: oklch(0.93 0 0); }
.tb-check-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex: none; }
.tb-check-item-text { flex: 1; font-size: 13.5px; color: var(--foreground); }
.tb-check-item-text.done { color: var(--muted-foreground); text-decoration: line-through; }
.tb-check-item-del { background: transparent; border: 0; color: var(--muted-foreground); cursor: pointer; padding: 4px; border-radius: 4px; opacity: 0; transition: opacity 0.15s; }
.tb-check-item:hover .tb-check-item-del { opacity: 1; }
.tb-check-item-del:hover { color: var(--destructive); background: oklch(0.95 0.04 25); }
.tb-check-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tb-check-add input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* Actividad (comentarios + log). */
.tb-act-input { display: flex; gap: 10px; margin-bottom: 18px; }
.tb-act-input-box { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: box-shadow 0.15s; }
.tb-act-input-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tb-act-input-box textarea { width: 100%; min-height: 60px; padding: 10px 12px; border: 0; outline: 0; font-size: 13px; font-family: inherit; resize: none; }
.tb-act-input-foot { background: oklch(0.985 0 0); padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); }
.tb-act-list { display: flex; flex-direction: column; gap: 14px; }
.tb-act-item { display: flex; gap: 12px; }
.tb-act-item-avatar { width: 32px; height: 32px; border-radius: 999px; background: oklch(0.93 0 0); color: var(--muted-foreground); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.tb-act-item-bubble { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; flex: 1; box-shadow: 0 1px 2px oklch(0 0 0 / 0.04); max-width: 100%; }
.tb-act-item-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.tb-act-item-name { font-weight: 600; font-size: 13px; color: var(--foreground); }
.tb-act-item-time { font-size: 11px; color: var(--muted-foreground); }
.tb-act-item-text { font-size: 13px; color: var(--foreground); margin: 0; }
.tb-act-item-action { font-size: 13px; color: var(--muted-foreground); margin-top: 6px; }
.tb-act-item-action strong { color: var(--foreground); font-weight: 600; }

/* Popover de seleccion (miembros/etiquetas/datas). Posicionado DENTRO del modal a la izquierda del sidebar. */
.tb-pop { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px oklch(0 0 0 / 0.18); padding: 14px 14px 12px; width: 280px; right: 232px; }
.tb-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tb-pop-title { font-size: 13px; font-weight: 600; color: var(--foreground); }
.tb-pop-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.tb-pop-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s; font-size: 13px; }
.tb-pop-item:hover { background: var(--muted); }
.tb-pop-item.selected { background: var(--primary-soft); color: var(--primary); }
.tb-pop-add { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.tb-pop-add input { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }

/* Paleta de colores para titulo de tarjeta. */
.tb-color-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tb-color-swatch { width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 6px; cursor: pointer; padding: 0; transition: transform 0.1s, border-color 0.15s; }
.tb-color-swatch:hover { transform: scale(1.08); }
.tb-color-swatch.selected { border-color: var(--foreground); }
.tb-color-swatch.clear { background: var(--card); border: 1px dashed var(--border); color: var(--muted-foreground); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* Configurar tablero (panel lateral). */
.tb-config { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 980px; }
.tb-config-section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.tb-config-section h3 { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.tb-config-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tb-config-row:last-child { border-bottom: 0; }
.tb-config-row .tb-color-dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.tb-config-row input[type="text"] { flex: 1; padding: 4px 8px; border: 1px solid transparent; border-radius: 4px; font-size: 13px; background: transparent; }
.tb-config-row input[type="text"]:focus { border-color: var(--primary); outline: 0; background: var(--muted); }

/* Entradas del log de prompts enviados a la IA (chat de prueba del agente). */
.ag-prompt-entry { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 10px 12px; }
.ag-prompt-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11.5px; }
.ag-prompt-entry-time { color: var(--muted-foreground); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; }
.ag-prompt-entry-title { color: var(--primary); font-weight: 700; font-size: 11.5px; }
.ag-prompt-entry-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); margin: 4px 0 4px; }
.ag-prompt-entry textarea { resize: vertical; }

/* Scroll dentro de listas largas (recursos, cache fields). ~10 items visibles. */
.ag-list-scroll { max-height: 440px; overflow-y: auto; padding-right: 6px; }

/* Acordeon para colapsar secciones del editor de agente. */
.ag-accordion { border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.ag-accordion-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: transparent; border: 0; cursor: pointer; text-align: left; }
.ag-accordion-head:hover { background: var(--muted); }
.ag-accordion-chev { display: inline-block; transition: transform 0.15s ease; color: var(--muted-foreground); font-size: 12px; width: 14px; }
.ag-accordion-chev.open { transform: rotate(90deg); }
.ag-accordion-count { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--accent); color: var(--primary); font-size: 11px; font-weight: 700; }
.ag-accordion-spacer { flex: 1; }
.ag-accordion-body { padding: 4px 12px 14px; border-top: 1px solid var(--border); }

/* Chat de prueba del agente */
.ag-test { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ag-test-body { max-height: 380px; min-height: 160px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--muted); }
.ag-test-empty { color: var(--muted-foreground); font-size: 12.5px; text-align: center; margin: auto; font-style: italic; }
.ag-bubble { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ag-bubble.me { align-self: flex-end; background: var(--gradient-violet, #7c4dff); color: #fff; border-bottom-right-radius: 4px; }
.ag-bubble.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ag-bubble.ag-typing { color: var(--muted-foreground); font-style: italic; }
.ag-attach { margin-top: 6px; }
.ag-attach img, .ag-attach video { max-width: 200px; max-height: 200px; border-radius: 8px; display: block; }
.ag-attach audio { max-width: 220px; }
.ag-attach a { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.ag-bubble.bot .ag-attach a { color: var(--primary); }
.ag-attach-text { background: rgba(0,0,0,0.04); border-left: 3px solid var(--primary); border-radius: 4px; padding: 6px 8px; font-size: 12.5px; white-space: pre-wrap; }
.ag-attach-cap { font-size: 12px; margin-top: 3px; }

/* Enviar prueba a telefono */
.ag-phone { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--card); }
.ag-phone-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ag-phone-row { display: flex; gap: 6px; margin-top: 8px; }
.ag-phone-row .form-control { font-size: 12px; }
.ag-test-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--card); }
.ag-test-input input { flex: 1; }

/* Separador visual entre campos del lead (tipo de campo Separador) */
.pl-quote-tplsel { max-width: 200px; font-size: 12.5px; padding: 4px 8px; }
.pl-field-separator { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--primary); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pl-field-separator::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pl-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
/* Contenedor fijo (no hace scroll) para el chat: ancla el overlay de drag&drop a la vista visible */
.pl-chat-bodywrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Overlay para arrastrar y soltar documentos sobre la conversacion (visible aunque el chat este lleno) */
.pl-chat-dropmask { display: none; position: absolute; inset: 8px; z-index: 5; border: 2px dashed var(--primary); border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); font-weight: 700; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.pl-chat-bodywrap.pl-chat-dragover .pl-chat-dropmask { display: flex; }
.pl-date-divider { text-align: center; font-size: 10px; color: var(--muted-foreground); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin: 4px 0 2px; display: flex; align-items: center; gap: 10px; }
.pl-date-divider::before, .pl-date-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pl-bubble { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; word-wrap: break-word; position: relative; }
.pl-bubble .t { font-size: 9.5px; opacity: 0.7; margin-top: 3px; }
.pl-bubble.out { align-self: flex-end; background: var(--gradient-violet); color: #fff; border-bottom-right-radius: 4px; }
.pl-bubble.in { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
/* Preserva los saltos de linea del mensaje (antes se juntaba todo en una sola linea). */
.pl-bubble-text { white-space: pre-wrap; word-break: break-word; }
/* Reaccion del agente (emoji) anclada al borde inferior de la burbuja, estilo WhatsApp. */
.pl-bubble-reaction { position: absolute; bottom: -10px; font-size: 14px; line-height: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.pl-bubble.in .pl-bubble-reaction { right: 8px; }
.pl-bubble.out .pl-bubble-reaction { left: 8px; }
.pl-chat-empty { color: var(--muted-foreground); font-size: 12px; text-align: center; margin: auto; font-style: italic; padding: 20px; }

/* Mensajes pregrabados con categorias */
.pl-chat-quick { padding: 10px 14px 6px; border-top: 1px solid var(--border); background: var(--card); }
.pl-qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pl-qr-head > span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--muted-foreground); }
.pl-qr-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pl-qr-tab { font-size: 10.5px; padding: 3px 9px; border-radius: 999px; color: var(--muted-foreground); font-weight: 700; border: none; background: none; cursor: pointer; letter-spacing: 0.02em; }
.pl-qr-tab:hover { color: var(--foreground); }
.pl-qr-tab.active { background: var(--primary); color: #fff; }
.pl-qr-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 116px; overflow-y: auto; }
.pl-quick-chip { font-size: 11.5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--muted); color: var(--foreground); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-quick-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--accent); }
.pl-chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card); align-items: flex-end; }
.pl-chat-input input,
.pl-chat-input textarea { flex: 1; border: 1px solid var(--border); border-radius: 16px; padding: 9px 14px; font-size: 13px; min-width: 0; font-family: inherit; line-height: 1.4; }
.pl-chat-input textarea { resize: none; max-height: 160px; }
.pl-quote-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card); }
.pl-quote-actions .btn { font-size: 12.5px; padding: 7px 12px; }
.pl-quote-confirm { font-size: 12.5px; font-weight: 600; color: var(--foreground); }
.pl-quote-msg { font-size: 12px; color: var(--muted-foreground); }
.pl-chat-send { width: 38px; height: 38px; border-radius: 50%; background: var(--gradient-violet); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.pl-chat-send:disabled { opacity: 0.5; cursor: default; }
.pl-chat-send svg { width: 16px; height: 16px; }
/* Boton de microfono / nota de voz */
.pl-chat-mic { width: 38px; height: 38px; border-radius: 50%; background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.pl-chat-mic:hover { color: var(--primary); border-color: var(--primary); }
.pl-chat-mic:disabled { opacity: 0.5; cursor: default; }
.pl-chat-mic svg { width: 16px; height: 16px; }
.pl-chat-mic.recording { background: #fde8e8; color: #d33; border-color: #f3b6b6; }
.pl-rec-bar { flex: 1; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid #f3b6b6; border-radius: 16px; font-size: 13px; color: #d33; min-width: 0; background: #fff6f6; }
.pl-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #d33; flex: none; animation: pl-rec-pulse 1s infinite; }
@keyframes pl-rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Barra de progreso de subida de adjuntos + spinner de actividad */
.pl-upload { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--card); }
.pl-upload-info { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-foreground); }
.pl-upload-track { height: 6px; border-radius: 4px; background: var(--muted); overflow: hidden; }
.pl-upload-fill { height: 100%; background: var(--gradient-violet); border-radius: 4px; transition: width 0.15s linear; }
.pl-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); flex: none; display: inline-block; vertical-align: -2px; animation: pl-spin 0.7s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* Responder a un mensaje (cita simple) */
.pl-bubble-reply { position: absolute; top: 2px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,0.06); color: var(--muted-foreground); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.pl-bubble:hover .pl-bubble-reply { opacity: 1; }
.pl-bubble.out .pl-bubble-reply { right: auto; left: 4px; background: rgba(255,255,255,0.25); color: #fff; }
.pl-bubble-reply svg { width: 13px; height: 13px; }
.pl-reply-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--card); }
.pl-reply-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--primary); flex: none; }
.pl-reply-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pl-reply-label { font-size: 11px; font-weight: 600; color: var(--primary); }
.pl-reply-snippet { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-reply-x { border: none; background: none; color: var(--muted-foreground); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; flex: none; }

/* Adjuntos */
.pl-attach { position: relative; flex-shrink: 0; }
.pl-attach-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; cursor: pointer; }
.pl-attach-btn:hover { color: var(--primary); border-color: var(--primary); }
.pl-attach-btn svg { width: 16px; height: 16px; }
.pl-attach-menu { position: absolute; bottom: 44px; left: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 20; min-width: 150px; }
.pl-attach-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; color: var(--foreground); background: none; border: none; cursor: pointer; text-align: left; }
.pl-attach-item:hover { background: var(--muted); }
.pl-attach-item svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.pl-media-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; margin-bottom: 4px; }
.pl-media-doc { display: inline-block; font-size: 12.5px; text-decoration: underline; margin-bottom: 4px; }
.pl-bubble.out .pl-media-doc { color: #fff; }

/* Toggle Datos/Chat: solo visible en movil. */
.pl-lead-mobtabs { display: none; }
@media (max-width: 880px) {
    .pl-lead-dialog { flex-direction: column; max-height: 94vh; }
    .pl-lead-mobtabs { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--card); flex: 0 0 auto; }
    .pl-lead-mobtabs button { flex: 1; padding: 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); font-weight: 700; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }
    .pl-lead-mobtabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    /* Mostrar solo el panel seleccionado y dejar que ocupe el alto disponible. */
    .pl-lead-dialog .pl-lead-left, .pl-lead-dialog .pl-chat { flex: 1 1 auto; max-height: none; min-height: 0; }
    .pl-lead-dialog.mob-datos .pl-chat { display: none; }
    .pl-lead-dialog.mob-chat .pl-lead-left { display: none; }
    .pl-chat { border-left: none; border-top: 1px solid var(--border); }
}

/* ===== Pipeline modal: campos por etapa ===== */
.pl-stagegroup { margin-bottom: 18px; }
.pl-stagegroup-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: var(--primary); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.pl-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pl-field.col2 { grid-column: 1 / -1; }
.pl-field.col-med { grid-column: span 2; }   /* Media: ocupa 2 de las 3 columnas. */
.pl-field.col-full { grid-column: 1 / -1; }   /* Grande: ancho completo. */
/* En pantallas medianas bajamos a 2 columnas para que los campos no queden apretados. */
@media (max-width: 980px) { .pl-fields { grid-template-columns: 1fr 1fr; } }
/* Caption pegado a su texto de ayuda (menos separacion) */
.pl-field .form-label { margin-bottom: 1px; }
.pl-field-help { font-size: 11px; color: var(--muted-foreground); margin: 0 0 5px; font-style: italic; line-height: 1.25; }
/* Campo de moneda con simbolo como prefijo */
.pl-money-input { display: flex; align-items: stretch; }
.pl-money-input .pl-money-sign { flex: none; display: flex; align-items: center; padding: 0 9px; border: 1px solid var(--border); border-right: none; border-radius: 0.5rem 0 0 0.5rem; background: var(--muted); color: var(--muted-foreground); font-weight: 700; font-size: 12.5px; }
.pl-money-input input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pl-multi-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pl-multi-idx { flex: none; min-width: 22px; height: 22px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pl-multi-del { flex: none; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--destructive); cursor: pointer; line-height: 1; font-size: 16px; }
.pl-multi-add { border: 1px dashed var(--border); border-radius: 7px; background: none; color: var(--primary); font-size: 12px; font-weight: 600; padding: 4px 10px; cursor: pointer; }
.cfg-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); margin-left: 6px; }
/* Boton Guardar con cambios pendientes en el modal del lead: color ambar para llamar la atencion. */
.pl-save-dirty { background: #f59e0b; border: 1px solid #f59e0b; color: #1f2937; font-weight: 700; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.pl-save-dirty:hover { background: #d97706; border-color: #d97706; color: #fff; }
.pl-saved-flag { font-size: 12px; font-weight: 600; color: #16a34a; display: inline-flex; align-items: center; gap: 4px; }
.pl-saved-flag::before { content: "✓"; font-weight: 700; }
/* Campo Total (solo lectura, calculado). */
.pl-total-field { background: var(--muted); font-weight: 700; color: var(--primary); }

/* Modulo Plantillas de cotizacion */
.pl-tpl-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.pl-tpl-list { padding: 14px; }
.pl-tpl-list-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); margin-bottom: 8px; }
.pl-tpl-item-row { display: flex; align-items: stretch; gap: 6px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.pl-tpl-item-row.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pl-tpl-item-row:hover .pl-tpl-item-del { opacity: 1; }
.pl-tpl-item { display: block; flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 10px 12px; cursor: pointer; }
.pl-tpl-item .nm { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.pl-tpl-item .mt { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
/* Boton X de eliminar inline en la lista. Aparece al hover de toda la fila o siempre en active. */
.pl-tpl-item-del { display: grid; place-items: center; width: 36px; flex: none; border: 0; background: transparent; color: var(--muted-foreground); cursor: pointer; opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.pl-tpl-item-del svg { width: 15px; height: 15px; }
.pl-tpl-item-del:hover { background: oklch(0.95 0.04 25); color: var(--destructive); }
.pl-tpl-item-del:disabled { opacity: 0.35 !important; cursor: not-allowed; }
.pl-tpl-item-row.active .pl-tpl-item-del { opacity: 0.7; }
.pl-tpl-default { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); }
.pl-tpl-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pl-tpl-html { font-family: var(--bs-font-monospace, monospace); font-size: 12.5px; line-height: 1.5; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.pl-tpl-vars { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.pl-tpl-vars-title { font-size: 11.5px; font-weight: 700; color: var(--muted-foreground); margin-bottom: 8px; }
.pl-tpl-vars-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-tpl-stage-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); margin: 8px 0 5px; opacity: .85; }
.pl-tpl-var { font-size: 11.5px; background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; color: var(--primary); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.pl-tpl-var:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pl-tpl-preview-head { padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--muted-foreground); background: var(--card); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.pl-tpl-preview { width: 100%; height: 540px; border: 0; background: #fff; display: block; }
@media (max-width: 1100px) {
    .pl-tpl-layout { grid-template-columns: 1fr; }
    .pl-tpl-editor { grid-template-columns: 1fr; }
}
.pl-tpl-gallery { margin-top: 18px; padding: 18px; }
.pl-tpl-gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pl-tpl-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.pl-tpl-asset { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.pl-tpl-asset-thumb { height: 110px; background: #f3f4f6 center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.pl-tpl-asset-thumb img { max-width: 100%; max-height: 110px; object-fit: contain; }
.pl-tpl-asset-name { font-size: 11.5px; padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-tpl-asset-actions { display: flex; gap: 6px; padding: 6px 8px 8px; }
.pl-tpl-asset-actions .btn-sm { font-size: 11px; padding: 3px 7px; flex: 1; }
.cfg-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--card); margin-bottom: 6px; }
.cfg-row .grow { flex: 1; min-width: 0; }

/* Acordeon nativo <details>/<summary> reutilizable en paginas tenant (Lineas WhatsApp, etc.) */
.cfg-accordion { border: 1px solid var(--border); border-radius: 0.9rem; background: var(--card); overflow: hidden; }
.cfg-accordion[open] { box-shadow: var(--shadow-soft); }
.cfg-accordion-summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; font-weight: 600; font-size: 13.5px; }
.cfg-accordion-summary::-webkit-details-marker { display: none; }
.cfg-accordion-summary:hover { background: var(--muted); }
.cfg-accordion-summary .cfg-accordion-chevron { transition: transform 0.2s; flex: none; color: var(--muted-foreground); }
.cfg-accordion[open] .cfg-accordion-summary .cfg-accordion-chevron { transform: rotate(90deg); }
.cfg-accordion[open] .cfg-accordion-summary { border-bottom: 1px solid var(--border); }
.cfg-accordion > .card { border: 0; box-shadow: none; margin: 14px 14px 14px 14px !important; max-width: none !important; }
.cfg-accordion > .card:last-child { margin-bottom: 14px !important; }

/* ===== Nav: insignia "en construccion" ===== */
.cubot-nav-soon { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground); }

/* Acordeon de la API de integracion en Mi cuenta (colapsado por defecto). */
.acct-api > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-api > summary::-webkit-details-marker { display: none; }
.acct-api > summary::before { content: "\25B8"; color: var(--muted-foreground); margin-right: 8px; transition: transform .15s ease; }
.acct-api[open] > summary::before { transform: rotate(90deg); }
.acct-api > summary:hover { background: var(--muted); border-radius: 1.25rem; }

/* =====================================================================
   RESPONSIVE - moviles y tabletas (<= 991px): menu off-canvas + ajustes
   ===================================================================== */
@media (max-width: 991.98px) {
  /* El menu se vuelve un panel deslizable; oculto por defecto (se oculta solo). */
  .cubot-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh; height: 100dvh;
    width: 280px;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  /* Abierto cuando el checkbox esta marcado. */
  .cubot-nav-toggle:checked ~ .cubot-sidebar { transform: translateX(0); }

  /* Capa oscura detras del menu abierto. */
  .cubot-nav-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1040; border: 0; }
  .cubot-nav-toggle:checked ~ .cubot-nav-overlay { display: block; }

  /* Topbar: hamburguesa a la izquierda + marca, usuario a la derecha. */
  .cubot-topbar { justify-content: flex-start; gap: 10px; padding: 0 14px; }
  .cubot-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-left: -6px;
    border-radius: 10px; cursor: pointer; color: var(--foreground);
  }
  .cubot-hamburger:hover { background: var(--muted); }
  .cubot-hamburger svg { width: 22px; height: 22px; }
  .cubot-topbar-brand { display: inline-block; font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
  .cubot-topbar-brand span { color: var(--primary); }
  .cubot-topbar form { margin-left: auto; }            /* empuja "Salir" a la derecha */
  .cubot-user-chip { display: none; }                   /* se oculta para no saturar */

  /* Mas aire util en pantallas chicas. */
  .cubot-content { padding: 16px 14px; }
  .page-title { font-size: 1.5rem; }
  .module-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Rejillas comunes a una sola columna. */
  .ai-grid, .rep-grid, .brand-cols { grid-template-columns: 1fr !important; }

  /* Tablas anchas: que hagan scroll horizontal en vez de romper el layout. */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .cubot-content .table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Modales/cuadros anchos: que quepan en la pantalla. */
  .modal-dialog { margin: 10px; }
}

/* Telefonos pequenos. */
@media (max-width: 560px) {
  .cubot-topbar-brand { font-size: 14px; }
  .cubot-content { padding: 14px 11px; }
  .page-title { font-size: 1.32rem; }
  .page-sub { font-size: .86rem; }
  /* Formularios de 2 columnas (lead, etc.) a una sola columna. */
  .pl-fields { grid-template-columns: 1fr; }
}

/* ===== Comando "/" en el chat: popup de pregrabados (Pipeline + Conversaciones) ===== */
.cv-composer-box, .pl-chat-input { position: relative; }
.slash-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 50;
  max-height: 300px;
  overflow-y: auto;
}
.slash-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px 6px;
  font-size: 11px;
  color: var(--muted-foreground);
}
.slash-pop-head span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); }
.slash-pop-head em { font-style: normal; font-size: 10.5px; }
.slash-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name cat" "prev prev";
  gap: 1px 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}
.slash-item:hover, .slash-item.sel { background: var(--muted); }
.slash-item.sel { box-shadow: inset 0 0 0 1px var(--primary); }
.slash-name { grid-area: name; font-weight: 600; font-size: 13px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slash-cat { grid-area: cat; font-size: 10.5px; color: var(--muted-foreground); white-space: nowrap; }
.slash-prev { grid-area: prev; font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Modulo Planes de Viaje / Destinos ===== */
.btn.btn-dark { background: oklch(0.28 0.03 280); color: #fff; border: 1px solid transparent; }
.btn.btn-dark:hover { background: oklch(0.22 0.03 280); }
.form-label.sm { font-size: 10.5px; }

/* Metricas */
.dst-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.dst-stat { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.dst-stat-ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.dst-stat-ic svg { width: 24px; height: 24px; }
.dst-stat-ic.indigo { background: var(--primary-soft); color: var(--primary); }
.dst-stat-ic.emerald { background: oklch(0.95 0.06 165); color: oklch(0.55 0.13 165); }
.dst-stat-ic.amber { background: oklch(0.96 0.07 85); color: oklch(0.62 0.13 70); }
.dst-stat-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); display: block; }
.dst-stat-val { font-size: 26px; font-weight: 800; color: var(--foreground); line-height: 1.1; }
.dst-stat-hint { font-size: 11px; font-weight: 600; display: block; margin-top: 2px; }
.dst-stat-hint.indigo { color: var(--primary); }
.dst-stat-hint.emerald { color: oklch(0.55 0.13 165); }
.dst-stat-hint.amber { color: oklch(0.62 0.13 70); }
.dst-stat-split { display: flex; align-items: center; gap: 10px; margin: 2px 0; font-size: 14px; font-weight: 700; color: var(--foreground); }
.dst-stat-bar { width: 2px; height: 12px; background: var(--border); border-radius: 2px; }

/* Barra de filtros */
.dst-filters { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.dst-filters-left { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.dst-search { position: relative; flex: 1; min-width: 230px; max-width: 380px; }
.dst-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-foreground); }
.dst-search .form-control { padding-left: 36px; }
.dst-sel { max-width: 190px; }
.dst-group { display: flex; align-items: center; gap: 6px; }
.dst-group-lbl { font-size: 12px; color: var(--muted-foreground); font-weight: 600; }
.dst-group-btn { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 9px; border: none; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.dst-group-btn:hover { background: var(--muted); }
.dst-group-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* Grupos y tablero */
.dst-group-section { margin-bottom: 28px; }
.dst-group-head { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px; }
.dst-group-mark { width: 4px; height: 16px; background: var(--primary); border-radius: 3px; }
.dst-group-head h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--foreground); margin: 0; }
.dst-group-count { background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.dst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Tarjeta de destino */
.dst-card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.dst-card:hover { box-shadow: 0 16px 40px rgba(0,0,0,.12); transform: translateY(-3px); }
.dst-card-cover { position: relative; height: 168px; background: var(--muted); flex-shrink: 0; }
.dst-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.dst-card-cover-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted-foreground); }
.dst-card-cover-ph svg { width: 42px; height: 42px; }
.dst-card-cover-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,.55), transparent 55%); }
.dst-card-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.dst-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 8px; }
.dst-badge.light { background: rgba(255,255,255,.95); color: oklch(0.3 0.03 280); }
.dst-badge.solid { background: var(--primary); color: #fff; }
.dst-card-loc { position: absolute; bottom: 12px; left: 12px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dst-card-loc svg { width: 14px; height: 14px; }
.dst-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.dst-card-name { font-size: 16px; font-weight: 800; color: var(--foreground); margin: 0 0 8px; }
.dst-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.dst-tag-mini { font-size: 9.5px; font-weight: 700; background: var(--muted); color: var(--muted-foreground); padding: 2px 7px; border-radius: 5px; }
.dst-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.dst-card-meta-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); display: block; }
.dst-card-meta-val { font-size: 12px; font-weight: 700; color: var(--foreground); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dst-card-reqs .dst-card-meta-lbl { margin-bottom: 4px; }
.dst-req-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dst-req { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; border: 1px solid; }
.dst-req.amber { background: oklch(0.96 0.06 85); color: oklch(0.55 0.12 70); border-color: oklch(0.88 0.08 85); }
.dst-req.rose { background: oklch(0.95 0.04 15); color: oklch(0.55 0.18 15); border-color: oklch(0.88 0.07 15); }
.dst-req.sky { background: oklch(0.96 0.04 235); color: oklch(0.55 0.13 240); border-color: oklch(0.88 0.06 235); }
.dst-req.emerald { background: oklch(0.95 0.06 165); color: oklch(0.5 0.12 165); border-color: oklch(0.87 0.08 165); }
.dst-req-none { font-size: 10.5px; color: var(--muted-foreground); font-style: italic; }
.dst-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.dst-card-foot-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); display: block; }
.dst-card-foot-val { font-size: 16px; font-weight: 800; color: var(--primary); }
.dst-card-actions { display: flex; gap: 6px; }
.dst-icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; cursor: pointer; }
.dst-icon-btn svg { width: 16px; height: 16px; }
.dst-icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.dst-icon-btn.danger:hover { color: oklch(0.55 0.2 15); border-color: oklch(0.55 0.2 15); }

/* Vacio */
.dst-empty { text-align: center; padding: 40px 24px; max-width: 460px; margin: 24px auto; }
.dst-empty-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; margin: 0 auto 14px; }
.dst-empty-ic svg { width: 30px; height: 30px; }
.dst-empty h4 { font-size: 16px; font-weight: 700; color: var(--foreground); margin: 0 0 6px; }
.dst-empty p { font-size: 13px; color: var(--muted-foreground); margin: 0 0 14px; }

/* Modal de 4 pestanas */
.dst-modal { max-width: 920px; width: 100%; }
.dst-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.dst-tab { padding: 12px 14px; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--muted-foreground); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dst-tab:hover { color: var(--foreground); }
.dst-tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 700; }
.dst-modal-body { max-height: 60vh; overflow-y: auto; }
.dst-hidden { display: none; }
.dst-form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dst-form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dst-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* Picker de tags */
.dst-tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.dst-tag-chip { font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground); cursor: pointer; transition: all .15s; }
.dst-tag-chip:hover { background: var(--muted); }
.dst-tag-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Formula y hoteles */
.dst-formula { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--primary-soft); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.dst-formula-left { display: flex; align-items: center; gap: 12px; }
.dst-formula-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.dst-formula-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); display: block; }
.dst-formula-eq { font-size: 14px; font-weight: 800; color: var(--accent-foreground); }
.dst-formula-res { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 8px 16px; text-align: center; }
.dst-formula-res-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); display: block; }
.dst-formula-res-val { font-size: 17px; font-weight: 800; color: var(--primary); }
.dst-hotels-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dst-hotels-head span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--foreground); }
.dst-hotel-row { position: relative; background: var(--muted); border: 1px solid var(--border); border-radius: 16px; padding: 14px 14px 2px; margin-bottom: 12px; }
.dst-hotel-del { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; border: none; background: oklch(0.95 0.04 15); color: oklch(0.55 0.18 15); display: grid; place-items: center; cursor: pointer; }
.dst-hotel-del svg { width: 15px; height: 15px; }

/* Exigencias */
.dst-info-card { background: oklch(0.96 0.04 235); border: 1px solid oklch(0.88 0.06 235); color: oklch(0.4 0.08 240); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; margin-bottom: 16px; }
.dst-req-box { background: var(--muted); border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.dst-req-box-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--foreground); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.dst-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--foreground); }
.dst-dim { opacity: .45; pointer-events: none; }
.dst-switch { position: relative; display: inline-flex; width: 42px; height: 23px; flex-shrink: 0; cursor: pointer; }
.dst-switch input { opacity: 0; width: 0; height: 0; }
.dst-slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; }
.dst-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 2.5px; background: #fff; border-radius: 50%; transition: .2s; }
.dst-switch input:checked + .dst-slider { background: var(--primary); }
.dst-switch input:checked + .dst-slider::before { transform: translateX(18px); }
.dst-vax-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.dst-vax { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.dst-vax.active { border-color: var(--primary); color: var(--primary); }
.dst-vax input { accent-color: var(--primary); }

/* Multimedia */
.dst-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--border); background: var(--muted); border-radius: 16px; padding: 26px; text-align: center; cursor: pointer; transition: border-color .15s; }
.dst-drop:hover { border-color: var(--primary); }
.dst-drop svg { width: 32px; height: 32px; color: var(--primary); }
.dst-drop-main { font-size: 13px; font-weight: 700; color: var(--foreground); }
.dst-drop-sub { font-size: 11px; color: var(--muted-foreground); }
.dst-url-row { display: flex; gap: 8px; margin-top: 10px; }
.dst-url-row .form-control { flex: 1; }
.dst-url-row .btn { flex-shrink: 0; }
.dst-badge.video { background: oklch(0.55 0.2 15); color: #fff; display: inline-flex; align-items: center; gap: 3px; }
.dst-badge.video svg { width: 11px; height: 11px; }
.dst-video-preview { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #000; }
.dst-video-preview video, .dst-video-preview iframe { width: 100%; aspect-ratio: 16 / 9; display: block; border: 0; background: #000; }
.dst-video-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--card); }
.dst-video-url { font-size: 11.5px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dst-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.dst-gallery-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 10; }
.dst-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.dst-cover-tag { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 6px; }
.dst-gallery-actions { position: absolute; inset: 0; background: rgba(15,23,42,.42); opacity: 0; transition: opacity .15s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.dst-gallery-item:hover .dst-gallery-actions { opacity: 1; }
.dst-gallery-actions button { width: 30px; height: 30px; border-radius: 9px; border: none; background: rgba(255,255,255,.92); color: oklch(0.3 0.03 280); display: grid; place-items: center; cursor: pointer; }
.dst-gallery-actions button:last-child { color: oklch(0.55 0.2 15); }
.dst-gallery-actions svg { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .dst-stats { grid-template-columns: 1fr; }
  .dst-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .dst-grid { grid-template-columns: 1fr; }
  .dst-form-grid2, .dst-form-grid3 { grid-template-columns: 1fr; }
  .dst-vax-grid, .dst-gallery { grid-template-columns: 1fr 1fr; }
}

/* Temporada alta por pais */
.dst-season-lbl { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dst-season-btns { display: flex; gap: 6px; }
.dst-season-btns .btn { font-weight: 600; }
.dst-season-hint { font-size: 11.5px; color: var(--accent-foreground); margin-top: 5px; }

/* Contactos del hotel */
.dst-hotel-contacts { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }
.dst-hotel-contacts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dst-hotel-contacts-head span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.dst-contact-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.dst-contact-row .form-control { font-size: 12px; padding: 6px 9px; }
.dst-contact-del { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; border: none; background: oklch(0.95 0.04 15); color: oklch(0.55 0.18 15); display: grid; place-items: center; cursor: pointer; }
.dst-contact-del svg { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .dst-contact-row { grid-template-columns: 1fr 1fr; }
}

/* ===== Modal de la agenda de itinerarios: contenido + chat del viajero =====
   Misma forma que la ficha de lead del pipeline (.pl-lead-dialog): el contenido con sus
   pestanas a la izquierda y el ChatPanel a la derecha. En pantallas angostas el chat se
   oculta para no dejar dos columnas ilegibles. */
.itin-dialog { max-width: 1500px; width: 97vw; display: flex; padding: 0; overflow: hidden; max-height: 94vh; height: 94vh; }
.itin-main { flex: 1 1 62%; min-width: 0; display: flex; flex-direction: column; max-height: 94vh; }
.itin-main .modal-body { flex: 1; min-height: 0; }
.itin-dialog .pl-chat { flex: 1 1 38%; }
@media (max-width: 1100px) { .itin-dialog .pl-chat { display: none; } }
