:root {
  --navy: #061a2f;
  --navy-soft: #0c2945;
  --blue: #287fc7;
  --blue-dark: #1766a8;
  --gold: #c9a451;
  --line: #dfe6ee;
  --paper: #f3f6f9;
  --ink: #102238;
}

body {
  background: linear-gradient(135deg, #eef3f8 0%, #f8fafc 52%, #edf3f8 100%);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login { background: radial-gradient(circle at 72% 18%, #234f74 0%, #0b2c49 34%, #041423 100%); }
.login form { width: min(450px, calc(100% - 28px)); padding: 42px 38px; border: 1px solid #ffffff55; border-radius: 22px; box-shadow: 0 28px 90px #00101f80; }
.login-logo { width: 126px; height: 126px; margin-bottom: 20px; filter: drop-shadow(0 10px 18px #07192d38); }
.login h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; line-height: 1.15; color: #0a2038; margin: 8px 0 26px; }
.login p { color: #6f8298; }

input, select { border-color: #cbd7e4; background: #f9fbfd; border-radius: 10px; transition: border-color .18s, box-shadow .18s, background .18s; }
input:focus, select:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px #287fc71a; }
form > button, .primary { border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 7px 18px #1766a824; transition: transform .16s, box-shadow .16s; }
form > button:hover, .primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px #1766a834; }

.shell { grid-template-columns: 282px 1fr; }
aside { background: linear-gradient(180deg, #061a2f 0%, #071f37 55%, #041423 100%); padding: 30px 22px; box-shadow: 14px 0 40px #08233c12; }
.brand { gap: 14px; padding: 0 8px 22px; border-bottom: 1px solid #ffffff16; }
.brand img { width: 62px; height: 62px; filter: drop-shadow(0 8px 12px #0007); }
.brand b { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; letter-spacing: .18em; }
.brand span { margin-top: 4px; color: #a8bad0; }
nav { gap: 8px; margin-top: 22px; }
nav button { padding: 14px 16px; border-radius: 11px; font-weight: 600; letter-spacing: .01em; transition: background .16s, color .16s, transform .16s; }
nav button:hover { transform: translateX(2px); }
nav button.active { background: linear-gradient(135deg, #173d5e, #1a486d); box-shadow: inset 3px 0 0 var(--gold), 0 8px 20px #00101f36; }
.account { padding: 22px 8px 0; }

main { background: transparent; }
header { padding: 32px 42px 28px; border-bottom: 1px solid #dbe4edcc; background: #ffffffdc; backdrop-filter: blur(16px); }
header p { color: #71839a; font-weight: 700; letter-spacing: .18em; }
header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2.35rem; color: #0b2139; margin-top: 8px; }
section { padding: 34px 42px 48px; }

.stats { gap: 20px; }
.stats article, .panel, .document-preview { border: 1px solid #dce5ed; border-radius: 16px; background: #ffffffed; box-shadow: 0 10px 32px #09243d0d; }
.stats article { padding: 24px; position: relative; overflow: hidden; }
.stats article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--gold), #8d6d2c); }
.stats span { color: #77889b; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stats b { font-family: Georgia, "Times New Roman", serif; color: #102c48; font-size: 2.3rem; }
.panel { padding: 28px; margin-top: 22px; }
.row { padding: 19px 22px; transition: background .15s; }
.row:hover { background: #f7fafc; }
.row:last-child { border-bottom: 0; }

.modal { background: #031425d9; backdrop-filter: blur(6px); }
.modal form, .document-viewer { border: 1px solid #ffffff70; border-radius: 20px; box-shadow: 0 28px 90px #00101f70; }
.modal form { padding: 34px; }
.modal h2 { font-family: Georgia, "Times New Roman", serif; color: #10263f; }
fieldset { border-color: #dbe4ed; border-radius: 12px; background: #f9fbfd; padding: 15px; }

.document-toolbar { margin-bottom: 22px; }
.category-tabs { padding: 5px; background: #e6edf4; border-radius: 12px; }
.category-tabs button { border: 0; background: transparent; border-radius: 9px; padding: 10px 17px; font-weight: 700; }
.category-tabs button.active { background: #fff; color: #123654; box-shadow: 0 4px 14px #09243d16; }
.document-grid { gap: 20px; }
.document-preview { transition: transform .18s, box-shadow .18s, border-color .18s; }
.document-preview:hover { transform: translateY(-3px); border-color: #bdd0e0; box-shadow: 0 16px 38px #09243d1a; }
.preview-frame { height: 225px; background: linear-gradient(145deg, #edf2f7, #f8fafc); }
.preview-open > b { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: #112b45; margin-top: 12px; }
.preview-open > small { color: #77889b; }
.doc-category { background: #e1effb; color: #1766a8; }
.doc-category.instructor { background: #f3ead4; color: #7a5b19; }
.document-viewer > .doc-head { padding: 20px 24px; background: #fbfcfe; }

.planner-shell, .trainee-shell { border-radius: 15px; box-shadow: 0 12px 34px #09243d12; }
.schedule-toolbar { padding: 15px 17px; background: linear-gradient(135deg, #667fa8, #7892bc); }
.trainee-shell .schedule-toolbar { background: #fff; }
.lesson-card { border-radius: 6px; box-shadow: 0 4px 10px #0b20351a; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 92px 1fr; }
  header { padding: 28px 30px; }
  section { padding: 28px 30px; }
  .brand { padding-left: 0; padding-right: 0; }
}

@media (max-width: 700px) {
  body { background: #f3f6f9; }
  aside { height: 76px; padding: 7px 8px; }
  .shell { display: block; }
  nav button { border-radius: 9px; }
  header { padding: 22px 18px; }
  header h1 { font-size: 1.75rem; }
  section { padding: 18px 14px 96px; }
  .stats { gap: 12px; }
  .stats article { padding: 18px; }
  .panel { padding: 19px; border-radius: 13px; }
  .login form { padding: 32px 26px; border-radius: 18px; }
  .login h1 { font-size: 1.75rem; }
  .document-preview:hover { transform: none; }
}

.exam-toolbar, .exam-card-head, .exam-actions, .question-head, .exam-meta { display: flex; align-items: center; gap: 10px; }
.exam-toolbar, .exam-card-head { justify-content: space-between; }
.exam-toolbar { margin-bottom: 20px; flex-wrap: wrap; }
.exam-filter { width: auto; min-width: 210px; }
.exam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.exam-card { margin: 0; padding: 24px; }
.exam-card h2, .exam-card h3 { font-family: Georgia, "Times New Roman", serif; color: #102c48; margin: 0; }
.exam-card p { color: #687b90; line-height: 1.55; }
.exam-meta { flex-wrap: wrap; margin: 14px 0; }
.exam-pill { padding: 5px 9px; border-radius: 999px; background: #e5eff8; color: #1a5f96; font-size: .72rem; font-weight: 800; }
.exam-pill.draft { background: #eef0f3; color: #66717d; }
.exam-pill.published { background: #ddf3e6; color: #187346; }
.exam-pill.closed { background: #f7e3e3; color: #963838; }
.exam-actions { flex-wrap: wrap; margin-top: 18px; }
.exam-actions button { min-height: 38px; border: 1px solid #cbd7e4; border-radius: 9px; background: #fff; color: #23415f; padding: 0 12px; font-weight: 700; }
.exam-actions button.primary { border: 0; color: #fff; }
.exam-actions button.danger { border-color: #efcccc; }
.question-list { display: grid; gap: 14px; margin-top: 20px; }
.question-item { border: 1px solid #dce5ed; border-radius: 13px; padding: 18px; background: #fff; }
.question-head { justify-content: space-between; align-items: flex-start; }
.question-head b { line-height: 1.45; }
.answer-list { display: grid; gap: 8px; margin-top: 13px; }
.answer-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: #f5f8fb; color: #42566b; }
.answer-option.correct { background: #e4f5e9; color: #176a3d; font-weight: 700; }
.exam-taking { max-width: 900px; margin: 0 auto; }
.exam-taking .question-item { padding: 22px; }
.exam-taking label.answer-option { cursor: pointer; }
.exam-taking input[type="radio"] { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.exam-progress { height: 8px; background: #dce5ed; border-radius: 999px; overflow: hidden; margin: 16px 0 24px; }
.exam-progress span { display: block; height: 100%; background: linear-gradient(90deg, #287fc7, #c9a451); }
.exam-result { text-align: center; padding: 34px; }
.exam-result strong { display: block; font: 700 3rem Georgia, serif; color: #123654; margin: 12px 0; }
.form-section-title { margin: 22px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #6d7e91; }
.question-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
textarea { width: 100%; min-height: 95px; border: 1px solid #cbd7e4; border-radius: 10px; padding: 11px; font: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px #287fc71a; }
@media (max-width: 800px) { .exam-grid, .question-option-grid { grid-template-columns: 1fr; } .exam-card-head { align-items: flex-start; flex-direction: column; } }

.document-release-controls { border-top: 1px solid #e1e8ef; padding: 12px 14px 14px; display: grid; gap: 9px; }
.document-release-summary { color: #667b90; font-size: .76rem; font-weight: 700; line-height: 1.35; }
.document-release-button { min-height: 38px; border: 1px solid #b9cbdc; border-radius: 9px; background: #fff; color: #153b5d; font-weight: 800; cursor: pointer; }
.document-release-button:hover { background: #eef5fb; border-color: #7ba6c9; }
.class-release-form { width: min(620px, calc(100vw - 28px)); }
.class-release-list { display: grid; gap: 8px; max-height: 48vh; overflow: auto; margin: 16px 0 20px; padding: 4px; }
.class-release-list .check { margin: 0; padding: 12px; border: 1px solid #dbe4ed; border-radius: 10px; background: #f8fafc; }
.class-release-list .check:has(input:checked) { border-color: #5d9bca; background: #edf6fd; }
.class-release-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.class-release-actions > div { display: flex; gap: 10px; }
.class-release-note { color: #667b90; line-height: 1.45; }
.class-release-error { display: block; color: #b23838; min-height: 1.2em; margin-top: 10px; }
.class-release-load-error { color: #b23838; flex-basis: 100%; }

.results-toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.results-toolbar label { display: grid; gap: 6px; min-width: 210px; color: #667b90; font-size: .75rem; font-weight: 800; }
.results-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.results-table-wrap { overflow-x: auto; padding: 0; }
.results-table { width: 100%; min-width: 880px; border-collapse: collapse; }
.results-table th, .results-table td { padding: 14px 16px; border-bottom: 1px solid #e3e9ef; text-align: left; vertical-align: top; }
.results-table th { background: #f2f6fa; color: #5d7084; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.results-table tbody tr:hover { background: #f8fbfd; }
.result-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.result-status.passed { background: #ddf3e6; color: #187346; }
.result-status.failed { background: #f7e3e3; color: #963838; }

.planner-shell, .trainee-shell { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week-grid { grid-template-columns: 72px repeat(7, minmax(150px, 1fr)); min-width: 1122px; }
.student-grid { grid-template-columns: 88px repeat(7, minmax(170px, 1fr)); min-width: 1278px; }

@media (max-width: 1000px) {
  .week-grid { grid-template-columns: 72px repeat(7, 170px); min-width: 1262px; }
  .student-grid { grid-template-columns: 88px repeat(7, 185px); min-width: 1383px; }
}

@media (max-width: 700px) {
  .results-summary { grid-template-columns: 1fr 1fr; }
  .week-grid { grid-template-columns: 62px repeat(7, 155px); min-width: 1147px; }
  .student-grid { grid-template-columns: 72px repeat(7, 165px); min-width: 1227px; }
  nav { justify-content: flex-start; overflow-x: auto; }
  nav button { flex: 0 0 76px; }
}
