:root {
    --bg: #f3f6f9;
    --sidebar: #1f2a37;
    --muted: #7b8794;
    --line: #dfe5ec;
    --purple: #6548ff;
    --purple-dark: #573cf0;
    --text: #263241;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 184px; background: var(--sidebar); color: #c7d0db; padding: 24px 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 800; padding: 0 20px 26px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--purple); }
.nav { display: grid; gap: 3px; }
.nav a, .nav-label { padding: 11px 20px; font-size: 13px; }
.nav a { display: block; border-left: 3px solid transparent; }
.nav a:hover, .nav a.active { background: var(--purple); border-left-color: #b9aaff; color: #fff; }
.nav-label { margin-top: 10px; color: #697684; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.main { margin-left: 184px; min-height: 100vh; }
.topbar { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 26px; }
.menu-button { border: 0; background: transparent; font-size: 20px; color: #7b8794; }
.search { width: 170px; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 14px; }
.topbar-spacer { flex: 1; }
.bell { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #f0f4f8; color: var(--purple); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #12355b; color: #fff; font-weight: 800; }
.hero { min-height: 174px; padding: 42px 26px 58px; background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: #fff; display: flex; justify-content: space-between; align-items: flex-start; }
.student-hero { min-height: 236px; padding-bottom: 98px; }
.hero h1, .page-head h1 { margin: 0; font-size: 22px; letter-spacing: 0; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; opacity: .75; }
.primary-button, .secondary-button { border: 0; border-radius: 6px; padding: 12px 16px; font-weight: 800; cursor: pointer; }
.primary-button { background: #fff; color: var(--purple); box-shadow: 0 8px 22px rgba(31,42,55,.12); }
.secondary-button { background: #eef2ff; color: var(--purple); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: -70px 26px 24px; }
.student-stat-grid { margin-top: -78px; }
.stat-card, .panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(31,42,55,.05); }
.stat-card { padding: 22px; }
.stat-card span { display: block; font-weight: 800; margin-bottom: 12px; }
.stat-card strong { display: block; font-size: 30px; line-height: 1; margin-bottom: 8px; }
.stat-card small, .list-row span, .branch-card p { color: var(--muted); }
.panel { margin: 0 26px 24px; overflow: hidden; }
.panel-title, .page-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; }
.page-head { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: #fff; margin-bottom: 24px; }
.panel-title { border-bottom: 1px solid var(--line); padding: 18px 20px; }
.panel-title h2, .branch-card h2 { margin: 0; font-size: 16px; }
.panel-title a { color: var(--purple); font-size: 13px; font-weight: 800; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #f0f3f7; color: #778395; text-align: left; font-size: 12px; }
th, td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; color: #fff; padding: 4px 9px; font-size: 11px; font-weight: 800; }
.badge.green { background: #23a455; }
.badge.purple { background: var(--purple); }
.badge.blue { background: #2ba8df; }
.role-chip { font-size: 12px; font-weight: 800; color: var(--purple); background: #eef2ff; border-radius: 999px; padding: 7px 10px; }
.table-link { color: var(--purple); font-weight: 900; }
.logout-form { padding: 8px 20px; }
.logout-form button { width: 100%; border: 0; border-radius: 6px; padding: 10px 12px; background: #334155; color: #fff; font-weight: 800; cursor: pointer; text-align: left; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-tabs label { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 26px; }
.dashboard-grid .panel { margin: 0 0 24px; }
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.list-row strong, .list-row span { display: block; }
.score { color: var(--purple); font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px; }
.form-grid.single { grid-template-columns: repeat(2, 1fr); }
.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
label { display: grid; gap: 8px; font-size: 12px; color: #6b7685; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font: inherit; color: var(--text); background: #fff; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0 26px 24px; }
.branch-card { margin: 0; padding: 24px; }
.detail-panel { padding: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.detail-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.detail-grid strong { display: block; font-size: 15px; }
.step-body { padding: 20px; }
.step-body p, .note { color: #526071; line-height: 1.5; }
.note { background: #fff8e6; border: 1px solid #ffe1a6; border-radius: 8px; padding: 12px; }
.progress-panel { padding: 20px; }
.progress-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.progress-summary div { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fbfcfe; }
.progress-summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 7px; }
.progress-summary strong { display: block; font-size: 22px; }
.progress-track { height: 12px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.progress-track div { height: 100%; background: linear-gradient(90deg, var(--purple), #23a455); border-radius: inherit; }
.log-part-list { overflow: visible; }
.log-part { border-bottom: 1px solid var(--line); }
.log-part:last-child { border-bottom: 0; }
.log-part summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; cursor: pointer; list-style: none; }
.log-part summary::-webkit-details-marker { display: none; }
.log-part summary:hover { background: #f8faff; }
.log-part summary::after { content: "+"; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #eef2ff; color: var(--purple); font-weight: 900; flex: 0 0 auto; }
.log-part[open] summary::after { content: "-"; }
.part-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.part-main strong, .part-main span { display: block; }
.part-main strong { font-size: 14px; }
.part-main span { color: var(--muted); font-size: 12px; font-weight: 800; margin-top: 4px; }
.part-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #eef2ff; color: var(--purple); font-weight: 900; flex: 0 0 auto; }
.part-meta { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.part-meta strong { font-size: 12px; white-space: nowrap; }
.activity-list { display: grid; gap: 14px; margin-top: 16px; }
.activity-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fbfcfe; margin-top: 14px; }
.activity-card-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.activity-card-title span { color: var(--muted); font-size: 12px; font-weight: 800; }
.new-activity { background: #fff; border-color: #cfd8ff; }
.compact-review { grid-template-columns: 180px 180px 1fr; padding: 18px 0 0; }
.locked-banner { display: grid; gap: 5px; padding: 18px 20px; background: #eef7ff; border-left: 4px solid #2ba8df; color: var(--text); }
.locked-banner span, .muted-text { color: var(--muted); font-size: 13px; font-weight: 800; }
.flash, .alert { margin: 18px 26px 0; border-radius: 8px; padding: 12px 16px; font-weight: 700; }
.flash { background: #e9f9ef; color: #16743a; border: 1px solid #bdeacb; }
.alert { background: #fff2f2; color: #b42318; border: 1px solid #ffd0d0; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1f2a37, #6548ff); padding: 22px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 10px; padding: 34px; box-shadow: 0 28px 70px rgba(0,0,0,.25); }
.login-logo { width: 64px; height: 64px; display: grid; place-items: center; background: var(--purple); color: #fff; border-radius: 14px; font-weight: 900; margin-bottom: 20px; }
.login-card h1 { margin: 0; font-size: 25px; }
.login-card p { margin: 8px 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 16px; }
.login-card button { margin-top: 6px; background: var(--purple); color: #fff; border: 0; border-radius: 6px; padding: 13px 16px; font-weight: 900; cursor: pointer; }
.compact { margin: 0 0 16px; }
.actions-cell { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-button { border: 0; background: transparent; color: var(--purple); padding: 0; font: inherit; font-weight: 900; cursor: pointer; }
.hero-subtitle { margin: 8px 0 0; color: rgba(255,255,255,.78); }
.profile-list { display: grid; gap: 12px; padding: 20px; }
.profile-list div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.profile-list span { color: var(--muted); font-size: 12px; font-weight: 800; }
.profile-list strong { font-size: 13px; }
.empty-state { display: grid; gap: 5px; padding: 8px 0; }
.empty-state strong { color: var(--text); }
.empty-state span { color: var(--muted); }
nav[role="navigation"] { padding: 14px 20px; }
@media (max-width: 900px) {
    .sidebar { width: 76px; }
    .brand span:last-child, .nav-label { display: none; }
    .nav a { font-size: 0; min-height: 42px; }
    .nav a::first-letter { font-size: 13px; }
    .main { margin-left: 76px; }
    .stat-grid, .dashboard-grid, .card-grid, .form-grid, .form-grid.single, .filter-bar { grid-template-columns: 1fr; }
    .hero { display: block; }
    .stat-grid { margin-top: -48px; }
}
