/* ================================================================
   CRM CLASS LABELS — DARK LUXURY THEME
   public/css/crm-theme.css
   Versión 2.0
   
   Índice:
   0.  Variables & Reset
   1.  Layout (sidebar + contenido)
   2.  Sidebar
   3.  Header / Topbar
   4.  Tipografía
   5.  Cards
   6.  Tablas (DataTables)
   7.  Formularios (inputs, selects, summernote)
   8.  Botones
   9.  Badges & Status
   10. Timeline (detalle prospecto)
   11. Modales
   12. Alertas & Toasts
   13. SweetAlert2 overrides
   14. Charts
   15. Utilidades
   16. Responsive
================================================================ */


/* ================================================================
   0. VARIABLES & RESET
================================================================ */
:root {
    /* Paleta base */
    --negro:           #0d0d0f;
    --negro-card:      #141416;
    --negro-sidebar:   #0f0f11;
    --negro-input:     #1c1c1f;
    --negro-hover:     #1e1e22;
    --borde:           #2a2a2e;
    --borde-focus:     #c9a84c;

    /* Dorado — acento principal */
    --dorado:          #c9a84c;
    --dorado-claro:    #e8cc7a;
    --dorado-oscuro:   #a6883a;
    --dorado-sutil:    rgba(201, 168, 76, .08);
    --dorado-glow:     rgba(201, 168, 76, .20);

    /* Texto */
    --texto:           #e8e8e8;
    --texto-secundario:#a0a0a8;
    --texto-muted:     #6b6b72;

    /* Semáforos */
    --verde:           #3ecf8e;
    --verde-bg:        rgba(62, 207, 142, .10);
    --amarillo:        #f6c90e;
    --amarillo-bg:     rgba(246, 201, 14, .10);
    --rojo:            #e05252;
    --rojo-bg:         rgba(224, 82, 82, .10);
    --azul:            #4e8ef7;
    --azul-bg:         rgba(78, 142, 247, .10);
    --naranja:         #f0863c;
    --naranja-bg:      rgba(240, 134, 60, .10);

    /* Layout */
    --sidebar-w:       210px;
    --topbar-h:        54px;
    --radio:           6px;
    --radio-lg:        10px;

    /* Transiciones */
    --trans:           .25s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--negro);
    color: var(--texto);
    font-family: 'Montserrat', sans-serif;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}


/* ================================================================
   1. LAYOUT — Topnav horizontal (sin sidebar)
   El header.php genera: <nav id="crm-nav"> + <div id="crm-content">
   El cierre </div> está en js.php
================================================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Área de contenido scrollable bajo el topnav */
#crm-content {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.75rem 2rem;
    background: var(--negro);
    box-sizing: border-box;
}
#crm-content::-webkit-scrollbar       { width: 5px; }
#crm-content::-webkit-scrollbar-track { background: transparent; }
#crm-content::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 3px; }

/* Aliases de compatibilidad — las vistas usan .crm-content o #crm-content */
.crm-content {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.75rem 2rem;
    background: var(--negro);
}

/* ================================================================
   2. SIDEBAR — mantenido para compatibilidad pero no se usa
   con el topnav. Si en el futuro se activa, ya está listo.
================================================================ */
.crm-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}
.crm-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}
.crm-sidebar {
    width: 0;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 0;
    display: none;
}

/* Logo en sidebar */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 1.25rem;
    border-bottom: 1px solid var(--borde);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-brand img {
    max-width: 140px;
    filter: brightness(.9) contrast(1.05);
}

/* Sección de usuario activo */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--borde);
}

.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--dorado);
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
    font-size: .78rem;
    font-weight: 600;
    color: var(--texto);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .68rem;
    color: var(--dorado);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Navegación */
.sidebar-nav { flex: 1; padding: .75rem 0; }

.sidebar-label {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--texto-muted);
    padding: 1rem 1.25rem .4rem;
}

.nav-item-crm > a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    color: var(--texto-secundario);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 400;
    border-left: 2px solid transparent;
    transition: color var(--trans), background var(--trans), border-color var(--trans);
    white-space: nowrap;
}

.nav-item-crm > a i {
    width: 16px;
    text-align: center;
    font-size: .85rem;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity var(--trans);
}

.nav-item-crm > a:hover,
.nav-item-crm > a.active {
    color: var(--texto);
    background: var(--dorado-sutil);
    border-left-color: var(--dorado);
}

.nav-item-crm > a:hover i,
.nav-item-crm > a.active i {
    opacity: 1;
    color: var(--dorado);
}

/* Badge contador en nav */
.nav-badge {
    margin-left: auto;
    background: var(--dorado);
    color: #0d0d0f;
    font-size: .6rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 10px;
    line-height: 1.4;
}

/* Separador */
.sidebar-divider {
    height: 1px;
    background: var(--borde);
    margin: .5rem 1rem;
}


/* ================================================================
   3. TOPBAR
================================================================ */
.crm-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: var(--negro-card);
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    gap: 1rem;
    z-index: 999;
    transition: left var(--trans);
}

.topbar-toggle {
    background: none;
    border: none;
    color: var(--texto-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: .4rem;
    border-radius: var(--radio);
    transition: color var(--trans);
}

.topbar-toggle:hover { color: var(--dorado); }

.topbar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: .08em;
    color: var(--texto);
}

.topbar-spacer { flex: 1; }

/* Notificaciones */
.topbar-noti {
    position: relative;
    background: none;
    border: none;
    color: var(--texto-muted);
    font-size: .95rem;
    cursor: pointer;
    padding: .4rem .5rem;
    border-radius: var(--radio);
    transition: color var(--trans);
}

.topbar-noti:hover { color: var(--dorado); }

.noti-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    background: var(--dorado);
    border-radius: 50%;
    border: 1.5px solid var(--negro-card);
}

/* Avatar topbar */
.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--borde);
    object-fit: cover;
    cursor: pointer;
    transition: border-color var(--trans);
}

.topbar-avatar:hover { border-color: var(--dorado); }


/* ================================================================
   4. TIPOGRAFÍA
================================================================ */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    letter-spacing: .06em;
    color: var(--texto);
}

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--texto);
    margin-bottom: .25rem;
}

.page-subtitle {
    font-size: .75rem;
    color: var(--texto-muted);
    letter-spacing: .04em;
    margin-bottom: 1.5rem;
}

/* Breadcrumb */
.breadcrumb-crm {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
    color: var(--texto-muted);
    margin-bottom: 1.5rem;
    letter-spacing: .04em;
}

.breadcrumb-crm a {
    color: var(--texto-muted);
    text-decoration: none;
    transition: color var(--trans);
}

.breadcrumb-crm a:hover { color: var(--dorado); }

.breadcrumb-crm .sep {
    color: var(--borde);
    font-size: .65rem;
}

.breadcrumb-crm .current { color: var(--texto); }


/* ================================================================
   5. CARDS
================================================================ */
.card-crm {
    background: var(--negro-card);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 1.5rem;
    position: relative;
}

/* Línea dorada superior (decorativa) */
.card-crm.card-accent::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dorado), transparent);
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
}

.card-crm .card-header-crm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--borde);
}

.card-crm .card-title {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--texto);
}

/* Cards de estadísticas (KPIs) */
.stat-card {
    background: var(--negro-card);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--trans), transform var(--trans);
}

.stat-card:hover {
    border-color: var(--dorado);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radio-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon.gold   { background: var(--dorado-sutil);  color: var(--dorado); }
.stat-icon.green  { background: var(--verde-bg);       color: var(--verde); }
.stat-icon.blue   { background: var(--azul-bg);        color: var(--azul); }
.stat-icon.red    { background: var(--rojo-bg);        color: var(--rojo); }
.stat-icon.orange { background: var(--naranja-bg);     color: var(--naranja); }

.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
    color: var(--texto);
}

.stat-label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--texto-muted);
}


/* ================================================================
   6. TABLAS (DataTables)
================================================================ */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio) !important;
    color: var(--texto) !important;
    padding: .4rem .75rem !important;
    font-size: .8rem !important;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--borde-focus) !important;
    box-shadow: 0 0 0 3px var(--dorado-glow) !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: .75rem;
    color: var(--texto-muted) !important;
    margin-top: .75rem;
}

/* Tabla */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    background: var(--negro) !important;
    color: var(--texto-muted) !important;
    font-size: .7rem !important;
    font-weight: 600 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid var(--borde) !important;
    padding: .7rem 1rem !important;
    white-space: nowrap;
}

table.dataTable tbody tr {
    background: var(--negro-card) !important;
    border-bottom: 1px solid var(--borde) !important;
    transition: background var(--trans);
}

table.dataTable tbody tr:hover {
    background: var(--negro-hover) !important;
}

table.dataTable tbody td {
    color: var(--texto) !important;
    font-size: .82rem !important;
    padding: .7rem 1rem !important;
    vertical-align: middle !important;
}

/* Paginación */
.dataTables_paginate .paginate_button {
    background: var(--negro-card) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio) !important;
    color: var(--texto-muted) !important;
    font-size: .72rem !important;
    padding: .28rem .65rem !important;
    margin: 0 2px !important;
    cursor: pointer !important;
    transition: all var(--trans) !important;
    box-shadow: none !important;
    outline: none !important;
}
.dataTables_paginate .paginate_button:hover,
.dataTables_paginate .paginate_button:focus {
    background: var(--negro-hover) !important;
    border-color: rgba(201,168,76,.4) !important;
    color: var(--dorado) !important;
    box-shadow: none !important;
    outline: none !important;
}
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover,
.dataTables_paginate .paginate_button.current:focus {
    background: var(--dorado) !important;
    border-color: var(--dorado) !important;
    color: #0a0a0c !important;
    font-weight: 700 !important;
    box-shadow: 0 0 10px rgba(201,168,76,.25) !important;
}
.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: #333 !important;
    cursor: default !important;
    opacity: 1 !important;
}


/* ================================================================
   7. FORMULARIOS
================================================================ */
.form-label-crm {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--texto-muted);
    margin-bottom: .4rem;
    display: block;
}

.form-control,
.form-select {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio) !important;
    color: var(--texto) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: .83rem !important;
    padding: .65rem 1rem !important;
    transition: border-color var(--trans), box-shadow var(--trans) !important;
}

.form-control::placeholder { color: var(--texto-muted) !important; }

.form-control:focus,
.form-select:focus {
    border-color: var(--borde-focus) !important;
    box-shadow: 0 0 0 3px var(--dorado-glow) !important;
    outline: none !important;
    background: var(--negro-input) !important;
}

.form-control:disabled,
.form-select:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

/* Select2 overrides */
.select2-container--default .select2-selection--single {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio) !important;
    height: auto !important;
    padding: .6rem 1rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--texto) !important;
    font-size: .83rem !important;
    font-family: 'Montserrat', sans-serif !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: .5rem !important;
}

.select2-dropdown {
    background: var(--negro-card) !important;
    border: 1px solid var(--borde-focus) !important;
    border-radius: var(--radio) !important;
}

.select2-container--default .select2-results__option {
    color: var(--texto) !important;
    font-size: .82rem !important;
    padding: .5rem 1rem !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--dorado-sutil) !important;
    color: var(--dorado) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    color: var(--texto) !important;
    border-radius: var(--radio) !important;
    padding: .4rem .75rem !important;
}

/* Summernote */
.note-editor.note-frame {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio) !important;
}

.note-editor .note-toolbar {
    background: var(--negro) !important;
    border-bottom: 1px solid var(--borde) !important;
}

.note-editor .note-btn {
    background: transparent !important;
    border-color: var(--borde) !important;
    color: var(--texto-muted) !important;
}

.note-editor .note-btn:hover {
    background: var(--dorado-sutil) !important;
    color: var(--dorado) !important;
}

.note-editor .note-editable {
    background: var(--negro-input) !important;
    color: var(--texto) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: .85rem !important;
}

.note-status-output { display: none !important; }


/* ================================================================
   8. BOTONES
================================================================ */

/* Primario — dorado */
.btn-crm {
    background: var(--dorado);
    border: none;
    border-radius: var(--radio);
    color: #0d0d0f;
    font-family: 'Montserrat', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .6rem 1.25rem;
    cursor: pointer;
    transition: background var(--trans), transform .15s, box-shadow var(--trans);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
}

.btn-crm:hover {
    background: var(--dorado-claro);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--dorado-glow);
    color: #0d0d0f;
}

.btn-crm:active { transform: translateY(0); }

/* Secundario — outline */
.btn-crm-outline {
    background: transparent;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    color: var(--texto-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .06em;
    padding: .6rem 1.25rem;
    cursor: pointer;
    transition: border-color var(--trans), color var(--trans), background var(--trans);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
}

.btn-crm-outline:hover {
    border-color: var(--dorado);
    color: var(--dorado);
    background: var(--dorado-sutil);
}

/* Peligro */
.btn-crm-danger {
    background: var(--rojo-bg);
    border: 1px solid var(--rojo);
    border-radius: var(--radio);
    color: var(--rojo);
    font-family: 'Montserrat', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    padding: .6rem 1.25rem;
    cursor: pointer;
    transition: background var(--trans), transform .15s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
}

.btn-crm-danger:hover {
    background: var(--rojo);
    color: #fff;
    transform: translateY(-1px);
}

/* Icono solamente */
.btn-icon {
    background: none;
    border: none;
    color: var(--texto-muted);
    font-size: .9rem;
    cursor: pointer;
    padding: .35rem .5rem;
    border-radius: var(--radio);
    transition: color var(--trans), background var(--trans);
}

.btn-icon:hover {
    color: var(--dorado);
    background: var(--dorado-sutil);
}


/* ================================================================
   9. BADGES & STATUS
================================================================ */
.badge-crm {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .25rem .65rem;
    border-radius: 20px;
}

.badge-crm.nuevo       { background: var(--azul-bg);    color: var(--azul); }
.badge-crm.cotizado    { background: var(--amarillo-bg); color: var(--amarillo); }
.badge-crm.proyecto    { background: var(--dorado-sutil); color: var(--dorado); }
.badge-crm.venta       { background: var(--verde-bg);   color: var(--verde); }
.badge-crm.perdido     { background: var(--rojo-bg);    color: var(--rojo); }
.badge-crm.espera      { background: var(--naranja-bg); color: var(--naranja); }
.badge-crm.inactivo    { background: var(--borde);      color: var(--texto-muted); }


/* ================================================================
   10. TIMELINE (Detalle Prospecto)
================================================================ */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--borde);
}

.timeline-item {
    display: flex;
    gap: 1.25rem;
    padding: 0 0 1.75rem 0;
    position: relative;
}

.timeline-dot {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
    background: var(--negro-card);
    z-index: 1;
}

.timeline-dot.gold   { border-color: var(--dorado); color: var(--dorado); background: var(--dorado-sutil); }
.timeline-dot.green  { border-color: var(--verde);  color: var(--verde);  background: var(--verde-bg); }
.timeline-dot.red    { border-color: var(--rojo);   color: var(--rojo);   background: var(--rojo-bg); }
.timeline-dot.blue   { border-color: var(--azul);   color: var(--azul);   background: var(--azul-bg); }

.timeline-body {
    flex: 1;
    background: var(--negro-card);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 1rem 1.25rem;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.timeline-author {
    font-size: .78rem;
    font-weight: 600;
    color: var(--texto);
}

.timeline-date {
    font-size: .7rem;
    color: var(--texto-muted);
    letter-spacing: .04em;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}

.timeline-content {
    font-size: .82rem;
    color: var(--texto-secundario);
    line-height: 1.65;
}

.timeline-content p:last-child { margin-bottom: 0; }


/* ================================================================
   11. MODALES
================================================================ */
.modal-content {
    background: var(--negro-card) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio-lg) !important;
}

.modal-header {
    border-bottom: 1px solid var(--borde) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 1.1rem !important;
    font-weight: 300 !important;
    letter-spacing: .08em !important;
    color: var(--texto) !important;
}

.modal-footer {
    border-top: 1px solid var(--borde) !important;
    padding: 1rem 1.5rem !important;
}

.btn-close {
    filter: invert(1) !important;
    opacity: .5 !important;
}

.btn-close:hover { opacity: 1 !important; }

.modal-backdrop {
    background: rgba(0,0,0,.7) !important;
}


/* ================================================================
   12. ALERTAS & TOASTS
================================================================ */
.alert-crm-success {
    background: var(--verde-bg);
    border-left: 3px solid var(--verde);
    border-radius: var(--radio);
    color: var(--verde);
    font-size: .8rem;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.alert-crm-warning {
    background: rgba(201,168,76,.1);
    border-left: 3px solid var(--dorado);
    border-radius: var(--radio);
    color: var(--dorado-claro);
    font-size: .8rem;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.alert-crm-danger {
    background: var(--rojo-bg);
    border-left: 3px solid var(--rojo);
    border-radius: var(--radio);
    color: var(--rojo);
    font-size: .8rem;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}


/* ================================================================
   13. SWEETALERT2 OVERRIDES
================================================================ */
.swal-crm-popup {
    background: var(--negro-card) !important;
    border: 1px solid var(--borde) !important;
    border-radius: var(--radio-lg) !important;
    font-family: 'Montserrat', sans-serif !important;
}

.swal2-title { color: var(--texto) !important; font-family: 'Cormorant Garamond', serif !important; }
.swal2-html-container { color: var(--texto-secundario) !important; font-size: .85rem !important; }
.swal2-icon { border-color: var(--borde) !important; }

.swal-crm-confirm {
    background: var(--dorado) !important;
    color: #0d0d0f !important;
    font-weight: 600 !important;
    font-size: .78rem !important;
    letter-spacing: .08em !important;
    border-radius: var(--radio) !important;
}

.swal-crm-cancel {
    background: var(--negro-input) !important;
    border: 1px solid var(--borde) !important;
    color: var(--texto-muted) !important;
    font-size: .78rem !important;
    border-radius: var(--radio) !important;
}


/* ================================================================
   14. CHARTS
================================================================ */
.chart-container {
    position: relative;
    width: 100%;
}


/* ================================================================
   15. UTILIDADES
================================================================ */
.text-gold   { color: var(--dorado) !important; }
.text-muted-crm { color: var(--texto-muted) !important; }
.text-verde  { color: var(--verde) !important; }
.text-rojo   { color: var(--rojo) !important; }

.bg-card     { background: var(--negro-card) !important; }
.bg-input    { background: var(--negro-input) !important; }

.border-crm  { border: 1px solid var(--borde) !important; }
.border-gold { border-color: var(--dorado) !important; }

.divider-crm {
    height: 1px;
    background: var(--borde);
    margin: 1.25rem 0;
}

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--negro); }
::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--texto-muted); }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--negro-card) 25%, var(--negro-hover) 50%, var(--negro-card) 75%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: var(--radio);
}

@keyframes skeleton-shimmer {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}


/* ================================================================
   16. RESPONSIVE
================================================================ */
@media (max-width: 768px) {
    #crm-content, .crm-content { padding: 1rem !important; }
    .stat-card { padding: 1rem; }
}

@media (max-width: 576px) {
    #crm-content, .crm-content { padding: .75rem !important; }
    .page-title { font-size: 1.2rem; }
    /* Asegurar que nada desborde en mobile */
    body, html { overflow-x: hidden !important; }
    .row { margin-left: 0 !important; margin-right: 0 !important; }
    [class*="col-"] { padding-left: .5rem !important; padding-right: .5rem !important; }
}