/* =====================================================
   Repositorio Digital de Sílabos - Estilos principales
   ===================================================== */

:root {
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --primary-dark: #152a45;
    --accent: #3182ce;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;
    --sidebar-width: 260px;
    --header-height: 60px;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
}

/* ========== LOGIN ========== */
.login-page {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.8rem;
}

.login-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

/* ========== LAYOUT ========== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-close {
    color: #fff;
    font-size: 1.2rem;
    padding: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

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

.nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #63b3ed;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

.user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-wrapper {
    flex: 1;
    padding: 1.5rem;
}

.main-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========== STAT CARDS ========== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* ========== TABLES ========== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

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

/* ========== FORMS ========== */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--border);
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    background: #f7fafc;
    border-color: var(--border);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

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

/* ========== FILTERS ========== */
.filters-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

/* ========== PDF VIEWER ========== */
.pdf-viewer-container {
    background: #525659;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 70vh;
}

.pdf-viewer-container iframe,
.pdf-viewer-container embed {
    width: 100%;
    height: 75vh;
    border: none;
}

.pdf-info-bar {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

/* ========== PAGINATION ========== */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    color: var(--primary-light);
    border-color: var(--border);
}

.pagination .page-item.active .page-link {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
}

/* ========== UTILITIES ========== */
.bg-primary { background-color: var(--primary-light) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-secondary { background-color: #718096 !important; }

.action-btns {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}