:root {
    /* Modo Oscuro (por defecto) - Deep Luxury Slate */
    --bg-main: #090d16;
    --bg-sidebar: #0f172a;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --bg-card: #131c31;
    --bg-card-rgb: 19, 28, 49;
    --bg-paper: #18233c;
    --bg-input: #101827;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-light: rgba(2, 132, 199, 0.15);
    --accent-rgb: 2, 132, 199;

    --brand-pro: #0d9488;
    --brand-pro-rgb: 13, 148, 136;

    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.5);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Glassmorphism Tokens */
    --glass-bg: rgba(19, 28, 49, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-blur: blur(14px);

    --kanban-col-width: 15%;

    /* Universal Switch / Toggle Tokens */
    --switch-bg-off: #334155;
    --switch-bg-on: #10b981;
    --switch-border-off: rgba(255, 255, 255, 0.12);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-theme="light"] * {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Custom Multiselect styles are centralized in the components section */

/* ==========================================================================
   Universal Toggle Switch Component
   Soporta: .switch-toggle, .switch-container, .switch, .form-switch
   Escalable dinámicamente mediante variables (--switch-w, --switch-h, --switch-pad)
   o inline en el objeto, sin forzar escalas rígidas en app.css.
   ========================================================================== */
.switch-toggle,
.switch-container,
.switch,
.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: var(--switch-w, 44px);
    height: var(--switch-h, 24px);
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    margin: 0;
}

.switch-toggle input[type="checkbox"],
.switch-container input[type="checkbox"],
.switch input[type="checkbox"],
.form-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.switch-toggle .slider-toggle,
.switch-toggle .slider,
.switch-container .slider,
.switch .slider,
.form-switch .slider {
    position: absolute;
    inset: 0;
    background-color: var(--switch-bg-off, #475569) !important;
    border: 1px solid var(--switch-border-off, rgba(255, 255, 255, 0.14));
    border-radius: 999px;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Thumb/Círculo: Centrado vertical matemático y traslación proporcional exacta */
.switch-toggle .slider-toggle::before,
.switch-toggle .slider::before,
.switch-container .slider::before,
.switch .slider::before,
.form-switch .slider::before {
    position: absolute;
    content: "";
    top: 50%;
    left: var(--switch-pad, 2px);
    transform: translateY(-50%);
    width: calc(var(--switch-h, 24px) - (var(--switch-pad, 2px) * 2));
    height: calc(var(--switch-h, 24px) - (var(--switch-pad, 2px) * 2));
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1),
                background-color 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Estado Checked (Encendido) */
.switch-toggle input:checked + .slider-toggle,
.switch-toggle input:checked + .slider,
.switch-container input:checked + .slider,
.switch input:checked + .slider,
.form-switch input:checked + .slider {
    background-color: var(--switch-bg-on, var(--accent, #2563eb)) !important;
    border-color: transparent !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 8px rgba(16, 185, 129, 0.25);
}

.switch-toggle input:checked + .slider-toggle::before,
.switch-toggle input:checked + .slider::before,
.switch-container input:checked + .slider::before,
.switch input:checked + .slider::before,
.form-switch input:checked + .slider::before {
    transform: translate(calc(var(--switch-w, 44px) - var(--switch-h, 24px)), -50%);
}

/* Modificadores de color contextual */
.switch-toggle.switch-success input:checked + .slider-toggle,
.switch-toggle.switch-success input:checked + .slider,
.switch-container.switch-success input:checked + .slider,
.switch.switch-success input:checked + .slider,
.form-switch.switch-success input:checked + .slider {
    background-color: var(--success, #10b981) !important;
}

.switch-toggle.switch-warning input:checked + .slider-toggle,
.switch-toggle.switch-warning input:checked + .slider,
.switch-container.switch-warning input:checked + .slider,
.switch.switch-warning input:checked + .slider,
.form-switch.switch-warning input:checked + .slider {
    background-color: var(--warning, #f59e0b) !important;
}

.switch-toggle.switch-brand input:checked + .slider-toggle,
.switch-toggle.switch-brand input:checked + .slider,
.switch-container.switch-brand input:checked + .slider,
.switch.switch-brand input:checked + .slider,
.form-switch.switch-brand input:checked + .slider {
    background-color: var(--brand-pro, #67bab8) !important;
}

/* Estado Deshabilitado */
.switch-toggle input:disabled + .slider-toggle,
.switch-toggle input:disabled + .slider,
.switch-container input:disabled + .slider,
.switch input:disabled + .slider,
.form-switch input:disabled + .slider {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

/* Focus Visible para Accesibilidad */
.switch-toggle input:focus-visible + .slider-toggle,
.switch-toggle input:focus-visible + .slider,
.switch-container input:focus-visible + .slider,
.switch input:focus-visible + .slider,
.form-switch input:focus-visible + .slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Modo Claro - Luminoso, Limpio y Ejecutivo */
[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --bg-card: #ffffff;
    --bg-card-rgb: 255, 255, 255;
    --bg-paper: #ffffff;
    --bg-input: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-light: rgba(2, 132, 199, 0.08);
    --accent-rgb: 2, 132, 199;

    --brand-pro: #0f766e;
    --brand-pro-rgb: 15, 118, 110;

    --success: #059669;
    --success-rgb: 5, 150, 105;
    --danger: #dc2626;
    --danger-rgb: 220, 38, 38;
    --warning: #d97706;
    --warning-rgb: 217, 119, 6;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12);

    /* Glassmorphism Claro */
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: 1px solid rgba(15, 23, 42, 0.06);
    --glass-blur: blur(14px);

    --switch-bg-off: #94a3b8;
    --switch-bg-on: #10b981;
    --switch-border-off: rgba(0, 0, 0, 0.12);
}

/* Theme Toggle Icons */
[data-theme="light"] .theme-icon-moon {
    display: none !important;
}
[data-theme="light"] .theme-icon-sun {
    display: block !important;
}
[data-theme="dark"] .theme-icon-sun,
[data-theme="mood"] .theme-icon-sun {
    display: none !important;
}
[data-theme="dark"] .theme-icon-moon,
[data-theme="mood"] .theme-icon-moon {
    display: block !important;
}


/* Modo MOOD (Pink Princess) */
[data-theme="mood"] {
    --bg-main: #ff85a1;
    --bg-sidebar: #ff99ac;
    --border: #ffb3c1;
    --bg-card: #ffe5ec;
    --bg-paper: #ffe5ec;
    --bg-input: #ffffff;

    --text-primary: #590d22;
    --text-secondary: #800f2f;
    --text-muted: #a4133c;

    --accent: #ff4d6d;
    --accent-hover: #c9184a;
    --accent-light: rgba(255, 77, 109, 0.2);
    --accent-rgb: 255, 77, 109;

    --brand-pro: #ff4d6d;
    --brand-pro-rgb: 255, 77, 109;

    --switch-bg-off: #ffb3c1;
    --switch-bg-on: #e11d48;
    --switch-border-off: rgba(255, 255, 255, 0.2);

    --shadow: 0 4px 20px rgba(128, 15, 47, 0.2);
    --shadow-sm: 0 2px 8px rgba(128, 15, 47, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
    font-size: 0.95rem;
}

/* WhatsApp Brand Vector Utilities */
.icon-whatsapp {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}
.icon-whatsapp-colored {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}

/* App Shell & Layout */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================================
   Motor de Menú Lateral Flotante Expansible (Overlay con física elástica)
   ========================================================================== */
:root {
    --sidebar-width-collapsed: 76px;
    --sidebar-width-expanded: 270px;
    --sidebar-speed: 0.32s;
    --sidebar-expand-easing: cubic-bezier(0.16, 1, 0.3, 1);
    --sidebar-collapse-easing: cubic-bezier(0.34, 1.45, 0.64, 1); /* Signature Elastic Snap */
    --border-highlight: rgba(var(--brand-pro-rgb), 0.28);
    --border-tree-line: rgba(var(--brand-pro-rgb), 0.4);
    --brand-pro-glow: rgba(var(--brand-pro-rgb), 0.3);
    --shadow-sidebar-floating: 0 20px 50px -10px rgba(0, 0, 0, 0.65), 
                              0 0 0 1px rgba(255, 255, 255, 0.09),
                              12px 0 35px -5px rgba(0, 0, 0, 0.45);
    --radius-sidebar: 0 20px 20px 0;
    --radius-item: var(--radius);
}

[data-theme="light"] {
    --shadow-sidebar-floating: 0 20px 45px -10px rgba(0, 0, 0, 0.18), 
                              0 0 0 1px rgba(0, 0, 0, 0.06),
                              10px 0 25px -5px rgba(0, 0, 0, 0.08);
}

/* Espaciador lateral que asegura 0 desplazamiento en el contenido */
.sidebar-placeholder {
    width: var(--sidebar-width-collapsed);
    flex-shrink: 0;
    height: 100vh;
    pointer-events: none;
}

/* Barra lateral flotante */
.floating-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width-collapsed);
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    border-radius: var(--radius-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    contain: layout paint;
    will-change: width, box-shadow;
    
    transition: width var(--sidebar-speed) var(--sidebar-collapse-easing),
                box-shadow var(--sidebar-speed) ease,
                background-color 0.3s ease;
}

/* Estado Expandido al pasar el cursor (Hover) */
.floating-sidebar:hover,
.floating-sidebar.is-expanded {
    width: var(--sidebar-width-expanded);
    box-shadow: var(--shadow-sidebar-floating);
    transition: width var(--sidebar-speed) var(--sidebar-expand-easing),
                box-shadow var(--sidebar-speed) ease,
                background-color 0.3s ease;
}

/* Cabecera y Logo */
.sidebar-header {
    height: 74px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    width: 100%;
}

.brand-icon-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-item);
    background: linear-gradient(135deg, rgba(var(--brand-pro-rgb), 0.22), rgba(var(--accent-rgb), 0.12));
    border: 1px solid var(--border-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-pro);
    box-shadow: 0 4px 12px var(--brand-pro-glow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.floating-sidebar:hover .brand-icon-box {
    transform: scale(1.04);
    box-shadow: 0 6px 18px var(--brand-pro-glow);
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    overflow: hidden;
    min-width: 160px;
    
    opacity: 0;
    transform: translateX(-12px);
    filter: blur(4px);
    transition: opacity calc(var(--sidebar-speed) * 0.75) ease,
                transform calc(var(--sidebar-speed) * 0.85) cubic-bezier(0.16, 1, 0.3, 1),
                filter calc(var(--sidebar-speed) * 0.75) ease;
}

.floating-sidebar:hover .brand-text-block,
.floating-sidebar.is-expanded .brand-text-block {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
    transition-delay: 0.04s;
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--brand-pro);
    color: var(--bg-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Navegación */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 44px;
    border-radius: var(--radius-item);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
    width: 100%;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(var(--brand-pro-rgb), 0.15), rgba(var(--brand-pro-rgb), 0.04));
    color: var(--brand-pro);
    border-color: var(--border-highlight);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--brand-pro);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--brand-pro);
}

.nav-icon-wrap {
    width: 56px;
    min-width: 56px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.nav-icon-wrap i,
.nav-icon-wrap svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.nav-item:hover .nav-icon-wrap i,
.nav-item:hover .nav-icon-wrap svg {
    transform: scale(1.14);
    color: var(--brand-pro);
}

.nav-label-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    
    opacity: 0;
    transform: translateX(-14px);
    filter: blur(3px);
    transition: opacity calc(var(--sidebar-speed) * 0.7) ease,
                transform calc(var(--sidebar-speed) * 0.85) cubic-bezier(0.16, 1, 0.3, 1),
                filter calc(var(--sidebar-speed) * 0.7) ease;
}

.floating-sidebar:hover .nav-label-wrap,
.floating-sidebar.is-expanded .nav-label-wrap {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
    transition-delay: 0.04s;
}

.nav-label {
    font-size: 0.90rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nav-item.active .nav-label {
    font-weight: 700;
}

/* Puntos de Alerta en Modo Colapsado */
.nav-alert-dot {
    position: absolute;
    top: 7px;
    right: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.nav-alert-dot.amber {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.nav-alert-dot.blue {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.nav-alert-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: navPulseGlow 1.8s infinite;
}

@keyframes navPulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--brand-pro-rgb), 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(var(--brand-pro-rgb), 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--brand-pro-rgb), 0); }
}

/* Al expandirse la barra lateral, ocultamos el punto colapsado */
.floating-sidebar:hover .nav-alert-dot,
.floating-sidebar.is-expanded .nav-alert-dot {
    opacity: 0;
    transform: scale(0.4);
}

/* Pastillas / Badges en Modo Expandido */
.nav-badge-pill {
    font-size: 0.70rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-badge-pill.amber {
    background: rgba(245, 158, 11, 0.18);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.nav-badge-pill.blue {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.nav-badge-pill.green {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Submenús */
.nav-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-dropdown-toggle {
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
}

.dropdown-chevron {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-dropdown.is-open .dropdown-chevron {
    transform: rotate(180deg);
    color: var(--text-primary);
}

.nav-sub-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    width: 100%;
    
    margin-left: 0;
    padding-left: 0;
    border-left: 2px solid transparent;
    
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.22s ease,
                margin-left var(--sidebar-speed) var(--sidebar-expand-easing),
                padding-left var(--sidebar-speed) var(--sidebar-expand-easing),
                border-color var(--sidebar-speed) ease,
                margin-top 0.2s ease,
                margin-bottom 0.2s ease;
}

.nav-dropdown.is-open .nav-sub-container {
    max-height: 260px;
    opacity: 1;
    margin-top: 2px;
    margin-bottom: 4px;
}

.floating-sidebar:hover .nav-dropdown.is-open .nav-sub-container,
.floating-sidebar.is-expanded .nav-dropdown.is-open .nav-sub-container {
    margin-left: 26px;
    padding-left: 12px;
    border-left-color: var(--border-tree-line);
    width: calc(100% - 36px);
}

.sub-nav-item {
    display: flex;
    align-items: center;
    height: 42px;
    border-radius: var(--radius-item);
    color: var(--text-secondary);
    text-decoration: none;
    user-select: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    
    transition: background-color 0.18s ease,
                border-color 0.18s ease,
                color 0.18s ease,
                height var(--sidebar-speed) var(--sidebar-expand-easing);
}

.sub-icon-wrap {
    width: 56px;
    min-width: 56px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    
    transition: width var(--sidebar-speed) var(--sidebar-expand-easing),
                min-width var(--sidebar-speed) var(--sidebar-expand-easing);
}

.sub-icon-wrap i,
.sub-icon-wrap svg {
    width: 18px;
    height: 18px;
    color: var(--brand-pro);
    opacity: 0.9;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.floating-sidebar:hover .sub-nav-item,
.floating-sidebar.is-expanded .sub-nav-item {
    height: 36px;
    border-radius: 8px;
}

.floating-sidebar:hover .sub-icon-wrap,
.floating-sidebar.is-expanded .sub-icon-wrap {
    width: 22px;
    min-width: 22px;
    height: 36px;
    justify-content: flex-start;
}

.sub-nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
}

.sub-nav-item:hover .sub-icon-wrap i,
.sub-nav-item:hover .sub-icon-wrap svg {
    opacity: 1;
    transform: scale(1.15);
}

.sub-nav-item.active {
    color: var(--brand-pro);
    font-weight: 600;
    background: rgba(var(--brand-pro-rgb), 0.12);
}

.sub-nav-item.active .sub-icon-wrap i,
.sub-nav-item.active .sub-icon-wrap svg {
    opacity: 1;
}

.sub-nav-label {
    margin-left: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    
    opacity: 0;
    transform: translateX(-12px);
    filter: blur(3px);
    transition: opacity calc(var(--sidebar-speed) * 0.7) ease,
                transform calc(var(--sidebar-speed) * 0.85) cubic-bezier(0.16, 1, 0.3, 1),
                filter calc(var(--sidebar-speed) * 0.7) ease;
}

.floating-sidebar:hover .sub-nav-label,
.floating-sidebar.is-expanded .sub-nav-label {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
    transition-delay: 0.05s;
}

/* Footer de Perfil con Despliegue hacia Arriba */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    position: relative;
    background: rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.user-sub-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    width: 100%;
    margin-bottom: 0;
    
    margin-left: 0;
    padding-left: 0;
    border-left: 2px solid transparent;
    
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.22s ease,
                margin-bottom 0.2s ease,
                margin-left var(--sidebar-speed) var(--sidebar-expand-easing),
                padding-left var(--sidebar-speed) var(--sidebar-expand-easing),
                border-color var(--sidebar-speed) ease;
}

.sidebar-footer.is-open .user-sub-container {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 8px;
}

.floating-sidebar:hover .sidebar-footer.is-open .user-sub-container,
.floating-sidebar.is-expanded .sidebar-footer.is-open .user-sub-container {
    margin-left: 26px;
    padding-left: 12px;
    border-left-color: var(--border-tree-line);
    width: calc(100% - 36px);
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-item);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    text-align: left;
    padding: 0;
    overflow: hidden;
}

.user-profile-trigger:hover,
.sidebar-footer.is-open .user-profile-trigger {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--border-highlight);
}

.user-avatar-container {
    width: 56px;
    min-width: 56px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-item);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 0.88rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.user-profile-trigger:hover .user-avatar-wrap {
    transform: scale(1.05);
}

.status-dot-online {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: var(--success);
    border: 2px solid var(--bg-sidebar);
    border-radius: 50%;
}

.user-info-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 12px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    
    opacity: 0;
    transform: translateX(-12px);
    filter: blur(3px);
    transition: opacity calc(var(--sidebar-speed) * 0.7) ease,
                transform calc(var(--sidebar-speed) * 0.85) cubic-bezier(0.16, 1, 0.3, 1),
                filter calc(var(--sidebar-speed) * 0.7) ease;
}

.floating-sidebar:hover .user-info-wrap,
.floating-sidebar.is-expanded .user-info-wrap {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
    transition-delay: 0.04s;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.74rem;
    color: var(--brand-pro);
    font-weight: 600;
}

.user-chevron {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-footer.is-open .user-chevron {
    transform: rotate(180deg);
    color: var(--text-primary);
}

/* Tooltip en modo colapsado */
.sidebar-tooltip {
    position: fixed;
    left: calc(var(--sidebar-width-collapsed) + 12px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 0.80rem;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-6px) scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 12000;
    white-space: nowrap;
}

.sidebar-tooltip.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Main Content */
.main-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    padding: 18px 24px;
    box-sizing: border-box;
    position: relative;
}

.page-body {
    width: 100%;
    min-width: 0;
}

.main-content.guest {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, var(--bg-sidebar) 0%, var(--bg-main) 100%);
    padding: 20px;
}


/* Page Header */
.page-header,
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1,
.panel-header h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    margin-bottom: 24px;
    gap: 16px;
}

/* ==========================================================================
   Infinite Horizontal Scrolling News Ticker (Marquee Loop)
   ========================================================================== */
.header-news-ticker {
    display: flex;
    align-items: center;
    height: 72px;
    flex: 1;
    min-width: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-news-ticker:hover {
    border-color: var(--border-highlight);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Flechas flotantes de navegación rápida en hover */
.ticker-hover-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s, background-color 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}

.ticker-hover-prev {
    left: 12px;
}

.ticker-hover-next {
    right: 12px;
}

.header-news-ticker:hover .ticker-hover-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.ticker-hover-nav:hover {
    background: var(--bg-input);
    border-color: var(--brand-pro);
    color: var(--brand-pro);
    transform: translateY(-50%) scale(1.1);
}

.ticker-hover-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.ticker-marquee-wrapper {
    display: flex;
    overflow: hidden;
    width: 100%;
    height: 100%;
    align-items: center;
}

.ticker-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.ticker-marquee-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 16px;
    flex-shrink: 0;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.88rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ticker-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
    transform: scale(1.02);
}

.ticker-divider {
    color: var(--border);
    font-size: 1rem;
    user-select: none;
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
}

.ticker-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ticker-badge-dollar {
    background: rgba(var(--brand-pro-rgb), 0.15);
    color: var(--brand-pro);
    border: 1px solid rgba(var(--brand-pro-rgb), 0.3);
}

.ticker-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: alertPulse 1.8s infinite;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.ticker-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ticker-dollar-prices {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.ticker-dollar-val {
    font-variant-numeric: tabular-nums;
}

.ticker-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ticker-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.ticker-trend-badge.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.ticker-trend-badge.trend-down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ticker-trend-badge.trend-neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.ticker-time-muted {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ticker-alert-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.ticker-alert-sub {
    font-size: 0.84rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ticker-badge-time {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ticker-text-clean {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Horizontal Notification Banner ("Mientras no estabas")
   ========================================================================== */
.notif-horizontal-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: visible;
}

.notif-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.notif-banner-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.notif-banner-title-wrap {
    display: flex;
    flex-direction: column;
}

.notif-banner-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-banner-sub {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.notif-banner-chips-track {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px 4px;
    scrollbar-width: thin;
}

.notif-banner-item {
    position: relative;
    flex-shrink: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.notif-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--chip-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notif-chip-btn:hover {
    border-color: var(--chip-color, var(--accent));
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.notif-chip-icon {
    width: 15px;
    height: 15px;
    color: var(--chip-color, var(--accent));
    flex-shrink: 0;
}

.notif-chip-label {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-chip-time {
    font-size: 0.70rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.notif-chip-check-btn {
    background: transparent;
    border: none;
    padding: 2px 4px;
    margin: 0;
    margin-left: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-chip-check-btn:hover {
    background-color: rgba(16, 185, 129, 0.2);
    transform: scale(1.22);
}

.notif-chip-check-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    opacity: 0.65;
    transition: opacity 0.15s, color 0.15s;
}

.notif-chip-check-btn:hover .notif-chip-check-icon,
.notif-chip-btn:hover .notif-chip-check-icon {
    opacity: 1;
    color: var(--success);
}

/* Hover Popover Tooltip */
.notif-chip-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.notif-chip-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-highlight);
}

.notif-banner-item:hover .notif-chip-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.notif-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.notif-popover-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.notif-popover-time {
    font-size: 0.70rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.notif-popover-body p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.notif-popover-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.notif-popover-action-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notif-banner-actions {
    flex-shrink: 0;
}

.notif-banner-item.dismissing {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
}

/* Modal / Quick View del Dólar Blue */
.dialog-dollar-quickview .dialog-body {
    max-height: 85vh;
    overflow-y: auto;
}

.dollar-modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.dollar-stat-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dollar-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.dollar-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.dollar-stat-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.dollar-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dollar-history-table th {
    background: var(--bg-main);
    color: var(--text-muted);
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border);
}

.dollar-history-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.dollar-history-table tr:last-child td {
    border-bottom: none;
}

.dollar-history-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.flash-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.flash-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
    border: 1px solid transparent;
    transition: opacity 0.3s, transform 0.3s;
}

.flash-compact-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.flash-compact-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.flash-compact-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.flash-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: inherit;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s;
}

[data-theme="dark"] .flash-close {
    background: rgba(255, 255, 255, 0.1);
}

.flash-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .flash-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-container-guest {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 20%;
    max-width: 400px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 6px 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.settings-trigger {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
}

.settings-trigger:hover {
    background: var(--border);
    color: var(--text-primary);
}

.login-business-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.login-business-logo img.business-logo-img {
    width: 28px;
    height: auto;
    object-fit: contain;
    /* CSS filter hack to make dark SVGs white while keeping red colors red */
    filter: invert(1) hue-rotate(180deg) brightness(1.3);
}

[data-theme="light"] .login-business-logo img.business-logo-img {
    filter: none;
}

.login-business-logo .business-text {
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    font-weight: 600;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
}

.muted {
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Panel */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

/* Evitar que los dropdowns se corten cuando hay pocos resultados */
@media screen and (min-width: 1024px) {
    .table-wrap {
        overflow: visible;
    }
}

@media screen and (max-width: 1023px) {
    .panel:has(table) {
        min-height: 450px;
    }

    .panel:has(table) .table-wrap {
        min-height: 350px;
    }
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field-span-2 {
    grid-column: span 2;
}

.field-span-full {
    grid-column: 1 / -1;
}

/* Layout de 2 columnas para formularios largos */
.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .form-columns {
        grid-template-columns: 1fr;
    }
}

.form-grid label,
.form-grid .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]):not([type="range"]):not([type="color"]),
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    cursor: pointer;
}


input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.button-primary {
    background: var(--accent);
    color: white;
}

.button-primary:hover {
    background: var(--accent-hover);
}

.button-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background: var(--border);
}

.button-brand-outline,
.btn-brand-outline {
    background: var(--bg-input, #101827) !important;
    color: var(--brand-pro) !important;
    border: 1px solid var(--brand-pro) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.button-brand-outline:hover,
.btn-brand-outline:hover {
    background: rgba(var(--brand-pro-rgb, 13, 148, 136), 0.18) !important;
    border-color: var(--brand-pro) !important;
    color: var(--brand-pro) !important;
    transform: translateY(-1px);
}

.button-accent {
    background: #8b5cf6;
    color: white;
}

.button-accent:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.button-danger {
    background: var(--danger);
    color: white;
}

.button-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.button-link {
    background: transparent;
    color: var(--accent);
    padding: 4px 8px;
}

.button-link:hover {
    text-decoration: underline;
}

.button-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.button-block {
    width: 100%;
    display: flex;
}

/* Badge */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-activo {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-inactivo {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-tasacion {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-oferta_compra {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-reservado {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-vendido {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-alquilado {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Flash Messages */
.flash {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.flash-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Estilos compactos para tablas de detalles de ofertas */
.show-table-compact {
    width: 100%;
    border-collapse: collapse;
}

.show-table-compact td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.show-table-compact tr:last-child td {
    border-bottom: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 6px 12px;
    /* Reducido drasticamente para filas mas compactas */
    border-bottom: 1px solid var(--border);
    text-align: left;
    height: 40px;
    /* Forzar altura minima compacta */
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: default;
    height: 40px;

}

.table-actions form {
    display: flex;
    margin: 0;
    padding: 8.5px 10px;
}

/* Filter Bar */
.filters-bar {
    /*    display: flex; */
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    align-items: flex-end;
}

.filters-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.filter-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    min-width: 210px;
}

.filter-search-wrap .filter-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-search-wrap input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.filter-search-wrap input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.filter-date-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 8px 0 10px;
    height: 40px;
    gap: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.filter-date-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.filter-date-wrap .filter-label-prefix {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    white-space: nowrap;
}

.filter-date-wrap input[type="date"] {
    background: transparent;
    border: none;
    padding: 0;
    height: 100%;
    font-size: 0.84rem;
    color: var(--text-primary);
    width: 120px;
    cursor: pointer;
}

.filter-date-wrap input[type="date"]:focus {
    outline: none;
    border: none;
}

.filter-tasador,
.filter-type {
    display: flex;
    flex-direction: column;
    width: 180px;
    min-width: 150px;
    flex-shrink: 0;
}

.filters-row .button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    font-size: 0.86rem;
    font-weight: 600;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.filters-bar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filters-bar label span {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Sortable */
.sortable {
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    user-select: none;
}

.sortable:hover {
    background: var(--accent-light);
}

.sort-icon {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.4;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.sortable.active {
    color: var(--accent);
    font-weight: 600;
}

.sortable.active .sort-icon {
    opacity: 1;
}

/* Detail List */
.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-list div {
    display: grid;
    gap: 4px;
}

dt {
    color: var(--text-muted);
    font-size: 0.85rem;
}

dd {
    margin: 0;
    color: var(--text-primary);
}

/* Custom Multiselect */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-header {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    height: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 6px;
    user-select: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.multiselect-header:hover {
    border-color: var(--accent);
}

.multiselect-header:focus-visible {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.multiselect-header .placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.multiselect-header .arrow {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(100% - 20px);
    overflow: hidden;
}

.tag,
.selected-tags .tag {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
}

.tag .btn-remove {
    cursor: pointer;
    opacity: 0.65;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    transition: opacity 0.15s ease;
}

.tag .btn-remove:hover {
    opacity: 1;
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: none;
    padding: 4px 0;
}

.multiselect-dropdown.show {
    display: block !important;
}

.multiselect-option {
    padding: 8px 12px;
    font-size: 0.86rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.multiselect-option:hover {
    background: var(--accent-light);
}

.multiselect-option.selected {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    font-size: 1.1rem;
    padding: 6px 10px;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 150px;
    z-index: 100;
    padding: 4px;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--accent-light);
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown.dropup .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

/* Auth Card */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: authFadeIn 0.5s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-logo img.auth-favicon {
    width: 64px;
    height: auto;
}

.auth-logo img.auth-logo-sub {
    width: 48px;
    height: auto;
    margin-top: 4px;
}

.auth-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-brand span {
    color: var(--brand-pro);
}

.login-business-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.login-business-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    /* Filtro CSS para volver el logo blanco */
    filter: invert(1) hue-rotate(180deg) brightness(3);
}

[data-theme="light"] .login-business-logo {
    filter: none;
}

.login-business-container .eyebrow {
    margin-bottom: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.card-muted {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Split Grid */
.split-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Help & Error Text */
.error-text {
    color: var(--danger);
    font-size: 0.85rem;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination-link:hover:not(.disabled) {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: auto;
}

/* Actions */
.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Stack */
.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack-lg {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.subsection {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* Animations */
@keyframes popTag {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.print-only {
    display: none !important;
}

/* Print */
@media print {

    /* Ocultar elementos innecesarios */
    .noprint,
    .print-hidden,
    .detail-sub-icon,
    .detail-icon,
    .badge-pendiente,
    .sidebar,
    .sidebar-placeholder,
    .floating-sidebar,
    #floating-sidebar,
    .sidebar-tooltip,
    .sidebar-toggle,
    .sidebar-nav,
    aside,
    .eyebrow,
    .pagination,
    .offcanvas-overlay,
    .offcanvas-drawer,
    .modal-overlay,
    .modal-container,
    dialog.app-dialog,
    dialog.app-dialog::backdrop,
    .floating-dock-container,
    .dock-sensor-area,
    #app-floating-dock,
    .top-bar,
    .header-news-ticker,
    .flash-container,
    .flash-compact,
    .user-profile-wrapper,
    .button,
    button,
    form[action*="accept"],
    form[action*="reject"],
    #global-offcanvas-overlay,
    #global-offcanvas-drawer,
    #global-modal-overlay,
    #global-workspace-dialog,
    #system-confirm-dialog,
    #document-viewer-dialog,
    #calendar-dialog,
    #modal-revoke-dialog,
    #document-viewer-modal {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Reset global de alturas para impresión limpia */
    html,
    body {
        background: #fff !important;
        background-color: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Contenedor principal */
    .app-shell {
        display: block !important;
        background: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        background: #fff !important;
    }

    .page-body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .panel {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .table-wrap {
        overflow: visible !important;
    }

    /* Forzar texto negro y fondos blancos en todo el documento para evitar escalas de grises */
    * {
        color: #000 !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Tabla MonocromÃ¡tica */
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        margin-top: 20px;
    }

    th,
    td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        text-align: left !important;
    }

    th {
        font-weight: bold !important;
    }

    /* Encabezado */
    h2 {
        margin-top: 0;
        font-size: 18pt;
        font-weight: bold !important;
    }

    /* Destacar filas prioritarias en monocromo (Negrita y borde grueso) */
    .row-priority td {
        font-weight: bold !important;
        border-top: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
    }

    /* Badges Monocromaticos */
    .badge {
        display: inline-block !important;
        border: 1px solid #000 !important;
        border-radius: 4px !important;
        padding: 2px 6px !important;
        font-size: 8pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }

    .print-only {
        display: inline-block !important;
    }

    /* --- Estilos específicos para la impresión de Acuerdos Comerciales (Vista Detallada) --- */
    @page {
        size: Legal portrait;
        margin: 8mm 10mm;
    }

    .print-container .panel.info-panel-print {
        border: 1px solid #000000 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 4px 12px !important;
        color: #000000 !important;
        margin-bottom: 10px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-container .panel-header {
        border-bottom: 1px solid #000000 !important;
    }

    .print-container .panel.info-panel-print h2 {
        font-size: 1.15rem !important;
        margin-bottom: 4px !important;
    }

    .print-container .panel.info-panel-print h3 {
        font-size: 0.95rem !important;
        margin-bottom: 4px !important;
    }

    .print-container .panel.info-panel-print h4 {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }

    .print-container .show-table-compact td {
        padding: 2px 6px !important;
        font-size: 12px !important;
        border-bottom: 1px solid #000000 !important;
    }

    .print-container .print-header-formal {
        display: block !important;
        padding-bottom: 2px !important;
        margin-bottom: 2px !important;
    }

    .print-container .print-signatures-row {
        display: flex !important;
        page-break-inside: avoid;
        margin-top: 60px !important;
    }

    .print-container .form-columns {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        margin-bottom: 5px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-container .form-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .print-container a {
        text-decoration: none !important;
    }

    .print-container .print-header-formal table,
    .print-container .print-header-formal tr,
    .print-container .print-header-formal td {
        border: none !important;
        padding: 0 !important;
    }

    .print-container .signature-box {
        border-top: 1px solid #000000 !important;
    }
}

/* Mobile */
@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
    }

    .split-grid,
    .detail-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .field-span-full {
        grid-column: auto;
    }

    .main-content {
        padding: 20px;
    }
}

/* Skeleton Loader */
.skeleton-row {
    display: none;
}

.skeleton-row.active {
    display: table-row;
}

.skeleton-box {
    height: 38px;
    background-color: var(--bg-input);
    border-radius: var(--radius-sm);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.skeleton-box::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.05) 20%,
            rgba(255, 255, 255, 0.1) 60%,
            rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.5s infinite;
}

[data-theme="light"] .skeleton-box::after {
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.5) 20%,
            rgba(255, 255, 255, 0.7) 60%,
            rgba(255, 255, 255, 0) 100%);
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.w-30 {
    width: 30%;
}

.w-40 {
    width: 40%;
}

.w-50 {
    width: 50%;
}

.w-60 {
    width: 60%;
}

.w-70 {
    width: 70%;
}

.w-80 {
    width: 80%;
}

.w-90 {
    width: 90%;
}


/* Signage Priority */
.row-priority {
    background-color: #ff000050 !important;
}

.row-priority td {
    border-top: 1px solid #ff000050 !important;
    border-bottom: 1px solid #ff000050 !important;
}

/* Integration Manual Link */
.manual-link-wrapper {
    position: relative;
    display: inline-block;
}

.manual-link-search-box {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: var(--radius-sm);
    width: 300px;
    box-shadow: var(--shadow);
}

.manual-link-input {
    width: 100%;
    margin-bottom: 8px;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.search-result-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.search-result-item:hover {
    background: var(--accent-light);
}

/* Key Board Virtual */
.key-board-container {
    background: var(--bg-paper);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.key-grid-wrapper {
    display: grid;
    grid-template-columns: 40px repeat(6, 1fr);
    gap: 15px;
    min-width: 800px;
}

.grid-header-cell {
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.grid-row-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.key-hook {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.key-hook:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.key-hook.occupied {
    background: var(--bg-paper);
    border: 1px solid var(--brand-pro);
    border-left: 4px solid var(--brand-pro);
    border-style: solid;
}

.key-hook.withdrawn {
    border-left: 4px solid var(--warning);
    border-style: solid;
    background: rgba(245, 158, 11, 0.25);
    opacity: 0.8;
}

.key-hook.available {
    border-left: 4px solid var(--success);
    border-style: solid;
    background: rgba(16, 185, 129, 0.15);
}

.hook-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hook-content {
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hook-address {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    transition: color 0.15s ease;
}

.key-hook:hover .hook-address {
    color: var(--brand-pro);
}

.hook-withdrawn-tag {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hook-withdrawn-tag svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.hook-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

/* Leyenda del Tablero de Llaves */
.key-board-legend {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.legend-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-group-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-primary);
    background: var(--bg-main);
    border: 1px solid var(--border);
}

.legend-chip-in-slot .chip-slot-bar {
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--success);
}

.legend-chip-withdrawn .chip-withdrawn-bar {
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--warning);
}

.legend-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
}

/* Micro-pills de Estado Comercial del Inmueble (Opacas y Sólidas) */
.prop-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.64rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    user-select: none;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.prop-status-pill .pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Verde: Activo (Fondo verde bosque oscuro sólido, claramente diferenciado del fondo de la tarjeta) */
.prop-status-pill.prop-pill-success {
    background: #042419;
    color: #a7f3d0;
    border: 1px solid #047857;
}
.prop-status-pill.prop-pill-success .pill-dot {
    background: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.9);
}

/* Ámbar: Reserva / Acuerdo (Fondo marrón ámbar sólido) */
.prop-status-pill.prop-pill-warning {
    background: #2e1704;
    color: #fde68a;
    border: 1px solid #92400e;
}
.prop-status-pill.prop-pill-warning .pill-dot {
    background: #f59e0b;
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.9);
}

/* Rojo: Vendido / Inactivo (Fondo borgoña oscuro sólido, elimina contraste sucio con el verde) */
.prop-status-pill.prop-pill-danger {
    background: #2d0c11;
    color: #fca5a5;
    border: 1px solid #991b1b;
}
.prop-status-pill.prop-pill-danger .pill-dot {
    background: #ef4444;
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.9);
}

/* Muted: Otros (Fondo pizarra oscuro sólido) */
.prop-status-pill.prop-pill-muted {
    background: #182030;
    color: #cbd5e1;
    border: 1px solid #334155;
}
.prop-status-pill.prop-pill-muted .pill-dot {
    background: #94a3b8;
}

/* Modo Claro: Overrides sólidos de alto contraste */
:root[data-theme="light"] .prop-status-pill.prop-pill-success {
    background: #ecfdf5;
    border-color: #059669;
    color: #065f46;
}
:root[data-theme="light"] .prop-status-pill.prop-pill-warning {
    background: #fffbeb;
    border-color: #d97706;
    color: #92400e;
}
:root[data-theme="light"] .prop-status-pill.prop-pill-danger {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}
:root[data-theme="light"] .prop-status-pill.prop-pill-muted {
    background: #f8fafc;
    border-color: #64748b;
    color: #334155;
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.bg-brand {
    background-color: var(--brand-pro) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

.hook-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.key-hook:hover .hook-actions {
    opacity: 1;
}

.btn-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-input);
}

.btn-mini.text-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-mini.text-success:hover {
    border-color: var(--success);
    color: var(--success);
}

/* --- Master Table (Excel Mode) --- */
.master-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.badge-excel {
    background: #107c41;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.master-table-container {
    width: 100%;
    overflow-x: auto;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #1e293b;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
}

.master-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Fira Code', monospace, sans-serif;
    font-size: 11px;
    color: #94a3b8;
}

.master-table th {
    background: #1e293b;
    color: #f8fafc;
    text-align: left;
    padding: 10px 8px;
    border: 1px solid #334155;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.master-table td {
    padding: 4px 8px;
    border: 1px solid #334155;
    white-space: nowrap;
}

.master-table tr:hover {
    background: #1e293b;
}

.sync-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-synced {
    background: #10b981;
    box-shadow: 0 0 5px #10b981;
}

.status-local {
    background: #f59e0b;
}

.cell-id {
    color: #6366f1;
    font-weight: bold;
}

.cell-crm {
    color: #10b981;
    font-family: monospace;
}

.cell-status-activo {
    color: #10b981;
}

.cell-status-inactivo {
    color: #ef4444;
}

.cell-status-tasacion {
    color: #3b82f6;
}

.cell-status-oferta_compra {
    color: var(--warning);
}

.cell-status-reservado {
    color: #3b82f6;
}

.cell-status-vendido {
    color: #10b981;
}

/* --- User Profile Dropdown --- */
.user-profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile:hover {
    background: var(--bg-input);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
    animation: slideInDown 0.2s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}


/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px 16px;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--bg-card);
    margin: auto;
    padding: 24px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 500px;
    max-height: min(85vh, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Leads Call Helper */
.option-pills {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.option-pills.selected {
    background: var(--accent-call);
    color: white;
    border-color: var(--accent-call);
}

/* Utility Classes */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.w-full,
.w-100 {
    width: 100%;
}

.max-w-600 {
    max-width: 600px;
    margin: 0 auto;
}

.p-16 {
    padding: 16px;
}

.p-24 {
    padding: 24px;
}

.p-large {
    padding: 12px 30px;
}

.ml-20 {
    margin-left: 20px;
}

.ml-auto {
    margin-left: auto;
}

.mt-25 {
    margin-top: 25px;
}

.d-flex {
    display: flex;
}

.d-inline {
    display: inline;
}

.d-block {
    display: block;
}

.align-items-center {
    align-items: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.gap-8 {
    gap: 8px;
}

.gap-15 {
    gap: 15px;
}

.font-size-sm {
    font-size: 0.95rem;
}

.font-size-base {
    font-size: 1rem;
}

.font-size-lg {
    font-size: 1.2rem;
}

.font-size-small {
    font-size: 0.85rem;
}

.font-size-xs {
    font-size: 0.7rem;
}

.font-weight-500 {
    font-weight: 500;
}

.font-weight-normal {
    font-weight: normal;
}

.color-secondary {
    color: var(--text-secondary);
}

.bg-input {
    background: var(--bg-input);
}

.bg-success-light {
    background: rgba(16, 185, 129, 0.1);
}

.bg-muted-light {
    background: rgba(107, 114, 128, 0.05);
}

.border-success {
    border-color: var(--success);
}

.border-danger {
    border-color: var(--danger);
}

.border-warning {
    border-color: var(--warning);
}

.border-muted {
    border-color: var(--text-muted);
}

.border-accent {
    border: 1px solid var(--brand-pro);
}

.color-success-dark {
    color: #065f46;
}

.py-8 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.px-20 {
    padding-left: 20px;
    padding-right: 20px;
}

.border-radius-pill {
    border-radius: 999px;
}

.border-radius-lg {
    border-radius: var(--radius-lg);
}

.border {
    border: 1px solid var(--border);
}

.border-top-dashed {
    border-top: 1px dashed var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.shadow-success {
    box-shadow: 0 0 8px var(--success);
}

.shadow-warning {
    box-shadow: 0 0 8px var(--warning);
}

.line-height-tight {
    line-height: 1.2;
}

.opacity-30 {
    opacity: 0.3;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-70 {
    opacity: 0.7;
}

.opacity-100 {
    opacity: 1;
}

.text-accent {
    color: var(--brand-pro);
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--text-primary);
}

.text-decoration-none {
    text-decoration: none;
}

.icon-small {
    width: 14px;
    height: 14px;
}

.grid-cols-2 {
    grid-template-columns: 1fr 1fr;
}




/* Margins */
.ml-10 {
    margin-left: 10px;
}

.mr-10 {
    margin-right: 10px;
}

/* Display */
.d-none {
    display: none;
}

/* ==========================================================================
   LEAD CALL HELPER - PORTOFINO
   ========================================================================== */
.call-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s;
}

.call-step {
    display: none;
}

.call-step.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
    }
}

.call-script {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
    background: var(--bg-input);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 5px solid var(--accent);
    margin-bottom: 25px;
    margin-top: 15px;
    color: var(--text-primary);
}

.minuta {
    width: 100%;
    height: 250px;
    font-family: monospace;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    box-sizing: border-box;
}

.call-footer {
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    gap: 15px;
}

.call-footer>.button {
    flex: 1;
}

/* Row Hover & Pointer */
tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

tbody tr:hover {
    background-color: var(--accent-light);
}


/* ==========================================================================
   OFFCANVAS DRAWER
   ========================================================================== */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.offcanvas-overlay.show {
    opacity: 1;
    visibility: visible;
}

.offcanvas-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.offcanvas-drawer.offcanvas-drawer-wide {
    max-width: 900px;
    width: 65vw;
}

@media (max-width: 992px) {
    .offcanvas-drawer.offcanvas-drawer-wide {
        max-width: 100%;
        width: 100%;
    }
}

.lead-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    white-space: nowrap;
}

.lead-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.2s ease;
    user-select: none;
}

.lead-tag-chip:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.lead-tag-chip.active {
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.color-swatch-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    outline: none;
}

.color-swatch-btn:hover {
    transform: scale(1.18);
}

.color-swatch-btn.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--brand-pro, #3b82f6);
    transform: scale(1.12);
}

.quick-view-2col-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 850px) {
    .quick-view-2col-grid {
        grid-template-columns: 1fr;
    }
}

.offcanvas-drawer.show {
    transform: translateX(0);
}

.offcanvas-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offcanvas-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.offcanvas-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offcanvas-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.offcanvas-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Skeleton Loading & Enhanced Shimmer System */
.skeleton {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, var(--bg-input) 0%, var(--border) 50%, var(--bg-input) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer-wave 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
    display: block;
}

[data-theme="light"] .skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer-wave 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-box {
    border-radius: var(--radius);
}

.skeleton-avatar {
    border-radius: 50%;
}

.skeleton-pill {
    border-radius: 9999px;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.skeleton-text {
    height: 20px;
    margin-bottom: 12px;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.title {
    height: 28px;
    width: 40%;
    margin-bottom: 24px;
}

/* ==========================================================================
   NATIVE HTML5 DIALOG SYSTEM & TOP-LAYER MODALS
   ========================================================================== */
dialog.app-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 92vw;
    max-height: 90vh;
    width: auto;
    overflow: hidden;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.96) translateY(8px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                overlay 0.25s allow-discrete,
                display 0.25s allow-discrete;
    z-index: 10000;
}

dialog.app-dialog:not([open]) {
    display: none !important;
    pointer-events: none !important;
}

dialog.app-dialog[open] {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

@starting-style {
    dialog.app-dialog[open] {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
}

dialog.app-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease,
                backdrop-filter 0.25s ease,
                overlay 0.25s allow-discrete,
                display 0.25s allow-discrete;
}

dialog.app-dialog[open]::backdrop {
    opacity: 1;
}

@starting-style {
    dialog.app-dialog[open]::backdrop {
        opacity: 0;
    }
}

/* Modificadores de Tamaño para Diálogos */
dialog.app-dialog.dialog-confirm {
    max-width: 440px;
    width: 92%;
    border-top: 4px solid var(--brand-pro, #67bab8);
}

dialog.app-dialog.dialog-medium {
    max-width: 600px;
    width: 92%;
}

dialog.app-dialog.dialog-wide {
    max-width: 850px;
    width: 92%;
}

dialog.app-dialog.dialog-workspace {
    max-width: 1080px;
    width: 86vw;
    height: auto;
    max-height: 88vh;
}

@media (max-width: 992px) {
    dialog.app-dialog.dialog-workspace {
        width: 96vw;
        height: auto;
        max-height: 94vh;
    }
}

dialog.app-dialog.dialog-document-viewer {
    max-width: 1150px;
    width: 90vw;
    height: 90vh;
    max-height: 90vh;
}

dialog.app-dialog.dialog-calendar {
    max-width: 1240px;
    width: 92vw;
    height: 90vh;
    max-height: 90vh;
}

/* Estructura Interna del Diálogo */
.dialog-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    flex-shrink: 0;
    gap: 12px;
}

.dialog-header h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dialog-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dialog-btn-action {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dialog-btn-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.dialog-btn-action.btn-dialog-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger, #ef4444);
}

.dialog-body {
    padding: 20px 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dialog-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    flex-shrink: 0;
}

/* ==========================================================================
   FLOATING PSEUDO-OS DOCK (BARRA INFERIOR DE MINIMIZADOS AUTO-OCULTABLE)
   ========================================================================== */
.floating-dock-container {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 30px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s;
    pointer-events: auto;
    max-width: 90vw;
    overflow-x: auto;
}

[data-theme="light"] .floating-dock-container {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.floating-dock-container.dock-hidden {
    transform: translateX(-50%) translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.floating-dock-container.dock-empty {
    display: none !important;
}

/* Zona de detección para re-desplegar dock (gestionada por mousemove pasivo) */
.dock-sensor-area {
    display: none !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

.dock-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    white-space: nowrap;
}

[data-theme="light"] .dock-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--brand-pro, #67bab8);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .dock-item:hover {
    background: rgba(103, 186, 184, 0.15);
    border-color: var(--brand-pro, #67bab8);
}

.dock-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-pro, #67bab8);
}

.dock-item-title {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dock-item-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    transition: all 0.15s ease;
    margin-left: 2px;
}

.dock-item-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.15);
}

/* ==========================================================================
   NATIVE POPOVER API SUPPORT (DROPDOWNS & FLYOUTS)
   ========================================================================== */
[popover] {
    position: fixed;
    inset: unset;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    padding: 0;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.2s ease,
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                overlay 0.2s allow-discrete,
                display 0.2s allow-discrete;
    z-index: 99995;
}

[popover]:popover-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@starting-style {
    [popover]:popover-open {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

[popover]::backdrop {
    background: transparent;
}

/* ==========================================================================
   PROPERTY QUICK VIEW SHOWCASE (MODAL & CAROUSEL)
   ========================================================================== */
.property-quick-showcase {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 22px;
    align-items: start;
}

@media (max-width: 860px) {
    .property-quick-showcase {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.property-quick-header-block {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.property-quick-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin: 0;
}

.property-quick-badges-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.property-quick-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    border-radius: 999px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    height: 26px !important;
}

.property-quick-badge i,
.property-quick-badge svg {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.property-quick-badge span {
    display: inline-block !important;
    line-height: 1 !important;
}

.property-quick-badge .status-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.property-quick-badge.badge-venta {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.property-quick-badge.badge-alquiler {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.property-quick-badge.badge-tipo {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.property-quick-badge.badge-status {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.property-quick-badge .status-dot.status-activo {
    background: var(--success, #10b981);
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}

.property-quick-badge .status-dot.status-inactivo {
    background: var(--danger, #ef4444);
}

.property-quick-badge .status-dot.status-reservado,
.property-quick-badge .status-dot.status-pendiente {
    background: var(--warning, #f59e0b);
}

/* Carrusel de Fotos */
.property-quick-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    background: var(--bg-card-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    user-select: none;
}

.property-quick-carousel .carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.property-quick-carousel .carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.property-quick-carousel .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-quick-carousel .carousel-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(0,0,0,0.15));
    gap: 8px;
}

.property-quick-carousel .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
    pointer-events: auto;
}

.property-quick-carousel .carousel-btn:hover {
    background: var(--brand-pro, #3b82f6);
    transform: translateY(-50%) scale(1.1);
    color: #ffffff;
}

.property-quick-carousel .carousel-btn.prev {
    left: 10px;
}

.property-quick-carousel .carousel-btn.next {
    right: 10px;
}

.property-quick-carousel .carousel-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.property-quick-carousel .carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.property-quick-carousel .carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.2s ease;
}

.property-quick-carousel .carousel-dot.active {
    width: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Columna Derecha de Detalles */
.quick-details-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quick-location-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quick-location-address {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.quick-location-address i,
.quick-location-address svg {
    display: block;
    flex-shrink: 0;
}

.quick-location-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 24px;
}

.quick-price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-sm);
}

.quick-price-main {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--brand-pro, #3b82f6);
    letter-spacing: -0.02em;
    line-height: 1;
}

.quick-price-tasacion {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Grilla de Ambientes */
.quick-rooms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 500px) {
    .quick-rooms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quick-room-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.quick-room-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.quick-room-card i,
.quick-room-card svg {
    color: var(--accent, #3b82f6);
    width: 18px;
    height: 18px;
    display: block;
    margin: 0 auto;
}

.quick-room-card .room-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.quick-room-card .room-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Píldoras de Superficie */
.quick-surface-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-surface-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1;
}

.quick-surface-pill i,
.quick-surface-pill svg {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
}

.quick-surface-pill strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Chips de Servicios y Comodidades en Quick View */
.quick-features-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.quick-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.15s ease;
    user-select: none;
}

.quick-feature-chip.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

.quick-feature-chip.active i,
.quick-feature-chip.active svg {
    color: var(--accent);
}

.quick-feature-chip.inactive {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
    opacity: 0.45;
}

.quick-feature-chip.inactive i,
.quick-feature-chip.inactive svg {
    color: var(--text-muted);
}

/* Caja de Descripción con Toggle */
.quick-description-wrapper {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.quick-description-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 90px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
    white-space: pre-line;
}

.quick-description-text.expanded {
    max-height: 400px;
    overflow-y: auto;
}

.quick-description-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 0 0 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quick-description-toggle:hover {
    text-decoration: underline;
}

/* Contacto Propietario */
.quick-owner-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Documentos / Adjuntos debajo de galería */
.quick-docs-container {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Compatibilidad con modales legados */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: min(85vh, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-container > form,
.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Options Cards for Revoke Modal */
.revoke-status-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border, #334155);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.revoke-status-option:hover {
    border-color: var(--brand-pro, #67bab8);
    background: var(--bg-hover, rgba(255, 255, 255, 0.03));
}

.revoke-status-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-pro, #67bab8);
    cursor: pointer;
    flex-shrink: 0;
}

.revoke-status-option:has(input[type="radio"]:checked) {
    border-color: var(--brand-pro, #67bab8);
    background: var(--bg-hover, rgba(103, 186, 184, 0.08));
    box-shadow: 0 0 0 1px var(--brand-pro, #67bab8);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-scrollable-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
}

.modal-scrollable-body::-webkit-scrollbar {
    width: 6px;
}

.modal-scrollable-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scrollable-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-scrollable-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}


/* ==========================================================================
   INTERACTIVE CARTEL SELECT BADGES
   ========================================================================== */
.select-badge {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 24px 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    color: var(--text-primary);
    background-color: var(--bg-input);
    font-family: inherit;
    line-height: inherit;
}

[data-theme="dark"] .select-badge {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] .select-badge,
:root:not([data-theme]) .select-badge {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.select-badge.badge-activo {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: var(--success) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.select-badge.badge-inactivo {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.select-badge:hover {
    border-color: var(--accent);
}

.select-badge:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* Transición para ocultar fila de cartelería tras actualización */
.row-fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Estilos para la tabla de carteleria */
#carteles-table tbody tr {
    cursor: pointer;
    transition: background-color 0.18s ease;
}

#carteles-table tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

#carteles-table tbody tr.row-priority {
    background-color: rgba(245, 158, 11, 0.08) !important;
    background-color: color-mix(in srgb, var(--warning) 10%, transparent) !important;
    border-left: 4px solid var(--warning) !important;
}

#carteles-table tbody tr.row-priority:hover {
    background-color: rgba(245, 158, 11, 0.18) !important;
    background-color: color-mix(in srgb, var(--warning) 18%, transparent) !important;
}

/* Autocomplete suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 99999 !important;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.nominatim-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: var(--accent, #3b82f6);
    border-radius: 50%;
    animation: nominatimSpin 0.7s linear infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes nominatimSpin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.autocomplete-suggestion {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover {
    background: var(--accent-light);
}

/* Print mode layout overrides (when printable version is rendered on screen) */
body.is-print .sidebar,
body.is-print .top-bar,
body.is-print .page-header {
    display: none !important;
}

body.is-print .main-content {
    margin-left: 0 !important;
    padding: 20px !important;
    width: 100% !important;
}

body.is-print .panel {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

/* Error Handler Styles */
.error-handler-page {
    --bg-dark-error: #0f172a;
    --card-bg-error: rgba(30, 41, 59, 0.7);
    --brand-color-error: #67bab8;
    --text-main-error: #f8fafc;
    --text-muted-error: #94a3b8;
    --border-color-error: rgba(255, 255, 255, 0.1);
    --error-bg-error: rgba(15, 23, 42, 0.6);
    --error-text-error: #f87171;
    --error-border-error: rgba(248, 113, 113, 0.2);
    --wa-color-error: #25D366;
    --wa-hover-error: #20ba59;

    background-color: var(--bg-dark-error) !important;
    background-image:
        radial-gradient(at 50% 0%, rgba(103, 186, 184, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.8) 0px, transparent 50%) !important;
    background-attachment: fixed !important;
    color: var(--text-main-error) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    overflow-x: hidden !important;
}

.error-handler-page .error-container {
    background: var(--card-bg-error) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-color-error) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    max-width: 680px !important;
    width: 100% !important;
    padding: 48px 40px !important;
    text-align: center !important;
    animation: modalScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.error-handler-page .warning-icon {
    width: 72px !important;
    height: 72px !important;
    color: #f87171 !important;
    background: rgba(248, 113, 113, 0.1) !important;
    border-radius: 50% !important;
    padding: 16px !important;
    margin: 0 auto 24px auto !important;
    box-shadow: 0 0 30px rgba(248, 113, 113, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.error-handler-page .notfound-icon {
    width: 72px !important;
    height: 72px !important;
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1) !important;
    border-radius: 50% !important;
    padding: 16px !important;
    margin: 0 auto 24px auto !important;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.error-handler-page h1 {
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 12px !important;
    color: #ffffff !important;
}

.error-handler-page .subtitle {
    color: var(--text-muted-error) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    margin-bottom: 32px !important;
}

.error-handler-page .terminal-box {
    background: var(--error-bg-error) !important;
    border: 1px solid var(--error-border-error) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    text-align: left !important;
    margin-bottom: 36px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.error-handler-page .terminal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
    font-size: 13px !important;
    color: var(--text-muted-error) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 600 !important;
}

.error-handler-page .terminal-body {
    font-family: 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: var(--error-text-error) !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

.error-handler-page .terminal-meta {
    margin-top: 16px !important;
    padding-top: 16px !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.05) !important;
    font-size: 13px !important;
    color: var(--text-muted-error) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.error-handler-page .meta-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.error-handler-page .meta-label {
    color: #cbd5e1 !important;
    font-weight: 500 !important;
}

.error-handler-page .actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (min-width: 600px) {
    .error-handler-page .actions {
        flex-direction: row !important;
    }
}

.error-handler-page .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 28px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    width: 100% !important;
}

@media (min-width: 600px) {
    .error-handler-page .btn {
        width: auto !important;
    }
}

.error-handler-page .btn-wa {
    background-color: var(--wa-color-error) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.4) !important;
}

.error-handler-page .btn-wa:hover {
    background-color: var(--wa-hover-error) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 30px -5px rgba(37, 211, 102, 0.5) !important;
}

.error-handler-page .btn-wa:active {
    transform: translateY(0) !important;
}

.error-handler-page .btn-home {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main-error) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.error-handler-page .btn-home:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

.error-handler-page .btn-home:active {
    transform: translateY(0) !important;
}

.error-handler-page .footer-brand {
    margin-top: 32px !important;
    font-size: 13px !important;
    color: var(--text-muted-error) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.error-handler-page .pro-badge {
    color: var(--brand-color-error) !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Módulo de Ofertas de Compra (Premium Styled Controls)
   ========================================================================== */

/* Autocomplete de Propiedades */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    font-size: 0.95rem;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* Selectores Segmentados (Segmented Controls) */
.custom-switch-title {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.segmented-control {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    width: 100%;
    gap: 4px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    border: none;
}

.segmented-control label:hover {
    color: var(--text-primary);
}

.segmented-control input[type="radio"]:checked+label {
    background: var(--accent);
    color: #ffffff;
    box-shadow: none !important;
}

/* Grid Conditional Fields style to keep layout stable */
.grid-conditional-field {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.grid-conditional-field.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

@media print {
    .grid-conditional-field:not(.show) {
        display: none !important;
    }
}

/* Range Slider con Progreso Dual (Escritura split) */
.split-slider-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 10px;
}

.split-slider-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.split-percentages {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.percentage-box {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    min-width: 120px;
}

.percentage-box.vendedor {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-align: left;
}

.percentage-box.vendedor strong {
    color: var(--danger);
    font-size: 1.5rem;
}

.percentage-box.comprador {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    text-align: right;
}

.percentage-box.comprador strong {
    color: var(--success);
    font-size: 1.5rem;
}

.percentage-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.split-bar-wrapper {
    position: relative;
    height: 12px;
    background: var(--danger);
    /* Fondo representa al vendedor */
    border-radius: 999px;
    width: 100%;
    overflow: visible;
}

.split-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--success);
    /* Progreso representa al comprador */
    border-radius: 999px 0 0 999px;
    transition: width 0.05s ease-out;
}

.split-range-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    z-index: 10;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: none;
}

.split-range-slider:focus {
    outline: none;
}

.split-range-slider::-webkit-slider-runnable-track {
    background: transparent;
    border: none;
}

.split-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease;
}

.split-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Checkbox Switch (iOS Style Toggle) */
.checkbox-switch-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 5px 0;
}

.checkbox-switch-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-switch-label {
    position: relative;
    padding-left: 62px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    user-select: none;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
}

.checkbox-switch-label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 26px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.3s ease;
    box-shadow: none !important;
}

.checkbox-switch-label::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: none !important;
}

.checkbox-switch-container input[type="checkbox"]:checked+.checkbox-switch-label::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none !important;
}

.checkbox-switch-container input[type="checkbox"]:checked+.checkbox-switch-label::after {
    left: 28px;
    background: #ffffff;
    box-shadow: none !important;
}

/* Tabs layout */
.tabs-container {
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 16px;
    position: relative;
}

.tab-link {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--brand-pro);
    border-bottom-color: var(--brand-pro);
}

/* Sliding active tab indicator styling */
.tabs:has(.tab-indicator) .tab-link {
    border-bottom-color: transparent !important;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--brand-pro);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Utilidades y Ajustes de Acuerdo Comercial */
.text-danger {
    color: var(--danger) !important;
}

/* Tooltips interactivos */
.tooltip {
    position: relative;
    display: inline-flex;
    cursor: help;
    margin-left: 6px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: var(--shadow);
    pointer-events: none;
    white-space: normal;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* RBAC and Users/Roles interface styles */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.permission-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.permission-card:hover {
    border-color: var(--brand-pro);
    background: var(--bg-card);
}

.permission-card input[type="checkbox"] {
    margin-top: 3px;
}

.permission-details {
    display: flex;
    flex-direction: column;
}

.permission-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.permission-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.category-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--brand-pro);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.user-roles-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.badge-role {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 99px;
    font-weight: 500;
}

/* ==========================================================================
   VISOR DE DOCUMENTOS GLOBAL
   ========================================================================== */
#document-viewer-modal .modal-container {
    max-width: 90%;
    width: 75vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

#document-viewer-modal .modal-body {
    flex: 1;
    padding: 0;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.doc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-pro);
    border-radius: 50%;
    animation: doc-spin 1s linear infinite;
}

@keyframes doc-spin {
    to {
        transform: rotate(360deg);
    }
}

#doc-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

#doc-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

/* Document deletion container styling in edit form */
.doc-edit-container {
    display: flex !important;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}

.doc-edit-label {
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-edit-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.btn-delete-doc {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.btn-delete-doc:hover {
    color: #b91c1c;
}

/* Detalle de Acuerdos Comerciales (show.php) - Modos Pantalla y Utilidades */
.print-container .offer-actions {
    display: flex;
    gap: 10px;
}

.print-container .offer-pending-alert {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.print-container .offer-pending-title {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.print-container .offer-status-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.print-container .offer-accept-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-container .offer-status-select {
    width: 140px;
    padding: 8px 12px;
}

.print-container .inline-form {
    display: inline-block;
}

.print-container .print-header-formal {
    display: none;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.print-container .print-header-table {
    width: 100%;
    border: none;
}

.print-container .print-header-logo-cell {
    border: none;
}

.print-container .print-header-title {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
}

.print-container .print-header-subtitle {
    font-size: 12px;
    color: #555;
}

.print-container .print-header-meta-cell {
    text-align: right;
    border: none;
    font-size: 12px;
}

.print-container .panel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.print-container .panel-section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.print-container .text-md {
    font-size: 0.9rem;
}

.print-container .offer-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.print-container .detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.print-container .detail-value {
    font-size: 1.05rem;
    font-weight: 600;
}

.print-container .detail-value.font-500 {
    font-weight: 500;
}

.print-container .detail-value.inline-flex {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.print-container .detail-link {
    color: var(--accent);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.print-container .detail-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.print-container .detail-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.print-container .detail-subtext-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.print-container .detail-sub-icon {
    width: 13px;
    height: 13px;
    color: var(--text-secondary);
}

.print-container .offer-columns-layout {
    gap: 20px;
    margin-bottom: 24px;
}

.print-container .panel-header-compact {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.print-container .panel-header-title-compact {
    font-size: 1.15rem;
    font-weight: 600;
}

.print-container .highlight-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.print-container .offer-payment-details {
    background: var(--bg-input);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-line;
}

.print-container .offer-observations-text {
    font-style: italic;
    line-height: 1.6;
    white-space: pre-line;
}

.print-container .print-signatures-row {
    display: none;
    justify-content: space-between;
    margin-top: 80px;
    padding: 0 40px;
}

.print-container .signature-box {
    text-align: center;
    width: 220px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.print-container .signature-title {
    font-size: 13px;
    font-weight: 600;
}

.print-container .signature-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.print-container .w-100 {
    width: 100%;
}

.print-container .w-35 {
    width: 35%;
}

.print-container .mb-24 {
    margin-bottom: 24px;
}

.print-container .mb-40 {
    margin-bottom: 40px;
}

.print-container .pt-12 {
    padding-top: 12px;
}

.print-container .no-margin-bottom {
    margin-bottom: 0;
}

/* ==========================================================================
   MODULO DE LOTEOS: MAPA INTERACTIVO Y LISTADO DE LOTES
   ========================================================================== */
.loteo-map-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 120px);
}

.loteo-map-wrapper {
    display: flex;
    gap: 20px;
    flex: 1;
    height: 100%;
}

.loteo-map-frame {
    flex: 1;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-sidebar);
}

#loteo-leaflet-map {
    width: 100%;
    height: 100%;
}

.loteo-details-panel {
    width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    line-height: 1.3;
}

.loteo-details-panel h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.loteo-details-block {
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border);
}

.loteo-details-block.available {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.loteo-details-block.reserved {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.loteo-details-block.sold {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.loteo-details-block.resale {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.loteo-details-block .title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.loteo-details-block .meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.loteo-details-block .label-val {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.loteo-details-block .label-val:last-child {
    margin-bottom: 0;
}

.loteo-details-block .label-val span:first-child {
    color: var(--text-secondary);
}

.loteo-details-block .label-val span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.loteo-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.loteo-chip.available {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.loteo-chip.reserved {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.loteo-chip.sold {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.loteo-chip.resale {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.loteo-chip.not-available {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

/* Leyenda del Mapa */
.loteo-legend {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loteo-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loteo-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Listado de Loteos */
.loteo-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.loteo-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.loteo-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

.loteo-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: 200px;
}

.loteo-badge-select {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    outline: none;
}

.loteo-badge-select.available {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.loteo-badge-select.reserved {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.loteo-badge-select.sold {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.loteo-badge-select.resale {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.loteo-badge-select.not-available {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.3);
}

/* Leads Dashboard Styles */
.dashboard-charts-leads {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media screen and (max-width: 1024px) {
    .dashboard-charts-leads {
        grid-template-columns: 1fr;
    }
}

.chart-container-wrapper {
    position: relative;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ==========================================================================
   TABS AND TIMELINE STYLES (Property History)
   ========================================================================== */
.tabs-container {
    margin-top: 10px;
}

.tabs-nav {
    display: flex;
    gap: 24px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-link {
    background: none;
    border: none;
    padding: 12px 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-bottom: -2px;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--brand-pro);
    font-weight: 600;
    border-bottom: 2px solid var(--brand-pro);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline Layout */
.timeline {
    position: relative;
    padding: 10px 0 10px 24px;
    border-left: 2px solid var(--border);
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -33px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

/* Different markers for event types */
.timeline-item.creacion .timeline-marker {
    border-color: #3b82f6;
    /* Blue */
    background-color: rgba(59, 130, 246, 0.1);
}

.timeline-item.cambio_estado .timeline-marker {
    border-color: #f59e0b;
    /* Yellow/Orange */
    background-color: rgba(245, 158, 11, 0.1);
}

.timeline-item.cambio_precio .timeline-marker {
    border-color: #10b981;
    /* Green */
    background-color: rgba(16, 185, 129, 0.1);
}

.timeline-item.cambio_propietario .timeline-marker {
    border-color: #8b5cf6;
    /* Purple */
    background-color: rgba(139, 92, 246, 0.1);
}

.timeline-item.venta .timeline-marker {
    border-color: #ef4444;
    /* Red */
    background-color: rgba(239, 68, 68, 0.1);
}

.timeline-item.edicion .timeline-marker {
    border-color: #6b7280;
    /* Gray */
    background-color: rgba(107, 114, 128, 0.1);
}

.timeline-content {
    background: var(--bg-input);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.timeline-content:hover {
    border-color: var(--brand-pro);
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timeline-author {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-values {
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: var(--font-mono, monospace);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-val-old {
    color: var(--danger);
    text-decoration: line-through;
}

.timeline-val-arrow {
    color: var(--text-muted);
}

.timeline-val-new {
    color: var(--success);
    font-weight: 600;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Estilo para eventos de cambio de llaves en el historial */
/* Leads Dashboard Styles */
.dashboard-charts-leads {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media screen and (max-width: 1024px) {
    .dashboard-charts-leads {
        grid-template-columns: 1fr;
    }
}

.chart-container-wrapper {
    position: relative;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ==========================================================================
   TABS AND TIMELINE STYLES (Property History)
   ========================================================================== */
.tabs-container {
    margin-top: 10px;
}

.tabs-nav {
    display: flex;
    gap: 24px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-link {
    background: none;
    border: none;
    padding: 12px 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-bottom: -2px;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--brand-pro);
    font-weight: 600;
    border-bottom: 2px solid var(--brand-pro);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline Layout */
.timeline {
    position: relative;
    padding: 10px 0 10px 24px;
    border-left: 2px solid var(--border);
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -33px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

/* Different markers for event types */
.timeline-item.creacion .timeline-marker {
    border-color: #3b82f6;
    /* Blue */
    background-color: rgba(59, 130, 246, 0.1);
}

.timeline-item.cambio_estado .timeline-marker {
    border-color: #f59e0b;
    /* Yellow/Orange */
    background-color: rgba(245, 158, 11, 0.1);
}

.timeline-item.cambio_precio .timeline-marker {
    border-color: #10b981;
    /* Green */
    background-color: rgba(16, 185, 129, 0.1);
}

.timeline-item.cambio_propietario .timeline-marker {
    border-color: #8b5cf6;
    /* Purple */
    background-color: rgba(139, 92, 246, 0.1);
}

.timeline-item.venta .timeline-marker {
    border-color: #ef4444;
    /* Red */
    background-color: rgba(239, 68, 68, 0.1);
}

.timeline-item.edicion .timeline-marker {
    border-color: #6b7280;
    /* Gray */
    background-color: rgba(107, 114, 128, 0.1);
}

.timeline-content {
    background: var(--bg-input);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.timeline-content:hover {
    border-color: var(--brand-pro);
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timeline-author {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-values {
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: var(--font-mono, monospace);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-val-old {
    color: var(--danger);
    text-decoration: line-through;
}

.timeline-val-arrow {
    color: var(--text-muted);
}

.timeline-val-new {
    color: var(--success);
    font-weight: 600;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Estilo para eventos de cambio de llaves en el historial */
.timeline-item.cambio_llave .timeline-marker {
    border-color: #0d9488;
    /* Teal */
    background-color: rgba(13, 148, 136, 0.1);
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN Y LIQUIDACIÓN DE COMISIONES
   ========================================================================== */
@media print {

    body.is-print,
    body.is-print .app-shell,
    .is-print {
        background: #ffffff !important;
        color: #111827 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .print-hidden,
    .sidebar-placeholder,
    .floating-sidebar,
    #floating-sidebar,
    .sidebar-tooltip,
    aside.sidebar,
    header.top-bar,
    .header-news-ticker,
    .floating-dock-container,
    .dock-sensor-area,
    #app-floating-dock,
    .flash-container,
    .flash-compact,
    .noprint,
    .page-header.print-hidden {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-shell {
        display: block !important;
        grid-template-columns: none !important;
        background: #ffffff !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
    }

    .page-body {
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .print-container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        color: #111827 !important;
    }

    .print-header-formal {
        display: block !important;
        border-bottom: 2px solid #111827 !important;
        padding-bottom: 12px !important;
        margin-bottom: 24px !important;
    }

    .print-header-formal * {
        color: #111827 !important;
    }

    .print-only {
        display: block !important;
    }

    .panel {
        background: #ffffff !important;
        border: 1px solid #9ca3af !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        padding: 16px !important;
        page-break-inside: avoid !important;
        color: #111827 !important;
    }

    .panel h3,
    .panel h2 {
        color: #111827 !important;
        border-bottom: 1px solid #9ca3af !important;
    }

    .table-wrap,
    table {
        border-collapse: collapse !important;
        width: 100% !important;
        color: #111827 !important;
    }

    th,
    td {
        border-bottom: 1px solid #d1d5db !important;
        color: #111827 !important;
    }

    .badge {
        border: 1px solid #111827 !important;
        background: transparent !important;
        color: #111827 !important;
        padding: 2px 6px !important;
    }

    a {
        text-decoration: none !important;
        color: #111827 !important;
    }
}

/* Botón Toggle Visibilidad de Precio en Portales */
.btn-toggle-precio-visible {
    background: none;
    border: 1px solid transparent;
    padding: 2px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-toggle-precio-visible.is-visible {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .btn-toggle-precio-visible.is-visible {
    border-color: var(--success);
    color: var(--success);
    background: rgba(5, 150, 105, 0.12);
}

.btn-toggle-precio-visible.is-hidden {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] .btn-toggle-precio-visible.is-hidden {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(153, 74, 0, 0.12);
}

.btn-toggle-precio-visible:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* File Drag & Drop Dropzone */
.file-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    background: var(--bg-card);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    outline: none;
    min-height: 110px;
    margin-top: 6px;
}

.file-dropzone:hover,
.file-dropzone.dragover {
    border-color: var(--accent);
    background: var(--bg-input);
    transform: translateY(-1px);
}

.file-dropzone-icon {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.file-dropzone:hover .file-dropzone-icon,
.file-dropzone.dragover .file-dropzone-icon {
    color: var(--accent);
}

.file-dropzone span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-dropzone input[type="file"] {
    display: none !important;
}

/* Staged Files Preview */
.staged-files-list {
    width: 100%;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staged-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.staged-file-item span.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
    font-weight: 500;
    color: var(--text-primary) !important;
}

.btn-remove-staged {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    transition: transform 0.1s ease;
}

.btn-remove-staged:hover {
    transform: scale(1.1);
}

/* Card Propietario Asignado */
.assigned-owner-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assigned-owner-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.assigned-owner-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}

.assigned-owner-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.owner-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 576px) {
    .owner-info-grid {
        grid-template-columns: 1fr;
    }
}

.owner-info-grid .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.owner-info-grid .info-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.owner-info-grid .info-item strong,
.owner-info-grid .info-item span {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.assigned-owner-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.assigned-owner-card-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Tooltip de Fórmulas y Explicaciones */
.formula-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.formula-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--text-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.formula-tooltip-container:hover .formula-tooltip-trigger {
    border-color: var(--brand-pro);
    color: var(--brand-pro);
    background: rgba(103, 186, 184, 0.1);
}

.formula-tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 130%;
    right: 0;
    width: 290px;
    background: rgba(22, 31, 46, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    font-size: 0.8rem;
    line-height: 1.45;
    font-weight: 400;
    text-align: left;
    white-space: normal;
}

.formula-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 8px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--border) transparent transparent transparent;
}

.formula-tooltip-container:hover .formula-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   MANZANA BUTTON FILTERS & TAB TRANSITION SKELETON
   ========================================================================== */
.manzanas-filter-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.manzanas-filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.manzanas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.manzana-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
    transition: all 0.2s ease;
}

.manzana-btn:hover {
    border-color: var(--brand-pro);
    color: var(--brand-pro);
}

.manzana-btn.active {
    background: var(--brand-pro);
    border-color: var(--brand-pro);
    color: #ffffff;
}

.manzana-btn input[type="checkbox"] {
    display: none;
}

/* Premium Tab Transition Skeleton Styling */
.tab-pane.tab-loading,
.tab-content.tab-loading {
    position: relative;
    min-height: 250px;
}

.tab-pane.tab-loading>*,
.tab-content.tab-loading>* {
    display: none !important;
}

.tab-pane.tab-loading::before,
.tab-content.tab-loading::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 220px;
    background: linear-gradient(to bottom,
            var(--bg-input) 0%,
            var(--bg-input) 12%,
            transparent 12%,
            transparent 20%,
            var(--bg-input) 20%,
            var(--bg-input) 32%,
            transparent 32%,
            transparent 40%,
            var(--bg-input) 40%,
            var(--bg-input) 52%,
            transparent 52%,
            transparent 60%,
            var(--bg-input) 60%,
            var(--bg-input) 72%,
            transparent 72%,
            transparent 80%,
            var(--bg-input) 80%,
            var(--bg-input) 92%,
            transparent 92%);
    background-size: 100% 250px;
    border-radius: var(--radius-sm);
    animation: pulse 1.5s infinite ease-in-out;
}

/* Spinner Loader para el Estado del Bot de WhatsApp */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(103, 186, 184, 0.1);
    border-radius: 50%;
    border-top-color: var(--brand-pro);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   INTERACTIVE ONBOARDING TOUR (COBRANZAS)
   ========================================================================== */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 16, 34, 0.82); /* Glassmorphism background matching --bg-main */
    backdrop-filter: blur(2px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.tour-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tour-highlighted {
    position: relative !important;
    z-index: 10000 !important;
    box-shadow: 0 0 0 10px rgba(103, 186, 184, 0.35), 0 4px 30px rgba(0, 0, 0, 0.5) !important;
    background: var(--bg-card) !important;
    border-color: var(--brand-pro) !important;
    transition: all 0.3s ease !important;
}

.tour-popover {
    position: absolute;
    z-index: 10001;
    width: 320px;
    background: var(--bg-card);
    border: 1.5px solid var(--brand-pro);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tour-popover.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.tour-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.tour-popover-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--brand-pro);
    margin: 0;
}
.tour-popover-counter {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.tour-popover-body {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-primary);
}
.tour-popover-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
}
.tour-popover-buttons {
    display: flex;
    gap: 8px;
}
.tour-popover-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    height: auto;
    border: 1px solid transparent;
}
.tour-popover-btn-primary {
    background: var(--brand-pro);
    color: #0b1022;
}
.tour-popover-btn-primary:hover {
    opacity: 0.9;
}
.tour-popover-btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.tour-popover-btn-secondary:hover {
    background: var(--bg-input);
}
.tour-popover-btn-link {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 0.75rem;
    padding: 0;
    text-decoration: underline;
}
.tour-popover-btn-link:hover {
    color: var(--text-primary);
}

/* Historical Sales Highlight */
.historical-sale-row {
    background-color: rgba(103, 186, 184, 0.04) !important;
    border-left: 4px solid var(--brand-pro) !important;
}
.historical-sale-row:hover {
    background-color: rgba(103, 186, 184, 0.08) !important;
}
.badge-historical {
    background-color: rgba(103, 186, 184, 0.15) !important;
    color: var(--brand-pro) !important;
    border: 1px solid rgba(103, 186, 184, 0.3) !important;
}

/* Import Fix Screen Styles */
.import-fix-container {
    max-width: 1500px;
    margin: 2rem auto;
    padding: 0 1.5rem 100px 1.5rem; /* extra bottom padding for sticky bar */
}
.import-fix-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.import-fix-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.import-fix-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}
.import-fix-stat-card strong {
    font-size: 2rem;
    color: var(--text-primary);
}
.import-fix-stat-card span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.row-shifted {
    background-color: rgba(239, 68, 68, 0.06) !important;
    border-left: 4px solid var(--danger) !important;
}
.row-shifted:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
}
.row-ready {
    border-left: 4px solid var(--success) !important;
}
.badge-shifted {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-ready {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: var(--success) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.import-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(11, 16, 34, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}
.import-progress-container {
    flex: 1;
    max-width: 600px;
    margin-right: 2rem;
}
.import-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.import-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-pro);
    transition: width 0.3s ease;
}
.import-table-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.import-table-input:focus {
    border-color: var(--brand-pro);
    outline: none;
}
.import-table-select {
    width: 100%;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.import-table-select:focus {
    border-color: var(--brand-pro);
    outline: none;
}
.import-tab-link {
    cursor: pointer;
}
.import-tab-link.active {
    color: var(--brand-pro);
    border-bottom: 2px solid var(--brand-pro);
}

.sales-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: flex-end;
}
.sales-filter-search {
    grid-column: span 2;
}
.sales-filter-field {
    grid-column: span 1;
}
.sales-filter-buttons {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .sales-filter-grid {
        grid-template-columns: 1fr;
    }
    .sales-filter-search,
    .sales-filter-field,
    .sales-filter-buttons {
        grid-column: span 1;
    }
    .sales-filter-buttons {
        justify-content: flex-start;
        width: 100%;
    }
}

/* ==========================================
   SISTEMA DE NOTIFICACIONES (BELL & DROPDOWN)
   ========================================== */
.notifications-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 12px;
}

.notifications-bell-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: var(--shadow-sm);
}

.notifications-bell-btn:hover {
    background: var(--bg-input);
    border-color: var(--accent);
    color: var(--accent);
}

.notifications-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-main);
    box-shadow: var(--shadow-sm);
}

.notifications-dropdown {
    position: absolute;
    top: 80px;
    right: 0;
    width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

.notifications-dropdown.show {
    display: flex;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar);
}

.notifications-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.notifications-mark-all:hover {
    background: var(--accent-light);
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notifications-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.notification-item:hover {
    background: var(--bg-input);
}

.notification-item.unread {
    background: var(--accent-light);
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.notification-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.notification-item-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.notification-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.notification-mark-read-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.notification-mark-read-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   CALENDAR & AGENDA SYSTEM STYLES
   ========================================== */
.calendar-trigger-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0 22px;
    height: 72px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.calendar-trigger-btn:hover {
    background: var(--bg-input);
    border-color: var(--brand-pro);
    color: var(--brand-pro);
}

.calendar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.calendar-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.calendar-modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1200px;
    max-height: min(85vh, calc(100vh - 140px));
    height: 85vh;
    min-height: 500px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.calendar-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-view-toggles {
    display: flex;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.calendar-toggle-btn {
    border: none;
    background: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-toggle-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.calendar-modal-close {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-modal-close:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.calendar-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.calendar-modal-left {
    flex: 1.6;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-modal-right {
    flex: 1;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Calendar Month View CSS */
.calendar-view-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px;
}

.calendar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav-actions {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background: var(--bg-input);
    border-color: var(--accent);
    color: var(--accent);
}

.calendar-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
    text-align: center;
}

.calendar-weekday {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-days-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
}

.calendar-day-cell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s;
    min-height: 0;
    overflow: hidden;
}

.calendar-day-cell:hover {
    border-color: var(--accent);
    background: var(--bg-input);
}

.calendar-day-cell.other-month {
    opacity: 0.4;
    background: var(--bg-sidebar);
}

.calendar-day-cell.today {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.calendar-day-cell.selected {
    background: var(--accent-light);
    border-color: var(--accent);
}

.calendar-day-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-day-cell.today .calendar-day-num {
    color: var(--accent);
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    max-height: 48px;
}

/* Event micro-badge */
.calendar-day-event-dot {
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1.2;
}

/* Event color schemes based on type */
.event-dot-meeting { background: #3b82f6; } /* Reunión */
.event-dot-call { background: #10b981; } /* Llamado */
.event-dot-whatsapp { background: #25d366; } /* WhatsApp */
.event-dot-contract-reservation { background: #8b5cf6; } /* Firma de Boleto */
.event-dot-contract-close { background: #6366f1; } /* Firma de Escritura */
.event-dot-personal { background: #f97316; } /* Personal */
.event-dot-vacation { background: #ec4899; } /* Vacaciones */
.event-dot-appraisal { background: #06b6d4; } /* Tasación */

/* Agenda View CSS */
.agenda-view-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px;
}

.agenda-filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.agenda-search-input {
    flex: 1;
}

.agenda-events-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

.agenda-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.agenda-item-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.agenda-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.agenda-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.agenda-item-type-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

.agenda-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agenda-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.agenda-item-property {
    font-size: 0.75rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.agenda-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-item-date {
    text-align: right;
}

.agenda-date-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agenda-date-day {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Event Right Column Form CSS */
.event-form-panel {
    padding: 20px 24px;
    line-height: 1.2;
}

.event-form-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.event-form-group {
    margin-bottom: 14px;
    position: relative;
}

.event-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Autocomplete Suggestion Dropdowns */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    display: none;
}

.autocomplete-suggestion {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover {
    background: var(--bg-input);
    color: var(--accent);
}

.autocomplete-empty {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Selected Entity Tags Container */
.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.selected-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.selected-tag-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-tag-remove:hover {
    color: var(--danger);
}

.event-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.event-details-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.event-details-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-details-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-details-desc {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--bg-sidebar);
    padding: 10px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
}

/* Responsive adjustment */
@media (max-width: 900px) {
    .calendar-modal-body {
        flex-direction: column;
        overflow-y: auto;
    }
    .calendar-modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex: none;
        height: 60vh;
    }
    .calendar-modal-right {
        flex: none;
        height: auto;
        overflow-y: visible;
    }
}

/* ==========================================
   MÓDULO DE TASACIONES
   ========================================== */

/* Dashboard & KPIs */
.appraisals-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.appraisals-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.appraisals-stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.appraisals-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.appraisals-stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Layout y Toggler */
.appraisals-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.view-toggler-container {
    display: inline-flex;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.view-toggle-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-toggle-btn.active {
    background: var(--accent);
    color: #ffffff;
}

/* Tablero Kanban */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: stretch;
}

.kanban-column {
    flex: 1;
    min-width: var(--kanban-col-width, 15%);
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s;
}

.kanban-column.drag-over {
    background-color: var(--accent-light);
    border-color: var(--accent);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.kanban-column-title {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.kanban-column-badge {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 300px;
    flex: 1;
}

/* Tarjeta Kanban */
.kanban-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.kanban-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kanban-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.98);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.kanban-card-code {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-pro);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
}

.kanban-card-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.kanban-card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kanban-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.kanban-card-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.kanban-card-btn:hover {
    background: var(--bg-input);
    color: var(--accent);
}

/* Gráficos de Tasaciones */
.appraisals-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .appraisals-charts-grid {
        grid-template-columns: 1fr;
    }
}

.appraisals-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.appraisals-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Formulario Detallado / Drawer */
.appraisal-details-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appraisal-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-pro);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin-top: 8px;
}

/* Estilos de Impresión Reporte */
.appraisal-print-body {
    background: #ffffff !important;
    color: #1f2937 !important;
    font-family: 'Inter', -apple-system, sans-serif;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-radius: 8px;
}

.appraisal-print-container {
    background: #ffffff;
    color: #1f2937;
}

.print-header {
    border-bottom: 3px solid #0c4948;
    padding-bottom: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.print-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0c4948;
    letter-spacing: -0.02em;
}

.print-logo-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.print-meta-box {
    text-align: right;
    font-size: 0.85rem;
    color: #4b5563;
}

.print-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1f2937;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.print-section {
    margin-bottom: 20px;
}

.print-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0c4948;
    text-transform: uppercase;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 4px;
    margin-bottom: 10px;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
    font-size: 0.9rem;
}

.print-grid-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 4px;
}

.print-grid-label {
    font-weight: 600;
    color: #4b5563;
}

.print-grid-val {
    color: #1f2937;
}

.print-desc-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.print-value-card {
    background: #f0fdfa;
    border: 2px solid #0c4948;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
}

.print-value-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0c4948;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.print-value-amount {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0c4948;
}

.print-services-box {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.5;
}

.print-services-list {
    margin-top: 6px;
    padding-left: 16px;
}

.print-services-list li {
    margin-bottom: 4px;
}

.print-signature-section {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.print-signature-line {
    border-top: 1px solid #4b5563;
    width: 220px;
    text-align: center;
    padding-top: 6px;
    font-size: 0.8rem;
    color: #4b5563;
}

/* Ocultar elementos para la impresión */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .sidebar, .top-bar, .appraisals-header-actions, .appraisals-dashboard-stats, .appraisals-charts-grid, .kanban-board, .button, .flash-container, .flash-compact {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .appraisal-print-body {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* Column Resolution split */
.kanban-column.col-resolution {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.resolution-dropzones-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.resolution-box {
    flex: 1;
    min-height: 110px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(var(--bg-card-rgb), 0.3);
}
.resolution-box:hover {
    background: rgba(var(--bg-card-rgb), 0.7);
}
.resolution-box.drag-over {
    transform: scale(1.02);
}
.resolution-box.box-captada {
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success);
}
.resolution-box.box-captada.drag-over {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}
.resolution-box.box-reporte {
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}
.resolution-box.box-reporte.drag-over {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}
.resolution-box.box-caida {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger);
}
.resolution-box.box-caida.drag-over {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}
.resolution-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 8px;
}
.resolution-count {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

/* ==========================================================================
   Dashboard MVP Redesign CSS
   ========================================================================== */

.mvp-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.mvp-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.mvp-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.mvp-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.mvp-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.stat-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: var(--border-highlight);
}

.stat-card-link:active {
    transform: translateY(-1px);
}

/* Timeline de Notificaciones ("Mientras no estabas") */
.notif-timeline {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
    padding-top: 2px;
}

.notif-timeline::-webkit-scrollbar {
    width: 6px;
}
.notif-timeline::-webkit-scrollbar-track {
    background: rgba(var(--bg-card-rgb), 0.1);
    border-radius: 3px;
}
.notif-timeline::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.notif-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.notif-card:hover {
    border-color: var(--brand-pro);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.notif-card.clickable {
    cursor: pointer;
}
.notif-card.clickable:hover {
    background: var(--bg-hover);
}

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-right: 12px;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.notif-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-action {
    display: flex;
    align-items: center;
}

/* Botón de marcar leído */
.btn-read-check {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-read-check:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: var(--success);
}

/* Gráficos SVG Interactivos */
.svg-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.svg-chart-container {
    position: relative;
    width: 100%;
    overflow: visible;
}

.svg-chart-tooltip {
    position: absolute;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.svg-point-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}

.svg-point-trigger:hover {
    r: 7 !important;
}

/* Comparador Side-by-side */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

.comparison-side-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.comparison-side-card.side-a {
    border-left: 4px solid var(--brand-pro);
    background: linear-gradient(to bottom right, rgba(16, 185, 129, 0.02), transparent);
}

.comparison-side-card.side-b {
    border-left: 4px solid var(--accent);
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.02), transparent);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.comparison-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.comparison-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-main);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.comparison-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(var(--text-muted-rgb, 128, 128, 128), 0.2);
}

.comparison-metric-item:last-child {
    border-bottom: none;
}

.comparison-metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.comparison-metric-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    width: 100%;
}

.comparison-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.side-a .comparison-progress-fill {
    background: var(--brand-pro);
}

.side-b .comparison-progress-fill {
    background: var(--accent);
}

.comparison-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
}

/* Elementos del gráfico comparativo SVG */
.comp-bar-a {
    fill: var(--brand-pro);
    opacity: 0.85;
    transition: opacity 0.2s ease, fill 0.2s ease;
    cursor: pointer;
}
.comp-bar-a:hover {
    opacity: 1;
}

.comp-bar-b {
    fill: var(--accent);
    opacity: 0.85;
    transition: opacity 0.2s ease, fill 0.2s ease;
    cursor: pointer;
}
.comp-bar-b:hover {
    opacity: 1;
}

.comp-grid-line {
    stroke: var(--border);
    stroke-dasharray: 4 4;
}

/* Timeline vacía o sin notificaciones */
.timeline-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(var(--bg-card-rgb), 0.1);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* --- LEADS SELLERS DOCK (CRM KANBAN) --- */
.leads-sellers-dock {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    height: 110px;
    background: rgba(30, 41, 59, 0.85); /* Oscuro elegante */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    padding: 12px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
}

[data-theme="light"] .leads-sellers-dock {
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
}

.leads-sellers-dock.dock-open {
    bottom: 0;
}

.leads-sellers-dock h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 24px;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

[data-theme="light"] .leads-sellers-dock h4 {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* Seller Dropzone */
.seller-dropzone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    height: 54px;
}

[data-theme="light"] .seller-dropzone {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.seller-dropzone:hover, .seller-dropzone.drag-over {
    background: rgba(103, 186, 184, 0.15); /* Color institucional con opacidad */
    border-color: #67bab8;
    box-shadow: 0 0 12px rgba(103, 186, 184, 0.3);
    transform: scale(1.02);
}

.seller-dropzone .avatar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.seller-dropzone .name {
    color: var(--text-primary);
}

/* Form Tabs Panes */

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Services & Amenities Checkbox Grids */
.checkbox-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.checkbox-card:hover {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.checkbox-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Portal Multidiffusion Cards */
.portals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.portal-card {
    padding: 20px;
    background: var(--surface-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
}

.portal-badge.desconectado { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.portal-badge.publicado { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.portal-badge.pendiente { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.portal-badge.pausado { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* --- Mapa Interactivo: Pantalla Completa & Legibilidad Modo Oscuro --- */
.map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* --- Aislamiento de contexto de apilamiento para mapas Leaflet (evita que controles de zoom se superpongan a la barra lateral) --- */
.leaflet-container:not(.map-fullscreen),
#property-map-picker:not(.map-fullscreen),
#appraisal-map-picker:not(.map-fullscreen),
.map-picker-container:not(.map-fullscreen) {
    isolation: isolate;
    z-index: 1;
}

.leaflet-container:not(.map-fullscreen) .leaflet-top,
.leaflet-container:not(.map-fullscreen) .leaflet-bottom {
    z-index: 10 !important;
}

.leaflet-container:not(.map-fullscreen) .leaflet-pane {
    z-index: 5 !important;
}

:root:not([data-theme="light"]) .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(92%) contrast(90%);
}

:root:not([data-theme="light"]) .leaflet-container {
    background: var(--bg-card) !important;
}

.leaflet-control-fullscreen {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.leaflet-control-fullscreen a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
    color: var(--text-primary, #333) !important;
    background-color: #ffffff !important;
    border-radius: 4px !important;
    border-bottom: none !important;
    cursor: pointer !important;
}

/* ==========================================================================
   PASSWORD TOGGLE BUTTON
   ========================================================================== */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 42px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm, 4px);
    transition: color 0.2s ease;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   CARDS & PANELS COMPONENT
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 24px;
}

.card:not(:has(.card-header)):not(:has(.card-body)) {
    padding: 24px;
}

.card-muted {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */
.badge-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    line-height: 1.3;
    transition: background 0.15s ease;
}

[data-theme="light"] .badge-role {
    background: #e9ecef;
    border-color: #ced4da;
    color: #212529;
}

.badge-exception {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-sm, 6px);
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-info {
    background: var(--accent-light);
    color: var(--accent);
}

/* ==========================================================================
   BUTTON SIZES & UTILITIES
   ========================================================================== */
.button-xs {
    padding: 5px 12px !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-sm, 6px) !important;
}

/* ==========================================================================
   USERS MODULE: GRIDS & USER CARDS
   ========================================================================== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-color: var(--brand-pro) !important;
}

.user-card-inactive {
    background: var(--bg-input) !important;
    border-style: dashed !important;
    opacity: 0.8;
}

.user-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-pro, #67bab8), #4a8b89);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(103, 186, 184, 0.3);
}

.user-card-inactive .user-avatar-circle {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    box-shadow: none;
}

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    max-width: 580px;
    width: 100%;
    max-height: min(85vh, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================================================
   PROFILE VIEW COMPONENTS
   ========================================================================== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.profile-card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.profile-avatar-img,
.profile-avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.profile-avatar-placeholder {
    background: linear-gradient(135deg, var(--accent) 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-btn-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent);
    color: #ffffff;
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.profile-avatar-btn-edit:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

.profile-user-details h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.profile-user-username {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Permisos Activos Accordion */
.profile-permissions-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

details.profile-perm-category {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

details.profile-perm-category[open] {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

details.profile-perm-category summary.profile-perm-category-header {
    background: var(--bg-input, var(--bg-card));
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 0.2s;
}

details.profile-perm-category summary.profile-perm-category-header::-webkit-details-marker,
details.profile-perm-category summary.profile-perm-category-header::marker {
    display: none;
}

details.profile-perm-category summary.profile-perm-category-header:hover {
    background: rgba(59, 130, 246, 0.08);
}

.profile-perm-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-perm-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s;
    flex-shrink: 0;
}

details.profile-perm-category[open] .profile-perm-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.profile-perm-category-title {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.profile-perm-count-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-card);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

details.profile-perm-category[open] .profile-perm-count-badge {
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

.profile-perm-list {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.profile-perm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.profile-perm-item:last-child {
    border-bottom: none;
}

.profile-perm-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.profile-perm-name {
    font-size: 0.86rem;
    font-weight: 600;
    display: block;
    color: var(--text-primary);
}

.profile-perm-item.disabled .profile-perm-name {
    color: var(--text-muted);
    font-weight: 400;
}

.profile-perm-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    line-height: 1.4;
}

.profile-perm-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.profile-perm-badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.profile-perm-badge-disabled {
    background: rgba(107, 114, 128, 0.12);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Google Card */
.profile-google-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 18px;
}

.profile-google-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.profile-google-toggle {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

/* ==========================================================================
   AVATAR CIRCULAR CROPPER COMPONENT
   ========================================================================== */
.avatar-cropper-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.avatar-cropper-dropzone:hover,
.avatar-cropper-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.avatar-cropper-viewport {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #090d16;
    touch-action: none;
    user-select: none;
    cursor: grab;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.avatar-cropper-viewport:active {
    cursor: grabbing;
}

.avatar-cropper-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.avatar-cropper-mask {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.68);
    pointer-events: none;
}

.avatar-cropper-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}

.avatar-cropper-slider {
    flex: 1;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ==========================================================================
   VISTA DE TARJETAS COMPACTAS PARA PROPIEDADES
   ========================================================================== */
.properties-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    grid-auto-rows: auto;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

.property-card-compact {
    display: flex;
    flex-direction: row;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
    min-height: 154px;
    height: auto;
    box-sizing: border-box;
}

.property-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    z-index: 5;
}

.property-card-compact:has(.dropdown.open),
.property-card-compact.dropdown-is-open {
    z-index: 120;
}

.property-card-thumb-wrap {
    width: 135px;
    min-width: 135px;
    max-width: 135px;
    position: relative;
    background: var(--bg-input);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
}

.property-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.3s ease;
}

.property-card-img.property-card-img-loaded {
    opacity: 1;
}

.property-card-compact:hover .property-card-img.property-card-img-loaded {
    transform: scale(1.05);
}

.property-card-no-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    opacity: 0.6;
    width: 100%;
    height: 100%;
    background: var(--bg-input);
}

.property-card-badge-legajo {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
    letter-spacing: 0.03em;
}

.property-card-badge-operacion {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    z-index: 2;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.property-card-badge-operacion.badge-activo,
.property-card-badge-operacion.badge-venta {
    background: #059669;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.property-card-badge-operacion.badge-info,
.property-card-badge-operacion.badge-alquiler {
    background: var(--accent);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.property-card-content {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    box-sizing: border-box;
}

.property-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.property-card-price-wrap {
    flex-shrink: 0;
    white-space: nowrap;
}

.property-card-price {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.property-card-tags-wrap {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-end;
}

.property-card-address {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.property-card-location {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-card-type-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    flex-shrink: 1;
}

.property-card-metrics {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}

.property-card-metric-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.property-card-metric-item strong {
    color: var(--text-primary);
}

.property-card-amenities {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
    min-height: 22px;
}

.property-amenity-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.property-amenity-pill.active {
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.property-amenity-pill.inactive {
    color: var(--text-muted);
    opacity: 0.35;
    background: transparent;
    border: 1px solid transparent;
}

.property-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 2px;
}

.property-card-footer .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.property-card-footer .dropdown-toggle:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

.property-card-footer .dropdown-menu {
    min-width: 180px;
    right: 0;
    top: 100%;
    margin-top: 4px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    z-index: 150;
}

.property-card-footer .dropdown.dropup .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

/* ==========================================================================
   MODAL DE BIENVENIDA Y NOVEDADES (RELEASE NOTES v2.9)
   ========================================================================== */
.release-notes-container {
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
}

.release-notes-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius);
    padding: 16px 20px;
}

@media (max-width: 650px) {
    .release-notes-banner {
        flex-direction: column;
        text-align: center;
    }
}

.release-notes-illustration-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.release-notes-svg-img {
    width: 140px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.release-notes-hero-text {
    flex: 1;
    min-width: 0;
}

.release-notes-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

@media (max-width: 650px) {
    .release-notes-badge-row {
        justify-content: center;
    }
}

.release-notes-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.release-notes-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.release-notes-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.release-notes-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.release-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 700px) {
    .release-notes-grid {
        grid-template-columns: 1fr;
    }
    .release-notes-card[style*="grid-column"] {
        grid-column: auto !important;
    }
}

.release-notes-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.release-notes-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.release-notes-card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.release-notes-card-icon i,
.release-notes-card-icon svg {
    width: 18px;
    height: 18px;
}

.release-notes-card-content {
    flex: 1;
    min-width: 0;
}

.release-notes-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.release-notes-card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.release-notes-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.release-notes-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.release-notes-checkbox {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.release-notes-btn-accept {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   FICHA RÁPIDA DE LLAVES (KEY QUICK VIEW)
   ========================================================================== */
.key-quick-container {
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.key-quick-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.key-quick-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.key-quick-code-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.key-quick-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
}

.key-quick-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.key-quick-property-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.key-quick-prop-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-quick-prop-info {
    flex: 1;
    min-width: 0;
}

.key-quick-prop-address {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.key-quick-prop-meta {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.key-quick-actions-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key-quick-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-quick-withdraw-form {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.key-quick-form-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.key-quick-form-group {
    flex: 1;
    min-width: 220px;
}

.key-quick-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.key-quick-return-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    padding: 14px;
    flex-wrap: wrap;
}

.key-quick-return-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text-primary);
}

.key-quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.key-quick-secondary-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 6px;
}

.key-quick-btn-danger-link {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.key-quick-btn-danger-link:hover {
    background: rgba(239, 68, 68, 0.1);
}

.key-quick-history-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.key-quick-empty-logs {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.key-quick-timeline {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.key-quick-timeline::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 13px;
    width: 2px;
    background: var(--border);
}

.key-quick-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    position: relative;
}

.key-quick-timeline-item:last-child {
    padding-bottom: 0;
}

.key-quick-timeline-dot {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--bg-card);
}

.key-quick-timeline-content {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.key-quick-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
}

.key-quick-timeline-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
}

.key-quick-timeline-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   CRM LEADS - FICHA COMPLETA REDISEÑADA & PIPELINE RIBBON (v2.15.0.3)
   ========================================================================== */

/* Animación con rebote físico (Signature Spring Bounce) */
.spring-bounce {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.spring-bounce:hover {
    transform: translateY(-2px) scale(1.02);
}

.spring-bounce:active {
    transform: translateY(0) scale(0.98);
}

/* Pipeline Ribbon Chevron */
.crm-pipeline-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.crm-pipeline-ribbon {
    display: flex;
    align-items: stretch;
    gap: 4px;
    min-width: 780px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-pipeline-step {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px 10px 24px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%, 14px 50%);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crm-pipeline-step:first-child {
    clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%);
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    padding-left: 16px;
}

.crm-pipeline-step:last-child {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 14px 50%);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    padding-right: 16px;
}

.crm-pipeline-step:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--brand-pro);
    transform: translateY(-2px);
    z-index: 2;
}

.crm-pipeline-step.completed {
    background: #2563eb;
    color: #ffffff;
}

.crm-pipeline-step.current {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: scale(1.03);
    z-index: 3;
}

.crm-pipeline-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    margin-right: 6px;
}

.crm-pipeline-step:not(.completed):not(.current) .crm-pipeline-step-num {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
}

/* Cabecera Lead CRM */
.crm-lead-header-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.crm-lead-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-pro) 0%, #60a5fa 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.crm-advisor-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
}

.crm-advisor-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-pro);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.crm-advisor-select {
    background: transparent;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crm-advisor-select:hover,
.crm-advisor-select:focus {
    background: var(--bg-card);
    border-color: var(--border-highlight);
}

/* Botones Ganado y Cerrado */
.crm-btn-won {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    padding: 7px 14px !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.crm-btn-won:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px) scale(1.02);
}

.crm-btn-lost {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    padding: 7px 14px !important;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.crm-btn-lost:hover {
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
    transform: translateY(-2px) scale(1.02);
}

/* Tarjeta de Negocio y Criterios */
.crm-deal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.crm-deal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand-pro) 0%, #60a5fa 100%);
}

.crm-matchmaking-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.12) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
}

/* Drawer / Quick View Lateral (Ver y Sumar) */
.crm-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10020;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.crm-drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.crm-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 580px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
    z-index: 10021;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crm-drawer-backdrop.show .crm-drawer-panel {
    transform: translateX(0);
}

.crm-drawer-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.crm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-drawer-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-input);
    display: flex;
    justify-content: flex-end;
}

.crm-match-prop-card {
    display: flex;
    gap: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crm-match-prop-card:hover {
    border-color: var(--brand-pro);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.key-quick-timeline-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.key-quick-timeline-details {
    margin-top: 4px;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ==========================================================================
   MODERNIZACIÓN FICHA DE PROPIEDADES (PROPERTIES / FORM & SHOW)
   ========================================================================== */

/* Hero Header de Propiedad */
.property-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.property-hero-main {
    flex: 1;
    min-width: 320px;
}

.property-hero-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.property-hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.property-hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.property-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Pestañas con Badges y Contadores */
.tab-counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    margin-left: 6px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.tab-link.active .tab-counter-badge {
    background: rgba(13, 148, 136, 0.2);
    color: var(--brand-pro);
}

/* Sticky Action Bar (Barra Flotante de Acciones al Pie) */
.form-sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: var(--glass-bg, rgba(19, 28, 49, 0.92));
    backdrop-filter: var(--glass-blur, blur(16px));
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.25);
    margin: 30px -24px -18px -24px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.form-sticky-footer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-sticky-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Selectores Segmentados (Number Steppers) */
.segmented-stepper {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
    width: 100%;
    overflow-x: auto;
    align-items: center;
}

.stepper-btn {
    flex: 1;
    min-width: 28px;
    height: 32px;
    padding: 0 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    white-space: nowrap;
}

.stepper-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.stepper-btn.active {
    background: var(--brand-pro);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
}

.stepper-overflow-input {
    background: var(--bg-card) !important;
    border: 1px solid var(--brand-pro) !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    text-align: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    animation: fadeInScale 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Toggle-Chips Vectoriales para Amenities y Servicios (Forzado 1 sola fila con ellipsis) */
.amenities-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.amenity-toggle-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    user-select: none;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
}

.amenity-toggle-chip:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    color: var(--text-primary);
}

.amenity-toggle-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.amenity-toggle-chip.is-active {
    background: rgba(13, 148, 136, 0.12);
    border-color: var(--brand-pro);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--brand-pro);
}

.amenity-toggle-chip .chip-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.amenity-toggle-chip.is-active .chip-icon {
    color: var(--brand-pro);
    transform: scale(1.1);
}

.amenity-toggle-chip .chip-label,
.amenity-toggle-chip > span:not(.chip-check) {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    flex: 1 !important;
    line-height: 1.25;
}

.amenity-toggle-chip .chip-check {
    margin-left: auto;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.amenity-toggle-chip.is-active .chip-check {
    background: var(--brand-pro);
    border-color: var(--brand-pro);
    color: #fff;
}

/* Caja de Precios con Conversión Dólar Blue */
.price-input-wrapper {
    position: relative;
    width: 100%;
}

.price-currency-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-pro);
    pointer-events: none;
}

.price-currency-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--radius-sm, 6px);
    background: rgba(103, 186, 184, 0.12);
    border: 1px solid rgba(103, 186, 184, 0.28);
    color: var(--brand-pro, #67bab8);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    line-height: 1.2;
}

.price-currency-toggle:hover {
    background: rgba(103, 186, 184, 0.22);
    border-color: var(--brand-pro, #67bab8);
}

.price-currency-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.price-currency-toggle .currency-swap-icon {
    width: 12px;
    height: 12px;
    opacity: 0.75;
    transition: transform 0.25s ease;
}

.price-currency-toggle:hover .currency-swap-icon {
    opacity: 1;
    transform: rotate(180deg);
}

[data-theme="light"] .price-currency-toggle {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
}

[data-theme="light"] .price-currency-toggle:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #059669;
}

.price-input-prefixed {
    padding-left: 72px !important;
    font-weight: 600;
    font-size: 1.05rem;
}

.blue-conversion-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Casillero Llave Tablero Virtual */
.virtual-key-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.virtual-key-badge-lg {
    font-size: 1.15rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
}

/* Tablero Virtual Miniatura (Ficha de Propiedades) */
.mini-board-tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-left: auto;
}

.mini-board-tab-btn {
    background: transparent;
    border: none;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-board-tab-btn:hover {
    color: var(--text-primary);
}

.mini-board-tab-btn.active {
    background: var(--brand-pro);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mini-board-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    min-height: 44px;
}

.mini-board-chosen-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    padding: 4px 10px;
    border-radius: 9999px;
}

.mini-board-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 0 2px;
}

.mini-board-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-box.available {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
}

.legend-box.chosen {
    background: #f97316;
    border: 1px solid #ea580c;
}

.legend-box.occupied {
    background: rgba(100, 116, 139, 0.25);
    border: 1px solid #475569;
}

.mini-board-wrapper {
    display: none;
}

.mini-board-wrapper.active {
    display: block;
}

.mini-board-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    user-select: none;
}

.mini-slot {
    height: 34px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

/* Verde: Disponible */
.mini-slot.available {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.mini-slot.available:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
    transform: scale(1.04);
}

/* Naranja: Elegido */
.mini-slot.chosen {
    background: #f97316;
    border-color: #ea580c;
    border-width: 2px;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.45);
}

.mini-slot.chosen:hover {
    background: #ea580c;
    transform: scale(1.04);
}

/* Gris: Ocupado */
.mini-slot.occupied {
    background: rgba(100, 116, 139, 0.18);
    border-color: rgba(148, 163, 184, 0.2);
    color: #64748b;
    cursor: not-allowed;
    opacity: 0.75;
}

.mini-slot.occupied:hover {
    transform: none;
}

/* Avatar de Propietario con Iniciales */
.owner-avatar-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-pro), var(--accent));
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

/* ==========================================================================
   Módulo de Cartelería - UI/UX Pro Max Componentes Modernos
   ========================================================================== */

/* Header con Badges y Acciones */
.carteleria-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Grid de Métricas y KPIs de Cartelería */
.carteleria-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.carteleria-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.carteleria-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.carteleria-kpi-card.is-active {
    border-color: var(--brand-pro);
    background: rgba(13, 148, 136, 0.07);
    box-shadow: 0 0 0 1px var(--brand-pro);
}

.carteleria-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.carteleria-kpi-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.carteleria-kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carteleria-kpi-icon i {
    width: 17px;
    height: 17px;
}

.carteleria-kpi-num {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 8px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* Desglose Venta / Alquiler en KPI */
.carteleria-kpi-breakdown {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.kpi-sub-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 0.73rem;
    font-weight: 600;
    line-height: 1.3;
}

.kpi-sub-pill-venta {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-sub-pill-alquiler {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Barra de Herramientas y Filtros Instantáneos */
.carteleria-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
}

.cartel-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
}

.cartel-search-wrap i,
.cartel-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.cartel-search-wrap input {
    width: 100%;
    height: 38px;
    padding-left: 36px !important;
    padding-right: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cartel-search-wrap input:focus {
    border-color: var(--brand-pro);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
    outline: none;
}

.cartel-segmented-group {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
    align-items: center;
}

.cartel-seg-btn {
    height: 34px;
    padding: 0 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    user-select: none;
}

.cartel-seg-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.cartel-seg-btn.active {
    background: var(--brand-pro);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}

.cartel-seg-badge {
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
}

.cartel-urgent-toggle-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.cartel-urgent-toggle-btn:hover {
    border-color: var(--warning);
    color: var(--warning);
}

.cartel-urgent-toggle-btn.active {
    background: rgba(245, 158, 11, 0.14);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 0 1px var(--warning);
}

.cartel-results-counter {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* Celdas enriquecidas de la tabla */
.cartel-address-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cartel-address-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.25;
}

.cartel-address-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cartel-legajo-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
}

.cartel-maps-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 1px 6px;
    border-radius: 4px;
    transition: all 0.18s ease;
}

.cartel-maps-btn:hover {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
}

/* Badges Semánticos de Operación */
.badge-operacion-venta {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-operacion-alquiler {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* Celda de Contacto Telefónico y WhatsApp */
.cartel-contact-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cartel-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: all 0.18s ease;
}

.cartel-phone-btn:hover {
    border-color: var(--brand-pro);
    color: var(--brand-pro);
}

.cartel-wa-trigger-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #25D366;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cartel-wa-trigger-btn:hover {
    background: #25D366;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

/* Botón Urgente Asíncrono */
.cartel-urgente-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-muted);
    opacity: 0.35;
}

.cartel-urgente-btn:hover {
    opacity: 0.8;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    transform: scale(1.1);
}

.cartel-urgente-btn.is-urgent {
    opacity: 1;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
    animation: urgentPulse 2.5s infinite;
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Estado Vacío de Cartelería */
.carteleria-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    margin-top: 10px;
}

.carteleria-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.12);
    color: var(--brand-pro);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.carteleria-empty-icon i {
    width: 30px;
    height: 30px;
}

.carteleria-empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.carteleria-empty-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 440px;
    margin: 0;
}








