:root {
    --navy: #0b1f4d;
    --navy-2: #142d63;
    --blue: #2563eb;
    --sky: #eaf2ff;
    --green: #16a368;
    --orange: #f59e0b;
    --red: #dc3545;
    --ink: #16213a;
    --muted: #64748b;
    --line: #e4e9f1;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --sidebar-width: 266px;
    --banner-height: 40px;
    --topbar-height: 70px;
    --shadow: 0 10px 30px rgba(11, 31, 77, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.skip-link {
    position: fixed; z-index: 1300; top: 7px; left: 10px; padding: 7px 11px;
    border-radius: 7px; background: #fff; color: var(--navy); box-shadow: var(--shadow);
    font-size: 12px; font-weight: 800; transform: translateY(-160%); transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }
.content-wrap:focus { outline: 0; }

.demo-banner {
    position: fixed; inset: 0 0 auto; z-index: 1100; height: var(--banner-height);
    display: flex; align-items: center; justify-content: center; gap: 22px;
    padding: 0 18px; color: #fff; background: linear-gradient(90deg, #8a4a00, #b96900 55%, #8a4a00);
    font-size: 13px; letter-spacing: .01em;
}
.demo-banner i { margin-right: 6px; }
.demo-banner-meta { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.3); }
.banner-button { border: 1px solid rgba(255,255,255,.45); border-radius: 6px; padding: 4px 10px; color: #fff; background: rgba(255,255,255,.1); font-size: 12px; }
.banner-button:hover { background: rgba(255,255,255,.2); }

.app-shell { min-height: 100vh; padding-top: var(--banner-height); }
.sidebar {
    position: fixed; z-index: 900; top: var(--banner-height); bottom: 0; left: 0; width: var(--sidebar-width);
    display: flex; flex-direction: column; background: var(--navy); color: #dce6fb; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: var(--topbar-height); padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; color: var(--navy); background: #fff; font-weight: 800; font-size: 14px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-copy strong { color: #fff; font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fb0d1; font-size: 11px; }
.role-switcher { margin: 14px 14px 8px; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); }
.role-switcher label { display: block; margin: 0 0 6px; color: #94a9d2; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.select-wrap { display: flex; align-items: center; gap: 8px; }
.select-wrap select { width: 100%; border: 0; outline: 0; color: #fff; background: transparent; font-size: 13px; font-weight: 700; }
.select-wrap option { color: var(--ink); }
.sidebar-nav { flex: 1; padding: 0 10px 20px; }
.nav-heading { margin: 15px 10px 6px; color: #8197c0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-link { position: relative; width: 100%; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; border: 0; border-radius: 7px; padding: 9px 10px; color: #c6d3eb; background: transparent; text-align: left; font-size: 12.5px; }
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 #7db1ff; }
.nav-badge { min-width: 20px; padding: 2px 6px; border-radius: 99px; background: #f59e0b; color: #442500; text-align: center; font-size: 10px; font-weight: 800; }
.sidebar-help { margin: 0 14px 16px; padding: 12px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #173b7a, #24539d); font-size: 11px; }
.sidebar-help > i { float: left; margin: 2px 9px 18px 0; color: #a8c9ff; font-size: 17px; }
.sidebar-help div { display: flex; flex-direction: column; }
.sidebar-help span { margin-top: 2px; color: #bcd1f3; }
.sidebar-help button { width: 100%; margin-top: 9px; border: 0; border-radius: 6px; padding: 7px; color: var(--navy); background: #fff; font-size: 11px; font-weight: 800; }

.main-shell { min-height: calc(100vh - var(--banner-height)); margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 800; top: var(--banner-height); height: var(--topbar-height); display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.icon-button { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; color: #53627a; background: #fff; }
.menu-toggle { display: none; }
.global-search { position: relative; width: min(390px, 36vw); display: flex; align-items: center; gap: 10px; }
.global-search > i { position: absolute; left: 13px; color: #8190a7; }
.global-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 50px 0 38px; outline: 0; background: #f8fafc; color: var(--ink); font-size: 13px; }
.global-search input:focus { border-color: #93b4f4; box-shadow: 0 0 0 3px rgba(37,99,235,.1); background: #fff; }
.global-search kbd { position: absolute; right: 9px; padding: 3px 6px; border: 1px solid #dbe1ea; border-radius: 5px; color: #8290a3; background: #fff; font-size: 10px; }
.search-results { position: absolute; top: 47px; left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.search-result { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); padding: 11px 13px; background: #fff; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f5f8fd; }
.search-result i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--blue); background: var(--sky); }
.search-result span { display: flex; flex-direction: column; font-size: 12px; }
.search-result small { color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tour-button, .top-cta { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; padding: 0 13px; font-size: 12px; font-weight: 750; }
.tour-button { border: 1px solid #b9c8e0; color: var(--navy); background: #fff; }
.top-cta.secondary { border: 1px solid var(--navy); color: var(--navy); }
.top-cta.primary { color: #fff; background: var(--navy); }
.notification-button span { position: absolute; top: -4px; right: -4px; width: 17px; height: 17px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--red); font-size: 8px; font-weight: 800; }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; padding: 3px 0 3px 7px; background: transparent; color: var(--ink); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #2f64ba, #0b1f4d); font-size: 11px; font-weight: 800; }
.profile-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.profile-copy strong { font-size: 11.5px; }
.profile-copy small { color: var(--muted); font-size: 9.5px; }
.profile-button > i { color: #94a3b8; font-size: 9px; }

.content-wrap { width: min(1480px, 100%); margin: 0 auto; padding: 25px 28px 100px; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #8290a4; font-size: 11px; }
.page-title h1 { margin: 0; color: var(--navy); font-size: clamp(23px, 2.3vw, 30px); letter-spacing: -.035em; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.primary-button, .secondary-button, .text-button { border-radius: 8px; padding: 9px 13px; font-size: 12px; font-weight: 750; }
.primary-button { border: 1px solid var(--navy); color: #fff; background: var(--navy); }
.primary-button:hover { background: var(--navy-2); }
.secondary-button { border: 1px solid #cfd8e6; color: var(--navy); background: #fff; }
.text-button { border: 0; color: var(--muted); background: transparent; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 9px; font-size: 10.5px; font-weight: 750; }
.status-pill.success { color: #08754a; background: #dff8ed; }
.status-pill.warning { color: #8b5700; background: #fff0c8; }
.status-pill.info { color: #1e55a5; background: #e5efff; }
.status-pill.neutral { color: #536175; background: #edf1f6; }
.status-pill.danger { color: #a52b36; background: #fde8ea; }

.welcome-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; min-height: 178px; margin-bottom: 18px; border-radius: 15px; padding: 25px 28px; color: #fff; background: linear-gradient(118deg, #0b1f4d, #183d80 65%, #2563a9); box-shadow: var(--shadow); }
.welcome-panel::after { content: ""; position: absolute; right: -70px; top: -100px; width: 310px; height: 310px; border: 50px solid rgba(255,255,255,.055); border-radius: 50%; }
.welcome-panel > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 7px; color: #b9d3ff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.welcome-panel h2 { max-width: 650px; margin: 0; font-size: clamp(22px, 2.5vw, 31px); letter-spacing: -.035em; }
.welcome-panel p { max-width: 600px; margin: 8px 0 18px; color: #d2dff5; font-size: 12.5px; line-height: 1.55; }
.welcome-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.welcome-actions button { border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 9px 13px; color: #fff; background: rgba(255,255,255,.1); font-weight: 750; font-size: 11px; }
.welcome-actions button:first-child { color: var(--navy); background: #fff; }
.hero-metric { justify-self: end; min-width: 240px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; padding: 16px; background: rgba(255,255,255,.09); backdrop-filter: blur(8px); }
.hero-metric > span { color: #c5d5f0; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.hero-metric strong { display: block; margin: 6px 0 2px; font-size: 29px; }
.hero-metric small { color: #bbf0d7; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 18px rgba(18,39,81,.035); }
.stat-card { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; padding: 16px; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--sky); }
.stat-icon.green { color: #0d8a59; background: #e1f7ed; }
.stat-icon.orange { color: #b36c00; background: #fff2d9; }
.stat-icon.purple { color: #7450b8; background: #f0eafe; }
.stat-copy { display: flex; flex-direction: column; }
.stat-copy span { color: var(--muted); font-size: 10.5px; }
.stat-copy strong { margin-top: 2px; color: var(--navy); font-size: 21px; letter-spacing: -.025em; }
.stat-trend { grid-column: 1 / -1; margin-top: 1px; color: var(--green); font-size: 9.5px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 16px; margin-bottom: 17px; }
.panel { padding: 18px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-header h2 { margin: 0; color: var(--navy); font-size: 15px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.panel-link { border: 0; padding: 2px; color: var(--blue); background: transparent; font-size: 10.5px; font-weight: 700; }
.bar-chart { height: 220px; display: flex; align-items: flex-end; gap: clamp(7px, 2vw, 20px); padding: 10px 8px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 54px, #eef1f5 55px); }
.bar-group { height: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; position: relative; }
.bar { width: 11px; min-height: 5px; border-radius: 4px 4px 0 0; background: #2f68c3; transition: height .5s ease; }
.bar.alt { background: #91b5ec; }
.bar-group label { position: absolute; bottom: -22px; color: var(--muted); font-size: 9px; }
.chart-legend { display: flex; gap: 16px; margin-top: 29px; color: var(--muted); font-size: 9px; }
.chart-legend i { margin-right: 4px; font-size: 7px; }
.activity-list { display: grid; gap: 0; }
.activity { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--sky); font-size: 11px; }
.activity div { display: flex; flex-direction: column; }
.activity strong { font-size: 10.5px; }
.activity span { margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 7px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 700; }
.quick-action i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--sky); font-size: 13px; }
.quick-action:hover { border-color: #9cb7e2; transform: translateY(-1px); box-shadow: var(--shadow); }

.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.filter-search { position: relative; flex: 1; }
.filter-search i { position: absolute; left: 11px; top: 11px; color: #8996a8; font-size: 11px; }
.filter-bar input, .filter-bar select { height: 35px; border: 1px solid #d8e0eb; border-radius: 7px; padding: 0 10px; color: #48566b; background: #fff; font-size: 10.5px; }
.filter-search input { width: 100%; padding-left: 31px; }
.table-panel { overflow: hidden; padding: 0; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 11px 14px; color: #708098; background: #f8fafc; text-align: left; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 10.5px; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--navy); background: #e8eef9; font-size: 9px; font-weight: 800; }
.person-cell div { display: flex; flex-direction: column; }
.person-cell small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.row-action { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); background: #fff; }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.pagination { display: flex; gap: 4px; }
.pagination span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; }
.pagination .current { color: #fff; background: var(--navy); }

.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card { position: relative; overflow: hidden; min-height: 170px; border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fff; box-shadow: 0 4px 18px rgba(18,39,81,.035); }
.feature-card > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--sky); }
.feature-card h2 { margin: 15px 0 5px; color: var(--navy); font-size: 14px; }
.feature-card p { margin: 0 0 13px; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.feature-card .card-link { border: 0; padding: 0; color: var(--blue); background: none; font-size: 10.5px; font-weight: 750; }
.feature-card .metric { position: absolute; top: 18px; right: 18px; color: var(--navy); font-size: 18px; font-weight: 800; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; border: 1px solid #bcd4fa; border-radius: 9px; padding: 11px 13px; color: #20497f; background: #edf5ff; font-size: 10.5px; line-height: 1.5; }
.notice.warning { border-color: #efd18b; color: #7a5100; background: #fff8e6; }
.notice i { margin-top: 2px; }

.attendance-sheet { overflow-x: auto; }
.attendance-grid { min-width: 660px; display: grid; grid-template-columns: 2fr repeat(4, 72px); }
.attendance-grid > div { min-height: 43px; display: flex; align-items: center; padding: 8px 11px; border-bottom: 1px solid var(--line); font-size: 10px; }
.attendance-grid .head { color: var(--muted); background: #f8fafc; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.attendance-option { justify-content: center; }
.attendance-option input { accent-color: var(--navy); }
.progress-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; margin: 13px 0; font-size: 10px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf1f5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress-row strong { text-align: right; }

.timetable { display: grid; grid-template-columns: 78px repeat(5, 1fr); gap: 1px; overflow-x: auto; border: 1px solid var(--line); background: var(--line); }
.time-cell { min-width: 115px; min-height: 68px; padding: 9px; background: #fff; font-size: 9px; }
.time-cell.head { min-height: auto; color: var(--navy); background: #f3f6fa; font-weight: 800; text-align: center; }
.time-cell.time { min-width: 78px; color: var(--muted); background: #f8fafc; font-weight: 700; }
.lesson { border-left: 3px solid var(--blue); border-radius: 5px; padding: 7px; color: #174887; background: #eaf2ff; }
.lesson.green { border-color: var(--green); color: #08754a; background: #e5f8ef; }
.lesson.orange { border-color: var(--orange); color: #855100; background: #fff3db; }
.lesson strong, .lesson span { display: block; }
.lesson span { margin-top: 3px; opacity: .75; }

.portal-preview { display: grid; grid-template-columns: 260px 1fr; overflow: hidden; min-height: 510px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.portal-profile { padding: 24px; color: #fff; background: linear-gradient(155deg, var(--navy), #1c4a91); }
.portal-profile .large-avatar { width: 62px; height: 62px; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.15); font-weight: 800; }
.portal-profile h2 { margin: 13px 0 2px; font-size: 16px; }
.portal-profile p { margin: 0 0 20px; color: #c8d9f7; font-size: 10px; }
.profile-detail { display: flex; flex-direction: column; margin: 13px 0; }
.profile-detail span { color: #9fb8e0; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.profile-detail strong { margin-top: 3px; font-size: 10.5px; }
.portal-body { padding: 23px; background: #f8fafc; }
.portal-body h2 { margin: 0 0 4px; color: var(--navy); font-size: 18px; }
.portal-body > p { margin: 0 0 18px; color: var(--muted); font-size: 10.5px; }
.student-online-exams { margin-top: 16px; }
.student-online-exams .panel-header h2 i { margin-right: 6px; color: var(--blue); }
.student-exam-list { display: grid; gap: 9px; }
.student-exam-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.student-exam-card.featured-exam { border-color: #adc6ef; background: linear-gradient(90deg, #f4f8ff, #fff); }
.exam-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--sky); }
.exam-card-icon.science { color: #7650b5; background: #f0eafe; }
.exam-card-icon.completed { color: var(--green); background: #e2f7ed; }
.exam-card-copy h3 { margin: 5px 0 2px; color: var(--navy); font-size: 11.5px; }
.exam-card-copy p { margin: 0; color: var(--muted); font-size: 9.5px; }

.action-dock { position: fixed; z-index: 780; right: 22px; bottom: 20px; display: flex; gap: 8px; filter: drop-shadow(0 8px 16px rgba(11,31,77,.15)); }
.action-dock button, .action-dock a { display: flex; align-items: center; gap: 7px; border: 0; border-radius: 99px; padding: 11px 15px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 800; }
.action-dock a { color: var(--navy); background: #fff; }

.modal-backdrop { position: fixed; z-index: 1600; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(7,18,43,.66); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.demo-modal { position: relative; width: min(560px, 100%); max-height: min(720px, calc(100vh - 36px)); overflow-y: auto; border-radius: 15px; padding: 26px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border: 0; border-radius: 7px; color: var(--muted); background: #f0f3f7; }
.modal-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--sky); font-size: 18px; }
.demo-modal h2 { margin: 14px 0 5px; color: var(--navy); font-size: 20px; }
.demo-modal > div > p { margin: 0 0 18px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #506078; font-size: 9.5px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d5deea; border-radius: 7px; padding: 9px 10px; outline: 0; color: var(--ink); background: #fff; font-size: 11px; }
.field textarea { min-height: 74px; resize: vertical; }
.exam-option { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink) !important; background: #f8fafc; cursor: pointer; }
.exam-option:hover { border-color: #9bb8e6; background: var(--sky); }
.exam-option input { width: auto; margin: 0; accent-color: var(--navy); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #81a6e5; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.simulation-note { grid-column: 1 / -1; display: flex; gap: 8px; border-radius: 7px; padding: 9px; color: #7c5200; background: #fff5dc; font-size: 9.5px; line-height: 1.45; }
.success-state { text-align: center; padding: 20px 8px; }
.success-state .modal-icon { margin: 0 auto; color: var(--green); background: #e1f8ee; }

.tour-overlay { position: fixed; z-index: 2000; inset: 0; pointer-events: none; }
.tour-overlay[hidden] { display: none; }
.tour-spotlight { position: fixed; border: 3px solid #fbbf24; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(5,15,39,.72), 0 0 0 7px rgba(251,191,36,.18); transition: all .25s ease; }
.tour-card { position: fixed; z-index: 1; width: min(350px, calc(100vw - 30px)); border-radius: 13px; padding: 19px; background: #fff; box-shadow: 0 18px 60px rgba(0,0,0,.3); pointer-events: auto; }
.tour-step { color: var(--blue); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.tour-card h2 { margin: 7px 0 5px; color: var(--navy); font-size: 17px; }
.tour-card p { margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.tour-progress { display: flex; gap: 4px; margin-bottom: 14px; }
.tour-progress span { height: 3px; flex: 1; border-radius: 99px; background: #dfe5ee; }
.tour-progress span.done { background: var(--blue); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; }

.toast-region { position: fixed; z-index: 2200; top: 56px; right: 18px; display: grid; gap: 8px; }
.toast { min-width: 260px; display: flex; align-items: center; gap: 9px; border: 1px solid #c9d6e7; border-radius: 9px; padding: 11px 13px; color: var(--ink); background: #fff; box-shadow: var(--shadow); font-size: 10.5px; animation: toast-in .25s ease both; }
.toast i { color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.noscript { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 30px; background: #fff; font-weight: 700; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
    .top-cta.secondary, .profile-copy, .profile-button > i { display: none; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
    :root { --sidebar-width: 250px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open { overflow: hidden; }
    .sidebar-backdrop { position: fixed; z-index: 850; inset: var(--banner-height) 0 0; background: rgba(4,14,36,.45); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .main-shell { margin-left: 0; }
    .menu-toggle { display: grid; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .module-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    :root { --banner-height: 48px; --topbar-height: 62px; }
    .demo-banner { justify-content: space-between; gap: 8px; padding: 0 10px; font-size: 10px; }
    .demo-banner-meta { padding-left: 0; border-left: 0; }
    .banner-button { width: 28px; overflow: hidden; white-space: nowrap; padding: 5px 6px; }
    .banner-button i { margin-right: 20px; }
    .topbar { gap: 8px; padding: 0 11px; }
    .global-search { flex: 1; width: auto; }
    .global-search input { padding-right: 10px; }
    .global-search kbd, .tour-button, .top-cta, .notification-button { display: none; }
    .content-wrap { padding: 18px 13px 100px; }
    .page-title { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .welcome-panel { grid-template-columns: 1fr; padding: 21px; }
    .hero-metric { width: 100%; justify-self: stretch; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stat-grid, .module-grid { grid-template-columns: 1fr; }
    .stat-card { grid-template-columns: 38px 1fr; }
    .stat-icon { width: 38px; height: 38px; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar select, .filter-bar > button { width: 100%; }
    .portal-preview { grid-template-columns: 1fr; }
    .portal-profile { display: grid; grid-template-columns: 65px 1fr; column-gap: 12px; }
    .portal-profile h2 { align-self: end; margin-top: 0; }
    .portal-profile p { margin-bottom: 0; }
    .profile-detail { display: none; }
    .student-exam-card { grid-template-columns: 40px 1fr; }
    .student-exam-card > button { grid-column: 1 / -1; width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full, .form-actions, .simulation-note { grid-column: 1; }
    .action-dock { right: 11px; bottom: 12px; }
    .action-dock span { display: none; }
    .action-dock button, .action-dock a { width: 44px; height: 44px; justify-content: center; padding: 0; font-size: 14px; }
    .tour-card { left: 15px !important; right: 15px !important; bottom: 15px !important; top: auto !important; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
