/* Variables CSS para el tema */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
}

/* Reset y base */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Wrapper principal */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-brand i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar.collapsed .sidebar-brand i {
    margin-right: 0;
}

#sidebarCollapse {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    padding: 5px 10px;
}

#sidebarCollapse:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation */
.sidebar ul.components {
    padding: 20px 0;
}

.sidebar ul li {
    position: relative;
}

.sidebar ul li .nav-link {
    padding: 15px 20px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.sidebar ul li .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar ul li .nav-link.active {
    color: white;
    background: var(--accent-color);
}

.sidebar ul li .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed ul li .nav-link span {
    display: none;
}

.sidebar.collapsed ul li .nav-link i {
    margin-right: 0;
}

/* Submenu */
.sidebar ul li ul {
    background: rgba(0, 0, 0, 0.1);
    padding: 0;
}

.sidebar ul li ul li .nav-link {
    padding: 10px 20px 10px 50px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar ul li ul li .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar.collapsed ul li ul {
    display: none !important;
}

/* Content */
.content {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
}

.content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top navbar */
.content .navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sidebarCollapseTop {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

#sidebarCollapseTop:hover {
    background: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
}

/* Botones */
.btn {
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* Tabla */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

/* Paginación */
.pagination {
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    margin: 0 2px;
    border-radius: 6px;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Alertas */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

/* Formularios */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
}

/* Badges */
.badge {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    
    .sidebar.show {
        margin-left: 0;
    }
    
    .content {
        margin-left: 0;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar ul li .nav-link {
        padding: 12px 15px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizado */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Utilidades */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Dashboard específico */
.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dashboard-card .card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.dashboard-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.dashboard-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.status-sin-licenciar {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.status-licenciado {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.status-vencido {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.status-suspendido {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}