/* Astrov.pro вЂ” СЂР°Р±РѕС‡РёР№ РёРЅС‚РµСЂС„РµР№СЃ РґРёСЃРїРµС‚С‡РµСЂСЃРєРѕР№: РїР»РѕС‚РЅРѕ, С‡РёС‚Р°РµРјРѕ, Р±РµР· СѓРєСЂР°С€РµРЅРёР№ */
:root {
  --bg: #f4f5f3; --surface: #ffffff; --ink: #1b2120; --muted: #64706c; --line: #dfe3e0; --line-strong: #c7cdca;
  --accent: #1f6f68; --accent-ink: #ffffff; --accent-soft: #e2f0ee; --amber: #b86e00; --amber-soft: #fcefd8;
  --good: #2d7a3e; --good-soft: #e3f2e6; --bad: #b4372f; --bad-soft: #f8e3e1; --violet: #6d4fa0; --violet-soft: #efe8f7;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
/* РўС‘РјРЅР°СЏ С‚РµРјР° РІРєР»СЋС‡Р°РµС‚СЃСЏ С‚РѕР»СЊРєРѕ РІСЂСѓС‡РЅСѓСЋ: РєР»Р°СЃСЃ theme-dark РЅР° <html>.
   РџРѕ СѓРјРѕР»С‡Р°РЅРёСЋ РІСЃРµРіРґР° СЃРІРµС‚Р»Р°СЏ вЂ” РЅРµР·Р°РІРёСЃРёРјРѕ РѕС‚ РЅР°СЃС‚СЂРѕРµРє СЃРёСЃС‚РµРјС‹. */
html.theme-dark {
  --bg: #121716; --surface: #1a2120; --ink: #e6ebe9; --muted: #98a5a1; --line: #2b3533; --line-strong: #3a4643;
  --accent: #5fbfb4; --accent-ink: #0c1413; --accent-soft: #183331; --amber: #f0a83a; --amber-soft: #3a2c14;
  --good: #6cc47e; --good-soft: #1b3322; --bad: #ef7a70; --bad-soft: #3a1d1a; --violet: #b79be0; --violet-soft: #2b2238;
  color-scheme: dark;
}
html { color-scheme: light; }
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.45 var(--font); }
a { color: var(--accent); }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }

/* РЅР°РІРёРіР°С†РёСЏ */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 4px 18px; padding: 8px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--ink); text-decoration: none; margin-right: 8px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.top .spacer { flex: 1; }
.user { color: var(--muted); font-size: .92rem; display: flex; gap: 10px; align-items: center; }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }

/* РєРЅРѕРїРєРё Рё С„РѕСЂРјС‹ */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 6px 12px; border-radius: 6px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 3px 8px; font-size: .9rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: middle; }
label { color: var(--muted); font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field .help { color: var(--muted); font-size: .82rem; }
.field .err, .errorlist { color: var(--bad); font-size: .85rem; margin: 0; padding: 0; list-style: none; }
.check { display: flex; gap: 6px; align-items: center; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* РїР°РЅРµР»Рё */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2, .g3, .g4, .g6 { grid-template-columns: minmax(0, 1fr); } }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
@media (max-width: 560px) { .span2, .span3 { grid-column: auto; } }

/* С‚Р°Р±Р»РёС†С‹ */
.tbl { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tbl th a { color: inherit; text-decoration: none; white-space: nowrap; }
.tbl th a:hover { text-decoration: underline; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.is-cancel td { color: var(--muted); text-decoration: line-through; }
tr.is-unassigned td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tfoot td, tr.total td { font-weight: 700; background: var(--bg); }
td a.trip { color: var(--ink); text-decoration: none; font-weight: 600; }
td a.trip:hover { color: var(--accent); }
.good { color: var(--good); } .bad { color: var(--bad); font-weight: 600; }
td.good { background: var(--good-soft); } td.bad { background: var(--bad-soft); }

/* РїРёР»СЋР»Рё Рё РѕС‚РјРµС‚РєРё */
.pill { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.st-new { background: var(--amber-soft); border-color: transparent; color: var(--amber); font-weight: 600; }
.st-req { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.st-asg { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.st-done { background: var(--good-soft); border-color: transparent; color: var(--good); }
.st-cancel { color: var(--muted); }
.st-late { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.tag { display: inline-block; font-size: .75rem; padding: 0 6px; border-radius: 4px; margin-left: 3px; white-space: nowrap; }
.tag.paid { background: var(--violet-soft); color: var(--violet); }
.tag.sales { background: var(--accent-soft); color: var(--accent); }
.tag.social { background: var(--amber-soft); color: var(--amber); }
.tag.changed { background: var(--bad-soft); color: var(--bad); }
.tag.mutual { background: var(--bg); color: var(--muted); border: 1px solid var(--line-strong); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.sent { background: var(--amber-soft); color: var(--amber); }
.tag.fail { background: var(--bad-soft); color: var(--bad); }

/* СЃРІРѕРґРєР° */
.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters .field { min-width: 120px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.messages { list-style: none; padding: 0; margin: 0 0 12px; }
.messages li { padding: 8px 12px; border-radius: 8px; background: var(--good-soft); color: var(--good); margin-bottom: 6px; }
.messages li.error { background: var(--bad-soft); color: var(--bad); }

.money-box { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.money-box dt { color: var(--muted); }
.money-box dd { margin: 0; text-align: right; font-weight: 600; }
.money-box .n { font-size: 1.15rem; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.hint.warn { color: var(--amber); }
.history { font-size: .9rem; }
.history li { margin-bottom: 6px; }
.copybox { white-space: pre-wrap; font-family: var(--mono); font-size: .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.day-head { display: flex; align-items: baseline; gap: 10px; }
.empty { color: var(--muted); padding: 12px; }
details summary { cursor: pointer; color: var(--accent); }
.ts-wrapper { min-width: 0; }

/* С‚РµР»РµС„РѕРЅ: СЃС‚СЂРѕРєРё РїРѕРµР·РґРѕРє вЂ” РєР°СЂС‚РѕС‡РєР°РјРё */
.sm-label { display: none; }
@media (max-width: 700px) {
  .top-in { flex-wrap: nowrap; overflow-x: auto; }
  .nav { flex-wrap: nowrap; }
  .top .spacer, .user span { display: none; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  table.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.cards td { border: 0; padding: 0; min-width: 0 !important; text-align: left; }
  table.cards td.num { text-align: right; }
  table.cards td.hs { display: none; }
  table.cards td.c-route { grid-column: 1 / -1; color: var(--ink); }
  table.cards .sm-label { display: inline; color: var(--muted); font-weight: 400; }
  tr.is-unassigned td:first-child { box-shadow: none; }
  tr.is-unassigned { box-shadow: inset 3px 0 0 var(--amber); }
}

/* СЃРїСЂР°РІРѕС‡РЅРёРєРё, РїСЂРѕС„РёР»СЊ: Р·Р°РіРѕР»РѕРІРѕРє СЃС‚СЂР°РЅРёС†С‹ СЃ РєСЂСѓРїРЅРѕР№ РєРЅРѕРїРєРѕР№ В«РќР°Р·Р°РґВ», РїР»РёС‚РєРё СЂР°Р·РґРµР»РѕРІ */
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { margin: 0; font-size: 1.4rem; }
.pagehead .btn.primary { margin-left: auto; }
.btn.back { padding: 9px 16px; font-size: 1.02rem; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); }
.tile b { font-size: 1.15rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.tile.admin { border-style: dashed; }
.subhead { font-size: 1rem; color: var(--muted); margin: 8px 0; }
.car-row { padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
a.user { text-decoration: none; padding: 6px 10px; border-radius: 6px; }
a.user:hover, a.user.on { background: var(--accent-soft); color: var(--accent); }
details.logout > summary { list-style: none; display: inline-flex; }
details.logout > summary::-webkit-details-marker { display: none; }
@media (max-width: 560px) { .pagehead .btn.primary { margin-left: 0; } .btn.back { padding: 10px 18px; } }
.badge { display:inline-block; min-width:18px; padding:0 5px; margin-left:2px; border-radius:9px; background:var(--accent); color:var(--accent-ink); font-size:.72rem; font-weight:700; line-height:18px; text-align:center; }
.tabs { display:flex; gap:4px; margin:0 0 12px; border-bottom:1px solid var(--line); }
.tab { padding:7px 14px; border:1px solid transparent; border-bottom:0; border-radius:8px 8px 0 0; color:var(--muted); text-decoration:none; font-size:.92rem; }
.tab.on { background:var(--surface); border-color:var(--line); color:var(--ink); font-weight:600; margin-bottom:-1px; }
.ok { color:var(--good); font-weight:600; }
/* «Таблица»: подсказка «итого» рядом с полем базы (аудит P001) */
.money-total { display: block; font-size: .72rem; color: var(--muted); line-height: 1.1; margin-top: 2px; white-space: nowrap; }

/* Выбор машины поиском: список совпадений под полем */
.car-picker { position: relative; }
.car-picker input[type="text"] { width: 100%; }
.car-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px);
  background: #fff; border: 1px solid #d7dbe6; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20,30,60,.14); max-height: 320px; overflow-y: auto; padding: 4px;
}
.car-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; line-height: 1.3;
}
.car-item:hover, .car-item:focus { background: #eef3ff; }
.car-item.in-park { border-left: 3px solid #1d3d8f; }
.car-item b { font-weight: 600; }
.car-item .muted { color: #6b6b6b; font-size: 12.5px; }
.car-empty, .car-more { padding: 8px; font-size: 12.5px; color: #6b6b6b; }
