/* ======================================================
   ORION EVALUATE — Design System
   Primary: #092031 (Navy)   Accent: #00D5E1 (Cyan)
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
    --navy:         #092031;
    --navy-light:   #0d2d44;
    --navy-mid:     #12374f;
    --cyan:         #00D5E1;
    --cyan-dark:    #00adb8;
    --cyan-glow:    rgba(0, 213, 225, 0.15);
    --white:        #ffffff;
    --surface:      #f4f7fa;
    --surface-2:    #eef2f6;
    --text-primary: #1a2e3b;
    --text-muted:   #7a90a0;
    --border:       #e2eaf0;
    --shadow-sm:    0 1px 3px rgba(9,32,49,0.06), 0 1px 2px rgba(9,32,49,0.04);
    --shadow-md:    0 4px 16px rgba(9,32,49,0.10);
    --shadow-lg:    0 8px 32px rgba(9,32,49,0.14);
    --radius:       12px;
    --radius-sm:    8px;
    --sidebar-w:    260px;
    --header-h:     64px;
    --transition:   all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

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

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

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.sidebar-logo-icon {
    width: 40px; height: 40px;
    background: var(--cyan);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: var(--navy);
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-logo-text {
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.sidebar-logo-sub {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 16px 10px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
    margin-bottom: 2px;
}
.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}
.sidebar-link.active {
    background: var(--cyan-glow);
    color: var(--cyan);
    border-left: 3px solid var(--cyan);
    padding-left: 9px;
}
.sidebar-link.active i { color: var(--cyan); }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: default;
}
.sidebar-avatar {
    width: 34px; height: 34px;
    background: var(--cyan);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--navy);
    flex-shrink: 0;
}
.sidebar-user-name {
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}
.sidebar-user-role {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Top Header ────────────────────────────────────────── */
.top-header {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.page-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-primary);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-header-logout {
    display: flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-header-logout:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231,76,60,0.05);
}

/* ── Page Body ─────────────────────────────────────────── */
.page-body {
    padding: 28px;
    flex: 1;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.card-body { padding: 20px; }
.card-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
}

/* ── Stat Cards ────────────────────────────────────────── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.cyan    { background: var(--cyan-glow); color: var(--cyan-dark); }
.stat-icon.navy    { background: rgba(9,32,49,0.08); color: var(--navy); }
.stat-icon.success { background: rgba(16,185,129,0.1); color: #059669; }
.stat-icon.warning { background: rgba(245,158,11,0.1); color: #d97706; }
.stat-icon.danger  { background: rgba(239,68,68,0.1);  color: #dc2626; }

.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--navy);
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--navy);
}
.btn-primary:hover {
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
    color: var(--navy);
    box-shadow: 0 4px 14px rgba(0,213,225,0.35);
}
.btn-dark {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}
.btn-dark:hover {
    background: var(--navy-light);
    border-color: var(--navy-light);
    color: var(--white);
}
.btn-success {
    background: #10b981;
    border-color: #10b981;
    color: var(--white);
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: var(--white);
}
.btn-warning:hover { background: #d97706; border-color: #d97706; color: var(--white); }
.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: var(--white);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: var(--white); }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--text-primary); color: var(--text-primary); background: var(--surface); }

.btn-outline-primary {
    background: transparent;
    border-color: var(--cyan);
    color: var(--cyan-dark);
}
.btn-outline-primary:hover { background: var(--cyan-glow); }

.btn-outline-danger {
    background: transparent;
    border-color: #fca5a5;
    color: #ef4444;
}
.btn-outline-danger:hover { background: rgba(239,68,68,0.05); border-color: #ef4444; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

/* ── Form Elements ─────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 6px; }
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--white);
    transition: var(--transition);
    width: 100%;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
}
.form-control.is-invalid { border-color: #ef4444; }
.invalid-feedback { color: #ef4444; font-size: 12px; margin-top: 4px; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 100px; }

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.input-group-text {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 9px 13px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Tables ────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface); }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-cyan    { background: var(--cyan-glow); color: var(--cyan-dark); }
.badge-navy    { background: rgba(9,32,49,0.1); color: var(--navy); }
.badge-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-danger  { background: rgba(239,68,68,0.1);  color: #dc2626; }
.badge-gray    { background: var(--surface-2); color: var(--text-muted); }

/* Bootstrap badge overrides */
.bg-primary    { background: var(--cyan) !important; color: var(--navy) !important; }
.bg-success    { background: #10b981 !important; color: #fff !important; }
.bg-warning    { background: #f59e0b !important; color: #fff !important; }
.bg-danger     { background: #ef4444 !important; color: #fff !important; }
.bg-secondary  { background: var(--surface-2) !important; color: var(--text-muted) !important; }
.bg-info       { background: var(--cyan-glow) !important; color: var(--cyan-dark) !important; }

/* ── Alerts ────────────────────────────────────────────── */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: #065f46; }
.alert-danger  { background: rgba(239,68,68,0.07);  border-color: rgba(239,68,68,0.2);  color: #7f1d1d; }
.alert-info    { background: var(--cyan-glow);       border-color: rgba(0,213,225,0.3);   color: #0e5966; }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: #78350f; }

/* ── Progress Bar ──────────────────────────────────────── */
.progress {
    height: 8px;
    background: var(--surface-2);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
    background: var(--cyan);
}
.progress-bar.bg-success { background: #10b981; }
.progress-bar.bg-danger  { background: #ef4444; }
.progress-bar.bg-primary { background: var(--cyan); }

/* ── Timer Bar (exam) ──────────────────────────────────── */
#timer-bar {
    background: var(--navy) !important;
    border-bottom: 2px solid var(--cyan);
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}
#timer-display { color: var(--cyan) !important; font-variant-numeric: tabular-nums; }
#timer-display.text-danger { color: #ef4444 !important; }

/* ── Auth Pages ────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-box {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.auth-header {
    background: var(--navy);
    padding: 32px 32px 28px;
    text-align: center;
}
.auth-logo {
    width: 56px; height: 56px;
    background: var(--cyan);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: var(--navy);
    font-weight: 800;
    margin: 0 auto 16px;
}
.auth-title  { color: var(--white); font-size: 20px; font-weight: 700; margin: 0; }
.auth-subtitle { color: rgba(255,255,255,0.5); font-size: 13px; margin: 4px 0 0; }
.auth-body { padding: 28px 32px 32px; }

/* ── Section Headers ───────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* ── Utilities ─────────────────────────────────────────── */
.text-muted    { color: var(--text-muted) !important; }
.text-cyan     { color: var(--cyan-dark); }
.text-navy     { color: var(--navy); }
.text-success  { color: #059669 !important; }
.text-danger   { color: #ef4444 !important; }
.text-warning  { color: #d97706 !important; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.d-flex        { display: flex; }
.align-items-center { align-items: center; }
.align-items-start  { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.flex-grow-1   { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-100         { width: 100%; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.me-3 { margin-right: 12px; }
.ms-2 { margin-left: 8px; }
.ms-auto { margin-left: auto; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 20px; padding-bottom: 20px; }
.px-0 { padding-left: 0; padding-right: 0; }
.p-0 { padding: 0; }
.p-3 { padding: 12px; }
.p-4 { padding: 20px; }
.p-2 { padding: 8px; }
.text-center { text-align: center; }
.text-end    { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: 12px; }
.fs-2 { font-size: 28px; }
.fs-5 { font-size: 18px; }
.fs-6 { font-size: 13px; }
.rounded { border-radius: var(--radius-sm); }
.border-bottom { border-bottom: 1px solid var(--border); }
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.min-w-0 { min-width: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Bootstrap grid compatibility */
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col-md-3, .col-md-4, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-12, .col-12 { padding: 0 10px; box-sizing: border-box; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .col-md-8 { flex: 0 0 66.667%; max-width: 66.667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
.g-3 { gap: 20px; }
.g-4 { gap: 24px; }
.row.g-3, .row.g-4 { margin: 0; }
.row.g-3 > [class^="col"], .row.g-4 > [class^="col"] { padding: 0; }
.col-md-3.g, .col-md-4.g { /* handled via gap */ }

/* Container */
.container { max-width: 1100px; margin: 0 auto; }

/* Bootstrap-compat select */
select.form-select { appearance: auto; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .page-body { padding: 16px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(9,32,49,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* Dropdown (Bootstrap) overrides */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
}
.dropdown-item { border-radius: 6px; font-size: 13.5px; padding: 8px 12px; }
.dropdown-item:hover { background: var(--surface); }

/* Btn-close */
.btn-close { opacity: 0.5; }

/* dismiss alert */
.alert-dismissible { padding-right: 50px; position: relative; }
.alert-dismissible .btn-close { position: absolute; right: 14px; top: 12px; }
