:root {
    --ink: #162235;
    --muted: #66758a;
    --line: #e2e8f0;
    --soft: #f6f8fb;
    --card: #ffffff;
    --brand: #2458e8;
    --brand-dark: #173fb0;
    --teal: #0e9f91;
    --success: #16794f;
    --warning: #a16108;
    --danger: #b42335;
    --shadow: 0 16px 45px rgba(23, 47, 86, .08);
    --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f5f7fb; color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
.topbar { min-height: 72px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 4vw; gap: 24px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #6c7ff5); color: #fff; font-size: 12px; letter-spacing: .02em; box-shadow: 0 8px 18px rgba(36,88,232,.24); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 650; padding: 9px 12px; border-radius: 10px; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: #edf2ff; }
.user-chip { border-left: 1px solid var(--line); padding-left: 18px; color: var(--ink); font-weight: 700; display: flex; flex-direction: column; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 4px; }
.container { max-width: 1420px; margin: 0 auto; padding: 34px 4vw 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.page-heading h1 { margin: 2px 0 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.045em; line-height: 1.1; }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .15em; margin: 0 0 7px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.footer { text-align: center; color: #8290a3; font-size: 12px; padding: 25px 20px 40px; }
h2, h3, p { margin-top: 0; }
h2 { letter-spacing: -.03em; line-height: 1.2; }
h3 { letter-spacing: -.02em; }
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; background: linear-gradient(135deg, #eef3ff 0%, #f8fbff 62%, #effaf8 100%); border: 1px solid #dce6ff; padding: 28px 30px; border-radius: var(--radius); margin-bottom: 22px; box-shadow: var(--shadow); }
.hero-card h2 { margin-bottom: 8px; font-size: 26px; }
.hero-card p { max-width: 720px; margin-bottom: 0; }
.hero-actions, .action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-hero { border-color: #d6e6ff; }
.button { appearance: none; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 15px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 750; transition: .18s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--brand); color: white; box-shadow: 0 6px 15px rgba(36,88,232,.2); }
.button.primary:hover { background: var(--brand-dark); color: white; }
.button.secondary { background: #eaf0ff; color: #2450c8; border-color: #dce6ff; }
.button.secondary:hover { background: #dce7ff; color: #173fb0; }
.button.ghost { background: white; color: var(--muted); border-color: var(--line); }
.button.ghost:hover { color: var(--brand); border-color: #b9c8ee; }
.button.danger { background: #fff1f2; color: var(--danger); border-color: #ffd6da; }
.button.danger:hover { background: #ffe4e7; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 11px; border-radius: 8px; }
.button.full { width: 100%; }
.button.disabled { opacity: .5; pointer-events: none; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 22px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 7px 24px rgba(23,47,86,.04); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { display: block; font-size: 29px; letter-spacing: -.04em; margin: 5px 0; }
.stat-card small { font-weight: 500; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 7px 24px rgba(23,47,86,.035); margin-bottom: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 21px; }
.panel-heading p { margin-bottom: 0; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.content-grid.two-col { align-items: start; }
.notice-card { display: flex; align-items: center; gap: 15px; background: #fffaf0; border: 1px solid #f4ddb0; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.notice-card h3 { margin: 0 0 3px; font-size: 16px; }
.notice-card p { margin: 0; color: #7c5b22; font-size: 13px; }
.notice-card .button { margin-left: auto; }
.notice-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: #875414; background: #fbe8bb; font-weight: 900; }
.alert { border-radius: 11px; border: 1px solid; padding: 11px 14px; margin: 0 0 17px; font-size: 13px; }
.alert-success { color: #12623e; background: #edfbf4; border-color: #b9e9ce; }
.alert-warning { color: #835111; background: #fff8e9; border-color: #f4d99d; }
.alert-danger { color: #9f1d31; background: #fff1f3; border-color: #ffcbd2; }
.status { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status.active { color: #117246; background: #e8f8ef; }
.status.suspended { color: #a34d1c; background: #fff0e8; }
.badge { color: #52627a; background: #f0f3f8; border: 1px solid #e3e8ef; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #aab4c2; margin-right: 4px; }
.dot.ok { background: #1da56b; }
form label { display: block; color: #455368; font-size: 12px; font-weight: 750; margin-bottom: 13px; }
form label small { display: block; color: var(--muted); font-weight: 500; margin: 4px 0 7px; }
input, textarea, select { width: 100%; margin-top: 6px; border: 1px solid #d7deea; background: #fff; color: var(--ink); border-radius: 9px; padding: 10px 11px; font: inherit; font-size: 13px; outline: none; transition: border .16s, box-shadow .16s; }
input:focus, textarea:focus, select:focus { border-color: #7e9cf4; box-shadow: 0 0 0 3px rgba(36,88,232,.11); }
textarea { resize: vertical; min-height: 70px; }
input[type="color"] { height: 38px; padding: 3px; cursor: pointer; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
input[type="file"] { padding: 8px; background: #fbfcfe; }
.form-grid { display: grid; gap: 0 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.credentials { background: #f5f8ff; border: 1px dashed #b8c8ed; padding: 14px; border-radius: 10px; margin: 16px 0; line-height: 1.9; }
.credentials code { background: #e9efff; padding: 2px 5px; border-radius: 4px; }
.workflow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 22px; }
.workflow > div { display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--soft); border-radius: 11px; color: #4a5a70; font-size: 13px; }
.workflow b { display: grid; place-items: center; background: #e2eaff; color: var(--brand); width: 28px; height: 28px; border-radius: 50%; }
.mini-list { display: grid; gap: 9px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.mini-list b { color: var(--brand); display: inline-block; min-width: 42px; }
.empty-state { text-align: center; border: 1px dashed #ccd6e5; border-radius: 14px; padding: 45px 20px; background: rgba(255,255,255,.7); margin-bottom: 20px; }
.empty-state.compact { padding: 24px 15px; border: 0; background: transparent; margin: 0; }
.empty-state h2, .empty-state h3 { margin: 8px 0; }
.empty-state p { color: var(--muted); }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 8px; color: var(--brand); background: #edf2ff; border-radius: 13px; font-size: 22px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed #aebee0; background: #f9fbff; border-radius: 13px; padding: 26px 16px; margin-bottom: 15px; cursor: pointer; }
.dropzone:hover { border-color: var(--brand); background: #f1f5ff; }
.dropzone input[type=file] { max-width: 100%; margin-top: 12px; }
.upload-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: #e8eeff; font-size: 20px; margin-bottom: 8px; }
.dropzone strong { color: #2d3d55; }
.dropzone small { color: var(--muted); font-weight: 500; margin-top: 4px; }
.file-meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; margin-top: 15px; border-top: 1px solid var(--line); font-size: 12px; color: #43536b; }
.file-meta small { color: var(--muted); }
.preview-panel { min-height: 200px; }
.template-preview-image { background: #f2f5f9; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 22px; text-align: center; }
.template-preview-image img { max-width: 100%; max-height: 380px; object-fit: contain; display: block; margin: auto; }
.photo-settings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.photo-settings label { margin: 0; }
.field-heading { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 6px; }
.settings-table table { min-width: 920px; }
.settings-table th, .settings-table td { padding: 8px 7px; }
.compact-input { min-width: 125px; margin-top: 5px; padding: 7px 8px; }
.number-input { width: 72px; padding: 7px 6px; }
.small-select { width: auto; min-width: 76px; padding: 7px 5px; }
.switch { display: flex; justify-content: center; align-items: center; margin: 8px 0 0; }
.switch input { display: none; }
.switch span { width: 35px; height: 20px; border-radius: 20px; background: #cbd4df; position: relative; cursor: pointer; }
.switch span:after { content: ""; width: 15px; height: 15px; border-radius: 50%; background: #fff; position: absolute; top: 2.5px; left: 3px; transition: .18s; box-shadow: 0 1px 3px #8490a0; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span:after { left: 17px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #708098; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; padding: 10px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 11px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:hover { background: #fbfcff; }
td strong { display: block; color: #24344c; }
td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.table-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.inline-form { display: inline-flex; margin: 0; }
.inline-form button { font-family: inherit; }
.delete-form { display: none; }
.student-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.avatar { width: 36px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid #dbe1ea; background: #eef1f4; display: inline-grid; place-items: center; color: #8491a3; font-size: 9px; font-weight: 800; }
.avatar.large { width: 82px; height: 100px; border-radius: 9px; }
.avatar.placeholder { display: inline-grid; place-items: center; }
.photo-upload { display: flex; align-items: center; gap: 18px; padding: 18px 0; margin: 12px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.photo-upload label { flex: 1; margin: 0; }
.subheading { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
.subheading h3 { font-size: 15px; margin: 0; }
.subheading span { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.toolbar h2 { margin: 0; }
.toolbar h2 small { font-weight: 500; font-size: 13px; }
.search-form { display: flex; gap: 7px; align-items: center; min-width: min(100%, 460px); }
.search-form input { min-width: 210px; margin: 0; }
.import-panel { padding-bottom: 18px; }
.import-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.import-form input[type=file] { flex: 1; min-width: 220px; margin: 0; }
.import-form .tiny { flex-basis: 100%; }
.bulk-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding-top: 18px; }
.bulk-actions label { min-width: 220px; margin: 0; }
.bulk-actions select { margin-top: 0; }
.check-col { width: 70px; }
.check-all { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 10px; color: #708098; }
.check-all input { width: 15px; height: 15px; }
.auth-body { min-height: 100vh; background: radial-gradient(circle at 5% 0%, #e9efff 0, transparent 38%), radial-gradient(circle at 100% 100%, #e0faf5 0, transparent 34%), #f7f9fc; display: flex; flex-direction: column; }
.auth-shell { width: min(1040px, 92vw); margin: auto; display: grid; grid-template-columns: 1fr 420px; gap: 65px; align-items: center; padding: 40px 0; }
.auth-intro { padding: 18px 0; }
.auth-brand { margin-bottom: 45px; }
.auth-intro h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.02; letter-spacing: -.065em; margin: 12px 0 20px; max-width: 600px; }
.auth-intro > p:not(.eyebrow) { max-width: 570px; color: #5d6e86; font-size: 17px; }
.feature-list { display: grid; gap: 9px; color: #3d526e; font-weight: 650; margin-top: 27px; }
.auth-card { background: rgba(255,255,255,.96); border: 1px solid #e2e7f0; border-radius: 20px; padding: 30px; box-shadow: 0 25px 70px rgba(23,47,86,.13); }
.auth-card.wide { width: min(480px, 92vw); margin: auto; }
.auth-card h2 { margin: 8px 0 6px; font-size: 28px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: #f2f5fa; border-radius: 11px; margin-bottom: 26px; }
.auth-tabs a { flex: 1; text-align: center; padding: 9px; border-radius: 8px; color: var(--muted); font-weight: 750; font-size: 13px; }
.auth-tabs a.active { background: #fff; color: var(--brand); box-shadow: 0 2px 7px rgba(25,49,89,.08); }
.auth-card .tiny { margin: 18px 0 0; text-align: center; }
.auth-card label { margin-bottom: 15px; }
.auth-card .form-grid label { margin-bottom: 15px; }
.auth-brand { font-size: 17px; }
@media (max-width: 1000px) {
    .auth-shell { grid-template-columns: 1fr 400px; gap: 35px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .topbar { padding: 12px 4vw; flex-wrap: wrap; gap: 9px; }
    .nav-links { order: 3; width: 100%; overflow-x: auto; margin-left: -5px; }
    .nav-links a { padding: 7px 9px; font-size: 12px; }
    .user-chip { margin-left: auto; border-left: 0; padding-left: 0; font-size: 12px; }
    .container { padding-top: 25px; }
    .hero-card, .toolbar, .panel-heading { align-items: flex-start; flex-direction: column; }
    .hero-card .button, .notice-card .button { margin-left: 0; }
    .content-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .photo-settings { grid-template-columns: repeat(2, 1fr); }
    .workflow { grid-template-columns: 1fr; }
    .search-form { width: 100%; min-width: 0; }
    .search-form input { min-width: 0; flex: 1; }
    .notice-card { align-items: flex-start; flex-wrap: wrap; }
    .notice-card .notice-icon { flex-basis: 34px; }
    .notice-card > div:nth-child(2) { flex: 1; min-width: 200px; }
    .auth-shell { display: flex; flex-direction: column; width: min(520px, 92vw); gap: 10px; padding: 25px 0; }
    .auth-intro { text-align: center; }
    .auth-brand { justify-content: center; margin-bottom: 28px; }
    .auth-intro h1 { font-size: 38px; }
    .auth-intro > p:not(.eyebrow), .feature-list { display: none; }
    .auth-card { width: 100%; }
}
@media (max-width: 450px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { padding: 14px; }
    .stat-card strong { font-size: 23px; }
    .panel { padding: 18px; }
    .button { padding-left: 11px; padding-right: 11px; }
}
