/* ═══════════════════════════════════════════════════════════
   LILA Bot Panel — estilo WeSpeak-like con paleta Lila
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-alt: #FAF8F3;
  --border: #E8E4D9;
  --border-strong: #D6D0C0;

  --primary: #1A3C2E;       /* verde Lila */
  --primary-hover: #234C3C;
  --primary-soft: #E8F0EB;

  --accent: #C9A040;        /* dorado Lila */
  --accent-hover: #B08A2E;

  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-soft: #9A9A9A;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 16px rgba(26,60,46,.08);
  --shadow-lg: 0 8px 32px rgba(26,60,46,.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --sidebar-width: 260px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font: inherit; color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.875rem; }

/* ─── Login gate ─────────────────────────────────────── */
.login-gate {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #0F2A1F 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.login-card h1 {
  font-size: 1.25rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
}
.login-card form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-card input {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: all .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.error {
  color: var(--danger);
  background: #FEF2F2;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-size: 0.875rem;
}

/* ─── App layout ──────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 42px; height: 42px;
  background: var(--primary);
  color: var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}
.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}
.nav-section {
  padding: 1rem 0.75rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  margin-bottom: 2px;
  transition: all .12s;
  font-size: 0.9rem;
}
.nav-item:hover {
  background: var(--primary-soft);
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
}
.nav-item.active .nav-icon {
  filter: none;
}
.nav-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-weight: 600;
}
.nav-item.active .badge {
  background: var(--accent);
  color: var(--primary);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,.2);
}
.status-dot.disconnected { background: var(--text-soft); box-shadow: none; }
.status-dot.error { background: var(--danger); }

/* ─── Content area ────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.section {
  display: none;
  padding: 2rem 2.5rem;
  max-width: 1400px;
  animation: fadeIn .2s ease-out;
}
.section.active { display: block; }
.section-header {
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inbox uses full height */
#section-inbox { padding: 0; max-width: none; height: 100vh; }

/* ─── Buttons ─────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all .15s;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all .15s;
}
.btn-secondary:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  background: #FEF2F2;
  color: var(--danger);
  border: 1px solid #FECACA;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-icon {
  background: transparent;
  border: none;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--primary-soft); color: var(--primary); }

.actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ─── Form grid ───────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-full { grid-column: 1 / -1; }
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.field input, .field select, .field textarea {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.toggle input[type="checkbox"] {
  width: 38px; height: 22px;
  appearance: none;
  background: var(--border-strong);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: all .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle input[type="checkbox"]:checked {
  background: var(--primary);
}
.toggle input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

/* ─── Card list (knowledge, training, templates) ──────── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all .15s;
}
.item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.item-card-body { flex: 1; min-width: 0; }
.item-card-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.item-card-content {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.item-card-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.tag {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
}
.tag.accent { background: #FFF8E6; color: var(--accent-hover); }
.tag.danger { background: #FEF2F2; color: var(--danger); }
.tag.success { background: #ECFDF5; color: var(--success); }

.item-card-actions {
  display: flex;
  gap: 0.25rem;
}

/* ─── Inbox layout ────────────────────────────────────── */
.inbox-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
}
.inbox-list {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inbox-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.inbox-header h2 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.filter-pills {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.pill {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all .12s;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
#inbox-search {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 0.85rem;
}
#inbox-search:focus {
  outline: none;
  border-color: var(--primary);
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
}
.conv-item {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  transition: background .12s;
}
.conv-item:hover { background: var(--primary-soft); }
.conv-item.active { background: var(--primary-soft); border-left: 3px solid var(--primary); }
.conv-avatar {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  position: relative;
}
.conv-avatar .platform-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
}
.conv-body { flex: 1; min-width: 0; }
.conv-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.conv-name { font-weight: 600; color: var(--text); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 0.7rem; color: var(--text-soft); flex-shrink: 0; }
.conv-preview {
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.15rem;
}
.conv-unread-badge {
  background: var(--accent);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* ─── Chat thread ─────────────────────────────────────── */
.inbox-chat {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-header {
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.chat-contact {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.chat-name { font-weight: 600; color: var(--primary); }
.chat-meta { font-size: 0.75rem; color: var(--text-muted); }

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.msg-bubble {
  max-width: 70%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}
.msg-bubble.in {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-bubble.out {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-bubble.out.human { background: var(--accent); color: var(--primary); }
.msg-meta {
  font-size: 0.65rem;
  margin-top: 0.25rem;
  opacity: 0.7;
  text-align: right;
}
.msg-bubble.in .msg-meta { color: var(--text-soft); text-align: left; }

.chat-composer {
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-composer textarea, .chat-composer input {
  flex: 1;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  resize: none;
  font-size: 0.9rem;
}
.chat-composer textarea:focus, .chat-composer input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}
.empty-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ─── Channels grid ───────────────────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all .15s;
}
.channel-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.channel-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.channel-info { flex: 1; min-width: 0; }
.channel-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.15rem;
}
.beta-tag {
  background: var(--accent);
  color: var(--primary);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
  font-weight: 700;
  text-transform: uppercase;
}
.channel-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.channel-card.connected {
  border-color: var(--success);
  background: linear-gradient(to right, #ECFDF5, var(--surface) 30%);
}
.channel-card.connected .status-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.channel-card.error .status-dot { background: var(--danger); }

/* Integrations list */
.integration-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.integration-row {
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.integration-row:last-child { border-bottom: none; }
.integration-icon {
  font-size: 1.5rem;
  width: 42px; height: 42px;
  background: var(--primary-soft);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.integration-info { flex: 1; }
.integration-info strong {
  display: block;
  color: var(--primary);
}
.integration-info small {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: block;
  margin-top: 0.15rem;
}
.connected-tag {
  background: #ECFDF5;
  color: var(--success);
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ─── Test chat ───────────────────────────────────────── */
.test-chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 600px;
}
.test-chat .chat-messages { background: var(--bg); }

/* ─── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 {
  color: var(--primary);
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
}
.modal .form-grid {
  grid-template-columns: 1fr;
  padding: 0;
  border: none;
  background: none;
  margin: 0 0 1.5rem;
}
.modal .modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ─── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  font-weight: 500;
  font-size: 0.9rem;
  animation: slideUp .25s;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── NUEVO: KPI cards + reservas columns + badge ───── */
.accent-badge {
  background: var(--accent) !important;
  color: var(--primary) !important;
  font-size: 0.6rem !important;
  padding: 0.08rem 0.4rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all .15s;
}
.kpi-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ─── Hospitality KPIs (compact 6-tile grid in dashboard) ─── */
.hosp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}
.hosp-kpi {
  background: linear-gradient(145deg, #FAF8F3 0%, #F4F0E4 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: all .15s;
}
.hosp-kpi:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.hosp-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.hosp-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.hosp-delta {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.35rem;
  min-height: 1em;
}
.hosp-delta.up   { color: #1d7a3f; }
.hosp-delta.down { color: #c8443a; }
.hosp-delta.flat { color: var(--text-muted); }
.hosp-sublabel {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.reservation-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.col-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}

.res-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  transition: all .12s;
}
.res-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.res-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.res-guest { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.res-unit { font-size: 0.7rem; background: var(--primary-soft); color: var(--primary); padding: 0.1rem 0.5rem; border-radius: 99px; font-weight: 600; }
.res-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.res-source { font-size: 0.65rem; padding: 0.05rem 0.4rem; border-radius: 4px; text-transform: uppercase; font-weight: 700; }
.src-direct { background: #E8F0EB; color: var(--primary); }
.src-airbnb { background: #FFE8E6; color: #FF5A5F; }
.src-booking { background: #E8F0FF; color: #003580; }
.src-whatsapp_bot { background: #DCFCE7; color: #25D366; }

/* ─── Campaign cards ─────────────────────────────────── */
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  transition: all .15s;
}
.campaign-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}
.campaign-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.15rem;
}
.campaign-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.campaign-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.campaign-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.campaign-stat-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}
.campaign-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}
.campaign-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ─── Dashboard + Funnel + Quota widget ──────────────── */
.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dashboard-col { display: flex; flex-direction: column; }
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

#dash-stages .stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}
#dash-stages .stage-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  margin: 0 0.75rem;
  overflow: hidden;
}
#dash-stages .stage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

#dash-channels .channel-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
#dash-channels .channel-line:last-child { border-bottom: none; }

/* Funnel Kanban */
.funnel-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.funnel-col {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-height: 300px;
}
.funnel-col-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
}
.funnel-col-count {
  background: var(--primary);
  color: #fff;
  padding: 0.05rem 0.45rem;
  border-radius: 99px;
  font-size: 0.65rem;
}
.funnel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all .12s;
}
.funnel-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.funnel-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.funnel-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Quota widget en sidebar */
.quota-widget {
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
}
.quota-label {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}
.quota-label span { color: var(--accent-hover); font-weight: 700; }
.quota-bar {
  height: 5px;
  background: rgba(0,0,0,.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 3px;
  transition: width .3s;
}
.quota-text {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Widget generator */
.widget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}
.widget-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.widget-embed-code {
  background: #0F2A1F;
  color: #C9A040;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: nowrap;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-row { grid-template-columns: 1fr; }
  .funnel-board { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}

/* ─── NOTIFICATIONS FEED ────────────────────────────── */
.notif-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}
.notif-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background .15s, transform .15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--surface-alt); transform: translateX(2px); }
.notif-item.unread { background: #FFFBEA; border-left-color: var(--accent); }
.notif-item.severity-success { border-left-color: var(--success); }
.notif-item.severity-warning { border-left-color: var(--warning); }
.notif-item.severity-error   { border-left-color: var(--danger); }
.notif-item.severity-info    { border-left-color: var(--primary); }

.notif-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: flex-start;
  line-height: 1;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; color: var(--text); }
.notif-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; word-wrap: break-word; }
.notif-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}
.notif-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 0.5rem;
}

/* ─── TARIFAS / Quote form ──────────────────────────── */
.quote-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}
.quote-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--text-muted);
  gap: 0.25rem;
}
.quote-form input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--surface);
  min-width: 150px;
}
.quote-form input:focus {
  outline: none;
  border-color: var(--primary);
}
.quote-results {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.quote-card {
  padding: 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.quote-card .qc-code {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}
.quote-card .qc-type {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 12px;
  font-size: 0.7rem;
  margin-top: 0.25rem;
}
.quote-card .qc-total {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.5rem;
}
.quote-card .qc-night {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.rule-row:last-child { border-bottom: none; }
.rule-name { font-weight: 600; color: var(--text); }
.rule-desc { font-size: 0.78rem; color: var(--text-muted); }
.rule-adj {
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8rem;
}
.rule-adj.positive { background: #DCFCE7; color: #166534; }
.rule-adj.negative { background: #FEE2E2; color: #991B1B; }

.unit-rate-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.unit-rate-row:last-child { border-bottom: none; }
.unit-rate-row .u-code { font-weight: 700; color: var(--primary); }
.unit-rate-row .u-name { font-size: 0.8rem; color: var(--text-muted); }
.unit-rate-row .u-price { font-weight: 700; color: var(--accent); }

/* ─── TUTORIALS / Coachmark ─────────────────────────── */
.coachmark {
  position: fixed;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem;
  z-index: 10000;
  animation: coachBounce .25s ease-out;
}
@keyframes coachBounce {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.coachmark.hidden { display: none; }
.coachmark-arrow {
  position: absolute;
  top: -10px;
  left: 24px;
  width: 18px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.coachmark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.coachmark-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  text-decoration: underline;
}
.coachmark-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.coachmark-body {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.coachmark-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.coachmark-actions button {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

/* highlight the element the coachmark points at */
.coach-target {
  position: relative;
  z-index: 9999;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px rgba(201, 160, 64, 0.25);
  border-radius: var(--radius-sm);
  transition: box-shadow .2s;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 72px; }
  .brand-text, .nav-item span:not(.nav-icon):not(.badge), .sidebar-footer { display: none; }
  .nav-section { font-size: 0; padding: 0.5rem; }
  .section { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; padding: 1.25rem; }
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-list { display: var(--inbox-list-mobile, flex); }
}
