/* CRM KAURI · rediseño visual (Modern Minimal SaaS).
   Solo presentación: no cambia estructura, datos ni funciones. Se carga al final de todo (lib/ConsoleUI.php) y
   redefine la paleta con variables propias del CRM. Sin subrayados en ningún lugar. */
:root{
  --crm-side:#183D35;--crm-side-hover:#254D43;--crm-side-text:#cfe0da;--crm-side-muted:#8fb0a6;
  --crm-bg:#F6F7F9;--crm-surface:#FFFFFF;--crm-line:#E3E7EC;--crm-line-strong:#D3D9E0;
  --crm-primary:#365A78;--crm-primary-hover:#294760;
  --crm-text:#202B36;--crm-muted:#697586;
  --crm-ok-bg:#E3F3E9;--crm-ok:#2E6B47;--crm-warn-bg:#FFF2DA;--crm-warn:#8A5A12;--crm-off-bg:#EDF0F3;--crm-error:#B85C5C;--crm-error-bg:#FBEDED;
  --crm-radius:12px;--crm-radius-sm:8px;
  --crm-shadow:0 1px 2px rgba(32,43,54,.05);
  --k-yellow:#ffd800;--k-ink:var(--crm-text);--k-ink-2:var(--crm-text);--k-muted:var(--crm-muted);--k-bg:var(--crm-bg);--k-line:var(--crm-line);--k-line-strong:var(--crm-line-strong);
  --console-bg:var(--crm-bg);--console-side:var(--crm-side);--console-surface:var(--crm-surface);--console-line:var(--crm-line);--console-text:var(--crm-text);--console-muted:var(--crm-muted);--console-accent:var(--crm-primary);
  --bg:var(--crm-bg);--panel:var(--crm-surface);--surface:var(--crm-surface);--surface-elevated:var(--crm-bg);--border:var(--crm-line);--text:var(--crm-text);--muted:var(--crm-muted);--text-muted:var(--crm-muted);--line:var(--crm-line);--accent:var(--crm-primary)
}

/* ---- Base: tipografía de sistema, fondo gris claro y cero subrayados ---- */
html,body{background:var(--crm-bg)!important;color:var(--crm-text)}
body{font:14px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif!important;-webkit-font-smoothing:antialiased}
body h1,body h2,body h3,body strong{color:var(--crm-text)}
body h1{font-weight:700;font-size:1.55rem;letter-spacing:-.02em}
body h2{font-weight:650;font-size:1.1rem;letter-spacing:-.01em}
body h3{font-weight:650}
body label,body small,body th{color:var(--crm-muted)}
body .muted,body .dashboard-tagline{color:var(--crm-muted)}
html body a,html body a:hover,html body a:focus,html body a:active,html body a:visited,html body summary,html body button,html body .button,
html body main :is(p,li,small,td,span,div)>a:not(.button):not(.result-link-icon):not([class*="nav"]),
html body main :is(p,li,small,td,span,div)>a:not(.button):not(.result-link-icon):not([class*="nav"]):hover{text-decoration:none!important;text-decoration-line:none!important;text-decoration-color:transparent!important}
html body *,html body *::before,html body *::after{-webkit-text-decoration:none!important}
body a{color:var(--crm-primary)}
body a:hover{color:var(--crm-primary-hover)}
body .kauri-word{color:var(--crm-text);-webkit-text-fill-color:var(--crm-text);border:0!important;text-decoration:none}
body .eyebrow{display:block;color:var(--crm-muted);font-size:.72rem;font-weight:650;letter-spacing:.08em;text-transform:uppercase}
body .eyebrow::before{display:none}
body hr{border:0;border-top:1px solid var(--crm-line)}

/* ---- Contenedores: tarjetas blancas, borde fino, sombra mínima ---- */
body .panel,body .card,body .surface,body .metrics article,body .auth-card,body main>header,body .dashboard-header{background:var(--crm-surface);border:1px solid var(--crm-line)!important;border-radius:var(--crm-radius)!important;box-shadow:var(--crm-shadow)}
body main>header,body .dashboard-header{border-bottom:1px solid var(--crm-line)!important}
body .metrics article{border-top:1px solid var(--crm-line)!important}
body .panel h2{padding-bottom:10px;margin-bottom:14px;border-bottom:1px solid var(--crm-line)}
body .metrics article strong{font-size:1.6rem;font-weight:700;letter-spacing:-.02em}
body .metrics article span,body .metrics article small{color:var(--crm-muted)}

/* ---- Barra lateral: verde petróleo, íconos claros, activa con fondo más claro ---- */
body.console-shell .sidebar,body.console-shell .accounts-nav,body .topnav{background:var(--crm-side)!important;border-color:var(--crm-side)!important;color:var(--crm-side-text)}
body.console-shell .sidebar nav a,body.console-shell .sidebar .console-brand{color:var(--crm-side-text)!important;border-radius:10px;transition:background-color .15s ease,color .15s ease}
body.console-shell .sidebar nav a:hover{background:var(--crm-side-hover)!important;color:#fff!important}
body.console-shell .sidebar nav a.console-current,body.console-shell .sidebar nav a.active-nav,body .accounts-nav .selected{background:var(--crm-side-hover)!important;color:#fff!important}
body.console-shell .sidebar nav a.console-current::before,body.console-shell .sidebar nav a.active-nav::before{display:none}
body .console-nav-symbol{color:inherit}
body .console-brand-mark{background:var(--k-yellow);border:0;border-radius:10px}
body .console-avatar{background:var(--crm-side-hover);color:#fff;border:0}
body.console-shell .sidebar .console-settings>button,body.console-shell .console-settings-toggle,body .console-settings>summary{background:var(--crm-side-hover)!important;color:#fff!important;border:1px solid transparent!important;border-radius:10px;transition:background-color .15s ease}
body.console-shell .sidebar .console-settings>button:hover,body .console-settings>summary:hover{background:#2e5a4e!important}
body .console-settings-menu{background:#fff;color:var(--crm-text);border:1px solid var(--crm-line);border-radius:var(--crm-radius);box-shadow:0 8px 24px rgba(24,61,53,.14)}
body .console-settings-menu a{color:var(--crm-text)}
body .console-settings-menu a:hover{background:var(--crm-bg)}
body .console-nav-badge{background:#F4C542;color:#183D35;border:2px solid var(--crm-side)}

/* ---- Barra superior de la cuenta y consola de actividad ---- */
body .radar-account-bar,body.console-shell .radar-account-bar,body.console-shell .dashboard-header{background:#fff;color:var(--crm-text);border-color:var(--crm-line)}
body.console-shell .radar-account-bar a,body.console-shell .radar-account-bar .owner{color:var(--crm-muted)}
body.console-shell .radar-account-bar a:hover{color:var(--crm-primary)}
body.console-shell .account-activity-footer,body.console-shell .radar-console{background:#fff;border-color:var(--crm-line);color:var(--crm-text)}
body .console-toolbar button{background:var(--crm-bg)!important;color:var(--crm-text)!important;border:1px solid var(--crm-line)!important}
body .console-toolbar button:hover:not(:disabled){background:var(--crm-off-bg)!important}

/* ---- Botones ---- */
body main button:not(.secondary):not(.quiet):not(.danger):not(.run-toggle):not(.console-settings-toggle),body main .button,
body #choose-locations,body #search-form #start,body #search-form #cancel-location,body .email-editor #compose-email,body .email-editor #save-template,body .email-editor #send-template-test{background:var(--crm-primary)!important;color:#fff!important;border:1px solid var(--crm-primary)!important;border-radius:var(--crm-radius-sm)!important;font-weight:600;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}
body main button:not(.secondary):not(.quiet):not(.danger):not(.run-toggle):not(.console-settings-toggle):hover:not(:disabled),body main .button:hover,
body #choose-locations:hover:not(:disabled),body #search-form #start:hover:not(:disabled),body #search-form #cancel-location:hover:not(:disabled),body .email-editor #compose-email:hover:not(:disabled),body .email-editor #save-template:hover:not(:disabled),body .email-editor #send-template-test:hover:not(:disabled){background:var(--crm-primary-hover)!important;border-color:var(--crm-primary-hover)!important}
body main button.secondary,body main button.quiet{background:#fff!important;color:var(--crm-text)!important;border:1px solid var(--crm-line-strong)!important;border-radius:var(--crm-radius-sm)!important;font-weight:600}
body main button.secondary:hover:not(:disabled),body main button.quiet:hover:not(:disabled){background:var(--crm-bg)!important;border-color:var(--crm-primary)!important}
body button.danger{background:#fff!important;color:var(--crm-error)!important;border:1px solid var(--crm-error)!important;border-radius:var(--crm-radius-sm)}
body button.danger:hover:not(:disabled){background:var(--crm-error-bg)!important}
body button:disabled{opacity:.55;cursor:not-allowed}
body .run-toggle{border-color:var(--crm-primary)}
body .run-toggle::after{border-left-color:var(--crm-primary)}
body button:focus-visible,body a:focus-visible,body summary:focus-visible,body input:focus-visible,body select:focus-visible,body textarea:focus-visible{outline:2px solid var(--crm-primary);outline-offset:2px}

/* ---- Formularios ---- */
body input,body textarea,body select{background:#fff;color:var(--crm-text);border:1px solid var(--crm-line-strong);border-radius:var(--crm-radius-sm);transition:border-color .18s ease,box-shadow .18s ease}
body input:focus,body textarea:focus,body select:focus{outline:none;border-color:var(--crm-primary);box-shadow:0 0 0 3px rgba(54,90,120,.16)}
body input::placeholder,body textarea::placeholder{color:#9aa5b1}
body input[type="checkbox"],body input[type="radio"]{accent-color:var(--crm-primary)}
body .scope-grid label,body .email-summary span{background:#fff;color:var(--crm-text);border:1px solid var(--crm-line);border-radius:var(--crm-radius-sm)}
body .scope-grid label:has(input:checked){background:var(--crm-ok-bg);border-color:#b9dcc6}

/* ---- Tablas compactas ---- */
body .table-wrap{border:1px solid var(--crm-line);border-radius:var(--crm-radius);overflow:auto;background:#fff}
body table{border-collapse:separate;border-spacing:0;font-size:13px}
body table th{background:var(--crm-bg);color:var(--crm-muted);font-weight:650;font-size:.72rem;letter-spacing:.05em;text-transform:uppercase;border-bottom:1px solid var(--crm-line)!important;padding:9px 12px;text-align:left;white-space:nowrap}
body table td{border-bottom:1px solid var(--crm-line);padding:8px 12px;color:var(--crm-text);vertical-align:middle}
body table tbody tr:last-child td{border-bottom:0}
body table tbody tr{transition:background-color .15s ease}
body table tbody tr:hover td{background:#F2F5F8}
body .search-results-table th,body .search-results-table td{padding:8px 12px}

/* ---- Avisos y estados ---- */
body .notice{background:var(--crm-warn-bg);border:1px solid #f0d9ab;color:var(--crm-warn);border-radius:var(--crm-radius-sm)}
body .notice.error{background:var(--crm-error-bg);border-color:#ebc4c4;color:var(--crm-error)}
body .indicator{border-radius:999px}
body .sources .source-activity.is-active{color:var(--crm-ok)}

/* ---- Bandeja de WhatsApp y espacios de trabajo ---- */
body .inbox-shell,body .inbox-list-pane,body .inbox-chat-head,body .inbox-composer,body .inbox-list,body .inbox-chat{background:#fff;color:var(--crm-text);border-color:var(--crm-line)}
body .inbox-list .inbox-list-item.is-selected,body .inbox-list .inbox-list-item:hover{background:var(--crm-ok-bg)}
body .inbox-messages{background:var(--crm-bg)}
body .wa-workspace{--wa-bg:var(--crm-bg);--wa-panel:#fff;--wa-line:var(--crm-line-strong);--wa-muted:var(--crm-muted);--wa-green:var(--crm-primary);background:var(--crm-bg);color:var(--crm-text)}
body .wa-workspace .wa-primary{background:var(--crm-primary);color:#fff}

/* ---- Contenido: aire y ancho cómodos ---- */
body main{max-width:1400px}
body.console-shell main{padding-top:20px}

/* ---- Movimiento discreto ---- */
@media (prefers-reduced-motion:reduce){body *,body *::before,body *::after{transition:none!important;animation:none!important}}

/* ---- Ajustes de acomodo ---- */
body.console-shell .sidebar>nav{overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#3d6a5d transparent}
body.console-shell .sidebar>nav::-webkit-scrollbar{width:6px;height:0}
body.console-shell .sidebar>nav::-webkit-scrollbar-thumb{background:#3d6a5d;border-radius:6px}
body .console-nav-badge{top:-2px;right:0}
body table td{overflow-wrap:break-word;word-break:normal}
body #store-rows td:first-child,body #email-rows td:first-child{min-width:190px}
body #store-rows td:nth-child(3),body #email-rows td:nth-child(4){min-width:120px}
body .panel>.run{display:flex;flex-wrap:wrap;gap:8px}
