:root {
    --bg-color: #020617;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-primary: #a855f7;
    --accent-secondary: #06b6d4;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --whatsapp: #25d366;
    --email: #06b6d4;
    --telegram: #3b82f6;
    --salesforce: #00a1e0;
    --calendar-hour-height: 80px;
    --calendar-grid-border: rgba(255, 255, 255, 0.05);
}

:root {
    /* Typography & Motion Tokens */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --ease-out-fluid: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-delay: 0s !important;
        transition-duration: 0s !important;
    }
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.03) 0px, transparent 70%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ======================== LAYOUT ======================== */
.glass-container {
    width: 98vw;
    height: 96vh;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    /* CRITICAL: overflow:clip instead of overflow:hidden.
       overflow:hidden creates a new containing block for position:fixed children,
       trapping modals inside the container. overflow:clip does NOT do this. */
    overflow: clip;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    position: relative;
}

@media (max-width: 1024px) {
    .glass-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* ======================== SIDEBAR ======================== */
.sidebar {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid var(--glass-border);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

/* Mobile Sidebar State */
@media (max-width: 768px) {
    .glass-container {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 82vw !important;
        height: 100vh !important;
        background: #0b0f19 !important;
        z-index: 99999 !important;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.9) !important;
        transform: translate3d(-100%, 0, 0) !important;
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto !important;
    }
    .sidebar.active {
        transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
    }
    .overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.65) !important;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        z-index: 99990 !important;
        display: none;
        pointer-events: auto !important;
    }
    .overlay.active {
        display: block !important;
    }
}

.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .hamburger { display: block; }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    padding: 0 8px;
}

.aura-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 10px var(--accent-primary));
}

.logo h1 {
    font-size: 18px;
    letter-spacing: 4px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.nav-links li.active a,
.nav-links a:hover {
    background: rgba(168, 85, 247, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.nav-links li.active a {
    background: rgba(168, 85, 247, 0.18);
    color: #ffffff;
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-weight: 600;
    border-radius: 10px;
}

/* Channel Stats in Sidebar */
.sidebar-channel-stats {
    margin: 24px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.channel-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.channel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.channel-dot.whatsapp { background: var(--whatsapp); box-shadow: 0 0 6px var(--whatsapp); }
.channel-dot.email { background: var(--email); box-shadow: 0 0 6px var(--email); }
.channel-dot.telegram { background: var(--telegram); box-shadow: 0 0 6px var(--telegram); }
.channel-dot.salesforce { background: var(--salesforce); box-shadow: 0 0 6px var(--salesforce); }

.channel-name {
    flex-grow: 1;
    color: var(--text-dim);
}

.channel-count {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: var(--success);
    letter-spacing: 2px;
    font-weight: 700;
    padding: 0 8px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ======================== MAIN CONTENT ======================== */
.content {
    flex-grow: 1;
    padding: 32px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-shrink: 0;
}

header.header-with-subnav {
    margin-bottom: 14px;
}

header h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
}

.pulse-small {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    display: inline-block;
}

.welcome {
    font-size: 14px;
    color: var(--text-dim);
}

.avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 8px 20px -4px rgba(168, 85, 247, 0.5);
}

/* ======================== KPIs ======================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 20px 24px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    opacity: 0.5;
}

.kpi-card:hover {
    border-color: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.kpi-card .label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.kpi-card .value {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.kpi-card .trend {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
}

.trend.positive { color: var(--success); }
.trend.warning { color: var(--warning); }
.trend.negative { color: var(--danger); }

/* ======================== LEADS SECTION ======================== */
.leads-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.refresh-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.refresh-btn:active {
    transform: translateY(1px) scale(0.98);
}

.refresh-btn:disabled,
.refresh-btn.spinning {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    border-color: rgba(168, 85, 247, 0.3);
}

.refresh-btn .refresh-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.refresh-btn.spinning .refresh-icon {
    display: inline-block;
    animation: spin-refresh 0.8s linear infinite;
}

@keyframes spin-refresh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======================== CHANNEL TABS ======================== */
.channel-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0;
}

.channel-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}

.channel-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.channel-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.06);
}

.channel-tab[data-channel="whatsapp"].active {
    color: var(--whatsapp);
    border-bottom-color: var(--whatsapp);
    background: rgba(37, 211, 102, 0.06);
}
.channel-tab[data-channel="email"].active {
    color: var(--email);
    border-bottom-color: var(--email);
    background: rgba(6, 182, 212, 0.06);
}
.channel-tab[data-channel="telegram"].active {
    color: var(--telegram);
    border-bottom-color: var(--telegram);
    background: rgba(59, 130, 246, 0.06);
}
.channel-tab[data-channel="salesforce"].active {
    color: var(--salesforce);
    border-bottom-color: var(--salesforce);
    background: rgba(0, 161, 224, 0.06);
}

.tab-count {
    background: rgba(255,255,255,0.08);
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 11px;
    min-width: 22px;
    text-align: center;
}

.channel-tab.active .tab-count {
    background: currentColor;
    color: #000;
}

/* ======================== TABLE ======================== */
.leads-table-container {
    width: 100%;
    overflow-x: auto;
    flex-grow: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 16px 10px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.badge {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-email { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.2); }
.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #4ade80; border: 1px solid rgba(37,211,102,0.2); }
.badge-telegram { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-salesforce { background: rgba(0, 161, 224, 0.15); color: #38bdf8; border: 1px solid rgba(0,161,224,0.2); }
.badge-manual_test { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.2); }

.score-pill {
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.score-high { color: var(--success); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.score-medium { color: var(--warning); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.score-low { color: var(--danger); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-chip.pending { background: rgba(245,158,11,0.1); color: var(--warning); }
.status-chip.proposed { background: rgba(59,130,246,0.1); color: #60a5fa; }
.status-chip.approved { background: rgba(34,197,94,0.1); color: var(--success); }
.status-chip.archived { background: rgba(100,116,139,0.1); color: #64748b; }
.status-chip.ready_to_send { background: rgba(168,85,247,0.1); color: var(--accent-primary); }

.action-btn {
    background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(6,182,212,0.1));
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(168,85,247,0.3);
}

/* ======================== REFINAMIENTO DE CAMPOS (PREMIUM) ======================== */
.form-group {
    margin-bottom: 18px !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 2px;
}

.filter-input, .filter-select {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--glass-border) !important;
    color: #fff !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-input:focus, .filter-select:focus {
    border-color: var(--accent-primary) !important;
    background: rgba(168, 85, 247, 0.05) !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
    outline: none;
}

/* Consent Grid - Modern Toggle Style */
.consent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.consent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.consent-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.consent-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.consent-item:has(input:checked) {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-primary);
    color: #fff;
}

/* Timeline/Interaction Registration Refinement */
.btn-secondary-accent {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary)) !important;
    color: #000 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-secondary-accent:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4) !important;
}

/* ======================== MODAL ======================== */
.modal, .modal-backdrop {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
    /* Flexbox centering for all modals */
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Forzar ocultación si tiene clase u-hidden o display: none */
.modal.u-hidden,
.modal-backdrop.u-hidden,
.modal[style*="display: none"],
.modal[style*="display:none"],
.modal-backdrop[style*="display: none"],
.modal-backdrop[style*="display:none"] {
    display: none !important;
}

/* Activar flex centering SOLO cuando el modal está abierto */
.modal[style*="display: block"]:not([style*="display: none"]),
.modal[style*="display:block"]:not([style*="display:none"]),
.modal[style*="display: flex"]:not([style*="display: none"]),
.modal[style*="display:flex"]:not([style*="display:none"]),
.modal-backdrop[style*="display: block"]:not([style*="display: none"]),
.modal-backdrop[style*="display:block"]:not([style*="display:none"]),
.modal-backdrop[style*="display: flex"]:not([style*="display: none"]),
.modal-backdrop[style*="display:flex"]:not([style*="display:none"]) {
    display: flex !important;
}

.modal-backdrop .modal-content,
.modal .modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    margin: auto;
    width: 620px;
    max-width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.glass-card {
    background: rgba(10, 15, 35, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    position: relative;
    padding: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dim);
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    padding: 4px;
}

.close-modal:hover { color: var(--danger); }

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
}

.modal-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: -1px;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}

.modal-tab:hover { color: #fff; background: rgba(255,255,255,0.03); }
.modal-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.06);
}

.modal-panel { display: none; }
.modal-panel.active { display: block; }

/* History Timeline */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

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

.history-item:last-child { border-bottom: none; }

.history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.history-icon.whatsapp { background: rgba(37,211,102,0.15); }
.history-icon.email { background: rgba(6,182,212,0.15); }
.history-icon.telegram { background: rgba(59,130,246,0.15); }
.history-icon.salesforce { background: rgba(0,161,224,0.15); }
.history-icon.default { background: rgba(168,85,247,0.15); }

.history-body { flex-grow: 1; }
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.history-channel { font-weight: 700; font-size: 13px; }
.history-date { font-size: 11px; color: var(--text-dim); }
.history-content {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    font-style: italic;
    background: rgba(255,255,255,0.02);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Response Buttons */
.response-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    border: none;
    color: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168,85,247,0.4);
}

.btn-secondary {
    flex: 1;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-secondary-accent {
    background: linear-gradient(135deg, var(--accent-secondary), #0891b2) !important;
    border: none !important;
    color: #fff !important;
}

.btn-secondary-accent:hover {
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-style: italic;
    font-size: 14px;
}

/* ======================== CRM AGENDA & CONTACTS ======================== */
.view { display: none; width: 100%; min-height: 100%; animation: fadeIn 0.4s ease; flex-direction: column; }
.view.active { display: flex; }

.sidebar-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 800;
}

/* Contacts Filters Bar */
.contacts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    align-items: center;
}

.filter-input {
    flex-grow: 1;
    min-width: 200px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 13px;
    transition: all 0.2s;
}

.filter-input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}

.filter-select {
    background: rgba(15, 20, 45, 0.95);
    border: 1px solid var(--glass-border);
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bfa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select option {
    background-color: #0f1429;
    color: #e2e8f0;
    padding: 8px 12px;
}

.filter-select option:hover,
.filter-select option:focus,
.filter-select option:checked {
    background-color: #7c3aed;
    color: #ffffff;
}

/* Global Select Fix for Dark Themes */
select option {
    background-color: #1a1f3d !important;
    color: #ffffff !important;
}

.filter-select:focus {
    border-color: var(--accent-primary);
    color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}

/* Task Priority Badges */
.priority-chip {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.priority-urgent { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.priority-high { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.priority-medium { background: rgba(234,179,8,0.1); color: #fde047; border: 1px solid rgba(234,179,8,0.2); }
.priority-low { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }

/* Task Type Icons */
.task-type-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-box-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-secondary);
}

/* Contact List specific */
.contact-main-info {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-weight: 700;
    color: var(--text-main);
}

.contact-meta {
    font-size: 11px;
    color: var(--text-dim);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-mini {
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
}

/* Animations */
@keyframes rowFadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

#leads-body tr, #tasks-body tr, #contacts-body tr {
    animation: rowFadeIn 0.3s ease forwards;
}

/* ======================== CLIENT CARD ======================== */
.client-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.client-card-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.client-avatar-lg {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(168,85,247,0.4);
}

.client-card-info { flex-grow: 1; }

.client-contact-row {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

/* ======================== VEHICLE INTEREST CARD ======================== */
.vehicle-card {
    background: linear-gradient(135deg, rgba(15,23,42,0.9), rgba(10,15,35,0.9));
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
}

.vehicle-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-secondary), var(--accent-primary));
}

.vehicle-card-header {
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.vehicle-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    filter: drop-shadow(0 0 8px rgba(6,182,212,0.4));
}

.vehicle-title-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.vehicle-name {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.vehicle-variant {
    font-size: 12px;
    color: var(--text-dim);
}

.vehicle-tags {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
    flex-shrink: 0;
}

.vehicle-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-dim);
    white-space: nowrap;
}

.tag-finance { background: rgba(6,182,212,0.12); border-color: rgba(6,182,212,0.2); color: var(--accent-secondary); }
.tag-trade { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.2); color: var(--warning); }

.vehicle-card-body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-budget {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 10px 14px;
}

.vehicle-budget-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}

.vehicle-budget-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -0.3px;
}

/* Ad Source Block */
.ad-source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.04);
}

.ad-source-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-source-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.ad-source-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.ad-source-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.ad-source-id {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 1px;
}

.ad-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-secondary);
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.25);
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.ad-link-btn:hover {
    background: var(--accent-secondary);
    color: #000;
}

/* Urgency Badge */
.urgency-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.urgency-alta, .urgency-compra-inmediata {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--danger);
}
.urgency-media {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    color: var(--warning);
}
.urgency-baja, .urgency-solo-explorando {
    background: rgba(100,116,139,0.12);
    border: 1px solid rgba(100,116,139,0.25);
    color: #64748b;
}

/* Section Boxes */
.section-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}

.section-box-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-textarea {
    width: 100%;
    height: 90px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: var(--font-sans);
}

/* ======================== UTILITIES ======================== */
.u-hidden { display: none; }
.u-mt-0 { margin-top: 0 !important; }
.u-mb-20 { margin-bottom: 20px; }
.u-mt-20 { margin-top: 20px; }
.w-full { width: 100%; }
.grid-2-col { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 12px; 
}
.text-lg { font-size: 18px; }
.text-dim-small { color: var(--text-dim); font-size: 14px; }

/* ======================== COMPONENT REFINEMENTS ======================== */
.btn-primary-compact {
    width: auto !important;
    padding: 10px 20px !important;
}

.contacts-count-text {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.section-box-limited {
    max-width: 600px;
}
.modal-w-large {
    width: min(900px, 95vw) !important;
}

/* ======================== LEAD & CONTACT MODAL (Aura Pro Ultra Wide) ======================== */
.modal-lead-detail,
#lead-modal .modal-content,
#contact-modal .modal-content {
    width: min(1200px, 94vw) !important;
    max-height: 90vh !important;
    padding: 28px 32px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

/* Scrollbars personalizadas premium (Dark Glass) sin barra horizontal */
.modal-lead-detail::-webkit-scrollbar,
#lead-modal .modal-content::-webkit-scrollbar,
#contact-modal .modal-content::-webkit-scrollbar,
.timeline-chat::-webkit-scrollbar {
    width: 6px !important;
    height: 0px !important; /* Elimina scrollbar horizontal fea */
}

.modal-lead-detail::-webkit-scrollbar-track,
#lead-modal .modal-content::-webkit-scrollbar-track,
#contact-modal .modal-content::-webkit-scrollbar-track,
.timeline-chat::-webkit-scrollbar-track {
    background: transparent !important;
}

.modal-lead-detail::-webkit-scrollbar-thumb,
#lead-modal .modal-content::-webkit-scrollbar-thumb,
#contact-modal .modal-content::-webkit-scrollbar-thumb,
.timeline-chat::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.35) !important;
    border-radius: 6px !important;
}

.modal-lead-detail::-webkit-scrollbar-thumb:hover,
#lead-modal .modal-content::-webkit-scrollbar-thumb:hover,
#contact-modal .modal-content::-webkit-scrollbar-thumb:hover,
.timeline-chat::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.65) !important;
}

@supports (scrollbar-width: thin) {
    .modal-lead-detail,
    #lead-modal .modal-content,
    #contact-modal .modal-content,
    .timeline-chat {
        scrollbar-width: thin;
        scrollbar-color: rgba(168, 85, 247, 0.35) transparent;
    }
}

.modal-w-medium {
    width: min(520px, 95vw) !important;
}

.textarea-short {
    height: 70px !important;
}
/* ======================== PROFILE LAYOUT (Walcu Inspired) ======================== */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(460px, 500px) 1fr;
    gap: 28px;
    height: 100%;
    min-width: 0;
    overflow-x: hidden;
}

@media (max-width: 1100px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.profile-info-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    overflow-x: hidden;
}

.profile-timeline-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255,255,255,0.015);
    border-radius: 20px;
    padding: 22px;
    border: 1px solid var(--glass-border);
    min-width: 0;
    overflow-x: hidden;
}

/* Timeline Conversation Styles */
.timeline-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    animation: bubbleSlide 0.3s ease-out;
}

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

.chat-incoming {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.chat-outgoing {
    align-self: flex-end;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-bottom-right-radius: 4px;
}

.chat-meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-channel-icon {
    font-size: 14px;
    margin-left: 8px;
}

/* System Event Bubble */
.event-bubble {
    align-self: center;
    background: rgba(255,255,255,0.03);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Call Transcription Component */
.transcription-box {
    background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(168,85,247,0.1));
    border: 1px dashed var(--accent-secondary);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
}

.transcription-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 8px;
}

.transcription-text {
    font-size: 12px;
    font-style: italic;
    color: #e2e8f0;
}

/* Overlay for Mobile */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
}

.overlay.active { display: block; }

/* Chat Composer (Walcu Style) */
.chat-composer {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
}

.chat-composer:focus-within {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.composer-input {
    flex-grow: 1;
    min-width: 80px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 8px 4px;
    outline: none;
}

.composer-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    flex-shrink: 0;
}

.composer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.composer-btn.recording {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.composer-btn-send {
    background: var(--accent-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.composer-btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.composer-btn-wa {
    background: #25D366 !important;
    width: auto !important;
    padding: 0 14px !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.composer-btn-wa:hover {
    background: #20ba59 !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4) !important;
}

.composer-btn-note {
    background: rgba(255, 255, 255, 0.1) !important;
    width: auto !important;
    padding: 0 10px !important;
    gap: 4px !important;
    font-size: 12px !important;
    color: var(--text-dim) !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.composer-btn-note:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.pulse-red {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* ===== USER MANAGEMENT & SECURITY PANEL ===== */

.config-security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
    padding: 0.25rem 0;
}

.security-card {
    padding: 1.5rem;
    border-radius: 1rem;
}

.security-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.security-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.security-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.security-card-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.security-info-list { display: flex; flex-direction: column; gap: 0.75rem; }
.security-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.03);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}
.security-info-label { font-size: 0.8rem; color: var(--text-muted); }
.security-info-value { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

.security-msg {
    padding: 0.65rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.75rem;
}
.security-msg-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.security-msg-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Users table badge pills */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-active { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.status-suspended { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }

.role-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: #c4b5fd;
}

.actions-cell { display: flex; gap: 0.4rem; align-items: center; }

.btn-icon-action {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.btn-icon-action.btn-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.btn-icon-action.btn-warning:hover { background: rgba(245, 158, 11, 0.3); }
.btn-icon-action.btn-info { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.btn-icon-action.btn-info:hover { background: rgba(59, 130, 246, 0.3); }
.btn-icon-action.btn-danger { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.btn-icon-action.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.muted-text { color: var(--text-muted); font-size: 0.82rem; font-style: italic; }
.required-star { color: #f87171; }
.u-mb-20 { margin-bottom: 1.25rem; }/* ======================== AURA DIALER PREMIUM ======================== */
#aura-dialer-container {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 320px;
    z-index: 100000;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#aura-dialer-container.dialer-hidden {
    opacity: 0;
    transform: translateY(40px) scale(0.85);
    pointer-events: none;
}

.dialer-content {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.75), 
                0 0 30px rgba(168, 85, 247, 0.15);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.dialer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.dialer-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dialer-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.dialer-header h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    opacity: 0.8;
}

.dialer-header button {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dialer-header button:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.dialer-screen {
    background: rgba(0,0,0,0.4);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.03);
}

.dialer-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dialer-prefix-pill {
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #d8b4fe;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1.4;
}

.dialer-prefix-pill:hover {
    background: rgba(168, 85, 247, 0.35);
    border-color: rgba(168, 85, 247, 0.8);
    color: #fff;
    transform: scale(1.05);
}

.dialer-prefix-pill:active {
    transform: scale(0.95);
}

#dialer-number {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    outline: none;
    letter-spacing: 1px;
}

#dialer-number::placeholder {
    color: rgba(255,255,255,0.2);
    font-size: 18px;
}

#call-status {
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dialer-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.key {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
}

.key:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.key:active {
    transform: scale(0.95);
    background: var(--accent-primary);
}

.dialer-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    align-items: center;
}

.btn-action {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    width: 54px;
    height: 54px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-action.call {
    background: var(--success);
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 22px;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.btn-action.call.active {
    background: var(--danger);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

.btn-action:hover:not(.call) {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(168, 85, 247, 0.4);
    z-index: 1001;
    transition: all 0.25s var(--ease-out-fluid);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======================== CONNECTIONS GRID ======================== */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.connection-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.connection-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.connection-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connection-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.connection-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 20px;
}

.connection-actions {
    display: flex;
    justify-content: flex-end;
}

.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ======================== ANIMATIONS & TOASTS ======================== */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

#notification-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 300px;
    animation: toast-in 0.35s var(--ease-out-fluid) forwards;
}

.toast.success { border: 1px solid rgba(34, 197, 94, 0.4); box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 16px rgba(34, 197, 94, 0.15); }
.toast.error { border: 1px solid rgba(239, 68, 68, 0.4); box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 16px rgba(239, 68, 68, 0.15); }
.toast.info { border: 1px solid rgba(6, 182, 212, 0.4); box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 16px rgba(6, 182, 212, 0.15); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(50px) scale(0.9); }
}

/* ======================== TRASH & SELECTION ======================== */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-trash-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.btn-trash-toggle:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-trash-toggle.active {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-trash-toggle .badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

.selection-action-bar {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(168, 85, 247, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.selection-info {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.selection-btns {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.action-btn.delete:hover {
    background: #ef4444;
    color: white;
}

.qa-btn.qa-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-action.delete {
    background: var(--danger);
    color: #fff;
}

.btn-action.restore {
    background: var(--success);
    color: #fff;
}

.btn-action.cancel {
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
    border-color: var(--glass-border);
}

.btn-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    margin: 0;
    font: inherit;
    color: var(--accent-primary);
    width: 18px;
    height: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--accent-primary);
    background-color: CanvasText;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:checked {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.1);
}

.trash-mode-active .leads-section {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.02);
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.u-hidden { display: none !important; }

/* Selection Columns */
.col-selection {
    width: 40px;
    text-align: center;
}

.vehicle-text, .brand-text {
    font-size: 12px;
    font-weight: 500;
}

.date-text {
    font-size: 12px;
    color: var(--text-dim);
}

/* Inline Form Helpers */
.inline-contact-form .form-group {
    margin-bottom: 0 !important;
}

/* ======================== CALENDAR & AGENDA 2.0 ======================== */
:root {
    --calendar-grid-border: rgba(255, 255, 255, 0.05);
    --calendar-hour-height: 80px;
    --calendar-day-width: 1fr;
}

.agenda-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.view-switcher {
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-primary);
}

.current-period {
    font-size: 16px;
    font-weight: 700;
    min-width: 180px;
    text-align: center;
}

/* Calendar Grid Layout */
.calendar-view {
    display: flex;
    flex-direction: column;
    height: 700px; /* Fixed height for scrolling */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
}

.calendar-header-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.header-cell {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    border-right: 1px solid var(--calendar-grid-border);
}

.header-cell.today {
    color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.05);
}

.header-cell .day-num {
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

.calendar-body-scroll {
    overflow-y: auto;
    flex: 1;
}

.calendar-body-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    position: relative;
    min-height: 100%;
}

.time-col {
    border-right: 1px solid var(--calendar-grid-border);
}

.time-cell {
    height: calc(var(--calendar-hour-height) / 2);
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
    padding-top: 4px;
    border-bottom: 1px solid var(--calendar-grid-border);
}

.time-cell.sub-hour {
    font-size: 8px;
    opacity: 0.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.day-col {
    position: relative;
    border-right: 1px solid var(--calendar-grid-border);
    background: 
        repeating-linear-gradient(
            transparent,
            transparent calc(var(--calendar-hour-height) / 2 - 1px),
            rgba(255, 255, 255, 0.03) calc(var(--calendar-hour-height) / 2 - 1px),
            rgba(255, 255, 255, 0.03) calc(var(--calendar-hour-height) / 2)
        ),
        repeating-linear-gradient(
            transparent,
            transparent calc(var(--calendar-hour-height) - 1px),
            var(--calendar-grid-border) calc(var(--calendar-hour-height) - 1px),
            var(--calendar-grid-border) var(--calendar-hour-height)
        );
    min-height: calc(15 * var(--calendar-hour-height)); /* 15 horas (8-22) */
}

.day-col.today {
    background-color: rgba(168, 85, 247, 0.01);
}

/* Calendar Cards */
.task-card {
    position: absolute;
    left: 4px;
    right: 4px;
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-fluid);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.task-card:hover {
    transform: scale(1.02);
    z-index: 20;
    background: rgba(168, 85, 247, 0.25);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.task-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.task-card .task-time {
    font-weight: 800;
    font-size: 10px;
    margin-bottom: 4px;
    opacity: 0.8;
    display: flex;
    justify-content: space-between;
}

.task-card .task-title {
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card .task-client {
    font-size: 11px;
    color: var(--text-dim);
}

/* Task Types Colors */
.task-card.type-call { border-color: var(--accent-secondary); background: rgba(6, 182, 212, 0.15); }
.task-card.type-whatsapp { border-color: var(--whatsapp); background: rgba(37, 211, 102, 0.15); }
.task-card.type-meeting { border-color: var(--warning); background: rgba(245, 158, 11, 0.15); }

/* Quick Actions on Hover */
.task-quick-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-quick-actions {
    opacity: 1;
}

.qa-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qa-btn:hover {
    background: var(--accent-primary);
}

/* Conflict highlight */
.task-conflict {
    border: 2px dashed var(--danger) !important;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: var(--danger); box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { border-color: transparent; box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }
    100% { border-color: var(--danger); box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
}

/* Now line */
.calendar-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--danger);
    z-index: 100;
    pointer-events: none;
}

.calendar-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

/* Ghost shadow during drag */
.drag-ghost-shadow {
    position: absolute;
    left: 4px;
    right: 4px;
    background: rgba(168, 85, 247, 0.05);
    border: 1px dashed var(--accent-primary);
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
}

.task-card.is-saving {
    opacity: 0.7;
    filter: grayscale(0.5);
    cursor: wait;
}

/* Inline Contact Form in Modal */
.inline-contact-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    display: none;
}

.inline-contact-form.active {
    display: block;
}

.inline-contact-form h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--accent-secondary);
}

/* Row Actions Table */
.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Table row action buttons (icon-only 32x32) */
.row-actions .action-btn,
.action-btn.icon-only,
.action-btn-icon,
td > .action-btn:empty,
td > .action-btn:only-child:not([style*="padding"]) {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.action-btn {
    width: auto;
    min-width: fit-content;
    height: auto;
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.action-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.action-btn.delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.qa-btn.qa-delete:hover {
    background: #ef4444 !important;
    color: white;
    border-color: #ef4444 !important;
}

/* ==========================================================================
   --- APPOINTMENT CARD & MODAL ACTIONS (PREMIUM REDESIGN) ---
   ========================================================================== */
.appointment-card-premium {
    position: relative;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 16px;
    backdrop-filter: blur(16px);
    transition: all 0.25s ease;
    overflow: hidden;
}

.appointment-card-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.appointment-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.appointment-meta-pills {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.appointment-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    color: #e2e8f0;
}

.appointment-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.btn-app-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.btn-app-edit {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

.btn-app-edit:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.5);
}

.btn-app-calendar {
    background: rgba(255, 255, 255, 0.07);
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-app-calendar:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-app-call-aurora {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

.btn-app-call-aurora:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.5);
}

/* Contact Direct Actions */
.direct-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.direct-contact-phone {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.direct-contact-phone:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(-1px);
}

.direct-contact-wa {
    background: #25d366;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

.direct-contact-wa:hover {
    background: #20ba5a;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.45);
}

.btn-danger {
    background: #ef4444;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ======================== FORM GRID UTILITIES ======================== */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ======================== HOT LEADS ======================== */
.lead-hot {
    background: rgba(239, 68, 68, 0.05) !important;
}

.hot-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 8px;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    animation: pulse-hot 2s infinite;
}

@keyframes pulse-hot {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(239, 68, 68, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
}

/* ======================== PREMIUM VEHICLE INFO GRID ======================== */
.vehicle-info-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 5px;
}

.vehicle-info-grid .section-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vehicle-info-grid .section-box:hover {
    border-color: rgba(168, 85, 247, 0.25) !important;
    box-shadow: 0 12px 40px 0 rgba(168, 85, 247, 0.08) !important;
    transform: translateY(-2px);
}

.vehicle-info-grid .grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

.vehicle-info-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vehicle-info-grid .form-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: var(--text-dim) !important;
    margin-bottom: 2px !important;
}

.vehicle-info-grid .filter-input, 
.vehicle-info-grid .filter-select {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.vehicle-info-grid .filter-input:focus, 
.vehicle-info-grid .filter-select:focus {
    border-color: var(--accent-primary) !important;
    background: rgba(168, 85, 247, 0.06) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15) !important;
}

.consent-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 12px !important;
}

.consent-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-dim) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.consent-item:hover {
    background: rgba(168, 85, 247, 0.05) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.consent-item:has(input:checked) {
    background: rgba(168, 85, 247, 0.12) !important;
    border-color: var(--accent-primary) !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15) !important;
}

.vehicle-info-grid .response-actions {
    display: flex;
    justify-content: flex-end;
}

.vehicle-info-grid .btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), rgba(168, 85, 247, 0.8)) !important;
    border: none !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.vehicle-info-grid .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5) !important;
}

@media (max-width: 768px) {
    .vehicle-info-grid .grid-2-col {
        grid-template-columns: 1fr !important;
    }
}

/* ======================== PLAN MOVES III (AutoIA Solutions) ======================== */
.moves-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.moves-client-card, .moves-drive-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 10px;
}

.moves-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
}

.moves-card-field:last-child {
    border-bottom: none;
}

.moves-card-field .m-label {
    color: var(--text-dim);
    font-weight: 500;
}

.moves-card-field .m-value {
    color: var(--text-main);
    font-weight: 600;
}

.moves-upload-zone {
    border: 2px dashed rgba(168, 85, 247, 0.3);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 18px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.moves-upload-zone:hover, .moves-upload-zone.dragover {
    border-color: var(--accent-secondary);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.moves-upload-zone .upload-icon {
    font-size: 32px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 8px var(--accent-secondary));
}

.moves-upload-zone h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.moves-upload-zone p {
    font-size: 12px;
    color: var(--text-dim);
}

.moves-processing {
    text-align: center;
    padding: 30px;
}

.moves-processing .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.05);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 16px;
}

.moves-processing p {
    font-size: 13px;
    color: var(--text-dim);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.moves-scorecard-results {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
}

.moves-scorecard-results h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scorecard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.scorecard-item:last-child {
    border-bottom: none;
}

.scorecard-field-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scorecard-field-info .sc-name {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scorecard-field-info .sc-compare {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

.scorecard-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scorecard-badge.ok {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
}

.scorecard-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

.moves-result-summary {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.moves-result-summary.all-ok {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.moves-result-summary.has-errors {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.moves-link-doc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    margin: 4px;
}

.moves-link-doc:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
}

.moves-table-actions {
    display: flex;
    gap: 10px;
}

#moves-filter-status {
    margin: 0 !important;
}

.moves-muted-note {
    font-size: 12px !important;
}

#moves-file-input {
    display: none !important;
}

#btn-moves-open-folder {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
    width: 100% !important;
}

/* ======================== MOVES III VALIDATION MODAL CLASSES ======================== */
.moves-title-mb-12 {
    margin-bottom: 12px;
}

.moves-dual-tab-container {
    padding: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.moves-dual-tab-button {
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    border-radius: 6px;
}

.moves-dual-tab-badge {
    font-size: 10px;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239,68,68,0.1);
    color: var(--status-rejected);
}

.moves-scorecard-panel {
    border: 1px solid rgba(255,255,255,0.06);
    padding: 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.01);
}

.moves-edit-form-panel {
    border: 1px solid rgba(255,255,255,0.06);
    padding: 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.01);
    margin-top: 15px;
}

.moves-accent-title {
    color: var(--accent-secondary);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.moves-input-bg-transparent {
    background: rgba(255,255,255,0.03);
}

.moves-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.moves-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.moves-warning-padding {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    margin-top: 10px;
}

.moves-action-margin {
    margin-top: 15px;
}

.moves-summary-panel {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    margin-top: 20px;
}

.moves-summary-title {
    font-size: 12px;
    margin-bottom: 10px;
}

.moves-summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moves-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.moves-summary-total-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 8px;
    font-size: 13px;
    font-weight: 800;
}

.moves-action-buttons-margin {
    margin-top: 20px;
}

/* ======================== MOVES III EXTRA WIDE & OPTIMIZED VIEWS ======================== */
.modal-w-xlarge {
    width: 1100px !important;
    max-width: 95vw !important;
}

#moves-modal .modal-content {
    max-height: 90vh !important;
    overflow-y: auto !important;
}

@supports (scrollbar-width: thin) {
    #moves-modal .modal-content {
        scrollbar-width: thin;
        scrollbar-color: var(--glass-border) transparent;
    }
}

#moves-modal .modal-content::-webkit-scrollbar {
    width: 6px;
}

#moves-modal .modal-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

#moves-modal .close-modal {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}

#moves-modal .close-modal:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg) scale(1.1);
}

.grid-1-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ===================== BOTONES TABLA MOVES ===================== */
.moves-actions-container {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-width: 190px;
}

.btn-moves-action-drive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    flex: 1;
}

.btn-moves-action-drive:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.btn-moves-action-update {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #d8b4fe;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex: 1;
}

.btn-moves-action-update:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
    color: #f3e8ff;
}

.btn-moves-action-validate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 190px;
    padding: 7px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-moves-action-validate:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

/* ======================== LINT FIXES (NO INLINE STYLES) ======================== */
.sf-table-actions-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sf-search-input-width {
    min-width: 220px;
}

.contact-address-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.my-2 {
    margin-top: 10px;
    margin-bottom: 10px;
}

.quote-total-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: right;
}

.quote-total-label {
    font-size: 11px;
    color: var(--text-dim);
}

.quote-total-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-secondary);
}

.quote-financing-box {
    background: rgba(16, 185, 129, 0.05);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    margin-top: 10px;
}

/* ======================== PIPELINE KANBAN VIEW ======================== */
.pipeline-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
    height: calc(100vh - 200px);
    align-items: flex-start;
}

.pipeline-column {
    flex: 1;
    min-width: 300px;
    max-width: 380px;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pipeline-column:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.column-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.column-amount {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-secondary);
}

.column-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 4px;
    min-height: 150px;
}

.opportunity-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.opportunity-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.opp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.opp-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.3;
}

.opp-card-score {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.opp-card-score.hot {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.opp-card-vehicle {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.opp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.opp-card-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-secondary);
}

.opp-card-date {
    font-size: 10px;
    color: var(--text-dim);
}

.opp-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.opp-card-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}

.pipeline-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.pipeline-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pipeline-mode-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ======================== FUNNEL VIEW ======================== */
.funnel-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}
.funnel-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.funnel-stat-card {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.funnel-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}
.funnel-stat-title {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 8px;
}
.funnel-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.funnel-stat-subtitle {
    font-size: 11px;
    color: #64748b;
}
.funnel-container-visual {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.funnel-step {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.funnel-step-shape {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
    padding: 0 24px;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto; /* center alignment */
}
.funnel-step-shape:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transform: scale(1.01);
}
.funnel-step-name {
    font-weight: 600;
    font-size: 13px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.funnel-step-count {
    font-weight: 800;
    font-size: 15px;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.funnel-step-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    width: 60px;
    text-align: right;
    font-family: monospace;
}

/* Gradients for each step to look incredibly high-premium */
.step-total-leads .funnel-step-shape {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.step-qualified-leads .funnel-step-shape {
    background: linear-gradient(90deg, #ec4899 0%, #be185d 100%);
    border: 1px solid rgba(236, 72, 153, 0.2);
}
.step-opportunities .funnel-step-shape {
    background: linear-gradient(90deg, #f59e0b 0%, #b45309 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.step-quotes .funnel-step-shape {
    background: linear-gradient(90deg, #8b5cf6 0%, #6d28d9 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.step-won .funnel-step-shape {
    background: linear-gradient(90deg, #10b981 0%, #047857 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Hermes Workspace Interactive Elements */
.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(-1px);
}

/* ==========================================================================
   CALENDARIO NATIVO DE CITAS DE AURORA
   ========================================================================== */

.calendar-main-card {
    border-radius: 16px;
    background: rgba(18, 24, 38, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 0 10px;
    min-width: 170px;
}

.btn-icon-cal {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-cal:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #fff;
    transform: scale(1.05);
}

.btn-today-cal {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 0 12px;
    height: 34px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-today-cal:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

.calendar-view-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-switch-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cal-switch-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.cal-switch-btn.active {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

/* Cuadrícula del Calendario */
.calendar-grid-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.calendar-weekdays-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.cal-th-col {
    padding: 6px 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cal-th-col.is-weekend {
    color: #64748b;
}

.cal-th-col.is-today-col {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    font-weight: 800;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    min-height: 500px;
    width: 100%;
}

.calendar-day-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    min-height: 104px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    transition: all 0.2s ease;
}

.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(168, 85, 247, 0.3);
}

.calendar-day-cell.weekend-cell {
    background: rgba(255, 255, 255, 0.01);
}

.calendar-day-cell.other-month {
    opacity: 0.35;
    background: transparent;
}

.calendar-day-cell.today {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.45);
    box-shadow: inset 0 0 16px rgba(168, 85, 247, 0.12), 0 0 10px rgba(168, 85, 247, 0.15);
}

.cal-day-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cal-day-label-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-day-weekday-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day-cell.today .cal-day-weekday-tag {
    color: #c084fc;
    font-weight: 800;
}

.cal-day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 5px;
}

.calendar-day-cell.today .cal-day-number {
    background: #a855f7;
    color: #fff;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.cal-today-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.5);
    letter-spacing: 0.05em;
}

.cal-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.cal-event-pill {
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: 6px;
    margin-bottom: 2px;
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.cal-event-pill:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cal-event-time-badge {
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: -0.02em;
}

.cal-sede-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.cal-event-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-event-pill.event-testdrive {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

.cal-event-pill.event-visit {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.cal-event-pill.event-aurora {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.35);
}

.cal-event-pill.event-call {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

.cal-event-pill.event-completed {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
    text-decoration: line-through;
    opacity: 0.8;
}

.cal-event-pill.event-completed:hover {
    filter: none;
    opacity: 1;
}

/* Vista Semana (Weekly Columnar Grid) */
.calendar-week-container {
    width: 100%;
    margin-top: 8px;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    min-height: 520px;
    width: 100%;
}

.calendar-week-col {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.calendar-week-col:hover {
    border-color: rgba(168, 85, 247, 0.25);
}

.calendar-week-col.weekend {
    background: rgba(255, 255, 255, 0.01);
}

.calendar-week-col.today {
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.1);
}

.calendar-week-col-header {
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.calendar-week-col.today .calendar-week-col-header {
    background: rgba(168, 85, 247, 0.18);
    border-bottom-color: rgba(168, 85, 247, 0.35);
}

.cal-week-dayname {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.calendar-week-col.today .cal-week-dayname {
    color: #c084fc;
    font-weight: 800;
}

.cal-week-daynum-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cal-week-daynum {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
}

.calendar-week-col.today .cal-week-daynum {
    color: #a855f7;
}

.cal-week-month {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.cal-week-events-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.cal-week-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 6px 0;
}

.cal-week-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cal-week-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

.cal-week-card.event-testdrive {
    border-left: 3px solid #10b981;
}

.cal-week-card.event-visit {
    border-left: 3px solid #38bdf8;
}

.cal-week-card.event-aurora {
    border-left: 3px solid #a855f7;
}

.cal-week-card.event-call {
    border-left: 3px solid #f59e0b;
}

.cal-week-card.event-completed {
    border-left: 3px solid #64748b;
    opacity: 0.65;
}

.cal-week-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.cal-week-card-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: #cbd5e1;
}

.cal-week-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.35;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cal-week-card-customer {
    font-size: 0.72rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-week-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.cal-week-card-action {
    color: #c084fc;
    font-weight: 600;
}

/* Vista Agenda */
.calendar-agenda-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agenda-day-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-day-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: #94a3b8;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-day-header.today {
    color: #a855f7;
}

.agenda-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-fluid);
    flex-wrap: wrap;
}

.agenda-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateX(4px);
}

.agenda-card-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
    min-width: 65px;
}

.agenda-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agenda-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}

.agenda-card-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.agenda-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modales de Citas */
.appointment-detail-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.appointment-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.appointment-notes-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

/* ==========================================================================
   --- EXTENSIÓN CONFIGURACIÓN AURORA IA & LIVE SANDBOX ---
   ========================================================================== */

.aurora-config-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(236, 72, 153, 0.08) 50%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    gap: 1.5rem;
    flex-wrap: wrap;
}

.aurora-banner-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 280px;
}

.aurora-avatar-glow {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.aurora-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.pulse-green {
    animation: pulse-aura-green 2s infinite;
}

@keyframes pulse-aura-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.aurora-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.aurora-title-row h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.badge-primary-glow {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.aurora-banner-desc {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

.aurora-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Status Bar */
.aurora-status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.aurora-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aurora-status-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

.aurora-status-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.aurora-status-val code {
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: #38bdf8;
}

/* Grid Layout */
.aurora-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .aurora-settings-grid {
        grid-template-columns: 1fr;
    }
}

.aurora-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.aurora-card-wide {
    grid-column: 1 / -1;
}

.aurora-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aurora-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.6rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.aurora-card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.aurora-card-header p {
    margin: 0.15rem 0 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

/* Presets & Pills */
.aurora-presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.preset-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.preset-pill:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: #ffffff;
}

.preset-pill.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.2));
    border-color: #8b5cf6;
    color: #e9d5ff;
    font-weight: 600;
}

/* Slider */
.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.aurora-range-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.35rem;
}

/* Info Box */
.aurora-info-box {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    margin-top: 0.5rem;
}

.info-box-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.info-box-content {
    font-size: 0.78rem;
    color: #bae6fd;
    line-height: 1.45;
}

.info-box-content strong {
    color: #e0f2fe;
    display: block;
    margin-bottom: 0.2rem;
}

.info-box-content p {
    margin: 0;
}

/* Rule Chips */
.aurora-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.rule-chip {
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 0.75rem;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.rule-chip:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #a855f7;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Live Sandbox Styles */
.aurora-sandbox-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.sandbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .sandbox-grid {
        grid-template-columns: 1fr;
    }
}

.sandbox-input-col {
    display: flex;
    flex-direction: column;
}

.aurora-test-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.test-case-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.test-case-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.sandbox-output-col {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.85rem;
    padding: 1.25rem;
}

.sandbox-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sandbox-badge-whatsapp {
    font-size: 0.75rem;
    font-weight: 700;
    color: #22c55e;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sandbox-metrics {
    display: flex;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

.metric-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.sandbox-chat-bubble {
    flex: 1;
    background: #0b141a;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.75rem 0.75rem 0.75rem 0.15rem;
    padding: 1rem 1.15rem;
    min-height: 140px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.bubble-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 0.4rem;
}

.bubble-content {
    font-size: 0.88rem;
    color: #e2e8f0;
}

/* Slider */
.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.aurora-range-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.35rem;
}

/* Info Box */
.aurora-info-box {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    margin-top: 0.5rem;
}

.info-box-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.info-box-content {
    font-size: 0.78rem;
    color: #bae6fd;
    line-height: 1.45;
}

.info-box-content strong {
    color: #e0f2fe;
    display: block;
    margin-bottom: 0.2rem;
}

.info-box-content p {
    margin: 0;
}

/* Rule Chips */
.aurora-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.rule-chip {
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 0.75rem;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.rule-chip:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #a855f7;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Live Sandbox Styles */
.aurora-sandbox-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.sandbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .sandbox-grid {
        grid-template-columns: 1fr;
    }
}

.sandbox-input-col {
    display: flex;
    flex-direction: column;
}

.aurora-test-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.test-case-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.test-case-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.sandbox-output-col {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.85rem;
    padding: 1.25rem;
}

.sandbox-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sandbox-badge-whatsapp {
    font-size: 0.75rem;
    font-weight: 700;
    color: #22c55e;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sandbox-metrics {
    display: flex;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

.metric-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.sandbox-chat-bubble {
    flex: 1;
    background: #0b141a;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.75rem 0.75rem 0.75rem 0.15rem;
    padding: 1rem 1.15rem;
    min-height: 140px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.bubble-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 0.4rem;
}

.bubble-content {
    font-size: 0.88rem;
    color: #e2e8f0;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.sandbox-bubble-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* =========================================================
   🖨️ ESTILOS DE IMPRESIÓN OFICIALES (A4 ESTADILLO TALLER)
   ========================================================= */
@media print {
    /* Ocultar elementos de UI no imprimibles */
    body * {
        visibility: hidden !important;
    }

    /* Mostrar únicamente el área de estadillo */
    #printable-estadillo-area,
    #printable-estadillo-area * {
        visibility: visible !important;
    }

    #printable-estadillo-area {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    #estadillo-table {
        width: 100% !important;
        border: 1px solid #000000 !important;
        font-size: 8pt !important;
    }

    #estadillo-table th,
    #estadillo-table td {
        border: 1px solid #cccccc !important;
        padding: 4px 6px !important;
        color: #000000 !important;
    }

    #estadillo-table th {
        background-color: #f1f5f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-weight: bold !important;
    }

    @page {
        size: landscape;
        margin: 10mm;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   📅 PLANIFICADOR SEMANAL & CARGA DE TALLER (MOSS DRIVE SALAMANCA)
   ═══════════════════════════════════════════════════════════════════════════ */
.taller-planner-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
}

@media (max-width: 1200px) {
    .taller-planner-grid {
        grid-template-columns: repeat(3, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .taller-planner-grid {
        grid-template-columns: 1fr;
    }
}

.taller-day-col {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    transition: border-color 0.2s;
}

.taller-day-col.today {
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.08);
}

.taller-day-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.taller-day-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #f8fafc;
}

.taller-day-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.taller-day-cards {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.taller-planner-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 10px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
    cursor: grab;
    user-select: none;
}

.taller-planner-card:active {
    cursor: grabbing;
}

.taller-planner-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.taller-planner-card.is-dragging {
    opacity: 0.35;
    transform: scale(0.96);
    border-color: #a855f7 !important;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}

.planner-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.planner-time-badge:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
    color: #fff;
    transform: scale(1.04);
}

.taller-day-col {
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.taller-day-col.drag-target-active {
    background: rgba(168, 85, 247, 0.15) !important;
    border: 2px dashed #a855f7 !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35) !important;
}

.taller-day-cards {
    min-height: 120px;
}

.taller-add-card-btn {
    margin-top: 10px;
    padding: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.taller-add-card-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
    color: #f8fafc;
    transform: translateY(-1px);
}

/* Autocomplete de Búsqueda Rápida en Modal Taller */
.taller-autocomplete-container {
    position: relative;
}

.taller-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
    z-index: 10050;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
}

.taller-autocomplete-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.taller-autocomplete-item:last-child {
    border-bottom: none;
}

.taller-autocomplete-item:hover {
    background: rgba(168, 85, 247, 0.25);
}

.taller-planner-card.status-TERMINADO {
    border-color: rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.08);
}

.taller-planner-card.status-EN_TALLER {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 0 12px rgba(251, 146, 60, 0.08);
}

.taller-planner-card.status-ESPERA_RECAMBIOS {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.08);
}

.taller-planner-card.status-EN_RECEPCION {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.08);
}

.taller-planner-card.status-PENDIENTE {
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.08);
}

/* ==========================================================================
   📱 ADAPTABILIDAD RESPONSIVE: TALLER, CHECKLIST E INSPECCIÓN VISUAL
   ========================================================================== */
@media (max-width: 768px) {
    /* Modales adaptados a pantallas móviles */
    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        margin: 8px auto !important;
        padding: 14px !important;
        max-height: 94vh !important;
        border-radius: 14px !important;
    }

    /* Grids en modales que deben apilarse verticalmente */
    #taller-checklist-modal div[style*="grid-template-columns: 1fr 1.5fr"],
    #taller-checklist-modal div[style*="grid-template-columns: 1fr 1fr"],
    #taller-cost-modal div[style*="grid-template-columns: 1fr 1fr"],
    #incadea-connection-modal div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Botones de combustible en recepción taller */
    #chk-fuel-buttons {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .btn-fuel {
        flex: 1 1 45px !important;
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
    }

    /* Firma táctil fluida */
    #chk-signature-canvas {
        width: 100% !important;
        height: 120px !important;
    }

    /* Toolbar de taller en móviles */
    .taller-toolbar-header,
    .taller-toolbar-filters,
    .taller-toolbar-subbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .taller-toolbar-header > div,
    .taller-toolbar-filters > div,
    .taller-toolbar-subbar > div {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }

    #taller-filter-status,
    #taller-filter-brand,
    #btn-taller-fleet-toggle,
    #btn-taller-anniv-toggle {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* Acciones en tabla de O.R. */
    #taller-table td {
        font-size: 0.8rem !important;
        padding: 8px 6px !important;
    }
}

/* ==========================================================================
   🟦 TALLER: RECTÁNGULO HOMOGÉNEO DE BOTONES DE ACCIÓN
   ========================================================================== */
.taller-master-header {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.taller-buttons-rectangle {
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}

.taller-buttons-rectangle button {
    transition: all 0.15s ease-in-out !important;
    letter-spacing: -0.2px;
}

.taller-buttons-rectangle button:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

@media (max-width: 1100px) {
    .taller-master-header {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .taller-buttons-rectangle {
        width: 100% !important;
    }
}

@media (max-width: 600px) {
    .taller-buttons-rectangle {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        padding: 6px !important;
    }
    .taller-buttons-rectangle button {
        font-size: 0.72rem !important;
        padding: 0 4px !important;
    }
}

/* ======================== UNIFIED VIEW SUBNAV BAR ======================== */
.view-subnav-bar {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 5px;
    gap: 6px;
    margin-bottom: 22px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-width: 100%;
    width: fit-content;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE / Edge */
    box-sizing: border-box;
}

.view-subnav-bar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.view-subnav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim, #94a3b8);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
}

.view-subnav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.view-subnav-btn.active {
    background: var(--accent-primary, #a855f7) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 12px rgba(168, 85, 247, 0.4);
}

.subview-panel {
    display: block;
    width: 100%;
    flex: 1 0 auto;
    animation: fadeInSubview 0.22s ease-in-out;
}

.subview-panel header {
    margin-bottom: 20px;
}

.subview-panel.u-hidden {
    display: none !important;
}

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

@media (max-width: 768px) {
    .view-subnav-bar {
        width: 100%;
        display: flex !important;
        box-sizing: border-box;
    }
    .view-subnav-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12.5px;
    }
}

/* ======================== SPA TOP NAVIGATION & BACK BUTTON ======================== */
.top-nav-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    width: fit-content;
    max-width: 100%;
    flex-shrink: 0;
    animation: fadeIn 0.2s ease;
    user-select: none;
}

.top-nav-bar.u-hidden {
    display: none !important;
}

.btn-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.28);
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav-back:hover {
    background: var(--accent-primary, #a855f7);
    color: #ffffff;
    border-color: var(--accent-primary, #a855f7);
    transform: translateX(-2px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-nav-back .icon {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.btn-nav-back:hover .icon {
    transform: translateX(-2px);
}

.top-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim, #94a3b8);
}

.top-breadcrumb .bc-link {
    cursor: pointer;
    color: var(--text-dim, #94a3b8);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.top-breadcrumb .bc-link:hover {
    color: var(--accent-primary, #a855f7);
    text-decoration: underline;
}

.top-breadcrumb .bc-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

.top-breadcrumb .bc-page {
    color: #f8fafc;
    font-weight: 600;
}

.top-breadcrumb .bc-sub {
    color: var(--accent-secondary, #38bdf8);
    font-weight: 600;
}

@media (max-width: 768px) {
    .top-nav-bar {
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
}

/* ======================== GLOBAL TOP HEADER STRIP ======================== */
.top-header-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Trigger Button: Spotlight */
.btn-spotlight-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim, #94a3b8);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 280px;
    max-width: 100%;
}

.btn-spotlight-trigger:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(168, 85, 247, 0.4);
    color: #f8fafc;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
    transform: translateY(-1px);
}

.btn-spotlight-trigger .icon {
    font-size: 14px;
    opacity: 0.8;
}

.btn-spotlight-trigger .text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shortcut-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: inherit;
}

/* Trigger Button: Cotizador MG */
.btn-quick-budget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.25) 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}

.btn-quick-budget:hover {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4);
}

.badge-plan-auto {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #fef08a;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ======================== SPOTLIGHT COMMAND PALETTE (CTRL + K) ======================== */
.spotlight-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10020;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    animation: fadeIn 0.15s ease-out;
}

.spotlight-dialog {
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(168, 85, 247, 0.2);
    width: 650px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDownZoom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownZoom {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.spotlight-search-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-search-icon {
    font-size: 20px;
    opacity: 0.8;
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 16px;
    font-family: inherit;
}

.spotlight-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.spotlight-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.spotlight-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.spotlight-body {
    max-height: 420px;
    overflow-y: auto;
    padding: 10px;
}

.spotlight-body::-webkit-scrollbar {
    width: 6px;
}

.spotlight-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.spotlight-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 8px 12px 4px 12px;
}

.spotlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.spotlight-item:hover,
.spotlight-item.selected {
    background: rgba(168, 85, 247, 0.14);
    border-color: rgba(168, 85, 247, 0.35);
}

.spotlight-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.spotlight-item-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.spotlight-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spotlight-item-title {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-item-desc {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.spotlight-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.spotlight-tag.badge-dealer {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.spotlight-tag.badge-status {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.spotlight-empty {
    padding: 30px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(11, 15, 25, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #64748b;
}

.spotlight-shortcuts {
    display: flex;
    gap: 12px;
}

.shortcut-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shortcut-item kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    padding: 1px 5px;
    color: #cbd5e1;
    font-size: 10px;
}

/* ======================== COTIZADOR EXPRESS MG MODAL ======================== */
.mg-budget-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10025;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

.mg-budget-dialog {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 18px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.75), 0 0 40px rgba(239, 68, 68, 0.2);
    width: 780px;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDownZoom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-budget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.12) 0%, transparent 100%);
}

.mg-budget-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mg-logo-badge {
    background: #ef4444;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.mg-budget-title-wrap h3 {
    margin: 0;
    font-size: 18px;
    color: #f8fafc;
    font-weight: 700;
}

.mg-budget-title-wrap p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.mg-budget-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mg-budget-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
}

.mg-budget-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Config Grid */
.mg-config-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr 1.2fr;
    gap: 14px;
    align-items: flex-end;
}

.mg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mg-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.mg-select {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 9px 12px;
    color: #f8fafc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.mg-select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.mg-type-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 2px;
}

.mg-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mg-toggle-btn.active {
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* Model Summary */
.mg-model-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 10px;
}

.mg-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-dgt-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.5px;
}

.mg-dgt-badge.dgt-cero {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid #38bdf8;
}

.mg-dgt-badge.dgt-eco {
    background: #059669;
    color: #ffffff;
    border: 1px solid #34d399;
}

.mg-dgt-badge.dgt-c {
    background: #ca8a04;
    color: #ffffff;
    border: 1px solid #facc15;
}

.mg-summary-name {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
}

.mg-summary-pff {
    color: #94a3b8;
    font-size: 12px;
}

/* 3 Price Cards Grid */
.mg-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.mg-price-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.mg-price-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.mg-price-card.featured {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.18);
}

.mg-card-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.mg-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mg-card-icon {
    font-size: 16px;
}

.mg-card-header h4 {
    margin: 0;
    font-size: 13px;
    color: #f8fafc;
    font-weight: 600;
}

.mg-card-discount {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 6px;
}

.mg-card-price {
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 6px;
}

.mg-card-price.highlight {
    color: #ef4444;
    font-size: 24px;
}

.mg-card-details {
    font-size: 11px;
    color: #94a3b8;
    margin-top: auto;
}

/* Plan Auto+ Banner */
.mg-plan-auto-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(202, 138, 4, 0.25) 100%);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
}

.mg-plan-auto-icon {
    font-size: 24px;
}

.mg-plan-auto-info {
    flex: 1;
}

.mg-plan-auto-info h5 {
    margin: 0 0 3px 0;
    font-size: 14px;
    color: #fef08a;
    font-weight: 700;
}

.mg-plan-auto-info p {
    margin: 0;
    font-size: 12px;
    color: #fef9c3;
    opacity: 0.9;
}

.mg-plan-auto-price-wrap {
    text-align: right;
}

.mg-plan-auto-label {
    font-size: 11px;
    color: #fef08a;
    font-weight: 600;
}

.mg-plan-auto-price {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Actions */
.mg-budget-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

.btn-mg-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-copy-wa {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-copy-wa:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-print-budget {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.btn-print-budget:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

@media (max-width: 768px) {
    .top-header-strip {
        flex-wrap: wrap;
    }
    .btn-spotlight-trigger {
        width: 100%;
    }
    .mg-config-grid {
        grid-template-columns: 1fr;
    }
    .mg-cards-grid {
        grid-template-columns: 1fr;
    }
    .mg-plan-auto-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .mg-plan-auto-price-wrap {
        text-align: left;
    }
}

/* ==========================================================================
   OPCIÓN 3 & 4: FILTRO GLOBAL DE SEDE & TERMÓMETRO IA EN KANBAN
   ========================================================================== */

/* 1. Selector Global de Sede en Cabecera */
.dealer-global-select-wrap {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 3px 10px 3px 8px;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dealer-global-select-wrap:hover,
.dealer-global-select-wrap:focus-within {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}

.dealer-select-icon {
    font-size: 13px;
    opacity: 0.9;
}

.dealer-global-select {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 0;
    font-family: inherit;
}

.dealer-global-select option {
    background: #0f172a;
    color: #f1f5f9;
    padding: 6px 12px;
}

/* 2. Barra de Resumen Térmico IA */
.pipeline-temp-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.temp-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.temp-summary-item.hot {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.temp-summary-item.warm {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fde68a;
}

.temp-summary-item.cold {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.temp-summary-item .temp-val {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.temp-summary-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.dealer-active-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-light, #f1f5f9);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.ai-scoring-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3. Insignias de Temperatura en Tarjetas Kanban */
.opp-card-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.temp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.temp-badge.temp-hot {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
    animation: hotPulse 2.5s infinite ease-in-out;
}

@keyframes hotPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
    }
}

.temp-badge.temp-warm {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.temp-badge.temp-cold {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.temp-score-mini {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim, #94a3b8);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 4. Botón 1-Click WhatsApp Directo en Tarjeta Kanban */
.btn-card-wa-direct {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.35);
    color: #25D366;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-card-wa-direct:hover {
    background: #25D366;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
    transform: translateY(-1px);
}

.btn-card-wa-direct .wa-icon {
    font-size: 11px;
}

.opp-card-submeta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.opp-card-dealer-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #94a3b8;
}

.opp-card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.opp-card-actions-left {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-card-quote-mg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-card-quote-mg:hover {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
}

.btn-card-quote-mg .icon {
    font-size: 10px;
}

/* Banner de Contexto de Cliente en Cotizador */
.mg-lead-context-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.12) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

.mg-lead-context-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}

.mg-lead-context-pill {
    color: #f1f5f9;
}

.mg-lead-context-pill strong {
    color: #a78bfa;
}

.mg-lead-context-dealer {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.mg-lead-context-phone {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.btn-send-wa-direct {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-send-wa-direct:hover {
    background: linear-gradient(135deg, #1ea952 0%, #0d7367 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

.btn-quote-mg-lead-modal {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
    transition: all 0.2s ease;
}

.btn-quote-mg-lead-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.5);
}

/* ==========================================================================
   HOJA DE PEDIDO OFICIAL MG - MOSS DRIVE S.L. (A4 IMPRIMIBLE / PDF)
   ========================================================================== */

.mg-order-sheet-backdrop {
    background: rgba(10, 15, 29, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10050;
    overflow-y: auto;
    padding: 20px 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mg-order-sheet-dialog {
    width: 100%;
    max-width: 860px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mg-sheet-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mg-sheet-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheet-title-badge {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 700;
}

.sheet-sub-badge {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.mg-sheet-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sheet-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-sheet-print {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-sheet-print:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-sheet-close {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-sheet-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Hoja de Papel en Pantalla */
.mg-order-sheet-paper {
    background: #ffffff;
    color: #0f172a;
    border-radius: 6px;
    padding: 36px 40px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
    font-size: 12px;
}

/* Encabezado Hoja */
.sheet-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.sheet-brand-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sheet-company-info h1 {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sheet-company-info p {
    margin: 2px 0;
    font-size: 11px;
    color: #475569;
}

.sheet-doc-meta {
    text-align: right;
}

.sheet-doc-badge {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sheet-doc-meta p {
    margin: 2px 0;
    font-size: 11px;
    color: #475569;
}

/* Grid de Cliente y Vehículo */
.sheet-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.sheet-box {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    background: #f8fafc;
}

.sheet-box-title {
    font-size: 11px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.sheet-data-table {
    width: 100%;
    border-collapse: collapse;
}

.sheet-data-table td {
    padding: 3px 0;
    font-size: 11px;
}

.sheet-data-table td.label {
    color: #64748b;
    font-weight: 600;
    width: 38%;
}

.sheet-data-table td.value {
    color: #0f172a;
    font-weight: 700;
}

/* Tabla Económica */
.sheet-pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.sheet-pricing-table th {
    background: #1e293b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    padding: 8px 12px;
}

.sheet-pricing-table th:last-child {
    text-align: right;
}

.sheet-pricing-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11.5px;
    color: #1e293b;
}

.sheet-pricing-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.sheet-pricing-table tr.total-pvp td {
    background: #f1f5f9;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    border-top: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
}

.sheet-pricing-table tr.plan-auto-row td {
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
}

.sheet-pricing-table tr.total-net-row td {
    background: #dcfce7;
    font-size: 14px;
    font-weight: 900;
    color: #14532d;
    border-top: 2px solid #22c55e;
    border-bottom: 2px solid #22c55e;
}

/* Financiación y Opciones */
.sheet-finance-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sheet-finance-item {
    font-size: 11px;
}

.sheet-finance-item strong {
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

/* Garantías y Condiciones */
.sheet-guarantees {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 16px;
}

.sheet-guarantee-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #9d174d;
}

/* Firmas */
.sheet-signatures-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.sheet-signature-box {
    text-align: center;
}

.sheet-signature-line {
    border-bottom: 1px dashed #94a3b8;
    height: 48px;
    margin-bottom: 6px;
}

.sheet-signature-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}

.sheet-legal-footer {
    margin-top: 20px;
    font-size: 9px;
    color: #64748b;
    text-align: justify;
    line-height: 1.3;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}

/* ==========================================================================
   REGLAS PARA IMPRESIÓN DIRECTA / GUARDADO PDF (@media print)
   ========================================================================== */

@media print {
    /* Ocultar todo el Dashboard principal de la pantalla */
    body * {
        visibility: hidden !important;
    }

    /* Mostrar únicamente la hoja de pedido oficial */
    #mg-order-sheet-modal,
    #mg-order-sheet-modal * {
        visibility: visible !important;
    }

    #mg-order-sheet-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        backdrop-filter: none !important;
        display: block !important;
    }

    .mg-order-sheet-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .no-print {
        display: none !important;
    }

    .mg-order-sheet-paper {
        box-shadow: none !important;
        padding: 10mm 12mm !important;
        border-radius: 0 !important;
        color: #000000 !important;
        background: #ffffff !important;
    }

    .sheet-pricing-table th {
        background: #334155 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-doc-badge {
        background: #dc2626 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-pricing-table tr.total-pvp td {
        background: #f1f5f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-pricing-table tr.total-net-row td {
        background: #dcfce7 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: A4 portrait;
        margin: 8mm;
    }
}

/* ==========================================================================
   SISTEMA DE FILTRADO POR TIENDA / SEDE & BADGES VISUALES
   ========================================================================== */

/* Barra de Filtros Rápidos por Tienda */
.dealer-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    flex-wrap: wrap;
}

.dealer-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dim, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 4px;
}

.dealer-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.dealer-pill-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.dealer-pill-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.dealer-pill-btn[data-dealer="Salamanca"].active {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.dealer-pill-btn[data-dealer="Ávila"].active {
    background: rgba(192, 132, 252, 0.18);
    border-color: #c084fc;
    color: #c084fc;
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.3);
}

.dealer-pill-btn[data-dealer="Segovia"].active {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.dealer-pill-btn .pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    margin-left: 2px;
}

/* Badges de Tienda Visuales (Tabla y Tarjetas) */
.dealer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.2;
}

.dealer-badge.dealer-salamanca {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.dealer-badge.dealer-avila {
    background: rgba(192, 132, 252, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.45);
    color: #d8b4fe;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.15);
}

.dealer-badge.dealer-segovia {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.dealer-badge.dealer-none {
    background: rgba(148, 163, 184, 0.1);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}

/* Indicador de Tienda en Tarjeta Kanban */
.opp-card-dealer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ==========================================================================
   ESTADÍSTICAS & ANALÍTICA DE LEADS POR CENTRO (MOSS DRIVE)
   ========================================================================== */
.analytics-filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.4);
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.analytics-badge-status {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.analytics-badge-status strong {
    color: #f1f5f9;
}

/* KPIs de Período Temporal */
.analytics-kpi-grid {
    margin-bottom: 24px;
}

.analytics-kpi-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.analytics-kpi-card .kpi-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.analytics-kpi-card .kpi-icon-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.analytics-kpi-card .kpi-submeta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
}

.analytics-kpi-card .trend-prev-label {
    color: var(--text-dim);
}

.analytics-kpi-card.kpi-day::before {
    background: linear-gradient(to right, #38bdf8, #818cf8);
}
.analytics-kpi-card.kpi-day .value {
    color: #e0f2fe;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.analytics-kpi-card.kpi-week::before {
    background: linear-gradient(to right, #10b981, #34d399);
}
.analytics-kpi-card.kpi-week .value {
    color: #d1fae5;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.analytics-kpi-card.kpi-month::before {
    background: linear-gradient(to right, #f59e0b, #fbbf24);
}
.analytics-kpi-card.kpi-month .value {
    color: #fef3c7;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.analytics-kpi-card.kpi-year::before {
    background: linear-gradient(to right, #ec4899, #c084fc);
}
.analytics-kpi-card.kpi-year .value {
    color: #fce7f3;
    text-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

/* Grid de Gráficos */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.35) 0%, rgba(15, 23, 42, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 22px 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.analytics-card-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.analytics-card-header p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.badge-store-count {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
}

.chart-legend-pills {
    display: flex;
    gap: 8px;
}

.legend-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.legend-pill.pill-sal { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.legend-pill.pill-avi { background: rgba(192, 132, 252, 0.15); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }
.legend-pill.pill-seg { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Donut Chart */
.chart-container-flex {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

@media (max-width: 600px) {
    .chart-container-flex {
        flex-direction: column;
    }
}

.donut-chart-wrapper {
    width: 170px;
    height: 170px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.donut-legend-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.donut-legend-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.donut-legend-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.donut-legend-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
}

.donut-legend-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-legend-count {
    font-size: 0.85rem;
    font-weight: 800;
    color: #f8fafc;
}

.donut-legend-pct {
    font-size: 0.75rem;
    color: var(--text-dim);
    min-width: 38px;
    text-align: right;
}

/* Timeline Chart */
.bar-chart-wrapper {
    width: 100%;
    min-height: 180px;
    position: relative;
}

.svg-timeline-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.timeline-bar-group:hover rect {
    filter: brightness(1.25);
    cursor: pointer;
}

/* Canales & Modelos List */
.channels-progress-list, .models-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.channel-progress-item, .model-ranking-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-item-header, .model-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}

.channel-bar-bg, .model-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.channel-bar-fill, .model-bar-fill {
    height: 100%;
    border-radius: 6px;
    transform-origin: left center;
    transition: opacity 0.3s ease;
}

/* Tabla Ejecutiva de Analíticas */
.analytics-table th {
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.analytics-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
}

.analytics-store-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #f8fafc;
}

.score-pill-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   --- CONTROL DE ACCESO RBAC, PERMISOS GRANULARES & SIMULADOR DE PRUEBAS ---
   ========================================================================== */

/* Selector de simulación en Header */
.user-simulate-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.user-simulate-wrap:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.user-simulate-select {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}

.user-simulate-select option {
    background: #0f172a;
    color: #f8fafc;
}

/* Banner superior cuando se simula un usuario de prueba */
.impersonation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.95), rgba(180, 83, 9, 0.95));
    color: #ffffff;
    padding: 8px 24px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    z-index: 9999;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    animation: fadeInSlideDown 0.3s ease;
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.impersonation-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-exit-impersonation {
    background: #ffffff;
    color: #b45309;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-exit-impersonation:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Grid del Formulario de Usuario en Modal */
.nu-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .nu-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Sección de Matriz de Permisos */
.nu-permissions-section {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.nu-permissions-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 12px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.nu-permissions-title-wrap h4 {
    margin: 0 0 4px 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fafc;
}

.nu-permissions-hint {
    font-size: 0.78rem;
    color: #94a3b8;
}

.nu-permissions-actions {
    display: flex;
    gap: 8px;
}

.nu-permissions-matrix {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

@media (max-width: 900px) {
    .nu-permissions-matrix {
        grid-template-columns: 1fr;
    }
}

/* Tarjeta de Categoría de Permisos */
.permission-category-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
}

.permission-category-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.permission-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ítem individual de permiso */
.permission-item-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.permission-item-row:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.permission-item-row.is-checked {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

.permission-checkbox {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

.permission-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.permission-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* Badges de Tienda y Permisos en la Tabla de Usuarios */
.badge-store {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-store-salamanca {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-store-avila {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.badge-store-segovia {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-store-todas {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-perm-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    cursor: help;
}

/* ==========================================================================
   WALCU CRM — WHATSAPP WIDGET & OMNICHANNEL TIMELINE COMPONENT
   ========================================================================== */

/* Barra de Acciones Rápidas (Walcu Style Tabs) */
.walcu-actions-bar {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.walcu-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.walcu-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.walcu-action-btn.active, .walcu-action-btn.btn-wa-active {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.4);
    color: #4ade80;
}

/* Caja Principal de WhatsApp (Walcu Box) */
.walcu-wa-box {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(37, 211, 102, 0.08);
    height: 100%;
}

.walcu-wa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(20, 30, 50, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.walcu-wa-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #f1f5f9;
}

.walcu-wa-icon {
    font-size: 1.1rem;
}

.walcu-wa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(37, 211, 102, 0.15);
    color: #4ade80;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.pulse-dot-green {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 2s infinite;
}

/* Contenedor del Hilo de Chat */
.walcu-chat-timeline {
    flex: 1;
    min-height: 260px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
}

/* Separador de Fecha Estilo Walcu */
.walcu-date-divider {
    align-self: center;
    margin: 8px 0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Burbujas de Chat Nativas WhatsApp */
.chat-bubble.chat-wa-outgoing {
    align-self: flex-end;
    max-width: 82%;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.22) 0%, rgba(18, 140, 126, 0.3) 100%);
    border: 1px solid rgba(37, 211, 102, 0.4);
    border-bottom-right-radius: 4px;
    border-radius: 12px;
    padding: 10px 14px;
    color: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-bubble.chat-wa-incoming {
    align-self: flex-start;
    max-width: 82%;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom-left-radius: 4px;
    border-radius: 12px;
    padding: 10px 14px;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tarjeta de Nota Interna CRM */
.chat-bubble.chat-crm-note {
    align-self: stretch;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fde68a;
}

/* Tarjeta de Llamada Registrada */
.chat-bubble.chat-crm-call {
    align-self: stretch;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    color: #bfdbfe;
}

.chat-wa-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.wa-checks-blue {
    color: #38bdf8;
    font-weight: bold;
}

/* Barra de Plantillas Rápidas (Walcu Template Selector) */
.walcu-template-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 12px;
    background: rgba(20, 30, 50, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.walcu-tpl-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.walcu-tpl-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.walcu-select {
    flex: 1;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #f1f5f9;
    outline: none;
    cursor: pointer;
}

.walcu-select:focus {
    border-color: #25d366;
}

.btn-walcu-apply {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(37, 211, 102, 0.2);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #4ade80;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-walcu-apply:hover {
    background: #22c55e;
    color: #052e16;
}

/* Recordatorio Condicional de Seguimiento (Signature Walcu Feature) */
.walcu-reminder-bar {
    padding: 8px 12px;
    background: rgba(234, 179, 8, 0.08);
    border-bottom: 1px solid rgba(234, 179, 8, 0.2);
}

.walcu-reminder-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #fef08a;
    cursor: pointer;
    flex-wrap: wrap;
}

.walcu-checkbox {
    accent-color: #eab308;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.walcu-datetime {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.74rem;
    color: #fff;
    outline: none;
}

/* Compositor Mejorado (Walcu Composer) */
.walcu-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.95);
}

.composer-textarea {
    width: 100%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #fff;
    resize: vertical;
    min-height: 55px;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
}

.composer-textarea:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.walcu-composer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.walcu-composer-btns {
    display: flex;
    gap: 8px;
}

.btn-send-wa-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
    transition: all 0.2s;
}

.btn-send-wa-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45);
}

.btn-send-note-main {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send-note-main:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}


/* ==========================================================================
   CONTACT PANEL TABS & PANELS (Docs, Calls, Timeline Filters)
   ========================================================================== */

/* Panel Selector Tabs (Filter for Timeline) */
.walcu-panel-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    flex-wrap: wrap;
}

.walcu-panel-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.walcu-panel-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.walcu-panel-tab.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
}

/* Panel Container */
.walcu-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.walcu-panel.active {
    display: flex;
}

/* Documentos Panel Styles */
.docs-toolbar {
    flex-shrink: 0;
}

.docs-list {
    flex: 1;
    overflow-y: auto;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.doc-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.2);
}

.doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-primary);
}

.doc-icon.pdf { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.doc-icon.image { background: rgba(6, 182, 212, 0.15); color: var(--accent-secondary); }
.doc-icon.spreadsheet { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.doc-icon.folder { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.doc-actions {
    display: flex;
    gap: 6px;
}

.doc-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doc-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.doc-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* Upload Modal */
.upload-dropzone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.05);
}

.upload-dropzone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.upload-dropzone-text {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.upload-dropzone-hint {
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.7;
}

.upload-progress {
    margin-top: 16px;
    display: none;
}

.upload-progress.active {
    display: block;
}

.upload-progress-bar {
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    font-size: 12px;
    color: var(--text-dim);
}

/* Calls Panel Styles */
.calls-list {
    flex: 1;
    overflow-y: auto;
}

.call-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.call-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
}

.call-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: #000;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.call-icon.incoming { background: linear-gradient(135deg, var(--success), #16a34a); }
.call-icon.outgoing { background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary)); }
.call-icon.missed { background: linear-gradient(135deg, var(--danger), #dc2626); }

.call-content {
    flex: 1;
    min-width: 0;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.call-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
}

.call-type.incoming { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.call-type.outgoing { background: rgba(6, 182, 212, 0.15); color: var(--accent-secondary); border: 1px solid rgba(6, 182, 212, 0.3); }
.call-type.missed { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

.call-date {
    font-size: 11px;
    color: var(--text-dim);
}

.call-duration {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.call-transcript {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    line-height: 1.5;
}

/* Modal Upload Document */
#upload-doc-modal .modal-content {
    width: min(500px, 95vw) !important;
}

/* Empty state for docs */
.docs-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.docs-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.docs-empty-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.docs-empty-hint {
    font-size: 12px;
    line-height: 1.5;
}



/* Technical / Data Typography */
.funnel-step-pct,
.kpi-value,
.badge-count,
.channel-stat-val,
.stat-number,
.filter-count,
code,
pre {
    font-family: var(--font-mono) !important;
    font-feature-settings: "tnum" 1;
}


/* ==========================================================================
   SUPER-ADMIN & MULTI-TENANT MANAGEMENT (DANTE SAAS)
   ========================================================================== */

/* 1. Selector de Negocio en Cabecera Superior */
.tenant-global-select-wrap {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(253, 47, 51, 0.35);
    border-radius: 10px;
    padding: 3px 10px 3px 8px;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tenant-global-select-wrap:hover,
.tenant-global-select-wrap:focus-within {
    background: rgba(30, 41, 59, 0.95);
    border-color: #FD2F33;
    box-shadow: 0 0 16px rgba(253, 47, 51, 0.25);
}

.tenant-select-icon {
    font-size: 14px;
}

.tenant-global-select {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0;
    font-family: inherit;
    max-width: 210px;
}

.tenant-global-select option {
    background: #0f172a;
    color: #f1f5f9;
    padding: 6px 12px;
}

/* 2. Grid de KPIs Super-Admin */
.sa-kpis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.sa-kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sa-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
}

.sa-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sa-kpi-icon.icon-tenants {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sa-kpi-icon.icon-leads {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sa-kpi-icon.icon-errors {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sa-kpi-icon.icon-plans {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.sa-kpi-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sa-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sa-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.sa-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.1;
}

.sa-kpi-sub {
    font-size: 12px;
    color: #64748b;
}

.sa-kpi-plans-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.sa-plan-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
}

.sa-plan-tag.enterprise {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.sa-plan-tag.pro {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.sa-plan-tag.starter {
    background: rgba(52, 211, 153, 0.18);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* 3. Subpaneles y cabecera de secciones */
.sa-subpanel {
    animation: fadeIn 0.25s ease-out;
}

.sa-subpanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.sa-subpanel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
}

.sa-search-wrap input {
    min-width: 280px;
}

/* 4. Grid de Tarjetas de Tenants */
.sa-tenants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.sa-tenant-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.sa-tenant-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dialer-header h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #e2e8f0;
    margin: 0;
}

.dialer-subhead {
    font-size: 11px;
    color: var(--accent-primary, #a855f7);
    font-weight: 500;
}

.dialer-header button#close-dialer {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dialer-header button#close-dialer:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.08);
}

.dialer-screen {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#dialer-number {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 4px;
    outline: none;
    letter-spacing: 1.5px;
    font-family: monospace, inherit;
}

#dialer-number::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-size: 15px;
    letter-spacing: 0;
    font-family: inherit;
}

#call-status {
    font-size: 11px;
    color: #38bdf8;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.dialer-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.key {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 58px;
    height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 auto;
    padding: 0;
}

.key .key-num {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
}

.key .key-sub {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 1px;
}

.key:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.key:active {
    transform: scale(0.94);
    background: var(--accent-primary, #a855f7);
    border-color: var(--accent-primary, #a855f7);
}

.dialer-actions {
    display: flex;
    justify-content: center;
    gap: 28px;
    align-items: center;
}

.btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.btn-action.call {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

.btn-action.call:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.6);
}

.btn-action.call.active {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5) !important;
    animation: pulse-hangup 1.5s infinite;
}

.btn-action.backspace {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.btn-action.backspace:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.06);
}

/* ======================== BOTÓN FLOTANTE TRIGGER AURA VOICE ======================== */
.floating-dialer-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 14px;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 9999px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 
                0 0 25px rgba(168, 85, 247, 0.35);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    z-index: 9999;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-dialer-trigger:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 
                0 0 35px rgba(168, 85, 247, 0.55);
}

.dialer-trigger-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-live 1.8s infinite;
}

.dialer-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
}

.dialer-trigger-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #f8fafc;
}

.dialer-trigger-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-btn {
    display: none !important;
}

.sa-tenant-card.sa-tenant-current {
    border-color: #FD2F33 !important;
    background: rgba(253, 47, 51, 0.04) !important;
    box-shadow: 0 0 20px rgba(253, 47, 51, 0.15) !important;
}

.sa-tenant-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.sa-tenant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(253, 47, 51, 0.2), rgba(30, 41, 59, 0.8));
    border: 1px solid rgba(253, 47, 51, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #FD2F33;
    flex-shrink: 0;
}

.sa-tenant-identity {
    flex: 1;
    min-width: 0;
}

.sa-tenant-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sa-tenant-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-pill-active-session {
    font-size: 10px;
    font-weight: 700;
    background: rgba(253, 47, 51, 0.2);
    color: #FD2F33;
    border: 1px solid rgba(253, 47, 51, 0.5);
    padding: 1px 6px;
    border-radius: 99px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sa-tenant-subdomain {
    font-size: 12px;
    color: #64748b;
    font-family: monospace;
}

.sa-tenant-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.sa-plan-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.sa-plan-badge.enterprise {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    color: #e879f9;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.sa-plan-badge.pro,
.sa-plan-badge.professional {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.sa-plan-badge.starter {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.sa-badge-active {
    font-size: 11px;
    color: #10b981;
    font-weight: 500;
}

.sa-badge-inactive {
    font-size: 11px;
    color: #ef4444;
    font-weight: 500;
}

.sa-tenant-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(11, 15, 25, 0.5);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sa-metric-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sa-metric-num {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
}

.sa-metric-lbl {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sa-tenant-contact-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.sa-tenant-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.sa-tenant-actions button {
    flex: 1;
}

.sa-btn-current {
    background: rgba(253, 47, 51, 0.15) !important;
    color: #FD2F33 !important;
    border: 1px solid rgba(253, 47, 51, 0.4) !important;
    cursor: default;
}

/* 5. Watchdog & Errores Table */
.sa-watchdog-filters {
    display: flex;
    gap: 10px;
}

.sa-errors-table {
    width: 100%;
    border-collapse: collapse;
}

.sa-severity-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    letter-spacing: 0.05em;
}

.sa-severity-tag.critical {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.sa-severity-tag.error {
    background: #f97316;
    color: #ffffff;
}

.sa-severity-tag.warning {
    background: #f59e0b;
    color: #0f172a;
}

.sa-severity-tag.info {
    background: #3b82f6;
    color: #ffffff;
}

.sa-row-resolved {
    opacity: 0.5;
}

.sa-error-type {
    font-weight: 600;
    color: #f1f5f9;
}

.sa-endpoint-code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
    color: #94a3b8;
}

.sa-error-msg {
    max-width: 320px;
    font-size: 13px;
    line-height: 1.4;
}

.sa-stack-details {
    margin-top: 6px;
    font-size: 11px;
}

.sa-stack-details pre {
    background: #090d16;
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    color: #f87171;
    font-size: 10px;
    margin-top: 4px;
}
/* 6. Modal de Nuevo / Editar Negocio */
#sa-tenant-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#sa-tenant-modal.active,
#sa-tenant-modal[style*="display: flex"],
#sa-tenant-modal[style*="display: block"] {
    display: flex !important;
}

#sa-tenant-modal .modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    border-radius: 16px;
    padding: 24px;
    width: 520px;
    max-width: 92vw;
    animation: zoomIn 0.2s ease-out;
}

/* ==========================================================================
   DANTE PWA — Mobile Bottom Navigation & Mobile-First Touch Optimizations
   ========================================================================== */

/* Desktop: Ocultar barra inferior móvil */
.mobile-bottom-nav {
    display: none !important;
}

/* Mobile & Tablet Portrait (< 769px) */
@media (max-width: 768px) {
    /* Barra inferior fija */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        background: rgba(11, 15, 25, 0.94) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        z-index: 99999 !important;
        align-items: center;
        justify-content: space-around;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6);
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #94a3b8;
        padding: 6px 12px;
        min-width: 54px;
        min-height: 48px; /* Touch target estándar accesible */
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .mobile-nav-icon {
        font-size: 1.25rem;
        line-height: 1;
        margin-bottom: 3px;
        transition: transform 0.2s ease, filter 0.2s ease;
    }

    .mobile-nav-label {
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.3px;
        transition: color 0.2s ease;
    }

    .mobile-nav-btn:active {
        transform: scale(0.92);
    }

    .mobile-nav-btn.active {
        color: #ffffff;
    }

    .mobile-nav-btn.active .mobile-nav-icon {
        transform: translateY(-2px) scale(1.12);
        filter: drop-shadow(0 2px 8px rgba(253, 47, 51, 0.6));
    }

    .mobile-nav-btn.active .mobile-nav-label {
        color: #FD2F33;
        font-weight: 700;
    }

    .mobile-nav-btn.active::after {
        content: '';
        position: absolute;
        bottom: calc(4px + env(safe-area-inset-bottom, 0px));
        width: 18px;
        height: 3px;
        background: #FD2F33;
        border-radius: 99px;
        box-shadow: 0 0 8px rgba(253, 47, 51, 0.8);
    }

    /* Espacio inferior para no tapar contenido */
    #main-content,
    .content {
        padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Botón flotante de llamadas adaptado a móvil */
    #open-dialer-btn {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
        z-index: 99990 !important;
    }

    #aura-dialer-container {
        right: 16px !important;
        left: 16px !important;
        width: auto !important;
        max-width: 340px !important;
        margin: 0 auto !important;
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 100000 !important;
    }

    /* Tablas con scroll horizontal suave */
    .table-container,
    .table-responsive,
    .leads-table-wrapper,
    table {
        -webkit-overflow-scrolling: touch;
    }

    /* Header superior compacto en móvil */
    .top-header-strip {
        padding: 8px 12px !important;
    }

    .hamburger {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Super-Admin responsive móvil */
    .sa-kpis-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .sa-kpi-card {
        padding: 12px !important;
        gap: 10px !important;
    }

    .sa-kpi-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 18px !important;
    }

    .sa-kpi-value {
        font-size: 20px !important;
    }

    .sa-tenants-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .sa-search-wrap input {
        min-width: 100% !important;
    }

    .tenant-global-select-wrap {
        max-width: 160px;
    }

    .tenant-global-select {
        max-width: 130px !important;
        font-size: 12px !important;
    }
}

/* --- CALENDAR MULTI-DEALER TOOLBAR & SEDE BADGES --- */
.calendar-dealer-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cal-dealer-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-dealer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.25);
}

.cal-dealer-btn.active {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.6);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.cal-sede-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ==========================================================================
   J.A.R.V.I.S. VOICE OPERATOR PILL & TOAST // DANTE CRM
   ========================================================================== */
.btn-jarvis-voice-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-jarvis-voice-pill:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
    border-color: #06b6d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-jarvis-voice-pill.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(245, 158, 11, 0.25) 100%);
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    animation: jarvisPillPulse 1.4s infinite ease-in-out;
}

@keyframes jarvisPillPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.jarvis-pill-icon {
    font-size: 13px;
    line-height: 1;
}

.jarvis-pill-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #06b6d4;
    box-shadow: 0 0 6px #06b6d4;
}

.btn-jarvis-voice-pill.active .jarvis-pill-pulse {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: jarvisLedBlink 0.8s infinite;
}

@keyframes jarvisLedBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Toast flotante de J.A.R.V.I.S. en Dante CRM */
.jarvis-crm-toast {
    position: fixed;
    top: 65px;
    right: 24px;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(6, 182, 212, 0.2);
    backdrop-filter: blur(12px);
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.jarvis-crm-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.jarvis-crm-toast.action {
    border-color: #a855f7;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(168, 85, 247, 0.25);
}

.jarvis-crm-toast.warn {
    border-color: #f59e0b;
}

.jarvis-crm-toast.error {
    border-color: #ef4444;
}

/* ==========================================================================
   J.A.R.V.I.S. TACTICAL CONVERSATIONAL HUD // DANTE CRM
   ========================================================================== */
.jarvis-hud-container {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.jarvis-hud-container.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: none !important;
}

/* Backdrop deshabilitado para vista 100% nítida y trabajo en simultáneo */
.jarvis-hud-backdrop {
    display: none !important;
}

.jarvis-hud-panel {
    position: fixed;
    top: 65px;
    right: 24px;
    width: 440px;
    max-width: calc(100vw - 32px);
    height: min(680px, calc(100vh - 90px));
    background: rgba(11, 19, 41, 0.96);
    border: 1px solid rgba(6, 182, 212, 0.45);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(6, 182, 212, 0.25);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s ease;
    color: #f8fafc;
    pointer-events: auto !important;
}

.jarvis-hud-panel.minimized {
    height: 72px !important;
    overflow: hidden !important;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(6, 182, 212, 0.3);
}

.jarvis-hud-container.visible .jarvis-hud-panel {
    transform: translateY(0) scale(1);
}

/* Header */
.jarvis-hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.jarvis-hud-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jarvis-reactor-icon {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #06b6d4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.reactor-core {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #06b6d4;
    box-shadow: 0 0 8px #06b6d4;
}

.jarvis-reactor-icon.state-listening .reactor-core {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
    animation: pulseCore 0.8s infinite;
}

.jarvis-reactor-icon.state-thinking .reactor-core {
    background: #f59e0b;
    box-shadow: 0 0 12px #f59e0b;
    animation: rotateCore 1.2s infinite linear;
}

.jarvis-reactor-icon.state-speaking .reactor-core {
    background: #10b981;
    box-shadow: 0 0 12px #10b981;
}

@keyframes pulseCore {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes rotateCore {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.jarvis-hud-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.jarvis-hud-tag {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-weight: 700;
}

.jarvis-hud-status {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
    font-family: var(--font-mono, monospace);
}

.jarvis-hud-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.jarvis-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.jarvis-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.jarvis-icon-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Visualizer Card */
.jarvis-visualizer-card {
    padding: 12px 20px;
    background: rgba(6, 182, 212, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.jarvis-soundwaves {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.wave-bar {
    width: 3px;
    height: 6px;
    background: #06b6d4;
    border-radius: 2px;
    transition: height 0.2s ease;
}

.jarvis-soundwaves.state-listening .wave-bar {
    background: #ef4444;
    animation: waveListening 0.8s infinite ease-in-out;
}

.jarvis-soundwaves.state-speaking .wave-bar {
    background: #10b981;
    animation: waveSpeaking 0.6s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveListening {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

@keyframes waveSpeaking {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

.jarvis-status-text {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jarvis-status-text.type-listening {
    color: #fca5a5;
}

.jarvis-status-text.type-speaking {
    color: #6ee7b7;
}

.jarvis-status-text.type-thinking {
    color: #fde68a;
}

.jarvis-status-text.type-error {
    color: #f87171;
}

/* Messages scroll container */
.jarvis-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jarvis-messages-scroll::-webkit-scrollbar {
    width: 5px;
}

.jarvis-messages-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.jarvis-msg {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: fadeInMsg 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.jarvis-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.jarvis-msg-assistant {
    align-self: flex-start;
}

.msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.jarvis-msg-user .msg-avatar {
    background: rgba(6, 182, 212, 0.2);
}

.msg-body {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #e2e8f0;
}

.jarvis-msg-user .msg-body {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-color: rgba(6, 182, 212, 0.3);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.jarvis-msg-assistant .msg-body {
    border-bottom-left-radius: 4px;
}

.intro-msg .msg-body {
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.2);
}

.jarvis-action-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.jarvis-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Quick chips */
.jarvis-quick-chips {
    display: flex;
    gap: 8px;
    padding: 8px 20px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.jarvis-quick-chips::-webkit-scrollbar {
    display: none;
}

.jarvis-chip {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.jarvis-chip:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
    color: #ffffff;
}

/* Input Bar */
.jarvis-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.jarvis-mic-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.jarvis-mic-btn:hover {
    background: rgba(6, 182, 212, 0.3);
    transform: scale(1.05);
}

.jarvis-mic-btn.active {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    animation: jarvisPulseBtn 1.2s infinite;
}

@keyframes jarvisPulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.jarvis-text-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 9px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.jarvis-text-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.jarvis-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.jarvis-send-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

@media (max-width: 640px) {
    .jarvis-hud-panel {
        top: auto;
        bottom: 70px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: 70vh;
        border-radius: 20px;
    }
}



