/* GH Desarrollos — marca: blanco (base), dorado #CDAF79 (acento) y negro #111 (texto y contraste).
   La escala de dorado de Filament vive en App\Support\Brand; aquí solo lo que Filament no expone.
   Modo claro = el de la marca (blanco). Modo oscuro (clase «dark» en <html>) = negro con el mismo dorado. */

:root {
    --gh-gold: #CDAF79;
    --gh-gold-soft: #FAF7F2;      /* fondo del elemento activo del menú */
    --gh-gold-text: #6E5D3F;      /* dorado para TEXTO (6.3:1 sobre blanco) */
    --gh-ink: #111111;
    --gh-bg: #fff;
    --gh-border: #E9E2D2;
    --gh-muted: #6b6558;
    --gh-error: #b42318;
    --gh-chart-grid: #EEE9DD;
    --gh-chart-text: #6B6558;
}

.dark {
    --gh-gold-soft: rgb(205 175 121 / .12);
    --gh-gold-text: #D9C08C;      /* dorado claro para texto sobre negro (10:1) */
    --gh-ink: #F3EFE6;
    --gh-bg: #0a0a0a;             /* el gris casi negro que Filament usa de fondo en oscuro */
    --gh-border: rgb(255 255 255 / .12);
    --gh-muted: #A8A292;
    --gh-error: #F97066;
    --gh-chart-grid: rgb(255 255 255 / .09);
    --gh-chart-text: #B3AD9E;
}

/* Fondo del sitio (Filament usa un gris casi blanco por defecto en claro). */
.fi-body,
.fi-simple-layout,
.fi-simple-main-ctn { background-color: var(--gh-bg); }

/* Cabecera del color del fondo con un filo dorado fino (se quita el anillo gris/sombra de Filament, que lo tapaba). */
.fi-topbar { background-color: var(--gh-bg); border-bottom: 1px solid var(--gh-gold); box-shadow: none; }

/* Menú lateral: elemento activo con fondo dorado muy suave y marca dorada a la izquierda. */
.fi-sidebar-item.fi-active > a,
.fi-sidebar-item.fi-active > button {
    background-color: var(--gh-gold-soft);
    box-shadow: inset 3px 0 0 var(--gh-gold);
}

/* Tarjetas del login y de secciones: borde fino, sin sombras pesadas. */
.fi-simple-main { border: 1px solid var(--gh-border); box-shadow: 0 1px 3px rgb(17 17 17 / .05); }
.dark .fi-simple-main { box-shadow: none; }

/* Encabezados de tablas: más discretos. */
.fi-ta-header-cell { color: var(--gh-ink); }

/* Botones dorados sólidos: en oscuro también el champagne de marca con texto oscuro (Filament pone un dorado apagado
   con texto blanco, de menor contraste). Solo los rellenos: los botones de contorno y de enlace no llevan fondo propio. */
html.dark .fi-btn.fi-color-primary[class*="fi-bg-color-"] { background-color: #CDAF79; color: #292215; }
html.dark .fi-btn.fi-color-primary[class*="fi-bg-color-"]:hover { background-color: #E0CDAC; color: #292215; }

/* ---- Contraer el menú lateral (solo escritorio) ----
   Filo fino en la división y una pestaña redonda a caballo sobre ella, centrada a la mitad de la altura; el botón de Filament de la cabecera se oculta
   en escritorio para no tener dos controles. En móvil se conserva el menú de hamburguesa de siempre. */
.gh-sidebar-toggle { display: none; }
@media (min-width: 1024px) {
    .fi-sidebar { border-inline-end: 1px solid var(--gh-border); }
    .fi-topbar-collapse-sidebar-btn-ctn { display: none; }
    .gh-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: -0.875rem;
                         width: 1.75rem; height: 1.75rem; padding: 0; border-radius: 9999px; border: 1px solid var(--gh-border);
                         background: var(--gh-bg); color: var(--gh-muted); cursor: pointer; z-index: 30; box-shadow: 0 1px 2px rgb(17 17 17 / .08); }
    .gh-sidebar-toggle:hover { color: var(--gh-ink); border-color: var(--gh-gold); }
    .gh-sidebar-toggle:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 2px; }
    .gh-sidebar-toggle svg { width: 1rem; height: 1rem; transition: transform .15s; }
}

/* ---- Botón de modo claro/oscuro ---- */
.gh-theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin-inline-end: .5rem;
                   border-radius: .5rem; border: 1px solid var(--gh-border); background: transparent; color: var(--gh-muted); cursor: pointer; }
.gh-theme-toggle:hover { color: var(--gh-ink); border-color: var(--gh-gold); }
.gh-theme-toggle:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 2px; }
.gh-theme-toggle svg { width: 1.25rem; height: 1.25rem; }
/* En el login no hay cabecera: flota arriba a la derecha. */
.gh-theme-toggle-floating { position: fixed; top: 1rem; right: 1rem; margin: 0; z-index: 10; background: var(--gh-bg); }

/* ---- Utilidades propias para las vistas Blade personalizadas ----
   El CSS de Filament está precompilado y solo trae las clases que él usa: las utilidades de Tailwind
   escritas en nuestras vistas (space-y-4, gap-3, text-sm…) no existen, así que se usan estas. */
.gh-stack { display: flex; flex-direction: column; gap: 1rem; }
.gh-stack-sm { display: flex; flex-direction: column; gap: .625rem; }
.gh-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.gh-row-top { display: flex; align-items: flex-start; gap: .625rem; }
.gh-muted { color: var(--gh-muted); }
.gh-small { font-size: .875rem; line-height: 1.4; }
.gh-rules { margin: 0; padding-inline-start: 1.25rem; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; line-height: 1.5; }
.gh-rules li { list-style: disc; }
.gh-pairing-code { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 700; letter-spacing: .2em;
                    color: var(--gh-ink); background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .5rem 1rem; width: fit-content; }
.gh-modal { margin: auto; padding: 0; border: 1px solid var(--gh-border); border-radius: .75rem; width: min(26rem, calc(100% - 2rem)); height: min(48rem, calc(100% - 2rem));
           background: var(--gh-bg); color: var(--gh-ink); overflow: hidden; }
.gh-modal[open] { display: flex; flex-direction: column; }
.gh-modal::backdrop { background: rgb(0 0 0 / .6); }
.gh-modal-head { display: flex; align-items: center; justify-content: space-between; padding: .625rem .875rem; border-bottom: 1px solid var(--gh-border); }
.gh-modal-close { background: none; border: 0; cursor: pointer; color: var(--gh-muted); font-size: 1rem; padding: .25rem .5rem; }
.gh-modal-close:hover { color: var(--gh-ink); }
.gh-modal-frame { flex: 1; width: 100%; border: 0; background: #161513; }
.gh-anchor { scroll-margin-top: 5rem; }  /* que el título no quede tapado por la cabecera al saltar desde el índice */
html:has(.gh-anchor) { scroll-behavior: smooth; }
.gh-toc { margin: 0; padding-inline-start: 1.5rem; columns: 2 16rem; column-gap: 2rem; font-size: .9rem; line-height: 1.5; }
.gh-toc li { list-style: decimal; padding: .125rem 0; break-inside: avoid; }
/* Lead con la cita vencida (rojo) o con la reactivación pendiente (ámbar): se nota en la lista de leads. */
tr.gh-row-alert > td { background-color: rgb(180 35 24 / .07); }
tr.gh-row-notice > td { background-color: rgb(181 120 20 / .09); }
.dark tr.gh-row-alert > td { background-color: rgb(249 112 102 / .12); }
.dark tr.gh-row-notice > td { background-color: rgb(250 190 80 / .12); }
/* El indicador de «Configuración» (grupo de Filament) se ve igual que el de Leads y Eventos: › contraído, ⌄ abierto. */
html .fi-sidebar-group .fi-sidebar-group-collapse-btn { rotate: 180deg; transition: rotate .15s; }
html .fi-sidebar-group.fi-collapsed .fi-sidebar-group-collapse-btn { rotate: 90deg; }

/* Submenús más compactos: Filament deja 4 px entre ellos y 8 px de relleno por elemento. */
.fi-sidebar-sub-group-items { row-gap: 0; }
.fi-sidebar-sub-group-items .fi-sidebar-item-btn { padding-block: .1875rem; }

/* Elementos del menú con submenús que se contraen (Leads, Eventos). */
.gh-collapsible-head { cursor: pointer; }
.gh-item-chevron { margin-inline-start: auto; display: inline-flex; color: var(--gh-muted); transition: transform .15s; }
.gh-item-chevron svg { width: 1rem; height: 1rem; }
.gh-item-collapsed .gh-item-chevron { transform: rotate(-90deg); }
.gh-subitems-collapsed { display: none; }

.gh-map { height: 26rem; border-radius: .5rem; border: 1px solid var(--gh-border); position: relative; z-index: 0; isolation: isolate;
          display: flex; align-items: center; justify-content: center; color: var(--gh-muted); font-size: .875rem; text-align: center; padding: 1rem; }
.gh-map.leaflet-container { display: block; padding: 0; background: var(--gh-bg); font: inherit; }
/* Modo oscuro: el mapa base se invierte y se atenúa (los marcadores van en otra capa y no cambian). */
.dark .gh-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.dark .gh-map .leaflet-bar a { background: #171717; color: var(--gh-ink); border-bottom-color: var(--gh-border); }
.dark .gh-map .leaflet-bar a:hover { background: #262626; }
.dark .gh-map .leaflet-control-attribution { background: rgb(10 10 10 / .7); color: var(--gh-muted); }
.dark .gh-map .leaflet-control-attribution a { color: var(--gh-gold-text); }
.gh-pin-wrap { background: none; border: 0; }
.gh-pin { display: grid; place-items: center; border-radius: 9999px; background: #A9822B; color: #fff; font-weight: 700; font-size: .875rem;
          border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.gh-map-list { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem; }
.gh-map-list li { display: inline-flex; gap: .375rem; align-items: baseline; font-size: .8125rem; padding: .125rem .625rem; border-radius: 9999px;
                  border: 1px solid var(--gh-border); background: var(--gh-gold-soft); }
.gh-link { color: var(--gh-gold-text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.gh-link:hover { color: var(--gh-ink); }
.gh-error { color: var(--gh-error); font-size: .875rem; }
/* El QR siempre va sobre blanco (si no, el celular no lo lee en modo oscuro). */
.gh-qr { width: 16rem; height: 16rem; background: #fff; padding: .5rem; border-radius: .5rem; border: 1px solid #E9E2D2; }

/* Gráficas de una misma fila: tarjetas de igual altura aunque tengan distinto número de barras. */
.fi-wi-chart { height: 100%; }
.fi-wi-chart > .fi-section { height: 100%; }
/* Filament pinta el texto y la cuadrícula de las gráficas con el `color` de estos elementos, así que siguen el modo. */
.fi-wi-chart .fi-wi-chart-grid-color { color: var(--gh-chart-grid); }
.fi-wi-chart .fi-wi-chart-text-color { color: var(--gh-chart-text); }

/* Pie de página (panel y login): discreto, centrado, con el enlace en dorado legible. */
.gh-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: 1.25rem 1rem; margin-top: 2rem;
             border-top: 1px solid var(--gh-border); color: var(--gh-muted); font-size: .8125rem; line-height: 1.4; }
.gh-footer a { color: var(--gh-gold-text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.gh-footer a:hover { color: var(--gh-ink); }

/* Texto técnico (URLs, códigos): monoespaciado, con salto de línea en cualquier punto para no desbordar. */
.gh-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; background: var(--gh-gold-soft);
           border: 1px solid var(--gh-border); border-radius: .375rem; padding: .25rem .5rem; word-break: break-all; color: var(--gh-ink); }

/* ---- Asistente del sistema (solo administradores): botón del encabezado y panel lateral de conversación ---- */
.gh-assistant-btn { color: var(--gh-gold-text); }
.gh-assistant-overlay { position: fixed; inset: 0; background: rgb(17 17 17 / .35); z-index: 60; }
.gh-assistant-panel { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(30rem, 100vw); z-index: 61; display: flex; flex-direction: column;
                      background: var(--gh-bg); color: var(--gh-ink); border-inline-start: 1px solid var(--gh-gold); box-shadow: -8px 0 24px rgb(17 17 17 / .12); }
.gh-assistant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .875rem 1rem; border-bottom: 1px solid var(--gh-border); }
.gh-assistant-sub { display: block; font-size: .75rem; color: var(--gh-muted); }
.gh-assistant-actions { display: flex; align-items: center; gap: .5rem; }
.gh-assistant-link { font-size: .8125rem; color: var(--gh-gold-text); background: none; border: 0; cursor: pointer; padding: .25rem .5rem; border-radius: .375rem; }
.gh-assistant-link:hover { background: var(--gh-gold-soft); }
.gh-assistant-close { font-size: 1.5rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--gh-muted); padding: 0 .25rem; }
.gh-assistant-close:hover { color: var(--gh-ink); }
.gh-assistant-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.gh-assistant-empty { color: var(--gh-muted); font-size: .875rem; display: flex; flex-direction: column; gap: .5rem; }
.gh-assistant-example { text-align: start; font-size: .8125rem; color: var(--gh-ink); background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .5rem .75rem; cursor: pointer; }
.gh-assistant-example:hover { border-color: var(--gh-gold); }
.gh-chat-row { display: flex; }
.gh-chat-row-user { justify-content: flex-end; }
.gh-chat-msg { max-width: 92%; border-radius: .75rem; padding: .5rem .75rem; font-size: .875rem; line-height: 1.45; border: 1px solid var(--gh-border); overflow-wrap: anywhere; }
.gh-chat-user { background: var(--gh-gold-soft); border-color: var(--gh-gold); }
.gh-chat-bot { background: var(--gh-bg); }
.gh-chat-error { background: var(--gh-bg); border-color: var(--gh-error); color: var(--gh-error); }
.gh-chat-typing { color: var(--gh-muted); font-style: italic; }
.gh-chat-meta { margin-top: .25rem; font-size: .6875rem; color: var(--gh-muted); }
.gh-chat-body > :first-child { margin-top: 0; }
.gh-chat-body > :last-child { margin-bottom: 0; }
.gh-chat-body p { margin: .4rem 0; }
.gh-chat-body ul, .gh-chat-body ol { margin: .4rem 0; padding-inline-start: 1.25rem; }
.gh-chat-body ul { list-style: disc; }
.gh-chat-body ol { list-style: decimal; }
.gh-chat-body code { font-size: .8125rem; background: var(--gh-gold-soft); border-radius: .25rem; padding: .05rem .3rem; }
.gh-chat-body pre { margin: .5rem 0; padding: .5rem .75rem; background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .5rem; overflow-x: auto; }
.gh-chat-body pre code { background: none; padding: 0; }
.gh-chat-body a { color: var(--gh-gold-text); text-decoration: underline; }
.gh-assistant-error { margin: 0 1rem .5rem; padding: .5rem .75rem; font-size: .8125rem; border: 1px solid var(--gh-error); color: var(--gh-error); border-radius: .5rem; }
.gh-assistant-form { display: flex; gap: .5rem; padding: .75rem 1rem 1rem; border-top: 1px solid var(--gh-border); }
.gh-assistant-form textarea { flex: 1; resize: none; font-size: .875rem; padding: .5rem .625rem; background: var(--gh-bg); color: var(--gh-ink); border: 1px solid var(--gh-border); border-radius: .5rem; }
.gh-assistant-form textarea:focus { outline: 2px solid var(--gh-gold); outline-offset: 1px; }
.gh-assistant-send { align-self: flex-end; background: var(--gh-gold); color: #292215; border: 0; border-radius: .5rem; padding: .5rem 1rem; font-weight: 600; cursor: pointer; }
.gh-assistant-send:disabled, .gh-assistant-form textarea:disabled { opacity: .6; cursor: wait; }

/* ---- «Ver como»: aviso fijo mientras un administrador ve el sistema como otro usuario ---- */
.gh-impersonating { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: .875rem;
                    max-width: calc(100vw - 2rem); padding: .625rem .875rem .625rem 1rem; border-radius: .75rem; background: #111; color: #F3EFE6; font-size: .875rem; line-height: 1.35;
                    border: 1px solid var(--gh-gold); box-shadow: 0 8px 24px rgb(17 17 17 / .35); }
.gh-impersonating strong { color: var(--gh-gold); }
.gh-impersonating-leave { flex: none; background: var(--gh-gold); color: #292215; border: 0; border-radius: .5rem; padding: .4rem .875rem; font-weight: 600; cursor: pointer; }
.gh-impersonating-leave:hover { filter: brightness(1.08); }
@media (max-width: 640px) { .gh-impersonating { flex-direction: column; align-items: stretch; text-align: center; } }

/* Conversaciones (admin), al estilo WhatsApp Web: contactos a la izquierda, conversación a la derecha. */
.gh-wa { display: grid; grid-template-columns: minmax(18rem, 24rem) 1fr; height: calc(100vh - 11rem); min-height: 28rem; border: 1px solid var(--gh-border); border-radius: .75rem; overflow: hidden; background: var(--gh-bg); }
.gh-wa-side { display: flex; flex-direction: column; border-inline-end: 1px solid var(--gh-border); min-height: 0; }
.gh-wa-filters { padding: .75rem; display: flex; flex-direction: column; gap: .5rem; border-bottom: 1px solid var(--gh-border); }
.gh-wa-selects { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.gh-wa-input { width: 100%; font-size: .8125rem; color: var(--gh-ink); background: var(--gh-bg); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .45rem .6rem; }
.gh-wa-input:focus { outline: 2px solid var(--gh-gold); outline-offset: 0; }
.gh-wa-contacts { flex: 1; overflow-y: auto; min-height: 0; }
.gh-wa-contact { display: flex; gap: .65rem; width: 100%; text-align: start; padding: .65rem .75rem; background: none; border: 0; border-bottom: 1px solid var(--gh-border); cursor: pointer; color: var(--gh-ink); }
.gh-wa-contact:hover { background: var(--gh-gold-soft); }
.gh-wa-active, .gh-wa-active:hover { background: var(--gh-gold-soft); box-shadow: inset 3px 0 0 var(--gh-gold); }
.gh-wa-avatar { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--gh-gold); color: #292215; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.gh-wa-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.gh-wa-contact-top { display: flex; justify-content: space-between; gap: .5rem; }
.gh-wa-name { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-wa-time { flex: none; font-size: .6875rem; color: var(--gh-muted); }
.gh-wa-snippet { font-size: .75rem; color: var(--gh-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.gh-wa-badges { display: flex; gap: .35rem; margin-top: .15rem; }
.gh-wa-badge { font-size: .6875rem; border: 1px solid var(--gh-border); border-radius: .375rem; padding: 0 .35rem; color: var(--gh-muted); }
.gh-wa-badge-warn { border-color: var(--gh-gold); color: var(--gh-gold-text); }
.gh-wa-empty { padding: 1rem; font-size: .8125rem; color: var(--gh-muted); }
.gh-wa-more { display: block; width: 100%; padding: .65rem; font-size: .8125rem; color: var(--gh-gold-text); background: none; border: 0; cursor: pointer; }
.gh-wa-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--gh-gold-soft); }
.gh-wa-chat-head { display: flex; align-items: center; gap: .65rem; padding: .6rem .9rem; background: var(--gh-bg); border-bottom: 1px solid var(--gh-border); }
.gh-wa-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gh-wa-back { display: none; font-size: 1.25rem; background: none; border: 0; cursor: pointer; color: var(--gh-ink); }
.gh-wa-thread { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; min-height: 0; }
.gh-wa-day { align-self: center; margin: .5rem 0; }
.gh-wa-day span { font-size: .6875rem; color: var(--gh-muted); background: var(--gh-bg); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .15rem .6rem; }
.gh-wa-row { display: flex; }
.gh-wa-row-out { justify-content: flex-end; }
.gh-wa-bubble { max-width: min(75%, 38rem); border-radius: .6rem; padding: .35rem .6rem .25rem; border: 1px solid var(--gh-border); overflow-wrap: anywhere; }
.gh-wa-in { background: var(--gh-bg); border-top-left-radius: 0; }
.gh-wa-out { background: var(--gh-gold-soft); border-color: var(--gh-gold); border-top-right-radius: 0; }
.gh-wa-sender { font-size: .6875rem; font-weight: 600; color: var(--gh-gold-text); }
.gh-wa-text { font-size: .875rem; line-height: 1.4; white-space: pre-wrap; }
.gh-wa-media { color: var(--gh-muted); font-style: italic; }
.gh-wa-stamp { text-align: end; font-size: .625rem; color: var(--gh-muted); }
.gh-wa-placeholder { margin: auto; text-align: center; color: var(--gh-muted); font-size: .875rem; padding: 2rem; }
@media (max-width: 800px) {
    .gh-wa { grid-template-columns: 1fr; height: calc(100vh - 9rem); }
    .gh-wa-chat { display: none; }
    .gh-wa-open .gh-wa-chat { display: flex; }
    .gh-wa-open .gh-wa-side { display: none; }
    .gh-wa-back { display: inline-block; }
}

/* Pipeline de leads: una columna por estatus. */
.gh-pl-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.gh-pl-bar .gh-wa-input { width: auto; min-width: 12rem; }
.gh-pl-totals { margin-inline-start: auto; font-size: .8125rem; color: var(--gh-muted); }
.gh-pl-totals strong { color: var(--gh-ink); }
.gh-pl { display: flex; gap: .75rem; overflow-x: auto; align-items: flex-start; padding-bottom: .75rem; }
.gh-pl-col { flex: none; width: 17rem; background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .75rem; display: flex; flex-direction: column; max-height: calc(100vh - 14rem); }
.gh-pl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--gh-border); }
.gh-pl-title { font-weight: 600; font-size: .875rem; }
.gh-pl-count { font-size: .75rem; color: var(--gh-gold-text); border: 1px solid var(--gh-gold); border-radius: 999px; padding: 0 .45rem; }
.gh-pl-sum { flex-basis: 100%; font-size: .6875rem; color: var(--gh-muted); }
.gh-pl-cards { display: flex; flex-direction: column; gap: .5rem; padding: .5rem; overflow-y: auto; }
.gh-pl-card { display: flex; flex-direction: column; gap: .15rem; background: var(--gh-bg); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .55rem .65rem; }
.gh-pl-name { font-weight: 600; font-size: .875rem; color: var(--gh-ink); text-decoration: none; overflow-wrap: anywhere; }
.gh-pl-name:hover { color: var(--gh-gold-text); text-decoration: underline; }
.gh-pl-meta { font-size: .75rem; color: var(--gh-muted); overflow-wrap: anywhere; }
.gh-pl-money { color: var(--gh-gold-text); font-weight: 600; }
.gh-pl-alert { align-self: flex-start; font-size: .6875rem; border-radius: .375rem; padding: 0 .35rem; margin-top: .15rem; }
.gh-pl-alert-danger { color: var(--gh-error); border: 1px solid var(--gh-error); }
.gh-pl-alert-warning { color: var(--gh-gold-text); border: 1px solid var(--gh-gold); }
.gh-pl-moves { display: block; margin-top: .35rem; }
.gh-pl-move { display: block; width: 100%; text-align: center; font-size: .75rem; color: var(--gh-gold-text); background: none; border: 1px solid var(--gh-border); border-radius: .375rem; padding: .3rem .5rem; cursor: pointer; }
.gh-pl-move:hover { border-color: var(--gh-gold); background: var(--gh-gold-soft); }
.gh-pl-empty { font-size: .75rem; color: var(--gh-muted); text-align: center; padding: .5rem; }
.gh-pl-more { font-size: .75rem; color: var(--gh-gold-text); text-align: center; padding: .25rem; }

/* Calendario de leads (FullCalendar): colores de la marca y modo oscuro. */
.gh-cal { --fc-border-color: var(--gh-border); --fc-page-bg-color: var(--gh-bg); --fc-neutral-bg-color: var(--gh-gold-soft); --fc-today-bg-color: var(--gh-gold-soft); --fc-list-event-hover-bg-color: var(--gh-gold-soft); --fc-now-indicator-color: var(--gh-error); --fc-button-bg-color: var(--gh-bg); --fc-button-border-color: var(--gh-border); --fc-button-text-color: var(--gh-ink); --fc-button-hover-bg-color: var(--gh-gold-soft); --fc-button-hover-border-color: var(--gh-gold); --fc-button-active-bg-color: var(--gh-gold); --fc-button-active-border-color: var(--gh-gold); color: var(--gh-ink); font-size: .8125rem; }
.gh-cal .fc-button-primary:not(:disabled).fc-button-active, .gh-cal .fc-button-primary:not(:disabled):active { color: #292215; }
.gh-cal .fc-toolbar-title { font-size: 1.125rem; text-transform: capitalize; }
.gh-cal a { color: inherit; text-decoration: none; }
.gh-cal .fc-event { border-width: 1px; cursor: pointer; }
.gh-cal .fc-daygrid-event, .gh-cal .fc-timegrid-event { color: #292215; }
.gh-cal-cita { background: var(--gh-gold); border-color: var(--gh-gold); }
.gh-cal-llamada { background: #8FB5C9; border-color: #8FB5C9; }
.gh-cal-seguimiento { background: #C9C2B0; border-color: #C9C2B0; }
.gh-cal-done { opacity: .5; text-decoration: line-through; }
.gh-cal-overdue { box-shadow: inset 0 0 0 2px var(--gh-error); }
.gh-cal .fc-list-event .fc-list-event-dot { border-color: currentColor; }
.gh-cal-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; color: var(--gh-ink); }
.gh-cal-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-inline-start: .5rem; }
.gh-cal-dot-cita { background: var(--gh-gold); }
.gh-cal-dot-llamada { background: #8FB5C9; }
.gh-cal-dot-seguimiento { background: #C9C2B0; }
.gh-cal-evento { background: #A8C3A0; border-color: #A8C3A0; }
.gh-cal-difusion { background: #C7A6C9; border-color: #C7A6C9; }
.gh-cal-dot-evento { background: #A8C3A0; }
.gh-cal-dot-difusion { background: #C7A6C9; }

/* Estatus con color discreto: tinte suave del color y un punto; el texto conserva el color normal (legible en claro y oscuro). */
.gh-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; line-height: 1.2; padding: .15rem .55rem; border-radius: 999px; color: var(--gh-ink); background: color-mix(in srgb, var(--st) 28%, transparent); border: 1px solid var(--st); font-weight: 500; white-space: nowrap; }
.gh-status::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--st); flex: none; }
.gh-status-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; background: var(--st); margin-inline-end: .4rem; vertical-align: baseline; }
.gh-pl-head { background: color-mix(in srgb, var(--st, transparent) 30%, transparent); border-top: 5px solid var(--st, transparent); border-radius: .7rem .7rem 0 0; }

/* «Acciones en bloque»: siempre a la vista; atenuado y sin clic mientras no haya filas marcadas. */
.gh-bulk-disabled { opacity: .45; pointer-events: none; }

/* El estatus con sus avisos debajo (Cita vencida, Reactivar, Bot apagado), en lugar de una columna para cada aviso. */
.gh-status-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.gh-status-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.gh-tag { font-size: .6875rem; line-height: 1.3; border-radius: .375rem; padding: 0 .35rem; border: 1px solid var(--gh-border); color: var(--gh-ink); white-space: nowrap; }
.gh-tag-danger { border-color: var(--gh-error); color: var(--gh-error); }
.gh-tag-warning { border-color: var(--gh-gold); color: var(--gh-gold-text); }

/* El celular bajo el nombre del lead: enlace a WhatsApp (verde de WhatsApp, oscurecido para leerse bien sobre blanco). */
.gh-note-full { white-space: normal; line-height: 1.5; overflow-wrap: anywhere; }

/* Barra de acciones de las fichas (lead y candidato), solo íconos: cada uno dentro de un círculo para que se lea como botón (v1.80.2). */
.fi-icon-btn.gh-round-btn {
    /* Filament les pone margen NEGATIVO a los botones de ícono (para encajar en tablas): con el círculo se enciman. Aquí, sin margen. */
    margin: 0 !important;
    width: 2.5rem; height: 2.5rem; border-radius: 9999px; flex: none;
    border: 1px solid var(--gh-border); background-color: var(--gh-bg);
    box-shadow: 0 1px 2px rgb(17 17 17 / .06);
    transition: background-color .15s, border-color .15s;
}
.fi-icon-btn.gh-round-btn:hover, .fi-icon-btn.gh-round-btn:focus-visible { background-color: var(--gh-gold-soft); border-color: var(--gh-gold); }
/* Los dorados (+ Agregar, nota) con el borde dorado; los apagados (sin correo) se ven claramente inactivos. */
.fi-icon-btn.gh-round-btn.fi-color-primary { border-color: var(--gh-gold); }
.fi-icon-btn.gh-round-btn:disabled, .fi-icon-btn.gh-round-btn.fi-disabled { opacity: .45; box-shadow: none; }
/* Separación entre los círculos (quedaban pegados): la fila de acciones de la cabecera que los lleva. */
.fi-header-actions-ctn .fi-ac:has(.gh-round-btn) { gap: .625rem; flex-wrap: wrap; }

/* Configuración → Reglas del bot (v1.85). */
.gh-botrules-dl { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: .6rem 1.25rem; margin: 0; }
.gh-botrules-dl dt { font-weight: 600; font-size: .875rem; }
.gh-botrules-dl dd { margin: 0; font-size: .875rem; white-space: pre-line; }
@media (max-width: 640px) { .gh-botrules-dl { grid-template-columns: 1fr; } .gh-botrules-dl dd { margin-bottom: .5rem; } }
.gh-botrules-msg { margin-bottom: 1.1rem; }
.gh-botrules-msg-title { font-weight: 600; margin: 0 0 .15rem; }
.gh-botrules-bubble { white-space: pre-line; font-size: .875rem; background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .75rem; padding: .7rem .9rem; max-width: 46rem; }
.gh-botrules-prompt { white-space: pre-wrap; font-size: .8rem; line-height: 1.45; background: var(--gh-gold-soft); border: 1px solid var(--gh-border); border-radius: .5rem; padding: .9rem 1rem; max-height: 36rem; overflow: auto; margin: .35rem 0 0; }

/* Listado de Usuarios: encabezado de cada estatus solo con su punto de color (el nombre, al pasar el cursor). */
.gh-status-head { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; cursor: help; padding: .15rem; white-space: nowrap; font-size: .8125rem; }
.gh-status-head .gh-status-dot { width: .7rem; height: .7rem; margin: 0; flex: none; }
.gh-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


/* Listado de Usuarios: leyenda de los colores de estatus, arriba de la tabla (plegable). */
.gh-legend { margin-top: .5rem; font-size: .8125rem; color: var(--gh-ink); border: 1px solid var(--gh-border); border-radius: .75rem; background: var(--gh-bg); padding: .5rem .85rem; max-width: 56rem; }
.gh-legend summary { cursor: pointer; font-weight: 600; color: var(--gh-gold-text); }
.gh-legend-table { border-collapse: collapse; margin-top: .5rem; width: 100%; }
.gh-legend-table th { text-align: left; font-weight: 600; color: var(--gh-muted); padding: .2rem .6rem .35rem 0; border-bottom: 1px solid var(--gh-border); }
.gh-legend-table td { padding: .3rem .6rem .3rem 0; vertical-align: top; border-bottom: 1px solid var(--gh-border); }
.gh-legend-table tr:last-child td { border-bottom: 0; }
.gh-legend-table td:first-child { width: 1.5rem; }
.gh-legend-table .gh-status-dot { margin: .2rem 0 0; }
.gh-legend-name { font-weight: 500; white-space: nowrap; }

/* Conversación de WhatsApp en la ficha del lead y del candidato, estilo chat (v1.88). */
:root { --gh-chat-out: #2451B0; --gh-chat-out-text: #fff; --gh-chat-human: #6E5D3F; --gh-chat-bg: #F1F4F9; }
.dark { --gh-chat-out: #2f5fc4; --gh-chat-human: #8a7650; --gh-chat-bg: rgb(255 255 255 / .04); }
.gh-chat-card { border: 1px solid var(--gh-border); border-radius: 1rem; background: var(--gh-bg); }
.gh-chat-title { font-weight: 700; font-size: 1.05rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--gh-border); }
.gh-chat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1rem 1.25rem .75rem; }
.gh-chat-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .8125rem; padding: .25rem .6rem; border-radius: .5rem; border: 1px solid var(--gh-border); color: var(--gh-muted); background: var(--gh-chat-bg); }
.gh-chat-chip svg { width: 1rem; height: 1rem; }
.gh-chat-chip-on { color: #1f7a4d; background: #ecfdf3; border-color: #c6f0d6; }
.gh-chat-chip-paused { color: #9a6700; background: #fff8e6; border-color: #f5dfa6; }
.dark .gh-chat-chip-on { color: #3dd68c; background: rgb(61 214 140 / .1); border-color: rgb(61 214 140 / .25); }
.dark .gh-chat-chip-paused { color: #f5c451; background: rgb(245 196 81 / .1); border-color: rgb(245 196 81 / .25); }
.gh-chat-phone { color: var(--gh-muted); font-size: .9rem; }
.gh-chat-pause { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .875rem; padding: .45rem .9rem; border-radius: .6rem; border: 1px solid var(--gh-border); background: var(--gh-bg); color: var(--gh-ink); cursor: pointer; }
.gh-chat-pause svg { width: 1rem; height: 1rem; opacity: .6; }
.gh-chat-pause:hover { border-color: var(--gh-gold); }
.gh-chat-thread { margin: 0 1.25rem; padding: 1rem; background: var(--gh-chat-bg); border-radius: .85rem; display: flex; flex-direction: column; gap: .6rem; max-height: 34rem; overflow-y: auto; }
.gh-chat-row { display: flex; }
.gh-chat-row-in { justify-content: flex-start; }
.gh-chat-row-out { justify-content: flex-end; }
.gh-chat-bubble { max-width: min(42rem, 80%); padding: .6rem .85rem .45rem; border-radius: 1rem; box-shadow: 0 1px 2px rgb(17 17 17 / .06); }
.gh-chat-in { background: #fff; color: #111; border-top-left-radius: .35rem; }
.dark .gh-chat-in { background: #1c1c1c; color: var(--gh-ink); }
.gh-chat-out { background: var(--gh-chat-out); color: var(--gh-chat-out-text); border-top-right-radius: .35rem; }
.gh-chat-human { background: var(--gh-chat-human); }
.gh-chat-note .gh-chat-text { font-style: italic; opacity: .8; }
.gh-chat-text { white-space: pre-line; overflow-wrap: anywhere; font-size: .925rem; line-height: 1.45; }
.gh-chat-meta { font-size: .75rem; opacity: .7; margin-top: .25rem; }
.gh-chat-empty { color: var(--gh-muted); text-align: center; margin: 1rem 0; font-size: .875rem; }
.gh-chat-compose { display: flex; gap: .75rem; align-items: center; padding: 1rem 1.25rem 0; }
.gh-chat-compose textarea { flex: 1; resize: vertical; min-height: 3.25rem; font: inherit; font-size: .925rem; padding: .7rem .9rem; border: 1px solid var(--gh-border); border-radius: .75rem; background: var(--gh-bg); color: var(--gh-ink); }
.gh-chat-compose textarea:focus { outline: 2px solid var(--gh-chat-out); outline-offset: 0; }
.gh-chat-send { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; padding: .7rem 1.1rem; border: 0; border-radius: .75rem; background: var(--gh-chat-out); color: #fff; cursor: pointer; }
.gh-chat-send svg { width: 1.1rem; height: 1.1rem; }
.gh-chat-send:disabled { opacity: .6; }
.gh-chat-hint { font-size: .75rem; color: var(--gh-muted); padding: .35rem 1.25rem 1rem; margin: 0; }
@media (max-width: 640px) { .gh-chat-bubble { max-width: 90%; } .gh-chat-pause { margin-left: 0; } }
.gh-botrules-heading { font-size: 1.25rem; font-weight: 700; margin: 1rem 0 0; }

/* Ayuda: buscador por palabra (v1.90). La barra se queda fija arriba al bajar. */
.gh-help-search { position: sticky; top: 4.5rem; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--gh-bg); border: 1px solid var(--gh-border); border-radius: .75rem; box-shadow: 0 2px 8px rgb(17 17 17 / .06); }
.gh-help-search input { flex: 1; min-width: 0; font: inherit; font-size: .9rem; border: 0; outline: 0; background: transparent; color: var(--gh-ink); padding: .35rem 0; }
.gh-help-search-icon { width: 1.1rem; height: 1.1rem; color: var(--gh-muted); flex: none; }
.gh-help-search-count { font-size: .8125rem; color: var(--gh-muted); white-space: nowrap; }
.gh-help-search-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; border: 1px solid var(--gh-border); background: var(--gh-bg); color: var(--gh-ink); cursor: pointer; flex: none; }
.gh-help-search-btn svg { width: 1rem; height: 1rem; }
.gh-help-search-btn:disabled { opacity: .4; cursor: default; }
.gh-help-content { display: flex; flex-direction: column; gap: 1.5rem; }
mark.gh-hit { background: #fde68a; color: inherit; border-radius: .15rem; padding: 0 .05rem; }
mark.gh-hit-current { background: var(--gh-gold); outline: 2px solid var(--gh-gold); }
.dark mark.gh-hit { background: rgb(253 230 138 / .35); }
/* Chat: adjuntar imagen o PDF (v1.91). */
.gh-chat-attach { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .75rem; border: 1px solid var(--gh-border); background: var(--gh-bg); color: var(--gh-muted); cursor: pointer; flex: none; }
.gh-chat-attach:hover { color: var(--gh-chat-out); border-color: var(--gh-chat-out); }
.gh-chat-attach svg { width: 1.25rem; height: 1.25rem; }
.gh-chat-attach-preview { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .75rem 1.25rem 0; padding: .5rem .75rem; border: 1px dashed var(--gh-border); border-radius: .75rem; }
.gh-chat-attach-preview img { max-height: 5rem; max-width: 8rem; border-radius: .5rem; object-fit: cover; }
.gh-chat-attach-remove { margin-left: auto; font-size: .8125rem; border: 0; background: none; color: var(--gh-error); cursor: pointer; }
.gh-chat-media img { display: block; max-width: 16rem; max-height: 16rem; border-radius: .6rem; margin-bottom: .35rem; object-fit: cover; }
.gh-chat-file { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .875rem; text-decoration: underline; color: inherit; margin-bottom: .35rem; }
.gh-chat-file svg { width: 1.1rem; height: 1.1rem; }
/* Conversaciones: el cuadro para escribir abajo del hilo (v1.92). */
.gh-wa-compose { background: var(--gh-bg); border-top: 1px solid var(--gh-border); padding-bottom: .25rem; }
.gh-wa-compose .gh-chat-compose { padding: .75rem .9rem 0; }
.gh-wa-compose .gh-chat-hint { padding: .3rem .9rem .5rem; }
.gh-wa-compose .gh-chat-attach-preview { margin: .6rem .9rem 0; }
.gh-row-inactive > td { opacity: .55; }
