:root {
    --navy: #0b2341;
    --blue: #1559a6;
    --orange: #f07b24;
    --green: #12805c;
    --red: #c63c3c;
    --bg: #f3f6fa;
    --line: #dce4ee;
    --text: #1d2939;
    --muted: #667085;
}
* { box-sizing: border-box; }
html { font-family: Inter, Arial, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
.portal-topbar { position: sticky; top: 0; z-index: 30; min-height: 68px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; box-shadow: 0 4px 20px rgba(8, 28, 52, .2); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 45px; height: 45px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.brand strong, .brand small { display: block; }
.brand small { color: #c9d6e6; margin-top: 2px; }
.user-actions { display: flex; align-items: center; gap: 12px; }
.user-actions form { margin: 0; }
.portal-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 24px 14px; }
.sidebar a { display: flex; gap: 10px; align-items: center; padding: 11px 13px; margin-bottom: 7px; border-radius: 10px; text-decoration: none; color: #344054; font-weight: 600; }
.sidebar a:hover, .sidebar a.active { background: #eaf2fc; color: var(--blue); }
.portal-main { min-width: 0; padding: 28px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.65rem; color: var(--navy); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 16px rgba(16, 45, 80, .055); padding: 20px; margin-bottom: 20px; }
.card h2, .card h3 { color: var(--navy); margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 13px; padding: 17px; }
.stat.green { border-left-color: var(--green); }.stat.orange { border-left-color: var(--orange); }.stat.red { border-left-color: var(--red); }
.stat span { color: var(--muted); display: block; font-size: .88rem; }
.stat strong { display: block; margin-top: 8px; color: var(--navy); font-size: 1.7rem; }
.btn { appearance: none; border: 0; border-radius: 9px; padding: 10px 15px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; justify-content: center; }
.btn:hover { filter: brightness(.94); }.btn-secondary { background: #e9eef5; color: #263a52; }.btn-orange { background: var(--orange); }.btn-danger { background: var(--red); }.btn-disabled { background: #d8dee8; color: #697586; cursor: not-allowed; }.btn-sm { padding: 7px 10px; font-size: .86rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }.inline-action-form { margin: 0; display: inline-flex; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)); gap: 12px; }
.form-group label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: #344054; }
.form-control, input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--text); padding: 8px 10px; font: inherit; }
textarea { resize: vertical; }.form-control:focus, input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(21, 89, 166, .12); }
.full-span { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.data-table th { background: #eef3f9; color: #20364f; text-align: left; font-size: .85rem; white-space: nowrap; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr:hover { background: #f8fbff; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; background: #e9eef5; color: #344054; }
.badge-complete { background: #dff7ee; color: #08704d; }.badge-incomplete { background: #fff1d8; color: #995600; }.badge-correction_requested { background: #ffe4e4; color: #a62424; }.badge-viewed { background: #e1efff; color: #14559c; }
.profile-grid, .detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.profile-grid div, .detail-grid div { padding: 12px; background: #fff; }
.profile-grid small, .detail-grid small { display: block; color: var(--muted); margin-bottom: 4px; }.profile-grid strong, .detail-grid strong { color: var(--navy); }
.signature { max-width: 115px; max-height: 45px; object-fit: contain; }
.alert { border-radius: 9px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid; }
.alert-success { background: #e6f7f0; border-color: #a9dfca; color: #086345; }.alert-error { background: #ffeded; border-color: #f0b4b4; color: #8e2727; }.alert-warning { background: #fff7e5; border-color: #ecd49c; color: #815311; }.alert-info { background: #eaf4ff; border-color: #b9d6f4; color: #164f88; }
.errorlist { color: #a62424; margin: 5px 0 0; padding-left: 20px; font-size: .88rem; }.helptext { color: var(--muted); font-size: .82rem; }
.review-item, .history-item { border-left: 3px solid var(--blue); padding: 10px 13px; margin: 10px 0; background: #f7faff; border-radius: 0 8px 8px 0; }.review-item p { margin-bottom: 0; }
.teacher-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.teacher-list { max-height: 210px; overflow: auto; }.teacher-list span { display: inline-block; margin: 3px; padding: 5px 8px; background: #eef3f8; border-radius: 7px; font-size: .84rem; }
.muted { color: var(--muted); }.empty { text-align: center; color: var(--muted); padding: 35px 15px !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #071a31, #123f70); }
.login-card { width: min(430px, 100%); background: #fff; padding: 32px; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }.login-logo { text-align: center; margin-bottom: 25px; }.login-logo img { width: 76px; height: 76px; object-fit: contain; }.login-logo h1 { color: var(--navy); margin: 8px 0 3px; }.login-logo p { color: var(--muted); margin: 0; }
.registration-card { width: min(760px, 100%); }.registration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); }.filter-grid { grid-template-columns: repeat(2, 1fr); }.profile-grid, .detail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .portal-topbar { padding: 9px 13px; }.brand small, .user-name { display: none; }.portal-layout { display: block; }.sidebar { position: sticky; top: 65px; z-index: 20; padding: 7px 10px; display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }.sidebar a { flex: 0 0 auto; margin: 0; padding: 8px 10px; font-size: .86rem; }.portal-main { padding: 16px 12px 28px; }.page-head { display: block; }.page-head .actions { margin-top: 12px; }.form-grid, .filter-grid, .profile-grid, .detail-grid, .teacher-lists, .registration-grid { grid-template-columns: 1fr; }.stats { gap: 9px; }.stat { padding: 12px; }.stat strong { font-size: 1.35rem; }.card { padding: 14px; }.full-span { grid-column: auto; } }
