:root {
  --bg: #08090b;
  --panel: #111317;
  --panel-2: #181b20;
  --panel-3: #20242b;
  --border: #2a2f37;
  --border-strong: #3b414b;
  --text: #f3f4f6;
  --muted: #9299a4;
  --silver: #c9ced6;
  --success: #3fb884;
  --danger: #e25555;
  --warn: #dba63f;
  --radius: 6px;
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", Arial, sans-serif;
  color-scheme: dark;
  --mono: Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--silver); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.en { font-family: var(--font); 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; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.center { text-align: center; }

/* ---------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px;
  background: var(--panel-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #292e36; border-color: #4a515d; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .option:focus-within {
  outline: 2px solid var(--silver); outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--silver); color: #0b0c0e; border-color: var(--silver); }
.btn-primary:hover { background: #e3e6ea; border-color: #e3e6ea; }
.btn-danger { color: #ffb4b4; border-color: #6b2e2e; background: #2a1517; }
.btn-danger:hover { background: #3a1b1e; border-color: #8a3a3a; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; font-size: 16px; }

label.field { display: grid; gap: 6px; align-content: start; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: #0c0d10; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--silver); outline: none; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--silver); }
.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: 12px; color: var(--muted); }
.error-text { color: #ff9c9c; font-size: 14px; min-height: 22px; }

/* ---------- surfaces */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-title h1 { font-size: 20px; letter-spacing: .1em; }
.section-title .sub { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 3px;
  border: 1px solid var(--border-strong); background: var(--panel-3); color: var(--silver);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.ok { color: #7fe0b4; border-color: #1f5c44; background: #10231c; }
.badge.bad { color: #ffa3a3; border-color: #6b2e2e; background: #2a1517; }
.badge.warn { color: #f1cc7c; border-color: #6a5220; background: #251e0f; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; border-inline-start: 3px solid var(--border-strong); }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12px; 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); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
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: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #14171b; }
td.wrap { white-space: normal; min-width: 260px; }
td.actions { text-align: end; }
td.actions .btn { margin-inline-start: 4px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.dim td { opacity: .55; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand img { width: 160px; height: 160px; object-fit: contain; }
.login-brand h1 { font-size: 22px; letter-spacing: .28em; margin-top: 12px; }
.login-note { margin-top: 14px; }
.hero { margin-bottom: 0; }
.login-brand p { color: var(--muted); font-size: 12px; letter-spacing: .2em; margin-top: 4px; }

/* ---------- trainee layout */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.topbar img { width: 36px; height: 36px; object-fit: contain; }
.topbar .brand { font-weight: 700; letter-spacing: .22em; font-size: 14px; }
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { font-size: 24px; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.notice { padding: 12px 14px; border: 1px solid var(--border-strong); border-inline-start: 3px solid var(--warn); background: var(--panel-2); border-radius: var(--radius); font-size: 14px; }
.notice.ok { border-inline-start-color: var(--success); }
.notice.bad { border-inline-start-color: var(--danger); }

/* ---------- handbook */
.handbook { display: grid; gap: 20px; grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.toc { position: sticky; top: 16px; display: grid; gap: 2px; padding: 12px; }
.toc a { display: block; padding: 7px 10px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 14px; }
.toc a:hover { background: var(--panel-2); color: var(--text); }
.hb-section { scroll-margin-top: 16px; }
.hb-section h2 { font-size: 18px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.hb-section h2 .n { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.hb-section p { margin-bottom: 10px; }
.hb-section ul { margin: 0 0 10px; padding-inline-start: 20px; }
.hb-section li { margin-bottom: 4px; }

/* ---------- exam */
.exam-shell { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.timer { font-family: var(--mono); font-size: 22px; font-weight: 700; padding: 4px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); direction: ltr; }
.timer.low { color: #ff9c9c; border-color: #6b2e2e; }
.progress { height: 6px; background: var(--panel-3); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.progress > div { height: 100%; width: 0; background: var(--silver); }
.question-text { font-size: 19px; font-weight: 600; margin-bottom: 18px; line-height: 1.7; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.option:hover { border-color: #5a626f; }
.option input { width: 18px; height: 18px; accent-color: var(--silver); flex: none; }
.option.selected { border-color: var(--silver); background: #22262d; }
.exam-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.dot { width: 32px; height: 32px; display: grid; place-items: center; font-size: 12px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--muted); cursor: pointer; font-family: var(--mono); }
.dot.answered { background: var(--panel-3); color: var(--text); border-color: #5a626f; }
.dot.current { outline: 2px solid var(--silver); outline-offset: 1px; }
.result-status { font-size: 30px; font-weight: 700; letter-spacing: .14em; margin: 14px 0 6px; }
.result-status.ok { color: var(--success); }
.result-status.bad { color: var(--danger); }
.result-status.warn { color: var(--warn); }

/* ---------- dashboard layout */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--panel); 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: 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-brand b { display: block; letter-spacing: .2em; font-size: 13px; }
.sidebar-brand span { font-size: 10px; color: var(--muted); letter-spacing: .22em; }
.nav { display: grid; gap: 2px; padding: 12px 10px; overflow-y: auto; }
.nav button {
  display: block; width: 100%; text-align: start; padding: 10px 12px; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .12em; cursor: pointer;
  border-inline-start: 2px solid transparent;
}
.nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button.active { background: var(--panel-3); color: var(--text); border-inline-start-color: var(--silver); }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--border); }
.main { min-width: 0; }
.main-head { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--panel); }
.owner-tag { text-align: end; line-height: 1.3; }
.owner-tag b { display: block; font-size: 11px; letter-spacing: .24em; color: var(--silver); }
.owner-tag span { font-family: var(--mono); font-size: 14px; text-transform: none; letter-spacing: 0; }
.main-body { padding: 24px; }
.menu-btn { display: none; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { max-width: 200px; }
.two-col { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); 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: var(--radius); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 860px; }
.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: 16px; }
.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: var(--radius); font-size: 14px; }
.toast.bad { border-inline-start-color: var(--danger); }

.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: 4px; border: 1px solid transparent; font-size: 14px; }
.review-opt.correct { border-color: #1f5c44; background: #10231c; }
.review-opt.wrong { border-color: #6b2e2e; background: #2a1517; }
.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: var(--radius); padding: 10px 12px; }
.kv span { display: block; font-size: 11px; color: var(--muted); }
.kv b { font-size: 15px; }
.sub-title { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin: 18px 0 8px; }

/* ---------- responsive */
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; z-index: 40; 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; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .question-text { font-size: 17px; }
  .exam-nav .btn { flex: 1; }
  .topbar { padding: 10px 14px; }
  .topbar .brand { font-size: 12px; letter-spacing: .14em; }
}

/* ====================================================================== UI v2 */

@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: #07080a;
  --panel: #0f1115;
  --panel-2: #15181d;
  --panel-3: #1d2128;
  --border: #23272f;
  --border-strong: #353b46;
  --text: #f4f5f7;
  --muted: #8d95a1;
  --silver: #d3d7de;
  --radius: 10px;
  --font: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .9);
}

body {
  background:
    radial-gradient(1100px 520px at 50% -180px, rgba(160, 172, 190, .13), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  background-attachment: fixed;
  font-size: 15.5px;
}
h1, h2, h3 { font-weight: 700; }

/* buttons */
.btn { min-height: 42px; border-radius: 8px; font-weight: 500; transition: background-color .12s, border-color .12s, color .12s; }
.btn-sm { min-height: 32px; border-radius: 6px; }
.btn-lg { min-height: 50px; }
.btn-primary { background: linear-gradient(#eef0f3, #c4c9d1); border-color: #dfe2e7; color: #0a0b0d; font-weight: 700; }
.btn-primary:hover { background: linear-gradient(#ffffff, #d6dae0); border-color: #fff; }
.btn-ghost { border-color: var(--border); }

/* inputs */
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  min-height: 42px; border-radius: 8px; background: #0a0b0e; border-color: var(--border-strong);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--silver); box-shadow: 0 0 0 3px rgba(211, 215, 222, .12); }
label.field { font-size: 13px; font-weight: 500; }

/* surfaces */
.card, .stat, .table-wrap, .modal, .wing, .review-q { box-shadow: var(--shadow); }
.card { background: linear-gradient(180deg, #12151a, var(--panel)); padding: 22px; }
.card-title { font-weight: 700; font-size: 11.5px; letter-spacing: .16em; color: var(--muted); }
.stat { background: linear-gradient(180deg, #12151a, var(--panel)); padding: 18px; border-inline-start-width: 3px; }
.stat .value { font-size: 30px; }
.badge { border-radius: 999px; padding: 2px 11px; font-weight: 500; }
th { font-weight: 700; }
tbody tr:hover td { background: #13161b; }
.notice { border-radius: 8px; }
.modal { box-shadow: 0 30px 80px -20px #000; }
.modal-backdrop { background: rgba(3, 4, 6, .78); backdrop-filter: blur(3px); }

/* top bars */
.topbar, .main-head { background: rgba(13, 15, 19, .86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar .brand { font-size: 13px; }

/* login */
.login-brand img { width: 150px; height: 150px; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .7)); }
.login-brand h1 { font-size: 24px; }
.login-box .card { padding: 26px; }

/* trainee home */
.hero h1 { font-size: 26px; }

/* exam */
.option { border-radius: 10px; padding: 15px 18px; transition: border-color .12s, background-color .12s; }
.option.selected { border-color: var(--silver); background: #20252d; box-shadow: 0 0 0 1px var(--silver) inset; }
.timer { border-radius: 8px; }
.progress { height: 8px; border-radius: 999px; }
.progress > div { border-radius: 999px; background: linear-gradient(90deg, #9aa2ad, #eef0f3); transition: width .2s; }
.dot { border-radius: 8px; }

/* dashboard */
.sidebar { background: linear-gradient(180deg, #0f1115, #0b0d10); }
.nav button { padding: 11px 14px; border-radius: 8px; border-inline-start-width: 3px; transition: background-color .12s, color .12s; }
.nav button.active { background: linear-gradient(90deg, rgba(211, 215, 222, .12), rgba(211, 215, 222, .03)); }
.section-title h1 { font-size: 22px; }

/* ---------- landing page (all wings) */
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(9, 10, 13, .7); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.site-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .24em; font-size: 13px; }
.site-mark i { width: 10px; height: 10px; background: var(--silver); transform: rotate(45deg); display: block; }
.landing { max-width: 1240px; margin: 0 auto; padding: 0 20px 64px; }
.landing-hero { text-align: center; padding: 64px 0 44px; }
.eyebrow { display: inline-block; font-size: 11.5px; letter-spacing: .3em; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 16px; margin-bottom: 20px; background: rgba(15, 17, 21, .7); }
.landing-hero h1 { font-size: clamp(34px, 6vw, 60px); letter-spacing: .2em; line-height: 1.1; background: linear-gradient(180deg, #ffffff 20%, #8f97a3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-hero .lead { color: var(--muted); font-size: 17px; margin-top: 16px; }
.hero-stats { display: inline-flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.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); }

.wings { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.wing {
  position: relative; flex: 1 1 210px; max-width: 232px; min-width: 200px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  background: linear-gradient(180deg, #13161b, #0d0f13); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px 18px 18px; overflow: hidden; transition: border-color .15s, transform .15s;
}
.wing::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--border-strong); }
.wing.on::before { background: linear-gradient(90deg, transparent, var(--success), transparent); }
.wing.on { border-color: #2d3a37; }
.wing.on:hover { border-color: #4b6b61; transform: translateY(-3px); }
.wing-num { position: absolute; top: 12px; inset-inline-start: 14px; font-family: var(--mono); font-size: 12px; color: #5d6470; }
.wing-emblem { width: 132px; height: 132px; display: grid; place-items: center; margin: 8px 0 12px; }
.wing-emblem img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .7)); }
.emblem-ph {
  width: 104px; height: 120px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 14%, 100% 56%, 50% 100%, 0 56%, 0 14%);
  background: linear-gradient(160deg, #2a2f38, #15181d); color: #6d7582; font-size: 42px; font-weight: 700;
}
.wing.off .wing-emblem img { filter: grayscale(1) brightness(.6); }
.wing h2 { font-size: 17px; letter-spacing: .18em; }
.wing .ar { font-size: 15px; color: var(--silver); }
.wing .desc { font-size: 13px; color: var(--muted); flex: 1; margin: 4px 0 12px; }
.wing-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; padding: 4px 13px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); margin: 8px 0 4px; }
.wing.on .wing-status { color: #7fe0b4; border-color: #1f5c44; background: #0e211a; }
.wing.off h2, .wing.off .ar { color: #7c8490; }
.wing.off button.btn { background: transparent; border-style: dashed; }
.landing-foot { text-align: center; margin-top: 44px; color: #5d6470; font-size: 12px; letter-spacing: .14em; }

@media (max-width: 560px) {
  .landing-hero { padding: 40px 0 30px; }
  .wing { max-width: none; }
  .site-bar { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* grid children must be allowed to shrink, otherwise a wide table stretches the whole page */
.stack { grid-template-columns: minmax(0, 1fr); }
.main-body > *, .two-col > *, .stack > * { min-width: 0; }

/* ---------- multi-wing dashboard and wing pages */
.wing-switch { display: grid; gap: 6px; padding: 12px 14px 4px; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }
.wing-switch select { min-height: 38px; font-size: 13px; }
.nav-group { padding: 12px 14px 4px; font-size: 10.5px; letter-spacing: .24em; color: #5d6470; }
.sidebar-foot { display: grid; gap: 6px; }
.sidebar-brand img.hidden + div { padding-inline-start: 0; }
.wing-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wing-hero img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .7)); }
.wing-hero h1 { font-size: 26px; }
ul.plain { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; font-size: 14px; }
td input[type=text] { min-height: 36px; min-width: 220px; }
.topbar img.hidden { display: none; }

/* very narrow screens */
.two-col { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar .brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wing-hero > .grow { min-width: 180px; }

/* staff posts: centered names */
.kv.posts div, .posts-table th, .posts-table td { text-align: center; }
.kv.posts b { display: block; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; background: var(--warn); color: #111; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.nav-count.hidden { display: none; }

/* ---------- landing: training staff board */
.staff-board { margin-top: 72px; }
.board-head { text-align: center; margin-bottom: 26px; }
.board-head h2 { font-size: 26px; margin-top: 4px; }
.board-head p { margin-top: 6px; }
.command { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 18px; }
.post { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.post.big { flex: 1 1 260px; max-width: 340px; padding: 20px 16px; background: linear-gradient(180deg, #161a20, #0f1115); box-shadow: var(--shadow); border-top: 2px solid var(--silver); }
.post-role { font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.post-name { font-size: 15px; }
.post.big .post-name { font-size: 19px; }
.post-code { font-size: 12.5px; color: var(--silver); }
.post.vacant .post-name { color: #5d6470; font-weight: 500; }
.wing-staff { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.wing-team { flex: 1 1 210px; max-width: 232px; display: grid; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(180deg, #13161b, #0d0f13); box-shadow: var(--shadow); }
.wing-team.off { opacity: .75; }
.team-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.team-head img { width: 40px; height: 40px; object-fit: contain; }
.team-ph { width: 36px; height: 40px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 14%, 100% 56%, 50% 100%, 0 56%, 0 14%); background: linear-gradient(160deg, #2a2f38, #15181d); color: #6d7582; font-weight: 700; }
.team-head h3 { font-size: 14px; letter-spacing: .14em; }
.team-head .muted { font-size: 12px; }
@media (max-width: 560px) { .wing-team { max-width: none; } }
