/* ==========================================================================
   ЛОГИСТИКА v3 — таблица автобусов, страница заявок, редактирование
   ========================================================================== */

.lg-bus-page { display: flex; flex-direction: column; gap: 12px; }
.lg-bus-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-bus-toolbar .lg-search { flex: 1 1 260px; max-width: 360px; }
.lg-bus-table-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px; box-shadow: var(--c-shadow-sm); overflow: hidden; }
.lg-bus-table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--c-border); background: var(--c-surface-2); }
.lg-bus-table-head b { display: block; font-size: .92rem; }
.lg-bus-table-head span { display: block; color: var(--c-muted); font-size: .72rem; margin-top: 2px; }
.lg-bus-legend { display: flex; gap: 12px; color: var(--c-muted); font-size: .72rem; }
.lg-bus-legend i { margin-right: 4px; font-size: .55rem; }
.lg-bus-table-wrap { overflow: auto; }
.lg-bus-table { width: 100%; border-collapse: collapse; min-width: 1080px; font-size: .8rem; }
.lg-bus-table th { position: sticky; top: 0; z-index: 2; background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: 9px 8px; text-align: left; font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); white-space: nowrap; }
.lg-bus-table td { border-bottom: 1px solid var(--c-border); padding: 8px; vertical-align: middle; }
.lg-bus-table tbody tr:last-child td { border-bottom: none; }
.lg-bus-row { cursor: pointer; transition: background .12s; }
.lg-bus-row:hover { background: var(--c-brand-soft); }
.lg-bus-row.is-done { opacity: .78; }
.lg-bus-check-col { width: 34px; text-align: center !important; }
.lg-bus-check-col input { width: 16px; height: 16px; accent-color: var(--c-brand); cursor: pointer; }
.lg-bus-id b { display: block; font-size: .86rem; white-space: nowrap; }
.lg-bus-id small { display: block; color: var(--c-muted); font-size: .68rem; margin-top: 1px; }
.lg-bus-route { display: flex; flex-direction: column; gap: 2px; max-width: 250px; }
.lg-bus-route > span { display: block; font-size: .74rem; color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-bus-route > span:last-of-type { color: var(--c-text); font-weight: 600; }
.lg-bus-route > i { display: none; }
.lg-bus-route small { color: var(--c-muted); font-size: .64rem; }
.lg-bus-when b { display: block; font-size: .76rem; white-space: nowrap; }
.lg-bus-when span { display: block; color: var(--c-muted); font-size: .68rem; }
.lg-bus-seats b { display: block; font-size: .78rem; }
.lg-bus-seats small { display: block; color: var(--c-muted); font-size: .64rem; margin-top: 2px; }
.lg-bus-meter { height: 5px; background: var(--c-surface-2); border-radius: 999px; overflow: hidden; margin-top: 4px; width: 86px; }
.lg-bus-meter .meter__fill { display: block; height: 100%; border-radius: inherit; background: var(--c-success); }
.lg-bus-meter .meter__fill--warning { background: var(--c-warning); }
.lg-bus-meter .meter__fill--danger { background: var(--c-danger); }
.lg-bus-carrier b { display: block; font-size: .74rem; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.lg-bus-carrier small { display: block; color: var(--c-muted); font-size: .66rem; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.lg-bus-note { display: block; color: var(--c-warning); font-size: .62rem; margin-top: 2px; }
.lg-bus-price-col { text-align: right !important; white-space: nowrap; }
.lg-bus-actions { white-space: nowrap; text-align: right; }
.lg-icon-btn { width: 27px; height: 27px; border: none; background: transparent; color: var(--c-muted); border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.lg-icon-btn:hover { background: var(--c-brand-soft); color: var(--c-brand); }
.lg-icon-btn--danger:hover { background: rgba(220, 38, 38, .1); color: var(--c-danger); }

/* Страница заявок */
.rq-page { display: flex; flex-direction: column; gap: 12px; }
.rq-page__controls { display: flex; gap: 7px; margin-left: auto; flex-wrap: wrap; }
.rq-page__controls .lg-input { min-width: 260px; height: 38px; }
.rq-page .rq-summary { margin: 0; }
.rq-page .rq-toolbar { margin-top: 0; }
.rq-page .rq-list { margin-top: 0; }
.rq-edit-buses { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; max-height: 300px; overflow: auto; }
.rq-edit-bus { display: flex; align-items: center; gap: 9px; border: 1px solid var(--c-border); border-radius: 9px; padding: 7px 9px; cursor: pointer; }
.rq-edit-bus:hover { border-color: var(--c-brand); background: var(--c-brand-soft); }
.rq-edit-bus input { accent-color: var(--c-brand); }
.rq-edit-bus > div { flex: 1; min-width: 0; }
.rq-edit-bus b { display: block; font-size: .8rem; }
.rq-edit-bus small { display: flex; align-items: center; gap: 5px; color: var(--c-muted); font-size: .7rem; margin-top: 2px; }
.rq-edit-bus > span { color: var(--c-muted); font-size: .7rem; white-space: nowrap; }
.rq-bus-actions { display: flex; gap: 2px; justify-content: flex-end; }
.rq-bus-row { grid-template-columns: 1.1fr 1.4fr .8fr .7fr auto; }
@media (max-width: 900px) {
  .lg-bus-toolbar .lg-search { max-width: none; width: 100%; }
  .lg-bus-toolbar .lg-btn { flex: 1 1 auto; }
  .rq-page__controls { width: 100%; margin-left: 0; }
  .rq-page__controls .lg-input { flex: 1; min-width: 0; }
}

.lg-bus-table th:last-child, .lg-bus-table td.lg-bus-actions {
  position: sticky; right: 0; z-index: 2;
  background: var(--c-surface);
  box-shadow: -7px 0 9px -9px rgba(15, 23, 42, .35);
  width: 178px; min-width: 178px;
}
.lg-bus-table th:last-child { background: var(--c-surface); z-index: 3; }
.lg-bus-row:hover td.lg-bus-actions { background: var(--c-brand-soft); }
.lg-bus-row.is-done td.lg-bus-actions { background: var(--c-surface); }

/* ==========================================================================
   Инфопанель автобуса в окне «Кто едет»
   ========================================================================== */
.bus-info { display: flex; flex-direction: column; gap: 11px; }
.bus-info__hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 13px; background: linear-gradient(135deg, var(--c-brand-soft), var(--c-surface) 70%); }
.bus-info__identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bus-info__badge { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 9px; background: var(--c-brand); color: #fff; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.bus-info__identity h3 { margin: 0; font-size: .96rem; }
.bus-info__identity p { margin: 2px 0 0; color: var(--c-muted); font-size: .72rem; }
.bus-info__chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.bus-info__metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.bus-info__metric { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); }
.bus-info__metric > span { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; background: var(--c-surface-2); color: var(--c-brand); display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; }
.bus-info__metric b { display: block; font-size: .96rem; line-height: 1.1; }
.bus-info__metric small { display: block; color: var(--c-muted); font-size: .64rem; margin-top: 1px; }
.bus-info__metric.is-ok > span { color: var(--c-success); background: rgba(5,150,105,.08); }
.bus-info__metric.is-warning > span { color: var(--c-warning); background: rgba(217,119,6,.1); }
.bus-info__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 9px; align-items: start; }
.bus-info__card { border: 1px solid var(--c-border); border-radius: 11px; padding: 10px 11px; background: var(--c-surface); min-width: 0; }
.bus-info__card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.bus-info__card-head span { font-size: .76rem; font-weight: 750; display: inline-flex; align-items: center; gap: 5px; }
.bus-info__card-head i { color: var(--c-brand); }
.bus-info__card-head small { color: var(--c-muted); font-size: .66rem; }
.bus-info__details { margin: 0; display: flex; flex-direction: column; gap: 0; }
.bus-info__details > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--c-border); }
.bus-info__details > div:last-child { border-bottom: none; }
.bus-info__details dt { color: var(--c-muted); font-size: .68rem; }
.bus-info__details dd { margin: 0; font-size: .72rem; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bus-route-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.bus-route-stop { display: flex; align-items: flex-start; gap: 7px; position: relative; padding: 3px 0 7px 0; }
.bus-route-stop:last-child { padding-bottom: 0; }
.bus-route-stop:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 19px; bottom: -2px; width: 1px; background: var(--c-border-strong); }
.bus-route-stop__dot { width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; background: var(--c-surface); border: 1px solid var(--c-border-strong); color: var(--c-muted); font-size: .58rem; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; z-index: 1; }
.bus-route-stop--start .bus-route-stop__dot { background: #2563eb; border-color: #2563eb; color: #fff; }
.bus-route-stop--end .bus-route-stop__dot { background: #0f766e; border-color: #0f766e; color: #fff; }
.bus-route-stop small { display: block; color: var(--c-muted); font-size: .62rem; line-height: 1.2; }
.bus-route-stop b { display: block; font-size: .74rem; line-height: 1.35; margin-top: 1px; overflow-wrap: anywhere; }
.bus-people-section { border-top: 1px solid var(--c-border); padding-top: 10px; }
.bus-people-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.bus-people-section__head h3 { margin: 0; font-size: .88rem; display: flex; align-items: center; gap: 5px; }
.bus-people-section__head h3 i { color: var(--c-brand); }
.bus-people-section__head p { margin: 2px 0 0; color: var(--c-muted); font-size: .7rem; }
.bus-people-section__free { font-size: .68rem; font-weight: 650; color: var(--c-muted); background: var(--c-surface-2); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
@media (max-width: 800px) {
  .bus-info__hero { flex-direction: column; }
  .bus-info__chips { justify-content: flex-start; }
  .bus-info__metrics { grid-template-columns: 1fr 1fr; }
  .bus-info__grid { grid-template-columns: 1fr; }
  .bus-info__details > div { grid-template-columns: 100px minmax(0, 1fr); }
}
