/* Fulton Registration Portal — single stylesheet, no build step.
   Layout: staff/admin use a sidebar shell; students and public pages use a top bar.
   Grids respond to the width of the content area (container queries), not the window,
   so columns stack cleanly whether or not the sidebar is visible. */

:root {
  --blue: #2f7fd6;
  --blue-600: #2569b6;
  --blue-700: #1d5594;
  --blue-50: #edf4fd;
  --blue-100: #dbe9fb;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #dde5ef;
  --line-2: #edf1f6;
  --bg: #f5f7fb;
  --card: #fff;
  --green: #12805c;
  --green-bg: #ecfdf3;
  --green-line: #abefc6;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --amber-line: #fedf89;
  --red: #c0352b;
  --red-bg: #fef3f2;
  --red-line: #fecdca;
  --grey-bg: #f2f4f7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar: 248px;
  --topbar: 60px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--blue-600); text-underline-offset: 2px; }
a:hover { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.25; margin: 0; color: var(--ink); }
h1 { font-size: 1.55rem; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .6rem; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid #93c0f5; outline-offset: 2px; }
.spacer { flex: 1; }
.m0 { margin: 0; }
.mb { margin-bottom: 1rem; }
.mt { margin-top: 1rem; }
.mt-sm { margin-top: .5rem; }
.w-auto { width: auto !important; }
.w-full { width: 100%; }
.w-num { width: 5.5rem !important; }
.maxw { max-width: 760px; }
.error-text { color: var(--red); font-weight: 600; }

/* ---------- Staff shell: sidebar + main column ---------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; width: var(--sidebar); flex: none;
  background: #0f2742; color: #c9d6e6; display: flex; flex-direction: column; overflow-y: auto; z-index: 40;
}
.sidebar-brand { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem .8rem; text-decoration: none; color: #fff; }
.sidebar-brand img { width: 110px; height: auto; background: #fff; border-radius: 8px; padding: 4px 6px; }
.sidebar-brand span { font-weight: 700; font-size: .85rem; letter-spacing: .01em; }
.context { padding: .2rem 1rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .08); display: grid; gap: .55rem; }
.context-field label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #8fa6c1; margin-bottom: .2rem; font-weight: 600; }
.context-field select { width: 100%; background: #16355a; color: #fff; border: 1px solid #24476f; border-radius: 8px; padding: .4rem .5rem; font: inherit; font-size: .84rem; }
.sidenav { padding: .6rem .6rem 1.5rem; display: flex; flex-direction: column; gap: 1px; }
.sidenav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #7e96b3; font-weight: 700; padding: .9rem .6rem .3rem; }
.sidenav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 8px; color: #d3dfec; text-decoration: none; font-size: .9rem; font-weight: 500; }
.sidenav a svg { flex: none; opacity: .8; }
.sidenav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidenav a.active { background: var(--blue); color: #fff; }
.sidenav a.active svg { opacity: 1; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-scrim { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; padding: 0 1.25rem; }
.topbar .topbar-brand { display: none; }
.topbar .menu-toggle { display: none; }

@media (max-width: 1000px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .nav-toggle:checked ~ .shell .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 35; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .topbar-brand { display: inline-flex; }
  .topbar-brand img { height: 32px; width: auto; }
}

/* ---------- Top bar (shared pieces) ---------- */
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--grey-bg); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 2px; right: 1px; background: var(--red); color: #fff; border-radius: 999px; font-size: .66rem; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.lang-form select { border: 1px solid var(--line); border-radius: 8px; padding: .32rem .45rem; font: inherit; font-size: .82rem; font-weight: 600; background: #fff; color: var(--ink-2); min-width: 3.6rem; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); padding: .25rem .5rem .25rem .25rem; border-radius: 999px; }
.user-chip:hover { background: var(--grey-bg); color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--blue-100); color: var(--blue-700); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.user-name { display: flex; flex-direction: column; line-height: 1.15; }
.user-name strong { font-size: .86rem; white-space: nowrap; }
.user-name small { font-size: .75rem; color: var(--muted); }
@media (max-width: 700px) { .user-name { display: none; } }

/* Public / student top bar */
.topbar-public { padding: 0; height: auto; min-height: var(--topbar); }
.topbar-inner { max-width: 1240px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: .6rem; padding: .5rem 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand img { height: 38px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .92rem; white-space: nowrap; }
.brand-text span { font-size: .76rem; color: var(--muted); }
.topnav { display: flex; gap: .15rem; margin-left: .75rem; }
.topnav a { text-decoration: none; color: var(--ink-2); padding: .45rem .75rem; border-radius: 8px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.topnav a:hover { background: var(--grey-bg); color: var(--ink); }
.topnav a.active { background: var(--blue-50); color: var(--blue-700); }
@media (max-width: 760px) {
  .brand-text { display: none; }
  .topnav { margin-left: 0; }
  .topnav a { padding: .4rem .55rem; }
}

/* ---------- Content area ---------- */
.content { container-type: inline-size; container-name: content; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.75rem 2rem; flex: 1; }
.content-public { max-width: 1240px; }
@media (max-width: 700px) { .content { padding: 1rem .85rem 1.5rem; } }
footer.site { padding: 1.25rem 1.75rem 2rem; color: var(--muted); font-size: .8rem; max-width: 1280px; width: 100%; margin: 0 auto; }

/* Page header */
.breadcrumb { font-size: .85rem; margin: 0 0 .5rem; }
.breadcrumb a { text-decoration: none; color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--blue-600); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1.25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .title { display: flex; align-items: center; gap: .4rem .6rem; flex-wrap: wrap; min-width: 0; }
.page-head .title h1 { margin: 0; }
.page-head .title .who { font-weight: 600; color: var(--ink-2); font-size: 1rem; }
.page-head .tools { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.page-head .tools form { margin: 0; }

/* ---------- Grids (respond to the content width) ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
@container content (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container content (min-width: 1040px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); container-type: inline-size; min-width: 0; }
.panel-head { padding: .9rem 1.15rem; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; margin-right: auto; }
.panel-head > .badge:first-child, .panel-head > .step-num + h2 { margin-right: 0; }
.panel-body { padding: 1rem 1.15rem; }
.panel-body + .panel-body { border-top: 1px solid var(--line-2); }
.panel-foot { padding: .8rem 1.15rem; border-top: 1px solid var(--line-2); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: #fcfdfe; border-radius: 0 0 var(--radius) var(--radius); }
.panel-foot form { margin: 0; }
details.panel > summary, .panel details > summary { list-style: none; }
details > summary { cursor: pointer; font-weight: 600; color: var(--blue-700); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
.unread { background: #f6faff; box-shadow: inset 3px 0 0 var(--blue); }

/* ---------- Banners, flash, pills ---------- */
.banner-row { display: flex; gap: .75rem; align-items: stretch; margin-bottom: 1.25rem; flex-wrap: wrap; }
.banner { flex: 1 1 420px; display: flex; gap: .7rem; align-items: center; padding: .85rem 1.1rem; border-radius: 12px; border: 1px solid; font-size: .95rem; flex-wrap: wrap; }
.banner svg { flex: none; }
.banner > span { flex: 1 1 240px; }
.banner form { margin-left: auto; }
.banner.ok { background: var(--green-bg); border-color: var(--green-line); color: #05603a; }
.banner.warn { background: var(--amber-bg); border-color: var(--amber-line); color: #7a2e0e; }
.banner.bad { background: var(--red-bg); border-color: var(--red-line); color: #912018; }
.banner.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; }
.flash svg { flex: none; margin-top: 2px; }
.flash.success { background: var(--green-bg); border-color: var(--green-line); color: #05603a; }
.flash.error { background: var(--red-bg); border-color: var(--red-line); color: #912018; }
.flash.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; border-radius: 999px; font-weight: 700; border: 1px solid; white-space: nowrap; align-self: center; }
.status-pill.COMPLETE { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.status-pill.IN_PROGRESS { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.status-pill.NOT_STARTED { background: var(--grey-bg); border-color: var(--line); color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; border: 1px solid var(--line); background: var(--grey-bg); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge.green { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.badge.amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.badge.red { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.badge.blue { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 650; font-size: .9rem; padding: .55rem 1rem; border-radius: 9px; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: #c4cfdc; border-color: #c4cfdc; cursor: not-allowed; }
.btn.lg { padding: .7rem 1.3rem; font-size: .98rem; }
.btn.sm { padding: .35rem .7rem; font-size: .82rem; border-radius: 8px; }
.btn.secondary { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.secondary:hover { background: var(--grey-bg); color: var(--ink); }
.btn.success { background: var(--green); border-color: var(--green); }
.btn.success:hover { background: #0b6b4c; border-color: #0b6b4c; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; color: var(--blue-700); border-color: transparent; }
.btn.ghost:hover { background: var(--blue-50); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-600); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--blue); color: inherit; }
.stat .n { font-size: 1.6rem; font-weight: 750; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .8rem; font-weight: 600; }
td.due { color: var(--red); font-weight: 650; }
.stat .n.money { font-size: 1.15rem; white-space: nowrap; }
.fee-flags { justify-content: flex-end; gap: .35rem; }
.stat.green .n { color: var(--green); } .stat.amber .n { color: var(--amber); } .stat.red .n { color: var(--red); } .stat.blue .n { color: var(--blue-700); }
.panel-body .stat { box-shadow: none; }

/* Quick links (staff home) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; }
.tile { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--blue); color: var(--ink); }
.tile-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; }
.tile strong { display: block; font-size: .95rem; }
.tile span.small { color: var(--muted); }

/* ---------- Progress ---------- */
.progress-card { display: flex; gap: 1rem 1.5rem; align-items: center; padding: .9rem 1.15rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.progress-text { font-weight: 650; }
.progress-meta { color: var(--muted); font-size: .85rem; }
.bar { flex: 1 1 200px; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar.green > span { background: var(--green); }
.bar-0 > span { width: 0; } .bar-5 > span { width: 5%; } .bar-10 > span { width: 10%; } .bar-15 > span { width: 15%; } .bar-20 > span { width: 20%; }
.bar-25 > span { width: 25%; } .bar-30 > span { width: 30%; } .bar-35 > span { width: 35%; } .bar-40 > span { width: 40%; } .bar-45 > span { width: 45%; }
.bar-50 > span { width: 50%; } .bar-55 > span { width: 55%; } .bar-60 > span { width: 60%; } .bar-65 > span { width: 65%; } .bar-70 > span { width: 70%; }
.bar-75 > span { width: 75%; } .bar-80 > span { width: 80%; } .bar-85 > span { width: 85%; } .bar-90 > span { width: 90%; } .bar-95 > span { width: 95%; } .bar-100 > span { width: 100%; }
.hbars { display: grid; gap: .6rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr 40px; gap: .75rem; align-items: center; font-size: .88rem; text-decoration: none; color: var(--ink-2); }
a.hbar:hover { color: var(--blue-700); }

/* ---------- Six step cards (student dashboard) ---------- */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@container content (min-width: 620px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container content (min-width: 960px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.step-card.is-done { border-color: var(--green-line); }
.step-card.is-locked { background: #fbfcfe; }
.step-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line-2); }
.step-num { width: 36px; height: 36px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; }
.is-done .step-num { background: var(--green); }
.is-locked .step-num, .is-na .step-num { background: #98a2b3; }
.step-title { font-weight: 750; font-size: 1.02rem; line-height: 1.25; }
.step-icon { margin-left: auto; width: 42px; height: 42px; flex: none; border-radius: 11px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--blue); }
.is-done .step-icon { color: var(--green); }
.step-body { padding: 1rem 1.15rem; flex: 1; }
.step-link { font-weight: 700; font-size: .85rem; }
.step-desc { color: var(--ink-2); margin: .45rem 0 0; }
.step-state { display: flex; gap: .4rem; align-items: center; margin-top: .7rem; font-size: .85rem; flex-wrap: wrap; }
.step-foot { padding: .85rem 1.15rem; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: .75rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table thead th { background: #f9fafb; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; background: #f9fafb; border-top: 1px solid var(--line); }
.table.small th, .table.small td { padding: .45rem .7rem; }
.table td .row { flex-wrap: nowrap; }
.table.kv th { width: 38%; background: #fafbfc; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: .86rem; white-space: normal; }
.table .actions { display: flex; gap: .35rem; flex-wrap: nowrap; justify-content: flex-end; }
.table tr.edit-row > td { background: #f8fbff; padding: .9rem 1rem 1.1rem; }
.table tr.edit-row .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.table .wide-col { min-width: 200px; }
.table td .badge + .badge { margin-left: .2rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.cycle-row td { background: #f9fafb; font-size: .85rem; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem 1.1rem; }
@container (min-width: 520px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-grid .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field label, .label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .3rem; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.field .error { font-size: .8rem; color: var(--red); margin-top: .25rem; font-weight: 600; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .92rem; color: var(--ink); background: #fff; border: 1px solid #cfd8e3; border-radius: 8px; padding: .5rem .65rem; min-height: 38px; }
input[type=file] { font: inherit; font-size: .88rem; max-width: 100%; }
textarea { min-height: 110px; resize: vertical; }
select[multiple] { min-height: 140px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(47, 127, 214, .18); }
.has-error input, .has-error select { border-color: var(--red); }
.has-error label { color: var(--red); }
.field-error { color: var(--red); font-size: .82rem; font-weight: 600; margin-top: .25rem; }
.personal-form > fieldset { border: 0; padding: 0; }
.personal-form .panel-head.sub { border-top: 1px solid var(--line); padding-top: .8rem; padding-bottom: 0; }
.personal-form .panel-head.sub h3 { font-size: .95rem; margin: 0; color: var(--ink-2); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { flex: 1 1 150px; }
.filters .field.grow { flex: 3 1 240px; }
.filters > .btn, .filters > button { flex: none; }
.filters .check { min-height: 38px; }
.check { display: inline-flex; gap: .5rem; align-items: center; font-weight: 500; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; flex: none; accent-color: var(--blue); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 .3rem; font-size: .9rem; }
.grade-input { width: 5.5rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a .badge { margin-left: .25rem; }
.tabs a { padding: .6rem .85rem; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--blue-700); border-color: var(--blue); }
.panel-head .tabs { border: 0; margin: 0; }
.tab-panel[hidden] { display: none; }

/* ---------- Misc components ---------- */
.photo { width: 140px; height: 180px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; background: var(--grey-bg); display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 2.2rem; }
.photo-sm { width: 40px; height: 50px; border-radius: 8px; font-size: .9rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.checklist li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.tick { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: var(--grey-bg); color: var(--muted); border: 1px solid var(--line); flex: none; }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.declaration-text { white-space: pre-line; background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; max-height: 360px; overflow: auto; }
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; padding: .7rem 1.15rem; font-size: .85rem; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.timetable { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; align-items: start; }
.slot { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 9px; text-decoration: none; color: var(--ink); background: #fbfdff; }
.slot:hover { background: var(--blue-50); color: var(--ink); }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 1.5rem 0 .6rem; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(500px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-body { padding: 1.3rem 1.4rem .9rem; }
.dialog-body h2 { margin-bottom: .5rem; }
.dialog-foot { padding: .85rem 1.4rem; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: .5rem; background: #fafbfc; border-radius: 0 0 14px 14px; }

/* ---------- Sign-in pages ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(160deg, #e7f0fb, #f5f7fb 55%); }
.login-card { width: min(420px, 100%); }
.login-card .brand { justify-content: center; margin-bottom: 1.1rem; }
.login-card .brand img { height: 60px; }
.login-card .panel-head h1 { font-size: 1.3rem; }
.login-card .lang-form { justify-content: center; }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .no-print, footer.site, .btn, .step-foot, .tabs, .nav-scrim { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel, .step-card { box-shadow: none; break-inside: avoid; }
  .tab-panel[hidden] { display: block !important; }
  a { color: inherit; text-decoration: none; }
}
