/* Оформление в одной системе с ИИ-агентом и демо-мокапами: тёмная рабочая
   палитра, IBM Plex, высокая плотность. Диспетчерская — экран, за которым
   сидят смену целиком, поэтому контраст по срочности важнее украшений. */

:root {
  --bg: #0A0F14;
  --panel: #121A21;
  --panel-2: #17212A;
  --panel-3: #1D2935;
  --border: #223040;
  --border-soft: #1C2833;
  --text: #E9EEF2;
  --dim: #7F93A1;
  --route: #3AA0FF;
  --urgent: #FF4B5C;
  --urgent-soft: rgba(255, 75, 92, .16);
  --amber: #FFB020;
  --amber-soft: rgba(255, 176, 32, .16);
  --good: #34D399;
  --good-soft: rgba(52, 211, 153, .16);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
}

/* Дневная тема (как в агенте). Переключатель в шапке ставит data-theme="light"
   на <html>; смысл цветов тот же: синий — маршрут, красный — экстренный,
   зелёный — подтверждено. «Soft» цвета на светлом фоне плотнее. */
:root[data-theme="light"] {
  --bg: #F2F5F8;
  --panel: #FFFFFF;
  --panel-2: #F7F9FB;
  --panel-3: #EDF1F5;
  --border: #D3DCE4;
  --border-soft: #E2E8EE;
  --text: #16212B;
  --dim: #5A6B78;
  --route: #0B6FD4;
  --urgent: #D32030;
  --urgent-soft: rgba(211, 32, 48, .12);
  --amber: #B8780A;
  --amber-soft: rgba(184, 120, 10, .14);
  --good: #0F8A5F;
  --good-soft: rgba(15, 138, 95, .14);
}
:root[data-theme="light"] .login { background: radial-gradient(1200px 600px at 50% -10%, #DCE7F1, var(--bg)); }
:root[data-theme="light"] .cx-msg--them { background: var(--panel-3); color: var(--text); }
:root[data-theme="light"] .cx-map { background: #E8EEE9; }
:root[data-theme="light"] .cx-expand, :root[data-theme="light"] .cx-restore, :root[data-theme="light"] .cx-eta, :root[data-theme="light"] .cx-follow { background: rgba(255,255,255,.88); }
:root[data-theme="light"] .crew-net { background: #FDE7D3; color: #7C2D12; }
:root[data-theme="light"] .cx-overlay { background: rgba(20,30,40,.35); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; }
h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 6px; font-weight: 600; }
.dim { color: var(--dim); margin: 0; }
.dim strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------- вход */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, #1B2430, var(--bg)); z-index: 60; }
.login-card { width: 330px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 26px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 60px -30px #000; }
.login-mark { font-size: 30px; }
.login-card h1 { font-size: 20px; margin: 0; font-weight: 600; letter-spacing: .01em; }
.login-sub { margin: -6px 0 6px; color: var(--dim); font-size: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); }
input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--route); }
.login-card button { background: var(--urgent); color: #fff; border: 0; border-radius: 6px; padding: 10px; font-weight: 600; cursor: pointer; }
.login-sso { display: block; text-align: center; background: var(--urgent); color: #fff; border-radius: 6px; padding: 11px; font-weight: 600; text-decoration: none; }
.login-sso:hover { filter: brightness(1.08); }
.login-password { display: flex; flex-direction: column; gap: 12px; }
.login-or { text-align: center; color: var(--dim); font-size: 12px; margin-top: 4px; }
.login-card .login-crew { background: none; color: var(--dim); font-weight: 400; font-size: 12px; padding: 4px; text-decoration: underline; }
.link-issue { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.link-issue input { flex: 1 1 180px; }
.link-out { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.link-out textarea { width: 100%; font-family: var(--mono, monospace); font-size: 12px; word-break: break-all; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.login-error { background: var(--urgent-soft); color: #FFC3C9; border: 1px solid #5B2730; border-radius: 6px; padding: 8px 10px; font-size: 12px; }

/* ----------------------------------------------------------------- каркас */
.app, .crew-app { height: 100%; display: flex; flex-direction: column; }
.topbar { flex: none; height: 46px; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-mark { font-size: 16px; }
.stand-badge { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 20px; background: var(--amber-soft); color: var(--amber); border: 1px solid #4A3A18; }
.stand-badge[data-prod="1"] { background: var(--urgent-soft); color: #FF98A2; border-color: #5B2730; }
.tabs { display: flex; gap: 2px; }
.tab { background: transparent; border: 0; color: var(--dim); padding: 7px 11px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.is-active { background: var(--panel-3); color: var(--text); }
.tab-badge { background: var(--route); color: #04121F; border-radius: 20px; font-size: 10px; font-weight: 700; padding: 1px 6px; font-family: var(--mono); }
.tab-badge--urgent { background: var(--urgent); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { background: transparent; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 4px; border-radius: 5px; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn[data-off="1"] { opacity: .4; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; padding: 3px 7px; border-radius: 20px; border: 1px solid var(--border); color: var(--dim); white-space: nowrap; }
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.clock { font-family: var(--mono); font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.conn[data-state="open"] { background: var(--good); }
.conn[data-state="closed"] { background: var(--urgent); }
.user-chip { display: flex; align-items: center; gap: 7px; font-size: 12px; padding-left: 10px; border-left: 1px solid var(--border); }
.user-role { font-family: var(--mono); font-size: 10px; color: var(--dim); }

.views { flex: 1; min-height: 0; }
.view { display: none; height: 100%; }
.view.is-active { display: block; }
.page { height: 100%; overflow: auto; padding: 18px 20px 40px; }
.page--cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-content: start; }
.page-head { margin-bottom: 14px; max-width: 900px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.formula { font-family: var(--mono); font-size: 11.5px; color: var(--route); background: var(--bg); border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px; overflow-x: auto; }

/* ----------------------------------------------------------------- канбан */
.board-wrap { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 250px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); min-height: 0; }
.col { background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.col-head { flex: none; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.col-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
.col-count { font-family: var(--mono); font-size: 11px; color: var(--dim); background: var(--panel-3); border-radius: 20px; padding: 1px 7px; }
.col-head .btn { margin-left: auto; }
.col--attention .col-title { color: var(--urgent); }
.col--progress .col-title { color: var(--route); }
.col--done .col-title { color: var(--good); }
.col--cancelled .card-order { opacity: .7; }
.col-body { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.col-body:empty::before { content: attr(data-empty); color: #3C4B58; font-size: 12px; text-align: center; padding-top: 24px; }

.card-order {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius); padding: 10px; cursor: pointer;
}
.card-order:hover { background: var(--panel-2); }
.card-order[data-priority="emergency"] { border-left-color: var(--urgent); }
.card-order[data-priority="urgent"] { border-left-color: var(--amber); }
.card-order[data-status="attention"] { background: linear-gradient(90deg, rgba(255,75,92,.08), var(--panel) 45%); }
.card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.order-tag { font-family: var(--mono); font-size: 11px; color: var(--route); font-weight: 600; }
.card-addr { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.card-reason { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-family: var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--panel-3); color: var(--dim); white-space: nowrap; }
.tag--crew { background: rgba(58,160,255,.14); color: var(--route); }
.tag--manual { background: var(--amber-soft); color: var(--amber); }
.tag--urgent { background: var(--urgent-soft); color: #FF98A2; }
.tag--good { background: var(--good-soft); color: var(--good); }
.tag--agent { background: rgba(124,77,255,.16); color: #C0A9FF; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.crew-rail { background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel-head { flex: none; height: 40px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
.crew-list { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.crew-item { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 10px; }
.crew-item-top { display: flex; align-items: center; gap: 7px; }
.crew-name { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.crew-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }
.crew-dot[data-s="free"] { background: var(--good); }
.crew-dot[data-s="busy"] { background: var(--route); }
.crew-dot[data-s="offered"] { background: var(--amber); }
.crew-dot[data-s="offline"] { background: #3C4B58; }
.crew-meta { font-size: 11px; color: var(--dim); margin-top: 3px; }

/* ---------------------------------------------------------------- карточка */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,8,12,.72); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: min(680px, 100%); max-height: 88vh; overflow: auto; padding: 18px; position: relative; box-shadow: 0 30px 70px -30px #000; }
.modal--form { display: flex; flex-direction: column; gap: 10px; }
.modal--form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: transparent; border: 0; color: var(--dim); font-size: 15px; cursor: pointer; }
.modal-head { display: flex; align-items: center; gap: 8px; }
.modal-addr { font-size: 17px; font-weight: 600; margin: 6px 0 12px; }
.tabs--modal { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.modal-grid { display: grid; grid-template-columns: 120px 1fr; gap: 5px 10px; font-size: 12.5px; }
.modal-grid dt { color: var(--dim); }
.modal-grid dd { margin: 0; }
.modal-crew { margin: 12px 0; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--border); }
.timeline li { padding: 4px 0 4px 12px; position: relative; font-size: 12px; color: var(--dim); }
.timeline li::before { content: ''; position: absolute; left: -4px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.timeline li strong { color: var(--text); font-weight: 600; }
.timeline time { font-family: var(--mono); font-size: 10.5px; margin-left: 6px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.cand { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.cand[data-status="accepted"] { border-color: #1E5B45; background: var(--good-soft); }
.cand[data-status="declined"], .cand[data-status="timeout"] { opacity: .6; }
.cand-pos { font-family: var(--mono); color: var(--dim); font-size: 11px; }
.cand-name { font-family: var(--mono); font-weight: 600; }
.cand-detail { font-size: 11px; color: var(--dim); width: 100%; font-family: var(--mono); }
.cand-timer { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--amber); }

/* --------------------------------------------------------------------- чат */
.chat-log { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 6px; }
.msg { max-width: 82%; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.msg--coordinator { align-self: flex-end; background: #2E6FF2; }
.msg--crew { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border-soft); }
.msg--system { align-self: center; background: var(--panel-3); color: var(--dim); font-size: 11.5px; }
.msg .who { display: block; font-size: 10px; opacity: .8; margin-bottom: 2px; font-weight: 600; }
.msg time { display: block; font-family: var(--mono); font-size: 9.5px; opacity: .7; margin-top: 3px; text-align: right; }
.chat-input { display: flex; gap: 7px; margin-top: 8px; }
.chat-input input { flex: 1; }

.chat-fab { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; background: var(--route); color: #04121F; border: 0; cursor: pointer; display: grid; place-items: center; box-shadow: 0 12px 30px -10px #000; z-index: 40; }
.chat-fab-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 20px; background: var(--urgent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; font-family: var(--mono); }
.shift-chat { position: fixed; right: 18px; bottom: 74px; width: 330px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; z-index: 41; box-shadow: 0 24px 50px -24px #000; }
.shift-chat-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.shift-chat-title { font-weight: 600; font-size: 13px; }
.shift-chat-sub { font-size: 11px; color: var(--dim); }
.shift-chat-head .icon-btn { margin-left: auto; }

/* ------------------------------------------------------------------ кнопки */
.btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-3); }
.btn--primary { background: var(--route); color: #04121F; border-color: transparent; font-weight: 600; }
.btn--danger { background: var(--urgent-soft); color: #FF98A2; border-color: #5B2730; }
.btn--warn { background: var(--amber-soft); color: var(--amber); border-color: #4A3A18; }
.btn--sm { padding: 4px 9px; font-size: 11.5px; }
.btn--big { padding: 14px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }

/* --------------------------------------------------------------- таблицы */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; padding: 8px 10px; background: var(--panel-2); color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table tbody tr:hover { background: var(--panel-2); }
.mono { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.form { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.form--row { flex-direction: row; flex-wrap: wrap; align-items: center; }
.form label { font-size: 12px; color: var(--dim); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.form label span { flex: 1; }
.form input[type="number"] { width: 92px; }
.form-actions { display: flex; gap: 8px; align-items: center; }
.saved { font-size: 11px; color: var(--good); }

/* ---------------------------------------------------------- экран экипажа */
.crew-app { background: var(--bg); }
.crew-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
.crew-callsign { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.crew-sub { font-size: 11.5px; color: var(--dim); }
.crew-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.crew-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.crew-offer { background: linear-gradient(180deg, rgba(255,75,92,.14), var(--panel)); border: 1px solid #5B2730; border-radius: 12px; padding: 16px; }
.crew-offer-head { display: flex; align-items: center; gap: 9px; }
.offer-timer { margin-left: auto; font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--amber); font-variant-numeric: tabular-nums; }
.offer-timer[data-low="1"] { color: var(--urgent); }
.crew-offer-addr { font-size: 19px; font-weight: 600; margin: 10px 0 4px; }
.crew-offer-reason { color: var(--dim); font-size: 13.5px; }
.crew-offer-actions { display: flex; gap: 10px; margin-top: 16px; }
.crew-offer-actions .btn { flex: 1; }
.crew-order { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.crew-status-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.crew-chat { max-height: 200px; }
.crew-idle { margin: auto; text-align: center; color: var(--dim); padding: 40px 20px; }

/* ----------------------------------------------------------------- тосты */
.toasts { position: fixed; right: 14px; bottom: 74px; display: flex; flex-direction: column; gap: 7px; z-index: 45; }
.toast { background: var(--panel-3); border: 1px solid var(--border); border-left: 3px solid var(--route); border-radius: 6px; padding: 9px 12px; font-size: 12.5px; max-width: 330px; box-shadow: 0 12px 30px -12px #000; }
.toast[data-tone="urgent"] { border-left-color: var(--urgent); }
.toast[data-tone="warn"] { border-left-color: var(--amber); }
.toast[data-tone="good"] { border-left-color: var(--good); }

@media (max-width: 1100px) {
  .board-wrap { grid-template-columns: 1fr; }
  .crew-rail { display: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; }
  .shift-chat { width: calc(100vw - 36px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* Экран бригады: время в пути и кнопка маршрута */
.crew-offer-eta { font-size: 15px; color: var(--dim); margin: 4px 0 10px; }
.crew-route { width: 100%; margin: 6px 0 10px; }

/* Окно выдачи входа в приложение */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel, #161b22); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; max-width: 440px; width: 100%; }
.modal h3 { margin: 0 0 10px; }
.app-card .qr { background: #fff; padding: 10px; width: max-content; margin: 8px 0 12px; border-radius: 6px; }

/* Выезд профиля «Нарко/Психо» — видно на карточке канбана. */
.tag--narco { background: color-mix(in srgb, #a855f7 22%, transparent); color: #d8b4fe; }

/* ------------------------------------------------------------------ карта */
.view--map { position: relative; }
.map-full { height: calc(100vh - 140px); min-height: 360px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.map-box { height: 360px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.map-box--crew { height: 260px; margin: 10px 0; }
.map-note { margin-top: 6px; font-size: 12px; }
.map-legend { margin-top: 6px; font-size: 12px; }
.map-pin { cursor: pointer; font: 600 11px/1 system-ui, sans-serif; white-space: nowrap; }
.map-pin--crew { padding: 3px 6px; border-radius: 10px; color: #fff; background: #6b7280; border: 2px solid #fff; box-shadow: 0 1px 4px #0006; }
.map-pin--crew[data-status="free"] { background: #16a34a; }
.map-pin--crew[data-status="busy"] { background: #dc2626; }
.map-pin--crew[data-status="offered"] { background: #d97706; }
.map-pin--order { padding: 4px 7px; border-radius: 6px 6px 6px 0; color: #fff; background: #1d4ed8; border: 2px solid #fff; box-shadow: 0 1px 4px #0006; }
.map-pin--order[data-status="attention"] { background: #b91c1c; }
.lg { padding: 1px 6px; border-radius: 8px; color: #fff; margin-right: 4px; }
.lg--free { background: #16a34a; } .lg--busy { background: #dc2626; } .lg--offered { background: #d97706; } .lg--offline { background: #6b7280; }

/* ------------------------------------------------- экран бригады без связи */
.crew-net { background: #7c2d12; color: #fed7aa; padding: 8px 14px; font-size: 13px; text-align: center; }
.crew-offline-line { background: color-mix(in srgb, #d97706 18%, transparent); border: 1px solid #d97706; border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.crew-offline-line .btn--big { width: 100%; margin-top: 8px; }
.crew-mapdl { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 14px; }
.crew-mapdl h4 { margin: 0 0 6px; }
.crew-mapdl-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.crew-mapdl-bar span { display: block; height: 100%; width: 0; background: #2f7de1; transition: width .3s; }
.crew-mapdl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ================================================ экран бригады (макет 16.10) */
.cx { --cx-map: 50%; }
.cx-top { flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--border); font-size: 12px; }
.cx-callsign { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.cx-clock { font-family: var(--mono); color: var(--dim); margin: 0 auto; font-variant-numeric: tabular-nums; }
.cx-chips { display: flex; gap: 6px; align-items: center; }
.cx-chip { display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px var(--mono); padding: 4px 8px; border-radius: 20px; border: 1px solid transparent; background: var(--good-soft, rgba(52,211,153,.16)); color: var(--good, #34d399); white-space: nowrap; }
.cx-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cx-chip[data-s="warn"] { background: rgba(255,176,32,.16); color: #ffb020; }
.cx-chip[data-s="bad"] { background: rgba(255,75,92,.16); color: #ff4b5c; }
button.cx-chip { cursor: pointer; }
.cx-gear { background: none; border: 0; color: var(--dim); font-size: 18px; padding: 4px 2px 4px 6px; cursor: pointer; }

.cx-body { position: relative; flex: 1; overflow: hidden; }
.cx-map, .cx-side { position: absolute; transition: all .45s cubic-bezier(.65,0,.35,1); overflow: hidden; }
.cx-map { background: #0b1613; }
.cx-side { background: var(--panel); display: flex; flex-direction: column; }
/* MapLibre ставит контейнеру position: relative — растягиваем размерами, не inset. */
.cx-map-canvas { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.cx-map-empty { position: absolute; inset: 0; display: grid; place-items: center; }

/* доли карты по этапу */
.cx-body[data-phase="idle"], .cx-body[data-phase="incoming"] { --cx-map: 50%; }
.cx-body[data-phase="enroute"] { --cx-map: 66%; }
.cx-body[data-phase="arrived"] { --cx-map: 33%; }
/* разворот сильнее доли этапа (и портретной, и альбомной) */
.cx-body[data-phase][data-focus="map"] { --cx-map: 100% !important; }
.cx-body[data-phase][data-focus="side"] { --cx-map: 0% !important; }

/* альбомная (планшет, телефон боком) — рядом, как в макете */
@media (orientation: landscape) {
  .cx-map { top: 0; bottom: 0; left: 0; width: var(--cx-map); border-right: 1px solid var(--border); }
  .cx-side { top: 0; bottom: 0; right: 0; width: calc(100% - var(--cx-map)); }
  .cx-body[data-phase="enroute"] .cx-map { left: auto; right: 0; }
  .cx-body[data-phase="enroute"] .cx-side { right: auto; left: 0; }
}
/* портретная (телефон) — карта сверху, панель снизу */
@media (orientation: portrait) {
  .cx-body[data-phase="idle"], .cx-body[data-phase="incoming"] { --cx-map: 38%; }
  .cx-body[data-phase="enroute"] { --cx-map: 55%; }
  .cx-body[data-phase="arrived"] { --cx-map: 26%; }
  .cx-map { left: 0; right: 0; top: 0; height: var(--cx-map); border-bottom: 1px solid var(--border); }
  .cx-side { left: 0; right: 0; bottom: 0; height: calc(100% - var(--cx-map)); }
}
/* Невысокий телефон (≤ 800 px): карте меньше, чтобы кнопки вызова не уходили за край и не налезали на содержимое */
@media (orientation: portrait) and (max-height: 800px) {
  .cx-body[data-phase="enroute"] { --cx-map: 46%; }
  .cx-body[data-phase="arrived"] { --cx-map: 18%; }
}
.cx-body[data-focus="map"] .cx-side, .cx-body[data-focus="side"] .cx-map { opacity: 0; pointer-events: none; }

.cx-expand, .cx-restore { position: absolute; top: 8px; right: 8px; z-index: 6; font-size: 11px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); background: rgba(10,15,20,.75); color: var(--dim); cursor: pointer; }
.cx-restore { display: none; }
.cx-body[data-focus="map"] .cx-map .cx-restore, .cx-body[data-focus="side"] .cx-side .cx-restore { display: block; }
.cx-body[data-focus="map"] .cx-map .cx-expand, .cx-body[data-focus="side"] .cx-side .cx-expand { display: none; }
.cx-side .cx-expand, .cx-side .cx-restore { top: 6px; }
.cx-eta { position: absolute; top: 10px; left: 10px; z-index: 5; background: rgba(10,15,20,.78); border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; }
.cx-eta .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.cx-eta .v { font: 600 19px var(--mono); font-variant-numeric: tabular-nums; }

.cx-block { display: none; flex-direction: column; height: 100%; min-height: 0; }
.cx-body[data-phase="idle"] .cx-idle, .cx-body[data-phase="incoming"] .cx-idle { display: flex; }
.cx-body[data-phase="enroute"] .cx-enroute { display: flex; }
.cx-body[data-phase="arrived"] .cx-arrived { display: flex; }

.cx-tabs { flex: none; display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); padding-right: 110px; }
.cx-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: 500 13px inherit; padding: 9px 10px; cursor: pointer; margin-bottom: -1px; }
.cx-tab.is-active { color: var(--text); border-bottom-color: var(--route); }
.cx-badge { display: inline-block; min-width: 8px; height: 8px; border-radius: 50%; background: var(--urgent, #ff4b5c); margin-left: 6px; vertical-align: middle; }
.cx-panel { display: none; flex: 1; min-height: 0; flex-direction: column; overflow: auto; }
.cx-panel.is-active { display: flex; }
.cx-idle .crew-offline-line { margin: 12px 12px 0; }
.cx-online { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; padding-right: 110px; font-size: 12.5px; }

.cx-history { list-style: none; margin: 0; padding: 4px 0; }
.cx-history li { padding: 10px 14px; border-bottom: 1px solid var(--border-soft, var(--border)); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.cx-history .t { font: 11px var(--mono); color: var(--dim); }
.cx-history .o { color: var(--dim); font-size: 12px; }
.cx-history .empty { color: var(--dim); text-align: center; padding: 24px; border: 0; }

.cx-chat-log { flex: 1; min-height: 60px; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cx-msg { max-width: 86%; padding: 7px 10px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.cx-msg .who { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-bottom: 2px; }
.cx-msg--them { background: #1d2a36; align-self: flex-start; border-bottom-left-radius: 3px; }
.cx-msg--mine { background: #2e6ff2; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.cx-msg--system { align-self: center; background: none; color: var(--dim); font: 11px var(--mono); text-align: center; }
.cx-msg--wait { opacity: .6; }
.cx-chat-input { flex: none; display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); }
.cx-chat-input input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 9px 13px; color: var(--text); font-size: 14px; }

.cx-order { flex: none; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cx-order--full { border: 0; padding-right: 14px; }
.cx-addr { font-size: 16px; font-weight: 600; margin: 8px 0 2px; }
.cx-note { font-size: 13px; color: var(--dim); line-height: 1.45; }
.cx-meta { display: flex; gap: 18px; margin-top: 8px; }
.cx-meta .l, .cx-field .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.cx-meta .v { font: 600 13px var(--mono); }
.cx-fields { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 12px; }
.cx-field .v { font-size: 13px; }
.cx-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cx-actions .btn, .cx-bottom-actions .btn { flex: 1; min-height: 46px; }
/* «Выехали / На месте» — обёртка не должна мешать кнопке растянуться, как соседи */
#crewStatusButtons { display: contents; }
/* Следующий шаг («Выехали», «На месте») — первым и во всю ширину: на телефоне он не уходит за край */
#crewStatusButtons .btn { order: -1; flex-basis: 100%; }
.cx-bottom-actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.cx-bottom-actions .btn { flex: 1 1 auto; }
.cx-bottom-actions .btn--ghost { min-height: 38px; }
.cx-duration { margin: 4px 14px 12px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.cx-duration-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#cxDurationCancel { margin-top: 8px; }
.cx-duration-options .btn { flex: 1 0 22%; font-family: var(--mono); }
.cx-duration-result { margin: 4px 14px 12px; padding: 10px 12px; border-radius: 10px; background: rgba(52,211,153,.14); font-size: 13px; }
.cx-duration-result > div:first-child { display: flex; justify-content: space-between; }
.cx-duration-adjust { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cx-duration-adjust .btn { flex: 1; }
.cx-duration-result b { color: #34d399; font-family: var(--mono); }

.cx-overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,7,10,.55); }
.cx-overlay[hidden] { display: none; }
.cx-overlay--top { z-index: 40; }
.modal-work { margin: 10px 0; }
.modal-work h4 { margin: 0 0 6px; font-size: 13px; }
.modal-work .svc-row input.svc-price { width: 110px; }
.modal-work .svc-list { max-height: 300px; min-height: 0; }
.modal-work .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.modal-work label.t { display: flex; flex-direction: column; font-size: 12px; color: var(--dim); gap: 3px; }
.cx-sheet--tall { max-height: calc(100% - 28px); display: flex; flex-direction: column; }
.svc-list { overflow-y: auto; flex: 1 1 auto; min-height: 120px; margin: 8px 0; border-top: 1px solid var(--border); }
.svc-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); }
.svc-row label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.svc-row input[type=checkbox] { width: 20px; height: 20px; }
.svc-row input.svc-price { width: 96px; text-align: right; font-family: var(--mono); }
.svc-row input.svc-price:disabled { opacity: .35; }
.svc-total { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 2px; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cx-chips .is-on { border-color: var(--route, #2f7de1); color: var(--route, #2f7de1); }
.cx-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); margin-top: 8px; }
.cx-label input { font-size: 15px; padding: 9px; }
.svc-done { list-style: none; padding: 0; margin: 4px 0; }
.svc-done li { display: flex; justify-content: space-between; padding: 3px 0; }
.cx-sheet { width: min(94%, 460px); margin-bottom: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px 16px 10px 10px; padding: 16px; box-shadow: 0 -12px 40px rgba(0,0,0,.5); }
.cx-sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-sheet-head .crew-timer { margin-left: auto; font-family: var(--mono); }
.svc-total-top { margin-left: auto; font-size: 15px; }
.svc-total-top b { font-family: var(--mono); color: #34d399; }
.cx-sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
.cx-sheet-actions .btn { flex: 1; min-height: 46px; }
.cx-sheet-actions--col { flex-direction: column; }
.order-tag--warn { color: #ffb020; background: rgba(255,176,32,.16); }
.cx-swipe { position: relative; margin-top: 14px; height: 50px; border-radius: 25px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; touch-action: none; user-select: none; }
.cx-swipe-fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #34d399, #22b98a); }
.cx-swipe-label { position: absolute; inset: 0; padding: 0 12px 0 54px; text-align: center; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: var(--dim); }
.cx-swipe-thumb { position: absolute; top: 4px; left: 4px; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #0a0f14; display: grid; place-items: center; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

.cx-settings { position: absolute; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.cx-settings[hidden] { display: none; }
.cx-settings-top { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--border); }
.cx-settings-body { flex: 1; overflow: auto; padding: 4px 16px 24px; }
.cx-settings-body section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.cx-settings-body h4 { margin: 0 0 8px; }
.cx-settings-body .crew-mapdl { margin: 0; border-top: 0; }
.cx-kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; font-size: 13px; }
.cx-kv dt { color: var(--dim); }
.cx-kv dd { margin: 0; }
.cx-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.crew-app.cx { position: relative; }

/* ---------------------------------------------- чаты координатора (16.10) */
.chat-list { flex: 1; overflow: auto; }
.chat-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft, var(--border)); cursor: pointer; }
.chat-list-item:hover { background: var(--panel-2); }
.chat-list-item .nm { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.chat-list-item .lt { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item .tx { flex: 1; min-width: 0; }
.chat-list-item .un { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--urgent, #ff4b5c); color: #fff; font: 600 11px/18px var(--mono); text-align: center; }
.chat-list-sep { padding: 8px 12px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.crew-chat-btn { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 2px; position: relative; }
.crew-chat-btn[data-unread]::after { content: attr(data-unread); position: absolute; top: -6px; right: -8px; min-width: 14px; height: 14px; border-radius: 7px; background: var(--urgent, #ff4b5c); color: #fff; font: 600 9px/14px var(--mono); text-align: center; padding: 0 3px; }
.cx-follow { position: absolute; bottom: 44px; right: 10px; z-index: 6; font-size: 13px; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--route); background: rgba(10,15,20,.85); color: var(--text); cursor: pointer; }

/* --------------------------------------- заявка 1С → Ирида (колонка экипажей) */
/* снизу — место под круглую кнопку чатов (она закреплена в углу экрана) */
.onec-push { flex: none; border-top: 1px solid var(--border); max-height: 55%; overflow: auto; padding-bottom: 64px; }
.onec-form { display: flex; gap: 6px; padding: 8px; }
.onec-form input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; color: var(--text); font-size: 12px; }
.onec-preview { padding: 0 8px 10px; font-size: 12px; }
.onec-preview dl { display: grid; grid-template-columns: 78px 1fr; gap: 3px 6px; margin: 0 0 8px; }
.onec-preview dt { color: var(--dim); }
.onec-preview dd { margin: 0; word-break: break-word; }
.onec-preview .warn { color: var(--urgent, #f87171); margin: 4px 0; }
.onec-preview .ok { color: var(--good, #4ade80); margin: 6px 0 0; }
.onec-preview .btn { width: 100%; }
.cx-history li[data-past] { cursor: pointer; }
.cx-history li[data-past]:active { background: var(--panel-2); }
#crewPast .timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
#crewPast .timeline li { padding: 4px 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
#crewPast .timeline time { font-family: var(--mono); color: var(--dim); margin-right: 6px; }

/* Меню на вызове (20.10): история, личный чат и чат смены поверх вызова. */
.cx-back-order { display: none; margin: 10px 12px 0; }
.cx-body[data-menu="1"] .cx-back-order { display: block; }
.cx-body[data-menu="1"][data-phase="enroute"] .cx-enroute,
.cx-body[data-menu="1"][data-phase="arrived"] .cx-arrived { display: none; }
.cx-body[data-menu="1"][data-phase="enroute"] .cx-idle,
.cx-body[data-menu="1"][data-phase="arrived"] .cx-idle { display: flex; }
.cx-body[data-menu="1"] #crewOnlineRow, .cx-body[data-menu="1"] #crewOfflineLine { display: none !important; }
.cx-tab[data-menu-open] { margin-left: auto; }
.req { color: #FF98A2; }
.cx-attn { animation: cx-attn 1.2s ease 2; }
@keyframes cx-attn { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px #f59e0b; } }

/* Отчёт по вызовам (20.10) */
.rep-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.rep-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); }
.rep-form input, .rep-form select { min-height: 34px; }
.rep-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rep-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rep-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.rep-card .l { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.rep-card .v { font: 600 20px var(--mono); margin-top: 4px; }
.rep-crews { max-width: 640px; margin-bottom: 14px; }
.rep-table tbody tr { cursor: pointer; }

/* картинки в чатах (21.10) */
.attach-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; cursor: pointer; font-size: 18px; user-select: none; flex: 0 0 auto; }
.msg-img { display: block; max-width: min(240px, 100%); max-height: 240px; margin: 4px 0; border-radius: 8px; cursor: zoom-in; object-fit: cover; }
.img-view { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 12px; }
.img-view img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* MAX */
.max-card .code { font: 600 34px/1.2 ui-monospace, monospace; letter-spacing: 6px; margin: 8px 0; }
.max-badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--good-soft); color: var(--good); }
.max-btn { font: 700 11px/1 inherit; letter-spacing: .5px; width: auto; padding: 0 8px; }
.max-btn.is-on { color: var(--good); }

/* ---------------------------------------------- график бригад (22.10.2026) */
.login-card a.login-crew { text-align: center; }
body.is-brigadier #tabs, body.is-brigadier #maxBtn, body.is-brigadier #soundBtn, body.is-brigadier #chipCrews,
body.is-brigadier #conn, body.is-brigadier #supportSlot, body.is-brigadier #clock, body.is-brigadier #chatFab, body.is-brigadier #shiftChat { display: none !important; }
.sched-now { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.sched-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.sched-nav { display: inline-flex; align-items: center; gap: 8px; }
.sched-nav b { min-width: 110px; text-align: center; text-transform: capitalize; }
.sched-tpl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; margin-bottom: 10px; }
.sched-tpl input, .sched-tpl select { width: auto; }
/* Своя прокрутка у таблицы в обе стороны: только так шапка с днями прилипает сверху */
.sched-wrap { overflow: auto; max-height: calc(100dvh - 150px); -webkit-overflow-scrolling: touch; margin-bottom: 16px; }
.sched-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sched-table th, .sched-table td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--border-soft); min-width: 30px; }
.sched-table .sched-name { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; min-width: 150px; max-width: 190px;
  padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sched-table thead th { font-weight: 600; }
.sched-table thead th, .sched-table thead td { position: sticky; top: 0; z-index: 2; background: var(--panel); }
.sched-table thead .sched-head-times > * { top: var(--sched-h1, 34px); box-shadow: inset 0 -1px 0 var(--border); }
.sched-table thead .sched-name { z-index: 3; }
.sched-table thead .is-today { background: var(--panel-3); }
.sched-table .sched-group .sched-name { cursor: pointer; user-select: none; white-space: normal; line-height: 1.25; }
.sched-caret { display: inline-block; width: 12px; color: var(--text); }
.sched-count { font-weight: 400; opacity: .7; }
.sched-sum { color: var(--good); font-size: 10px; }
.sched-table .is-weekend { color: var(--amber); }
.sched-table .is-today { background: var(--panel-3); }
.sched-table .sched-group th { padding: 8px 8px 3px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sched-time { font-family: var(--mono); font-size: 10px; line-height: 1.2; color: var(--route); cursor: pointer; }
.sched-time sup { color: var(--amber); }
.sched-cell input { width: 18px; height: 18px; margin: 0; accent-color: var(--good); cursor: pointer; }
.sched-cell.is-busy input { opacity: .35; }
.sched-other { display: block; font-size: 9px; color: var(--amber); line-height: 1; }
.sched-person { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.sched-times { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.sched-times label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.crew-pair { font-family: inherit; font-size: 11px; white-space: normal; }
@media (max-width: 700px) {
  body.is-brigadier .topbar { gap: 8px; }
  .sched-table .sched-name { min-width: 110px; max-width: 120px; }
}

/* -------------------------------------------- ПИН-код (22.10.2026) */
.pin-btn.is-warn { color: var(--amber); }
.pin-card { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.pin-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.pin-card input[type=password] { letter-spacing: .3em; font-size: 18px; }
body.is-brigadier #pinBtn { display: none !important; }

/* -------------------------- выбор нескольких профилей экипажа (28.10.2026) */
.ms { position: relative; display: inline-block; min-width: 150px; }
.ms > summary { list-style: none; cursor: pointer; padding: 6px 28px 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); font-size: 12.5px; white-space: nowrap; position: relative; }
.ms > summary::-webkit-details-marker { display: none; }
.ms > summary::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.ms[open] > summary::after { content: '▴'; }
.ms-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 260px; padding: 8px 10px; display: flex; flex-direction: column;
  gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ms-menu label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; white-space: nowrap; }
