:root {
  color-scheme: dark;
  --bg: #0b1714;
  --bg-soft: #10231f;
  --surface: #142a25;
  --surface-2: #19332d;
  --surface-3: #203d36;
  --border: rgba(220, 255, 239, .11);
  --border-strong: rgba(220, 255, 239, .2);
  --text: #f5fbf8;
  --muted: #9eb5ad;
  --accent: #b8f36b;
  --coral: #ff9b77;
  --blue: #8ecdf3;
  --yellow: #f8d778;
  --danger: #ff827e;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 13px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { min-width: 320px; margin: 0; color: var(--text); background: radial-gradient(circle at 10% -5%, rgba(184,243,107,.1), transparent 28rem), radial-gradient(circle at 100% 25%, rgba(142,205,243,.07), transparent 32rem), var(--bg); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(184,243,107,.55); outline-offset: 3px; }
.eyebrow, .overline { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.overline { display: block; color: var(--muted); }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--accent); color: #14220d; box-shadow: 0 8px 24px rgba(184,243,107,.18); }
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.03em; }
.admin-brand > span:last-child { display: flex; }
.admin-brand strong { font-weight: 800; }
.admin-brand em { color: var(--accent); font-style: normal; font-weight: 800; }
.admin-login { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; overflow: hidden; }
.login-card { position: relative; z-index: 1; width: min(100%, 510px); padding: 43px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(25,51,45,.97), rgba(16,35,31,.97)); box-shadow: var(--shadow); }
.login-card .admin-brand { margin-bottom: 58px; }
.login-card h1 { max-width: 420px; margin: 14px 0; font-size: clamp(36px, 7vw, 56px); letter-spacing: -.065em; line-height: .96; }
.login-card > p { max-width: 400px; margin: 0 0 31px; color: var(--muted); }
.admin-login-form { display: grid; gap: 9px; }
.admin-login-form label { color: var(--muted); font-size: 12px; font-weight: 750; }
.admin-login-form input { width: 100%; padding: 12px 13px; border: 1px solid var(--border-strong); border-radius: 12px; outline: 0; background: rgba(11,23,20,.62); }
.admin-login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(184,243,107,.1); }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; border: 0; border-radius: 12px; background: var(--accent); color: #14220d; cursor: pointer; font-weight: 850; }
.primary-button:hover { background: #cafb88; transform: translateY(-1px); }
.message { min-height: 23px; margin: 2px 0 0; color: var(--danger); font-size: 13px; }
.login-grid { position: absolute; width: min(80vw, 720px); aspect-ratio: 1; border: 1px solid rgba(184,243,107,.08); border-radius: 50%; transform: translate(30%, 25%); }
.login-grid::before, .login-grid::after { position: absolute; inset: 13%; border: 1px solid rgba(142,205,243,.08); border-radius: 50%; content: ''; }
.login-grid::after { inset: 28%; border-color: rgba(255,155,119,.08); }
.login-grid i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 7px rgba(184,243,107,.08); }
.login-grid i:nth-child(1) { top: 16%; left: 22%; }
.login-grid i:nth-child(2) { right: 15%; bottom: 27%; background: var(--coral); }
.login-grid i:nth-child(3) { bottom: 10%; left: 42%; background: var(--blue); }
.admin-app { min-height: 100vh; }
.admin-header { display: flex; align-items: center; gap: 24px; width: min(calc(100% - 40px), 1300px); min-height: 78px; margin: auto; border-bottom: 1px solid var(--border); }
.header-title { display: flex; min-width: 0; flex-direction: column; margin-left: 20px; padding-left: 25px; border-left: 1px solid var(--border); }
.header-title span { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.header-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; gap: 8px; margin-left: auto; }
.quiet-button, .dialog-close { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--muted); cursor: pointer; }
.quiet-button { padding: 9px 12px; font-size: 12px; font-weight: 750; }
.quiet-button:hover { border-color: var(--border-strong); color: var(--text); }
.admin-main { width: min(calc(100% - 40px), 1300px); margin: auto; padding: 70px 0 100px; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.admin-intro h1 { max-width: 850px; margin: 13px 0 9px; font-size: clamp(38px, 6vw, 72px); letter-spacing: -.065em; line-height: .94; }
.admin-intro h1 span { color: var(--accent); }
.admin-intro p { max-width: 640px; margin: 0; color: var(--muted); font-size: 17px; }
.intro-mark { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.intro-mark i { display: block; width: 34px; height: 1px; background: var(--border-strong); }
.intro-mark span:first-child { color: var(--accent); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 150px; padding: 22px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(20,42,37,.75); }
.metric-card::after { position: absolute; right: -22px; bottom: -25px; width: 85px; height: 85px; border: 15px solid var(--metric-color, rgba(184,243,107,.12)); border-radius: 50%; opacity: .25; content: ''; }
.metric-card strong { display: block; margin-top: 20px; font-size: 36px; letter-spacing: -.06em; line-height: 1; }
.metric-card small { color: var(--muted); }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(20,42,37,.78); box-shadow: var(--shadow); }
.roster-panel { min-height: 440px; padding: 29px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel h2 { margin: 6px 0 0; font-size: 25px; letter-spacing: -.045em; }
.count-badge { padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 750; }
.trainee-list { display: grid; gap: 8px; }
.trainee-row { display: grid; grid-template-columns: minmax(170px, 1.4fr) minmax(115px, .8fr) minmax(115px, .8fr) auto; align-items: center; gap: 14px; width: 100%; padding: 15px 13px; border: 1px solid transparent; border-radius: 15px; background: rgba(255,255,255,.025); text-align: left; }
.trainee-row:hover { border-color: var(--border-strong); background: rgba(255,255,255,.04); }
.trainee-name { display: flex; min-width: 0; align-items: center; gap: 11px; }
.trainee-name > span:last-child { min-width: 0; text-align: left; }
.avatar { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: rgba(184,243,107,.14); color: var(--accent); font-size: 12px; font-weight: 850; }
.trainee-name strong, .trainee-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trainee-name small, .trainee-meta small { color: var(--muted); font-size: 11px; }
.trainee-meta { color: var(--text); font-size: 13px; }
.progress-line { display: flex; align-items: center; gap: 9px; }
.progress-line > span { width: 34px; color: var(--accent); font-size: 12px; font-weight: 850; }
.meter { display: block; width: 75px; height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.status { padding: 4px 7px; border-radius: 7px; background: rgba(184,243,107,.1); color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.status.idle { background: rgba(255,155,119,.1); color: var(--coral); }
.status.off { background: rgba(158,181,173,.1); color: var(--muted); }
.empty-roster { display: grid; min-height: 270px; place-items: center; padding: 35px; border: 1px dashed var(--border-strong); border-radius: 16px; color: var(--muted); text-align: center; }
.empty-roster strong { display: block; margin-bottom: 5px; color: var(--text); }
.trainee-dialog { width: min(calc(100% - 30px), 700px); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.trainee-dialog::backdrop { background: rgba(4,10,8,.78); backdrop-filter: blur(5px); }
.dialog-inner { position: relative; padding: 34px; }
.dialog-close { position: absolute; top: 17px; right: 17px; width: 34px; height: 34px; font-size: 22px; line-height: 1; }
.detail-heading { padding-right: 38px; }
.detail-heading h2 { margin: 8px 0 2px; font-size: 34px; letter-spacing: -.06em; }
.detail-heading p { margin: 0; color: var(--muted); }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 27px 0; }
.detail-stat { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.detail-stat strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.detail-stat small { color: var(--muted); font-size: 11px; }
.module-progress-list { display: grid; gap: 12px; }
.module-progress-row { display: grid; grid-template-columns: minmax(145px, 1fr) 1fr 43px; align-items: center; gap: 12px; }
.module-progress-row > span:first-child { font-size: 12px; }
.module-progress-row .meter { width: 100%; height: 7px; }
.module-progress-row > strong { color: var(--accent); font-size: 12px; text-align: right; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.detail-footer small { color: var(--muted); }
.danger-button { border: 1px solid rgba(255,130,126,.25); border-radius: 10px; background: transparent; color: var(--danger); cursor: pointer; padding: 8px 10px; font-size: 11px; font-weight: 750; }

@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .admin-header, .admin-main { width: min(calc(100% - 28px), 1300px); }
  .admin-header { gap: 10px; }
  .header-title { display: none; }
  .quiet-button { padding: 8px 9px; font-size: 11px; }
  .admin-main { padding-top: 45px; }
  .admin-intro { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
  .intro-mark { display: none; }
  .admin-intro h1 { font-size: clamp(39px, 12vw, 60px); }
  .admin-intro p { font-size: 15px; }
  .roster-panel { padding: 22px 16px; }
  .trainee-row { grid-template-columns: 1fr auto; }
  .trainee-meta { display: none; }
  .progress-line { justify-content: flex-end; }
  .status { grid-column: 2; grid-row: 2; justify-self: end; }
  .login-card { padding: 29px 24px; }
  .login-card .admin-brand { margin-bottom: 42px; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
  .module-progress-row { grid-template-columns: 1fr 43px; gap: 6px 12px; }
  .module-progress-row .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; } }
