/* batches screens: list, new batch, batch page tabs, daily class screen, today's classes */

/* ---------- list ---------- */
.bt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.bt-card { display: flex; flex-direction: column; gap: 12px; }
.bt-card-head { display: flex; align-items: flex-start; gap: 10px; }
.bt-card-head .grow { flex: 1; min-width: 0; }
.bt-name { display: block; font-size: 16px; line-height: 1.3; }
.bt-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13.5px; color: var(--mute); }
.bt-facts span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bt-facts svg { flex: none; color: var(--gold); }
.bt-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.bt-nums > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bt-nums b { font-size: 18px; line-height: 1.1; }
.bt-nums small { color: var(--mute); font-size: 12px; }
.bt-nums .bar { min-width: 0; flex: none; height: 5px; }
.bt-nums .bt-alert b { color: var(--red); }

/* ---------- new batch ---------- */
.bt-plan-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); }
.bt-plan-note svg { flex: none; color: var(--gold); margin-top: 2px; }
.bt-plan-note p { margin: 2px 0 0; }
.bt-save-row { justify-content: flex-end; }

/* ---------- batch page tabs ---------- */
.bt-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.bt-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; white-space: nowrap; text-decoration: none; color: var(--mute); font-weight: 600; font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; }
.bt-tab:hover { color: var(--ink); }
.bt-tab.on { color: var(--navy); border-bottom-color: var(--gold); }
@media (prefers-color-scheme: dark) { .bt-tab.on { color: var(--gold-light); } }
.bt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bt-next h3 { margin: 4px 0 2px; }
.bt-pin { font-size: 30px; font-weight: 800; letter-spacing: .18em; color: var(--navy); background: var(--gold-soft); border-radius: 12px; padding: 4px 14px; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .bt-pin { color: var(--gold-light); } }
.bt-msg { margin-top: 14px; }
.bt-msg summary { cursor: pointer; font-weight: 600; padding: 6px 0; min-height: 32px; }
.bt-msg-text { white-space: pre-wrap; word-break: break-word; font: 13.5px/1.5 var(--font); background: var(--chip); border-radius: 12px; padding: 12px 14px; margin: 8px 0 10px; max-height: 320px; overflow: auto; }

/* ---------- calendar ---------- */
.bt-legend { display: inline-flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; color: var(--mute); }
.bt-leg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line-strong); }
.bt-legend i.Held, .bt-legend i.good { background: var(--leaf); border-color: var(--leaf); }
.bt-legend i.Planned { background: var(--gold-soft); border-color: var(--gold); }
.bt-legend i.Cancelled, .bt-legend i.none { background: var(--chip); }
.bt-legend i.ok { background: #8fcaa4; border-color: #8fcaa4; }
.bt-legend i.warm { background: var(--gold-light); border-color: var(--gold); }
.bt-legend i.bad { background: #e88a8a; border-color: var(--red); }
.bt-cal { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.bt-day { display: flex; flex-direction: column; gap: 3px; min-height: 112px; position: relative; }
.bt-day.tap { cursor: pointer; }
.bt-day.tap:hover { border-color: var(--navy); }
.bt-day.Held { background: color-mix(in srgb, var(--leaf-soft) 55%, var(--paper)); }
.bt-day.late { border-color: var(--red); }
.bt-day-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.bt-day-top strong { font-size: 13.5px; }
.bt-day-no { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); font-weight: 700; }
.bt-day-title { font-size: 13.5px; line-height: 1.3; flex: 1; }
.bt-day-edit { align-self: flex-start; margin-top: 4px; }

/* ---------- trainees ---------- */
.bt-list { padding: 4px 16px; }
.bt-trainee { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bt-trainee:last-child { border-bottom: 0; }
.bt-trainee.off { opacity: .65; }
.bt-tr-main { min-width: 0; } .bt-tr-main strong, .bt-tr-main small { display: block; overflow-wrap: anywhere; }
.bt-tr-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bt-tr-nums > div, .bt-test-nums > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt-tr-nums b, .bt-test-nums b { font-size: 15px; }
.bt-tr-nums small, .bt-test-nums small { font-size: 11.5px; color: var(--mute); }
.bt-tr-nums .bar { flex: none; height: 5px; min-width: 0; }
.bt-tr-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
details.card > summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.bt-pick { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.bt-pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 52px; }
.bt-pick-row:last-child { border-bottom: 0; }
.bt-pick-row:hover { background: var(--chip); }
.bt-pick-row .grow { flex: 1; min-width: 0; } .bt-pick-row strong, .bt-pick-row small { display: block; overflow-wrap: anywhere; }
.bt-pick-row input { flex: none; width: 22px; height: 22px; }
.bt-pick > .muted { padding: 14px; margin: 0; }

/* ---------- tests ---------- */
.bt-tests { padding: 6px 18px 12px; }
.bt-mod { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 14px 0 4px; }
.bt-test { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bt-test.mod { background: color-mix(in srgb, var(--gold-soft) 50%, transparent); margin: 0 -10px; padding: 10px; border-radius: 10px; border-bottom: 0; }
.bt-test .grow { flex: 1; min-width: 0; } .bt-test .row { gap: 8px; }
.bt-test small { display: block; }
.bt-test-nums { display: grid; grid-template-columns: repeat(2, 64px); gap: 8px; }
.bt-switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--chip); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--mute); min-height: 36px; min-width: 96px; }
.bt-knob { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.bt-switch.on { background: var(--leaf); border-color: var(--leaf); color: #fff; flex-direction: row-reverse; padding: 4px 4px 4px 12px; }
.bt-switch:disabled { opacity: .6; cursor: wait; }

/* ---------- progress matrix ---------- */
.bt-matrix { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 100%; }
.bt-matrix table { width: max-content; min-width: 100%; }
.bt-matrix th { font-size: 12px; color: var(--mute); background: color-mix(in srgb, var(--chip) 55%, var(--paper)); position: sticky; top: 0; }
.bt-matrix th.mod { color: #7a5718; background: var(--gold-soft); }
.bt-matrix th.name { z-index: 2; }
.bt-matrix td.name { min-width: 150px; max-width: 190px; white-space: normal; z-index: 1; }
.bt-matrix td.name strong, .bt-matrix td.name small { display: block; } .bt-matrix td.name small { color: var(--mute); font-size: 11.5px; }
.bt-c { min-width: 38px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-c.good { background: var(--leaf); color: #fff; }
.bt-c.ok { background: #bfe3cc; color: #1d5235; }
.bt-c.warm { background: var(--gold-soft); color: #7a5718; }
.bt-c.bad { background: #f6c9c9; color: #8a1414; }
.bt-c.none { color: var(--line-strong); }
.bt-miss { margin: 0; padding-left: 18px; font-size: 13px; color: var(--mute); flex: 1.4; }

/* ---------- class screen ---------- */
.bt-plancard > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; }
.bt-plancard > summary::-webkit-details-marker { display: none; }
.bt-plancard > summary .grow { flex: 1; display: flex; flex-direction: column; }
.bt-plancard > summary strong { font-size: 16px; }
.bt-plancard > summary svg { color: var(--gold); transition: transform .15s; }
.bt-plancard[open] > summary svg { transform: rotate(-8deg); }
.bt-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.bt-plan h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.bt-plan p, .bt-plan ul { margin: 0; } .bt-plan ul { padding-left: 18px; } .bt-plan li { margin: 2px 0; }
.bt-counts { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; margin: 6px 0 12px; font-size: 14px; }
.bt-counts b { font-size: 20px; } .bt-counts .P b { color: var(--leaf); } .bt-counts .A b { color: var(--red); } .bt-counts .L b { color: var(--gold); }
.bt-att { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bt-tile { font: inherit; color: inherit; text-align: left; width: 100%; min-height: 64px; padding: 10px 12px; -webkit-tap-highlight-color: transparent; user-select: none; }
.bt-tile:active { transform: scale(.98); }
.bt-tile .avatar { width: 40px; height: 40px; }
.bt-tile.P .avatar { background: var(--leaf); color: #fff; } .bt-tile.A .avatar { background: var(--red); color: #fff; } .bt-tile.L .avatar { background: var(--gold); color: #fff; }
.bt-tile-name { flex: 1; min-width: 0; } .bt-tile-name strong, .bt-tile-name small { display: block; overflow-wrap: anywhere; } .bt-tile-name small { color: var(--mute); font-size: 12px; }
.bt-tile-st { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--chip); color: var(--mute); }
.bt-tile.P .bt-tile-st { background: var(--leaf); color: #fff; } .bt-tile.A .bt-tile-st { background: var(--red); color: #fff; } .bt-tile.L .bt-tile-st { background: var(--gold); color: #fff; }
.bt-photo { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bt-photo img { max-width: 100%; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }
.bt-savebar { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }
.bt-savebar .btn { min-height: 50px; font-size: 16px; padding: 0 26px; }
.bt-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 18px; }
.bt-done h2 { margin: 4px 0; } .bt-done h4 { margin: 10px 0 4px; }
.bt-done ul { text-align: left; margin: 0; padding-left: 20px; }
.bt-done .btn-row { justify-content: center; margin-top: 12px; }
.bt-done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: #fff; }

/* ---------- today ---------- */
.bt-h { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 6px 0 0; }
.bt-today { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 14px 16px; }
.bt-today .grow { flex: 1; min-width: 0; } .bt-today .grow > * { display: block; }
.bt-today-time { flex: none; width: 58px; text-align: center; display: flex; flex-direction: column; padding: 6px 0; border-radius: 10px; background: var(--navy-soft); }
.bt-today-time strong { font-size: 15px; } .bt-today-time small { font-size: 11.5px; color: var(--mute); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .bt-cards { grid-template-columns: 1fr; }
  .bt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-trainee { grid-template-columns: auto minmax(0, 1fr); }
  .bt-tr-nums, .bt-tr-act { grid-column: 1 / -1; }
  .bt-tr-act { justify-content: flex-start; }
  .bt-test { flex-wrap: wrap; }
  .bt-test .grow { flex-basis: 100%; }
  .bt-test-nums { flex: 1; }
  .bt-plan { grid-template-columns: 1fr; }
  .bt-att { grid-template-columns: 1fr; }
  .bt-savebar .btn { width: 100%; justify-content: center; }
  .bt-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-pin { font-size: 26px; }
  .bt-today { grid-template-columns: 58px minmax(0, 1fr); }
  .bt-today > .btn, .bt-today > .pill { grid-column: 2; justify-self: start; }
  .bt-save-row .btn { flex: 1; justify-content: center; }
  .line-row:has(.bt-miss) { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) { .bt-facts { grid-template-columns: 1fr; } .bt-cal { grid-template-columns: 1fr; } }

/* add trainees from a pasted list */
.bt-paste > * + * { margin-top: 12px; }
.bt-paste textarea { font-family: var(--font); min-height: 130px; }
.bt-paste-res { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.bt-paste-res ul { margin: 4px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.bt-paste-res .bad h4 { color: var(--red); }

/* progress: top performers / needs support */
.bt-spot { align-items: start; }
.bt-spot > .card { margin: 0; min-width: 0; }
.bt-spot-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bt-spot-card.top { border-top: 4px solid var(--gold); }
.bt-spot-card.top h3 svg { color: var(--gold); }
.bt-spot-card.need { border-top: 4px solid var(--red); }
.bt-spot-card.need h3 svg { color: var(--red); }
.bt-spot-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bt-spot-row:last-child { border-bottom: 0; }
.bt-spot-row .grow { flex: 1; min-width: 0; }
.bt-spot-row strong, .bt-spot-row small { display: block; overflow-wrap: anywhere; }
.bt-spot-val { flex: none; font-size: 16px; }
.bt-spot-card.need .bt-spot-val { color: var(--red); }
@media (max-width: 760px) { .bt-spot { grid-template-columns: 1fr; } }

/* My book panel */
.bt-book summary { cursor: pointer; padding: 2px 0; }
.bt-book-list { display: grid; margin: 8px 0 12px; border-top: 1px solid var(--line); }
.bt-book-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); min-height: 44px; }
.bt-book-row input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }

/* Scheme certificates */
.bt-scheme-list { display: grid; }
.bt-scheme-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 160px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .bt-scheme-row { grid-template-columns: 1fr 1fr; } .bt-scheme-row .grow { grid-column: 1 / -1; } }

/* attendance report after a class */
.bt-att { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; }
.bt-att h4 { margin: 0 0 4px; }
