/* =============================================================================
   CRM EKOBITS - Estilos propios (Fase 3)
   ============================================================================= */

/* ---------- Login ---------- */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    color: #fff;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Layout general del CRM ---------- */
.crm-body {
    min-height: 100vh;
}

.crm-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.crm-sidebar {
    width: 250px;
    min-width: 250px;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
}

.crm-sidebar-header {
    height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-brand {
    color: #fff;
    font-size: 1.05rem;
    white-space: nowrap;
}

.crm-brand strong {
    color: #38bdf8;
}

.crm-nav-link {
    color: #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
}

.crm-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.crm-nav-link.active {
    color: #fff;
    background: #0d6efd;
}

.crm-nav-link.disabled {
    color: #64748b;
    cursor: not-allowed;
}

.crm-sidebar-footer {
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* En movil, el offcanvas maneja el sidebar */
@media (max-width: 991.98px) {
    .crm-sidebar {
        background: #0f172a !important;
    }
}

/* ---------- Zona principal ---------- */
.crm-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Permite que las tablas responsivas no desborden */
}

.crm-topbar {
    height: 60px;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.crm-content {
    flex-grow: 1;
    background: var(--bs-tertiary-bg);
}

/* ---------- KPIs ---------- */
.crm-kpi .card-body {
    position: relative;
    padding: 1rem;
}

.crm-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.crm-kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.crm-kpi-label {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

/* ---------- Campana de notificaciones ---------- */
.crm-bell-menu {
    width: 320px;
    max-width: 90vw;
}

.crm-bell-list {
    max-height: 320px;
    overflow-y: auto;
}

.crm-bell-unread {
    background: var(--bs-primary-bg-subtle);
}

/* ---------- Ajustes modo oscuro ---------- */
[data-bs-theme="dark"] .crm-content {
    background: #0b1120;
}

[data-bs-theme="dark"] .crm-topbar {
    background: #111827;
}

[data-bs-theme="dark"] .card {
    background: #111827;
}
