/* ===== АвтоСервис CRM — интерфейс (mobile-first) ===== */
:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #16202c;
  --muted: #6b7787;
  --line: #e3e8ef;
  --brand: #e62b2b;      /* v2.8.2: фирменный красный логотипа */
  --brand-dark: #b40f0f;
  --brand-soft: #ffeaea;
  --ok: #0f9d58;
  --ok-soft: #e6f6ec;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info: #1d6fe0;
  --info-soft: #e8f1fe;
  --danger: #d92d20;
  --danger-soft: #fee4e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --nav-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}
a { color: var(--info); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.app { display: flex; flex-direction: column; width: 100%; max-width: none; margin: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, #101828, #182234);
  color: #fff;
  padding: 10px 14px calc(10px) ;
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 12px rgba(16,24,40,.18);
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand);
  display: grid; place-items: center; flex: 0 0 auto;
}
.topbar .logo svg { width: 20px; height: 20px; }
.topbar h1 { font-size: 16px; line-height: 1.15; }
.topbar .sub { font-size: 11.5px; color: #9aa7b8; font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .today-chip {
  font-size: 12px; color: #cfd7e2; background: rgba(255,255,255,.08);
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.icon-btn {
  border: 0; background: rgba(255,255,255,.08); color: #fff;
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.16); }

main { flex: 1; padding: 14px; padding-bottom: 28px; min-width: 0; }
.page-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.page-title h2 { font-size: 21px; }
.page-title .spacer { flex: 1; }

/* ---------- нижняя навигация (телефон) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex; align-items: stretch;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.fab-link { position: relative; }
.tabbar a.fab-link .fab {
  width: 50px; height: 50px; border-radius: 16px; background: var(--brand); color: #fff;
  display: grid; place-items: center; margin-top: -22px;
  box-shadow: 0 6px 18px rgba(234,88,12,.4);
}
.tabbar a.fab-link .fab svg { width: 26px; height: 26px; }

/* ---------- сайдбар (ПК) ---------- */
.sidenav { display: none; }
@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); max-width: none; width: 100%; }
  .topbar { grid-column: 1 / -1; }
  main { min-width: 0; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 12px; border-right: 1px solid var(--line); min-height: calc(100vh - 58px);
  }
  .sidenav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    color: var(--muted); font-weight: 600; font-size: 14px;
  }
  .sidenav a:hover { background: #e9edf3; color: var(--ink); }
  .sidenav a.active { background: var(--brand-soft); color: var(--brand-dark); }
  .sidenav a svg { width: 19px; height: 19px; }
  .sidenav .group { margin: 14px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #9aa7b8; padding-left: 12px; }
  main { padding: 22px 26px 60px; }
}
@media (min-width: 1500px) {
  .app { grid-template-columns: 264px minmax(0, 1fr); }
  main { padding-left: clamp(30px, 2.2vw, 56px); padding-right: clamp(30px, 2.2vw, 56px); }
}

/* ---------- карточки / сетки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 12px 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.kpi .label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 23px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: linear-gradient(180deg, #fff7f2, #fff); border-color: #fbd9c3; }
.kpi.accent .value { color: var(--brand-dark); }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; }
.row-item {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  border-bottom: 1px solid var(--line); cursor: pointer; background: var(--card);
}
.row-item:last-child { border-bottom: 0; }
.row-item:active { background: #f6f8fb; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 700; font-size: 15px; }
.row-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-item .right { text-align: right; flex: 0 0 auto; }
.row-item .amount { font-weight: 800; font-size: 15px; }
.plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700;
  background: #f1f4f8; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; font-size: 13px;
  display: inline-block;
}
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--info-soft); color: var(--info);
}
.avatar.orange { background: var(--brand-soft); color: var(--brand-dark); }
.avatar.green { background: var(--ok-soft); color: var(--ok); }

.group-label {
  padding: 10px 14px 6px; font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; background: var(--bg);
  position: sticky; top: 58px; z-index: 5;
}
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 8px; }

/* ---------- статусы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-записан { background: var(--info-soft); color: var(--info); }
.badge.s-в-работе, .badge.s-work { background: var(--warn-soft); color: var(--warn); }
.badge.s-готов { background: #ede9fe; color: #6d28d9; }
.badge.s-выдан { background: var(--ok-soft); color: var(--ok); }
.badge.s-отменён { background: #eef1f5; color: #667085; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 14px; border-radius: 11px; font-weight: 700; font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f6f8fb; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(234,88,12,.28); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); border-color: #f7c9c5; background: #fff6f5; }
.btn.sm { padding: 7px 10px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 7px 13px;
  border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .6; font-weight: 600; margin-left: 4px; }

/* ---------- формы ---------- */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; outline: none; font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234,88,12,.12); }
.textarea { min-height: 72px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- модалка / лист ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,24,40,.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
@media (min-width: 900px) { .overlay { align-items: center; padding: 24px; } }
.sheet {
  background: #fff; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column;
  border-radius: 18px 18px 0 0; animation: slide .2s ease-out;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .sheet { border-radius: 18px; max-height: 88vh; } }
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateY(24px); opacity: .6 } }
.sheet-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sheet-head h3 { font-size: 17px; flex: 1; }
.sheet-body { padding: 16px; overflow-y: auto; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; background: #fbfcfe; }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: #dfe4ea; margin: 8px auto -4px; }
@media (min-width: 900px) { .grabber { display: none; } }

/* ---------- позиции в наряде ---------- */
.item-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fbfcfe; }
.item-row .top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row .kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.item-name { margin-bottom: 8px; }
.item-line { display: grid; grid-template-columns: 1fr 112px 38px; gap: 8px; align-items: center; }
.item-line.part { grid-template-columns: 72px 1fr 38px; }
.item-line .input, .item-line .select { padding: 9px 10px; }
.inventory-note { margin-top: 6px; color: var(--muted); font-size: 12px; }
.inventory-note.warn { color: var(--danger); font-weight: 700; }
@media (min-width: 720px) {
  .item-line.work { grid-template-columns: 1fr 190px 130px 38px; }
  .item-line.part { grid-template-columns: 86px 130px 38px; }
}
.del-btn { border: 0; background: var(--danger-soft); color: var(--danger); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; font-weight: 700; }
.total-line.big { font-size: 19px; border-top: 1px solid var(--line); background: #fff7f2; }
.add-line { display: flex; gap: 8px; }

/* ---------- склад запчастей ---------- */
.inv-search { width: min(100%, 290px); }
.inv-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inv-actions .btn { white-space: nowrap; }
.inventory-low { color: var(--danger); }
.inventory-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.inventory-status.ok { color: #137547; background: #e9f8ef; }
.inventory-status.low { color: #b42318; background: #fff0ed; }
.inventory-delta { display: inline-block; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inventory-delta.in { color: #137547; }
.inventory-delta.out { color: #b42318; }
.inventory-current { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 719px) {
  .inv-search { width: 100%; max-width: 100%; }
  .inventory-table td[data-l="Действия"]::before { align-self: flex-start; }
}

/* ---------- таблица (ПК) ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; position: sticky; top: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.total td { font-weight: 800; background: #fff7f2; border-bottom: 0; }
@media (max-width: 719px) {
  table.tbl { min-width: 0; }
  table.tbl thead { display: none; }
  table.tbl tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.tbl td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  table.tbl td::before { content: attr(data-l); color: var(--muted); font-size: 12.5px; font-weight: 600; }
  table.tbl td.strong { font-weight: 800; font-size: 16px; }
  table.tbl tr.total { background: #fff7f2; }
}

/* ---------- прочее ---------- */
.fab-fixed {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 35; width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(234,88,12,.4);
  display: grid; place-items: center; cursor: pointer;
}
@media (min-width: 900px) { .fab-fixed { bottom: 26px; } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 22px);
  background: #101828; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px;
  z-index: 90; box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: 92vw;
}
.toast.err { background: var(--danger); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.search { position: relative; }
.search .input { padding-left: 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }
.picklist { border: 1px solid var(--line); border-radius: 11px; max-height: 210px; overflow-y: auto; background: #fff; }
.picklist .pl-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.picklist .pl-item:hover { background: #f6f8fb; }
.picklist .pl-item.sel { background: var(--brand-soft); }
.picklist .pl-new { color: var(--brand-dark); font-weight: 700; }
.spinner { display: grid; place-items: center; padding: 40px; color: var(--muted); }

/* Прайс: марки с заполненной нормой видны в списке, остальные — внутри карточки работы */
.service-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.service-groups .card { min-width: 0; }
.service-price-item { cursor: pointer; gap: 12px; }
.service-price-item:hover { background: #f8fafc; }
.service-price-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 62%; }
.service-price-tag { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; background: #f8fafc; font-variant-numeric: tabular-nums; }
.service-price-tag span { color: var(--muted); font-size: 11px; }
.service-price-tag b { font-size: 13px; }
.service-price-empty { color: var(--muted); font-size: 12px; white-space: nowrap; }
/* обязательные поля */
.req { color: var(--danger); font-weight: 800; }
.input.input-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft); background: #fff5f5; }
.field .hint.hint-error { color: var(--danger); font-weight: 600; }

.service-brand-help { padding: 10px 12px; margin: 6px 0 12px; border-radius: 10px; color: var(--muted); background: #f4f7fb; font-size: 13px; line-height: 1.45; }
/* v2.8: редактор прайса — блоки по маркам, у марки сколько угодно вариантов/примечаний */
.svc-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fbfdff; }
.svc-group-head { display: grid; grid-template-columns: minmax(140px, 1fr) auto 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.svc-group-hint { font-size: 11px; white-space: nowrap; }
.svc-variant { display: grid; grid-template-columns: 84px 110px minmax(140px, 1fr) 30px; gap: 8px; align-items: center; padding: 5px 0; }
.svc-variant .input { min-width: 0; }
.svc-price { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.svc-add-variant { margin-top: 6px; }
@media (min-width: 1350px) { .service-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 2100px) { .service-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .service-price-item { align-items: flex-start; flex-wrap: wrap; }
  .service-price-tags { width: 100%; max-width: none; justify-content: flex-start; }
  .svc-variant { grid-template-columns: 72px 92px 28px; grid-template-areas: "hours price del" "note note note"; gap: 6px; }
  .svc-variant [data-hours] { grid-area: hours; }
  .svc-variant .svc-price { grid-area: price; }
  .svc-variant [data-note] { grid-area: note; }
  .svc-variant [data-variant-remove] { grid-area: del; }
}

/* v2.8: запчасть клиента */
.client-part-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; padding: 5px 9px; border: 1px dashed var(--line); border-radius: 999px; font-size: 12px; cursor: pointer; user-select: none; }
.client-part-toggle.on { border-color: var(--ok); background: var(--ok-soft); }
.client-part-toggle small { font-size: 10px; }
.badge.client-part { background: var(--ok-soft); color: var(--ok); }

/* v2.8: график выручки */
.chart-box { padding: 10px 12px 4px; overflow-x: auto; }
.chart-legend { display: flex; align-items: center; gap: 6px; padding: 0 12px 10px; font-size: 12px; color: var(--muted); }
.chart-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .lg.works { background: #3b82f6; }
.chart-legend .lg.parts { background: #22c55e; margin-left: 8px; }

/* v2.9.2: табель фикс-сотрудников */
.tab-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.tab-day { width: 54px; padding: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); color: inherit; display: flex; flex-direction: column; align-items: center; cursor: pointer; font: inherit; }
.tab-day small { font-size: 10px; color: var(--muted); }
.tab-day b { font-size: 15px; }
.tab-day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab-day.on small { color: #fff; }
.tab-day:disabled { opacity: .35; cursor: default; }

/* v2.9: гостевой режим «только просмотр» */
.guest-bar { position: sticky; top: 0; z-index: 60; padding: 9px 14px; background: linear-gradient(90deg, #b45309, #92400e); color: #fff; font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.25); }

/* v2.8: фото заказ-наряда */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-item { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f8fafc; }
.photo-item img { display: block; width: 100%; height: 130px; object-fit: cover; }
.photo-item figcaption { padding: 5px 8px; font-size: 11px; color: var(--muted); }
.photo-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none; border-radius: 50%; background: rgba(15,23,42,.65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.photo-del:hover { background: var(--danger); }
/* Недельное расписание: 7 дней в строку, горизонтальная прокрутка на узком экране */
.schedule-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; }
.schedule-range { flex: 1; min-width: 0; text-align: center; }
.schedule-range b { display: block; font-size: 16px; }
.schedule-range span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.schedule-hint { margin: 0 0 10px; }
.schedule-card { overflow: hidden; }
.schedule-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.schedule-table { width: 100%; min-width: 1260px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.schedule-table th { position: sticky; top: 0; z-index: 2; padding: 11px 10px; text-align: left; vertical-align: top; background: #f8fafc; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.schedule-table td { width: 14.285%; padding: 8px; vertical-align: top; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-table th:last-child, .schedule-table td:last-child { border-right: 0; }
.schedule-table th.is-today, .schedule-table td.is-today { background: #fffaf5; }
.schedule-day-name { display: inline-block; font-size: 14px; font-weight: 800; }
.schedule-day-date { display: inline-block; margin-left: 6px; color: var(--muted); font-size: 12px; }
.schedule-day-count { float: right; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #eef1f5; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; }
.schedule-day-list { display: flex; min-height: 145px; flex-direction: column; gap: 7px; }
.schedule-job { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 9px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.schedule-job:hover { border-color: #f1b58e; background: #fffaf6; }
.schedule-job-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: var(--muted); font-size: 11px; }
.schedule-job-head .badge { padding: 2px 6px; font-size: 9px; }
.schedule-car { overflow-wrap: anywhere; font-size: 14px; line-height: 1.25; }
.schedule-plate { width: fit-content; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.schedule-client { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-empty { display: grid; min-height: 100px; place-items: center; padding: 10px; color: #9aa7b8; border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; text-align: center; }
.schedule-add { display: block; margin-top: 8px; padding: 6px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 11px; }
.schedule-add:hover { color: var(--brand-dark); border-color: #f1b58e; background: #fffaf6; }
@media (max-width: 560px) {
  .schedule-toolbar { gap: 6px; padding: 8px; }
  .schedule-range b { font-size: 13px; }
  .schedule-range span { font-size: 10px; }
  .schedule-toolbar .btn { padding: 7px 9px; }
}
.app-footer {
  grid-column: 1 / -1; padding: 13px 16px 18px; text-align: center;
  border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px;
}
.app-footer strong { color: var(--ink); font-weight: 700; }


/* ===== Финансы сервиса за период (v2.7) ===== */
.fin-card { margin-bottom: 12px; }
.fin-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.fin-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc;
  min-width: 0;
}
.fin-tile .fin-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fin-tile .fin-val { font-size: 19px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.fin-tile .fin-val.neg { color: var(--danger); }
.fin-tile .fin-val.pos { color: var(--ok); }
.fin-tile small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.fin-tile.accent { background: linear-gradient(180deg, var(--ok-soft), #fff); border-color: #bfe6cd; }
.fin-lines { border-top: 1px solid var(--line); padding-top: 8px; }
.fin-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 2px; font-size: 13.5px; border-bottom: 1px dashed #eef1f5;
}
.fin-line:last-child { border-bottom: none; }
.fin-line span { color: var(--ink); }
.fin-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-line b.neg { color: var(--danger); font-weight: 600; }
.fin-line b.muted, .fin-line span.muted { color: var(--muted); font-weight: 600; }
.fin-line.total { border-top: 1px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 10px; }
.fin-line.total span { font-weight: 800; }
.fin-line.total b { font-size: 17px; font-weight: 800; color: var(--ok); }
@media (max-width: 560px) {
  .fin-hero { grid-template-columns: 1fr; }
  .fin-tile { flex-direction: row; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
  .fin-tile .fin-label { min-width: 90px; }
  .fin-tile small { flex-basis: 100%; }
}

/* ===== История изменений (v2.7) ===== */
.audit-row { font-size: 13px; }
.audit-row .audit-time { font-size: 11px; margin-top: 2px; }
