/* Админка, вход, служебные страницы. Страница родителя использует track/track.css */
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", "Noto Sans Georgian", sans-serif; color: #1d2330; background: #f4f6f9; }
h1:focus { outline: none; }
a { color: #2a6edb; }
.muted { color: #6b7685; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.error { color: #c0392b; margin: 6px 0; }
.spacer { flex: 1; }

/* шапка */
.admin-header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #1f3b63; color: #fff; flex-wrap: wrap; }
.admin-header .brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.admin-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-header nav a { color: #cfe0f7; padding: 8px 12px; border-radius: 6px; text-decoration: none; }
.admin-header nav a.active, .admin-header nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.admin-header form { margin: 0; }
.link-btn { background: none; border: 0; color: #cfe0f7; cursor: pointer; font: inherit; }
.link-btn:hover { color: #fff; text-decoration: underline; }
.admin-main { padding: 16px 20px; }

/* элементы управления */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
button, .btn { font: inherit; padding: 6px 12px; border: 1px solid #c5ccd6; background: #fff; border-radius: 6px; cursor: pointer; color: inherit; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #eef2f7; }
button.primary { background: #2a6edb; border-color: #2a6edb; color: #fff; }
button.primary:hover { background: #1f5bbb; }
button.danger { color: #c0392b; }
button.small, .btn.small { padding: 2px 8px; font-size: 12px; }
input { font: inherit; padding: 6px 8px; border: 1px solid #c5ccd6; border-radius: 6px; }
input[type=checkbox] { padding: 0; }
input.search { width: 260px; }

/* таблицы */
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid #e8ecf1; text-align: left; vertical-align: middle; }
table.list th { background: #f0f3f7; font-weight: 600; font-size: 13px; }
table.list tr.inactive td { color: #98a1ad; }
td.board { font-weight: 700; font-size: 16px; text-align: center; }
td.actions { white-space: nowrap; text-align: right; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #b0b7c1; }
.dot.on { background: #27ae60; } .dot.move { background: #2a6edb; } .dot.old { background: #e67e22; }

.notice { background: #fff8e6; border: 1px solid #f3d27a; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice li { margin: 4px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* модальное окно */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 900; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(520px, 95vw); max-height: 92vh; overflow: auto;
         background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.3); z-index: 901; }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: #6b7685; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 6px; align-items: center; }
fieldset { border: 1px solid #e0e5eb; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
legend { font-size: 12px; color: #6b7685; padding: 0 4px; }

/* карта */
.admin-map { height: calc(100vh - 100px); border-radius: 8px; }
.leaflet-tooltip.bus-label { background: #2a6edb; color: #fff; border: 0; font-weight: 700; padding: 2px 6px; border-radius: 4px; box-shadow: none; }
.leaflet-tooltip.bus-label.stale { background: #8e98a5; }
.leaflet-tooltip.bus-label::before { display: none; }
.school-pin { font-size: 22px; }

/* вход и служебные страницы */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center-box { text-align: center; max-width: 440px; font-size: 16px; }
.big-icon { font-size: 64px; }
.login-box { background: #fff; padding: 28px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08); width: min(340px, 92vw); }
.login-box h1 { font-size: 20px; margin: 0 0 16px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #6b7685; margin-bottom: 12px; }
.login-box button { width: 100%; padding: 9px; }

/* лист печати */

@media (prefers-color-scheme: dark) {
  .center-page { background: #1e232b; color: #e8ecf1; }
}

/* панель «произошла ошибка» Blazor — скрыта, пока не случится сбой */
#blazor-error-ui { display: none; position: fixed; left: 0; bottom: 0; width: 100%; z-index: 1000; padding: 10px 20px;
                   background: #fff4c2; box-shadow: 0 -1px 2px rgba(0,0,0,.2); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

.board-links { display: block; font-size: 11px; font-weight: 400; white-space: nowrap; }
.board-links a { margin-right: 4px; }

/* переключатель языка */
.lang-switch { display: inline-flex; border: 1px solid rgba(127,127,127,.4); border-radius: 6px; overflow: hidden; }
.lang-switch a { padding: 3px 8px; font-size: 12px; font-weight: 600; text-decoration: none; color: inherit; opacity: .75; }
.lang-switch a.on { background: #2a6edb; color: #fff; opacity: 1; }
.admin-header .lang-switch { border-color: rgba(255,255,255,.35); color: #cfe0f7; }
.login-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.login-head h1 { margin: 0; }
td.qr-links { white-space: nowrap; }
td.qr-links a { margin-right: 6px; font-size: 13px; }

/* ===== печать QR на листах Tanex TW-2204: A4, 4 наклейки 105 × 148,5 мм без полей ===== */
@page { size: A4 portrait; margin: 0; }
.print-bar { padding: 10px; background: #eee; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.print-bar form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.print-bar input[type=number] { width: 64px; }
.print-bar select { padding: 2px 4px; }
.sheet { width: 210mm; height: 297mm; display: grid; grid-template-columns: 105mm 105mm; grid-template-rows: 148.5mm 148.5mm;
         background: #fff; margin: 8mm auto; box-shadow: 0 1px 6px rgba(0,0,0,.35); overflow: hidden;
         break-after: page; page-break-after: always; }
.sheet:last-child { break-after: auto; page-break-after: auto; }
.card { box-sizing: border-box; width: 105mm; height: 148.5mm; overflow: hidden; padding: 9mm 8mm 8mm;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-align: center; color: #000; outline: 1px dashed #bbb; outline-offset: -1px; }
.card.blank { outline-color: #eee; }
.card .org { font-size: 17pt; font-weight: 800; line-height: 1.15; margin-bottom: 2.5mm; }
.card .school-band { width: 100%; box-sizing: border-box; border: 2px solid #000; border-radius: 3mm; padding: 1.5mm 3mm; margin-bottom: 4mm; }
.card .school-band .label { font-size: 8.5pt; color: #444; text-transform: uppercase; letter-spacing: .5px; }
.card .school { font-size: 18pt; font-weight: 800; line-height: 1.15; }
.card .school-en { font-size: 12pt; font-weight: 600; }
.card .qr { line-height: 0; }
.card .qr svg { width: 62mm; height: 62mm; }
.card .head { font-weight: 700; font-size: 11.5pt; margin-top: 4mm; line-height: 1.25; }
.card .head-en { font-size: 10pt; font-weight: 600; line-height: 1.25; }
.card .hint { font-size: 8.5pt; color: #444; margin-top: 2mm; }
@media print {
  .print-bar { display: none; }
  html, body { background: #fff !important; margin: 0; padding: 0; }
  .sheet { margin: 0; box-shadow: none; }
  .card, .card.blank { outline: none; }
}
@media screen { .print-sheets { background: #8a8f96; padding: 1px 0 8mm; min-height: 100vh; } }
.addr { font-size: 12px; max-width: 320px; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; }
.geo-hits { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 220px; overflow: auto; }
.geo-hit { text-align: left; font-size: 13px; white-space: normal; }

/* история */
.hist-toolbar label { display: inline-flex; gap: 6px; align-items: center; }
.hist-toolbar select { min-width: 220px; }
.hist-wrap { display: flex; gap: 12px; height: calc(100vh - 150px); min-height: 420px; }
.hist-mapcol { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hist-map { flex: 1; border-radius: 8px; }
.hist-player { display: flex; gap: 8px; align-items: center; }
.hist-player input[type=range] { flex: 1; }
.hist-player #hist-now { min-width: 140px; text-align: right; }
.hist-side { width: 320px; overflow: auto; }
.hist-side h3 { font-size: 14px; margin: 14px 0 6px; }
.hist-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.hist-kpis div { background: rgba(127,127,127,.08); border-radius: 8px; padding: 8px; }
.hist-kpis span { display: block; font-size: 11px; opacity: .7; }
.hist-kpis b { font-size: 15px; }
.hist-stops { display: flex; flex-direction: column; gap: 4px; }
.hist-stop-row { display: flex; gap: 8px; text-align: left; align-items: flex-start; font-size: 13px; white-space: normal; padding: 6px 8px; }
.hist-stop-row .num, .hist-stop b { display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
  background: #6b46c1; color: #fff; font-size: 11px; align-items: center; justify-content: center; }
.hist-stop { background: none; border: none; }
.hist-stop b { width: 22px; height: 22px; border: 2px solid #fff; box-sizing: border-box; }
.hist-bus { background: none; border: none; }
.hist-bus div { width: 26px; height: 26px; border-radius: 50%; background: #1d4ed8; color: #fff; border: 2px solid #fff; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
div.small { font-size: 12px; }
@media (max-width: 800px) { .hist-wrap { flex-direction: column; height: auto; } .hist-map { height: 60vh; flex: none; } .hist-side { width: auto; } }
.hist-toolbar select, .hist-toolbar input[type=date] { padding: 5px 8px; font: inherit; border: 1px solid #c5ccd6; border-radius: 6px; }
