/* =====================================================================
   СВІТЛОФОР · доповнення: адмін-панель, графіки, сертифікати, ролі
   ===================================================================== */

.container.wide { max-width: 1440px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-text { color: var(--green-dark); }
.bad-text { color: var(--red); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.section-title h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title h2 svg { width: 22px; height: 22px; color: var(--muted); }
.card h2 svg, .card h3 svg { color: var(--muted); }
.hint-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--muted); font-size: .86rem; }
.hint-box svg { width: 18px; height: 18px; margin-top: 1px; }
.progress.red > div { background: var(--red); }
.progress.yellow > div { background: #e5c400; }
.badge.glass { background: rgba(255, 255, 255, .13); color: #fff; backdrop-filter: blur(6px); }
.tiny-badge { font-size: .66rem; padding: 2px 7px; }
.avatar.sm { width: 28px; height: 28px; font-size: .66rem; margin: 0; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.6rem; margin: 0; padding: 3px; }
@media print { .no-print { display: none !important; } }

/* ---------------------------------------------------------- admin layout */
.admin-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: calc(var(--header-h) + 20px); background: var(--ink); color: #fff; border-radius: 22px; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; min-height: calc(100vh - var(--header-h) - 48px); overflow: hidden; }
.side::after { content: ""; position: absolute; left: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(var(--green), transparent 70%); opacity: .25; pointer-events: none; }
.side-user { display: flex; gap: 10px; align-items: center; padding: 8px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-user .avatar { margin: 0; }
.side-user .muted { color: #9aa0ad; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #c3c7d0; font-weight: 600; font-size: .92rem; position: relative; transition: background .2s, color .2s; }
.side a svg { width: 19px; height: 19px; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side a.active { background: #fff; color: var(--ink); }
.side a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; position: relative; z-index: 1; }
.admin-main { min-width: 0; }
.admin-main > .page-head { margin-bottom: 20px; }

/* ---------------------------------------------------------- KPI */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); margin-bottom: 20px; }
.kpis .kpi { padding-left: 16px; padding-right: 16px; min-width: 0; container-type: inline-size; }
/* розмір числа підлаштовується під ширину плитки, щоб «9,6 год» завжди вміщалось */
.kpis .kpi-v { font-size: clamp(1.15rem, 17cqi, 1.9rem); white-space: nowrap; }
.kpis .kpi-v small { font-size: .62em; font-weight: 600; margin-left: 2px; }
.topbar-inner { max-width: 1440px; }
.admin-layout > * { min-width: 0; }
.cert-seal .tl i { animation: none !important; opacity: 1 !important; filter: none !important; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--fg); margin-bottom: 12px; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi.green .kpi-ico { background: var(--green-soft); color: var(--green-dark); }
.kpi.red .kpi-ico { background: var(--red-soft); color: var(--red); }
.kpi.yellow .kpi-ico { background: var(--yellow-soft); color: var(--yellow-ink); }
.kpi-v { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.kpi-l { color: var(--muted); font-weight: 600; font-size: .85rem; margin-top: 4px; }
.kpi-s { font-size: .78rem; color: var(--dim); margin-top: 6px; }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.dash-grid > .card { margin: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.card-title h3 { margin: 0; }

/* ---------------------------------------------------------- charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.base-line { stroke: var(--line-strong); stroke-width: 1; }
.axis-label { fill: var(--dim); font-size: 11px; font-family: var(--font-body); }
.bar-mark { transform-origin: bottom; transform-box: fill-box; animation: growUp .7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.hit { fill: transparent; cursor: crosshair; }
.hit.on { fill: rgba(21, 23, 29, .05); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .8rem; line-height: 1.45; white-space: nowrap; box-shadow: var(--shadow-lg); z-index: 5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.course-stats { display: flex; flex-direction: column; gap: 14px; }
.cs-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) 2fr 48px; gap: 14px; align-items: center; }
.cs-title { display: flex; flex-direction: column; min-width: 0; }
.cs-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-pct { text-align: right; font-family: var(--font-display); font-size: .95rem; }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg); gap: 2px; }
.stack i { display: block; height: 100%; transition: width 1s var(--ease); }
.stack i:first-child { border-radius: 999px 0 0 999px; }

.leaderboard { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.leaderboard a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: inherit; transition: background .2s; }
.leaderboard a:hover { background: var(--bg); text-decoration: none; }
.leaderboard .place { width: 26px; text-align: center; font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.leaderboard .person { flex: 1; min-width: 0; }
.lb-score { display: flex; flex-direction: column; align-items: flex-end; }
.lb-score b { font-family: var(--font-display); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: none; }
.feed .light { margin-top: 6px; }
.feed .grow { flex: 1; min-width: 0; font-size: .9rem; }
.feed a { color: var(--fg); }
.reviews { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.review { margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.review p { margin: 8px 0; font-size: .95rem; }
.review footer { font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------- stars / rating */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars i svg { width: 16px; height: 16px; color: var(--line-strong); fill: var(--line-strong); }
.stars i.on svg { color: #f5b301; fill: #f5b301; }
.stars.sm i svg { width: 13px; height: 13px; }
.rating-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: .82rem; color: var(--ink); background: var(--yellow-soft); padding: 3px 8px; border-radius: 999px; flex: none; }
.rating-chip svg { width: 13px; height: 13px; color: #f5b301; fill: #f5b301; }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { background: none; border: none; padding: 2px; cursor: pointer; transition: transform .15s var(--ease); }
.star-input button:hover { transform: scale(1.18); }
.star-input svg { width: 32px; height: 32px; color: var(--line-strong); fill: transparent; transition: all .15s; }
.star-input button.on svg { color: #f5b301; fill: #f5b301; }
.rate-card { margin-top: 18px; background: linear-gradient(135deg, var(--yellow-soft), var(--surface) 60%); }
.cert-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); flex: none; }
.cert-ico svg { width: 22px; height: 22px; }
.cert-ico.big { width: 56px; height: 56px; border-radius: 18px; }
.cert-ico.big svg { width: 28px; height: 28px; }
.teachers { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------- announcements */
.announce-list { display: flex; flex-direction: column; gap: 10px; }
.announce { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid #6b8af0; }
.announce.ok { border-left-color: var(--green); }
.announce.warn { border-left-color: var(--yellow); }
.announce.danger { border-left-color: var(--red); }
.announce-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #eef2ff; color: #3d5bd9; flex: none; }
.announce.ok .announce-ico { background: var(--green-soft); color: var(--green-dark); }
.announce.warn .announce-ico { background: var(--yellow-soft); color: var(--yellow-ink); }
.announce.danger .announce-ico { background: var(--red-soft); color: var(--red); }
.announce-ico svg { width: 19px; height: 19px; }
.announce .grow { flex: 1; min-width: 0; }
.announce-body { margin: 4px 0 6px; white-space: pre-wrap; color: var(--text); }
.announce-admin { display: flex; gap: 10px; align-items: flex-start; }
.announce-admin .announce { flex: 1; }

/* ---------------------------------------------------------- списки пройдених курсів */
.cert-list { display: flex; flex-direction: column; gap: 8px; }
.cert-item { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: inherit; transition: all .2s var(--ease); }
.cert-item:hover { border-color: var(--fg); text-decoration: none; transform: translateX(3px); }
.cert-item .grow { flex: 1; display: flex; flex-direction: column; }
.cert-strip { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cert-mini { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); background: var(--ink); color: #fff; position: relative; overflow: hidden; transition: transform .3s var(--ease); }
.cert-mini::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(var(--yellow), transparent 70%); opacity: .35; }
.cert-mini:hover { transform: translateY(-4px); text-decoration: none; }
.cert-mini .muted { color: #9aa0ad; }


/* друк карток з логінами (одна картка або аркуш карток після імпорту) */
.cred-sheet, .cred-sheet-print { display: none; }
.cred-mini { position: relative; border: 1px dashed #9aa0ad; border-radius: 10px; padding: 16px 14px 12px; break-inside: avoid; display: flex; flex-direction: column; gap: 3px; font-size: 12px; overflow: hidden; }
.cred-mini > b { font-size: 14px; }
.cred-mini > span { color: #6b7080; margin-bottom: 4px; }
.cred-mini code { font-size: 13px; font-weight: 700; }
.cred-mini small { color: #6b7080; margin-top: 4px; }
@media print {
  @page { size: A4; margin: 10mm; }
  body.print-cred *, body.print-sheet * { visibility: hidden; }
  body.print-cred .cred-card, body.print-cred .cred-card * { visibility: visible; }
  body.print-cred .cred-card { position: fixed; left: 40px; top: 40px; width: 420px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-sheet > *:not(.cred-sheet-print) { display: none !important; }
  body.print-sheet .cred-sheet-print, body.print-sheet .cred-sheet-print * { visibility: visible; }
  body.print-sheet .cred-sheet-print { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* імпорт з Excel */
.modal.modal-xl { max-width: 1000px; }
.imp-steps { margin: 14px 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); }
.imp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 14px 0; }
.imp-stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.imp-stat b { font-family: var(--font-display); font-size: 1.6rem; }
.imp-stat span { color: var(--muted); font-size: .84rem; }
.imp-stat.ok b { color: var(--green-dark); } .imp-stat.bad b { color: var(--red); } .imp-stat.warn b { color: var(--yellow-ink); }
.imp-table { max-height: 52vh; overflow: auto; }
.imp-table code { font-family: var(--font-mono); font-weight: 700; }
tr.row-bad td { background: rgba(225, 43, 28, .05); }
tr.row-warn td { background: var(--yellow-soft); }
.warn-text { color: var(--yellow-ink); }
.bad-text svg, .warn-text svg, .ok-text svg { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------------------------------------------------------- profile / roles */
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.profile-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.badge.role-trainee { background: var(--green-soft); color: var(--green-dark); }
.badge.role-teacher { background: #eef2ff; color: #3d5bd9; }
/* матеріали уроку в картці стажера */
tr.mat-row > td { padding-top: 0 !important; border-top: none !important; }
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 2px 0 6px; }
.mat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.mat .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; }
.mat-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.mat-ico svg { width: 16px; height: 16px; }
.mat .tiny svg { width: 12px; height: 12px; vertical-align: -2px; }
.mat.done { border-color: rgba(31, 168, 79, .35); background: rgba(31, 168, 79, .06); }
.mat.done .mat-ico { background: rgba(31, 168, 79, .14); color: var(--green-dark); }
.mat.part .mat-ico { background: var(--yellow-soft); color: var(--yellow-ink); }
.mat.none { opacity: .75; }
.mat.none .tiny { color: var(--red); }
.mat-pct { font-family: var(--font-mono); font-weight: 700; font-size: .82rem; }
.dep-select { width: auto; max-width: 240px; padding: 7px 12px; font-size: .86rem; }
.badge.role-supervisor { background: #f3ecff; color: #7a3fc7; }
.badge.role-manager { background: var(--yellow-soft); color: var(--yellow-ink); }
.badge.role-admin { background: var(--ink); color: #fff; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.role-card { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.role-card > span { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.role-card > span svg { width: 21px; height: 21px; }
.role-card b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.role-card small { color: var(--muted); font-weight: 600; }
.role-card.role-trainee > span { background: var(--green-soft); color: var(--green-dark); }
.role-card.role-teacher > span { background: #eef2ff; color: #3d5bd9; }
.role-card.role-supervisor > span { background: #f3ecff; color: #7a3fc7; }
.role-card.role-manager > span { background: var(--yellow-soft); color: var(--yellow-ink); }
.role-card.role-admin > span { background: var(--ink); color: #fff; }

.modal.modal-wide { max-width: 620px; }
.modal.modal-left { text-align: left; max-height: calc(100vh - 32px); overflow: auto; }
.form-modal h2 { font-size: 1.3rem; }
.role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.role-opt { margin: 0; cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt > span { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; height: 100%; transition: all .2s; }
.role-opt > span svg { width: 20px; height: 20px; color: var(--muted); }
.role-opt b { font-size: .88rem; }
.role-opt small { color: var(--muted); font-weight: 500; font-size: .74rem; line-height: 1.35; }
.role-opt input:checked + span { border-color: var(--fg); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(21,23,29,.08); }
.role-opt input:checked + span svg { color: var(--fg); }
.perm-list { display: grid; gap: 6px; }
.perm { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.perm:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.perm input { accent-color: var(--green); }

.cred-card { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px 20px; overflow: hidden; background: #fff; }
.cred-stripe { position: absolute; left: 0; right: 0; top: 0; height: 6px; display: flex; }
.cred-stripe i { flex: 1; }
.cred-stripe i:nth-child(1) { background: var(--red); } .cred-stripe i:nth-child(2) { background: var(--yellow); } .cred-stripe i:nth-child(3) { background: var(--green); }
.cred-logo { height: 38px; margin-bottom: 10px; }
.cred-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.cred-row span { color: var(--muted); font-weight: 600; font-size: .85rem; }
.cred-row code { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; background: var(--bg); padding: 4px 10px; border-radius: 8px; user-select: all; word-break: break-all; }

/* ---------------------------------------------------------- tests */
.test-settings { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.test-settings .switch span, .ts-num { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin: 0; }
.test-settings svg { width: 16px; height: 16px; color: var(--muted); }
.ts-num input { width: 76px; padding: 7px 10px; }
.test-timer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--bg); }
.test-timer svg { width: 16px; height: 16px; }
.test-timer.low { background: var(--red); color: #fff; animation: pulseRed 1s infinite; }
@keyframes pulseRed { 50% { box-shadow: 0 0 0 6px rgba(225, 43, 28, .2); } }

.demo-card { background: linear-gradient(160deg, var(--yellow-soft), var(--surface) 55%); }
.demo-card .kpi-ico { color: var(--fg); }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .span-2, .span-3 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { position: static; min-height: 0; padding: 8px; flex-direction: row; overflow-x: auto; border-radius: 16px; }
  .side-user, .side-foot { display: none; }
  .side nav { flex-direction: row; }
  .side a { white-space: nowrap; padding: 9px 12px; }
  .side a.active::before { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .cs-row { grid-template-columns: 1fr 44px; }
  .cs-row .stack { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 680px) {
  .cert-inner { inset: 26px 28px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px; }
  .kpi-v { font-size: 1.35rem; }
}

/* =====================================================================
   ТЕМНА ТЕМА (перемикач — кнопка з місяцем угорі; вибір запам'ятовується)
   ===================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #0b0c10;
  --ink-2: #d5d9e0;
  --fg: #f3f4f6;
  --text: #e4e6eb;
  --muted: #a3a9b6;
  --dim: #767d8b;
  --bg: #121318;
  --surface: #1b1e25;
  --surface-2: #21252d;
  --line: #2d323c;
  --line-strong: #3c4250;
  --green-dark: #22a653;
  --primary-hover: #1b8f46;
  --green-soft: rgba(31, 168, 79, .16);
  --red-soft: rgba(225, 43, 28, .17);
  --yellow-soft: rgba(250, 223, 18, .12);
  --yellow-ink: #f1d34b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] body { background: var(--bg); }
:where(html[data-theme="dark"]) a { color: #4cd07d; }
html[data-theme="dark"] .btn { color: #fff; }
html[data-theme="dark"] .btn-ghost, html[data-theme="dark"] .btn-danger { color: var(--text); }
html[data-theme="dark"] .btn-danger { color: #ff6b5e; border-color: rgba(225, 43, 28, .35); }
html[data-theme="dark"] .btn-danger:hover { color: #fff; }
html[data-theme="dark"] .btn-yellow { color: #15171d; }
html[data-theme="dark"] .side a.active { color: #15171d; }
/* темні плашки — трохи світліші за фон і з рамкою, щоб не зливались */
html[data-theme="dark"] .hero, html[data-theme="dark"] .course-hero, html[data-theme="dark"] .side,
html[data-theme="dark"] .test-cta, html[data-theme="dark"] .auth-art { background-color: #0a0b0e; box-shadow: 0 0 0 1px var(--line); }
html[data-theme="dark"] .btn:not(.btn-ghost):not(.btn-danger):not(.btn-yellow):not(.btn-go):not(.btn-tg):not(.btn-link) { background: #2e333e; }
html[data-theme="dark"] .nav a.nav-link.active, html[data-theme="dark"] .chip.active, html[data-theme="dark"] .tabs a.active,
html[data-theme="dark"] .outline a.current, html[data-theme="dark"] .badge.dark, html[data-theme="dark"] .badge.role-admin,
html[data-theme="dark"] .role-card.role-admin > span, html[data-theme="dark"] .tg-steps li::before { background: #f3f4f6; color: #15171d; border-color: #f3f4f6; }
html[data-theme="dark"] .toast, html[data-theme="dark"] .chart-tip { background: #2e333e; }
/* напівпрозорі «скляні» панелі */
html[data-theme="dark"] .topbar { background: rgba(18, 19, 24, .85); border-color: var(--line); }
html[data-theme="dark"] .study-bar, html[data-theme="dark"] .test-head { background: rgba(27, 30, 37, .92); }
html[data-theme="dark"] .brand img, html[data-theme="dark"] .cert-logo { background: #fff; border-radius: 12px; padding: 3px 6px; }
html[data-theme="dark"] .avatar span { background: var(--surface); }
/* повідомлення та бейджі */
html[data-theme="dark"] .alert.info { background: #1f2635; color: #c9d4ee; }
html[data-theme="dark"] .note.info { background: #1c2536; border-color: #2c3a55; color: #b9cbf2; }
html[data-theme="dark"] .note.warn { border-color: rgba(250, 223, 18, .3); color: #f1d34b; }
html[data-theme="dark"] .note.danger { border-color: rgba(225, 43, 28, .4); color: #ff8a7f; }
html[data-theme="dark"] .announce-ico, html[data-theme="dark"] .badge.role-teacher, html[data-theme="dark"] .role-card.role-teacher > span { background: rgba(93, 123, 255, .16); color: #93a8ff; }
html[data-theme="dark"] .badge.role-supervisor, html[data-theme="dark"] .role-card.role-supervisor > span { background: rgba(160, 100, 240, .18); color: #c39bff; }
html[data-theme="dark"] .rating-chip { color: #f1d34b; }
html[data-theme="dark"] .cred-card { background: var(--surface); }
html[data-theme="dark"] .office-docx .pdf-stage { background: #2a2e36; }
html[data-theme="dark"] tr.row-bad td { background: rgba(225, 43, 28, .1); }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #6f7685; }
html[data-theme="dark"] .gen-1::after, html[data-theme="dark"] .gen-1 { color: inherit; }
/* плавна зміна теми */
html.theme-anim, html.theme-anim * { transition: background-color .35s ease, border-color .35s ease, color .35s ease !important; }

/* кнопка перемикання теми */
.theme-btn svg { width: 18px; height: 18px; }