/* Панель персонала */
body { background: var(--bg); }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; background:
  radial-gradient(700px 360px at 80% 0%, rgba(79, 195, 255, .14), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); }
.login-card .logo { width: 260px; margin: 0 auto 22px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--text); }
.side .brand b { font-weight: 900; letter-spacing: .04em; display: block; line-height: 1; }
.side .brand i { font-style: normal; font-size: 10px; letter-spacing: .4em; color: var(--ice); }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 6px 10px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none !important; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.is-active { background: var(--ice-soft); color: var(--ice); }
.nav-link .ico { width: 20px; text-align: center; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.side-foot .who { padding: 0 8px 10px; }
.side-foot .who b { display: block; }

.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 24px 28px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 80; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 70; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 60; align-items: center; justify-content: space-between; gap: 10px; height: 56px; padding: 0 12px; background: rgba(6, 11, 22, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .topbar .title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 16px 14px 70px; }
  .page-head h1 { font-size: 22px; }
}

/* Плитки показателей */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile .v { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.tile .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.tile .h { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.tile.ok .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--bad); } .tile.ice .v { color: var(--ice); }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; gap: 8px; } .tile { padding: 12px; } .tile .v { font-size: 24px; } }

.loc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .loc-cards { grid-template-columns: 1fr; } }
.loc-card h3 { font-size: 17px; margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; margin: 12px 0; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }

/* Списки */
.list { display: grid; gap: 8px; }
.list-item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
a.list-item:hover { border-color: var(--line-strong); text-decoration: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 700; }
.list-item .s { color: var(--muted); font-size: 13.5px; }
.date-group { margin: 18px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.date-group:first-child { margin-top: 0; }
.fill { width: 160px; flex: none; }
.fill .meter { height: 8px; margin-top: 6px; }
.fill .nums { font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; }
.fill .nums b { color: var(--text); }
@media (max-width: 560px) { .fill { width: 110px; } .list-item { padding: 10px 12px; } }
.time-big { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; width: 64px; flex: none; }

/* Таблицы */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th, table.t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { color: var(--faint); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); white-space: nowrap; position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.clickable { cursor: pointer; }
table.t tr.clickable:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Участники тренировки */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: 700 14.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.tab.is-active { color: var(--ice); border-bottom-color: var(--ice); }
.tab .count { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 2px 8px; font-size: 12px; margin-left: 6px; }
.person { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.person.is-present { border-color: rgba(61, 220, 151, .45); }
.person.is-absent { border-color: rgba(255, 107, 122, .35); }
.person .idx { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 14px; }
.person.is-present .idx { background: var(--ok-soft); color: var(--ok); }
.person.is-absent .idx { background: var(--bad-soft); color: var(--bad); }
.person .name { font-weight: 700; font-size: 15.5px; }
.person .meta { color: var(--muted); font-size: 13.5px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.person .meta a { color: var(--muted); }
.att { display: flex; gap: 6px; align-items: center; }
.att .btn { min-height: 38px; font-size: 13.5px; padding: 0 12px; }
.att .btn.on-present { background: var(--ok); color: #03140c; }
.att .btn.on-absent { background: var(--bad); color: #1a0306; }
@media (max-width: 640px) {
  .person { grid-template-columns: 30px 1fr; }
  .person .idx { width: 30px; height: 30px; }
  .person .att { grid-column: 1 / -1; }
  .person .att .btn { flex: 1; min-height: 42px; }
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.toolbar .grow { flex: 1 1 220px; }
.toolbar select.input { width: auto; flex: 0 1 auto; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 210px; }
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 12px; border-radius: 8px; font: 500 14.5px/1.2 var(--font); cursor: pointer; }
.menu-pop button:hover { background: var(--surface-3); }
.menu-pop button.danger { color: #ffb3bb; }

/* Сканер */
.scanner { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; max-width: 480px; margin: 0 auto; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 14%; border: 3px solid rgba(127, 216, 255, .9); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.scan-result { max-width: 480px; margin: 14px auto 0; }
.scan-result .card { text-align: center; }
.scan-big { font-size: 22px; font-weight: 900; }

/* Графики (простые столбцы) */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 10px 4px 0; overflow-x: auto; }
.bar { flex: 1 0 14px; max-width: 34px; display: flex; flex-direction: column-reverse; height: 100%; position: relative; }
.bar span { display: block; width: 100%; }
.bar .p { background: var(--ok); border-radius: 0 0 4px 4px; }
.bar .a { background: var(--bad); }
.bar .u { background: var(--surface-3); border-radius: 4px 4px 0 0; }
.bar-labels { display: flex; gap: 4px; padding: 4px 4px 0; overflow: hidden; }
.bar-labels span { flex: 1 0 14px; max-width: 34px; font-size: 10px; color: var(--faint); text-align: center; }
.chart-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.sched-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sched-row:last-child { border-bottom: 0; }
.sched-times { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sched-times .input { width: 110px; min-height: 38px; padding: 6px 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.empty-state { text-align: center; color: var(--muted); padding: 34px 12px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 40px; height: 22px; appearance: none; background: var(--surface-3); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }
.showcase { border: 1px solid rgba(127, 216, 255, .35); background: var(--ice-soft); border-radius: 12px; padding: 12px 14px; }
.loc-card .fill { width: 120px; }
