/* ===================================================================
   AutoSecurity - Dashboard Layout Styles
   =================================================================== */

/* Variables para CONCYTEQ */
:root {
    --concyteq: #003366;
    --concyteq-oscuro: #002244;
    --morado: #6f42c1;
    --morado-claro: #9b7fd3;
    --gris-claro: #f8f9fa;
    --gris-medio: #6c757d;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Barlow Semi Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    overflow-x: hidden;
}

/* ===================================================================
   SIDEBAR
   =================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--concyteq) 0%, var(--concyteq-oscuro) 100%);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Logo del sidebar */
.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
}

/* Navegación del sidebar */
.sidebar-nav {
    padding: 1rem 0;
    list-style: none;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding-left: 1.75rem;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid var(--morado-claro);
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-nav .nav-link span {
    flex: 1;
}

/* Submenú toggle */
.submenu-toggle {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.submenu-toggle.rotated {
    transform: rotate(180deg);
}

/* Submenú */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.submenu.show {
    max-height: 500px;
}

.submenu-item {
    padding: 0.65rem 1.5rem 0.65rem 3.5rem !important;
    font-size: 0.9rem;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 3.75rem !important;
}

.submenu-item.active {
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--morado-claro);
}

/* Divider del sidebar */
.sidebar-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 1rem 1.5rem;
}

/* ===================================================================
   MAIN CONTENT
   =================================================================== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: #f4f6f9;
    transition: margin-left 0.3s ease;
}

/* ===================================================================
   TOP NAVBAR
   =================================================================== */
.top-navbar {
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-navbar .navbar-text {
    display: flex;
    align-items: center;
    color: var(--concyteq);
    font-size: 0.95rem;
}

.top-navbar .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

.bg-concyteq {
    background-color: var(--concyteq) !important;
}

.bg-morado {
    background-color: var(--morado) !important;
}

.text-concyteq {
    color: var(--concyteq) !important;
}

.text-concyteq-oscuro {
    color: var(--concyteq-oscuro) !important;
}

/* Avatar en header */
.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e3e6f0;
}

/* Search input en navbar */
.top-navbar input[type="text"].form-control {
    border-radius: 20px;
    border: 1px solid #e3e6f0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: 250px;
}

.top-navbar input[type="text"].form-control:focus {
    border-color: var(--concyteq);
    box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.15);
}

/* Notificación badge */
.badge-counter {
    position: absolute;
    transform: scale(0.7);
    transform-origin: top right;
}

/* ===================================================================
   PAGE CONTENT
   =================================================================== */
.page-content {
    padding: 1.5rem;
    min-height: calc(100vh - 70px);
}

/* ===================================================================
   PERFIL DE USUARIO
   =================================================================== */
.perfil-foto-container {
    position: relative;
    display: inline-block;
}

.perfil-foto {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--concyteq);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.perfil-foto-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--morado);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.perfil-foto-overlay:hover {
    background: var(--morado-claro);
    transform: scale(1.1);
}

.perfil-foto-btn {
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar input[type="text"].form-control {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 1rem;
    }

    .sidebar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }

    .top-navbar {
        padding: 0.5rem 1rem;
    }

    .top-navbar .navbar-text {
        font-size: 0.85rem;
    }

    .header-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e3e6f0;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--concyteq) 0%, var(--morado) 100%);
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.border-left-primary {
    border-left: 0.25rem solid var(--concyteq) !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}
