:root {
    --primary: #1e3a8a;
    --primary-strong: #172554;
    --primary-soft: #dbeafe;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --secondary: #0f172a;
    --accent: #eff6ff;
    --bg: #f3f7ff;
    --panel: #ffffff;
    --muted: #64748b;
    --white: #ffffff;
    --success: #0f766e;
    --danger: #dc2626;
    --warning: #f59e0b;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 12px 28px rgba(30, 58, 138, 0.10);
    --radius: 1rem;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(180deg, #f4f8ff 0%, #edf4ff 100%);
    color: #0f172a;
    line-height: 1.6;
}

img { max-width: 100%; }

a { text-decoration: none; }

.card,
.table,
.form-control,
.form-select,
.form-check-input,
.btn,
.alert,
.modal-content {
    border-radius: var(--radius);
}

/* Global button styling */
.btn {
    border-radius: 0.8rem;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%);
    border-color: var(--primary-strong);
    color: var(--white);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(30, 58, 138, 0.25);
    background: rgba(255,255,255,0.8);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.btn-outline-secondary {
    border-color: rgba(148,163,184,0.5);
    color: var(--secondary);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 24px rgba(30, 58, 138, 0.16);
}

.navbar-brand {
    letter-spacing: 0.5px;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.96) !important;
    transition: all 0.2s ease;
    border-radius: 0.6rem;
    padding: 0.5rem 0.75rem !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff !important;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.35);
}

.navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.site-logo {
    height: 44px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    border-radius: 10px;
}

.panel-topbar .site-logo {
    height: 36px;
    margin-right: .75rem;
}

/* Shared cards */
.card {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: var(--shadow-card);
}

/* Shared forms */
.form-control,
.form-select {
    background-color: #f8fbff;
    border: 1px solid rgba(148,163,184,0.38);
    color: var(--secondary);
    padding: 0.78rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(59,130,246,0.7);
    box-shadow: 0 0 0 0.22rem rgba(59,130,246,0.14);
    background-color: var(--white);
}

.form-label {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.input-group .btn {
    border-radius: 0 0.8rem 0.8rem 0;
}

/* Tables */
.table {
    background: var(--white);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table thead th {
    background: rgba(30, 58, 138, 0.06);
    color: var(--primary-strong);
    font-weight: 700;
    border-bottom: 1px solid rgba(30,58,138,0.12);
    padding: 0.9rem 0.8rem;
}

.table tbody td {
    padding: 0.9rem 0.8rem;
    vertical-align: middle;
    border-color: rgba(148,163,184,0.18);
}

.table tbody tr:hover {
    background: rgba(59,130,246,0.03);
}

/* Alerts */
.alert {
    border: none;
    box-shadow: 0 8px 18px rgba(15,23,42,0.04);
}

.alert-success { background: rgba(15,118,110,0.10); color: #065f46; }
.alert-danger { background: rgba(220,38,38,0.08); color: #991b1b; }
.alert-warning { background: rgba(245,158,11,0.12); color: #92400e; }
.alert-info { background: rgba(59,130,246,0.08); color: #1d4ed8; }

/* Section layouts */
.hero-section {
    background: linear-gradient(135deg, #edf5ff 0%, #f8fbff 100%);
    padding: 0;
}

.hero-section .hero-banner {
    width: 100%;
    max-width: 100%;
    position: relative;
}

.hero-section .hero-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-section .container {
    max-width: 1400px;
}

.hero-banner-actions {
    position: absolute;
    right: 4rem;
    bottom: 2.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-banner-actions .btn {
    min-width: 160px;
    box-shadow: 0 18px 48px rgba(6, 40, 84, 0.16);
}

@media (max-width: 768px) {
    .hero-banner-actions {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        justify-content: center;
    }

    .hero-banner-actions .btn {
        width: 100%;
        min-width: unset;
    }
}

.alur-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.alur-row {
    width: 100%;
    align-items: stretch;
}

.alur-step-card {
    flex: 1 1 220px;
    min-width: 220px;
    background: rgba(255,255,255,0.96);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.alur-step-card .step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1rem;
}

.alur-step-card::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(30, 58, 138, 0.08);
    top: -20px;
    right: -20px;
}

.alur-top,
.alur-bottom {
    min-height: 240px;
}

@media (max-width: 992px) {
    .alur-flow { gap: 1rem; }
    .alur-row { flex-direction: column; gap: 1rem; }
}

/* Shared admin/student shell */
.admin-layout,
.student-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 20%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: var(--white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(30,58,138,0.18);
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.sidebar-brand img,
.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
}

.sidebar-brand div {
    min-width: 0;
}

.sidebar-brand strong {
    display: block;
    font-size: 1rem;
    color: var(--white);
    line-height: 1.3;
    word-break: break-word;
}

.sidebar-brand .small {
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
}

.sidebar .nav {
    padding: 0.9rem 0.8rem 1rem;
    gap: 0.45rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: var(--white) !important;
    border-radius: 0.75rem;
    padding: 0.8rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(255,255,255,0.08);
    border-left-color: var(--primary-lighter);
    transform: translateX(3px);
    color: var(--white) !important;
}

.sidebar .nav-link.active {
    background: rgba(59,130,246,0.22);
    border-left-color: var(--primary-lighter);
    box-shadow: inset 2px 0 0 rgba(96,165,250,0.8);
}

.main-content {
    flex: 1;
    margin-left: 20%;
    width: calc(100% - 20%);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f5f7fb;
    padding: 1.5rem;
}

.panel-topbar {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%) !important;
    color: var(--white) !important;
    padding: 1rem 1.25rem !important;
    border-radius: 1rem;
    box-shadow: 0 12px 24px rgba(30,58,138,0.18);
}

/* Scrollbar */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.28);
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: min(280px, 82vw);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex !important;
    }
}

@media (max-width: 767px) {
    .main-content {
        padding: 1rem;
    }

    .panel-topbar {
        padding: 0.9rem 1rem !important;
    }

    .panel-topbar h5 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: min(100vw, 300px);
    }

    .btn {
        width: 100%;
    }

    .navbar-nav .btn {
        width: auto;
    }
}

.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.badge.text-bg-primary { background-color: var(--primary) !important; color: var(--white) !important; }
.bg-white { background-color: var(--white) !important; }

/* Forms card layout */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #edf5ff 0%, #f8fbff 100%);
}

.auth-card {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: var(--shadow-soft);
    border-radius: 1.5rem;
    padding: 2rem;
}

.table-responsive {
    border-radius: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
