:root {
  --navy: #111d35;
  --navy-2: #1a2a4a;
  --navy-3: #253a63;
  --ink: #0b1426;
  --signal: #2ec4a9;
  --signal-2: #5fdcc4;
  --orange: #e8591a;
  --bg: #eef0f4;
  --card: #ffffff;
  --line: #d9dde6;
  --text: #18202f;
  --muted: #687085;
  --p3: #2f7d5b;  --p3-bg: #e2f1e9;
  --p4: #2b5fb8;  --p4-bg: #e2ebfa;
  --p5: #b8420f;  --p5-bg: #fde8dc;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }
.i { width: 18px; height: 18px; flex: none; }
a { color: inherit; }

/* Каркас: боковое меню + контент */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #b9c3d8; display: flex; flex-direction: column; padding: 22px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; padding: 0 8px 22px; border-bottom: 1px solid var(--navy-3); margin-bottom: 16px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--signal); color: var(--ink); display: grid; place-items: center; }
.brand-mark .i { width: 22px; height: 22px; stroke-width: 2; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; margin-bottom: 4px; }
.menu a:hover { background: var(--navy-2); color: #fff; }
.menu a.active { background: var(--signal); color: var(--ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--navy-3); padding: 16px 8px 0; font-size: 13px; }
.side-foot b { display: block; color: #fff; font-size: 14px; }
.role { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--signal); letter-spacing: 1px; text-transform: uppercase; }
.side-foot a { display: flex; align-items: center; gap: 8px; margin-top: 14px; text-decoration: none; color: #b9c3d8; }

.main { min-width: 0; }

/* Табло-шапка */
.board { background: var(--ink); color: #fff; padding: 26px 32px 22px; background-image: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px); }
.board-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--signal); display: flex; align-items: center; gap: 8px; }
.label .i { width: 16px; height: 16px; }
.flap { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.flap span { font-family: var(--mono); font-weight: 800; font-size: 26px; background: #1b2744; color: var(--signal-2); padding: 6px 9px; border-radius: 5px; box-shadow: inset 0 -14px 0 rgba(0,0,0,.18); min-width: 30px; text-align: center; }
.flap span.gap { background: none; box-shadow: none; color: #5d6a88; min-width: 10px; padding: 6px 2px; }
.wk { display: flex; gap: 6px; }
.wk a { width: 40px; height: 40px; border-radius: 9px; border: 1px solid #2c3b5f; display: grid; place-items: center; color: #d4dbea; }
.wk a:hover { border-color: var(--signal); color: var(--signal); }
.meters { display: flex; gap: 28px; margin-top: 20px; flex-wrap: wrap; }
.meter small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #7f8aa6; font-weight: 700; }
.meter b { font-family: var(--mono); font-size: 20px; color: #fff; }
.meter b em { font-style: normal; color: var(--signal); }

/* Полоса действий */
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 32px; background: var(--card); border-bottom: 1px solid var(--line); }
.num { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.num span { padding: 0 12px; color: var(--muted); font-weight: 600; font-size: 13px; }
.num input { width: 58px; border: 0; border-left: 1px solid var(--line); padding: 9px 6px; font: inherit; font-family: var(--mono); font-weight: 800; font-size: 15px; color: var(--navy); text-align: center; }
.grow { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-main { background: var(--signal); color: var(--ink); }
.btn-main:hover { background: var(--signal-2); }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--navy); }
.btn-dark { background: var(--navy); color: #fff; }
.meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.meta .i { width: 15px; height: 15px; }

.content { padding: 22px 32px 60px; }
.hint { display: flex; gap: 10px; align-items: center; color: #0f5247; background: #dff5f0; border-radius: 9px; padding: 10px 14px; margin-bottom: 18px; font-size: 13.5px; }
.hint .i { color: #1a9c86; }

/* Состав: вагоны-дни */
.train { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.car { background: var(--card); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.car.manual { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.car-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.car-day { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--navy); }
.car-day b { font-family: var(--mono); background: var(--navy); color: var(--signal); font-size: 12px; padding: 4px 7px; border-radius: 5px; letter-spacing: 1px; }
.car-date { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.car-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.flag { font-family: var(--mono); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; background: var(--orange); color: #fff; padding: 3px 7px; border-radius: 4px; }
.mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; text-decoration: none; color: var(--p4); }
.mini .i { width: 14px; height: 14px; }
.mini.danger { color: var(--orange); }
.cab { display: flex; align-items: center; gap: 12px; margin: 12px 14px 4px; padding: 10px 12px; background: var(--navy); color: #fff; border-radius: 10px; }
.cab-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--signal); color: var(--ink); display: grid; place-items: center; flex: none; }
.cab-ic .i { width: 22px; height: 22px; stroke-width: 2; }
.cab small { display: block; font-size: 10.5px; color: #8c98b5; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.cab strong { font-size: 15px; }
.cab .tag { margin-left: auto; }
.seats-head { display: flex; align-items: center; gap: 7px; padding: 10px 14px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.seats-head .i { width: 15px; height: 15px; }
.seats-head b { font-family: var(--mono); color: var(--navy); }
.seats { list-style: none; margin: 0; padding: 4px 8px 12px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
.seats li { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; font-size: 13px; min-width: 0; }
.seats li:hover { background: #f3f5f9; }
.no { font-family: var(--mono); font-size: 11px; color: #a3aabb; width: 18px; flex: none; }
.nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-family: var(--mono); font-size: 10.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; flex: none; }
.tag.p3 { background: var(--p3-bg); color: var(--p3); }
.tag.p4 { background: var(--p4-bg); color: var(--p4); }
.tag.p5 { background: var(--p5-bg); color: var(--p5); }
.cab .tag.p4 { background: #2a4a86; color: #cfe0ff; }
.cab .tag.p5 { background: #7a2e0e; color: #ffd9c4; }

/* Правка дня */
.edit { background: var(--card); border: 2px solid var(--signal); border-radius: 12px; overflow: hidden; max-width: 860px; }
.edit-top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 700; }
.edit-top .i { color: var(--signal); }
.edit-top span { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--signal); }
.edit-body { padding: 16px; }
.edit h4 { margin: 0 0 8px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.edit select { width: 100%; max-width: 320px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; margin-bottom: 18px; background: #fff; }
.cks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 10px; }
.ck { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.ck input { display: none; }
.ck .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b9c0cf; display: grid; place-items: center; color: transparent; flex: none; }
.ck .box .i { width: 13px; height: 13px; stroke-width: 2.6; }
.ck:has(input:checked) { background: #f6f8fc; }
.ck:has(input:checked) .box { background: var(--navy); border-color: var(--navy); color: var(--signal); }
.ck .tag { margin-left: auto; }
.edit-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfd; }

/* Состояния */
.sep { margin: 48px 0 16px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; display: flex; align-items: center; gap: 12px; }
.sep::after { content: ""; flex: 1; border-top: 1px dashed #b9c0cf; }
.state { background: var(--card); border-radius: 12px; border: 1px solid var(--line); padding: 48px 24px; text-align: center; }
.state-ic { width: 64px; height: 64px; margin: 0 auto; border-radius: 16px; background: var(--navy); color: var(--signal); display: grid; place-items: center; }
.state-ic .i { width: 34px; height: 34px; stroke-width: 1.6; }
.state-ic.red { color: #ff6a4d; }
.state h2 { margin: 16px 0 6px; color: var(--navy); font-size: 21px; }
.state p { margin: 0 0 20px; color: var(--muted); }
.state .row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.errs { list-style: none; padding: 0; margin: 0 auto 20px; max-width: 460px; text-align: left; }
.errs li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: #fdecea; color: #7a1d10; border-radius: 8px; margin-bottom: 6px; font-size: 13.5px; }
.errs li .i { color: #c62f1b; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .brand { border: 0; padding: 0 8px 0 0; margin: 0; }
  .brand span.t { display: none; }
  .menu { display: flex; gap: 4px; }
  .menu a { margin: 0; padding: 9px 11px; white-space: nowrap; }
  .side-foot { display: none; }
  .board, .bar, .content { padding-left: 16px; padding-right: 16px; }
  .flap span { font-size: 18px; min-width: 22px; padding: 5px 6px; }
  .train { grid-template-columns: 1fr; }
}

/* --- дополнения к макету для живого экрана --- */
.side-foot form { margin: 0; }
.side-foot button { display: flex; align-items: center; gap: 8px; margin-top: 14px; background: none; border: 0; padding: 0; font: inherit; color: #b9c3d8; cursor: pointer; }
.side-foot button:hover { color: #fff; }
.bar form { display: contents; }
.errs.inline { margin: 0 0 18px; max-width: none; }
.edit-err { margin: 0 0 14px; }
#day-edit:empty { display: none; }
.htmx-request .btn-main, .btn-main.htmx-request { opacity: .6; pointer-events: none; }
.mini { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* --- Игроки --- */
.counters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 120px; }
.counter small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.counter b { font-family: var(--mono); font-size: 20px; color: var(--navy); }
.counter.bad { border-color: #f3b9b0; background: #fdecea; }
.counter.bad b { color: #c62f1b; }
.addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.addrow input[type=text], .addrow select, .ptable input[type=text], .ptable select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.addrow input[type=text] { flex: 1; min-width: 200px; }
.ptable { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.ptable th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 10px 14px; background: #f7f8fb; border-bottom: 1px solid var(--line); }
.ptable td { padding: 9px 14px; border-bottom: 1px solid #eef0f4; font-size: 14px; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable .no { width: 1%; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-right: 4px; }
.ptable td.acts { text-align: right; white-space: nowrap; }
.ptable tr.editing td { background: #eefaf7; }
.role-note { color: var(--muted); font-size: 12.5px; }
.search { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; min-width: 240px; }
.filters { display: flex; gap: 6px; }
.chip-f { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 12.5px; color: var(--navy); text-decoration: none; }
.chip-f.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-head { padding: 26px 32px 0; }
.page-head h1 { margin: 6px 0 0; font-size: 26px; color: var(--navy); }
.page-head .label { color: var(--orange); }
/* --- Убрать всех --- */
.btn-danger { background: #c62f1b; color: #fff; }
.btn-danger:hover { background: #a82514; }
.confirm { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fdecea; border: 1px solid #f3b9b0; border-radius: 12px; padding: 14px 16px; }
.confirm-ic { width: 40px; height: 40px; border-radius: 10px; background: #c62f1b; color: #fff; display: grid; place-items: center; flex: none; }
.confirm-text { flex: 1; min-width: 220px; color: #7a1d10; }
.confirm-text b { display: block; font-size: 15px; }
.confirm-text span { font-size: 13.5px; }
/* --- Закрепление недели --- */
.confirm.pin { background: #e6eef8; border-color: #b9cbe3; }
.confirm.pin .confirm-ic { background: var(--navy); }
.confirm.pin .confirm-text { color: var(--navy); }
.pinned { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.hweek-top .pinned { padding: 4px 10px; font-size: 12px; }
/* --- Подсветка после загрузки состава --- */
.ptable tr.hl-new td { background: #e3f7f2; }
.ptable tr.hl-new td:first-child { box-shadow: inset 4px 0 0 var(--signal); }
.ptable tr.hl-chg td { background: #e8effb; }
.ptable tr.hl-chg td:first-child { box-shadow: inset 4px 0 0 #3b6fd1; }
.ptable tr.off td { color: #9aa0b0; background: #f7f8fa; }
.ptable tr.off td.acts { color: inherit; }
.mark { display: inline-block; margin-left: 10px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: 1px; }
.mark.new { background: var(--signal); color: #06352d; }
.mark.chg { background: #3b6fd1; color: #fff; }
.mark.off { background: #e4e6ec; color: #6b7185; }
.result li.chg { background: #e8effb; color: #1f3f7a; }
.result li.same { background: #f1f2f6; color: #5b6275; }
/* --- Добавление списком --- */
.bulk { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.bulk-tabs { display: flex; gap: 4px; padding: 8px 8px 0; background: #f7f8fb; border-bottom: 1px solid var(--line); }
.bulk-tabs a { padding: 9px 14px; border-radius: 9px 9px 0 0; font-weight: 700; font-size: 13.5px; color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 7px; }
.bulk-tabs a.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 0 var(--card); border: 1px solid var(--line); border-bottom: 0; margin-bottom: -1px; }
.bulk-body { padding: 14px; display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.bulk textarea { width: 100%; min-height: 190px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; font: 13.5px/1.6 var(--mono); resize: vertical; }
.bulk-side h4 { margin: 0 0 8px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.bulk-side p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.bulk-side code { font-family: var(--mono); background: #f3f5f9; padding: 1px 5px; border-radius: 4px; color: var(--navy); }
.bulk-side select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; margin-bottom: 12px; background: #fff; }
.bulk-side .btn { width: 100%; justify-content: center; }
.result { list-style: none; margin: 0; padding: 0 14px 14px; display: grid; gap: 6px; }
.result li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; }
.result li.ok { background: #dff5f0; color: #0f5247; }
.result li.skip { background: #fff4e8; color: #7a3a0e; }
.result li.bad { background: #fdecea; color: #7a1d10; }
@media (max-width: 860px) { .bulk-body { grid-template-columns: 1fr; } }
/* --- История --- */
.hweek { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.hweek-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.hweek-top .dates { font-family: var(--mono); font-weight: 800; color: var(--navy); font-size: 16px; }
.hweek-top .cnt { color: var(--muted); font-size: 13px; margin-left: auto; }
.ver { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #eef0f4; }
.ver:last-child { border-bottom: 0; }
.ver .v { font-family: var(--mono); font-weight: 800; color: var(--navy); }
.ver .d { color: var(--muted); font-size: 13px; }
.ver .d b { color: var(--text); font-weight: 600; }
.cur { font-family: var(--mono); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; background: var(--signal); color: var(--ink); padding: 3px 7px; border-radius: 4px; margin-left: 8px; }
.old { color: var(--muted); }
.archive { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; }
.archive .i { color: var(--signal); }
.archive a { margin-left: auto; color: var(--signal); font-weight: 700; text-decoration: none; }
/* --- Вход --- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background-image: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.025) 22px 23px); }
.auth-side .brand { border: 0; padding: 0; margin: 0; }
.auth-side h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
.auth-side p { color: #8c98b5; margin: 0; max-width: 360px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { color: var(--navy); font-size: 26px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; }
.fld { display: block; margin-bottom: 14px; }
.fld span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.fld input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.fld input:focus { outline: 2px solid var(--signal); border-color: var(--signal); }
.auth-card .btn { width: 100%; justify-content: center; padding: 12px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13.5px; }
.auth-links a { color: var(--navy-3); font-weight: 600; }
.auth-msg { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px; margin-bottom: 14px; font-size: 13.5px; }
.auth-msg.err { background: #fdecea; color: #7a1d10; }
.auth-msg.ok { background: #dff5f0; color: #0f5247; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 24px; gap: 24px; }
  .auth-side h2 { font-size: 22px; }
  .page-head { padding: 20px 16px 0; }
  .ptable .hide-m { display: none; }
  .ver { grid-template-columns: 1fr; gap: 4px; }
}

/* --- дополнения для живых экранов --- */
.ptable .acts form button.mini { vertical-align: baseline; }
.ptable tr.editing input[type=text] { width: 100%; }
.bulk .result { padding-top: 0; }
.auth-card .fld small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-card p.note { color: var(--muted); font-size: 14px; }
.settings-table td span { color: var(--muted); }

/* --- Свободные места VACANT --- */
.seats li.vacant .nm { color: #9aa5b8; letter-spacing: 1px; font-weight: 600; }
.seats li.vacant { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(148,163,184,.08) 6px 12px); }
.vac-note { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: #9aa5b8; }

/* ================= Современный светлый стиль ================= */
:root {
  --navy: #15233b;      /* заголовки и тёмные элементы */
  --navy-2: #f1f4fa;
  --navy-3: #e7e9f2;
  --ink: #15183a;
  --signal: #0f9d8a;    /* главный акцент — бирюзово-зелёный */
  --signal-2: #0b8574;
  --orange: #f08c2e;    /* ручная правка */
  --bg: #f3f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #15233b;
  --muted: #64748b;
  --p3: #0f8a60;  --p3-bg: #e3f6ee;
  --p4: #1d5bd8;  --p4-bg: #e8effe;
  --p5: #d9480f;  --p5-bg: #ffeee3;
  --shadow: 0 1px 2px rgba(21,35,59,.04), 0 6px 20px rgba(21,35,59,.06);
  --shadow-lg: 0 2px 4px rgba(21,35,59,.04), 0 16px 40px rgba(21,35,59,.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--bg); color: var(--text); font-feature-settings: "tnum"; -webkit-font-smoothing: antialiased; }

/* Меню — белая панель, активный пункт — мягкая «таблетка» */
.side { background: #fff; color: var(--muted); border-right: 1px solid var(--line); }
.brand { color: var(--navy); border-bottom: 1px solid var(--line); font-size: 17px; letter-spacing: -.2px; }
.brand-mark { border-radius: 12px; background: #e3f5f2; color: var(--signal); box-shadow: inset 0 0 0 1px #bfe6df; }
.menu a { border-radius: 12px; color: var(--muted); font-weight: 600; }
.menu a:hover { background: var(--navy-2); color: var(--navy); }
.menu a.active { background: #e3f5f2; color: var(--signal); }
.side-foot { border-top: 1px solid var(--line); }
.side-foot b { color: var(--navy); }
.side-foot a, .side-foot button { color: var(--muted); }
.side-foot button:hover, .side-foot a:hover { color: var(--navy); }
.role { color: var(--signal); font-family: var(--font); letter-spacing: .5px; }

/* Табло — тёмно-синяя карточка с мягким синим свечением и «стеклянными» табличками */
.board { margin: 24px 32px 0; border-radius: 24px; color: #fff; padding: 26px 30px 24px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(15,157,138,.40) 0%, transparent 60%), linear-gradient(135deg, #0f1e36 0%, #16294a 100%);
  box-shadow: 0 18px 40px rgba(15,30,54,.22); }
.label { color: rgba(255,255,255,.8); font-family: var(--font); font-weight: 600; letter-spacing: 1px; font-size: 12px; }
.flap span { background: rgba(255,255,255,.10); color: #fff; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); backdrop-filter: blur(6px); font-weight: 700; font-size: 26px; padding: 6px 10px; }
.flap span.gap { background: none; color: rgba(255,255,255,.6); box-shadow: none; }
.wk a { border-radius: 12px; border: 0; background: rgba(255,255,255,.16); color: #fff; }
.wk a:hover { background: var(--signal); color: #fff; }
.meters { gap: 12px; }
.meter { background: rgba(255,255,255,.07); border-radius: 14px; padding: 10px 14px; min-width: 130px; }
.meter small { color: rgba(255,255,255,.75); font-weight: 600; letter-spacing: .6px; text-transform: none; font-size: 12px; }
.meter b { color: #fff; font-size: 22px; font-weight: 700; }
.meter b em { color: #6fe0cc; }

/* Полоса действий — белая карточка */
.bar { margin: 16px 32px 0; border: 0; border-radius: 18px; background: #fff; box-shadow: var(--shadow); padding: 12px 16px; }
.num { border-radius: 12px; border: 1px solid var(--line); background: #f8fafc; }
.num span { color: var(--muted); }
.num input { background: transparent; border-left: 1px solid var(--line); color: var(--navy); font-weight: 700; }
.meta { color: var(--muted); }

/* Кнопки */
.btn { border-radius: 12px; font-weight: 600; padding: 10px 16px; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-main { background: var(--signal); color: #fff; box-shadow: 0 6px 16px rgba(15,157,138,.30); }
.btn-main:hover { background: var(--signal-2); }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--navy); box-shadow: 0 1px 2px rgba(21,35,59,.05); }
.btn-line:hover { border-color: #cbd5e1; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-danger { background: #e5484d; color: #fff; box-shadow: 0 6px 16px rgba(229,72,77,.25); }
.btn-danger:hover { background: #d13b40; }

/* Контент, подсказки, сообщения */
.content { padding: 20px 32px 60px; }
.hint { background: #e3f5f2; color: #0b6b5e; border-radius: 14px; }
.hint .i { color: var(--signal); }
.errs li, .result li, .auth-msg { border-radius: 12px; }
.errs li { background: #fdecee; color: #a4262c; }
.errs li .i { color: #e5484d; }
.result li.ok, .auth-msg.ok { background: #e3f6ee; color: #0b6b4a; }
.result li.skip { background: #fff4e5; color: #8a4b0f; }
.result li.bad, .auth-msg.err { background: #fdecee; color: #a4262c; }
.result li.chg { background: #e8effe; color: #2446a8; }
.result li.same { background: #f1f2f8; color: var(--muted); }

/* Дни-вагоны — белые карточки */
.train { gap: 18px; }
.car { border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.car:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.car.manual { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }
.car-top { border-bottom: 1px solid var(--line); padding: 14px 16px; }
.car-day { color: var(--navy); font-weight: 600; }
.car-day b { background: #e3f5f2; color: var(--signal); font-family: var(--font); border-radius: 10px; padding: 5px 8px; letter-spacing: .5px; }
.car-date { color: var(--muted); font-family: var(--font); }
.flag { background: #fff1e3; color: #c2610f; border-radius: 999px; font-family: var(--font); letter-spacing: .3px; text-transform: none; font-weight: 700; font-size: 11.5px; padding: 3px 9px; }
.mini { color: var(--signal); font-weight: 600; }
.mini.danger { color: #e5484d; }
.cab { background: linear-gradient(135deg, #e8f1ff, #dbe9ff); color: var(--navy); border-radius: 16px; margin: 14px 16px 4px; box-shadow: inset 0 0 0 1px #bcd4f7; }
.cab-ic { border-radius: 12px; background: #fff; color: #2f6fd6; box-shadow: inset 0 0 0 1px #bcd4f7; }
.cab small { color: #4a6fa8; letter-spacing: .6px; font-weight: 600; }
.cab strong { color: var(--navy); }
.cab .tag.p4 { background: var(--p4-bg); color: var(--p4); }
.cab .tag.p5 { background: var(--p5-bg); color: var(--p5); }
.seats-head { color: var(--muted); }
.seats li { border-radius: 10px; }
.seats li:hover { background: #f5f8fc; }
.no { color: #9aa5b8; font-family: var(--font); }

/* Статусы — мягкие «таблетки» */
.tag { font-family: var(--font); font-weight: 700; border-radius: 999px; padding: 2px 8px; font-size: 11px; }

/* Правка дня */
.edit { border: 0; border-radius: 20px; box-shadow: 0 0 0 2px var(--signal), var(--shadow-lg); }
.edit-top { background: #fff; color: var(--navy); border-bottom: 1px solid var(--line); }
.edit-top .i, .edit-top span { color: var(--signal); font-family: var(--font); }
.edit select { border-radius: 12px; }
.ck { border-radius: 12px; }
.ck .box { border-radius: 6px; }
.ck:has(input:checked) { background: #e8f7f4; }
.ck:has(input:checked) .box { background: var(--signal); border-color: var(--signal); color: #fff; }
.edit-foot { background: #f8fafc; border-top: 1px solid var(--line); }

/* Пустые состояния */
.state { border: 0; border-radius: 24px; box-shadow: var(--shadow); }
.state-ic { border-radius: 20px; background: #e3f5f2; color: var(--signal); box-shadow: inset 0 0 0 1px #bfe6df; }
.state-ic.red { background: #fdecee; color: #e5484d; box-shadow: inset 0 0 0 1px #f6c2c4; }

/* Игроки */
.page-head .label { color: var(--signal); }
.page-head h1 { font-size: 30px; letter-spacing: -.5px; }
.counters { gap: 12px; }
.counter { border: 0; border-radius: 16px; box-shadow: var(--shadow); padding: 12px 16px; }
.counter small { letter-spacing: .5px; text-transform: none; font-size: 12px; font-weight: 600; }
.counter b { font-family: var(--font); font-weight: 700; font-size: 22px; }
.counter.bad { background: #fdecee; box-shadow: 0 0 0 1px #f6c2c4; }
.counter.bad b { color: #e5484d; }
.addrow, .bulk, .ptable, .hweek { border: 0; border-radius: 20px; box-shadow: var(--shadow); background: #fff; }
.addrow input[type=text], .addrow select, .ptable input[type=text], .ptable select, .search,
.bulk textarea, .bulk-side select, .fld input { border-radius: 12px; border: 1px solid var(--line); background: #f8fafc; }
.search:focus, .bulk textarea:focus, .fld input:focus, .addrow input:focus { outline: 0; border-color: var(--signal); box-shadow: 0 0 0 4px rgba(15,157,138,.12); }
.bulk-tabs { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 8px 0; }
.bulk-tabs a { border-radius: 12px 12px 0 0; color: var(--muted); font-weight: 600; }
.bulk-tabs a.on { color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); background: none; }
.bulk-side code { background: #e8f7f4; color: #0b6b5e; border-radius: 6px; }
.ptable th { background: #f8fafc; color: var(--muted); border-bottom: 1px solid var(--line); letter-spacing: .5px; }
.ptable td { border-bottom: 1px solid #eef2f6; }
.ptable tbody tr:hover td { background: #f8fafd; }
.ptable .no { font-family: var(--font); color: #9aa5b8; }
.ptable tr.editing td { background: #eefaf7; }
.ptable tr.hl-new td { background: #effaf5; }
.ptable tr.hl-new td:first-child { box-shadow: inset 3px 0 0 var(--p3); }
.ptable tr.hl-chg td { background: #f0f4ff; }
.ptable tr.hl-chg td:first-child { box-shadow: inset 3px 0 0 var(--p4); }
.ptable tr.off td { color: #9aa5b8; background: #fafafc; }
.mark { border-radius: 999px; font-weight: 600; }
.mark.new { background: var(--p3-bg); color: var(--p3); }
.mark.chg { background: var(--p4-bg); color: var(--p4); }
.mark.off { background: #eef0f5; color: #7c809c; }
.chip-f { border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; }
.chip-f:hover { color: var(--navy); border-color: #cbd5e1; }
.chip-f.on { background: var(--signal); color: #fff; border-color: var(--signal); }

/* Подтверждения, закрепление */
.confirm { border: 0; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px #f6c2c4, var(--shadow); }
.confirm-ic { border-radius: 14px; background: #fdecee; color: #e5484d; }
.confirm-text { color: var(--navy); }
.confirm-text span { color: var(--muted); }
.confirm.pin { background: #fff; box-shadow: 0 0 0 1px #bfe6df, var(--shadow); }
.confirm.pin .confirm-ic { background: #e3f5f2; color: var(--signal); }
.confirm.pin .confirm-text { color: var(--navy); }
.pinned { background: #e3f5f2; color: var(--signal); border-radius: 999px; font-weight: 700; }

/* История */
.hweek { overflow: hidden; }
.hweek-top { border-bottom: 1px solid var(--line); padding: 14px 18px; }
.hweek-top .dates { font-family: var(--font); font-weight: 700; color: var(--navy); }
.ver .v { font-weight: 600; }
.cur { background: var(--p3-bg); color: var(--p3); border-radius: 999px; font-family: var(--font); text-transform: none; letter-spacing: .2px; font-size: 11.5px; padding: 3px 9px; }
.archive { background: #e3f5f2; color: #0b6b5e; border-radius: 16px; }
.archive .i, .archive a { color: var(--signal); }
.sep { font-family: var(--font); letter-spacing: 1px; }
.sep::after { border-top: 1px dashed #d3dae5; }

/* Вход */
.auth-side { color: #fff; background: radial-gradient(90% 120% at 100% 0%, rgba(15,157,138,.40) 0%, transparent 60%), linear-gradient(135deg, #0f1e36 0%, #16294a 100%); }
.auth-side .brand { color: #fff; }
.auth-side .brand-mark { background: rgba(255,255,255,.1); color: #6fe0cc; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.auth-side p { color: rgba(255,255,255,.8); }
.auth-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card .btn { width: 100%; justify-content: center; }
.fld span { color: var(--muted); font-weight: 600; }
.auth-links a { color: var(--signal); }

@media (max-width: 860px) {
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .board { margin: 16px 16px 0; padding: 20px; }
  .bar { margin: 12px 16px 0; }
  .content { padding: 16px 16px 48px; }
}

/* Иконки — современные: тоньше линия, мягкая заливка, у кнопок — чуть мельче */
.i { width: 18px; height: 18px; }
.btn .i { width: 17px; height: 17px; }
.label .i { color: #6fe0cc; }
.menu a .i { color: #94a3b8; }
.menu a:hover .i { color: var(--navy); }
.menu a.active .i { color: var(--signal); }
.hint .i { background: #fff; border-radius: 8px; padding: 3px; width: 24px; height: 24px; box-shadow: 0 1px 2px rgba(21,35,59,.06); }

/* Свой список дня — день вне автораспределения (фиолетовый акцент) */
.car.own { box-shadow: 0 0 0 2px #7c5cd6, var(--shadow); }
.car.own .car-day b { background: #f1ecff; color: #6d4bd1; }
.flag.own { background: #f1ecff; color: #6d4bd1; }
.cab small em { font-style: normal; color: #6d4bd1; margin-left: 4px; }
.tag.p1, .tag.p2 { background: #eef0f5; color: #7c809c; }
.edit.own { box-shadow: 0 0 0 2px #7c5cd6, var(--shadow-lg); }
.edit.own .edit-top .i, .edit.own .edit-top span { color: #6d4bd1; }
.edit.own .ck:has(input:checked) { background: #f4f0ff; }
.edit.own .ck:has(input:checked) .box { background: #7c5cd6; border-color: #7c5cd6; }
.own-note { display: flex; gap: 10px; align-items: flex-start; background: #f6f3ff; color: #4b3596; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; }
.own-note .i { color: #7c5cd6; flex: none; }
.btn-own { background: #7c5cd6; color: #fff; box-shadow: 0 6px 16px rgba(124,92,214,.28); }
.btn-own:hover { background: #6a49c8; }
.edit-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.edit-tools .search { flex: 1; padding: 9px 12px; font: inherit; }
.ck[hidden] { display: none; }

/* Воскресенье — ТОП-20 VS: заметка над местами VACANT */
.vs-note { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 9px 12px; border-radius: 12px; background: #fff6e0; color: #8a5a00; font-size: 13px; font-weight: 600; line-height: 1.4; }
.vs-note .i { color: #d99a00; flex: none; }
.vs-note b { color: #6b4500; }

/* Шапка вагона: действия переносятся на вторую строку, если не влезают */
.car-top { flex-wrap: wrap; row-gap: 8px; }
.car-act { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; column-gap: 12px; }
.mini, .flag { white-space: nowrap; }

/* Помощник машиниста — отдельная строка под кабиной, янтарный акцент */
.helper { display: flex; align-items: center; gap: 10px; margin: 8px 16px 4px; padding: 8px 12px; border-radius: 14px; border: 1.5px dashed #f0b44c; background: #fffaf0; }
.helper.set { border-style: solid; background: #fff6e0; }
.helper-ic { width: 30px; height: 30px; border-radius: 10px; background: #fff; color: #d99a00; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1px #f5d9a0; }
.helper-ic .i { width: 18px; height: 18px; }
.helper small { display: block; font-size: 10.5px; color: #a0782a; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.helper strong { font-size: 14px; color: #6b4500; }
.helper strong.vac { font-family: var(--mono); letter-spacing: 1px; color: #c08a1c; }
.helper .grow { flex: 1; }
.helper .mini { color: #b77900; }
.helper .tag { margin-left: 2px; }
.helper-form { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.helper-form select { flex: 1; min-width: 150px; padding: 7px 10px; border: 1px solid #f0cf8a; border-radius: 10px; font: inherit; font-size: 13.5px; background: #fff; color: var(--navy); }
.helper-form .btn { padding: 7px 12px; font-size: 13px; }
.btn-helper { background: #e0a100; color: #fff; box-shadow: 0 6px 14px rgba(224,161,0,.25); }
.btn-helper:hover { background: #c98f00; }

/* Экран «Помощники» */
.atable td.d { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.atable td .tag { margin-left: 8px; }
.atable tr.wk { display: table-row; }
.atable tr.wk td { background: #f6f8fc; font-weight: 600; color: var(--navy); font-size: 12.5px; letter-spacing: .4px; }
.atable tr.wk td .pinned { margin-left: 8px; }
.helper-name { display: inline-flex; align-items: center; gap: 6px; color: #6b4500; font-weight: 600; }
.helper-name .i { width: 16px; height: 16px; color: #d99a00; }
.atable tr.wk td a { display: inline; width: auto; height: auto; border: 0; border-radius: 0; background: none; color: inherit; text-decoration: none; }

/* Публичная страница «Поезд недели» — для всех игроков, без входа */
.pub { max-width: 1280px; margin: 0 auto; padding-bottom: 60px; }
.pub-top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 0; }
.pub-top .brand { border: 0; padding: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pub-top .grow { flex: 1; }
.pub-top .pinned { font-size: 13px; }
.pub .board { margin-top: 16px; }
.find { margin: 16px 32px 0; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 16px; flex-wrap: wrap; }
.find label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.find .i { color: var(--signal); width: 20px; height: 20px; flex: none; }
.find input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 15px; background: #f8fafc; color: var(--navy); }
.find input:focus { outline: 0; border-color: var(--signal); box-shadow: 0 0 0 4px rgba(15,157,138,.12); background: #fff; }
.find-res { font-size: 14px; color: var(--muted); font-weight: 600; }
.find-res b { color: var(--signal); }
.find-res.none { color: #a4262c; }
.pub .content { padding-top: 18px; }
.car.found { box-shadow: 0 0 0 3px var(--signal), var(--shadow); }
.car.dim { opacity: .38; }
.seats li.me { background: #e3f5f2; border-radius: 8px; }
.seats li.me .nm, .helper.me strong, .cab.me strong { color: var(--signal); font-weight: 700; }
mark { background: none; color: inherit; }
.car-top .you { margin-left: auto; background: var(--signal); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.share { display: inline-flex; }
.car-top .you[hidden] { display: none; }

/* Выбор «R4 и R5 едут» в панели */
.num select { border: 0; border-left: 1px solid var(--line); padding: 9px 10px; font: inherit; font-weight: 700; font-size: 14px; color: var(--navy); background: transparent; cursor: pointer; }

/* Удаление недели из истории */
.ver .acts { display: inline-flex; align-items: center; gap: 16px; }
.hconfirm { padding: 12px 16px 16px; border-top: 1px solid #eef0f4; }
.hconfirm .confirm { box-shadow: 0 0 0 1px #f6c2c4; }

/* Правка закреплённой недели: прошедшие / закреплённые / выбранные дни */
.bar.corr { box-shadow: 0 0 0 2px #f0b35a, var(--shadow); }
.flag.open { display: inline-flex; align-items: center; gap: 6px; }
.flag .i { width: 14px; height: 14px; }
.flag.past { display: inline-flex; align-items: center; gap: 5px; background: #eef1f5; color: #5b6576; }
.flag.fixed { display: inline-flex; align-items: center; gap: 5px; background: #e3f5f2; color: #0f7a6c; }
.car.past { opacity: .62; }
.car.past .car-day b { background: #eef1f5; color: #5b6576; }
.car.fixed { box-shadow: 0 0 0 2px #19a38f, var(--shadow); }
.car.picked { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }
.pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #c3cbd8; display: grid; place-items: center; background: #fff; color: transparent; }
.pick.on .box { background: var(--orange); border-color: var(--orange); color: #fff; }
.pick .box .i { width: 13px; height: 13px; }
.seats li.more .nm { font-style: italic; }

/* Время отправления дня */
.dep { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; font-size: 13px; font-weight: 700; color: var(--navy); }
.dep-ic { color: var(--signal); display: inline-flex; }
.dep input { border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font: inherit; font-family: var(--mono); font-weight: 800; color: var(--navy); background: #f8fafc; width: 92px; }
.dep em { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.dep b { font-family: var(--mono); font-weight: 800; }

/* Резервная копия */
.bk { display: flex; gap: 18px; align-items: flex-start; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; flex-wrap: wrap; }
.bk-ic { width: 48px; height: 48px; border-radius: 14px; background: #e3f5f2; color: var(--signal); display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1px #bfe6df; }
.bk-ic.warn { background: #fff1e3; color: #c2610f; box-shadow: inset 0 0 0 1px #f5cf8e; }
.bk-ic .i { width: 26px; height: 26px; }
.bk-body { flex: 1; min-width: 240px; }
.bk h2 { margin: 2px 0 6px; font-size: 18px; color: var(--navy); }
.bk p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.bk-meta { font-size: 13.5px; color: var(--navy); }
.bk-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file { position: relative; display: inline-flex; align-items: center; gap: 10px; border: 1px dashed #c3cbd8; border-radius: 12px; padding: 8px 12px; cursor: pointer; background: #f8fafc; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy); }
.file em { font-style: normal; color: var(--muted); font-size: 13px; }
.bk-ok, .bk-err { display: flex; gap: 10px; align-items: center; border-radius: 14px; padding: 12px 16px; font-weight: 600; margin-bottom: 16px; }
.bk-ok { background: #e3f5f2; color: #0f7a6c; }
.bk-err { background: #fdecee; color: #b4232a; }

/* Кабинет */
.ctabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.ctabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--navy); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.ctabs a .i { width: 17px; height: 17px; }
.ctabs a.on { background: var(--navy); color: #fff; box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; color: var(--navy); }
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat b { font-size: 28px; letter-spacing: -.5px; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat.hot { background: #e3f5f2; box-shadow: inset 0 0 0 1px #bfe6df, var(--shadow); }
.stat.hot b { color: #0f7a6c; font-size: 24px; }
.kv { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid #eef0f4; font-size: 14.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { width: 110px; color: var(--muted); flex: none; }
.cform { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 12px; max-width: 460px; }
.cform.row { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: none; }
.cform input[type=text], .cform input[type=email], .cform input[type=password], .cform select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #f8fafc; }
.cform.row input[type=email] { flex: 1; min-width: 220px; }
.fld { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.fld span { font-size: 13px; font-weight: 700; color: var(--navy); }
.fld em, .sw em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.sw { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.sw input { position: absolute; opacity: 0; }
.sw i { flex: none; width: 40px; height: 24px; border-radius: 999px; background: #cfd6e1; position: relative; transition: background .15s; margin-top: 1px; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(21,35,59,.25); transition: left .15s; }
.sw input:checked + i { background: var(--signal); }
.sw input:checked + i::after { left: 19px; }
.sw span { display: flex; flex-direction: column; gap: 2px; color: var(--navy); }
.me { font-size: 11px; font-weight: 700; color: var(--signal); margin-left: 6px; }
.tag.adm { background: #e3f5f2; color: #0f7a6c; }
.wait { color: #c2610f; font-weight: 600; font-size: 13px; }
.bk-ok .mini { margin-left: auto; }
.ptable .acts form { display: inline; }
.linkbox { width: 100%; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 13px; background: #f8fafc; color: var(--navy); }

/* Смена машиниста в вагоне */
.cab .mini { margin-left: 6px; color: #2f6fd6; }
.cab-edit { flex-wrap: wrap; align-items: flex-start; }
.cab-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cab-form small { flex-basis: 100%; }
.cab-form select { flex: 1; min-width: 160px; padding: 7px 10px; border: 1px solid #bcd4f7; border-radius: 10px; font: inherit; font-size: 13.5px; background: #fff; color: var(--navy); }
.cab-form .btn { padding: 7px 12px; font-size: 13px; }
.cab-form em { flex-basis: 100%; font-style: normal; font-size: 12px; color: #4a6fa8; line-height: 1.4; }

/* Нарушения — согласованные списки и отметки в неделе. */
.nm.marked { white-space: normal; }
.violation-badge { display: table; margin-top: 3px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; line-height: 1.4; }
.violation-badge.fine, .violation-pill.fine { color: #c83c46; background: #fdecee; }
.violation-badge.warning, .violation-pill.warning { color: #ad5c0c; background: #fff1df; }
.seats li.has-fine { background: #fff5f5; }
.seats li.has-warning { background: #fff8ef; }
.violation-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.violation-intro p { color: var(--muted); margin: 0; max-width: 660px; line-height: 1.6; }
.violation-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.violation-tabs a { padding: 10px 15px; border: 1px solid var(--line); background: white; border-radius: 999px; font-weight: 600; color: var(--muted); }
.violation-tabs a.on { background: var(--signal); border-color: var(--signal); color: white; }
.violation-tabs b { margin-left: 7px; }
.violations-content h2 { font-size: 19px; margin: 26px 0 12px; }
.violation-table { overflow: auto; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.violation-table .ptable { box-shadow: none; border-radius: 0; margin: 0; }
.violation-table td { padding: 16px; line-height: 1.5; }
.violation-table td:first-child { min-width: 145px; }
.violation-table td small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.violation-pill { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.violation-edit { font-size: 13px; font-weight: 600; color: var(--signal); text-decoration: none; white-space: nowrap; }
.violation-help { background: white; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); margin-top: 28px; }
.violation-help h3 { margin: 0 0 8px; font-size: 17px; }
.violation-help p { color: var(--muted); margin: 0; line-height: 1.6; }
@media(max-width:760px) { .violation-intro { align-items: flex-start; flex-direction: column; } .violation-table table { min-width: 650px; } .violation-table td, .violation-table th { padding: 12px; } }

/* Готовая форма управления внутри приложения — по макету design/violations.html. */
.violation-modal .modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(21,35,59,.42); display: flex; align-items: center; justify-content: center; padding: 20px; }
.violation-modal .modal { background: white; border-radius: 20px; box-shadow: 0 24px 80px rgba(21,35,59,.22); padding: 28px; width: 520px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; color: var(--navy); }
.violation-modal .modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.violation-modal .modal__head h2 { margin: 0; font-size: 22px; }
.violation-modal .modal__head .btn { border: 0; background: none; color: var(--muted); font: 24px var(--font); padding: 2px 6px; }
.violation-modal .field { display: block; margin-bottom: 18px; font-weight: 600; }
.violation-modal .field input:not([type="checkbox"]), .violation-modal .field select, .violation-modal .field textarea { display: block; width: 100%; margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: var(--navy); font: 14px var(--font); }
.violation-modal .field textarea { min-height: 90px; resize: vertical; }
.violation-modal .field:nth-last-child(2) { margin-bottom: 0; }
.violation-modal .switchrow { display: grid; grid-template-columns: 25px 1fr; column-gap: 10px; align-items: center; }
.violation-modal .switchrow__text { display: contents; }
.violation-modal .switchrow__label { grid-column: 2; grid-row: 1; }
.violation-modal .switchrow input { grid-column: 1; grid-row: 1; accent-color: var(--signal); width: 18px; height: 18px; }
.violation-modal .switchrow__help { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; margin-top: 12px; }
.violation-modal .switch__track { display: none; }
.violation-modal .formactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.violation-modal .formactions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--signal); color: white; border: 0; border-radius: 12px; padding: 11px 16px; font: 600 14px var(--font); box-shadow: none; white-space: nowrap; }
.violation-modal .formactions .btn--ghost { background: white; color: var(--muted); border: 1px solid var(--line); }
.violation-modal .btn:disabled { opacity: .6; cursor: wait; }
.violation-modal .field__error { color: #c83c46; background: #fdecee; padding: 11px 12px; border-radius: 10px; font-weight: 400; margin-bottom: 16px; }
.violation-modal :is(input,select,textarea,button):focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.public-week-picker { display:flex; align-items:center; flex-wrap:wrap; gap:10px; color:var(--text); margin:0; }
.public-week-picker label { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-weight:600; }
.public-week-picker select { font:inherit; color:var(--text); background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 14px; max-width:100%; }
.public-week-picker a { font-weight:600; color:var(--signal); }
.public-week-picker select:focus-visible, .public-week-picker a:focus-visible { outline:2px solid var(--signal); outline-offset:3px; }

