/* ============================================================
   Panel Tires Import — sistema de diseño
   Marca: negro #1D1D1B, amarillo #FFC71B, gris #757570, Poppins.
   ============================================================ */

/* --- Fuente de marca (auto-hosteada, sin CDN) --- */
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/poppins-600.woff2") format("woff2");
}

/* --- Tokens de tema --- */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f1ed;
  --surface-hover: #f6f6f2;
  --text: #1d1d1b;
  --muted: #757570;
  --border: #e8e8e4;
  --border-strong: #d9d9d3;

  --accent: #ffc71b;
  --accent-hover: #f0b800;
  --on-accent: #1d1d1b;

  --ok-bg: #e7f5ec;   --ok-fg: #1b7a43;
  --warn-bg: #fdf1df; --warn-fg: #9a6100;
  --bad-bg: #fbeae8;  --bad-fg: #b4271b;

  --shadow-sm: 0 1px 2px rgba(29, 29, 27, .06);
  --shadow-md: 0 4px 14px rgba(29, 29, 27, .08);
  --shadow-lg: 0 12px 32px rgba(29, 29, 27, .14);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --sidebar-w: 240px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141413;
  --surface: #1d1d1b;
  --surface-2: #262624;
  --surface-hover: #2b2b28;
  --text: #f4f4f2;
  --muted: #a3a39e;
  --border: #333330;
  --border-strong: #403f3b;

  --accent: #ffc71b;
  --accent-hover: #ffd24a;
  --on-accent: #1d1d1b;

  --ok-bg: #16301f;   --ok-fg: #59d98a;
  --warn-bg: #33280f; --warn-fg: #f5c451;
  --bad-bg: #331c1a;  --bad-fg: #f2857a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .38);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* --- Reset / base --- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

/* Scrollbars finas y de marca */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: var(--radius-pill);
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   Login
   ============================================================ */
.login {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 24px; background: var(--bg); z-index: 50;
}
.login-card {
  width: 100%; max-width: 360px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 32px; box-shadow: var(--shadow-md);
  animation: rise .5s var(--ease);
}
.login-card .brand-logo { width: 72px; height: 72px; margin: 0 auto 20px; }
.login-card h1 { font-size: 19px; font-weight: 600; }
.login-card p { color: var(--muted); font-size: 13px; margin-top: 6px; margin-bottom: 24px; }
.login-card .field { text-align: left; }
.login-error { color: var(--bad-fg); font-size: 13px; min-height: 18px; margin-top: 12px; }

/* ============================================================
   Shell: sidebar + contenido
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  transition: transform .3s var(--ease);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 18px; margin-bottom: 4px;
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 9px; }
[data-theme="dark"] .sidebar-brand img,
[data-theme="dark"] .login-card .brand-logo {
  background: #fff; padding: 4px;
}
.sidebar-brand .name { font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.sidebar-brand .sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 500; text-align: left;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent); color: var(--on-accent); }
.nav-item .badge {
  margin-left: auto; background: var(--bad-fg); color: #fff;
  font-size: 11px; font-weight: 600; min-width: 18px; height: 18px;
  border-radius: var(--radius-pill); display: grid; place-items: center; padding: 0 5px;
}
.nav-item.active .badge { background: var(--on-accent); color: var(--accent); }

.sidebar-footer { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--border); padding-top: 10px; }

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

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.hamburger {
  display: none; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 38px; height: 38px; cursor: pointer;
  color: var(--text); align-items: center; justify-content: center;
}
.hamburger svg { width: 20px; height: 20px; }

.view-wrap { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }
.view { animation: rise .35s var(--ease); }
.view[hidden] { display: none; }

/* ============================================================
   Indicadores de estado (pills)
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill.ok  { background: var(--ok-bg);  color: var(--ok-fg); }
.pill.ok .dot  { background: var(--ok-fg); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill.warn .dot { background: var(--warn-fg); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.pill.bad .dot { background: var(--bad-fg); }
.pill .dot.live { animation: pulse 2s infinite; }

/* ============================================================
   Cards y grillas
   ============================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.kpi { position: relative; }
.kpi .kpi-label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .kpi-label svg { width: 16px; height: 16px; opacity: .7; }
.kpi .kpi-value { font-size: 30px; font-weight: 600; margin-top: 8px; line-height: 1.1; letter-spacing: -.5px; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* Número con el color del estado (sección Chats abandonados del Resumen). */
.kpi .kpi-value.tone-ok { color: var(--ok-fg); }
.kpi .kpi-value.tone-warn { color: var(--warn-fg); }
.kpi .kpi-value.tone-bad { color: var(--bad-fg); }

.section-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 15px; font-weight: 600; margin: 8px 0 14px;
}
.section-title .muted-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.block { margin-bottom: 30px; }

/* ============================================================
   Botones y controles
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform .16s var(--ease), background-color .16s var(--ease), box-shadow .16s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.danger { background: transparent; color: var(--bad-fg); border-color: color-mix(in srgb, var(--bad-fg) 35%, transparent); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.icon { padding: 8px; }
.btn.icon svg { width: 18px; height: 18px; }

.input, select.input {
  width: 100%; padding: 10px 12px; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input::placeholder { color: var(--muted); }
select.input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px;
}
.select-inline {
  padding: 6px 28px 6px 10px; font-size: 12.5px; border-radius: 8px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23757570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* Chips de filtro */
.chips { display: inline-flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-pill); }
.chip {
  padding: 6px 14px; border: none; background: transparent; color: var(--muted);
  border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .chip.active { background: var(--surface-hover); }

/* Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--radius-pill);
  transition: background-color .2s var(--ease); cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--ok-fg); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Tablas (siempre con scroll interno)
   ============================================================ */
.scroll-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm);
  max-height: 440px;
}
.scroll-panel.tall { max-height: 560px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 600; text-align: center; letter-spacing: .2px;
  padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 11px 14px; font-size: 13px; text-align: center;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color .12s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr.clickable { cursor: pointer; }
td .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty-state, .loading-state {
  padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13.5px;
}
.loading-state .spinner { margin: 0 auto 12px; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

/* ============================================================
   Embudo (barras horizontales)
   ============================================================ */
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 46px; align-items: center; gap: 12px; }
.funnel-row .fl-label { font-size: 13px; color: var(--muted); }
.funnel-row .fl-bar-bg { background: var(--surface-2); border-radius: var(--radius-pill); height: 12px; overflow: hidden; }
.funnel-row .fl-bar { height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width .5s var(--ease); }
.funnel-row .fl-val { font-size: 13px; font-weight: 600; text-align: right; }

/* ============================================================
   Conversaciones (burbujas)
   ============================================================ */
.conv-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
#conv-list td:first-child { font-weight: 500; }
.chat-panel { max-height: 520px; }
.chat { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.bubble .bt { display: block; font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.bubble.user { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.bubble.assistant { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.bubble.assistant .bt { color: color-mix(in srgb, var(--on-accent) 60%, transparent); }
.chat-head {
  position: sticky; top: 0; z-index: 1; margin: -16px -16px 4px; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.chat-head .mono { color: var(--text); font-weight: 600; }
.chat-empty { display: grid; place-items: center; height: 100%; min-height: 200px; color: var(--muted); text-align: center; padding: 24px; }

/* ============================================================
   Consumo
   ============================================================ */
.progress { background: var(--surface-2); border-radius: var(--radius-pill); height: 10px; overflow: hidden; margin-top: 10px; }
.progress .bar { height: 100%; background: var(--ok-fg); border-radius: var(--radius-pill); transition: width .5s var(--ease); }
.progress .bar.warn { background: var(--warn-fg); }
.progress .bar.bad { background: var(--bad-fg); }

/* Radio-cards (ajustes) */
.radio-cards { display: flex; flex-direction: column; gap: 10px; }
.radio-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.radio-card:hover { background: var(--surface-hover); }
.radio-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); }
.radio-card .rc-title { font-weight: 600; font-size: 14px; }
.radio-card .rc-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.setting-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .sr-text { flex: 1; }
.setting-row .sr-title { font-weight: 600; font-size: 14px; }
.setting-row .sr-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Sucursales — grilla responsive: dos (o más) sucursales lado a lado; en
   pantallas angostas colapsa a una sola columna (auto-fit, sin media query). */
#sucursales-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px; align-items: start;
}
.suc-card { margin-bottom: 0; }
.suc-card .suc-group {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin: 16px 0 0;
}
.suc-maps {
  display: inline-block; margin-top: 6px; font-size: 12.5px;
  color: var(--accent); text-decoration: none; font-weight: 600;
}
.suc-maps:hover { text-decoration: underline; }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }
/* Acciones de la card de sucursal (editar/eliminar) e iconos por servicio */
.suc-actions { display: inline-flex; gap: 4px; margin-left: 6px; }
.svc-actions { display: inline-flex; gap: 2px; margin-right: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; transition: background-color .16s var(--ease), color .16s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad-fg); }
.field-hint { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ============================================================
   Toast + modal
   ============================================================ */
.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  animation: toast-in .3s var(--ease);
}
.toast.hide { animation: toast-out .25s var(--ease) forwards; }
.toast .ic { width: 20px; height: 20px; flex-shrink: 0; }
.toast.ok .ic { color: var(--ok-fg); }
.toast.bad .ic { color: var(--bad-fg); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 20, 19, .5);
  display: grid; place-items: center; z-index: 80; padding: 24px;
  animation: fade .2s var(--ease);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg);
  animation: rise .28s var(--ease);
}
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.modal p { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal.modal-wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin-bottom: 0; }

.backdrop-mobile { display: none; }

/* ============================================================
   Tooltip informativo (icono i sobre las tarjetas)
   ============================================================ */
.info { position: relative; display: inline-flex; align-items: center; color: var(--muted); cursor: help; }
.info svg { width: 15px; height: 15px; }
.info:hover, .info:focus-visible { color: var(--accent); outline: none; }
.info .tip {
  position: absolute; top: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 224px; max-width: 60vw; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 12px; line-height: 1.45; font-weight: 400;
  text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 45;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.info .tip::after {
  content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: var(--surface);
}
.info:hover .tip, .info:focus-visible .tip {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Estados de lead (badges de color, en negrita)
   ============================================================ */
.estado-select {
  appearance: none; border: none; cursor: pointer; color: #fff;
  font-family: inherit; font-weight: 700; font-size: 12px; letter-spacing: .2px;
  padding: 6px 28px 6px 13px; border-radius: var(--radius-pill);
  background-repeat: no-repeat; background-position: right 9px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  transition: background-color .16s var(--ease), transform .12s var(--ease);
}
.estado-select:hover { transform: translateY(-1px); }
.estado-select option { color: var(--text); background: var(--surface); font-weight: 500; }
.estado-select.est-pendiente_contacto { background-color: #dc3b3b; }
.estado-select.est-contactado { background-color: #de7c00; }
.estado-select.est-cerrado { background-color: #2f9e44; }

/* ============================================================
   Control de presupuesto (Ajustes) + formulario del modal
   ============================================================ */
.budget-control { display: flex; align-items: center; gap: 8px; }
.budget-control .input { width: 116px; }
.budget-prefix { color: var(--muted); font-size: 13px; font-weight: 500; }

.form-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.field-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field-label .input { font-weight: 400; color: var(--text); }
.field-row { display: flex; gap: 10px; }
.field-row .field-label { flex: 1; }

/* ============================================================
   Animaciones
   ============================================================ */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 70; height: 100vh;
    transform: translateX(-100%); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .backdrop-mobile.show {
    display: block; position: fixed; inset: 0; background: rgba(20, 20, 19, .45); z-index: 60;
    animation: fade .2s var(--ease);
  }
  .conv-layout { grid-template-columns: 1fr; }
  .view-wrap { padding: 20px 16px 40px; }
  .topbar { padding: 14px 16px; }
  .funnel-row { grid-template-columns: 110px 1fr 40px; }
}
