/* EduAdvisor360 - Main Theme CSS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary: #003087;
    --primary-light: #0047BD;
    --primary-dark: #001f5c;
    --secondary: #F5A623;
    --secondary-light: #FFB84D;
    --accent-teal: #00A896;
    --accent-green: #2ECC71;
    --accent-orange: #E67E22;
    --danger: #E53E3E;
    --success: #38A169;
    --warning: #D69E2E;
    --info: #3182CE;
    
    --bg-primary: #F0F4FF;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-sidebar: #001f5c;
    
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --text-white: #FFFFFF;
    
    --border: #E2E8F0;
    --border-focus: #003087;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,48,135,0.10);
    --shadow-lg: 0 8px 32px rgba(0,48,135,0.15);
    --shadow-xl: 0 20px 60px rgba(0,48,135,0.20);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;
    
    --sidebar-w: 260px;
    --header-h: 64px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(165deg, #001f5c 0%, #003087 60%, #0047BD 100%);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition-slow);
    box-shadow: 4px 0 20px rgba(0,48,135,0.25);
}

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

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand img {
    height: 44px;
    filter: brightness(0) invert(1);
}

.sidebar-brand-text {
    color: white;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-brand-text span { color: var(--secondary); }
.sidebar-tagline {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

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

.sidebar-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: white; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: rgba(255,255,255,0.5); font-size: 11px; text-transform: capitalize; }

.sidebar-nav { padding: 12px 12px; }
.nav-section-title {
    color: rgba(255,255,255,0.35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 8px 6px;
}

.nav-item { margin-bottom: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(3px);
}

.nav-link.active {
    background: rgba(255,255,255,0.18);
    color: white;
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--secondary);
    border-radius: 0 3px 3px 0;
}

.nav-link i { width: 18px; text-align: center; font-size: 15px; }

.nav-badge {
    margin-left: auto;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition-slow);
}

.topbar {
    height: var(--header-h);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.btn-toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.page-content { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226,232,240,0.8);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 24px; }

/* ===== STAT CARDS ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--stat-color, var(--primary));
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--stat-bg, rgba(0,48,135,0.08));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: var(--stat-color, var(--primary));
    margin-bottom: 12px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ===== FORMS ===== */
.form-section {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.form-section-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-header h5 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.3px;
}

.form-section-header i { font-size: 16px; opacity: 0.9; }
.form-section-body { padding: 24px; }

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.2px;
}

.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    background: #FAFBFF;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,48,135,0.10);
    background: white;
    outline: none;
}

.form-control::placeholder { color: #A0AEC0; }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    background: #F7F9FF;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(0,48,135,0.04);
}

.upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon { font-size: 32px; color: var(--primary); margin-bottom: 8px; }
.upload-text { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.upload-preview { margin-top: 8px; font-size: 12px; color: var(--success); display: none; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0,48,135,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,48,135,0.4);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(245,166,35,0.3);
}

.btn-secondary:hover { background: var(--secondary-light); transform: translateY(-1px); color: white; }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== BADGES / STATUS ===== */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-draft { background: #EDF2F7; color: #718096; }
.badge-submitted { background: #EBF4FF; color: #3182CE; }
.badge-under_review { background: #FFFBEB; color: #D69E2E; }
.badge-approved { background: #F0FFF4; color: #38A169; }
.badge-rejected { background: #FFF5F5; color: #E53E3E; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: linear-gradient(135deg, #F7F9FF, #EDF2FF); }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 14px 16px;
    font-size: 13.5px;
    color: var(--text-primary);
    border-bottom: 1px solid #F7F9FF;
    vertical-align: middle;
}
tr:hover td { background: #F7F9FF; }
tr:last-child td { border-bottom: none; }

/* ===== SIBLING ROW ===== */
.sibling-row {
    background: #F7F9FF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 10px;
    position: relative;
    transition: var(--transition);
}

.sibling-row:hover { border-color: var(--primary-light); }

.btn-remove-sibling {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.btn-remove-sibling:hover { transform: scale(1.1); background: #C53030; }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #001f5c 0%, #003087 50%, #0047BD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(245,166,35,0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0,168,150,0.06) 0%, transparent 40%);
    animation: bgShift 8s ease-in-out infinite alternate;
}

@keyframes bgShift {
    from { transform: rotate(0deg); }
    to { transform: rotate(3deg) scale(1.02); }
}

.auth-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-text { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.auth-logo-text span { color: var(--secondary); }
.auth-tagline { font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; }

.auth-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

/* ===== PROGRESS STEPS ===== */
.progress-steps {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step:last-child::after { display: none; }

.step.active::after { background: var(--primary); }

.step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.step.active .step-num, .step.done .step-num {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0,48,135,0.3);
}

.step-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; white-space: nowrap; }
.step.active .step-label { color: var(--primary); }

/* ===== ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid transparent;
}

.alert-success { background: #F0FFF4; color: #276749; border-left-color: var(--success); }
.alert-danger { background: #FFF5F5; color: #C53030; border-left-color: var(--danger); }
.alert-warning { background: #FFFBEB; color: #975A16; border-left-color: var(--warning); }
.alert-info { background: #EBF8FF; color: #2C5282; border-left-color: var(--info); }

/* ===== FOOTER ===== */
.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: white;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-xl); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 24px; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }

/* ===== MOBILE ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-toggle-sidebar { display: block; }
    .sidebar-overlay.show { display: block; }
    .page-content { padding: 16px; }
    .auth-container { padding: 28px 20px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-section-body { padding: 16px; }
    .card-body { padding: 16px; }
}

@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 0 16px; }
    .progress-steps { overflow-x: auto; padding-bottom: 8px; }
    .step-label { display: none; }
}

/* ===== UTILITY ===== */
.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.fw-800 { font-weight: 800; }
.gap-2 { gap: 8px; }
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h5 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F7F9FF; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* Input group icon */
.input-group-icon { position: relative; }
.input-group-icon .form-control { padding-left: 40px; }
.input-group-icon .icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

/* Password toggle */
.pw-toggle {
    position: absolute;
    right: 13px; top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0;
}

/* Checkboxes */
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-label { font-size: 13px; }

/* Document viewer link */
.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.doc-link:hover { text-decoration: underline; }
