/* =====================================================
   SEI - Sistema Escolar Integral
   Stylesheet Principal
   ===================================================== */

:root {
    /* Paleta escolar moderna */
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --primary-50: #EEF2FF;
    --secondary: #06B6D4;
    --secondary-light: #67E8F9;
    --accent: #F59E0B;
    --accent-light: #FCD34D;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #1E1B4B;
    --bg-sidebar-hover: #312E81;
    
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --text-sidebar: #C7D2FE;
    --text-sidebar-active: #FFFFFF;
    
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 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);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', sans-serif; font-weight: 600; line-height: 1.3; }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .badge-nav { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 1.2em; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.4em;
}

.sidebar-logo i {
    font-size: 1.5em;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 1.1em;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.sidebar-user-name { color: white; font-size: 0.9em; font-weight: 500; display: block; }
.sidebar-user-role { color: var(--text-sidebar); font-size: 0.75em; display: block; }

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

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-nav ul { list-style: none; }

.nav-section {
    color: var(--text-light);
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 16px 20px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 0.88em;
    border-radius: 0;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 500;
}

.nav-link i { width: 20px; text-align: center; margin-right: 12px; font-size: 1em; }

.badge-nav {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7em;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-link { color: #F87171 !important; }
.logout-link:hover { background: rgba(239,68,68,0.15) !important; }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ---- Topbar ---- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-secondary);
    cursor: pointer;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.9em; }
.breadcrumb-item { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb-separator { color: var(--text-light); }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.topbar-search i { position: absolute; left: 12px; color: var(--text-light); font-size: 0.85em; }
.topbar-search input {
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85em;
    width: 220px;
    background: var(--bg-primary);
    transition: var(--transition);
    outline: none;
}
.topbar-search input:focus { border-color: var(--primary-light); width: 280px; box-shadow: 0 0 0 3px var(--primary-50); }

.topbar-icons { display: flex; align-items: center; gap: 8px; }

.topbar-icon {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
}
.topbar-icon:hover { background: var(--primary-50); color: var(--primary); }

.badge-topbar {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.6em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.topbar-user-dropdown { position: relative; }

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    transition: var(--transition);
}
.topbar-user-btn:hover { border-color: var(--primary-light); }
.topbar-user-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.topbar-user-btn span { font-size: 0.85em; color: var(--text-primary); }
.topbar-user-btn i { font-size: 0.7em; color: var(--text-light); }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 200px;
    padding: 8px;
    display: none;
    z-index: 1001;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a,
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}
.dropdown-menu a:hover,
.dropdown-item:hover { background: var(--primary-50); color: var(--primary); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---- Page Content ---- */
.page-content { padding: 24px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title { font-size: 1.6em; color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); font-size: 0.9em; margin-top: 4px; }

/* ---- Cards ---- */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 1em; }

.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-primary); }

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
}
.stat-icon.blue { background: #EEF2FF; color: var(--primary); }
.stat-icon.green { background: #ECFDF5; color: var(--success); }
.stat-icon.yellow { background: #FFFBEB; color: var(--warning); }
.stat-icon.red { background: #FEF2F2; color: var(--danger); }
.stat-icon.cyan { background: #ECFEFF; color: var(--secondary); }
.stat-icon.purple { background: #FAF5FF; color: #A855F7; }

.stat-info { flex: 1; }
.stat-value { font-size: 1.6em; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.82em; color: var(--text-secondary); }
.stat-trend { font-size: 0.75em; margin-top: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(79,70,229,0.4); color: white; }

.btn-secondary { background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-light { background: #f8f9fa; color: var(--text-primary); border: 1px solid var(--border); }
.btn-light:hover { background: #e9ecef; border-color: var(--border-light); }

.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #DC2626); color: white; }
.btn-warning { background: linear-gradient(135deg, var(--warning), #D97706); color: white; }
.btn-info { background: linear-gradient(135deg, var(--info), #2563EB); color: white; }

.btn-sm { padding: 6px 14px; font-size: 0.82em; }
.btn-lg { padding: 14px 28px; font-size: 1em; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.form-control::placeholder { color: var(--text-light); }

textarea.form-control { min-height: 100px; resize: vertical; }

select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.form-text { font-size: 0.78em; color: var(--text-secondary); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.78em; margin-top: 4px; }

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-append {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.88em;
}

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: var(--bg-primary);
    padding: 12px 16px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 2px solid var(--border);
}
.table td {
    padding: 12px 16px;
    font-size: 0.88em;
    border-bottom: 1px solid var(--border-light);
}
.table tr:hover td { background: var(--primary-50); }
.table tr:last-child td { border-bottom: none; }

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9em;
    position: relative;
}
.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    opacity: 0.6;
}
.alert-success { background: #ECFDF5; color: #065F46; border-left: 4px solid var(--success); }
.alert-error { background: #FEF2F2; color: #991B1B; border-left: 4px solid var(--danger); }
.alert-warning { background: #FFFBEB; color: #92400E; border-left: 4px solid var(--warning); }
.alert-info { background: #EFF6FF; color: #1E40AF; border-left: 4px solid var(--info); }

/* ---- Badges & Tags ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: #ECFDF5; color: var(--success); }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: var(--danger); }
.badge-info { background: #EFF6FF; color: var(--info); }

/* ---- Tabs ---- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 4px;
    margin-bottom: 20px;
}
.tab-link {
    padding: 10px 20px;
    font-size: 0.88em;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1em; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- Pagination ---- */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 24px; }
.pagination { display: flex; gap: 4px; list-style: none; }
.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--text-primary);
}
.page-link:hover { background: var(--primary-50); border-color: var(--primary-light); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- Grid Layout Helpers ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}
.empty-state i { font-size: 3em; color: var(--text-light); margin-bottom: 16px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-light); font-size: 0.9em; }

/* ---- Loading ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
    position: relative;
    overflow: hidden;
}

.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: white;
}
.login-bg-shapes .shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; }
.login-bg-shapes .shape-2 { width: 300px; height: 300px; bottom: -80px; left: -80px; }
.login-bg-shapes .shape-3 { width: 200px; height: 200px; top: 50%; left: 50%; }

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: white;
    position: relative;
    z-index: 1;
}

.login-brand { text-align: center; margin-bottom: 40px; }
.login-brand i { font-size: 4em; margin-bottom: 16px; display: block; color: var(--accent-light); }
.login-brand h1 { font-size: 2.2em; font-family: 'Poppins', sans-serif; }
.login-brand p { color: rgba(255,255,255,0.7); margin-top: 8px; font-size: 1.1em; }

.login-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 500px;
}
.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}
.login-feature i { font-size: 1.3em; color: var(--accent-light); margin-top: 2px; }
.login-feature h4 { font-size: 0.9em; margin-bottom: 2px; }
.login-feature p { font-size: 0.78em; color: rgba(255,255,255,0.6); }

.login-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.login-card h2 { font-size: 1.5em; margin-bottom: 4px; }
.login-card .subtitle { color: var(--text-secondary); font-size: 0.9em; margin-bottom: 28px; }

.login-card .form-group { margin-bottom: 20px; }
.login-card .form-control {
    padding: 12px 16px;
    font-size: 0.95em;
}

.login-input-icon {
    position: relative;
}
.login-input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}
.login-input-icon .form-control { padding-left: 42px; }

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    margin-bottom: 24px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* ---- Quick Access Cards (Dashboard) ---- */
.quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}
.quick-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    color: var(--primary);
}
.quick-card i {
    font-size: 2em;
    margin-bottom: 12px;
    color: var(--primary);
}
.quick-card span { font-size: 0.85em; font-weight: 500; text-align: center; }

/* ---- Activity Feed ---- */
.activity-list { list-style: none; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 0.88em; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.75em; color: var(--text-light); margin-top: 2px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 2000;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    
    .main-content { margin-left: 0 !important; }
    .mobile-toggle { display: block; }
    
    .login-page { flex-direction: column; }
    .login-left { padding: 30px 20px; }
    .login-features { grid-template-columns: 1fr; }
    .login-right { width: 100%; padding: 20px; }
    
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    
    .topbar-search { display: none; }
}

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin: 0 !important; }
    .page-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- Animations ---- */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.slide-in { animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* ---- Exam Types Specific ---- */
.exam-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.exam-type-card {
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.exam-type-card:hover, .exam-type-card.selected {
    border-color: var(--primary);
    background: var(--primary-50);
}
.exam-type-card i { font-size: 2em; color: var(--primary); margin-bottom: 8px; }
.exam-type-card h4 { font-size: 0.95em; margin-bottom: 4px; }
.exam-type-card p { font-size: 0.78em; color: var(--text-secondary); }

/* ---- Word Search Puzzle ---- */
.word-search-grid {
    display: inline-grid;
    gap: 2px;
    background: var(--border);
    padding: 2px;
    border-radius: var(--radius-sm);
}
.word-search-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}
.word-search-cell.selected { background: var(--primary-light); color: white; }
.word-search-cell.found { background: var(--success); color: white; }

/* ---- Flashcards ---- */
.flashcard {
    perspective: 1000px;
    width: 280px;
    height: 180px;
    cursor: pointer;
}
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 0.95em;
}
.flashcard-front { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.flashcard-back { background: white; border: 2px solid var(--primary); transform: rotateY(180deg); }

/* ---- Progress Bar ---- */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.progress-fill.blue { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-fill.green { background: linear-gradient(90deg, var(--success), #34D399); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--warning), var(--accent-light)); }
.progress-fill.red { background: linear-gradient(90deg, var(--danger), #F87171); }

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 100;
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.82em; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ---- Aula Layout ---- */
.aula-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tarjetas-modulo {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.tarjeta-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
}

.tarjeta-head {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.tarjeta-head h3 {
    margin: 0;
    font-size: 1.1em;
    flex: 1;
}

.tarjeta-body {
    padding: 20px;
}

.w-100 { width: 100%; }
