/* =====================================================================
   CEMS – College Examination & Academic Management System
   Design system: academic navy + heritage gold, calm neutrals.
   ===================================================================== */
:root {
  --navy-950: #0c1730;
  --navy-900: #12224a;
  --navy-800: #1a3166;
  --navy-700: #22408a;
  --primary: #2447a8;
  --primary-600: #1f3d93;
  --primary-50: #eef2fc;
  --primary-100: #dce5f8;
  --gold: #b08d3c;
  --gold-50: #faf5e9;
  --gold-600: #8f7029;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e8f1;
  --border-strong: #cfd7e6;
  --text: #182033;
  --text-2: #3d475c;
  --muted: #6b7489;
  --green: #18794e;  --green-50: #e9f6ef;
  --red: #c0352b;    --red-50: #fdeeec;
  --amber: #a15c07;  --amber-50: #fdf3e2;
  --blue: #1d5fc4;   --blue-50: #e8f0fd;
  --purple: #6d3fc4; --purple-50: #f2edfc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --sidebar-w: 256px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .75rem; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #c9d3ea; display: flex; flex-direction: column; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #2c4a93, var(--navy-800)); border: 2px solid var(--gold);
  color: #fff; font-family: var(--font-serif); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { color: #fff; font-weight: 650; font-size: 14px; line-height: 1.2; }
.brand-sub { color: #8c9bbf; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #7385ad; padding: 16px 12px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 1px 0; border-radius: 8px;
  color: #c9d3ea; font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(176,141,60,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.active .icon { color: #e3c47a; }
.nav .icon { width: 17px; height: 17px; opacity: .9; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: #7385ad; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.menu-toggle { display: none; }
.global-search { position: relative; flex: 1; max-width: 460px; }
.global-search input[type=search] { padding-left: 36px; background: var(--surface-2); }
.global-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; position: relative; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }

.content { padding: 24px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.page-head .crumbs a { color: var(--muted); }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.grid > .card + .card, .course-grid > * + *, .grid > * + * { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.pad-0 .card-body { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack > * + * { margin-top: 18px; }

/* stats */
.stat { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat-icon.blue { background: var(--blue-50); color: var(--blue); }
.stat-icon.green { background: var(--green-50); color: var(--green); }
.stat-icon.gold { background: var(--gold-50); color: var(--gold-600); }
.stat-icon.purple { background: var(--purple-50); color: var(--purple); }
.stat-icon.red { background: var(--red-50); color: var(--red); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 1px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(36,71,168,.25); }
.btn-primary:hover { background: var(--primary-600); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-600); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(16,24,40,.05); }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--red-50); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #136440; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .req { color: var(--red); }
.input, .select, .textarea, input:not([type]), input[type=text], input[type=url], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; font: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 9px; transition: border-color .15s, box-shadow .15s;
}
textarea, .textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
select, .select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[type=color] { width: 48px; height: 38px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: middle; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error-text { font-size: 12px; color: var(--red); margin-top: 4px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.input-group { display: flex; }
.input-group > :first-child { border-radius: 9px 0 0 9px; }
.input-group > :last-child { border-radius: 0 9px 9px 0; margin-left: -1px; }
.lang-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--primary-50); color: var(--primary); margin-left: 4px; letter-spacing: .03em; vertical-align: 1px; }
.lang-tag.uk { background: #fff6d6; color: #8a6400; }
.fieldset-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 2px; grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed var(--border); }
.fieldset-title:first-child { border-top: 0; padding-top: 0; }

/* ------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table.compact td { padding: 7px 12px; }
.table tfoot td { background: var(--gold-50); font-weight: 600; }
.row-link { color: inherit; font-weight: 600; }
.table td.mono { white-space: nowrap; }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-mobile-brand .brand-name { color: var(--text); }
.auth-mobile-brand .brand-sub { color: var(--muted); }
.person { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.person .meta { line-height: 1.25; }
.person .meta span { font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--navy-800); background: linear-gradient(135deg, #e3e9f8, #f3ead5); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 26px; border: 3px solid #fff; box-shadow: var(--shadow); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar input, .toolbar select { width: auto; min-width: 150px; height: 36px; }
.toolbar .grow { flex: 1; min-width: 200px; }

.pagination { display: flex; align-items: center; gap: 4px; padding: 14px 18px; flex-wrap: wrap; }
.pagination .page { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 13px; text-decoration: none; background: #fff; }
.pagination .page.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page.disabled, .pagination .gap { opacity: .45; border-color: transparent; background: none; }
.pagination .page-info { margin-left: auto; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------- badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-gray { background: #eef0f4; color: #5b6476; }
.badge-gold { background: var(--gold-50); color: var(--gold-600); }
.badge-purple { background: var(--purple-50); color: var(--purple); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2); }
.grade { display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 6px; border-radius: 6px; font-weight: 700; font-size: 12.5px; background: var(--primary-50); color: var(--primary); }
.grade.fail { background: var(--red-50); color: var(--red); }
.grade.pending { background: #eef0f4; color: var(--muted); }

/* ------------------------------------------------------------- alerts / flash */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 13.5px; margin-bottom: 16px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-50); border-color: #bfe3cf; color: #11583a; }
.alert-error { background: var(--red-50); border-color: #f2c3be; color: #8e2018; }
.alert-warning { background: var(--amber-50); border-color: #f1d6a9; color: #7a4504; }
.alert-info { background: var(--blue-50); border-color: #c4d7f7; color: #164a99; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .2s ease; white-space: pre-line; }
.toast.error { background: #8e2018; }
.toast.success { background: #11583a; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { padding: 12px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); padding: 0 6px; border-radius: 999px; color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------- misc */
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 9px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }
.progress { height: 8px; background: #eaeef5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4f74d6); border-radius: 99px; }
.progress.gold > span { background: linear-gradient(90deg, var(--gold), #d0ad5c); }
.progress.green > span { background: linear-gradient(90deg, var(--green), #2fa36b); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: #b5bfd3; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.callout { border-radius: 10px; padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.callout.ok { background: var(--green-50); border: 1px solid #bfe3cf; }
.callout.warn { background: var(--amber-50); border: 1px solid #f1d6a9; }
.reasons { margin: 6px 0 0; padding-left: 18px; }
.inline-form { display: inline; }

/* bar chart */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; }
.donut { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut .hole { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.donut .hole b { font-size: 22px; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------- modal */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(12, 23, 48, .45); backdrop-filter: blur(2px); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ------------------------------------------------------------- student profile */
.profile-hero { display: flex; gap: 18px; align-items: center; padding: 20px; flex-wrap: wrap; }
.profile-hero h1 { font-size: 21px; }
.profile-hero .uk-name { color: var(--muted); font-size: 14px; }
.profile-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.profile-meta span { display: inline-flex; gap: 6px; align-items: center; }
.enroll-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; position: relative; overflow: hidden; background: #fff; }
.enroll-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--primary)); }
.semester-strip { display: flex; gap: 4px; margin-top: 10px; }
.semester-strip span { flex: 1; height: 8px; border-radius: 3px; background: #e9edf4; }
.semester-strip span.done { background: var(--green); }
.semester-strip span.partial { background: #e3b341; }
.semester-strip span.fail { background: var(--red); }
.sem-block + .sem-block { margin-top: 18px; }
.sem-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--navy-900); color: #fff; border-radius: 9px 9px 0 0; font-weight: 600; font-size: 13px; gap: 10px; flex-wrap: wrap; }
.sem-head .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sem-head .chips span { background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.sem-table { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 9px 9px; overflow: hidden; }

/* ------------------------------------------------------------- course builder */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.course-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.course-card .band { height: 6px; background: var(--c, var(--primary)); }
.course-card .body { padding: 16px 18px; flex: 1; }
.course-card .code { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.course-card h3 { margin: 4px 0 2px; font-size: 16px; }
.course-card h3 a { color: var(--text); }
.course-card .uk { color: var(--muted); font-size: 13px; }
.course-card .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.course-card .facts div { background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center; }
.course-card .facts b { display: block; font-size: 16px; }
.course-card .facts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.course-card .foot { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); gap: 8px; }

.stepper { display: flex; gap: 0; counter-reset: step; padding: 0; margin: 0 0 20px; list-style: none; overflow-x: auto; }
.stepper li { flex: 1; min-width: 130px; position: relative; padding: 0 8px 0 0; }
.stepper button { width: 100%; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; text-align: left; color: var(--muted); }
.stepper button .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 700; font-size: 12.5px; flex: none; color: var(--text-2); }
.stepper button b { display: block; font-size: 13px; color: var(--text); }
.stepper button small { font-size: 11.5px; }
.stepper li.active button { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.stepper li.active .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper li.done .n { background: var(--green); border-color: var(--green); color: #fff; }

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.builder-aside { position: sticky; top: 78px; }
.code-preview { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: .04em; color: var(--navy-800); background: repeating-linear-gradient(45deg, var(--gold-50), var(--gold-50) 8px, #fff 8px, #fff 16px); border: 1px dashed var(--gold); border-radius: 10px; padding: 12px; text-align: center; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.column { background: #eef1f7; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-height: 260px; scroll-snap-align: start; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.column.drag-over { border-color: var(--primary); background: var(--primary-50); }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.column-head b { font-size: 13.5px; }
.column-head .meta { font-size: 11.5px; color: var(--muted); }
.column-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.subject-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow-sm); position: relative; }
.subject-card:hover { border-color: var(--border-strong); }
.subject-card.dragging { opacity: .45; }
.subject-card .top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.subject-card .sc-code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.subject-card .sc-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; margin-top: 2px; }
.subject-card .sc-uk { font-size: 12px; color: var(--muted); line-height: 1.3; }
.subject-card .sc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.subject-card .sc-tags span { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.subject-card .sc-tags .t { background: #eaf0fd; color: #1d4fb0; border-color: #d4e0fa; }
.subject-card .sc-tags .p { background: #e9f6ef; color: #18794e; border-color: #cbe9d9; }
.subject-card .sc-tags .l { background: #f2edfc; color: #6d3fc4; border-color: #e1d6f7; }
.subject-card .sc-tags .cr { background: var(--gold-50); color: var(--gold-600); border-color: #eedfb9; }
.subject-card .lock { color: var(--amber); }
.add-subject { margin-top: 8px; width: 100%; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--muted); border-radius: 10px; padding: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.add-subject:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
.components { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.component { border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.component.on { border-color: #b8c8ef; background: #f7f9ff; }
.component .head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; margin-bottom: 8px; }
.component .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.component label { font-size: 11.5px; }
.component input { height: 34px; }
.summary-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.summary-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.summary-list li:last-child { border-bottom: 0; }
.summary-list b { font-variant-numeric: tabular-nums; }
.band-preview { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.band-preview td, .band-preview th { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }

/* ------------------------------------------------------------- marks entry */
.marks-table input[type=number] { width: 84px; height: 34px; text-align: center; font-variant-numeric: tabular-nums; padding: 0 6px; }
.marks-table input.invalid { border-color: var(--red); background: var(--red-50); }
.marks-table input:disabled { background: #f1f3f7; color: #9aa3b5; }
.marks-table tr.dirty td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.marks-table .calc { font-weight: 700; font-variant-numeric: tabular-nums; }
.marks-table .remarks { width: 160px; text-align: left; }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--border); padding: 12px 18px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.subject-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.subject-pills a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.subject-pills a.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.subject-pills a .done { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ------------------------------------------------------------- document issue */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; height: 100%; margin: 0; font-weight: 500; color: var(--text); }
.choice label b { font-size: 13.5px; }
.choice label small { color: var(--muted); font-weight: 400; }
.choice input:checked + label { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); background: #fbfcff; }
.choice input:disabled + label { opacity: .45; cursor: not-allowed; }
.choice input:focus-visible + label { outline: 3px solid var(--primary-100); }
.pdf-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--border); border-radius: 10px; background: #525659; }
.doc-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.doc-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-50); color: var(--gold-600); }
.serial { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .03em; }
.qr-box { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }

/* ------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); background: #fff; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 20% 15%, rgba(176,141,60,.28), transparent 45%), linear-gradient(160deg, var(--navy-800), var(--navy-950)); }
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: repeating-radial-gradient(circle at 85% 90%, rgba(255,255,255,.05) 0 1px, transparent 1px 22px); pointer-events: none; }
.auth-art h1 { color: #fff; font-family: var(--font-serif); font-size: 34px; font-weight: 600; max-width: 520px; margin-top: 24px; line-height: 1.2; }
.auth-art p { color: #c3cde6; max-width: 480px; font-size: 15px; }
.auth-features { display: grid; gap: 12px; margin-top: 28px; position: relative; z-index: 1; }
.auth-features div { display: flex; gap: 10px; align-items: center; color: #dfe6f6; }
.auth-features .icon { color: #e3c47a; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 24px; margin-bottom: 4px; }

/* ------------------------------------------------------------- public verification */
.verify-page { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 50% -10%, #e8edf8, var(--bg) 60%); }
.verify-top { background: var(--navy-900); color: #fff; }
.verify-top .inner { max-width: 980px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 14px; }
.verify-top .inner .brand-name { font-size: 15px; }
.lang-switch { margin-left: auto; display: flex; background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px; }
.lang-switch a { color: #c9d3ea; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.lang-switch a.active { background: #fff; color: var(--navy-900); }
.verify-main { flex: 1; max-width: 760px; width: 100%; margin: 0 auto; padding: 40px 20px; }
.verify-hero { text-align: center; margin-bottom: 26px; }
.verify-hero .seal-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: #fff; border: 2px solid var(--gold); color: var(--navy-800); box-shadow: var(--shadow); }
.verify-hero h1 { font-size: 28px; font-family: var(--font-serif); font-weight: 600; }
.verify-hero p { color: var(--muted); max-width: 560px; margin: 8px auto 0; }
.verify-form { display: flex; gap: 10px; }
.verify-form input { height: 48px; font-size: 16px; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.verify-form .btn { height: 48px; padding: 0 22px; }
.verify-form input#t { flex: 0 1 300px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.result-card { margin-top: 24px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--border); }
.result-head { padding: 22px 24px; display: flex; gap: 16px; align-items: center; }
.result-head.valid { background: linear-gradient(135deg, #e7f6ee, #f4fbf7); }
.result-head.revoked, .result-head.invalid { background: linear-gradient(135deg, #fdecea, #fff6f5); }
.result-head.not_found, .result-head.rate { background: linear-gradient(135deg, #f1f3f7, #fafbfc); }
.result-head .status-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.result-head.valid .status-icon { background: var(--green); }
.result-head.revoked .status-icon, .result-head.invalid .status-icon { background: var(--red); }
.result-head.not_found .status-icon, .result-head.rate .status-icon { background: #8a93a6; }
.result-head h2 { font-size: 20px; }
.result-body { padding: 8px 24px 22px; }
.result-body .kv { grid-template-columns: minmax(150px, 34%) 1fr; }
.result-body .kv dt, .result-body .kv dd { padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0; }
.verify-foot { text-align: center; padding: 22px; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------- installer */
.install-wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }

/* ------------------------------------------------------------- document design */
.design-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.design-preview-card { position: sticky; top: 78px; align-self: start; }
.issue-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.sig-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: 1fr; }
  .builder-aside { position: static; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(12,23,48,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-main, .grid-3, .design-grid, .issue-grid { grid-template-columns: 1fr; }
  .design-preview-card { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .user-chip .who { display: none; }
  .grid-2, .grid-4, .form-grid, .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .components, .sig-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  h1 { font-size: 19px; }
  .stat .value { font-size: 22px; }
  .verify-form { flex-direction: column; }
  .kv, .result-body .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .result-body .kv dt { border-bottom: 0; padding-bottom: 0; }
  /* stacked tables on phones */
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 14px; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; }
  .table.stack-sm td.num { text-align: right; }
  .bar-row { grid-template-columns: 90px 1fr 40px; }
}

@media print {
  .sidebar, .topbar, .actions, .no-print, .toast-stack { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

/* v1.3: student photo upload on the profile */
.photo-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-upload input[type=file] { max-width: 260px; font-size: 13px; }

/* v1.3: Template designer */
.designer { display: flex; flex-direction: column; gap: 12px; }
.dz-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; }
.dz-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dz-name { font-weight: 600; font-size: 16px; min-width: 260px; height: 36px; }
.dz-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dz-inline { display: inline-flex; gap: 6px; align-items: center; }
.dz-inline select { height: 32px; width: auto; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg-btn { border: 0; background: #fff; padding: 6px 12px; font-weight: 600; cursor: pointer; font-size: 13px; }
.seg-btn.active { background: var(--primary, #1d4ed8); color: #fff; }
.dz-body { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.dz-side, .dz-props { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.dz-palette .field { margin-bottom: 10px; }
.dz-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dz-add-grid .btn { justify-content: center; white-space: normal; height: auto; min-height: 32px; padding: 6px; font-size: 12px; }
.dz-layers { list-style: none; margin: 0; padding: 4px 8px; max-height: 300px; overflow: auto; }
.dz-layers li { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.dz-layers li:hover { background: #f3f4f6; }
.dz-layers li.active { background: #e0e7ff; font-weight: 600; }
.dz-layers li small { color: var(--muted); white-space: nowrap; }
.dz-stage { overflow: auto; padding: 20px; background: #e5e7eb; min-height: 70vh; }
.dz-page { position: relative; margin: 0 auto; background-color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.18); outline: none;
  background-image: linear-gradient(rgba(29,78,216,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(29,78,216,.06) 1px, transparent 1px); touch-action: none; user-select: none; }
.dz-band { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(-45deg, rgba(220,38,38,.07) 0 8px, rgba(220,38,38,.02) 8px 16px); border-bottom: 1px dashed #dc2626; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.dz-band span { font-size: 11px; color: #b91c1c; background: rgba(255,255,255,.8); padding: 2px 8px; border-radius: 6px; }
.dz-band-bottom { top: auto; bottom: 0; border-bottom: 0; border-top: 1px dashed #dc2626; }
.dz-el { position: absolute; box-sizing: border-box; cursor: move; outline: 1px dashed rgba(29,78,216,.35); color: #000; }
.dz-el:hover { outline-color: rgba(29,78,216,.8); }
.dz-el.selected { outline: 2px solid #1d4ed8; z-index: 5; }
.dz-el.dz-shrunk { outline-color: #f59e0b; }
.dz-inner { width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; white-space: pre-wrap; word-break: break-word; pointer-events: none; }
.dz-photo .dz-inner { align-items: center; justify-content: center; position: relative; }
.dz-photo svg { width: 100%; height: 100%; }
.dz-photo span { position: absolute; bottom: 4px; font: 600 10px/1 system-ui; color: #4b5563; }
.dz-qr .dz-inner { align-items: center; justify-content: center; background: repeating-conic-gradient(#000 0 25%, #fff 0 50%) 0 0 / 14% 14%; }
.dz-qr span { background: #fff; padding: 1px 4px; font: 700 11px system-ui; }
.dz-line .dz-inner { height: 50%; width: 100%; }
.dz-line { outline-offset: 2px; }
.dz-sigs { flex-direction: row !important; align-items: flex-end; }
.dz-sig { display: flex; flex-direction: column; align-items: center; padding: 0 6%; box-sizing: border-box; line-height: 1.2; text-align: center; }
.dz-sig-line { width: 100%; border-top: 1px solid #000; margin-bottom: 2px; }
.dz-sig small { font-size: .9em; }
.dz-records .dz-inner { background: repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 12%); padding: 4px; gap: 2px; }
.dz-records span { font-size: .9em; color: #4b5563; }
.dz-records i { display: block; height: 1px; background: rgba(0,0,0,.25); margin-top: 6%; }
.dz-kv { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,.15); }
.dz-h { position: absolute; width: 9px; height: 9px; background: #fff; border: 2px solid #1d4ed8; border-radius: 2px; z-index: 6; }
.dz-h-nw { left: -5px; top: -5px; cursor: nwse-resize; } .dz-h-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.dz-h-ne { right: -5px; top: -5px; cursor: nesw-resize; } .dz-h-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.dz-h-n { left: calc(50% - 5px); top: -5px; cursor: ns-resize; } .dz-h-s { left: calc(50% - 5px); bottom: -5px; cursor: ns-resize; }
.dz-h-e { right: -5px; top: calc(50% - 5px); cursor: ew-resize; } .dz-h-w { left: -5px; top: calc(50% - 5px); cursor: ew-resize; }
.dz-pgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
.dz-checks { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
#dz-props-body textarea { width: 100%; font-size: 13px; }
@media (max-width: 1200px) { .dz-body { grid-template-columns: 220px minmax(0, 1fr); } .dz-props { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 760px) { .dz-body { grid-template-columns: 1fr; } .dz-side { position: static; max-height: none; } }

/* v1.4: AI curriculum suggestion preview */
.ai-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; margin-top: 10px; }
.ai-sem { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.ai-sem ul { list-style: none; margin: 6px 0 0; padding: 0; }
.ai-sem li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); font-size: 13px; }
.ai-sem li small { display: block; color: var(--muted); }
.assign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.assign-grid .check { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; }

/* v1.4: grid children never grow wider than the screen (long select options on phones) */
.grid > *, .form-grid > *, .field { min-width: 0; }
.field select, .field input, .field textarea { max-width: 100%; }

/* ------------------------------------------------------------- per-student marks entry */
#assigned > details > summary { list-style: none; }
#assigned > details > summary::-webkit-details-marker { display: none; }
#marks-card .toolbar select, #marks-card .toolbar input[type=date] { min-width: 0; }
#marks-card .marks-table td { vertical-align: middle; }
#marks-card .marks-table td .small.muted { font-size: 11px; }
#sem-pills a { cursor: pointer; }
#marks-card [hidden], .badge[hidden] { display: none !important; }
/* direct-print preview frames: light canvas instead of the PDF viewer's dark grey */
.pdf-frame { background: #e9ecf1; }

/* Arrange text: the preview takes the full width while text is being moved */
.design-grid.arranging { grid-template-columns: minmax(0, 1fr) !important; }
.design-grid.arranging .design-preview-card { order: -1; position: static; }

/* Document design: full-screen preview / design editor */
.design-preview-card.preview-fullscreen { position: fixed !important; top: 0 !important; left: 0 !important; right: 0; bottom: 0; width: 100vw; height: 100vh; z-index: 1000; margin: 0 !important; border-radius: 0; display: flex; flex-direction: column; }
.design-preview-card.preview-fullscreen .card-body { flex: 1 1 auto; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.design-preview-card.preview-fullscreen .pdf-frame { flex: 1 1 auto; height: auto !important; min-height: 0; border: 0; border-radius: 0; }
.design-preview-card.preview-fullscreen .card-foot { display: none; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* v1.8 – automatic Ukrainian in the student form */
.tr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--primary-50, #eef3ff); }
.tr-bar .help { display: block; margin-top: 2px; }
.tr-bar .btn.is-loading { opacity: .7; pointer-events: none; }
.tr-status { min-height: 18px; margin-top: 5px; font-size: 12.5px; color: var(--muted, #667085); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.tr-uk.is-auto .tr-text { color: #0e7a4f; }
.tr-uk.is-manual .tr-text { color: #475467; }
.tr-uk.is-stale .tr-text { color: #9a5800; }
.tr-uk.is-error .tr-text { color: #b42318; }
.tr-uk.is-stale input, .tr-uk.is-stale textarea { border-color: #f0b44c; }
.tr-uk.is-auto input, .tr-uk.is-auto textarea { background: #f6fbf8; }
.tr-link { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--primary, #1d47c8); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tr-spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tr-spin .7s linear infinite; vertical-align: -2px; }
@keyframes tr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tr-spin { animation-duration: 2s; } }

/* v1.8.4 – Certificate / Diploma / Degree at enrollment */
.award-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.award-choice legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.award-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.award-grid .choice label { padding: 10px 12px; gap: 3px; }
.award-grid .choice label small { font-size: 11.5px; color: var(--muted, #667085); font-weight: 400; line-height: 1.3; }
.award-grid .choice input:checked + label { border-color: var(--primary, #1d47c8); background: var(--primary-50, #eef3ff); box-shadow: 0 0 0 3px rgba(29, 71, 200, .12); }
.award-grid .choice input:focus-visible + label { outline: 3px solid rgba(29, 71, 200, .35); outline-offset: 2px; }
@media (max-width: 560px) { .award-grid { grid-template-columns: 1fr; } }
