/* POLICE ACADEMY — navy, silver and gold, taken from the academy seal. */

@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/plex-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/plex-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/fonts/plex-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/plex-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/plex-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/fonts/plex-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #050a17;
  --panel: #0a1226;
  --panel-2: #0f1a33;
  --panel-3: #172647;
  --border: #1a294d;
  --border-strong: #2b3f6e;
  --text: #f1f4fa;
  --muted: #8e9cba;
  --silver: #cdd5e3;
  --gold: #d2aa5a;
  --gold-light: #f0d695;
  --success: #3fb884;
  --danger: #e35d5d;
  --warn: #e0a83a;
  --radius: 10px;
  --font: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 14px 34px -20px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 560px at 50% -200px, rgba(64, 104, 196, .22), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .016) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px) 0 0 / 46px 100%,
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  /* A column, so the footer sits at the bottom of the window even when the page is short. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > main, body > .admin { flex: 1 0 auto; width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
a { color: var(--gold-light); }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold-light); }
.en { letter-spacing: .14em; text-transform: uppercase; direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.center { text-align: center; }
.row.center { justify-content: center; }
.between { justify-content: space-between; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px;
  background: var(--panel-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s, transform .12s;
}
.btn:hover { background: #1e3160; border-color: #3d5591; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .option:focus-within, a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(#f3dca0, #c99b46); border-color: #e6c67c; color: #14100a; font-weight: 700; }
.btn-primary:hover { background: linear-gradient(#fbe9b9, #d8ab57); border-color: #f4dc9c; }
.btn-danger { color: #ffb4b4; border-color: #6b2e2e; background: #2a1517; }
.btn-danger:hover { background: #3a1b1e; border-color: #8a3a3a; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { min-height: 52px; padding: 10px 28px; font-size: 16.5px; }
.btn-block { width: 100%; }

label.field { display: grid; gap: 6px; align-content: start; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: #070d1c; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font: inherit; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
textarea.tall { min-height: 260px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(210, 170, 90, .14); outline: none; }
input[type=file] { color: var(--muted); font: inherit; font-size: 13px; }
input[type=file]::file-selector-button { margin-inline-end: 10px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel-3); color: var(--text); font: inherit; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--gold); flex: none; }
.form-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.error-text { color: #ff9c9c; font-size: 14px; min-height: 22px; }

/* ---------- surfaces */
.card {
  background: linear-gradient(180deg, #0d1730, var(--panel)); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.section-title h1 { font-size: 22px; }
.section-title .sub { color: var(--muted); font-size: 13.5px; }
.sub-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel-3); color: var(--silver);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.ok { color: #7fe0b4; border-color: #1f5c44; background: #0f231d; }
.badge.bad { color: #ffa3a3; border-color: #6b2e2e; background: #2a1517; }
.badge.warn { color: #f1cc7c; border-color: #6a5220; background: #251e0f; }
.badge.gold { color: #14100a; border-color: #e6c67c; background: linear-gradient(#f3dca0, #c99b46); font-weight: 700; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
  background: linear-gradient(180deg, #0d1730, var(--panel)); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; border-inline-start: 3px solid var(--border-strong); box-shadow: var(--shadow);
}
.stat .value { font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat.ok { border-inline-start-color: var(--success); }
.stat.bad { border-inline-start-color: var(--danger); }
.stat.warn { border-inline-start-color: var(--warn); }
.stat.gold { border-inline-start-color: var(--gold); }
button.stat { text-align: start; color: inherit; font: inherit; cursor: pointer; }
button.stat:hover { border-color: var(--border-strong); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #0e1830; }
td.wrap { white-space: normal; min-width: 240px; }
td.actions { text-align: end; }
td.actions .btn { margin-inline-start: 4px; }
td input[type=text] { min-height: 36px; min-width: 160px; }
td select { min-height: 36px; min-width: 120px; }
.dim td { opacity: .55; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.notice { padding: 12px 14px; border: 1px solid var(--border-strong); border-inline-start: 3px solid var(--warn); background: var(--panel-2); border-radius: 8px; font-size: 14px; }
.notice.ok { border-inline-start-color: var(--success); }
.notice.bad { border-inline-start-color: var(--danger); }
.notice.gold { border-inline-start-color: var(--gold); }
.notice ul { margin: 6px 0 0; padding-inline-start: 20px; }
.notice li { margin-bottom: 3px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kv div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.kv > div > span { display: block; font-size: 11.5px; color: var(--muted); }
.kv b { font-size: 15px; font-weight: 700; }
ul.plain { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.two-col { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.two-col.roomy { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); }
.two-col > *, .stack > * { min-width: 0; }

/* ---------- landing page */
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: rgba(5, 10, 23, .78); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.site-mark { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.site-bar .row { flex-wrap: nowrap; }
.site-mark img { width: 40px; height: 40px; object-fit: contain; }
.site-mark b { color: var(--gold-light); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.site-nav a:hover { color: var(--text); background: var(--panel-2); }

.landing { max-width: 1140px; margin: 0 auto; padding: 0 20px 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center; padding: 64px 0 48px; }
.eyebrow { display: inline-block; font-size: 11.5px; letter-spacing: .28em; color: var(--gold-light); border: 1px solid #4a3d1d; border-radius: 999px; padding: 5px 16px; margin-bottom: 18px; background: rgba(210, 170, 90, .08); }
.hero h1 { font-size: clamp(36px, 6vw, 62px); letter-spacing: .1em; line-height: 1.08; background: linear-gradient(180deg, #ffffff 25%, #93a4c9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--silver); font-size: 18px; margin-top: 16px; max-width: 520px; }
.hero-actions { margin-top: 26px; }
.hero-stats { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--silver); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.pulse.on { background: var(--success); box-shadow: 0 0 0 4px rgba(63, 184, 132, .18); }
.pulse.off { background: var(--danger); }
.hero-emblem { display: grid; place-items: center; position: relative; }
.hero-emblem::before { content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(70, 112, 210, .38), transparent 68%); }
.hero-emblem img { position: relative; width: min(100%, 400px); height: auto; filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .65)); }

.section { padding: 48px 0 8px; scroll-margin-top: 70px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h1, .section-head h2 { font-size: 28px; }
.section-head p { margin-top: 6px; }

/* public roster: one block per rank, the same layout as the department's own roster */
.roster { max-width: 1060px; margin-inline: auto; }
.rank-group { margin-bottom: 20px; border: 1px solid #1c3a86; border-radius: 6px; overflow: hidden; background: #0d1832; box-shadow: var(--shadow); }
.rank-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 18px;
  background: linear-gradient(270deg, #0f1b39 35%, #262d3d 72%, #3b3a2e); border-bottom: 2px solid #e8c53c;
}
[dir=ltr] .rank-head { background: linear-gradient(90deg, #0f1b39 35%, #262d3d 72%, #3b3a2e); }
.rank-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-name img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.rank-name h2 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-count { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 10px; border-radius: 999px; background: #e8c53c; color: #1a1606; font-size: 12px; font-weight: 700; flex: none; }
.rank-table { table-layout: fixed; font-size: 15px; }
.rank-table th, .rank-table td { padding: 11px 10px; border-bottom: 1px solid #1a2c58; overflow: hidden; text-overflow: ellipsis; }
.rank-table th { background: transparent; color: #8c9bbb; font-size: 14px; font-weight: 500; }
.rank-table th:nth-child(1) { width: 14%; }
.rank-table th:nth-child(2) { width: 44%; }
.rank-table td { font-weight: 700; }
.rank-table td.unit { color: #f0c53a; direction: ltr; text-align: right; }
[dir=ltr] .rank-table td.unit { text-align: left; }
.rank-table tbody tr:hover td { background: #101e3e; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: step; }
.step {
  position: relative; counter-increment: step; padding: 22px 20px 20px;
  background: linear-gradient(180deg, #0e1934, #0a1226); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.step::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 50%; border: 1px solid #5a4a22; background: rgba(210, 170, 90, .12); color: var(--gold-light); font-weight: 700; font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }
.step .rank { margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.facts div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; }
.facts b { display: block; font-size: 24px; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.facts span { font-size: 12.5px; color: var(--muted); }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card h3:not(:first-child) { margin-top: 20px; }

.board { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.post { flex: 1 1 230px; max-width: 300px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 14px; border-radius: 12px; background: linear-gradient(180deg, #0e1934, #0a1226); border: 1px solid var(--border); box-shadow: var(--shadow); }
.post.top { border-top: 2px solid var(--gold); }
.post-role { font-size: 10.5px; letter-spacing: .12em; color: var(--gold-light); }
.post-role-ar { font-size: 12.5px; color: var(--muted); }
.post-name { font-size: 16px; font-weight: 700; }
.cta { margin-top: 56px; text-align: center; padding: 40px 20px; border: 1px solid #3d3319; border-radius: 16px; background: radial-gradient(600px 220px at 50% 0, rgba(210, 170, 90, .16), transparent 70%), var(--panel); }
.cta h2 { font-size: 26px; margin-bottom: 8px; }
.cta .btn { margin-top: 20px; }
/* The same footer on every page: the academy's line, and under it who made the site. */
.site-foot { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 16px; color: #56648a; font-size: 12px; border-top: 1px solid var(--border); }
.site-foot .credit { letter-spacing: .08em; }
.site-foot .credit a { color: var(--gold-light); font-weight: 500; text-decoration: none; }
.site-foot .credit a:hover { text-decoration: underline; }

/* ---------- login and application */
.auth-page { display: grid; place-items: center; padding: 28px 16px; }
.auth-box { width: 100%; max-width: 440px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .7)); }
.auth-brand h1 { font-size: 22px; letter-spacing: .2em; margin-top: 8px; }
.auth-brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.auth-note { margin-top: 14px; }

/* ---------- applicant pages */
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: rgba(8, 14, 30, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar img { width: 38px; height: 38px; object-fit: contain; }
.topbar .brand { font-weight: 700; font-size: 13px; }
.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px 56px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome h1 { font-size: 25px; }

.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.stepper li { position: relative; text-align: center; font-size: 13px; color: var(--muted); padding-top: 40px; }
.stepper li::before {
  content: attr(data-n); position: absolute; top: 0; inset-inline-start: 50%; transform: translateX(50%);
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--muted); font-size: 13px; font-weight: 700; z-index: 1;
}
[dir=ltr] .stepper li::before { transform: translateX(-50%); }
.stepper li::after { content: ""; position: absolute; top: 14px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--border-strong); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--silver); }
.stepper li.done::before { content: "✓"; background: #10271f; border-color: #1f5c44; color: #7fe0b4; }
.stepper li.done::after, .stepper li.current::after { background: var(--success); }
.stepper li.current { color: var(--text); font-weight: 700; }
.stepper li.current::before { background: linear-gradient(#f3dca0, #c99b46); border-color: #e6c67c; color: #14100a; box-shadow: 0 0 0 4px rgba(210, 170, 90, .16); }
.stepper li.failed::before { content: "×"; background: #2a1517; border-color: #6b2e2e; color: #ffa3a3; }

.next-card { border-color: #3d3319; background: radial-gradient(520px 200px at 100% 0, rgba(210, 170, 90, .12), transparent 70%), linear-gradient(180deg, #0d1730, var(--panel)); }
.next-card h2 { font-size: 21px; margin-bottom: 6px; }
.next-card .row { margin-top: 16px; }
.meter { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #b88a3b, #f0d695); transition: width .25s; }

.session { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.session-head h3 { font-size: 16.5px; }
.session-when { font-size: 14px; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.session-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.uniform { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: #0a1226; }
.uniform img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.uniform b { font-size: 14px; }
.uniform ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; color: var(--silver); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 18px 16px 0; border-inline-start: 2px solid var(--border-strong); margin-inline-start: 6px; padding-inline-start: 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; top: 6px; inset-inline-start: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }
.timeline li:last-child { padding-bottom: 0; }
.timeline time { display: block; font-size: 12px; color: var(--muted); }

/* ---------- handbook */
.handbook { display: grid; gap: 20px; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.toc { position: sticky; top: 76px; display: grid; gap: 2px; padding: 12px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc a, .toc button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); text-decoration: none; font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.toc a:hover, .toc button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.toc button:disabled { cursor: not-allowed; opacity: .55; }
.toc .active { background: var(--panel-3); color: var(--text); }
.toc .tick { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 11px; color: transparent; }
.toc .read .tick { background: #10271f; border-color: #1f5c44; color: #7fe0b4; }
.hb-section { scroll-margin-top: 80px; }
.hb-section h2 { font-size: 20px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.hb-section h2 .n { color: var(--gold-light); font-family: var(--mono); font-size: 14px; }
.hb-section h3 { font-size: 16px; margin: 16px 0 8px; color: var(--gold-light); }
.hb-section p { margin-bottom: 10px; }
.hb-section ul { margin: 0 0 10px; padding-inline-start: 22px; }
.hb-section li { margin-bottom: 5px; }
.reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- written exam */
.exam-shell { max-width: 780px; margin: 0 auto; padding: 22px 16px 56px; -webkit-user-select: none; user-select: none; }
.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.exam-count { font-size: 15px; font-weight: 700; }
.timer { font-family: var(--mono); font-size: 22px; font-weight: 700; padding: 4px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); direction: ltr; min-width: 86px; text-align: center; }
.timer.low { color: #ff9c9c; border-color: #6b2e2e; }
.progress { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.progress > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #b88a3b, #f0d695); transition: width .2s; }
.strikes { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.strikes i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--panel-3); display: inline-block; }
.strikes i.on { background: var(--danger); border-color: #ff8f8f; }
.question-text { font-size: 19.5px; font-weight: 700; margin-bottom: 18px; line-height: 1.7; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .12s, background-color .12s;
}
.option:hover { border-color: #4d68ab; }
.option input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.option.selected { border-color: var(--gold); background: #1a2646; box-shadow: 0 0 0 1px var(--gold) inset; }
.exam-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.result-status { font-size: 30px; font-weight: 700; letter-spacing: .1em; margin: 10px 0 6px; }
.result-status.ok { color: var(--success); }
.result-status.bad { color: var(--danger); }
.result-status.warn { color: var(--warn); }
.result-score { font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.violations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: start; }
.violations li { padding: 10px 14px; border: 1px solid #6b2e2e; border-radius: 8px; background: #1d1014; font-size: 14px; }
.violations li.soft { border-color: var(--border-strong); background: var(--panel-2); }
.violations b { display: block; }
.violations span { color: var(--muted); font-size: 13px; }
:fullscreen { background: var(--bg); overflow-y: auto; }

/* ---------- dashboard */
.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0a1226, #070d1c); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { width: 44px; height: 44px; object-fit: contain; }
.sidebar-brand b { display: block; font-size: 13px; }
.sidebar-brand span { font-size: 10.5px; color: var(--gold-light); }
.nav { display: grid; gap: 2px; padding: 10px; overflow-y: auto; }
.nav-group { padding: 12px 12px 4px; font-size: 11.5px; font-weight: 700; color: #56648a; }
.nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: start; padding: 10px 12px;
  border: 0; border-radius: 8px; border-inline-start: 3px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .12s, color .12s;
}
.nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button.active { background: linear-gradient(90deg, rgba(210, 170, 90, .16), rgba(210, 170, 90, .03)); color: var(--text); border-inline-start-color: var(--gold); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn); color: #111; font-size: 11px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main-head { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: rgba(8, 14, 30, .86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.who { text-align: end; line-height: 1.3; }
.who b { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--gold-light); }
.who span { font-size: 14px; }
.main-body { padding: 24px; flex: 1 0 auto; }
.main-body > * { min-width: 0; }
.menu-btn { display: none; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { max-width: 220px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { padding: 9px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: start; white-space: normal; min-width: 240px; }
.perm-table input { width: 18px; height: 18px; accent-color: var(--gold); }
.section-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.section-row .n { font-family: var(--mono); color: var(--gold-light); width: 26px; }

/* practical exam sheet */
.sheet { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
.sheet-question { font-size: 21px; font-weight: 700; line-height: 1.7; }
.model-answer { padding: 12px 14px; border-radius: 8px; border: 1px dashed #5a4a22; background: rgba(210, 170, 90, .07); font-size: 14.5px; }
.model-answer span { display: block; font-size: 12px; color: var(--gold-light); margin-bottom: 4px; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { padding: 14px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.choice:hover { border-color: #4d68ab; }
.choice.on.answered { background: #10271f; border-color: var(--success); color: #7fe0b4; }
.choice.on.not_answered { background: #2a1517; border-color: var(--danger); color: #ffa3a3; }
.choice.on.other { background: #251e0f; border-color: var(--warn); color: #f1cc7c; }
.sheet-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sheet-dot { height: 36px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.sheet-dot.answered { background: #10271f; border-color: #1f5c44; color: #7fe0b4; }
.sheet-dot.not_answered { background: #2a1517; border-color: #6b2e2e; color: #ffa3a3; }
.sheet-dot.other { background: #251e0f; border-color: #6a5220; color: #f1cc7c; }
.sheet-dot.current { outline: 2px solid var(--gold); outline-offset: 1px; }

.review-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--panel-2); }
.review-q h3 { font-size: 15px; margin-bottom: 10px; line-height: 1.6; }
.review-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; }
.review-opt.correct { border-color: #1f5c44; background: #0f231d; }
.review-opt.wrong { border-color: #6b2e2e; background: #2a1517; }
.logo-preview { display: grid; place-items: center; min-height: 140px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: #070d1c; }
.logo-preview img { max-width: 180px; max-height: 180px; object-fit: contain; border-radius: 8px; }

/* ---------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 5, 12, .8); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px #000; }
.modal.wide { max-width: 940px; }
.modal.alert { border-color: #8a3a3a; box-shadow: 0 0 0 4px rgba(227, 93, 93, .16), 0 30px 80px -20px #000; }
.modal.alert .modal-head h2 { color: #ffa3a3; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-close { background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: grid; gap: 8px; z-index: 60; max-width: calc(100vw - 36px); }
.toast { padding: 10px 16px; background: var(--panel-3); border: 1px solid var(--border-strong); border-inline-start: 3px solid var(--success); border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); }
.toast.bad { border-inline-start-color: var(--danger); }

/* ---------- responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 40px 0 28px; }
  .hero .lead { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-emblem { order: -1; }
  .hero-emblem img { width: min(70%, 260px); }
  .site-nav { display: none; }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 40; transform: translateX(100%); transition: transform .18s; }
  [dir=ltr] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main-head { padding: 10px 16px; }
  .main-body { padding: 16px; }
  .handbook { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
  .sheet { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-grid, .facts { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: 1fr; gap: 0; }
  .stepper li { text-align: start; padding: 4px 44px 14px 0; min-height: 40px; }
  [dir=ltr] .stepper li { padding: 4px 0 14px 44px; }
  .stepper li::before { inset-inline-start: 0; transform: none; }
  [dir=ltr] .stepper li::before { transform: none; }
  .stepper li::after { top: -12px; inset-inline-start: 14px; inset-inline-end: auto; width: 2px; height: 16px; }
  .question-text { font-size: 17.5px; }
  .exam-nav .btn { flex: 1; }
  .site-bar, .topbar { padding: 10px 14px; }
  /* On a phone the seal alone carries the brand: the name is in the hero right below. */
  .site-mark span { display: none; }
  .choice-row { grid-template-columns: 1fr; }
  /* The unit code needs more of a narrow screen than it does of a wide one. */
  .rank-table { font-size: 14px; }
  .rank-table th:nth-child(1) { width: 24%; }
  .rank-table th:nth-child(2) { width: 40%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .exam-shell { display: none; } }

/* transfer evidence */
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.evidence-tile { display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); min-width: 0; }
.evidence-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: #060b18; overflow: hidden; cursor: zoom-in; }
.evidence-frame:hover { border-color: var(--gold); }
.evidence-frame img, .evidence-frame video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.evidence-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(6, 11, 24, .78); border: 1px solid var(--border-strong); color: #fff; font-size: 16px; }
.evidence-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.evidence-full { display: grid; gap: 12px; }
.evidence-full img, .evidence-full video { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; background: #060b18; }

/* a person's file in the dashboard */
.profile-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.profile-head h3 { font-size: 20px; margin: 0 0 4px; }
.profile-head .hint span { unicode-bidi: isolate; }
.profile-block { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .015); }
.profile-block > .row.between { align-items: center; }
.profile-block h4 { margin: 0; font-size: 15px; }
.kv b { overflow-wrap: anywhere; }

/* Outfit sheet: the slots of a uniform with their numbers, and the picture beside them. */
.outfit { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.outfit-table { width: 290px; max-width: 100%; border: 1px solid var(--border-strong); border-radius: 18px; overflow: hidden; background: var(--panel); direction: ltr; }
.outfit-head { padding: 16px 12px; text-align: center; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(210, 170, 90, .30), rgba(23, 38, 71, .95)); }
.outfit-head small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.outfit-slot { padding: 8px 10px; text-align: center; font-size: 13px; font-weight: 700; background: #0b1530; border-top: 1px solid var(--border); }
.outfit-cells { display: grid; grid-template-columns: 1fr 1fr; }
.outfit-cells span { padding: 9px 6px; text-align: center; font-size: 13px; background: var(--panel-2); border-top: 1px solid var(--border); }
.outfit-cells span + span { border-inline-start: 1px solid var(--border); }
.outfit-row:nth-child(even) .outfit-cells span { background: var(--panel-3); }
.outfit-photo { width: 270px; max-width: 100%; max-height: 460px; object-fit: cover; border-radius: 16px; border: 1px solid var(--border-strong); }
.outfit-notes { flex-basis: 100%; margin: 0; padding-inline-start: 18px; font-size: 13px; color: var(--silver); }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 620px), 1fr)); }
.slot-grid { display: grid; gap: 6px; }
.slot-row { display: grid; grid-template-columns: 130px 1fr 1fr; gap: 8px; align-items: center; }
.slot-cell { display: grid; grid-template-columns: 96px 1fr; gap: 6px; }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr; } }
.card.exam-outfit { border-color: var(--gold, #d4a24c); box-shadow: 0 0 0 1px rgba(212, 162, 76, .35); }
