/* SIOC - Estilos principales */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

/* Layout principal */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    background-color: #f5f5f5;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
}

.topbar .navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.search-container {
    position: relative;
    max-width: 400px;
}

.search-container .input-group {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-results .search-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-results .search-item:hover {
    background-color: #f8f9fa;
}

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

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0 !important;
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: #495057;
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-nav .nav-link i:last-child {
    margin-left: auto;
}

.sidebar-nav .submenu-item {
    padding-left: 3rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.sidebar-nav .collapse.show {
    background-color: #f8f9fa;
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1019;
}

.sidebar-overlay.show {
    display: block;
}

/* Contenido principal */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Páginas de autenticación */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Headers de página - Uniforme en todas las páginas */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.page-header p.text-muted {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.page-header .header-actions {
    margin-top: 1rem;
}

/* Cards - Uniforme en todas las páginas */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
    font-size: 1rem;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Tablas - Uniforme en todas las páginas */
.table {
    background-color: white;
    font-size: 0.95rem;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #6c757d;
    padding: 0.75rem;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    font-size: 0.95rem;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Botones */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Flash messages */
.flash-messages {
    position: fixed;
    top: calc(var(--topbar-height) + 1rem);
    right: 1rem;
    z-index: 1050;
    max-width: 400px;
}

.flash-messages .alert {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
}

/* Gráficos */
.chart-container {
    background: white;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* Formularios - Uniforme en todas las páginas */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #495057;
}

.form-control,
.form-select {
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-text {
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

/* Spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Responsive - Uniforme en todos los dispositivos */
@media (max-width: 991.98px) {
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .page-header p.text-muted {
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.1rem;
    }
    
    .topbar .navbar-brand {
        font-size: 1rem;
    }
    
    .search-container {
        max-width: 200px;
    }
}

