/* panel.css — panel tipo CRM con la estética de proveedor.html / business.html (A TEAM). Siempre en modo claro. */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --purple: #7B4FFF;
  --purple-hover: #6840E0;
  --cyan: #00BFFF;
  --gradient: linear-gradient(135deg, #00BFFF 0%, #7B4FFF 100%);
  --purple-soft: #F1ECFF;
  --cyan-soft: #E5F8FF;
  --bg: #F1F3F9;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #111827;
  --text-2: #6B7280;
  --text-3: #9CA3AF;
  --ok: #059669;
  --ok-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --sidebar-bg: #090B11;
  --sidebar-w: 252px;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #9CA3AF;
  --sidebar-text-active: #F3F4F6;
}

body { font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: var(--font-display); }

/* ───────────── Barra lateral ───────────── */
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  z-index: 50;
}
.sb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  min-height: 68px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sb-logo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.sb-brand { font: 700 1.05rem var(--font-display); color: #F3F4F6; white-space: nowrap; }

.sb-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sb-section-title {
  padding: 12px 16px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(156, 163, 175, 0.45);
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.18s, color 0.18s;
}
.sb-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--sidebar-text-active); }
.sb-item.active { background: rgba(123, 79, 255, 0.12); color: #C084FC; border-left-color: var(--purple); }
.sb-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.sb-label { flex: 1; font-size: 0.88rem; font-weight: 500; }
.sb-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #D1D5DB;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}
.sb-count.alert { background: var(--purple); color: #fff; }

.sb-andy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-border);
}
.sb-andy-title { color: #F3F4F6; font-weight: 600; font-size: 0.85rem; }
.sb-andy-status { color: var(--sidebar-text); font-size: 0.72rem; }
.sb-andy-status.on { color: #34D399; }
#sidebar .switch .track { background: rgba(255, 255, 255, 0.15); }
#sidebar .switch input:checked + .track { background: #7B4FFF; }

.sb-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.sb-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  margin: -6px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s;
}
.sb-user:hover { background: rgba(255, 255, 255, 0.05); }
.sb-user.active { background: rgba(123, 79, 255, 0.12); }
.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(123, 79, 255, 0.15);
  color: #C084FC;
  font: 700 0.8rem var(--font-display);
  flex-shrink: 0;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-user-name { color: #F3F4F6; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-email { color: var(--sidebar-text); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setup {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #F59E0B;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sb-logout {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.2s;
}
.sb-logout:hover { color: #FCA5A5; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.07); }
.sb-logout svg { width: 14px; height: 14px; }

/* ───────────── Estructura ───────────── */
#main { margin-left: var(--sidebar-w); min-height: 100vh; }
.view { padding: 24px 28px 28px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #047857;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  white-space: nowrap;
}
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; animation: pulse 1.8s infinite; }
.live.off { color: var(--text-3); background: var(--surface-2); border-color: var(--border); }
.live.off .dot { background: #D1D5DB; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Insignias (como business.html) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.badge.prop { background: rgba(123, 79, 255, 0.08); color: #6D28D9; border-color: rgba(123, 79, 255, 0.25); }
.badge.op { background: #F8FAFC; color: #334155; border-color: #E2E8F0; }
.badge.andy, .badge.ai { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.badge svg { width: 10px; height: 10px; }
.badge.paused { background: #F9FAFB; color: #6B7280; border-color: #E5E7EB; }
.badge.st-consulta { background: #F8FAFC; color: #475569; border-color: #CBD5E1; }
.badge.st-calificado { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.badge.st-visita_agendada { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.badge.st-visito, .badge.st-negociacion { background: #F5F3FF; color: #5B21B6; border-color: #DDD6FE; }
.badge.st-derivado { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.badge.st-cerrado { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }
.badge.st-descartado, .badge.st-no_interesa, .badge.st-frio { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-initials {
  position: relative;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font: 700 0.85rem var(--font-display);
}

/* ───────────── WhatsApp (réplica de business.html) ───────────── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar-title { margin: 0; font: 700 1.55rem var(--font-display); letter-spacing: -0.01em; }
.topbar-sub { margin: 2px 0 0; color: var(--text-2); font-size: 0.86rem; }
/* En escritorio los botones van en una fila; el subtítulo usa el resto del ancho */
.topbar > div:first-child { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; flex-shrink: 0; }

.wa-tabs { display: inline-flex; gap: 2px; padding: 3px; background: #F3F4F6; border: 1px solid var(--border); border-radius: 11px; }
.wa-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 8px;
  color: var(--text-2);
  font: 600 0.83rem var(--font-sans);
  text-decoration: none;
  transition: all 0.18s;
}
button.wa-tab { border: 0; background: none; font-family: var(--font-sans); cursor: pointer; }
.wa-tab svg { width: 15px; height: 15px; }
.wa-tab:hover { color: var(--text); }
.wa-tab.active { background: #fff; color: var(--purple); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.wa-tab-count { padding: 1px 7px; border-radius: 99px; background: #EDE9FE; color: var(--purple); font-size: 0.66rem; font-weight: 700; }

#view-whatsapp { height: 100vh; display: flex; flex-direction: column; padding-bottom: 20px; }
#view-whatsapp[hidden] { display: none; }
.wa-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wa-body[hidden] { display: none; }
.wa-body.funnel { overflow-y: auto; }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-wrap input { padding-left: 34px; background: #F9FAFB; font-size: 0.85rem; border-radius: 10px; }
.search-card { margin-bottom: 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.search-card .search-wrap { max-width: 440px; }

.chats-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: #fff; }
.chat-list-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.list-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font: 800 0.78rem var(--font-display);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.list-title span { font: 600 0.68rem var(--font-sans); color: var(--text-2); text-transform: none; letter-spacing: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chip {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: #fff;
  color: #4B5563;
  font: 600 0.72rem var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { border-color: #C4B5FD; color: var(--purple); }
.chip.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip .n { opacity: 0.7; margin-left: 3px; }

.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #F3F4F6;
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-item:hover { background: #F9FAFB; }
.chat-item.active { background: rgba(123, 79, 255, 0.06); border-left-color: var(--purple); }
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-item-name { font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 0.66rem; color: var(--text-2); white-space: nowrap; }
.chat-item-phone { display: flex; align-items: center; gap: 4px; font-size: 0.68rem; color: var(--text-3); margin-bottom: 2px; }
.chat-item-phone svg { width: 11px; height: 11px; }
.chat-item-preview { font-size: 0.76rem; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.chat-item-preview b { color: #374151; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

.chat-pane { position: relative; display: flex; min-height: 0; min-width: 0; background: #F0F2F5; }
.chat-pane > .empty-state { flex: 1; }
.wa-convo { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* Encabezado del chat: quién es, la etapa, si Andy responde y las herramientas */
.wa-chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.wa-head-id { flex: 1; min-width: 0; }
.wa-head-name { display: flex; align-items: center; gap: 8px; font: 700 1rem var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head-sub { font-size: 0.74rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head-id > .badge { margin-top: 4px; }
.wa-head-controls, .wa-head-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wa-head-icon { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-2); cursor: pointer; text-decoration: none; }
.wa-head-icon:hover, .wa-head-icon.active { background: var(--purple-soft); color: var(--purple); border-color: rgba(123, 79, 255, 0.3); }
.wa-head-icon svg { width: 16px; height: 16px; }
.wa-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 2px #fff; }
.wa-andy-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-2); font: 700 0.74rem var(--font-sans); cursor: pointer; white-space: nowrap; }
.wa-andy-toggle.on { color: #047857; border-color: #A7F3D0; background: #F0FDF4; }
.wa-switch { position: relative; width: 28px; height: 16px; border-radius: 8px; background: #CBD5E1; transition: background 0.15s; flex-shrink: 0; }
.wa-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.wa-andy-toggle.on .wa-switch { background: #10B981; }
.wa-andy-toggle.on .wa-switch::after { transform: translateX(12px); }
.wa-menu-wrap { position: relative; }
.wa-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); }
.wa-menu[hidden] { display: none; }
.wa-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: 500 0.82rem var(--font-sans); text-align: left; text-decoration: none; cursor: pointer; }
.wa-menu-item:hover { background: #F3F4F6; }
.wa-menu-item svg { width: 15px; height: 15px; color: var(--text-2); flex-shrink: 0; }
.wa-menu-item.danger, .wa-menu-item.danger svg { color: #DC2626; }
.phone-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid #A7F3D0;
  border-radius: 6px;
  background: #ECFDF5;
  color: #065F46;
  font-size: 12px;
  font-weight: 600;
}
.phone-badge.empty { background: #F1F5F9; color: #64748B; border-color: #CBD5E1; }
.phone-badge svg { width: 12px; height: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; }
.icon-btn:hover { background: #F3F4F6; color: var(--text); }
.icon-btn svg { width: 13px; height: 13px; }
.wa-link-btn, .wa-link-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 7px;
  font: 700 0.72rem var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  background: none;
  transition: background 0.15s;
}
.wa-link-btn svg { width: 12px; height: 12px; }
.wa-link-btn.green { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.wa-link-btn.green:hover { background: #DCFCE7; }
.wa-link-btn.purple { background: rgba(123, 79, 255, 0.07); color: #6D28D9; border-color: rgba(123, 79, 255, 0.25); }
.wa-link-btn.purple:hover { background: rgba(123, 79, 255, 0.14); }
.wa-link-btn.red { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.wa-link-btn.red:hover { background: #FEE2E2; }
.wa-link-select { width: auto; color: #334155; border-color: #E2E8F0; background: #F8FAFC; padding: 4px 8px; }

/* Ficha del contacto: columna derecha que se puede cerrar */
.wa-side { width: 300px; flex-shrink: 0; overflow-y: auto; background: #fff; border-left: 1px solid var(--border); }
.wa-side-top { display: none; }
.wa-side-block { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.wa-side-block:last-child { border-bottom: 0; }
.wa-side-block h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.wa-side-block h3 em { font-style: normal; letter-spacing: 0; text-transform: none; font-size: 0.74rem; color: var(--warn); }
.wa-side-block h3 em.ok { color: var(--ok); }
.wa-summary { margin: 0; font-size: 0.82rem; line-height: 1.5; color: #374151; }
.wa-progress { height: 5px; margin-bottom: 8px; border-radius: 3px; background: #EEF0F3; overflow: hidden; }
.wa-progress i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.wa-qual-link { text-decoration: none; color: inherit; }
.wa-qual-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 0.8rem; }
.wa-qual-item, .wa-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 0.8rem; }
.wa-qual-label, .wa-kv span { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); }
.wa-qual-label svg { display: none; }
.wa-qual-val, .wa-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.wa-qual-val.empty { color: var(--warn); }
.wa-kv b.empty { color: var(--text-3); font-weight: 500; }
.wa-qual-item.alert .wa-qual-val { color: #DC2626; }

.wa-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 5%;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  /* Beige como WhatsApp, con un patrón propio de objetos inmobiliarios (casas, llaves, planos, carteles) */
  background-color: #EFEAE2;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='300'%20height='300'%20viewBox='0%200%20300%20300'%20fill='none'%20stroke='%23CFC4B1'%20stroke-opacity='0.6'%20stroke-width='1.15'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cg%20transform='translate(38.9%2032.6)%20rotate(-24)%20scale(1.25)'%3E%3Crect%20x='-6'%20y='-11'%20width='12'%20height='22'%20rx='1'/%3E%3Ccircle%20cx='3'%20cy='1'%20r='1'/%3E%3C/g%3E%3Cg%20transform='translate(91.7%2021.2)%20rotate(-13)%20scale(1.07)'%3E%3Cpath%20d='M-6%20-2h12l-3-9h-6z'/%3E%3Cpath%20d='M0%20-2v11M-4%209h8'/%3E%3C/g%3E%3Cg%20transform='translate(151.7%2021.0)%20rotate(-24)%20scale(1.22)'%3E%3Ccircle%20cx='-3'%20cy='-5'%20r='4'/%3E%3Cpath%20d='M-3%20-1v12M-3%205h3M-3%209h3'/%3E%3Ccircle%20cx='5'%20cy='-6'%20r='2.5'/%3E%3C/g%3E%3Cg%20transform='translate(204.4%2031.1)%20rotate(-11)%20scale(1.23)'%3E%3Cpath%20d='M-11%204v-4l3-6h16l3%206v4z'/%3E%3Ccircle%20cx='-6'%20cy='5'%20r='2.5'/%3E%3Ccircle%20cx='6'%20cy='5'%20r='2.5'/%3E%3C/g%3E%3Cg%20transform='translate(262.7%2028.4)%20rotate(10)%20scale(1.19)'%3E%3Cpath%20d='M-11%206V0a3%203%200%200%201%203-3h16a3%203%200%200%201%203%203v6z'/%3E%3Cpath%20d='M-8%20-3v-4h16v4M-9%206v3M9%206v3'/%3E%3C/g%3E%3Cg%20transform='translate(45.8%2091.4)%20rotate(12)%20scale(1.16)'%3E%3Ccircle%20cx='-2'%20cy='-2'%20r='7'/%3E%3Cpath%20d='M3%203l7%207'/%3E%3Cpath%20d='M-6%200v-3l4-3%204%203v3'/%3E%3C/g%3E%3Cg%20transform='translate(106.2%2093.6)%20rotate(-9)%20scale(1.27)'%3E%3Cpath%20d='M-9%209V-1l9-7%209%207v10z'/%3E%3Cpath%20d='M0%206s-4-2.5-4-5a2%202%200%200%201%204-1%202%202%200%200%201%204%201c0%202.5-4%205-4%205z'/%3E%3C/g%3E%3Cg%20transform='translate(157.1%2091.4)%20rotate(-8)%20scale(1.29)'%3E%3Cpath%20d='M-9%2011V-1a6%206%200%200%201%2012%200v12M3%20-7h7v5H3'/%3E%3Cpath%20d='M-9%2011h12'/%3E%3C/g%3E%3Cg%20transform='translate(218.8%2081.9)%20rotate(-0)%20scale(1.20)'%3E%3Crect%20x='-9'%20y='-9'%20width='18'%20height='18'%20rx='1'/%3E%3Cpath%20d='M0%20-9v18M-9%200h18'/%3E%3C/g%3E%3Cg%20transform='translate(280.0%2091.3)%20rotate(-12)%20scale(1.10)'%3E%3Ccircle%20cx='-2'%20cy='0'%20r='8'/%3E%3Ccircle%20cx='-2'%20cy='0'%20r='2.5'/%3E%3Cpath%20d='M6%204h6v4H2'/%3E%3C/g%3E%3Cg%20transform='translate(32.4%20149.9)%20rotate(-6)%20scale(1.23)'%3E%3Crect%20x='-10'%20y='-8'%20width='20'%20height='17'%20rx='2'/%3E%3Cpath%20d='M-10%20-3h20M-5%20-11v5M5%20-11v5M-5%202h3M2%202h3M-5%206h3'/%3E%3C/g%3E%3Cg%20transform='translate(90.6%20155.5)%20rotate(-0)%20scale(1.28)'%3E%3Cpath%20d='M-11%2010h6v-6h6v-6h6v-6h4'/%3E%3C/g%3E%3Cg%20transform='translate(149.3%20158.5)%20rotate(-6)%20scale(1.09)'%3E%3Cpath%20d='M-11%207V-6M-11%202h22v5M11%207V0a3%203%200%200%200-3-3h-9v5'/%3E%3Ccircle%20cx='-6'%20cy='-1'%20r='2.5'/%3E%3C/g%3E%3Cg%20transform='translate(207.2%20145.0)%20rotate(-20)%20scale(1.12)'%3E%3Cpath%20d='M-10%209V-1l10-8%2010%208v10z'/%3E%3Cpath%20d='M-3%209V3h6v6'/%3E%3C/g%3E%3Cg%20transform='translate(263.6%20155.6)%20rotate(3)%20scale(1.16)'%3E%3Cpath%20d='M-11%200h22v3a6%206%200%200%201-6%206h-10a6%206%200%200%201-6-6z'/%3E%3Cpath%20d='M-8%200v-8a3%203%200%200%201%206%200'/%3E%3C/g%3E%3Cg%20transform='translate(36.6%20206.0)%20rotate(27)%20scale(1.23)'%3E%3Ccircle%20cx='0'%20cy='-4'%20r='7'/%3E%3Cpath%20d='M0%203v8M-3%2011h6'/%3E%3C/g%3E%3Cg%20transform='translate(104.9%20206.9)%20rotate(-7)%20scale(1.22)'%3E%3Crect%20x='-11'%20y='-9'%20width='22'%20height='18'/%3E%3Cpath%20d='M-11%20-1h8M-3%20-9v5M-3%201v8M3%20-1h8M3%20-9v8'/%3E%3C/g%3E%3Cg%20transform='translate(164.0%20212.2)%20rotate(-23)%20scale(1.11)'%3E%3Ccircle%20cx='-6'%20cy='0'%20r='5'/%3E%3Ccircle%20cx='-6'%20cy='0'%20r='1.6'/%3E%3Cpath%20d='M-1%200h12M7%200v4M10%200v3'/%3E%3C/g%3E%3Cg%20transform='translate(216.5%20210.2)%20rotate(9)%20scale(1.09)'%3E%3Crect%20x='-8'%20y='-11'%20width='16'%20height='22'%20rx='1'/%3E%3Cpath%20d='M-4%20-7h2M2%20-7h2M-4%20-2h2M2%20-2h2M-4%203h2M2%203h2M-2%2011V7h4v4'/%3E%3C/g%3E%3Cg%20transform='translate(278.3%20206.8)%20rotate(19)%20scale(1.05)'%3E%3Cpath%20d='M0%2011s-8-7-8-13a8%208%200%200%201%2016%200c0%206-8%2013-8%2013z'/%3E%3Ccircle%20cx='0'%20cy='-2'%20r='3'/%3E%3C/g%3E%3Cg%20transform='translate(38.7%20268.4)%20rotate(-12)%20scale(1.10)'%3E%3Cpath%20d='M-9%2011V-11M-9%20-8h17v10h-17'/%3E%3Cpath%20d='M-5%20-4h9M-5%20-1h6'/%3E%3C/g%3E%3Cg%20transform='translate(99.2%20261.6)%20rotate(2)%20scale(1.09)'%3E%3Cpath%20d='M-5%204h10l-2%207h-6z'/%3E%3Cpath%20d='M0%204V-4M0%20-1c-5%200-7-4-7-8%204%200%207%203%207%208M0%20-4c4%200%206-3%206-7-4%200-6%203-6%207'/%3E%3C/g%3E%3Cg%20transform='translate(151.2%20275.8)%20rotate(4)%20scale(1.00)'%3E%3Ccircle%20cx='0'%20cy='0'%20r='1.6'/%3E%3C/g%3E%3Cg%20transform='translate(216.4%20266.8)%20rotate(11)%20scale(1.00)'%3E%3Ccircle%20cx='0'%20cy='0'%20r='1.6'/%3E%3C/g%3E%3Cg%20transform='translate(267.0%20269.9)%20rotate(25)%20scale(1.00)'%3E%3Ccircle%20cx='0'%20cy='0'%20r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 300px 300px;
}
.wa-msg {
  position: relative;
  max-width: 65%;
  min-width: 80px;
  padding: 5px 7px 4px 9px;
  border-radius: 7.5px;
  color: #111B21;
  font-size: 0.83rem;
  line-height: 1.35;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  overflow-wrap: anywhere;
}
.wa-msg.in { align-self: flex-start; background: #fff; }
.wa-msg.out { align-self: flex-end; background: #D9FDD3; }
.wa-msg.out.human { background: #DCEBFF; }
.wa-msg.first { margin-top: 6px; }
.wa-msg.first.in { border-top-left-radius: 0; }
.wa-msg.first.out { border-top-right-radius: 0; }
.wa-msg a { color: #027EB5; text-decoration: none; word-break: break-all; }
.wa-msg a:hover { text-decoration: underline; }
.wa-msg-author { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; font-size: 0.66rem; font-weight: 700; line-height: 1.2; }
.wa-msg-author svg { width: 11px; height: 11px; }
.wa-msg-author.agent { color: #059669; }
.wa-msg-author.human { color: #2563EB; }
.wa-msg-content { white-space: pre-wrap; }
.wa-msg-meta { float: right; margin: 4px 0 -1px 8px; font-size: 0.62rem; color: #667781; line-height: 1; vertical-align: bottom; }
.wa-day {
  align-self: center;
  margin: 12px 0 4px;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #54656F;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.1);
}
.wa-readonly {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #F0F2F5;
  border-top: 1px solid #E5E7EB;
  color: #6B7280;
  font-size: 0.74rem;
}
.wa-readonly svg { width: 14px; height: 14px; flex-shrink: 0; }
.wa-readonly-action { flex-wrap: wrap; }
.wa-readonly-action > span { flex: 1; min-width: 200px; }
.wa-readonly a { color: var(--purple); font-weight: 600; }

/* Responder desde el panel */
.wa-compose { padding: 8px 16px 6px; background: #F0F2F5; border-top: 1px solid #E5E7EB; }
.wa-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.wa-compose textarea.wa-compose-input {
  flex: 1;
  min-height: 40px;
  max-height: 140px;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  background: #fff;
  resize: none;
  font-size: 0.86rem;
  line-height: 1.4;
  box-shadow: none;
}
.wa-compose textarea.wa-compose-input:focus { box-shadow: 0 0 0 2px var(--purple-soft); }
.wa-compose-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.wa-compose-send:hover:not(:disabled) { background: #6432EB; }
.wa-compose-send:disabled { opacity: 0.45; cursor: default; }
.wa-compose-send svg { width: 18px; height: 18px; margin-left: -2px; }
.wa-start { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; padding: 8px 12px; border-radius: 10px; background: #fff; font-size: 0.8rem; color: #374151; }
.wa-start .wa-link-btn:disabled { opacity: 0.6; cursor: wait; }
.wa-compose-clip { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: 50%; background: transparent; color: #54656F; cursor: pointer; }
.wa-compose-clip:hover { background: rgba(0, 0, 0, 0.06); color: var(--purple); }
.wa-compose-clip svg { width: 20px; height: 20px; }
.wa-attach-chip { display: flex; align-items: center; gap: 8px; max-width: 420px; margin-bottom: 8px; padding: 8px 10px 8px 12px; border-radius: 10px; background: #fff; font-size: 0.8rem; }
.wa-attach-chip svg { width: 16px; height: 16px; color: var(--purple); flex-shrink: 0; }
.wa-attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wa-attach-size { color: var(--text-3); flex-shrink: 0; }
.wa-attach-chip button { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 0.85rem; padding: 2px 4px; }
.wa-attach-chip button:hover { color: var(--danger, #DC2626); }
.wa-compose-hint { margin: 5px 4px 0; font-size: 0.68rem; color: #6B7280; }
.wa-msg.pending { opacity: 0.7; }
.wa-audio { display: block; width: 260px; max-width: 100%; height: 36px; margin: 2px 0 4px; }
.wa-audio-error { display: block; font-size: 0.72rem; color: #9CA3AF; font-style: italic; }
/* En escritorio, el botón flotante del asistente queda sobre la esquina: se le deja lugar */
@media (min-width: 901px) {
  .wa-compose { padding-right: 84px; }
}

.empty-state {
  margin: auto;
  max-width: 380px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.55;
}
.empty-state > svg { width: 46px; height: 46px; color: #D1D5DB; }
.empty-state strong { color: var(--text); font: 700 1.05rem var(--font-display); }
.empty-state .btn { margin-top: 8px; }

/* ───────────── Embudo ───────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-2);
}
.kpi-label .dot { width: 7px; height: 7px; border-radius: 50%; }
.kpi-val { font: 700 1.8rem var(--font-display); margin-top: 4px; }
.kpi-val small { font: 500 0.78rem var(--font-sans); color: var(--text-2); margin-left: 6px; }

.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kanban-col {
  width: 290px;
  min-width: 290px;
  background: #F3F4F6;
  border: 2px solid transparent;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}
.kanban-col.drag-over { border-color: var(--purple); background: rgba(123, 79, 255, 0.05); }
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 10px;
  border-top: 3px solid var(--col-color, var(--purple));
  border-radius: 12px 12px 0 0;
}
.col-title { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.col-count { padding: 2px 8px; border-radius: 20px; background: #E5E7EB; color: var(--text-2); font-size: 0.68rem; font-weight: 700; }
.col-cards { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; overflow-y: auto; min-height: 60px; }
.col-empty { padding: 18px 8px; text-align: center; color: var(--text-3); font-size: 0.78rem; }

.lead-card {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.lead-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.lead-card.dragging { opacity: 0.5; }
.lead-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.lead-card-top .avatar-initials { width: 30px; height: 30px; font-size: 0.72rem; }
.lead-card-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card-time { font-size: 0.68rem; color: var(--text-2); white-space: nowrap; }
.progress { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 0.68rem; color: var(--text-2); }
.progress-bar { flex: 1; display: flex; gap: 3px; }
.progress-bar span { flex: 1; height: 4px; border-radius: 3px; background: #E5E7EB; }
.progress-bar span.on { background: #F59E0B; }
.lead-card-info { padding: 8px 10px; margin-bottom: 10px; border-radius: 8px; background: var(--surface-2); font-size: 0.76rem; line-height: 1.5; }
.lead-card-info b { font-weight: 700; }
.lead-card-actions { display: grid; grid-template-columns: 1fr 1fr 32px; gap: 6px; }
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid;
  border-radius: 8px;
  font: 700 0.76rem var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  background: none;
}
.card-btn svg { width: 13px; height: 13px; }
.card-btn.purple { background: rgba(123, 79, 255, 0.07); color: #6D28D9; border-color: rgba(123, 79, 255, 0.25); }
.card-btn.purple:hover { background: rgba(123, 79, 255, 0.14); }
.card-btn.green { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.card-btn.green:hover { background: #DCFCE7; }
.card-btn.red { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.card-btn.red:hover { background: #FEE2E2; }

/* ───────────── Stock ───────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type="search"] { flex: 1 1 260px; background: var(--surface); }
.toolbar select { width: auto; background: var(--surface); }
.link-sm { font-size: 0.8rem; font-weight: 600; margin-left: auto; }

.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.prop-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.prop-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); border-color: var(--border-strong); }
.prop-card.muted { opacity: 0.7; }
.prop-cover {
  height: 6px;
  background: var(--gradient);
}
.prop-cover.reserved { background: #F59E0B; }
.prop-cover.sold { background: #DC2626; }
.prop-cover.paused { background: #9CA3AF; }
.prop-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prop-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.prop-name { margin: 0; font-size: 1.02rem; font-weight: 700; }
.prop-id { font-size: 0.7rem; color: var(--text-3); font-weight: 600; }
.prop-price { font: 700 1.25rem var(--font-display); }
.prop-price small { font: 600 0.72rem var(--font-sans); color: var(--text-2); margin-left: 4px; }
.prop-where { font-size: 0.8rem; color: var(--text-2); }
.specs { display: flex; flex-wrap: wrap; gap: 5px; }
.spec { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.72rem; color: #374151; }
.prop-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-top: 1px solid var(--border);
}
.interest { font-size: 0.74rem; color: var(--text-2); }
.interest b { color: var(--purple); }
.prop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }

/* ───────────── Configuración (una sola página, como el perfil de proveedor.html) ───────────── */
#view-config { padding-bottom: 120px; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 20px 24px; }
.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--purple);
  display: grid;
  place-items: center;
  object-fit: cover;
  background: var(--purple-soft);
  color: var(--purple);
  font: 700 1.3rem var(--font-display);
  flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.profile-info p { margin: 2px 0 0; color: var(--text-2); font-size: 0.86rem; }
.profile-tabs {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  gap: 4px;
  margin: 12px 0 24px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.p-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: none;
  color: var(--text-2);
  font: 700 13.5px var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.p-tab svg { width: 15px; height: 15px; }
.p-tab:hover { color: var(--text); }
.p-tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.p-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: #F59E0B; }

.config-panel { scroll-margin-top: 84px; margin-bottom: 32px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.section-head h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.section-head p { margin: 1px 0 0; color: var(--text-2); font-size: 0.84rem; }
.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--purple-soft);
  color: var(--purple);
}
.section-icon svg { width: 18px; height: 18px; }
.card.body { padding: 22px 24px; margin-bottom: 14px; }
.card-title { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }
.muted { color: var(--text-2); margin: 0 0 12px; font-size: 0.86rem; }
.help { font-size: 0.75rem; color: var(--text-3); }
.narrow { max-width: 320px; }
.row-gap { display: flex; gap: 22px; flex-wrap: wrap; }
.top-gap { margin-top: 14px; }
.check.spaced { display: flex; margin-bottom: 12px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* El título de un grupo de opciones no recibe el espacio automático de .field: mismo espacio que un label */
fieldset.field > legend { margin-bottom: 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row p { margin: 2px 0 0; }

.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-card {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.option-card:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.option-card input { margin-top: 2px; }
.option-card strong { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.option-card small { display: block; margin-top: 2px; color: var(--text-2); font-size: 0.8rem; }

.inline-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-field input[type="time"] { width: 150px; }
.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; min-width: 0; }

.days-grid { display: grid; gap: 8px; margin-bottom: 16px; }
.day-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.day-row .day-chip { width: 120px; justify-content: center; }
.day-times { display: flex; align-items: center; gap: 8px; }
.day-times .custom-select { width: 120px; }
.day-row .sep { text-align: center; color: var(--text-3); font-size: 0.85rem; }
.day-off { display: none; color: var(--text-3); font-size: 0.82rem; }
.day-row.off { background: transparent; }
.day-row.off .day-times { display: none; }
.day-row.off .day-off { display: inline; }
.cadence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.team-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.team-member {
  display: grid;
  grid-template-columns: 1fr 1fr 170px auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.team-member .name { font-weight: 600; }
.team-member .phone { color: var(--text-2); font-variant-numeric: tabular-nums; }
.team-add { display: grid; grid-template-columns: 1fr 1fr 190px auto; gap: 10px; margin-bottom: 8px; }

.sheet-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet-status .email { font-weight: 600; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 0.84rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.info { background: #F5F3FF; color: var(--text); border: 1px solid #DDD6FE; }
.notice.steps ol { margin: 8px 0; padding-left: 20px; }
.notice.steps li { margin-bottom: 4px; }
.notice code { font-size: 0.8rem; background: #fff; padding: 1px 5px; border-radius: 4px; }
.feature-list { margin: 0 0 18px; padding-left: 18px; color: var(--text-2); }
.feature-list li { margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stat .value { font: 700 1.4rem var(--font-display); }
.stat .label { font-size: 0.75rem; color: var(--text-2); }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.plan .muted { margin: 0; }

.save-bar {
  position: fixed;
  left: calc(var(--sidebar-w) + 28px);
  bottom: 20px;
  width: calc(100vw - var(--sidebar-w) - 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.12);
  transform: translateY(120px);
  transition: transform 0.2s;
  z-index: 40;
}
.save-bar.show { transform: translateY(0); }
.save-bar .muted { margin: 0; }

/* Diálogo de propiedad */
.dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(13, 15, 26, 0.35);
}
.dialog::backdrop { background: rgba(13, 15, 26, 0.5); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 22px; }
.dialog-head { border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-foot { border-top: 1px solid var(--border); justify-content: flex-end; }
.dialog-body { padding: 20px 22px; overflow-y: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* Editor de propiedades en 3 pasos */
.pstepper { display: flex; gap: 6px; padding: 12px 22px; border-bottom: 1px solid var(--border); background: #FAFAFC; overflow-x: auto; }
.pstepper button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pstepper button span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid #D1D5DB; font-size: 0.72rem; }
.pstepper button.done span { border-color: var(--purple); background: var(--purple); color: #fff; }
.pstepper button.active { background: var(--purple-soft); color: var(--purple); }
.pstepper button.active span { border-color: var(--purple); color: var(--purple); background: #fff; }
.pstep-title { margin: 22px 0 10px; font: 700 0.98rem var(--font-display); }
.pstep-title:first-child { margin-top: 0; }
.pstep-title small { font-weight: 500; color: var(--text-2); font-size: 0.8rem; }
.pstep-help { margin: -4px 0 12px; }
.input-pair { display: flex; gap: 6px; }
.input-pair input { flex: 1; min-width: 0; }
.input-pair .custom-select, .input-pair select { width: 90px; flex-shrink: 0; }
.dialog-foot-gap { flex: 1; }
@media (max-width: 700px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

input[type="text"], input[type="url"], input[type="tel"], input[type="email"], input[type="number"], input[type="password"], input[type="time"], input[type="search"], textarea, select {
  background: var(--surface);
  font-family: var(--font-sans);
}

@media (max-width: 900px) {
  #main { margin-left: 0; }
  .chats-layout { grid-template-columns: 1fr; }
  .option-cards, .cadence-grid, .stats, .grid-2, .grid-4, .team-member, .team-add { grid-template-columns: 1fr; }
  .save-bar { left: 16px; width: calc(100vw - 32px); }
  .topbar { flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; flex-shrink: 1; }
}

/* ───────────── Pantalla de entrada (login de cliente.html) ───────────── */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #090B11;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(123, 79, 255, 0.09) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(0, 191, 255, 0.06) 0%, transparent 40%);
}
.gate[hidden] { display: none; }
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 42px 40px;
  text-align: center;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.login-card .logo-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.login-logo { height: 48px; width: auto; margin-bottom: 14px; }
.login-card h2 { margin: 0 0 8px; font: 700 1.8rem var(--font-display); color: #F3F4F6; }
.login-sub { margin: 0; color: #9CA3AF; font-size: 0.82rem; line-height: 1.45; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: 600 0.9rem var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-google:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.btn-google:disabled { opacity: 0.4; cursor: not-allowed; }
.auth-divider {
  display: flex;
  align-items: center;
  margin: 10px 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.auth-divider span { padding: 0 12px; }
.gate .auth-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.gate .auth-input:focus { border-color: var(--purple); background: rgba(255, 255, 255, 0.07); }
.gate .auth-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.gate .btn-primary { padding: 12px 20px; }
#sidebar[hidden], #main[hidden] { display: none; }

/* ───────────── Asistente: ajustes al chat flotante de copilot.css ───────────── */
#copilot[hidden] { display: none; }
.copilot-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.biz-chatbot-avatar { overflow: hidden; }
.biz-chatbot-avatar img, .biz-chatbot-msg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.biz-chatbot-msg-avatar { overflow: hidden; }
.biz-chatbot-action-btn svg { width: 15px; height: 15px; }
.biz-chatbot-chip svg { width: 13px; height: 13px; color: #A78BFA; }
.biz-chatbot-msg-copy svg { width: 11px; height: 11px; }
.biz-chatbot-session-item > svg { width: 15px; height: 15px; color: var(--biz-cb-primary); flex-shrink: 0; }
.biz-chatbot-delete-session-btn svg, .biz-chatbot-sessions-new-btn svg { width: 13px; height: 13px; }
.copilot-chips { padding: 10px 14px 6px; border-bottom: 1px solid var(--biz-cb-border); }
.copilot-session-items { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.copilot-empty { padding: 30px 10px; text-align: center; color: var(--biz-cb-text-muted); font-size: 12px; }
.copilot-confirm { display: flex; gap: 8px; margin-top: 10px; }
.biz-chatbot-msg-bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
.biz-chatbot-send:disabled { opacity: 0.5; cursor: default; }

/* ───────────── Notas internas (en la ficha del contacto) ───────────── */
.notes-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; margin-bottom: 8px; overflow-y: auto; }
.note { padding: 7px 9px; border-radius: 8px; background: #FFFBEB; font-size: 0.8rem; color: #78350F; white-space: pre-wrap; overflow-wrap: anywhere; }
.note small { display: block; margin-top: 2px; font-size: 0.68rem; color: #A16207; }
.note-add { display: flex; gap: 6px; }
.note-add input { flex: 1; min-width: 0; padding: 6px 9px; font-size: 0.8rem; }

/* ───────────── Tus números y cuenta ───────────── */
.phone-row { grid-template-columns: 1fr 1fr auto; }
.phone-add { display: flex; gap: 10px; max-width: 420px; }
.account-info { display: flex; flex-direction: column; gap: 12px; }
.row-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-line .help { min-width: 90px; }

/* Entrada con email */
.gate-email { display: flex; flex-direction: column; }

/* ───────────── Inicio ───────────── */
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.home-date { margin: 0; color: var(--purple); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.home-greeting { margin: 2px 0 0; font: 700 1.9rem var(--font-display); letter-spacing: -0.01em; }
.home-ask { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 100%; }
.home-ask .chips { padding-top: 4px; flex-wrap: wrap; justify-content: flex-end; }
.status-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.status-item:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); }
.status-item strong { display: block; font-size: 0.86rem; }
.status-item small { display: block; color: var(--text-2); font-size: 0.74rem; }
.status-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.status-icon svg { width: 15px; height: 15px; }
.status-item.ok .status-icon { background: var(--ok-soft); color: var(--ok); }
.status-item.warn { border-color: #FDE68A; background: #FFFDF5; }
.status-item.warn .status-icon { background: var(--warn-soft); color: var(--warn); }
.kpi-link { color: var(--text); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.kpi-link:hover { border-color: #C4B5FD; box-shadow: 0 4px 14px rgba(123, 79, 255, 0.1); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-head .card-title { margin: 0; }
.card-head .link-sm { margin-left: 0; text-decoration: none; }
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: stretch; }
.home-grid .card.body { margin-bottom: 0; }
.empty-mini { padding: 18px 4px; color: var(--text-3); font-size: 0.84rem; }

.setup-card { margin-bottom: 18px; padding: 22px 24px 20px; border-color: #E4DCFF; background: linear-gradient(120deg, #F7F3FF 0%, #fff 55%); }
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setup-top .card-title { font-size: 1.15rem; }
.setup-sub { margin: 4px 0 0; color: var(--text-2); font-size: 0.88rem; }
.setup-ring { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.setup-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.setup-ring circle { fill: none; stroke-width: 5; }
.setup-ring .bg { stroke: #EDE9FE; }
.setup-ring .fg { stroke: var(--purple); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.setup-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--purple); }

/* Línea de pasos */
.setup-track { display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); margin: 22px 0 18px; padding: 0; list-style: none; }
.setup-track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.setup-track li::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: #E5E7EB; z-index: 0; }
.setup-track li:first-child::before { display: none; }
.setup-track li.done::before, .setup-track li.current::before { background: var(--purple); }
.setup-track a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; color: var(--text-2); text-decoration: none; font-size: 0.78rem; line-height: 1.25; }
.setup-dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #D1D5DB; background: #fff; color: var(--text-2); font-size: 0.78rem; font-weight: 700; transition: transform 0.15s; }
.setup-dot svg { width: 14px; height: 14px; }
.setup-track a:hover .setup-dot { transform: scale(1.08); border-color: var(--purple); }
.setup-track li.done .setup-dot { border-color: var(--purple); background: var(--purple); color: #fff; }
.setup-track li.done a { color: var(--text-2); }
.setup-track li.current .setup-dot { border-color: var(--purple); color: var(--purple); box-shadow: 0 0 0 5px rgba(123, 79, 255, 0.15); }
.setup-track li.current a { color: var(--text); font-weight: 700; }

/* Paso siguiente */
.setup-next { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid #E4DCFF; border-radius: 14px; background: #fff; }
.setup-next-icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.setup-next-icon svg { width: 22px; height: 22px; }
.setup-next-text { flex: 1; min-width: 0; }
.setup-next-label { color: var(--purple); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.setup-next-text h3 { margin: 2px 0 2px; font: 700 1.02rem var(--font-display); }
.setup-next-text p { margin: 0; color: var(--text-2); font-size: 0.85rem; line-height: 1.45; }
.setup-next-cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.setup-next-cta .btn svg { width: 15px; height: 15px; margin-left: 6px; }
.setup-time { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 0.78rem; white-space: nowrap; }
.setup-time svg { width: 13px; height: 13px; }
@media (max-width: 900px) {
  .setup-card { padding: 18px 16px; }
  .setup-track a span:last-child { display: none; }
  .setup-track li.current a span:last-child { display: block; position: absolute; top: 38px; white-space: nowrap; }
  .setup-track { margin-bottom: 34px; }
  .setup-next { flex-wrap: wrap; }
  .setup-next-cta { width: 100%; justify-content: space-between; }
}

.news-list { display: flex; flex-direction: column; }
.news-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
.news-item:last-child { border-bottom: 0; }
.news-item:hover { background: #FAFAFB; }
.news-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.news-icon svg { width: 15px; height: 15px; }
.news-item.alert .news-icon { background: #FFF7ED; color: #EA580C; }
.news-item.message .news-icon { background: #F0FDF4; color: #15803D; }
.news-item.agent .news-icon { background: var(--purple-soft); color: var(--purple); }
.news-item.new .news-icon { background: #EFF6FF; color: #2563EB; }
.news-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.news-meta small { color: var(--text-3); font-size: 0.7rem; white-space: nowrap; }

/* ───────────── Agenda ───────────── */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 18px; }
.week-day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-height: 96px; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.week-day:hover { border-color: #C4B5FD; }
.week-day.selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.12); }
.week-name { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-2); }
.week-day.today .week-name { color: var(--purple); }
.week-num { font: 700 1.4rem var(--font-display); }
.week-counts { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 2px; }
.week-pill { padding: 1px 7px; border-radius: 99px; font-size: 0.66rem; font-weight: 700; }
.week-pill.visit { background: #EFF6FF; color: #1D4ED8; }
.week-pill.followup { background: var(--purple-soft); color: var(--purple); }
.week-free { font-size: 0.7rem; color: var(--text-3); }
.agenda-list { display: flex; flex-direction: column; gap: 14px; }

/* Día como en una agenda: una fila por hora */
.day-schedule { padding: 0; overflow: hidden; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.day-head h2 { margin: 0; font: 700 1rem var(--font-display); }
.day-sub { color: var(--text-2); font-size: 0.8rem; }
.day-grid { display: flex; flex-direction: column; }
.slot { display: grid; grid-template-columns: 64px 1fr; min-height: 52px; border-bottom: 1px solid #F1F2F6; }
.slot:last-child { border-bottom: 0; }
.slot-hour { padding: 8px 0 0 20px; color: var(--text-3); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.slot.past .slot-hour { color: #C9CCD6; }
.slot.past { background: #FCFCFE; }
.slot-items { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 4px 8px; border-left: 1px solid #F1F2F6; }
.slot-items .agenda-row { border-top: 0; border-radius: 10px; padding: 8px 10px; background: #fff; }
.slot-items .agenda-row.visit { background: #EFF6FF; }
.slot-items .agenda-row.followup { background: #F7F4FF; }
.slot-now { position: absolute; left: -5px; right: 0; height: 2px; background: #EF4444; z-index: 1; pointer-events: none; }
.slot-now::before { content: ""; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #EF4444; }
.agenda-day { padding: 6px 0; }
.agenda-day-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 18px 6px; font-size: 0.92rem; font-weight: 700; }
.agenda-row {
  display: grid;
  grid-template-columns: 92px 30px 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid #F3F4F6;
  color: var(--text);
  text-decoration: none;
}
.agenda-row:hover { background: #FAFAFF; }
.agenda-row > svg { width: 14px; height: 14px; color: var(--text-3); }
.agenda-time { font-weight: 700; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.agenda-kind { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.agenda-kind svg { width: 15px; height: 15px; }
.agenda-row.visit .agenda-kind { background: #EFF6FF; color: #2563EB; }
.agenda-row.followup .agenda-kind { background: var(--purple-soft); color: var(--purple); }
.agenda-row.stay .agenda-kind { background: #ECFDF5; color: #047857; }
.slot-items .agenda-row.stay { background: #F0FDF4; }
.agenda-row.overdue .agenda-kind { background: var(--warn-soft); color: var(--warn); }
.agenda-row .avatar-initials { width: 34px; height: 34px; font-size: 0.74rem; }
.agenda-main { min-width: 0; display: flex; flex-direction: column; }
.agenda-main strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-detail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-2); font-size: 0.76rem; }
.agenda-compact .agenda-row { grid-template-columns: 104px 30px 34px minmax(0, 1fr) 16px; padding: 9px 4px; }
.agenda-compact .agenda-row:first-child { border-top: 0; }
#view-agenda .empty-state { padding: 48px 20px; }

/* ───────────── Desplegables (custom-select de proveedor.html) ───────────── */
.custom-select { position: relative; user-select: none; min-width: 0; }
/* El <select> real queda invisible pero presente: así el aviso de "completá este campo" aparece debajo */
.custom-select { position: relative; }
.custom-select > select { position: absolute !important; left: 0; right: 0; bottom: 0; width: 100% !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: 0.9rem var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cs-value { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select.cs-open .cs-trigger, .cs-trigger:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.1); outline: none; }
.custom-select.cs-invalid .cs-trigger { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.custom-select.cs-disabled .cs-trigger { opacity: 0.55; cursor: default; }
.cs-arrow { width: 14px; height: 14px; flex-shrink: 0; color: #9CA3AF; transition: transform 0.22s; }
.custom-select.cs-open .cs-arrow { transform: rotate(180deg); }
.cs-panel.cs-floating {
  position: fixed;
  z-index: 100000;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  animation: cs-in 0.13s ease;
}
.cs-panel.cs-up { animation-name: cs-in-up; }
.cs-panel.cs-floating:has(.cs-search) { display: flex; flex-direction: column; max-height: 320px; overflow: hidden; padding: 0; }
.cs-search { margin: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; font-size: 0.86rem; }
.cs-search:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.1); }
.cs-list { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4px; }
.cs-empty { padding: 10px 14px; color: var(--text-3); font-size: 0.84rem; }
@keyframes cs-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes cs-in-up { from { opacity: 0; transform: translateY(4px); } }
.cs-option { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); font-size: 0.88rem; cursor: pointer; transition: background 0.12s; }
.cs-option:hover, .cs-option.cs-active { background: rgba(123, 79, 255, 0.06); color: var(--purple); }
.cs-option.cs-selected { font-weight: 700; color: var(--purple); background: rgba(123, 79, 255, 0.05); }
.toolbar .custom-select { min-width: 190px; }
.toolbar .cs-trigger { padding: 9px 13px; font-size: 0.86rem; }
/* Desplegable chico de la cabecera del chat (etapa) */
.cs-trigger.wa-link-select { padding: 4px 9px; gap: 6px; font-size: 0.72rem; font-weight: 600; border-radius: 7px; }
.cs-trigger.wa-link-select .cs-arrow { width: 12px; height: 12px; }

@media (max-width: 900px) {
  .status-strip, .home-grid { grid-template-columns: 1fr; }
  .home-ask { align-items: flex-start; }
  .home-ask .chips { justify-content: flex-start; }
  .week-strip { grid-template-columns: repeat(4, 1fr); }
  .agenda-row, .agenda-compact .agenda-row { grid-template-columns: 70px 30px minmax(0, 1fr) 16px; }
  .agenda-row .avatar-initials { display: none; }
  .profile-tabs { top: 0; }
}

/* ───────────── Contactos (la "sábana") ───────────── */
.contacts-wrap { overflow: auto; max-height: calc(100vh - 210px); padding: 0; }
.contacts-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; white-space: nowrap; }
.contacts-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.contacts-table th:hover { color: var(--text); }
.contacts-table th.sorted { color: var(--purple); }
.contacts-table th.asc::after { content: " ↑"; }
.contacts-table th.desc::after { content: " ↓"; }
.contacts-table td { padding: 9px 14px; border-bottom: 1px solid #F3F4F6; color: #374151; }
.contacts-table tbody tr { cursor: pointer; }
.contacts-table tbody tr:hover td { background: #FAFAFF; }
.ct-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.ct-name .avatar-initials { width: 28px; height: 28px; font-size: 0.66rem; }
.col-phone, .col-visit, .col-last, .col-first { font-variant-numeric: tabular-nums; color: var(--text-2); }
.ct-empty { padding: 40px 14px !important; text-align: center; color: var(--text-3) !important; white-space: normal; }
#contactTotal { color: var(--text-3); }

/* ───────────── Mobile: barra superior + menú inferior (como WhatsApp) ───────────── */
#mobileBar, #bottomNav { display: none; }
.wa-back { display: none; }

@media (max-width: 900px) {
  #sidebar { display: none !important; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .view { padding: 16px 16px 24px; }

  #mobileBar:not([hidden]) {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    background: var(--sidebar-bg);
  }
  #mobileBar .sb-brand { flex: 1; }
  .mb-status { width: 9px; height: 9px; border-radius: 50%; background: #6B7280; }
  .mb-status.on { background: #34D399; box-shadow: 0 0 8px #34D399; }
  .mb-user { position: relative; display: flex; text-decoration: none; }
  .mb-user .sb-setup { position: absolute; top: -4px; right: -6px; }

  #bottomNav:not([hidden]) {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.05);
  }
  .bn-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 9px;
    color: var(--text-2);
    font-size: 0.66rem;
    font-weight: 600;
    text-decoration: none;
  }
  /* El ícono activo va dentro de una pastilla, como en WhatsApp */
  .bn-item > svg { width: 22px; height: 22px; padding: 4px 16px; box-sizing: content-box; border-radius: 99px; transition: background 0.18s; }
  .bn-item.active { color: var(--purple); font-weight: 700; }
  .bn-item.active > svg { background: var(--purple-soft); }
  .bn-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 10px);
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--purple);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
  }
  .bn-home { margin-top: -22px; }
  .bn-home-circle {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 4px solid #fff;
    background: var(--purple);
    color: #fff;
    box-shadow: 0 6px 16px rgba(123, 79, 255, 0.4);
  }
  .bn-home-circle svg { width: 22px; height: 22px; }

  /* Asistente: flota arriba del menú */
  #copilot .biz-chatbot-toggle-wrapper { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; }
  #copilot .biz-chatbot-window { right: 12px; width: calc(100vw - 24px); bottom: calc(144px + env(safe-area-inset-bottom)); height: calc(100dvh - 220px); }

  /* WhatsApp: la lista ocupa la pantalla; al tocar un chat, la conversación (con volver) */
  #view-whatsapp { height: calc(100dvh - 56px - 64px); padding: 12px 0 0; }
  #view-whatsapp .topbar { padding: 0 16px; flex-direction: row; align-items: center; }
  #view-whatsapp .topbar-sub, #liveBadge { display: none; }
  .chats-layout { border-radius: 0; border-left: 0; border-right: 0; }
  .chat-list-pane { max-height: none; border-right: 0; min-width: 0; }
  /* Como en WhatsApp: nombre y hora arriba, el último mensaje en una línea cortada con "…" */
  .chat-item { overflow: hidden; padding: 12px 16px 12px 13px; }
  .chat-item-phone { display: none; }
  .chat-item-name { font-size: 0.95rem; }
  .chat-item-time { font-size: 0.72rem; }
  .chat-item-preview { font-size: 0.84rem; margin-bottom: 5px; }
  #waChats .chat-pane { display: none; }
  #waChats.show-chat .chat-list-pane { display: none; }
  #waChats.show-chat .chat-pane { display: flex; }
  .wa-back { display: inline-grid; place-items: center; width: 34px; height: 34px; margin: 0 -4px 0 -8px; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; flex-shrink: 0; }
  .wa-back svg { width: 20px; height: 20px; transform: rotate(180deg); }
  /* Chat abierto: arriba quién es y las herramientas; abajo la etapa y si responde Andy. La ficha va encima del chat */
  .wa-chat-head { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .wa-head-controls { order: 3; width: 100%; }
  .wa-head-controls > .custom-select, .wa-head-controls > .wa-stage { flex: 1; min-width: 0; }
  .wa-side { position: absolute; inset: 0; z-index: 20; width: auto; border-left: 0; }
  .wa-side-top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); }
  /* Dentro de un chat se ocultan el menú, la barra y el asistente (pantalla completa, como WhatsApp) */
  body.in-chat #bottomNav, body.in-chat #mobileBar, body.in-chat #copilot { display: none !important; }
  body.in-chat { padding-bottom: 0; }
  body.in-chat #view-whatsapp { height: 100dvh; padding: 0; }
  body.in-chat #view-whatsapp .topbar { display: none; }

  .contacts-wrap { max-height: calc(100dvh - 300px); }
  .toolbar .custom-select { min-width: 150px; flex: 1 1 150px; }
  .toolbar input[type="search"] { flex-basis: 200px; }
  .save-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ───────────── Configuración → WhatsApp ───────────── */
.wa-intro { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.wa-intro-text { flex: 1; min-width: 0; }
.wa-intro > .btn { flex-shrink: 0; }
@media (max-width: 700px) {
  .wa-intro { flex-wrap: wrap; align-items: flex-start; }
  .wa-intro > .btn { width: 100%; }
}
.wa-intro strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.wa-intro .muted { margin: 0; }
.wa-icon { background: #DCFCE7; color: #15803D; }

@media (max-width: 900px) {
}


/* ───────────── Confirmaciones (dialogs.js, en lugar de confirm/prompt del navegador) ───────────── */
.app-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(13, 15, 26, 0.35);
}
.app-dialog[open] { animation: app-dialog-in 0.16s ease; }
.app-dialog::backdrop { background: rgba(13, 15, 26, 0.5); backdrop-filter: blur(2px); }
@keyframes app-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.app-dialog-body { padding: 24px 24px 8px; }
.app-dialog-title { margin: 0 0 8px; font: 700 1.15rem var(--font-display); }
.app-dialog-text { margin: 0 0 12px; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.app-dialog-input { width: 100%; margin: 4px 0 8px; }
.app-dialog-textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.app-dialog-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.app-dialog-fields .field { margin: 0; }
.app-dialog.wide { width: min(640px, calc(100vw - 32px)); }
.app-dialog-form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.app-dialog-body { overflow-y: auto; }
.app-dialog-fields.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.app-dialog-fields.cols .field { grid-column: 1 / -1; }
.app-dialog-fields.cols .field.half { grid-column: auto; }
@media (max-width: 560px) { .app-dialog-fields.cols .field.half { grid-column: 1 / -1; } }
.app-dialog-checklist { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.catalog-share { display: flex; flex-direction: column; gap: 14px; }
.catalog-share .check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.catalog-share .check-row input { margin-top: 3px; flex-shrink: 0; }
.catalog-share .check-row strong { display: block; font-size: 0.88rem; }
.catalog-share .check-row small { display: block; color: var(--text-2); font-size: 0.78rem; overflow-wrap: anywhere; }
.catalog-share .row-gap { gap: 8px; }
.app-dialog-checklist .check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.app-dialog-checklist .check-row:last-child { border-bottom: none; }
.app-dialog-checklist .check-row input { margin-top: 2px; flex-shrink: 0; }
.app-dialog-checklist .check-row span { display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.app-dialog-checklist .check-row small { color: var(--text-2); font-size: 0.76rem; }
.match-btn { color: var(--purple); font-weight: 600; }
.stock-tabs { display: inline-flex; margin-top: 12px; }
.config-lead { margin: 0 0 12px; }
/* Ayuda */
.mb-help { display: grid; place-items: center; width: 34px; height: 34px; color: var(--text-2); }
.mb-help svg { width: 20px; height: 20px; }
/* Ayuda: temas a la izquierda, preguntas a la derecha */
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.help-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.help-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: inherit; font-size: 0.86rem; font-weight: 600; text-align: left; cursor: pointer; }
.help-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-3); }
.help-nav-item span { flex: 1; }
.help-nav-item small { color: var(--text-3); font-size: 0.74rem; font-weight: 500; }
.help-nav-item:hover { background: #F5F3FF; color: var(--text); }
.help-nav-item.active { background: var(--purple-soft); color: var(--purple); }
.help-nav-item.active svg, .help-nav-item.active small { color: var(--purple); }
.help-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.help-search { width: 100%; }
.help-group { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.help-group-title { display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px 20px 12px; font: 700 1.05rem var(--font-display); }
.help-group-title svg { width: 20px; height: 20px; color: var(--purple); }
.help-item { border-top: 1px solid var(--border); }
.help-item summary { padding: 14px 20px; cursor: pointer; font-weight: 600; font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.help-item summary:hover { background: #FAFAFF; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; color: var(--purple); font-weight: 700; }
.help-item[open] summary::after { content: "–"; }
.help-item p { margin: 0; padding: 0 20px 16px; color: #374151; font-size: 0.88rem; line-height: 1.6; }
.help-empty { padding: 28px 20px; text-align: center; background: #fff; border: 1px dashed var(--border); border-radius: 16px; color: var(--text-2); }
.help-empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.help-ask { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px solid #DDD6FE; border-radius: 16px; background: linear-gradient(120deg, #F7F3FF 0%, #fff 70%); }
.help-ask-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--purple); color: #fff; }
.help-ask-icon svg { width: 20px; height: 20px; }
.help-ask-body { flex: 1; min-width: 0; }
.help-ask-body strong { display: block; font-size: 0.95rem; }
.help-ask-body p { margin: 2px 0 10px; color: var(--text-2); font-size: 0.84rem; }
.help-ask-row { display: flex; gap: 8px; }
.help-ask-input { flex: 1; min-width: 0; }
.help-support { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 8px; color: var(--text-2); font-size: 0.84rem; }
.help-support a { color: var(--purple); font-weight: 600; }
.help-support small { color: var(--text-3); }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; gap: 14px; }
  .help-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .help-nav::-webkit-scrollbar { display: none; }
  .help-nav-item { width: auto; flex-shrink: 0; white-space: nowrap; }
  .help-nav-item small { display: none; }
  .help-ask-row { flex-direction: column; }
}
.config-subtitle { margin: 6px 0 8px; font: 700 0.95rem var(--font-display); }
.contact-segments { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.wa-tab-count.urgent { background: #FEE2E2; color: #B91C1C; }
.case-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); }
.case-row:first-child { border-top: 0; }
.case-row.urgent { background: #FFF7F7; box-shadow: inset 3px 0 0 #EF4444; }
.case-row.muted { opacity: 0.6; }
.case-main { flex: 1; min-width: 0; }
.case-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-top strong { font-size: 0.92rem; }
.case-prop { color: var(--text-2); font-size: 0.82rem; }
.case-summary { margin: 6px 0 4px; font-size: 0.86rem; color: #374151; line-height: 1.45; }
.case-time { font-size: 0.74rem; color: var(--text-3); }
.case-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.case-actions .custom-select { width: 160px; }
.case-actions .btn svg { width: 14px; height: 14px; margin-right: 4px; }
@media (max-width: 700px) {
  .case-row { flex-direction: column; }
  .case-actions { width: 100%; }
}
.pill.info { background: #EFF6FF; color: #1D4ED8; border-color: #DBEAFE; }
.badge.tenant { background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.rentals-toolbar { justify-content: space-between; align-items: center; }
.rentals-toolbar .chips { display: flex; gap: 6px; }
.rental-list { padding: 4px 0; margin-bottom: 14px; }
.rental-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); }
.rental-row:first-child { border-top: 0; }
.rental-row.muted { opacity: 0.6; }
.rental-kind { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--purple-soft); color: var(--purple); }
.rental-kind.booking { background: #E0F2FE; color: #0369A1; }
.rental-kind svg { width: 18px; height: 18px; }
.rental-main { flex: 1; min-width: 0; }
.rental-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rental-top strong { font-size: 0.92rem; }
.rental-meta { margin-top: 3px; color: var(--text-2); font-size: 0.8rem; }
/* Calendario propio (date-picker.js) */
.dp-input { cursor: pointer; caret-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237B4FFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.dp-panel { position: fixed; z-index: 1000; width: 280px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 16px 40px rgba(13, 15, 26, 0.18); font-size: 0.86rem; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head strong { font-weight: 700; }
.dp-nav { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--purple); font-size: 1.2rem; cursor: pointer; }
.dp-nav:hover { background: var(--purple-soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-3); padding: 4px 0; }
.dp-cell { height: 34px; border: 0; border-radius: 9px; background: transparent; font: inherit; color: var(--text); cursor: pointer; }
.dp-cell:hover { background: var(--purple-soft); color: var(--purple); }
.dp-cell.today { box-shadow: inset 0 0 0 1.5px #C4B5FD; font-weight: 700; }
.dp-cell.selected { background: var(--purple); color: #fff; font-weight: 700; }
.dp-cell.empty { pointer-events: none; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-foot button { border: 0; background: transparent; color: var(--purple); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.dp-foot button:hover { background: var(--purple-soft); }
.contract-dialog { display: flex; flex-direction: column; gap: 14px; }
.contract-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed #C4B5FD; border-radius: 12px; background: #FAF8FF; }
.contract-file-name { font-weight: 600; font-size: 0.88rem; }
.contract-file-name.muted { color: var(--text-2); font-weight: 500; }
.contract-file small { color: var(--text-3); }
.contract-file-actions { margin-left: auto; display: flex; gap: 2px; }
.danger-text { color: var(--danger, #DC2626); }
.contract-text { font-size: 0.84rem; line-height: 1.5; }
.rental-note { margin-top: 4px; font-size: 0.78rem; color: var(--ok); font-weight: 600; }
.adjustment-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px solid #DDD6FE; border-radius: 10px; background: #FAF8FF; }
.adjustment-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.adjustment-text strong { font-size: 0.86rem; }
.adjustment-text span { font-size: 0.78rem; color: var(--text-2); line-height: 1.4; }
.adjustment-actions { display: flex; gap: 6px; }
.rental-actions { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.rentals-empty { max-width: 640px; margin: 24px auto; }
.rentals-empty .row-gap { justify-content: center; }
@media (max-width: 700px) {
  .rental-row { flex-wrap: wrap; }
  .rental-actions { width: 100%; justify-content: flex-start; }
}
.stock-actions { display: inline-flex; align-items: center; gap: 10px; }
.stock-actions[hidden] { display: none; }
.prop-extra { margin-top: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.prop-extra legend { padding: 0 6px; font-weight: 700; font-size: 0.85rem; }
.prop-extra legend small { font-weight: 500; color: var(--text-2); }
.guide-help { margin: 0 0 10px; }
#guideFields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
#guideFields .field { margin: 0; }
@media (max-width: 700px) { #guideFields { grid-template-columns: 1fr; } }
.check-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.86rem; }
.check-line small { color: var(--text-2); }
.pill.colleague { background: #FEF3C7; color: #92400E; }
.match-btn svg { width: 14px; height: 14px; }
.app-dialog-link { display: flex; gap: 8px; align-items: center; }
.app-dialog-link .app-dialog-input { margin: 0; }
.app-dialog-note { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--purple-soft); color: #374151; font-size: 0.8rem; line-height: 1.45; }
.app-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; }
.btn-danger-solid { background: var(--danger); color: #fff; border: none; border-radius: 9999px; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3); }
.btn-danger-solid:not(:disabled):hover { background: #B91C1C; transform: translateY(-1px); color: #fff; }

/* ───────────── Controles de configuración: chips, filas con interruptor ───────────── */
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.choice, .choice-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 0.84rem var(--font-sans);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 7px -2px 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  transition: all 0.15s;
}
.choice:hover, .choice-btn:hover { border-color: #C4B5FD; color: var(--purple); }
.choice:has(input:checked), .choice-btn.active { background: var(--purple-soft); border-color: var(--purple); color: var(--purple); }
.choice:has(input:checked) span::before {
  border-color: var(--purple);
  background: var(--purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.choice:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: 2px; }

.settings-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--surface); }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-row strong { display: block; font-size: 0.9rem; }
.setting-row small { display: block; color: var(--text-2); font-size: 0.78rem; margin-top: 1px; }
.setting-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.setting-row > .custom-select, .setting-controls .custom-select { width: 150px; flex-shrink: 0; }

/* Cuenta */
.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #F5F1FF, #EEF9FF);
  border: 1px solid #DDD6FE;
}
.plan-card strong { display: block; font: 700 1rem var(--font-display); }
.plan-price { font: 700 1.4rem var(--font-display); color: var(--purple); }
.plan-price small { font: 500 0.8rem var(--font-sans); color: var(--text-2); }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.account-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.account-label { display: block; color: var(--text-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.account-value { margin-top: 3px; font-weight: 600; font-size: 0.88rem; overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ───────────── Configuración en el celular ───────────── */
@media (max-width: 900px) {
  #view-config { padding-bottom: 140px; }
  .profile-hero { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 1.05rem; }
  .profile-info h1 { font-size: 1.15rem; }
  .profile-info p { overflow-wrap: anywhere; }
  .profile-hero > .pill { order: 3; }
  .profile-tabs { margin: 10px -16px 18px; padding: 6px 10px; border-radius: 0; border-left: 0; border-right: 0; }
  .card.body { padding: 16px; }
  .section-head h2 { font-size: 1.05rem; }
  .narrow { max-width: none; }
  .setting-row { flex-wrap: wrap; padding: 12px 14px; }
  .setting-row > div:first-child { flex: 1 1 200px; min-width: 0; }
  .setting-controls { width: 100%; justify-content: space-between; }
  .setting-row > .custom-select { width: 100%; }
  .day-row { gap: 10px; }
  .day-row .day-chip { width: 100%; justify-content: flex-start; }
  .day-times { width: 100%; }
  .day-times .custom-select { flex: 1; width: auto; }
  .account-grid { grid-template-columns: 1fr; }
  .plan-card { flex-wrap: wrap; }
  .sheet-status { gap: 8px 12px; }
  .input-with-action, .phone-add,   .phone-row { grid-template-columns: 1fr auto; }
  .phone-row .help { display: none; }
  .save-bar { flex-direction: column; align-items: stretch; border-radius: 16px; padding: 12px; }
  .save-bar .btn { width: 100%; }
}

/* Activar la suscripción (pantalla de entrada) */
.gate-plan { padding: 16px 18px; border-radius: 14px; background: rgba(123, 79, 255, 0.1); border: 1px solid rgba(123, 79, 255, 0.35); text-align: left; }
.gate-plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: #F3F4F6; }
.gate-plan-head strong { font: 700 1rem var(--font-display); }
.gate-plan-head span { font: 700 1.5rem var(--font-display); color: #C4B5FD; }
.gate-plan-head small { font: 500 0.8rem var(--font-sans); color: #9CA3AF; }
.gate-plan ul { margin: 0; padding-left: 18px; color: #D1D5DB; font-size: 0.84rem; line-height: 1.7; }
.gate-terms { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; color: #D1D5DB; font-size: 0.85rem; text-align: left; cursor: pointer; }
.gate-terms input { width: 18px; height: 18px; margin-top: 1px; accent-color: #7B4FFF; flex-shrink: 0; }
.gate-terms a { color: #C4B5FD; }
.gate-secure { margin: 0; color: #6B7280; font-size: 0.75rem; }
.gate-notice { padding: 10px 12px; border-radius: 10px; background: rgba(251, 191, 36, 0.12); color: #FCD34D; font-size: 0.82rem; text-align: left; }

/* Ingresar / Crear cuenta (pestañas como en cliente.html) */
.login-tabs { display: flex; gap: 10px; margin-bottom: 6px; padding-bottom: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.login-tab {
  flex: 1;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #9CA3AF;
  font: 600 14px var(--font-sans);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.login-tab:hover { color: #E5E7EB; }
.login-tab.active { color: #A78BFA; border-bottom-color: #7B4FFF; }
.signup-options { display: flex; flex-direction: column; gap: 10px; transition: opacity 0.2s; }
.signup-options.is-locked { opacity: 0.45; }

/* Selección de plan (pantalla comercial antes de pagar) */
.login-card.wide { max-width: 860px; }
.plan-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 4px 0 6px; }
.plan-option {
  flex: 1 1 280px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  text-align: left;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(123, 79, 255, 0.16), rgba(123, 79, 255, 0.05));
  border: 1px solid rgba(123, 79, 255, 0.45);
  box-shadow: 0 12px 32px rgba(123, 79, 255, 0.15);
}
.plan-option h3 { margin: 0; font: 700 1.2rem var(--font-display); color: #F3F4F6; }
.plan-option-tagline { margin: 0; color: #9CA3AF; font-size: 0.84rem; line-height: 1.45; }
.plan-option-price { font: 800 2.2rem var(--font-display); color: #fff; }
.plan-option-price small { font: 500 0.9rem var(--font-sans); color: #9CA3AF; }
.plan-option ul { flex: 1; margin: 0 0 6px; padding: 0; list-style: none; color: #D1D5DB; font-size: 0.86rem; line-height: 1.5; }
.plan-option li { position: relative; padding: 4px 0 4px 26px; }
.plan-option li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7B4FFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.login-card.wide .gate-terms { max-width: 380px; margin: 4px auto; }
.login-card.wide .btn-google { max-width: 380px; margin: 0 auto; }
.plan-option { position: relative; }
.plan-trial { align-self: flex-start; padding: 3px 10px; border-radius: 99px; background: #34D399; color: #052E1C; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.plan-option-note { margin: 0; color: #9CA3AF; font-size: 0.76rem; line-height: 1.45; text-align: center; }

/* Seguimientos */
.followup-body { transition: opacity 0.2s; }
.official-locked { opacity: 0.35; filter: grayscale(0.4); pointer-events: none; user-select: none; }
/* Seguimientos bloqueados sin la conexión oficial: el mismo gris que el resto (sin sumarle el de "apagados") */
.followup-body.official-locked.is-off .card { opacity: 1; }
.followup-body.official-locked .followup-off-note { display: none; }
.official-note { margin-bottom: 14px; line-height: 1.5; }
.followup-off-note { display: none; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; }
.followup-body.is-off .followup-off-note { display: block; }
.followup-body.is-off .card { opacity: 0.55; }
.week-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.week-chip { justify-content: center; padding: 10px 0; border-radius: 12px; }
.week-chip span::before { display: none; }
.week-chip:has(input:checked) { background: var(--purple); border-color: var(--purple); color: #fff; }
.days-grid { margin-bottom: 14px; }
.day-row .day-name { width: 110px; font-weight: 600; font-size: 0.88rem; color: var(--text); }
.day-row.is-hidden, .setting-row.is-hidden { display: none; }
.setting-row .day-times .custom-select { width: 120px; }

.cadence-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cadence-item { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.cadence-head strong { display: block; font-size: 0.9rem; }
.cadence-head small { display: block; color: var(--text-2); font-size: 0.78rem; margin-bottom: 10px; }
.cadence-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cadence-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border-radius: 99px;
  background: var(--purple-soft);
  border: 1px solid #DDD6FE;
  color: var(--purple);
  font-size: 0.82rem;
  font-weight: 700;
}
.cadence-step button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(123, 79, 255, 0.15); color: var(--purple); font-size: 0.85rem; line-height: 1; cursor: pointer; }
.cadence-step button:hover { background: var(--purple); color: #fff; }
.cadence-steps .custom-select { width: 150px; }
.cadence-steps .cs-trigger { padding: 6px 12px; border-style: dashed; border-radius: 99px; font-size: 0.82rem; font-weight: 600; color: var(--purple); }
.cadence-cold { color: var(--text-3); font-size: 0.8rem; font-weight: 600; }

@media (max-width: 900px) {
  .week-picker { gap: 5px; }
  .week-chip { padding: 9px 0; font-size: 0.78rem; }
  .day-row .day-name { width: 100%; }
  .setting-row .day-times { width: 100%; }
  .setting-row .day-times .custom-select { flex: 1; width: auto; }
}

/* Código de descuento en la selección de plan */
.promo-box { max-width: 380px; margin: 0 auto; width: 100%; text-align: center; }
.promo-link { border: 0; background: none; color: #A78BFA; font: 600 0.84rem var(--font-sans); cursor: pointer; text-decoration: underline; }
.promo-form { display: flex; gap: 8px; }
.promo-form .auth-input { margin: 0; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.promo-form .btn-google { width: auto; padding: 0 18px; }
.promo-error { margin-top: 6px; color: #FCA5A5; font-size: 0.8rem; }
.promo-applied { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: #6EE7B7; font-size: 0.84rem; text-align: left; }
.promo-applied button { border: 0; background: none; color: #9CA3AF; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }

/* Fotos de propiedades */
.prop-photo { position: relative; height: 170px; background: var(--surface-2); overflow: hidden; }
.prop-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prop-photo-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: rgba(9, 11, 17, 0.7); color: #fff; font-size: 0.72rem; font-weight: 700; }
.prop-photo-count svg { width: 12px; height: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 6px; }
.photo-tile, .photo-add { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; }
.photo-tile { background: var(--surface-2); border: 1px solid var(--border); }
.photo-tile.is-cover { border: 2px solid var(--purple); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-badge { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 99px; background: var(--purple); color: #fff; font-size: 0.65rem; font-weight: 700; }
.photo-actions { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.photo-tile:hover .photo-actions, .photo-tile:focus-within .photo-actions { opacity: 1; }
.photo-actions button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: rgba(9, 11, 17, 0.7); color: #fff; cursor: pointer; }
.photo-actions button:hover { background: var(--purple); }
.photo-actions svg { width: 13px; height: 13px; }
.photo-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--purple); font: 600 0.78rem var(--font-sans); cursor: pointer; }
.photo-add:hover { border-color: var(--purple); background: var(--purple-soft); }
.photo-add svg { width: 18px; height: 18px; }
@media (hover: none) { .photo-actions { opacity: 1; } }


/* WhatsApp: conexión oficial y plantillas */
.wa-choice-intro h3 { margin: 0 0 4px; font: 700 1.1rem var(--font-display); }
.wa-choice-intro p { margin: 0 0 18px; color: var(--text-2); font-size: 0.88rem; }
.wa-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 22px; }
.wa-choices.single { grid-template-columns: minmax(0, 560px); }
.wa-choice { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.wa-choice.featured { border: 2px solid var(--purple); background: linear-gradient(160deg, #F7F3FF 0%, #fff 60%); box-shadow: 0 12px 30px rgba(123, 79, 255, 0.1); }
.wa-choice-badge { position: absolute; top: -11px; left: 20px; padding: 3px 10px; border-radius: 999px; background: var(--purple); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.wa-choice-head { display: flex; align-items: center; gap: 12px; }
.wa-choice-head h3 { margin: 0; font: 700 1.05rem var(--font-display); }
.wa-choice-head p { margin: 2px 0 0; color: var(--text-2); font-size: 0.82rem; }
.wa-choice-icon { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.wa-choice:not(.featured) .wa-choice-icon { background: #E8F8EE; color: #16A34A; }
.wa-choice-icon svg { width: 22px; height: 22px; }
.wa-choice-points { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; flex: 1; }
.wa-choice-points li { display: flex; align-items: flex-start; gap: 9px; font-size: 0.86rem; line-height: 1.4; color: var(--text); }
.wa-choice-points svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; padding: 2px; border-radius: 50%; }
.wa-choice-points .yes svg { background: #DCFCE7; color: #15803D; }
.wa-choice-points .no { color: var(--text-2); }
.wa-choice-points .no svg { background: #F3F4F6; color: #9CA3AF; }
.wa-choice-meta { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 0.8rem; }
.wa-choice-meta span { display: flex; align-items: center; gap: 7px; }
.wa-choice-meta svg { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.wa-choice > .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wa-choice > .btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.wa-choice:not(.featured) > .btn { background: #fff; color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.wa-choice-tip { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; color: var(--text-2); font-size: 0.82rem; line-height: 1.45; }
.wa-choice-tip svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--purple); }
@media (max-width: 760px) { .wa-choices { grid-template-columns: 1fr; gap: 22px; } }
.wa-templates { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.tpl-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tpl-intro strong { display: block; margin-bottom: 2px; }
.tpl-intro .muted { margin: 0; }
.tpl-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tpl-head small { display: block; color: var(--text-2); font-size: 0.8rem; }
.tpl-text { width: 100%; min-height: 90px; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.tpl-problem { margin: 0; color: var(--danger); font-size: 0.8rem; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 0.8rem; }
.tpl-vars code { padding: 1px 6px; border-radius: 6px; background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.wa-template-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; background: #F0F2F5; border-top: 1px solid #E5E7EB; font-size: 0.78rem; color: #4B5563; }
.wa-template-strip > span { flex: 1 1 100%; }
.wa-template-strip input { flex: 1; min-width: 180px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.85rem; }
@media (max-width: 640px) { .tpl-intro { flex-direction: column; } }

/* Alta de propiedad: dirección con sugerencias */
.address-wrap { position: relative; }
.address-suggestions { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12); max-height: 260px; overflow-y: auto; }
.address-suggestions li { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.address-suggestions li strong { font-size: 0.88rem; font-weight: 600; }
.address-suggestions li span { color: var(--text-2); font-size: 0.78rem; }
.address-suggestions li:hover, .address-suggestions li.active { background: var(--purple-soft); }
.address-area { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.address-area strong { color: var(--text); font-weight: 600; }
.address-area .link-btn { padding: 0; border: 0; background: none; color: var(--purple); font: inherit; font-weight: 600; cursor: pointer; }
.address-extra { margin-top: -4px; }

/* Propiedades, Alquileres y Reclamos: en la compu son ítems de la barra lateral; en el celular, pestañas */
.stock-tabs { display: none; }
@media (max-width: 900px) { .stock-tabs { display: inline-flex; } }

/* Agenda: eventos del Google Calendar del broker */
.agenda-row.gcal { background: #F8FAFC; border-color: #E2E8F0; }
/* Los eventos del calendario no tienen avatar: el título usa esa columna */
.agenda-row.gcal, .agenda-compact .agenda-row.gcal { grid-template-columns: 92px 30px minmax(0, 1fr) 16px; }
@media (max-width: 900px) { .agenda-row.gcal, .agenda-compact .agenda-row.gcal { grid-template-columns: 70px 30px minmax(0, 1fr) 16px; } }
.agenda-row.gcal .agenda-kind { background: #E2E8F0; color: #475569; }
.agenda-row.gcal strong { color: #334155; }
.week-pill.gcal { background: #E2E8F0; color: #475569; }
.day-allday { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
/* Configuración → Calendario: Google Calendar */
.cal-head { display: flex; gap: 14px; align-items: flex-start; }
.cal-head .card-title { margin: 0 0 4px; }
.cal-head .muted { margin: 0; }
.cal-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.cal-icon svg { width: 20px; height: 20px; }
.cal-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 16px; }
.calendar-card .sheet-status { margin-top: 16px; }
.cal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

/* Configuración → Plantillas */
#templatesCard { display: flex; flex-direction: column; gap: 18px; }
.tpl-groups { display: flex; flex-direction: column; gap: 22px; }
.tpl-group { display: flex; flex-direction: column; gap: 10px; }
.tpl-group-title { margin: 0; font-size: 0.95rem; display: flex; flex-direction: column; gap: 2px; }
.tpl-group-title small { font-weight: 400; color: var(--text-2); font-size: 0.8rem; }
.tpl-optional { padding: 0; }
.tpl-optional > summary { list-style: none; cursor: pointer; padding: 14px 16px; }
.tpl-optional > summary::-webkit-details-marker { display: none; }
.tpl-optional > summary .tpl-head > div::before { content: "›"; float: left; margin-right: 10px; color: var(--text-3); font-size: 1.1rem; line-height: 1.1; transition: transform 0.15s; }
.tpl-optional[open] > summary .tpl-head > div::before { transform: rotate(90deg); }
.tpl-optional[open] { padding-bottom: 16px; }
.tpl-optional[open] > :not(summary) { margin: 0 16px; }
.tpl-optional[open] > summary { padding-bottom: 6px; }
.tpl-text:disabled { background: #F9FAFB; color: var(--text-2); }
.tpl-lock { display: flex; gap: 12px; align-items: flex-start; }
.tpl-lock > svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.tpl-lock p { margin: 4px 0 10px; }
.wa-templates-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.wa-templates-link:hover { border-color: var(--purple); background: var(--purple-soft); }
.wa-templates-link svg { width: 16px; height: 16px; color: var(--text-3); }

/* Configuración → Calificación: temas como chips */
.topic-picker { margin-bottom: 10px; }
.topic-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topic-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border: 1px solid var(--purple); border-radius: 9999px; background: var(--purple-soft); color: var(--purple); font: 600 0.84rem var(--font-sans); }
.topic-chip small { padding: 1px 6px; border-radius: 9999px; background: #fff; color: var(--purple); font-size: 0.68rem; font-weight: 600; }
.topic-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.topic-chip button:hover { background: #fff; }
.topic-chip.own { border-style: dashed; }
.topic-add { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px dashed var(--border-strong); border-radius: 9999px; background: var(--surface); color: var(--text-2); font: 600 0.84rem var(--font-sans); cursor: pointer; }
.topic-add svg { width: 14px; height: 14px; }
.topic-add:hover, .topic-add.open { border-color: var(--purple); color: var(--purple); }
.topic-menu { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #FAFAFF; display: flex; flex-direction: column; gap: 14px; }
.topic-menu-group { display: flex; flex-direction: column; gap: 8px; }
.topic-menu-group > small { color: var(--text-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.topic-options { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-option { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 9999px; background: var(--surface); color: var(--text-2); font: 500 0.82rem var(--font-sans); cursor: pointer; }
.topic-option svg { width: 12px; height: 12px; }
.topic-option:hover { border-color: var(--purple); color: var(--purple); }
.topic-free { display: flex; gap: 8px; }
.topic-free input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.86rem; }
.case-details { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 14px; margin: 8px 0 6px; padding: 10px 12px; border-radius: 10px; background: #F9FAFB; font-size: 0.82rem; }
.case-details dt { color: var(--text-2); }
.case-details dd { margin: 0; color: var(--text); font-weight: 500; }
@media (max-width: 640px) { .case-details { grid-template-columns: 1fr; } .case-details dd { margin-bottom: 6px; } }

/* Configuración: menú lateral (como Ayuda) y una sección por vez */
.config-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 18px; }
.config-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.config-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: inherit; font-size: 0.86rem; font-weight: 600; text-align: left; cursor: pointer; }
.config-nav-item > svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-3); }
.config-nav-item > span:first-of-type { flex: 1; }
.config-nav-item:hover { background: #F5F3FF; color: var(--text); }
.config-nav-item.active { background: var(--purple-soft); color: var(--purple); }
.config-nav-item.active > svg { color: var(--purple); }
.nav-ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #16A34A; color: #fff; flex-shrink: 0; }
.nav-ok svg { width: 11px; height: 11px; stroke-width: 3.5; }
.nav-pending { padding: 2px 7px; border-radius: 9999px; background: #FEF3C7; color: #B45309; font-size: 0.68rem; font-weight: 700; flex-shrink: 0; }
.config-content { min-width: 0; }
.config-content .config-panel { margin-bottom: 0; }
.section-pending { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-pending svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 900px) {
  .config-layout { grid-template-columns: 1fr; gap: 14px; }
  .config-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .config-nav::-webkit-scrollbar { display: none; }
  .config-nav-item { width: auto; flex-shrink: 0; white-space: nowrap; }
}
.section-pending[hidden] { display: none; }
.config-nav-group { padding: 12px 10px 4px; color: var(--text-3); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.config-nav-group:first-child { padding-top: 4px; }
@media (max-width: 900px) { .config-nav-group { display: none; } }

/* Configuración → Marca y catálogo */
.brand-preview { --brand: #7B4FFF; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #F6F7FB; }
.bp-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.bp-logo { display: block; height: 34px; width: auto; max-width: 140px; object-fit: contain; }
.bp-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.bp-name { display: flex; flex-direction: column; line-height: 1.2; }
.bp-name small { color: var(--text-2); font-size: 0.74rem; }
.bp-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.bp-pill { align-self: flex-start; padding: 3px 9px; border-radius: 9999px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.bp-price { font-size: 1.05rem; }
.bp-line { height: 8px; width: 70%; border-radius: 4px; background: #E5E7EB; }
.bp-line.short { width: 45%; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-box { box-sizing: border-box; width: 140px; height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: repeating-conic-gradient(#F3F4F6 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.logo-box img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-box.empty { background: #F9FAFB; color: var(--text-3); }
.logo-box.empty svg { flex-shrink: 0; }
.logo-box.empty svg { width: 22px; height: 22px; }
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.color-row input[type="color"] { width: 42px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.brand-actions { margin-top: 6px; }

/* Marca y catálogo → Reseñas */
.review-link { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.review-link input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.86rem; color: var(--text-2); background: #F9FAFB; }
.review-summary { margin: 0 0 12px; font-weight: 600; }
.review-tabs { margin-bottom: 12px; }
.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-row { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.review-row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-row-top small { color: var(--text-3); }
.review-row p { margin: 6px 0 10px; white-space: pre-line; }
.review-stars { color: #F59E0B; letter-spacing: 1px; }
@media (max-width: 640px) { .review-link { flex-wrap: wrap; } .review-link input { flex-basis: 100%; } }
.cover-box { box-sizing: border-box; width: 240px; height: 80px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.cover-box img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-box.empty { display: flex; align-items: center; justify-content: center; padding: 8px; background: linear-gradient(120deg, #F1ECFF, #fff); color: var(--text-3); font-size: 0.74rem; text-align: center; }

/* Chat: tildes de entrega y mensajes que no salieron */
.wa-tick { margin-left: 3px; color: #8696A0; font-size: 0.7rem; letter-spacing: -2px; }
.wa-tick.read { color: #53BDEB; }
.wa-tick.failed { color: #DC2626; letter-spacing: 0; }
.wa-msg.failed { box-shadow: inset 0 0 0 1px #FCA5A5; background: #FEF2F2; }
.wa-msg-error { display: block; margin-top: 4px; color: #B91C1C; font-size: 0.74rem; font-weight: 600; }

/* Mobile: las pestañas se deslizan y los botones de arriba no se salen de la pantalla */
@media (max-width: 900px) {
  .topbar-actions { width: 100%; }
  .topbar > div:first-child { width: 100%; }
  .wa-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .wa-tabs::-webkit-scrollbar { display: none; }
  .wa-tab { flex-shrink: 0; white-space: nowrap; }
  .stock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .stock-actions[hidden] { display: none; }
  .stock-actions .btn { width: 100%; justify-content: center; padding-left: 10px; padding-right: 10px; white-space: normal; line-height: 1.2; }
  .stock-actions .btn-primary { grid-column: 1 / -1; order: -1; }
  #shareCatalogBtn { grid-column: 1 / -1; }
  #rentalActions .btn-primary { grid-column: auto; order: 0; }
}

/* Contactos en el celular: una tarjeta por contacto (nombre y etapa; propiedad y último mensaje abajo) */
@media (max-width: 640px) {
  .contacts-wrap { max-height: none; overflow: visible; }
  .contacts-table, .contacts-table tbody { display: block; white-space: normal; }
  .contacts-table thead { display: none; }
  .contacts-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid #F3F4F6; }
  .contacts-table td { display: none; padding: 0; border: 0; }
  .contacts-table td.col-name { display: block; grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
  .contacts-table td.col-stage, .contacts-table td.col-cases { display: block; grid-column: 2; grid-row: 1; justify-self: end; }
  .contacts-table td.col-property, .contacts-table td.col-rentalProperty { display: block; grid-column: 1; padding-left: 42px; color: var(--text-2); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .contacts-table td.col-last { display: block; grid-column: 2; grid-row: 2; justify-self: end; color: var(--text-3); font-size: 0.74rem; }
  .contacts-table td.ct-empty { display: block; white-space: normal; }
}
@media (max-width: 900px) {
  /* Pestaña WhatsApp: el título y las pestañas en una fila */
  #view-whatsapp .topbar > div:first-child { width: auto; flex: 1 0 auto; }
  #view-whatsapp .topbar-actions { width: auto; }
}
/* Laptops chicas: la columna de la agenda del Inicio no entra al costado → va debajo */
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr; } }

/* Celular: los números en una fila compacta que se desliza (la lista aparece antes) */
@media (max-width: 640px) {
  .kpis { display: flex; overflow-x: auto; gap: 8px; margin: 0 0 14px; padding: 0 0 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpis .kpi { flex: 0 0 auto; min-width: 132px; max-width: 170px; padding: 10px 12px; scroll-snap-align: start; }
  .kpis .kpi-label { font-size: 0.62rem; }
  .kpis .kpi-val { display: flex; flex-direction: column; font-size: 1.4rem; margin-top: 2px; line-height: 1.1; }
  .kpis .kpi-val small { margin: 2px 0 0; font-size: 0.72rem; line-height: 1.25; }
}

/* Configuración → WhatsApp conectado */
.wa-connected { display: flex; flex-direction: column; gap: 16px; }
.wa-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(120deg, #ECFDF3 0%, #fff 75%); border: 1px solid #D1FADF; }
.wa-hero-icon { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border-radius: 16px; background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3); }
.wa-hero-icon svg { width: 28px; height: 28px; }
.wa-hero-main { min-width: 0; }
.wa-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-hero-phone { font: 700 1.35rem var(--font-display); letter-spacing: -0.01em; }
.wa-hero-main p { margin: 3px 0 0; color: var(--text-2); font-size: 0.86rem; }
.wa-hero-main p b { color: var(--text); }
.wa-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wa-tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); text-decoration: none; }
.wa-tile > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-tile small { color: var(--text-3); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.wa-tile strong { font-size: 1rem; }
.wa-tile span:not(.wa-tile-icon) { color: var(--text-2); font-size: 0.8rem; line-height: 1.35; }
.wa-tile .btn { align-self: center; flex-shrink: 0; }
.wa-tile.link:hover { border-color: #C4B5FD; box-shadow: 0 4px 14px rgba(123, 79, 255, 0.08); }
.wa-tile.link > svg { align-self: center; width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.wa-tile-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #F3F4F6; color: var(--text-2); }
.wa-tile-icon svg { width: 18px; height: 18px; }
.wa-tile-icon.ok { background: #ECFDF3; color: #059669; }
.wa-tile-icon.warn { background: #FFFBEB; color: #D97706; }
.wa-tile-icon.danger { background: #FEF2F2; color: #DC2626; }
.wa-connected-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--border); padding-top: 14px; }
.wa-connected-foot .spacer { flex: 1; }
.wa-disconnect { color: var(--danger); }
@media (max-width: 640px) {
  .wa-tiles { grid-template-columns: 1fr; }
  .wa-hero { padding: 14px; gap: 12px; }
  .wa-hero-icon { width: 44px; height: 44px; border-radius: 13px; }
  .wa-hero-phone { font-size: 1.15rem; }
}

/* Embudo: los números no se achican y hay margen a los costados en el celular */
.wa-body > .kpis, .wa-body > .search-card { flex-shrink: 0; }
@media (max-width: 900px) { #waFunnel { padding: 0 16px 16px; } }

/* Configuración → Seguimientos: ritmos sugeridos y pasos por etapa */
.cadence-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 16px; }
.cadence-preset { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.cadence-preset:hover { border-color: #C4B5FD; }
.cadence-preset.active { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.12); background: #FBFAFF; }
.cadence-preset strong { font-size: 0.92rem; }
.cadence-preset.active strong::after { content: " ✓"; color: var(--purple); }
.cadence-preset-hint { color: var(--text-2); font-size: 0.8rem; line-height: 1.35; }
.cadence-preset-days { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; color: var(--text-3); font-size: 0.74rem; }
.cadence-preset-days b { color: var(--text-2); font-weight: 600; }
.cadence-custom { grid-column: 1 / -1; margin: 0; }
.cadence-rows { display: flex; flex-direction: column; gap: 8px; }
.cadence-row { display: flex; align-items: center; gap: 10px; }
.cadence-num { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 0.74rem; font-weight: 700; }
.cadence-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; }
.cadence-fields select, .cadence-fields .custom-select { width: 100%; }
.cadence-warn { flex-shrink: 0; padding: 3px 8px; border-radius: 999px; background: #FFFBEB; color: #B45309; font-size: 0.7rem; font-weight: 700; }
.cadence-remove { width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: 1.1rem; cursor: pointer; }
.cadence-remove:hover { background: #FEF2F2; color: var(--danger); }
.cadence-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cadence-add-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px dashed var(--border-strong); border-radius: 999px; background: #fff; color: var(--purple); font: 600 0.82rem var(--font-sans); cursor: pointer; }
.cadence-add-btn svg { width: 14px; height: 14px; }
.cadence-add-btn:hover { border-color: var(--purple); }
@media (max-width: 640px) {
  .cadence-presets { grid-template-columns: 1fr; }
  .cadence-fields { grid-template-columns: 1fr; }
}

/* Inicio: para hacer hoy (franja), propiedades más consultadas y embudo del mes */
.home-grid + .home-grid { margin-top: 14px; }
.todo-strip { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.todo-strip.empty { background: linear-gradient(90deg, #ECFDF3, #fff 70%); border-color: #D1FADF; }
.todo-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.todo-title svg { width: 17px; height: 17px; color: var(--purple); }
.todo-title.ok svg { color: #059669; }
.todo-title.ok { color: #047857; }
.todo-sub { color: var(--text-2); font-size: 0.84rem; }
.todo-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.todo-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); font-size: 0.82rem; font-weight: 500; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.todo-chip:hover { border-color: #C4B5FD; background: #FCFBFF; }
.todo-icon { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #F3F4F6; color: var(--text-2); }
.todo-icon svg { width: 14px; height: 14px; }
.todo-chip.alert { border-color: #FED7AA; }
.todo-chip.alert .todo-icon { background: #FFF7ED; color: #EA580C; }
.todo-chip.warn .todo-icon { background: #FFFBEB; color: #D97706; }
.todo-chip.ok .todo-icon { background: #ECFDF3; color: #059669; }
.todo-chip.info .todo-icon { background: #EFF6FF; color: #2563EB; }
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; color: var(--text); text-decoration: none; }
.hot-item:hover { background: #FAFAFB; }
.hot-rank { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #F3F4F6; color: var(--text-2); font-size: 0.8rem; font-weight: 700; }
.hot-rank.top { background: #FFF7ED; font-size: 0.95rem; }
.hot-main { flex: 1; min-width: 0; }
.hot-top { display: flex; justify-content: space-between; gap: 10px; }
.hot-top strong { font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-top span { flex-shrink: 0; color: var(--text-2); font-size: 0.78rem; font-weight: 600; }
.hot-bar { height: 6px; margin: 5px 0 3px; border-radius: 99px; background: #F3F4F6; overflow: hidden; }
.hot-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #A78BFA, var(--purple)); }
.hot-main small { color: var(--text-3); font-size: 0.74rem; }
.hot-quiet { margin: 8px 6px 0; color: var(--text-3); font-size: 0.78rem; }
.home-empty { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 12px; background: #FAFAFB; }
.home-empty-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--text-3); }
.home-empty-icon svg { width: 18px; height: 18px; }
.home-empty strong { display: block; font-size: 0.88rem; }
.home-empty span { display: block; color: var(--text-2); font-size: 0.82rem; margin: 2px 0 6px; }
.fm-steps { display: flex; align-items: stretch; gap: 6px; }
.fm-step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-radius: 12px; background: #FAFAFB; border: 1px solid #F1F2F6; }
.fm-step strong { font: 700 1.5rem var(--font-display); line-height: 1.1; }
.fm-step span:last-child { color: var(--text-2); font-size: 0.76rem; }
.fm-dot { width: 8px; height: 8px; border-radius: 50%; }
.fm-arrow { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); }
.fm-arrow svg { width: 14px; height: 14px; }
.fm-arrow small { font-size: 0.7rem; font-weight: 700; color: var(--text-2); }
.fm-note { margin: 10px 2px 0; color: var(--text-3); font-size: 0.78rem; }
@media (max-width: 1180px) { .home-grid-even { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .fm-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fm-arrow { display: none; }
  .todo-chips { flex-direction: column; }
  .todo-chip { border-radius: 12px; }
}

/* Plantillas propias: lista y editor con vista previa */
.tpl-own-group { padding: 16px; border: 1px dashed #C4B5FD; border-radius: 14px; background: #FCFBFF; }
.tpl-own-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tpl-own-top .btn svg { width: 14px; height: 14px; }
.tpl-own { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.tpl-own-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tpl-own-head strong { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; }
.tpl-own-head small { color: var(--text-2); font-size: 0.76rem; }
.tpl-own p { margin: 0; color: var(--text-2); font-size: 0.84rem; white-space: pre-line; }
.tpl-override { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #F5F3FF; }
.tpl-override label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.82rem; font-weight: 600; color: var(--purple); }
.tpl-override select, .tpl-override .custom-select { flex: 1; min-width: 180px; }

body.modal-open { overflow: hidden; }
.tpl-editor-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px); }
.tpl-editor { width: min(1100px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35); overflow: hidden; }
.tpl-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.tpl-editor-head h2 { margin: 0; font: 700 1.2rem var(--font-display); }
.tpl-editor-head p { margin: 2px 0 0; color: var(--text-2); font-size: 0.84rem; }
.tpl-editor-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.tpl-editor-form { overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 18px; }
.tpl-sec h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 0.95rem; }
.tpl-sec h3 small { color: var(--text-3); font-weight: 500; font-size: 0.76rem; }
.tpl-sec .field { margin-bottom: 10px; }
.tpl-sec input[type="text"], .tpl-sec textarea, .tpl-sec select { width: 100%; }
.tpl-sec textarea { min-height: 120px; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.tpl-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tpl-seg button { padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-2); font: 600 0.82rem var(--font-sans); cursor: pointer; }
.tpl-seg button.on { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }
.tpl-media { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-media .btn svg { width: 14px; height: 14px; }
.tpl-body-tools { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 4px; }
.tpl-vars-box { display: flex; flex-direction: column; gap: 6px; }
.tpl-vars-box > .help { margin: 4px 0 0; }
.tpl-var-row { display: flex; align-items: center; gap: 8px; }
.tpl-var-row code { flex-shrink: 0; padding: 4px 8px; border-radius: 6px; background: var(--purple-soft); color: var(--purple); font-weight: 700; font-size: 0.8rem; }
.tpl-var-row select, .tpl-var-row .custom-select, .tpl-var-row input { flex: 1; min-width: 0; }
.tpl-btn-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.tpl-btn-type { display: inline-flex; align-items: center; gap: 5px; width: 128px; flex-shrink: 0; padding-top: 8px; color: var(--text-2); font-size: 0.78rem; font-weight: 700; }
.tpl-btn-type svg { width: 14px; height: 14px; }
.tpl-btn-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tpl-btn-adders { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-btn-adders button:disabled { opacity: 0.4; cursor: not-allowed; }
.tpl-editor-preview { overflow-y: auto; padding: 18px; background: #F3F4F8; border-left: 1px solid var(--border); }
.tpl-pv-label { display: block; margin-bottom: 10px; color: var(--text-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tpl-phone { border-radius: 18px; overflow: hidden; border: 1px solid #D1D5DB; background: #EFEAE2; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12); }
.tpl-phone-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #075E54; color: #fff; font-size: 0.86rem; }
.tpl-phone-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.2); font-weight: 700; }
.tpl-phone-chat { padding: 16px 12px 22px; min-height: 260px; }
.tpl-bubble { position: relative; max-width: 92%; padding: 6px 8px 18px; border-radius: 0 10px 10px 10px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); font-size: 0.86rem; color: #111B21; }
.tpl-pv-media { display: block; width: 100%; height: 150px; object-fit: cover; margin-bottom: 6px; border-radius: 6px; }
.tpl-pv-media.empty { display: flex; align-items: center; justify-content: center; gap: 6px; background: #E5E7EB; color: #6B7280; font-size: 0.82rem; }
.tpl-pv-media.empty svg { width: 20px; height: 20px; }
.tpl-pv-doc { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 10px; border-radius: 6px; background: #F3F4F6; font-size: 0.8rem; }
.tpl-pv-doc svg { width: 18px; height: 18px; color: #DC2626; }
.tpl-pv-head { display: block; margin: 2px 2px 4px; }
.tpl-pv-body { margin: 0 2px; white-space: pre-line; line-height: 1.4; }
.tpl-pv-body mark, .tpl-pv-head mark { padding: 0 2px; border-radius: 3px; background: #EDE9FE; color: #5B21B6; }
.tpl-pv-foot { display: block; margin: 6px 2px 0; color: #8696A0; font-size: 0.74rem; }
.tpl-pv-time { position: absolute; right: 8px; bottom: 4px; color: #8696A0; font-size: 0.66rem; }
.tpl-pv-btns { max-width: 92%; display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.tpl-pv-btns span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border-radius: 8px; background: #fff; color: #00A5F4; font-size: 0.84rem; font-weight: 500; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); }
.tpl-pv-btns svg { width: 14px; height: 14px; }
.tpl-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); background: #FAFAFB; }
.tpl-editor-problem { flex: 1; margin: 0; color: #B45309; font-size: 0.84rem; }
.tpl-editor-problem.ok { color: #047857; }
@media (max-width: 860px) {
  .tpl-editor-overlay { padding: 0; }
  .tpl-editor { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .tpl-editor-body { display: block; overflow-y: auto; }
  .tpl-editor-form { overflow: visible; padding: 16px; }
  .tpl-editor-preview { border-left: 0; border-top: 1px solid var(--border); }
  .tpl-editor-foot { flex-direction: column; align-items: stretch; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .tpl-editor-foot .row-gap { justify-content: flex-end; }
  .tpl-btn-row { flex-direction: column; gap: 6px; }
  .tpl-btn-type { width: auto; padding-top: 0; }
  .tpl-own-top { flex-direction: column; }
}
.tpl-body-tools .link-btn { padding: 0; border: 0; background: none; color: var(--purple); font: 600 0.82rem var(--font-sans); cursor: pointer; }
body.modal-open #copilot { display: none; }

/* WhatsApp → Campañas */
.wa-body.campaigns { overflow-y: auto; display: block; padding-bottom: 24px; }
.camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.camp-head h2 { margin: 0; font: 700 1.15rem var(--font-display); }
.camp-head p { margin: 2px 0 0; color: var(--text-2); font-size: 0.86rem; }
.camp-head .btn svg { width: 15px; height: 15px; }
.camp-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; margin-bottom: 12px; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
.camp-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 18px rgba(123, 79, 255, 0.08); }
.camp-card-top { display: flex; gap: 10px; align-items: center; }
.camp-card-title { flex: 1; min-width: 0; }
.camp-card-link { display: block; color: var(--text); font-weight: 700; font-size: 1rem; text-decoration: none; overflow-wrap: anywhere; }
.camp-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.camp-card-link:focus-visible::after { outline: 2px solid var(--purple); outline-offset: 2px; }
.camp-card-title small { color: var(--text-2); font-size: 0.8rem; }
.camp-card-del { position: relative; z-index: 1; flex-shrink: 0; color: var(--text-3); }
.camp-card-del:hover { color: #DC2626; }
.camp-card-del svg { width: 16px; height: 16px; }
.camp-card-alerts { display: flex; flex-wrap: wrap; gap: 6px; }
.camp-metrics, .camp-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.camp-metric { display: flex; flex-direction: column; min-width: 0; }
.camp-metric b { font: 700 1.15rem var(--font-display); color: var(--text); line-height: 1.25; }
.camp-metric span { color: var(--text-2); font-size: 0.78rem; }
.camp-metric small { color: var(--text-3); font-size: 0.74rem; }
.camp-metric.ok b { color: #059669; }
.camp-metrics { padding-top: 12px; border-top: 1px solid var(--border); }
.camp-summary-strip { margin-bottom: 14px; padding: 14px 18px; border-radius: 14px; background: #FAFAFF; border: 1px solid #E9E5FF; }
.camp-summary-strip .camp-metric b { font-size: 1.4rem; }
.camp-del-btn { color: #DC2626; }
.camp-del-btn svg { width: 14px; height: 14px; }
.camp-progress { height: 6px; border-radius: 99px; background: #F3F4F6; overflow: hidden; }
.camp-progress i { display: block; height: 100%; background: var(--purple); border-radius: 99px; }
.camp-locked, .camp-empty { display: flex; gap: 16px; align-items: flex-start; }
.camp-locked h2 { margin: 0 0 6px; font-size: 1.05rem; }
.camp-locked p, .camp-empty p { margin: 4px 0 12px; color: var(--text-2); font-size: 0.88rem; }
.camp-locked-icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.camp-locked-icon svg { width: 22px; height: 22px; }
.camp-wizard { display: flex; flex-direction: column; overflow: hidden; }
.camp-wizard-head { padding: 16px 20px 0; }
.camp-wizard-head h2 { margin: 6px 0 12px; font: 700 1.15rem var(--font-display); }
.camp-steps { display: flex; gap: 6px; margin: 0; padding: 0 0 14px; list-style: none; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.camp-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--text-3); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.camp-steps li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #F3F4F6; font-size: 0.72rem; }
.camp-steps li.on { background: var(--purple-soft); color: var(--purple); }
.camp-steps li.on span { background: var(--purple); color: #fff; }
.camp-steps li.done { color: #059669; }
.camp-steps li.done span { background: #ECFDF3; }
.camp-wizard-body { padding: 18px 20px; }
.camp-step-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.camp-step-grid .field { margin-bottom: 14px; }
.camp-step-grid select, .camp-step-grid input[type="text"] { width: 100%; }
.camp-activity { display: flex; gap: 8px; }
.camp-activity > * { flex: 1; }
.camp-side { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.camp-audience { padding: 16px; border-radius: 14px; background: #FAFAFF; border: 1px solid #E9E5FF; display: flex; flex-direction: column; gap: 10px; }
.camp-count { font-size: 0.92rem; color: var(--text-2); }
.camp-count b { display: block; font: 700 2rem var(--font-display); color: var(--purple); line-height: 1.1; }
.camp-sample { margin: 0; color: var(--text-2); font-size: 0.82rem; }
.camp-excluded { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-size: 0.8rem; }
.camp-excluded ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.camp-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.camp-pick input[type="search"] { width: 100%; }
.camp-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-2); font-size: 0.82rem; }
.camp-pick-head span { flex-basis: 100%; }
.camp-pick-head button { margin: 0; padding: 0; border: 0; background: none; color: var(--purple); cursor: pointer; font-family: inherit; }
.camp-pick-head button:disabled { color: var(--text-3); cursor: default; }
.camp-pick-rows { max-height: max(220px, calc(100vh - 400px)); overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.camp-pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.camp-pick-row + .camp-pick-row { border-top: 1px solid var(--border); }
.camp-pick-row:hover { background: #FAFAFF; }
.camp-pick-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.camp-pick-name strong, .camp-pick-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-pick-name small { color: var(--text-2); font-size: 0.78rem; }
.camp-templates { display: flex; flex-direction: column; gap: 8px; }
.camp-template { text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: inherit; color: var(--text); cursor: pointer; }
.camp-template.on { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.12); }
.camp-template-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.camp-template p { margin: 6px 0 0; color: var(--text-2); font-size: 0.82rem; white-space: pre-line; }
.camp-send { max-width: 620px; }
.camp-send input[type="text"], .camp-send input[type="datetime-local"] { width: 100%; }
.camp-confirm { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.camp-summary { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.camp-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 0.88rem; }
.camp-sum-row + .camp-sum-row { border-top: 1px solid var(--border); }
.camp-sum-row span { color: var(--text-2); }
.camp-notes { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 0.84rem; display: flex; flex-direction: column; gap: 4px; }
.camp-consent { padding: 12px 14px; border-radius: 12px; background: #FFFBEB; border: 1px solid #FDE68A; font-size: 0.86rem; }
.camp-nav { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: #FAFAFB; }
.camp-nav .spacer { flex: 1; }
.camp-back { display: inline-block; margin-bottom: 10px; }
.camp-detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.camp-detail-head h2 { margin: 0; font: 700 1.15rem var(--font-display); }
.camp-detail-head p { margin: 2px 0 0; color: var(--text-2); font-size: 0.84rem; }
.camp-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.camp-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.camp-tile b { font: 700 1.35rem var(--font-display); }
.camp-tile span { color: var(--text-2); font-size: 0.78rem; }
.camp-tile small { color: var(--text-3); font-size: 0.72rem; }
.camp-tile.ok b { color: #059669; }
.camp-tile.warn b { color: #D97706; }
.camp-tile.danger b { color: #DC2626; }
.camp-recipients { padding: 6px 0; }
.camp-rec-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px; }
.camp-rec-head small { color: var(--text-3); }
.camp-rec { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid #F3F4F6; color: var(--text); text-decoration: none; font-size: 0.86rem; }
.camp-rec:hover { background: #FAFAFB; }
.camp-rec-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.camp-rec-status { color: var(--text-2); font-size: 0.8rem; }
.camp-rec-status.failed { color: #DC2626; }
.camp-rec-error { grid-column: 1 / -1; color: #B91C1C; font-size: 0.76rem; }
@media (max-width: 1100px) { .camp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .wa-body.campaigns { padding: 0 16px 24px; }
  .camp-step-grid { grid-template-columns: 1fr; }
  .camp-side { position: static; order: -1; }
  .camp-pick-rows { max-height: 320px; }
  .camp-pick-row { padding: 12px; }
}
@media (max-width: 640px) {
  .camp-head { flex-direction: column; }
  .camp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camp-wizard-body { padding: 14px 16px; }
  .camp-nav { padding: 12px 16px; }
  .camp-rec { grid-template-columns: minmax(0, 1fr) auto; }
  .camp-metrics, .camp-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camp-card-top { flex-wrap: wrap; }
  .camp-card-title { flex-basis: calc(100% - 44px); order: -2; }
  .camp-card-del { order: -1; }
}
@media (max-width: 640px) {
  /* WhatsApp: con Chats, Embudo y Campañas, las pestañas van debajo del título y ocupan el ancho */
  #view-whatsapp .topbar { flex-wrap: wrap; gap: 8px; }
  #view-whatsapp .topbar > div:first-child { flex-basis: 100%; }
  #view-whatsapp .topbar-actions { width: 100%; }
  #view-whatsapp .wa-tabs { width: 100%; }
  #view-whatsapp .wa-tab { flex: 1; justify-content: center; padding-left: 8px; padding-right: 8px; }
}

/* Archivos en los formularios: zona para elegir o arrastrar */
.file-drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #FAFAFB; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.file-drop:hover, .file-drop.over { border-color: var(--purple); background: var(--purple-soft); }
.file-drop.has-file { border-style: solid; border-color: #C4B5FD; background: #fff; }
.file-drop-icon { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--purple); font-weight: 800; font-size: 1.1rem; }
.file-drop-icon.pdf { background: #FEF2F2; border-color: #FECACA; color: #DC2626; font-size: 0.68rem; letter-spacing: 0.04em; }
.file-drop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-drop-text strong { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop-text small { color: var(--text-2); font-size: 0.76rem; }
.file-drop-remove { width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: 50%; background: #F3F4F6; color: var(--text-2); font-size: 1.05rem; cursor: pointer; }
.file-drop-remove:hover { background: #FEF2F2; color: var(--danger); }

/* Campañas: programar con atajos, calendario del panel y hora */
.camp-schedule { display: flex; flex-direction: column; gap: 10px; }
.camp-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.camp-datetime { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px; }
.camp-datetime input, .camp-datetime select, .camp-datetime .custom-select { width: 100%; }
.camp-when { margin: 0; padding: 10px 12px; border-radius: 10px; background: #ECFDF3; color: #047857; font-size: 0.86rem; font-weight: 600; }
.camp-when::first-letter { text-transform: uppercase; }
.camp-when.warn { background: #F9FAFB; color: var(--text-2); font-weight: 500; }
.camp-quick .chip { display: inline-flex; align-items: center; gap: 5px; }
.camp-quick .chip svg { width: 13px; height: 13px; }

/* ───────────── Configurá tu cuenta con ayuda de Andy ───────────── */
.setup-entry { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; text-decoration: none; color: inherit; }
.setup-entry img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.setup-entry > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.setup-entry small { color: var(--text-2); }
.setup-with-andy { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 12px; font-size: 0.85rem; font-weight: 600; color: var(--purple); }
.setup-with-andy svg { width: 16px; height: 16px; }

.schat { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; height: calc(100dvh - 76px); max-width: 1180px; margin: 0 auto; }
.schat-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.schat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.schat-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.schat-head h2 { margin: 0; font-size: 1.05rem; }
.schat-head p { margin: 0; font-size: 0.8rem; color: var(--text-2); }
.schat-reset { margin-left: auto; }
.schat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: #FAFAFC; }
.schat-msg { max-width: min(680px, 88%); font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; padding: 11px 15px; border-radius: 16px; }
.schat-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.schat-msg.user { align-self: flex-end; background: var(--purple); color: #fff; border-bottom-right-radius: 5px; }
.schat-bot { align-self: flex-start; display: flex; align-items: flex-end; gap: 8px; max-width: min(720px, 92%); animation: schat-in 0.2s ease; }
.schat-bot > img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.schat-bot .schat-msg { max-width: none; }
.schat-dots { display: flex; align-items: center; gap: 5px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; border-bottom-left-radius: 5px; }
.schat-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: schat-dot 1.4s infinite ease-in-out both; }
.schat-dots i:nth-child(1) { animation-delay: -0.32s; }
.schat-dots i:nth-child(2) { animation-delay: -0.16s; }
.schat-dots small { margin-left: 6px; color: var(--text-2); }
@keyframes schat-dot { 0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes schat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.schat-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.schat-file { display: inline-flex; align-items: center; gap: 5px; max-width: 240px; padding: 4px 9px; border-radius: 99px; background: var(--purple-soft); color: var(--text); font-size: 0.78rem; }
.schat-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schat-file svg { width: 14px; height: 14px; flex-shrink: 0; }
.schat-file button { display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.schat-saved { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.schat-saved a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-size: 0.8rem; font-weight: 600; text-decoration: none; }
.schat-saved svg { width: 14px; height: 14px; }
.schat-card { align-self: flex-start; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: min(560px, 100%); padding: 14px 16px; background: var(--surface); border: 1px solid #DDD6FE; border-radius: 14px; }
.schat-card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--purple-soft); color: var(--purple); flex-shrink: 0; }
.schat-card-icon svg { width: 20px; height: 20px; }
.schat-card-text { flex: 1; min-width: 180px; }
.schat-card-text strong { display: block; font-size: 0.92rem; }
.schat-card-text small { color: var(--text-2); }
.schat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; background: #FAFAFC; }
.schat-input { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.schat-input.drag { background: var(--purple-soft); }
.schat-row { display: flex; align-items: flex-end; gap: 8px; }
.schat-row textarea { flex: 1; min-height: 46px; max-height: 180px; resize: none; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 12px; font: inherit; }
.schat-attach { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; }
.schat-attach svg { width: 19px; height: 19px; }
.schat-hint { margin: 6px 2px 0; font-size: 0.74rem; color: var(--text-2); }
.schat-side { padding: 16px; overflow-y: auto; }
.schat-side h3 { margin: 0 0 4px; font-size: 0.95rem; }
.schat-side > p { margin: 0 0 12px; font-size: 0.8rem; color: var(--text-2); }
.schat-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.schat-steps a { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.86rem; }
.schat-steps a:hover { background: #F5F3FF; }
.schat-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; }
.schat-steps .done .schat-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.schat-dot svg { width: 12px; height: 12px; }
.schat-steps .done a { color: var(--text-2); }

@media (max-width: 900px) {
  .schat { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 140px); }
  .schat-side { display: none; }
  .schat-head { padding: 10px 12px; }
  .schat-head img { width: 36px; height: 36px; }
  .schat-head h2 { font-size: 0.92rem; }
  .schat-head p, .schat-hint { display: none; }
  .schat-reset { white-space: nowrap; padding-inline: 6px; }
  .schat-list { padding: 14px; }
  .schat-msg { max-width: 94%; }
}

/* Campañas: empezar con Andy o con una predeterminada */
.camp-ask h2 { margin: 0 0 4px; }
.camp-ask textarea { width: 100%; margin: 12px 0; padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; font: inherit; resize: vertical; }
.camp-section-title { margin: 22px 0 10px; font-size: 0.98rem; }
.camp-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.camp-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.camp-preset:hover { border-color: var(--purple); }
.camp-preset small { color: var(--text-2); line-height: 1.35; }
.camp-manual { margin-top: 16px; font-size: 0.86rem; color: var(--text-2); }
.camp-manual a { color: var(--purple); font-weight: 600; }
.camp-link-btn { padding: 0; border: 0; background: none; cursor: pointer; }
.camp-proposal { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.camp-proposal textarea { width: 100%; padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; font: inherit; }
.camp-who { margin: 4px 0 14px; padding: 12px 14px; background: #F5F3FF; border-radius: 12px; }
.camp-who p { margin: 4px 0; font-size: 0.88rem; }
.camp-who small { display: block; color: var(--text-2); }
.camp-bubble { margin-top: 8px; padding: 11px 14px; border-radius: 12px; background: #DCF8C6; color: #111827; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; line-height: 1.45; }
@media (max-width: 800px) {
  .camp-proposal { grid-template-columns: minmax(0, 1fr); }
}

/* ───────────── En el celular se comporta como una app ───────────── */
/* iOS acerca la pantalla al escribir en un campo de menos de 16 px */
@media (pointer: coarse) {
  html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  input, textarea, select { font-size: 16px !important; }
}

/* Página de pago dentro del panel */
.pay-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: stretch; text-align: left; margin: 4px 0 6px; }
.pay-summary, .pay-form { display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; border-radius: 18px; }
.pay-summary { align-items: flex-start; background: linear-gradient(180deg, rgba(123, 79, 255, 0.16), rgba(123, 79, 255, 0.05)); border: 1px solid rgba(123, 79, 255, 0.45); box-shadow: 0 12px 32px rgba(123, 79, 255, 0.15); }
.pay-form { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); }
.pay-summary h3, .pay-form h3 { margin: 0; font: 700 1.2rem var(--font-display); color: #F3F4F6; }
.pay-summary-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pay-summary-head .plan-trial { position: static; margin: 0; }
.pay-summary dl { width: 100%; margin: 6px 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 8px 14px; font-size: 0.86rem; }
.pay-summary dt { color: #9CA3AF; }
.pay-summary dd { margin: 0; color: #F3F4F6; font-weight: 600; text-align: right; }
.pay-element { min-height: 180px; }
.pay-field { display: flex; flex-direction: column; gap: 6px; color: #D1D5DB; font-size: 0.85rem; }
.pay-form input.pay-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px; background: #1B1833; color: #F3F4F6; font: 400 0.94rem var(--font-sans); }
.pay-form input.pay-input:focus { outline: none; border-color: #7B4FFF; box-shadow: 0 0 0 3px rgba(123, 79, 255, 0.25); }
.pay-form input.pay-input[readonly] { color: #9CA3AF; }
.pay-form input.pay-input::placeholder { color: #6B7280; }
.pay-promo-box { text-align: center; }
.pay-promo-row { display: flex; gap: 8px; }
.pay-apply { width: auto; flex-shrink: 0; padding: 0 16px; }
.pay-loading { margin: 0; padding: 60px 8px; color: #9CA3AF; font-size: 0.9rem; text-align: center; }
.pay-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, 0.12); color: #FCA5A5; font-size: 0.86rem; }
.pay-secure { margin: 0; color: #9CA3AF; font-size: 0.75rem; text-align: center; }
@media (max-width: 720px) { .pay-page { grid-template-columns: minmax(0, 1fr); } .pay-summary, .pay-form { padding: 18px 16px; } }

/* Configuración A TEAM o personalizada, varita y setup mínimo */
.config-mode { margin: 0 0 14px; }
.mode-hidden { display: none !important; }
.mode-summary dl { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 10px 16px; margin: 0 0 12px; font-size: 0.9rem; }
.mode-summary dt { color: var(--text-2); font-weight: 600; }
.mode-summary dd { margin: 0; }
@media (max-width: 560px) { .mode-summary dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .mode-summary dd { margin-bottom: 10px; } }
.magic-btn { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; margin-left: auto; border: 1px solid #E4DCFF; border-radius: 10px; background: var(--purple-soft); color: var(--purple); cursor: pointer; }
.magic-btn svg { width: 19px; height: 19px; }
.magic-btn:hover:not(:disabled) { background: var(--purple); color: #fff; }
.magic-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.magic-btn.busy { opacity: 1; animation: magic-pulse 1s ease-in-out infinite; }
@keyframes magic-pulse { 50% { transform: scale(0.92); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .magic-btn.busy { animation: none; } }
.suggest-proposal { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: 10px 14px; margin: 0; max-height: 55vh; overflow: auto; font-size: 0.88rem; }
.suggest-proposal dt { color: var(--text-2); font-weight: 600; }
.suggest-proposal dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .suggest-proposal { grid-template-columns: minmax(0, 1fr); gap: 2px; } .suggest-proposal dd { margin-bottom: 10px; } }
.improve-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.improve-list a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #E4DCFF; border-radius: 14px; background: #fff; color: var(--text); text-decoration: none; }
.improve-list a:hover { border-color: var(--purple); }
.improve-list a > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); }
.improve-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.improve-text small { color: var(--text-2); font-size: 0.82rem; line-height: 1.35; }
.schat-side-more { margin-top: 18px !important; }

/* Inicio mientras se configura: solo la tarjeta de configuración */
.home-configuring .kpis, .home-configuring .todo-strip, .home-configuring .home-grid, .home-configuring .home-ask { display: none !important; }
/* Sin WhatsApp no se puede encender */
.sb-andy.locked { opacity: 0.55; }
.sb-andy.locked .switch { cursor: not-allowed; }
.copilot-setup-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--purple); font-size: 0.82rem; font-weight: 700; }
.copilot-setup-head svg { width: 15px; height: 15px; }
#copilotMessages .schat-saved, #copilotMessages .schat-card { margin-left: 44px; }

/* Planes */
.plan-option.featured { border: 2px solid #A78BFA; box-shadow: 0 12px 36px rgba(123, 79, 255, 0.28); }
/* Tres planes en fila: la tarjeta del alta se ensancha */
.login-card.plans { max-width: 1080px; }
.login-card.plans .plan-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.login-card.plans .plan-option { max-width: none; }
.plan-option-includes { margin: 4px 0 0; color: #F3F4F6; font-size: 0.82rem; font-weight: 700; }
@media (max-width: 860px) { .login-card.plans .plan-options { grid-template-columns: minmax(0, 1fr); } }
.pay-features { width: 100%; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.08); list-style: none; color: #D1D5DB; font-size: 0.84rem; line-height: 1.45; }
.pay-features li { position: relative; padding: 3px 0 3px 24px; }
.pay-features li::before { content: ""; position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: #7B4FFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat; }
.plan-option ul li { font-size: 0.86rem; }
.plan-lock { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plan-lock-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.plan-lock-icon svg { width: 20px; height: 20px; }
.plan-lock-text { flex: 1; min-width: 220px; }
.plan-lock-text p { margin: 4px 0 0; }
.plan-locked > :not(.section-head):not(.plan-lock):not(.config-mode):not(.mode-summary) { display: none !important; }
.plan-switch { margin: 14px 0; }
.plan-canceling { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); }
.plan-canceling p { margin: 0; flex: 1; font-size: .9rem; }
.plan-cancel { margin-left: auto; }
@media (max-width: 560px) { .plan-canceling { flex-direction: column; align-items: stretch; } .plan-cancel { margin-left: 0; } }
.plan-switch-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.plan-switch-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.plan-switch-option small { color: var(--text-2); }
.plan-switch-option.active { border-color: var(--purple); background: var(--purple-soft); cursor: default; opacity: 1; color: var(--text); }
.plan-switch-option.active small { color: var(--purple); font-weight: 600; }
.plan-switch-option:not(.active):hover { border-color: var(--purple); }
@media (max-width: 560px) { .plan-switch-options { grid-template-columns: minmax(0, 1fr); } }


/* Comisiones de la inmobiliaria */
.commission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { flex: 1; min-width: 0; }
.input-suffix > span { color: var(--text-2); font-weight: 600; }
@media (max-width: 760px) { .commission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Agregar propiedad: cómo cargarla */
.add-options { display: grid; gap: 10px; margin: 6px 0 4px; }
.add-option { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.add-option:hover { border-color: var(--purple); background: var(--purple-soft); }
.add-option-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.add-option-icon svg { width: 20px; height: 20px; }
.add-option-text { display: flex; flex-direction: column; gap: 2px; }
.add-option-text small { color: var(--text-2); font-size: 0.84rem; line-height: 1.4; }
.add-option:disabled { cursor: default; opacity: 0.6; background: var(--surface-2); }
.add-option:disabled:hover { border-color: var(--border); }
.add-option.small { padding: 10px 16px; }
.add-option.small .add-option-icon { width: 34px; height: 34px; }

/* Propiedad sincronizada con MercadoLibre */
.pill.ml { background: #FFF6CC; color: #6B5600; }
.ml-notice { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #FFFBE6; border: 1px solid #F5E08A; }
.ml-notice-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; color: var(--text-2); }
.ml-notice-text strong { color: var(--text); }
.ml-notice-actions { display: flex; gap: 6px; }
.ml-rules { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.ml-notice-text .notice { margin: 6px 0 0; }

/* AI de A TEAM incluida: uso del mes */
.ai-usage-label { margin: 14px 0 6px; color: var(--text-2); font-size: 0.88rem; }
.ai-usage-label strong { color: var(--text); font-size: 1.05rem; }
.camp-progress.ai-usage { height: 8px; margin-bottom: 12px; }
.camp-progress.ai-usage.warn i { background: #D97706; }
.camp-progress.ai-usage.grace i, .camp-progress.ai-usage.paused i, .camp-progress.ai-usage.daily i { background: #DC2626; }

/* Tu inmobiliaria: en qué te ayuda Andy (cards) y el texto único */
.op-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 8px; }
.op-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 14px 40px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.op-card input { position: absolute; opacity: 0; pointer-events: none; }
.op-card::before { content: ""; position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface); }
.op-card.on, .op-card:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.op-card.on::before, .op-card:has(input:checked)::before { background: var(--purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--purple); }
.op-card:focus-within { outline: 2px solid var(--purple); outline-offset: 2px; }
.op-card strong { font-size: 0.95rem; }
.op-card small { color: var(--text-2); font-size: 0.8rem; line-height: 1.4; }
.business-text { min-height: 380px; line-height: 1.55; }
.config-panel.panel-follow { margin-top: 18px; }

/* Reclamos en columnas por estado */
.cases-board .case-card { flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: grab; }
.cases-board .case-card:first-child { border-top: 1px solid var(--border); }
.cases-board .case-card.dragging { opacity: 0.5; }
.cases-board .case-actions { width: 100%; justify-content: space-between; }
.cases-board .case-actions select { flex: 1; min-width: 0; }
.cases-board .col-cards { display: flex; flex-direction: column; gap: 10px; }

/* Embudo: filtro por tipo de interesado */
.funnel-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.funnel-types .chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.funnel-types .chip-count { font-size: 0.75rem; opacity: 0.75; }
/* Calificación: una pestaña por tipo de interesado */
.qual-types { margin: 4px 0 12px; }
.qual-many { color: var(--warn); }

/* Inicio: Andy puede responder mejor */
.insights-card { display: flex; flex-direction: column; gap: 12px; }
.insights-card .card-title { display: flex; align-items: center; gap: 6px; }
.insight-item { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.insight-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.insight-count { color: var(--text-2); font-size: 0.82rem; }
.insight-item textarea { width: 100%; resize: vertical; }
.insight-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.insight-buttons { display: flex; align-items: center; gap: 8px; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #FDE68A; }

/* Servicios / bills de una habitación o alquiler: tipo, cómo se paga y monto */
.bills-grid { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) minmax(90px, .8fr); gap: 8px 12px; align-items: center; margin-bottom: 12px; font-size: .9rem; }
.bills-grid select, .bills-grid input { width: 100%; }
@media (max-width: 640px) { .bills-grid { grid-template-columns: 1fr 1fr; } .bills-grid .bill-fee { grid-column: span 2; } }

/* Card con tipos adentro (Alquiler: largo plazo, temporario, habitaciones) */
.op-card.op-group { cursor: default; }
.op-subs { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.op-sub { display: flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.op-card .op-sub input { position: static; opacity: 1; pointer-events: auto; width: 16px; height: 16px; accent-color: var(--purple); }

.plan-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 11px; font-weight: 600; vertical-align: middle; }

/* ───────────── Plan Gratis: banner, lo usado y selectores con tope ───────────── */
#planBanner { margin-bottom: 16px; }
.plan-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--purple-soft); color: var(--text); font-size: 0.86rem; border: 1px solid #DDD6FE; }
.plan-banner.warn { background: var(--warn-soft); border-color: #FDE68A; }
.plan-banner > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--purple); }
.plan-banner.warn > svg { color: var(--warn); }
.plan-banner > span { flex: 1 1 280px; min-width: 0; }
.plan-usage { margin-bottom: 16px; }
.plan-usage .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.usage-row { margin-top: 12px; }
.usage-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.86rem; }
.usage-bar { height: 8px; margin-top: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gradient); }
.usage-row.warn .usage-bar span { background: var(--warn); }
.usage-row.full .usage-bar span { background: var(--danger); }
.usage-row.full .usage-head strong { color: var(--danger); }
.usage-row small { display: block; margin-top: 4px; }
.pick-counter { margin: 0 0 8px; font-size: 0.84rem; color: var(--text-2); }
.pick-counter.full { color: var(--warn); font-weight: 600; }
.pick-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick-row { align-items: center; }
.pick-row input:disabled + .pick-thumb, .pick-row input:disabled ~ span { opacity: 0.45; }
.pick-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--bg); }
.plan-free-note { margin: 18px auto 0; max-width: 560px; text-align: center; font-size: 0.88rem; color: var(--text-2); }
.plan-free-note .btn { margin-top: 10px; }
.pill.plan-paused { cursor: pointer; border: none; font: inherit; }
@media (max-width: 640px) {
  .plan-banner .btn { flex: 1 1 auto; }
}

/* WhatsApp: conexión a mano (ID del número y token), plegada debajo de Facebook */
.wa-manual { margin-top: 18px; }
.wa-manual summary { cursor: pointer; font-weight: 600; color: var(--purple); margin-bottom: 10px; }

/* Inicio → "Andy puede responder mejor": la foto de Andy en el título, a su tamaño */
.insights-card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insights-card .card-title { display: flex; align-items: center; gap: 8px; }
.insights-card .insights-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.insight-said { margin: 2px 0 0; padding: 8px 10px; border-left: 3px solid var(--border); background: var(--surface-2); border-radius: 6px; font-size: 0.86rem; }

/* Cards clickeables: toda la card abre la ficha; abajo, acciones como chips con ícono */
.clickable-card { cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s; }
.clickable-card:hover { border-color: var(--purple); box-shadow: 0 6px 18px rgba(123, 79, 255, 0.12); }
.clickable-card:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.card-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface, #fff); color: var(--text-2); font: inherit; font-size: 0.78rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.card-chip svg { width: 14px; height: 14px; }
.card-chip:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-soft); }
.card-chip.primary { border-color: var(--purple); color: var(--purple); }
.card-chip.danger:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }
.card-open { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--purple); font-size: 0.8rem; font-weight: 700; }
.card-open svg { width: 14px; height: 14px; transition: transform 0.15s; }
.clickable-card:hover .card-open svg { transform: translateX(3px); }

/* Plantillas: el mismo espacio entre el texto, las variables y los botones en todas (obligatorias y opcionales) */
.tpl-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tpl-body .tpl-text { box-sizing: border-box; }
.tpl-body > .row-gap { margin-top: 6px; }
.tpl-optional[open] > .tpl-body { margin: 0 16px; }

/* La barra de "Guardar cambios" deja libre el lugar del botón de la AI (abajo a la derecha) */
.save-bar { width: calc(100vw - var(--sidebar-w) - 56px - 84px); }
@media (max-width: 900px) { .save-bar { width: calc(100vw - 32px - 76px); } }

/* Email de la cuenta: Configuración → Email */
#mailCard .cal-head { margin-bottom: 16px; }
.mail-provider { margin: -4px 0 12px; }
.mail-advanced { margin: 4px 0 12px; }
.mail-advanced summary { cursor: pointer; font-size: 0.86rem; color: var(--text-2); margin-bottom: 8px; }
.mail-steps { margin: 4px 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: 0.88rem; line-height: 1.45; }
.mail-guide .btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.mail-pass-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mail-pass-label .link-btn, .mail-provider .link-btn { color: var(--purple); font-size: 0.82rem; font-weight: 500; text-decoration: underline; }
/* Cómo se presenta por email */
.mail-personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mail-persona { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.mail-persona small { color: var(--text-2); font-size: 0.78rem; }
.mail-persona.on { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
@media (max-width: 640px) { .mail-personas { grid-template-columns: 1fr; } }

/* Email en los chats */
.chat-item-channel svg, .wa-msg-channel svg { width: 12px; height: 12px; vertical-align: -2px; }
.chat-item-channel { color: var(--text-2); margin-right: 4px; }
.wa-msg-channel { color: var(--text-2); margin-right: 4px; display: inline-flex; }
.wa-msg-auto { color: var(--text-2); margin-right: 6px; font-style: italic; }
.wa-channel-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 0.8rem; }
.wa-channel-switch .chip svg { width: 13px; height: 13px; vertical-align: -2px; }
.wa-compose-subject { width: 100%; margin-bottom: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface, #fff); }

/* ───────────── Configuración → Instagram ───────────── */
#igCard .cal-head { margin-bottom: 16px; }
.ig-steps { margin: 4px 0 16px; padding-left: 20px; color: var(--text-2); line-height: 1.55; font-size: 0.88rem; }
.ig-steps li + li { margin-top: 6px; }
.ig-account { align-items: center; }
.ig-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.ig-avatar svg { width: 22px; height: 22px; }
.ig-who { display: flex; flex-direction: column; min-width: 0; }
.ig-who small { color: var(--text-2); }
.ig-settings { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.ig-sub { margin: 18px 0 4px; font-size: 0.92rem; }
.ig-modes { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ig-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.ig-mode:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.ig-mode.disabled { opacity: 0.6; cursor: not-allowed; }
.ig-mode input { margin-top: 3px; flex-shrink: 0; }
.ig-mode span { display: flex; flex-direction: column; gap: 2px; }
.ig-mode small { color: var(--text-2); font-size: 0.8rem; line-height: 1.45; }
.ig-mode small.ig-mode-warn { color: var(--warn); margin-top: 4px; }
#igCard .notice.warn .btn { margin-left: 4px; }
/* Respuestas a comentarios de Instagram */
.ig-rules { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.ig-rules-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ig-rules-head .ig-sub { margin-top: 0; }
.ig-rule-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ig-rule { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.ig-rule.paused { opacity: 0.6; }
.ig-rule-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.ig-rule-thumb.any { background: var(--purple-soft); color: var(--purple); }
.ig-rule-thumb svg { width: 22px; height: 22px; }
.ig-rule-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ig-rule-where { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ig-rule-where:hover { text-decoration: underline; }
.ig-rule-keys { display: flex; flex-wrap: wrap; gap: 4px; }
.ig-rule-keys .badge.product { background: var(--purple-soft); color: var(--purple); }
.ig-rule-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ig-rule-actions .btn svg { width: 16px; height: 16px; }
.ig-rules-empty { margin-top: 10px; }
@media (max-width: 760px) {
  .ig-rules-head { flex-direction: column; }
  .ig-rule { flex-wrap: wrap; }
  .ig-rule-actions { width: 100%; justify-content: flex-end; }
}

/* Secciones por canal: WhatsApp | Email | Instagram arriba de la lista de chats y en el embudo */
.chat-channels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chat-channels .chip { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.chat-channels .chip svg, .funnel-types .chip svg { width: 13px; height: 13px; }

/* Inicio: la tarjeta de Instagram */
.home-ig { margin-bottom: 18px; }
.home-ig-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-ig .status-icon { background: #FCE7F3; color: #E1306C; }
@media (max-width: 900px) { .home-ig-rows { grid-template-columns: 1fr; } }

/* ───────────── Planes (Gratis, Pro y Equipos) y funciones con candado: web/upgrade.js ───────────── */
.pick-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0; }
.pick-plans.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: left; }
.pick-plan.featured { border: 2px solid var(--purple); box-shadow: 0 10px 28px rgba(123, 79, 255, 0.16); }
.pick-plan.current { background: var(--purple-soft); }
.pick-plan-trial { align-self: flex-start; padding: 3px 10px; border-radius: 99px; background: #34D399; color: #052E1C; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.pick-plan-headline { margin: 0; font: 800 1.3rem/1.2 var(--font-display); color: var(--text); }
.pick-plan-name { margin: 0; color: var(--purple); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.pick-plan-price { font: 800 1.6rem var(--font-display); color: var(--text); }
.pick-plan-price small { font: 500 0.82rem var(--font-sans); color: var(--text-2); }
.pick-plan-includes { flex: 1; margin: 4px 0 8px; padding: 0; list-style: none; color: var(--text-2); font-size: 0.84rem; line-height: 1.45; }
.pick-plan-includes li { position: relative; padding: 3px 0 3px 22px; }
.pick-plan-includes li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #7B4FFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat; }
@media (max-width: 760px) { .pick-plans, .pick-plans.count-2 { grid-template-columns: minmax(0, 1fr); } }
/* Mensual / Anual y el ahorro del anual */
.billing-toggle { display: flex; width: fit-content; max-width: 100%; margin: 10px auto 0; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); }
.billing-option { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border: 0; border-radius: 99px; background: transparent; color: var(--text-2); font: 600 0.88rem var(--font-sans); cursor: pointer; }
.billing-option.active { background: var(--purple); color: #fff; }
.billing-hint { padding: 2px 8px; border-radius: 99px; background: rgba(52, 211, 153, 0.18); color: #059669; font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.billing-option.active .billing-hint { background: rgba(255, 255, 255, 0.2); color: #fff; }
.pick-plan-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-plan-save { align-self: flex-start; padding: 3px 10px; border-radius: 99px; background: var(--purple); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.pick-plan-equiv { margin: -4px 0 0; color: var(--text-2); font-size: 0.82rem; font-weight: 600; }
/* En la pantalla de entrada (fondo oscuro) */
.login-card .pick-plan { background: linear-gradient(180deg, rgba(123, 79, 255, 0.16), rgba(123, 79, 255, 0.05)); border-color: rgba(123, 79, 255, 0.45); }
.login-card .pick-plan.featured { border: 2px solid #A78BFA; }
.login-card .pick-plan.current { background: rgba(255, 255, 255, 0.06); }
.login-card .pick-plan-headline, .login-card .pick-plan-price { color: #fff; }
.login-card .pick-plan-name { color: #A78BFA; }
.login-card .pick-plan-includes { color: #D1D5DB; }
.login-card .pick-plan-price small { color: #9CA3AF; }
.login-card .billing-toggle { border-color: rgba(123, 79, 255, 0.45); background: rgba(255, 255, 255, 0.04); }
.login-card .billing-option { color: #D1D5DB; }
.login-card .billing-option.active { background: #7B4FFF; color: #fff; }
.login-card .billing-hint { color: #6EE7B7; }
.login-card .pick-plan-equiv { color: #D1D5DB; }
.login-card.plans .pick-plans { margin: 4px 0 6px; }

/* Aviso de mejora */
.upgrade-dialog { max-width: 760px; }
.upgrade-head { display: flex; align-items: center; gap: 14px; }
.upgrade-lock { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--purple-soft); color: var(--purple); }
.upgrade-lock svg { width: 20px; height: 20px; }
.upgrade-plan { margin: 2px 0 0; color: var(--text-2); font-size: 0.88rem; }

/* Algo con candado: en gris, con el ícono; al tocarlo abre el aviso de mejora */
.feature-locked { position: relative; opacity: 0.6; filter: grayscale(0.4); cursor: pointer; }
.feature-locked:hover { opacity: 0.8; }
.lock-badge { display: inline-grid; place-items: center; margin-left: 6px; vertical-align: middle; color: var(--purple); }
.lock-badge svg, .lock-inline svg { width: 13px; height: 13px; }
.lock-inline { display: inline-grid; place-items: center; margin-left: auto; color: var(--text-3); }
.add-option.feature-locked .add-option-icon { color: var(--text-3); }
.pill.plan-paused svg { width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; }
/* Una sección con candado: arriba el aviso; lo de siempre queda a la vista, en gris y sin poder tocarlo */
.feature-locked-section > :not(.plan-lock):not(.section-head) { opacity: 0.5; filter: grayscale(0.5); pointer-events: none; user-select: none; }
.plan-lock { margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--purple); border-radius: var(--radius); background: var(--purple-soft); }
.plan-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-notice > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--purple); }
.plan-notice > span { flex: 1; min-width: 200px; }

/* Primeros pasos: la web para WhatsApp, el festejo de "Andy ya está atendiendo" y Tu web dentro de Tu negocio */
.setup-web-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; font-size: 0.85rem; color: var(--text-2); }
.setup-web-hint b { color: inherit; word-break: break-all; }
.setup-web-hint svg { width: 16px; height: 16px; flex-shrink: 0; }
.website-hint p { margin: 4px 0 6px; }
.website-hint .app-dialog-link { display: flex; gap: 8px; align-items: center; }
.website-hint .app-dialog-input { margin: 0; }
.setup-celebrate { border-color: #A7F3D0; background: #ECFDF5; }
.setup-celebrate .setup-next-icon { background: #D1FAE5; color: #047857; }
.section-subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 12px; }
.section-subhead .config-subtitle { margin: 0; }
.section-subhead .help { flex: 1 1 240px; margin: 0; }
.business-setup .option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .business-setup .option-cards { grid-template-columns: 1fr; } }

/* ───────────── Equipo (Configuración → Equipo) y lo que cada rol no ve ───────────── */
body:not(.can-admin) .admin-only { display: none !important; }
body:not(.can-operator) .operator-only { display: none !important; }
/* Lector: solo mira (sin escribir en los chats ni pedirle cosas al asistente) */
body[data-role="viewer"] .wa-compose, body[data-role="viewer"] #copilot { display: none !important; }
.team-panel { display: grid; gap: 16px; }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.team-head .card-title { margin: 0; }
.team-list { display: grid; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border, #E2E8F0); flex-wrap: wrap; }
.team-row:first-child { border-top: 0; }
.team-who { display: grid; gap: 2px; min-width: 0; }
.team-who strong, .team-who small { overflow-wrap: anywhere; }
.team-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-actions select { min-width: 120px; }
.team-invite { display: grid; gap: 6px; margin-top: 8px; }
.team-invite-row { display: flex; gap: 8px; flex-wrap: wrap; }
.team-invite-row input[type="email"] { flex: 1 1 220px; min-width: 0; }
.team-roles { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: 13px; }
.team-roles dt { font-weight: 600; }
.team-roles dd { margin: 0; color: var(--muted, #64748B); }
.btn.danger { color: #B91C1C; }
