:root {
  --navy: #14213d; --navy-2: #1d2d50; --accent: #f59e0b; --accent-2: #d97706;
  --bg: #f4f6fa; --card: #fff; --text: #1a2233; --muted: #6b7489; --line: #e3e7ef;
  --green: #15803d; --green-bg: #e8f6ee; --red: #b42318; --red-bg: #fdecea; --blue: #1d4ed8;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iPhone: вырез / Dynamic Island. Полоса под статус-баром в цвет меню, контент начинается ниже. */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--navy); z-index: 70; pointer-events: none; }
.side { padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); }
.auth { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
#toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d2e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #c9d2e6; font-weight: 500; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--accent); color: var(--navy); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { background: none; border: 0; color: #9fb0d0; padding: 0; cursor: pointer; margin-top: 4px; }
.main { min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* cards & grid */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 14px; }
.two { grid-template-columns: 1fr 1fr; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; white-space: nowrap; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.alert { border-left: 4px solid var(--red); }
.kpi.alert .value { color: var(--red); }
.kpi.ok .value { color: var(--green); }

/* bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 120px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-track { background: #eef1f6; border-radius: 4px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-fill.red { background: #e5484d; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; background: #fafbfd; position: sticky; top: 0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fafbfe; }
tfoot td { font-weight: 700; background: #fafbfd; border-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { margin-left: 4px; }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-red { background: var(--red-bg); color: var(--red); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-amber { background: #fff4e0; color: #9a5b00; }
.b-gray { background: #eef1f6; color: #4a5468; }
.b-blue { background: #e6eefc; color: var(--blue); }

/* forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #c7cfdd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters input, .filters select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.filters input[type=search] { min-width: 220px; }
.seg { display: inline-flex; background: #e8ecf3; border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .filters select:focus { outline: 2px solid #fcd38a; border-color: var(--accent); }
.field textarea { min-height: 70px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.err { color: var(--red); background: var(--red-bg); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast-item { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 500; }
.toast-item.error { background: var(--red); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy) 0%, #24396b 100%); padding: 16px; }
.auth .box { background: #fff; border-radius: 16px; padding: 28px; width: min(380px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth h1 { margin: 10px 0 4px; font-size: 21px; }
.auth p { margin: 0 0 18px; color: var(--muted); }
.auth .field { margin-bottom: 12px; }
.auth .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

/* account chips */
.acc-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.acc { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; border: 2px solid transparent; }
.acc.on { border-color: var(--accent); }
.acc .n { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.acc .v { font-size: 18px; font-weight: 700; margin-top: 2px; white-space: nowrap; }

/* report / analytics */
.three { grid-template-columns: repeat(3, 1fr); }
.full2 { grid-column: 1 / -1; }
.kvs { display: flex; flex-direction: column; margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv.strong span { color: var(--text); font-weight: 700; }
.kv.strong b { font-size: 15px; }
.checks .kv span:first-child { color: var(--text); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pair .field label { font-size: 11px; }
.table-wrap.flat { box-shadow: none; border: 1px solid var(--line); }
table.cur td { padding: 6px 8px; }
table.cur .field label:empty { display: none; }
table.cur input { text-align: right; }
table.cur tr.sum td { font-weight: 700; background: #fafbfd; }
.rep-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 6px; margin-bottom: 6px; }
.rep-row input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
table.click tbody tr { cursor: pointer; }
table.compact th, table.compact td { padding: 8px 9px; font-size: 13px; }
table.compact th { font-size: 11px; }
h2.sec { font-size: 16px; margin: 22px 0 10px; }
.veh { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.vcard { cursor: pointer; transition: box-shadow .15s; }
.vcard:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.vcard .mrow { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.vnum { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.vstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0 10px; }
.vstats span { display: block; font-size: 12px; color: var(--muted); }
.vstats b { font-variant-numeric: tabular-nums; }
.vnet { border-top: 1px solid var(--line); padding-top: 10px; align-items: baseline !important; }
.vnet b { font-size: 18px; }
.report .card h3 { margin-bottom: 10px; }

/* главная: напоминания и долги по авто */
.alert-box { background: #fff8eb; border: 1px solid #fcd38a; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.alert-row { color: var(--text); display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.dv { border-bottom: 1px solid var(--line); padding: 8px 0; }
.dv:last-child { border-bottom: 0; }
.dv-head { cursor: pointer; }
.dv-head .name { font-weight: 700; }
.dv-body[hidden] { display: none; }
.dv-body { margin: 10px 0 4px 12px; display: flex; flex-direction: column; gap: 10px; }
.dv-trip { background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.dv-trip .mrow { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dv-trip .mrow a { color: var(--text); }
.dv-inv { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.dv-r { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.vunits { display: grid; gap: 6px; margin: 12px 0; }
.vunits div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.vunits span { color: var(--muted); }
.set-link { color: #9fb0d0; }
details.analytics summary { cursor: pointer; list-style: none; }
details.analytics summary::before { content: '▸ '; }
details.analytics[open] summary::before { content: '▾ '; }
tr.old td { color: var(--muted); }
.fx-info { margin-top: 12px; padding: 10px 12px; background: #f4f6fa; border-radius: 8px; font-size: 13.5px; }

/* карточка рейса */
.trip-head { margin-bottom: 14px; }
.th-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.th-row h1 { margin: 0; font-size: 22px; }
.th-row .actions { margin-left: auto; }
.th-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; }
.th-sum b { color: var(--text); }
.th-warn { margin-top: 10px; background: var(--red-bg); color: var(--red); padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { text-align: left; background: #fff; border: 2px solid transparent; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-height: 92px; transition: border-color .12s, box-shadow .12s; }
.tile:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.tile.on { border-color: var(--accent); }
.tile .tl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.tile b { font-size: 19px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .ts { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-add { background: var(--navy); }
.tile-add .tl { color: #fcd38a; font-size: 15px; text-transform: none; letter-spacing: 0; }
.tile-add .ts { color: #c9d2e6; white-space: normal; }
.tile-add.on { border-color: var(--accent); }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.rgrid .panel { margin-bottom: 0; }
.panel.wide { grid-column: 1 / -1; }
.qpanel { border-top-color: var(--navy); }
details.qlog { margin-top: 14px; }
details.qlog summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.panel { min-width: 0; display: none; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; border-top: 3px solid var(--accent); }
.panel.show { display: block; }
.panel > h3 { margin: 0 0 12px; font-size: 16px; }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 12px; }
.block { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.block.calc { background: #fafbfd; }
.block h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.block .kvs { margin-top: 8px; }
.form.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field input, .field select { min-width: 0; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; font-size: 12.5px; color: var(--blue); list-style: none; }
details.more summary::before { content: '+ '; }
details.more[open] summary::before { content: '− '; }
details.more .form { margin-top: 8px; }
.qkinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qk input { display: none; }
.qk span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; background: #fff; }
.qk input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.qform { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.qbar { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

/* рейсы машины — плитки */
.trip-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ttile { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; border: 2px solid transparent; transition: box-shadow .12s, border-color .12s; }
.ttile:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); border-color: #fcd38a; }
.ttile.open { border-color: var(--accent); }
.tt-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tt-top b { font-size: 16px; }
.tt-date { font-size: 13px; color: var(--muted); }
.tt-route { font-size: 12.5px; color: var(--text); line-height: 1.35; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tt-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.tt-nums span { display: block; font-size: 11.5px; color: var(--muted); }
.tt-nums b { font-size: 14.5px; white-space: nowrap; }
.tt-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
@media (max-width: 1300px) { .trip-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .trip-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rgrid { grid-template-columns: minmax(0, 1fr); } }

.qsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.qsum div { background: #f4f6fa; border-radius: 8px; padding: 8px 10px; }
.qsum span { display: block; font-size: 11.5px; color: var(--muted); }
.qsum b { font-size: 14px; }
.qform { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
.qbar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; flex: 1; }
.qpay { flex: 0 0 auto !important; font-weight: 600; }
.qdeb { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; white-space: nowrap; }
.qlist { margin-top: 14px; border-top: 1px solid var(--line); }
.qrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.qamt { text-align: right; }
.qst { margin-top: 3px; font-size: 12px; }
.qx-ph { width: 30px; }
.cashops { background: #fff8eb; border: 1px solid #fcd38a; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.co-h { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.co-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed #f3d9a6; font-size: 13.5px; }
.ops .co-row { border-top: 1px solid var(--line); }
.co-act { display: flex; gap: 6px; align-items: center; }
.co-act select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.linkbtn { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0; }

.acc-kpi { cursor: pointer; transition: box-shadow .12s; }
.acc-kpi:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.acc-kpi .sub { color: var(--blue); }
.ops-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ops-sum div { background: #f4f6fa; border-radius: 8px; padding: 8px 10px; }
.ops-sum span { display: block; font-size: 11.5px; color: var(--muted); }
.ops { border-top: 1px solid var(--line); }
.op { display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.op-d { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.op-a { text-align: right; white-space: nowrap; }
.op.old { opacity: .55; }
.op-start { background: #fafbfd; }

.nav a, .mob-nav a { position: relative; }
.nbadge { background: #e5484d; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 6px; margin-left: auto; }
.mob-nav .nbadge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
.notif-card { margin-bottom: 14px; border-left: 4px solid #e5484d; }
.notif { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.notif:first-of-type { border-top: 0; }
.notif.red b { color: var(--red); }
.notif.amber b { color: #9a5b00; }
.notif.snoozed { opacity: .55; }
.nicon { font-size: 18px; text-align: center; }
.nact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.ordbar[hidden] { display: none; }
.ordbar { background: #e6eefc; color: #1e3a8a; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ord-ctl { display: none; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.veh.ordering .ord-ctl { display: flex; }
.veh.ordering .vcard { cursor: grab; outline: 2px dashed #9fb0d0; outline-offset: -2px; }
.vcard.dragging { opacity: .4; }

/* сцепки */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 14px; }
.coupling { padding: 14px; }
.cp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cp-head b { font-size: 17px; }
.cp-head .btn { margin-left: auto; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); align-items: stretch; }
.cp-link { align-self: center; height: 4px; background: #c7cfdd; border-radius: 2px; }
.half { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text); background: #fafbfd; transition: border-color .12s, box-shadow .12s; }
a.half:hover { border-color: #fcd38a; box-shadow: 0 4px 14px rgba(16,24,40,.08); }
.empty-half { border-style: dashed; align-items: flex-start; }
.h-k { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.h-n { font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: #fff4e0; color: #8a5000; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.gray { background: #eef1f6; color: #4a5468; }
/* карточка техники */
.sumtile { display: flex; flex-direction: column; gap: 3px; border-top: 3px solid var(--green); }
.sumtile.amber { border-top-color: var(--accent); }
.sumtile.red { border-top-color: #e5484d; }
.sumtile.red .value { color: var(--red); }
.sumtile.gray { border-top-color: #c7cfdd; }
.sumtile .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sumtile .value { font-size: 19px; font-weight: 700; }
.sumtile .sub { font-size: 12px; color: var(--muted); }
.sumtile .linkbtn { align-self: flex-start; margin-top: 2px; }
.docs-block { margin-top: 14px; padding: 12px 16px; }
.docs-block h3 { margin: 0 0 8px; }
.docs-row { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.doc-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
details.polist { margin-top: 14px; }
details.polist summary { cursor: pointer; }
tr.fuel-row { cursor: pointer; }
tr.fuel-trips[hidden] { display: none; }
tr.fuel-trips > td { background: #fafbfd; padding: 4px 8px 10px; }
table.inner th { background: transparent; }
.pay-card { display: flex; flex-direction: column; min-width: 0; }
.pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.pc-head h3 { margin: 0; }
.pc-head b { font-size: 17px; white-space: nowrap; }
.pay-list { max-height: 360px; overflow-y: auto; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.pr-amt { font-weight: 700; white-space: nowrap; text-align: right; }
.pr-act { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
/* схема колёс (вид сверху) */
.truck { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 4px; }
.cab, .kingpin { width: 240px; text-align: center; font-size: 12px; color: var(--muted); border: 2px solid #c7cfdd; background: #f4f6fa; }
.cab { height: 46px; line-height: 42px; border-radius: 14px 14px 6px 6px; }
.kingpin { height: 28px; line-height: 24px; border-radius: 6px; border-style: dashed; }
.axle { display: flex; align-items: center; gap: 8px; }
.ax-wheels { display: flex; gap: 4px; }
.ax-bar { width: 150px; height: 8px; background: #c7cfdd; border-radius: 4px; position: relative; }
.ax-bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.wheel { width: 84px; min-height: 92px; border: 2px solid #1a2233; background: #2a3448; color: #fff; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 6px 4px; font: inherit; }
.wheel:hover { border-color: var(--accent); }
.wheel.nowheel { background: #fff; color: var(--muted); border: 2px dashed #c7cfdd; }
.wheel .w-km { font-weight: 700; font-size: 13px; white-space: nowrap; }
.wheel .w-b { font-size: 11px; opacity: .85; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.wheel .w-d { font-size: 10.5px; opacity: .7; white-space: nowrap; }
.is-tr .ax-wheels .wheel { width: 76px; }

/* list on mobile */
.mob-nav { display: none; }
.cards-list { display: none; }

@media (max-width: 1200px) { .three { grid-template-columns: 1fr 1fr; } .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1000px) and (min-width: 761px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
  .two, .three { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: calc(14px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(84px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .page-head h1 { font-size: 19px; }
  .mob-top { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 12px; }
  .mob-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .mob-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: #9fb0d0; font-size: 10.5px; font-weight: 600; }
  .mob-nav a.active { color: var(--accent); }
  .mob-nav svg { width: 21px; height: 21px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 18px; }
  .bar-row { grid-template-columns: 90px 1fr 100px; }
  .form { grid-template-columns: 1fr; }
  .filters input[type=search] { min-width: 0; flex: 1 1 100%; }
  .hide-m { display: none; }
  .modal-bg { place-items: end center; padding: 0; }
  #list > .table-wrap, #ulist > .table-wrap { display: none; }
  .pair { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .trip-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rgrid { grid-template-columns: minmax(0, 1fr); }
  .pay-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pr-act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; }
  .cp-body { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cp-link { display: none; }
  .ax-bar { width: 40px; }
  .wheel, .is-tr .ax-wheels .wheel { width: 64px; min-height: 80px; }
  .wheel .w-b { display: none; }
  .cab, .kingpin { width: 160px; }
  .notif { grid-template-columns: 24px 1fr; }
  .nact { grid-column: 2; justify-content: flex-start; }
  .qsum { grid-template-columns: 1fr; }
  .ttile { padding: 11px; }
  .tt-nums { grid-template-columns: 1fr; }
  .tile { min-height: 80px; padding: 10px 12px; }
  .tile b { font-size: 16px; }
  .th-row .actions { margin-left: 0; width: 100%; }
  .form.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field input, .field select { min-width: 0; }
  table.cur td:first-child { font-size: 12px; }
  .cards-list { display: flex; flex-direction: column; gap: 8px; }
  .mcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
  .mcard .mrow { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 3px; }
  .filters .seg { flex: 1 1 100%; } .filters .seg button { flex: 1; }
  .filters select, .filters input[type=date] { flex: 1 1 45%; }
  .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; justify-content: center; }
  .modal { border-radius: 16px 16px 0 0; max-height: calc(92vh - env(safe-area-inset-top, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); }
}
@media (min-width: 761px) { .mob-top { display: none; } }

/* отчёт по автопарку */
.rep-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .rep-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile.static { cursor: default; min-height: 84px; }
.tile.static:hover { box-shadow: var(--shadow); }
.tile b.pos { color: var(--green, #16a34a); } .tile b.neg { color: var(--red, #dc2626); }
h3.sec { margin: 18px 0 10px; font-size: 15px; }
.veh-rep { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 10px; }
.vr { display: block; color: var(--text); padding: 14px 16px; border: 2px solid transparent; transition: border-color .12s; }
.vr:hover { border-color: var(--accent); }
.vr-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; } .vr-h b { font-size: 20px; }
.vr-big { font-size: 22px; font-weight: 700; margin-top: 8px; }
.vr-big.pos { color: var(--green, #16a34a); } .vr-big.neg { color: var(--red, #dc2626); }
.vr-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.vr-g div { display: flex; flex-direction: column; min-width: 0; } .vr-g span { font-size: 12px; color: var(--muted); }
.vr-g b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vr-more { margin-top: 8px; color: var(--accent); font-weight: 600; font-size: 13px; }
@media (max-width: 700px) { .rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid.g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
@media (max-width: 900px) { .grid.g2 { grid-template-columns: minmax(0, 1fr); } }
.kv.pos b { color: var(--green); } .kv.neg b { color: var(--red); }
.dlist { display: flex; flex-direction: column; }
.drow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; cursor: pointer; font: inherit; color: var(--text); }
.drow:hover { background: var(--bg); } .drow.off b { color: var(--muted); }
#g.seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
#g.seg::-webkit-scrollbar { display: none; }
#g.seg button { white-space: nowrap; flex: 0 0 auto; }

/* очередь на границе */
.border-card { grid-column: span 2; padding: 14px 16px; }
.bq-row { display: grid; grid-template-columns: minmax(0, 1.3fr) auto 70px; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.bq-row:last-of-type { border-bottom: 0; }
.bq-n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-q b { font-size: 18px; font-variant-numeric: tabular-nums; }
.bq-w { text-align: right; font-weight: 600; color: var(--muted); white-space: nowrap; }
.bq-tr { font-size: 12px; font-weight: 700; } .bq-tr.up { color: var(--red); } .bq-tr.down { color: var(--green); }
.bq-foot { margin-top: 6px; } .bq-foot a { color: var(--blue); }
.bq-ref { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.bq-ref:hover { color: var(--text); }
@media (max-width: 700px) { .border-card { grid-column: 1 / -1; } }
.bq-err { font-size: 11px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.bq-pick { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.bq-c h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.bq-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); cursor: pointer; font-size: 14px; }
.bq-opt input { width: auto; } .bq-opt[hidden], .bq-c[hidden] { display: none; }
.bq-set { margin-right: 6px; }

/* режим «скрыть суммы» */
body.priv .dash .kpi .value, body.priv .dash .kpi.alert .sub, body.priv .dash .bar-row .num, body.priv .dash .dv-trip b, body.priv .dash .dv-inv b, body.priv .dash .dv-inv .muted,
body.priv .dash #ulist td.num, body.priv .dash #ulist .mcard b, body.priv .dash #ulist tfoot, body.priv .dash #ulist .total,
body.priv .acc-strip .v {
  filter: blur(8px); user-select: none; transition: filter .15s;
}
body.priv .dash .border-card .value, body.priv .dash .border-card * { filter: none; }
.us-det { margin-top: 10px; } .us-det summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }
.us-det table { margin-top: 4px; }
.vx-com { white-space: pre-line; max-width: 320px; color: var(--muted); }

/* ===== карточка рейса (компактная) ===== */
.th-sub { color: var(--muted); font-size: 13px; }
.tsum { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 14px; position: sticky; top: 0; z-index: 6; }
.tkp { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.tkp div { min-width: 0; } .tkp span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.tkp b { font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbar { display: flex; height: 9px; border-radius: 6px; overflow: hidden; margin: 10px 0 6px; background: #eef1f6; }
.tbar i { display: block; height: 100%; }
.s-fuel { background: #f59e0b; } .s-sal { background: #2563eb; } .s-road { background: #7c3aed; } .s-oth { background: #0d9488; } .s-rep { background: #dc2626; } .s-pro { background: #16a34a; }
.tleg { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 12px; color: var(--muted); }
.tleg em { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tleg b { color: var(--text); font-weight: 600; } .tleg-km { margin-left: auto; }
.tchk { margin-top: 8px; font-size: 13px; }
.tchk summary { cursor: pointer; list-style: none; padding: 6px 10px; border-radius: 8px; background: var(--green-bg); color: var(--green); font-weight: 600; }
.tchk.bad summary { background: var(--red-bg); color: var(--red); }
.tchk summary::-webkit-details-marker { display: none; }
.tchk .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; margin-top: 8px; }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tcard { min-width: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 11px 16px 13px; border-top: 3px solid var(--accent); }
.tcard.full { grid-column: 1 / -1; }
.tc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tc-h h3 { margin: 0; font-size: 15px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.tc-t { font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; align-items: end; }
.frow.tight { grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); }
.frow .w2 { grid-column: span 2; }
.tcard .field label { font-size: 11.5px; font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .field input, .tcard .field select { padding: 6px 9px; height: 34px; }
.tcard .ro-val { height: 34px; display: flex; align-items: center; padding: 0 9px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.tcard details.more { margin-top: 6px; } .tcard details.more .form { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tres { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tres b { color: var(--text); }
.tc-rates { font-size: 12px; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tc-rates input { width: 58px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font: inherit; color: var(--text); }
table.dmoney { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dmoney th { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; text-align: right; padding: 2px 6px; }
table.dmoney td { padding: 3px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.dmoney td:first-child { text-align: left; color: var(--muted); white-space: normal; }
table.dmoney td input { width: 100%; max-width: 120px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; text-align: right; font: inherit; }
table.dmoney tr.tot td { font-weight: 700; color: var(--text); }
.tcard #repairs .rep-row { margin-bottom: 6px; }
.tcard #invs table { width: 100%; } .tcard #invs td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tnote { display: flex; gap: 12px; align-items: flex-end; } .tnote .field { flex: 1; margin: 0; } .tnote textarea { min-height: 44px; }
.tcard .qsum div { padding: 6px 8px; } .tcard .qkinds { margin-bottom: 8px; }
@media (max-width: 1100px) { .tkp { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .tgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .tsum { position: static; padding: 10px 12px; } .tkp b { font-size: 15px; } .tleg-km { margin-left: 0; }
  .frow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .frow.tight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .frow .w2 { grid-column: 1 / -1; } .tcard { padding: 10px 12px 12px; }
  .tnote { flex-direction: column; align-items: stretch; }
}
.tkp b.pos { color: var(--green); } .tkp b.neg { color: var(--red); }
table.dmoney td.neg, table.dmoney tr.tot td.neg { color: var(--red); }

/* ===== карточка рейса: плитки «подпись — поле» (вариант Б) ===== */
#rep .tmas { columns: 4 250px; column-gap: 12px; }
#rep .tmas > .tl { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 12px; }
#rep .twide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
#rep .tl { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 11px 14px 12px; border-left: 4px solid var(--accent); min-width: 0; }
#rep .th { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
#rep .th h3 { margin: 0; font-size: 14px; }
#rep .pill { font-size: 12.5px; font-weight: 700; background: #fff4dc; color: #92400e; border-radius: 999px; padding: 3px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#rep .pill.bad { background: var(--red-bg); color: var(--red); } #rep .pill.ok { background: var(--green-bg); color: var(--green); }
#rep .lr .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid #f0f2f6; font-size: 13px; min-height: 34px; }
#rep .lr .r > span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#rep .lr .r input, #rep .lr .r select { width: 50%; flex: none; min-width: 0; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; text-align: right; font: inherit; background: #fff; }
#rep .lr .r select { text-align: left; }
#rep .lr .r input[type=date] { width: 58%; padding: 0 4px; }
#rep .lr .r.res { background: #fafbfd; } #rep .lr .r.res b { color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
#rep .lr .r.res.pos b { color: var(--green); } #rep .lr .r.res.neg b { color: var(--red); }
#rep details.more { margin: 4px 0 2px; } #rep details.more summary { font-size: 12px; }
#rep .mt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#rep .mt th { font-size: 11px; color: var(--muted); text-align: right; padding: 0 3px; font-weight: 600; }
#rep .mt td { text-align: right; padding: 2px 3px; border-top: 1px solid #f0f2f6; white-space: nowrap; font-variant-numeric: tabular-nums; }
#rep .mt td:first-child { text-align: left; color: var(--muted); }
#rep .mt input { width: 100%; min-width: 0; height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; text-align: right; font: inherit; }
#rep .mt tr.tot td { font-weight: 700; color: var(--text); } #rep .mt td.neg { color: var(--red); }
#rep .rt { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
#rep .rt input { width: 50px; height: 26px; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font: inherit; }
#rep #repairs .rep-row { display: flex; gap: 6px; margin: 4px 0; } #rep #repairs .rep-row input { min-width: 0; height: 30px; }
#rep #repairs .rep-row input[data-ra] { flex: 0 0 84px; text-align: right; }
#rep #invs table { width: 100%; } #rep #invs td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
#rep .tchk { margin-top: 8px; font-size: 12.5px; }
#rep .tchk .checks { grid-template-columns: 1fr; }
#rep .tnote { display: flex; gap: 12px; align-items: flex-end; } #rep .tnote .field { flex: 1; margin: 0; } #rep .tnote textarea { min-height: 44px; }
#rep .qpanel .qsum div { padding: 6px 8px; }
@media (max-width: 1000px) { #rep .twide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { #rep .tmas { columns: 1; } #rep .tnote { flex-direction: column; align-items: stretch; } #rep .tl { padding: 10px 12px; } }

/* ===== карточка рейса: раскладка как в отчёте-таблице (вариант В) ===== */
#rep.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
#rep .c3 { grid-column: span 3; } #rep .c4 { grid-column: span 4; } #rep .c5 { grid-column: span 5; } #rep .c6 { grid-column: span 6; } #rep .c12 { grid-column: span 12; }
#rep .sc { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 0 0 8px; overflow: hidden; min-width: 0; }
#rep .sc > h4 { margin: 0 0 4px; padding: 7px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--navy); background: #fff7e6; border-top: 3px solid var(--accent); border-bottom: 1px solid #fde7b8;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
#rep .sc > h4 .act { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--blue); font-weight: 600; }
#rep .sc > h4 .rates { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 4px; }
#rep .sc > h4 .rates input { width: 48px; height: 24px; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font: inherit; color: var(--text); }
#rep .kv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 12px; min-height: 32px; border-bottom: 1px solid #f1f3f7; font-size: 13px; }
#rep .kv > span:first-child { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#rep .kv input, #rep .kv select { width: 55%; flex: none; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; text-align: right; font: inherit; background: #fff; min-width: 0; }
#rep .kv select { text-align: left; } #rep .kv input[type=date] { padding: 0 4px; }
#rep .kv .kv2 { width: 55%; display: flex; gap: 4px; } #rep .kv .kv2 input { width: 40%; } #rep .kv .kv2 select { width: 60%; }
#rep .kv.calc { background: #fafbfd; } #rep .kv b { font-variant-numeric: tabular-nums; white-space: nowrap; } #rep .kv.big b { font-size: 15px; }
#rep table.g { width: 100%; border-collapse: collapse; font-size: 13px; }
#rep table.g th { font-size: 11px; color: var(--muted); font-weight: 600; text-align: right; padding: 4px 8px; white-space: nowrap; }
#rep table.g th:first-child { text-align: left; }
#rep table.g td { padding: 2px 8px; text-align: right; border-top: 1px solid #f1f3f7; height: 32px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#rep table.g td:first-child { text-align: left; color: var(--muted); }
#rep table.g input { width: 100%; min-width: 0; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; text-align: right; font: inherit; }
#rep table.g .cv, #rep table.g tr.sub td { background: #fafbfd; color: var(--text); }
#rep table.g tr.tot td { font-weight: 700; color: var(--text); background: #fafbfd; }
#rep table.g td.neg { color: var(--red); }
#rep table.invt th, #rep table.invt td { text-align: left; color: var(--text); } #rep table.invt .r { text-align: right; }
#rep table.invt tbody tr[data-inv] { cursor: pointer; } #rep table.invt tbody tr[data-inv]:hover td { background: #fafbfd; }
#rep #repairs .rep-row { display: flex; gap: 6px; padding: 3px 12px; margin: 0; } #rep #repairs .rep-row input { min-width: 0; height: 28px; }
#rep #repairs .rep-row input[data-ra] { flex: 0 0 90px; text-align: right; } #rep #repairs > .muted { padding: 4px 12px; }
#rep .rest .kv b { color: var(--text); }
#rep .profit { display: flex; justify-content: space-between; align-items: center; margin: 8px 12px 0; padding: 9px 12px; border-radius: 8px; background: var(--green-bg); color: var(--green); }
#rep .profit.neg { background: var(--red-bg); color: var(--red); } #rep .profit span { font-weight: 600; } #rep .profit b { font-size: 20px; white-space: nowrap; }
#rep .tchk { margin: 8px 12px 0; }
#rep .tchk summary { font-size: 12px; }
#rep .qpanel #qx { padding: 4px 12px 0; }
#rep .qdet { margin-top: 8px; } #rep .qdet > summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 600; }
#rep .tnote { display: flex; gap: 10px; align-items: flex-end; padding: 10px 12px; }
#rep .tnote textarea { flex: 1; border: 1px solid var(--line); border-radius: 8px; min-height: 40px; font: inherit; padding: 6px 8px; }
#rep .pill:empty { display: none; }
@media (max-width: 1200px) { #rep .c3, #rep .c4, #rep .c5, #rep .c6 { grid-column: span 6; } #rep .rest { grid-column: span 12; } }
@media (max-width: 700px) {
  #rep.sheet { grid-template-columns: minmax(0, 1fr); } #rep.sheet > .sc { grid-column: 1 / -1; }
  #rep table.invt thead { display: none; } #rep table.invt tr { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 0; border-top: 1px solid var(--line); }
  #rep table.invt td { border: 0; height: auto; padding: 1px 12px; } #rep .tnote { flex-direction: column; align-items: stretch; }
}
#rep input, #rep select, #rep textarea { color: var(--text); }
#rep table.invt td:first-child { color: var(--text); }
#rep .qpanel .qform { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* карта машин (GPS) */
.gps-card { margin-bottom: 16px; }
.gps-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-top: 8px; }
.gps-map { height: 300px; border-radius: 10px; overflow: hidden; background: #eef1f6; z-index: 0; }
.gps-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.gps-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.gps-row .gr1, .gps-row .gr2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .gps-row .gr2 { font-size: 13px; }
.gps-row:hover { border-color: var(--accent); } .gps-row b { font-size: 16px; } .gps-row .gps-st { font-weight: 600; white-space: nowrap; }
.gps-row.lost { border-color: #f5c2bd; background: #fff8f7; }
.gps-pin { background: var(--navy); color: #fff; border-radius: 6px; padding: 2px 6px; font: 700 12px/1.3 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); border: 2px solid #fff; transform: translate(-50%, -50%); }
.gps-pin.moving { background: #16a34a; } .gps-pin.lost { background: #dc2626; }
@media (max-width: 800px) { .gps-wrap { grid-template-columns: minmax(0, 1fr); } .gps-map { height: 240px; } .gps-list { max-height: none; } }
.gps-bd { font-size: 12.5px; font-weight: 600; color: #92400e; background: #fff4dc; border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.notif.info, .ncard.info { border-left-color: var(--blue); }
.bp-map { height: 360px; border-radius: 10px; overflow: hidden; margin-top: 12px; background: #eef1f6; }

/* настройки уведомлений */
.ns-h { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.ns-tg { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; }
.ns-t td { vertical-align: middle; font-size: 13px; } .ns-t td:first-child { white-space: nowrap; }
.ns-t select { min-width: 150px; }
.ns-num { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } .ns-num input { width: 74px; height: 30px; padding: 0 6px; text-align: right; }
.ns-q { display: flex; align-items: center; gap: 6px; margin: 6px 0; } .ns-q select { width: auto; }
.modal.wide { width: min(900px, 100%); }
.modal label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; }
.modal label.check input[type=checkbox] { width: 16px; height: 16px; flex: none; margin: 0; }
.e1cards { background: #f7f9fc; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; } .e1cards select { width: auto; min-width: 140px; height: 30px; }
.cons { color: var(--text); font-weight: 600; }
.tt-km { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; white-space: nowrap; }

/* расходы по рейсу: этапы и массовая оплата */
#rep .qstage { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
#rep .qs-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; } #rep .qs-h b { font-size: 14px; } #rep .qs-all { margin-left: auto; display: flex; gap: 4px; align-items: center; color: var(--muted); }
#rep .qs-all input { width: auto; }
#rep .qr2 { display: grid; grid-template-columns: 24px minmax(0, 1.2fr) 110px minmax(0, 2fr) 30px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid #f1f3f7; font-size: 13px; }
#rep .qr2.done { opacity: .75; } #rep .qr-c input { width: 16px; height: 16px; } #rep .qr-a { text-align: right; white-space: nowrap; }
#rep .qr-s { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
#rep .qr-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } #rep .qr-act select { height: 30px; min-width: 0; max-width: 240px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font: inherit; }
#rep .qbulk { position: sticky; bottom: 8px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; box-shadow: 0 6px 18px rgba(16,24,40,.25); }
#rep .qbulk b { color: #fff; } #rep .qbulk [data-qbsum] { margin-right: auto; font-size: 13px; } #rep .qbulk .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
#rep .qbulk[hidden] { display: none; }
#rep .qadd-det > summary { color: var(--blue); }
#rep .ab-row.ab-miss { background: #fff7e6; } #rep .ab-row .kv2 input { width: 50%; }
.ttile.ab-miss { box-shadow: inset 0 0 0 2px #fbbf24; }
.tt-foot > span:first-child { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 800px) { #rep .qr2 { grid-template-columns: 22px minmax(0, 1fr) auto; } #rep .qr-s { grid-column: 2 / -1; } #rep .qr-x { grid-column: 3; grid-row: 1; justify-self: end; } }
#rep .qcur { display: inline-flex; } #rep .qcur button { padding: 4px 10px; font-size: 12px; }
#rep .qconv { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); } #rep .qconv input { width: 80px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; text-align: right; font: inherit; }
#rep .qconv[hidden] { display: none; }
#rep .qrest input { width: 76px; height: 24px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; text-align: right; font: inherit; color: var(--text); }
#rep .e100t { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#rep .e100t > .btn + .small { margin-top: -4px; }
#rep .e100sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
#rep .e100sum > div { background: var(--bg); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; font-size: 12px; }
#rep .e100sum > div span { color: var(--muted); } #rep .e100sum > div b { font-size: 14px; }
#rep .e100sum .tot { background: #fff4e0; }
#rep .e100act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; width: 100%; }
#rep .e100tx td { font-size: 12px; padding: 4px 8px; } #e100items { width: 100%; max-height: 260px; overflow: auto; }
#rep .e100tx td:nth-child(2) { text-align: left; } #rep .e100sum > div b { white-space: nowrap; }
#rep .e100sum > div b small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.trip-head .tnav { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; } .trip-head .tnav .btn[aria-disabled] { opacity: .35; pointer-events: none; } .trip-head .tnav a.btn { text-decoration: none; }
#rep .okkot { padding: 6px 12px 10px; } .okkosum { grid-template-columns: repeat(2, 1fr) !important; } .okkosum > div { background: var(--bg); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; font-size: 12px; } .okkosum > div span { color: var(--muted); } .okkosum > div b { font-size: 14px; }
.okkosum + .e100act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.okkosum { display: grid; gap: 8px; }

/* водители и документы */
.att-card { border-left: 4px solid #f59e0b; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.att-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.dtabs { display: inline-flex; }
.drv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.drv-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; }
.drv-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.dv-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dv-h b { font-size: 16px; }
.dv-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dv-d { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; display: flex; flex-direction: column; font-size: 12px; }
.dv-d span { color: var(--muted); } .dv-d b { font-size: 13px; color: #15803d; }
.dv-d.miss { border-style: dashed; } .dv-d.miss b { color: var(--muted); }
.dv-d.warn { border-color: #fcd38a; background: #fffaf0; } .dv-d.warn b { color: #8a5000; }
.dv-d.bad { border-color: #f5b5ad; background: #fdf1ef; } .dv-d.bad b { color: #b42318; }
.dsec { margin: 14px 0 8px; font-size: 15px; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; text-align: left; font: inherit; color: var(--text); }
.dc-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.dc-files { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-f { width: 72px; height: 72px; border-radius: 6px; border: 1px solid var(--line); background: #eef1f6; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.dc-f img { width: 100%; height: 100%; object-fit: cover; }
.dc-empty { padding: 6px 0; }
.dmiss { border: 2px dashed #c7cfdd; background: transparent; cursor: pointer; justify-content: center; align-items: center; min-height: 90px; color: var(--muted); }
.dmiss b { color: var(--text); } .dmiss:hover { border-color: #f59e0b; }
.drv-info .di-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.drv-info .di-grid > div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; } .drv-info .di-grid span { color: var(--muted); font-size: 12px; }
.drv-info select { height: 34px; }
#page > .card + .card { margin-top: 12px; }
@media (max-width: 700px) { .drv-info .di-grid { grid-template-columns: 1fr 1fr; } }

.mb-list { display: flex; flex-direction: column; }
.mb-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mb-act { display: flex; gap: 10px; align-items: center; } .mb-help { grid-column: 1 / -1; background: #f6f8fb; border-radius: 8px; padding: 8px 12px; }
.snd-docs { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 6px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.snd-g { display: flex; flex-direction: column; gap: 4px; } .snd-d { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; } .snd-d input { width: auto; } .snd-d.off { opacity: .55; }
@media (max-width: 700px) { .mb-row { grid-template-columns: 1fr; } }
.modal textarea[name=text] { min-height: 150px; }
.set-tabs { display: inline-flex; flex-wrap: wrap; margin-bottom: 14px; }
.set-panel > .card + .card, .set-panel > .grid + .card { margin-top: 14px; }
.set-note { padding: 10px 14px; font-size: 14px; }

.rsearch { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rs-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .rs-row input { flex: 1 1 160px; min-width: 0; height: 38px; }
.rs-cl { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.rs-chip { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; text-decoration: none; color: var(--text); font-size: 13px; }
.rs-chip span { color: var(--muted); font-size: 12px; } .rs-chip:hover { border-color: #f59e0b; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8fafc; }
.cl-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.cl-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; } .cl-info > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; } .cl-info span { color: var(--muted); font-size: 12px; }
.cl-ct { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
#page > .grid + .card, #page > .card + .grid { margin-top: 12px; }
@media (max-width: 700px) { .cl-kpis { grid-template-columns: 1fr 1fr; } }
.snd-share { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); } .snd-share .btn { flex: none; }
.snd-how { margin-top: 10px; background: #f6f8fb; border-radius: 8px; padding: 10px 12px; } .snd-how ol { margin: 6px 0 8px 18px; padding: 0; line-height: 1.6; } .snd-how-b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ord-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ord-top select { height: 34px; }
.ord-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ord-check { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fold { padding: 10px 14px; margin-bottom: 10px; } .fold summary { cursor: pointer; } .fold2 { margin: 8px 0 0 18px; } .fold2 summary { cursor: pointer; font-size: 14px; }
.fold-it { margin: 6px 0 0 22px; font-size: 14px; }
.ofile input[type=file] { padding: 10px; border: 2px dashed #c7cfdd; border-radius: 8px; background: #fafbfd; }
.inbox-help { margin-bottom: 12px; line-height: 1.6; } .inbox-ban { border-left: 4px solid #f59e0b; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
