/* ============================================
   SITE.CSS - Estilos globales del layout
   Solo contiene:
   - Reset y base
   - Top search bar
   - Dropdown de usuario
   - Alertas globales
   - Scrollbar personalizado
   - Utilidades generales
   - Responsive global
   - Estilos del login (soporte, etc.)
   
   NOTA: Los estilos de sidebar están en sidebar.css
         Los estilos de cada módulo están en su propio CSS
   ============================================ */

/* ============================================ */
/* RESET Y BASE                                 */
/* ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
}

body.guest {
    background: #f4f6f9;
}

/* ============================================ */
/* MAIN CONTENT Y CONTENEDORES                  */
/* ============================================ */

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background: #f4f6f9;
    padding: 0;
}

/* Cuando el sidebar está oculto */
body.sidebar-collapsed .main-content {
    margin-left: 0;
}

.page-content {
    padding: 20px 25px;
}

.content-wrapper {
    padding: 20px 25px;
}

/* ============================================ */
/* TOP SEARCH BAR                               */
/* ============================================ */

.top-search-bar {
    background: #ffffff;
    padding: 12px 25px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-search-bar .search-wrapper {
    flex: 1;
    max-width: 400px;
}

.top-search-bar .search-wrapper .input-group {
    background: #f4f6f9;
    border-radius: 25px;
    padding: 4px 12px;
    transition: all 0.2s ease;
}

.top-search-bar .search-wrapper .input-group:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.top-search-bar .search-wrapper input.form-control {
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 0.85rem;
    padding: 6px 8px;
}

.top-search-bar .search-wrapper input.form-control:focus {
    background: transparent;
    box-shadow: none;
    border: none;
}

.top-search-bar .search-wrapper .input-group-text {
    color: #6c757d;
    font-size: 0.85rem;
}

/* ============================================ */
/* DROPDOWN DE USUARIO                          */
/* ============================================ */

.user-info-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 30px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    background: transparent;
    border: none;
}

.user-info:hover,
.user-info:focus,
.user-info.show {
    background: rgba(13, 110, 253, 0.08);
    text-decoration: none;
    color: inherit;
}

.user-info:hover .user-name {
    color: #0d6efd;
}

.user-info:hover .avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-info .user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-info .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.2s ease;
}

.user-info .user-role {
    font-size: 0.65rem;
    color: #6c757d;
    text-transform: capitalize;
}

.user-info.dropdown-toggle::after {
    display: none;
}

.user-info .dropdown-arrow {
    font-size: 0.65rem;
    color: #6c757d;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.user-info[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* ============================================ */
/* DROPDOWN MENU DEL USUARIO                    */
/* ============================================ */

.user-dropdown-menu {
    min-width: 260px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    margin-top: 8px !important;
}

.user-dropdown-menu .dropdown-header {
    padding: 15px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-email {
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-menu .dropdown-item {
    padding: 10px 18px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.user-dropdown-menu .dropdown-item:hover {
    background: #e7f1ff;
    padding-left: 22px;
}

.user-dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background: #fde8e8;
}

.user-dropdown-menu .dropdown-divider {
    margin: 4px 0;
    border-color: #e9ecef;
}

/* ============================================ */
/* ALERTAS GLOBALES                             */
/* ============================================ */

.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* ============================================ */
/* SCROLLBAR PERSONALIZADA                      */
/* ============================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8b0b8;
}

/* ============================================ */
/* UTILIDADES                                   */
/* ============================================ */

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #0d6efd !important;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #0dcaf0 !important;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .top-search-bar {
        padding: 10px 15px;
    }

    .top-search-bar .search-wrapper {
        max-width: 100%;
    }

    .page-content {
        padding: 15px 10px;
    }

    .content-wrapper {
        padding: 15px 10px;
    }

    .user-info .user-details {
        display: none;
    }

    .user-info {
        padding: 6px;
    }

    .user-info .dropdown-arrow {
        display: none;
    }

    .user-dropdown-menu {
        min-width: 220px;
    }

    .alert {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}

@media (max-width: 576px) {
    .top-search-bar {
        padding: 8px 12px;
    }

    .user-info .avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .dropdown-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .user-dropdown-menu {
        min-width: 200px;
    }
}

/* ============================================ */
/* BOTÓN "GENERAR REPORTE" (dentro del header)  */
/* ============================================ */

.btn-generar-reporte {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-generar-reporte:hover {
    background: linear-gradient(135deg, #b02a37, #8b1a25);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

.btn-generar-reporte i {
    font-size: inherit;
}

@media (max-width: 576px) {
    .btn-generar-reporte span {
        display: none;
    }
}

/* ============================================ */
/* 🔥 LOGIN - CONTENEDOR PRINCIPAL              */
/* ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0091FF 0%, #0066CC 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 145, 255, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #8ccbfc;
    box-shadow: 0 10px 30px rgba(140, 203, 252, 0.4);
    padding: 15px;
    transition: transform 0.3s ease;
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: transparent !important;
}

.logo-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(140, 203, 252, 0.5);
}

.login-subtitle {
    color: #888;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e8ecf1;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: #0091FF;
    box-shadow: 0 0 0 4px rgba(0, 145, 255, 0.1);
}

.login-card .form-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
    margin-bottom: 5px;
}

.btn-login {
    background: linear-gradient(135deg, #0091FF 0%, #0066CC 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    width: 100% !important;
    color: #ffffff !important;
    margin-top: 10px !important;
    transition: all 0.3s !important;
}

.btn-login:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 145, 255, 0.4) !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #0091FF 0%, #0066CC 100%) !important;
}

.btn-login:focus,
.btn-login:active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0091FF 0%, #0066CC 100%) !important;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8ecf1;
}

.login-footer a {
    color: #0091FF;
    text-decoration: none;
    font-size: 13px;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-bottom {
    text-align: center;
    margin-top: 20px;
    color: #aaa;
    font-size: 12px;
}

.login-bottom a {
    color: #0091FF;
    text-decoration: none;
    font-size: 12px;
}

.login-bottom a:hover {
    text-decoration: underline;
}

.login-card .field-loginform-rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.login-card .field-loginform-rememberme label {
    margin: 0;
    font-weight: 400;
    color: #666;
    font-size: 14px;
}

.login-card .field-loginform-rememberme input {
    width: 18px;
    height: 18px;
    accent-color: #0091FF;
    cursor: pointer;
}

.forgot-password {
    float: right;
    color: #0091FF;
    text-decoration: none;
    font-size: 13px;
    margin-top: 15px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.alert-custom {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.help-block {
    font-size: 13px;
    margin-top: 5px;
}

/* ============================================ */
/* 🔥 MENSAJE DE SOPORTE EN LOGIN              */
/* ============================================ */

.login-support-box {
    margin-top: 20px;
    text-align: center;
}

.login-support-text {
    margin: 0;
    font-size: 12px;
    color: #0091FF;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.login-support-text i {
    color: #0091FF;
    font-size: 12px;
    margin-right: 4px;
    vertical-align: middle;
}

.login-support-text + .login-support-text {
    margin-top: 3px;
}

.login-support-email {
    display: block;
    margin: 3px 0 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #0091FF;
    letter-spacing: 0.3px;
    text-align: center;
    user-select: all;
    cursor: text;
}