/* Visual language ≈ fleetx admin: soft canvas, deep teal, floating cards.
 * Шрифты — только системные: Google Fonts с телефона в РФ без VPN часто
 * зависают и держат весь CSS (белый экран). */
:root {
  --bg: #e6ebf2;
  --bg-deep: #dce3ed;
  --fg: #1a2430;
  --muted: #7a8696;
  --card: #ffffff;
  --accent: #163f3c;
  --accent-mid: #1f5c57;
  --accent-soft: #e3f0ee;
  --accent-mint: #9fd6cf;
  --accent-fg: #ffffff;
  --chip: #f1f4f8;
  --line: rgba(26, 36, 48, 0.07);
  --shadow: 0 14px 36px rgba(26, 36, 48, 0.07);
  --radius: 24px;
  --radius-sm: 16px;
  --ok: #0f7a4c;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filter-rail {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 14px;
}
.filter-rail[hidden] { display: none !important; }
.filter-rail-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.filter-rail .filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.filter-rail .filter-field,
.filter-rail .filter-field.grow {
  flex: none;
  width: 100%;
  min-width: 0;
}
.filter-rail .chip-btn,
.filter-rail .primary {
  width: 100%;
}
.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #6b7a8c);
  margin-bottom: 6px;
}
.ms-wrap {
  position: relative;
  width: 100%;
}
.ms-btn {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line, #d7dde6);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink, #15202b);
  text-align: left;
  cursor: pointer;
}
.ms-btn:hover {
  border-color: #b7c2d0;
}
.ms-wrap.has-value .ms-btn {
  border-color: #8af49e;
  background: #f3fff6;
}
.ms-btn[aria-expanded="true"] {
  border-color: #8af49e;
  box-shadow: 0 0 0 3px rgba(138, 244, 158, 0.28);
}
.ms-btn-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-caret {
  flex: 0 0 auto;
  color: #8a97a6;
  font-size: 0.75rem;
}
.ms-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line, #d7dde6);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 32, 43, 0.12);
}
.ms-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink, #15202b);
  cursor: pointer;
  user-select: none;
}
.ms-opt:hover {
  background: #f3f6f9;
}
.ms-opt input {
  width: 15px;
  height: 15px;
  accent-color: #8af49e;
  cursor: pointer;
  flex: 0 0 auto;
}
.ms-empty {
  padding: 10px 8px;
  font-size: 0.82rem;
  color: #8a97a6;
}

.side {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brand-card {
  background: #0b0b0b;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  min-height: 56px;
}
.fx-logo-side .fx-logo-name {
  color: #fff;
}
.fx-logo-side .fx-logo-sub {
  color: rgba(255, 255, 255, 0.55);
}
.fx-logo-side .fx-logo-icon {
  width: 34px;
  height: 34px;
}

.main { min-width: 0; flex: 1; }

.top {
  padding: 4px 6px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.brand-block { min-width: 0; }
.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.45rem;
  color: var(--fg);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-mid);
}
.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
}
.side-user,
.me {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--chip);
  border-radius: 16px;
}
.me-label { word-break: break-word; color: var(--fg); }
.me-logout {
  border: none;
  align-self: flex-start;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.me-logout:hover { background: var(--accent-soft); }
.shift-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.shift-pill.shift-ok {
  background: #dcfce7;
  color: #166534;
}
.shift-pill.shift-bad {
  background: #fee2e2;
  color: #991b1b;
}
.shift-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}
.shift-banner-ok {
  background: #ecfdf5;
  color: #065f46;
}
.shift-banner-bad {
  background: #fef2f2;
  color: #991b1b;
}
.acts-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.acts-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.act-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.act-row:first-of-type { border-top: none; }
.act-row-type { font-weight: 600; }
.act-row-meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.badge.act-st-done { background: #dcfce7; color: #166534; }
.badge.act-st-wait { background: #fef3c7; color: #92400e; }
.badge.act-st-default { background: var(--chip); color: var(--fg); }
body.need-login .side,
body.need-login .top,
body.need-login .filter-rail {
  display: none !important;
}
body.need-login {
  background: #dbe2e9;
}
body.need-login .shell {
  width: 100%;
  max-width: none !important;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px 20px;
  background: transparent;
  gap: 0;
}
body.need-login .main {
  width: min(860px, calc(100vw - 40px)) !important;
  max-width: 860px !important;
  flex: 0 0 auto !important;
  padding-top: 0 !important;
}
body.need-login .panel {
  display: block !important;
  grid-template-columns: none !important;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  width: 100%;
  min-height: 0 !important;
}
body.need-login .view {
  padding: 0;
  width: 100%;
}

.login-wrap {
  display: block;
  width: 100%;
}
.login-card {
  width: 100%;
  box-sizing: border-box;
  background: #f3f5f7;
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(26, 36, 48, 0.1);
  border: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
.login-body {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #f7f8fa;
}
.login-brand {
  position: relative;
  background: #eceff3;
  padding: 28px 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 180px;
}
.login-deco {
  position: absolute;
  right: -48px;
  bottom: -72px;
  width: 260px;
  height: 260px;
  border-radius: 46% 54% 42% 58% / 52% 38% 62% 48%;
  background:
    radial-gradient(circle at 35% 35%, #9af7ad 0 28%, transparent 29%),
    radial-gradient(circle at 62% 42%, #7ff099 0 24%, transparent 25%),
    radial-gradient(circle at 48% 64%, #8af49e 0 30%, transparent 31%),
    linear-gradient(145deg, #8af49e 0%, #5fe07a 100%);
  opacity: 0.95;
  pointer-events: none;
  transform: rotate(-18deg);
}
.fx-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fx-logo-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
.fx-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fx-logo-name {
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #1a2430;
}
.fx-logo-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a8696;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #5c6775;
}
.login-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.login-input-wrap .field-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #9aa5b3;
  pointer-events: none;
}
.login-field input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 14px;
  padding: 14px 44px 14px 42px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
  box-shadow: inset 0 1px 2px rgba(26, 36, 48, 0.04);
}
.login-field input:focus {
  outline: none;
  border-color: #8af49e;
  box-shadow: 0 0 0 3px rgba(138, 244, 158, 0.35);
}
.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.55;
  line-height: 1;
}
.pwd-toggle:hover,
.pwd-toggle.is-on {
  opacity: 0.9;
  background: #f1f4f8;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5c6775;
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: 16px;
  height: 16px;
  accent-color: #8af49e;
  cursor: pointer;
}
.login-submit {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 15px 18px;
  border: none;
  border-radius: 16px;
  background: #8af49e;
  color: #143028;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.login-submit:hover {
  filter: brightness(0.97);
}
.login-submit:active {
  transform: scale(0.98);
}
.login-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
#loginOut:not([hidden]) {
  margin-top: 2px;
}

@media (min-width: 700px) {
  .login-card {
    grid-template-columns: 1fr 1fr;
    min-height: 460px;
  }
  .login-body {
    padding: 48px 44px;
  }
  .login-brand {
    order: 0;
    padding: 36px 36px 40px;
    min-height: auto;
  }
  .login-form {
    margin: 0;
    max-width: none;
  }
  .login-deco {
    width: 320px;
    height: 320px;
    right: -64px;
    bottom: -90px;
  }
}
@media (max-width: 699px) {
  .login-card {
    grid-template-rows: auto auto;
  }
  .login-brand {
    order: -1;
    min-height: 160px;
  }
  .login-body {
    padding: 28px 22px 32px;
  }
  .login-form {
    max-width: none;
    margin: 0;
  }
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.tabs {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: none;
  background: transparent;
  color: var(--fg);
  border-radius: 14px;
  padding: 11px 14px;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.tabs button:hover:not(.active) {
  background: var(--chip);
}
.tabs button:active { transform: scale(0.98); }
.tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.view { padding: 18px 16px 20px; }

@media (min-width: 900px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  body.need-login {
    overflow: auto;
  }
  .shell {
    max-width: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: row;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
    box-sizing: border-box;
  }
  .side {
    width: 232px;
    flex: 0 0 232px;
    height: 100%;
    overflow: auto;
    position: sticky;
    top: 0;
  }
  .tabs {
    flex-direction: column;
    overflow: visible;
  }
  .tabs button {
    width: 100%;
  }
  .side-user { margin-top: auto; }
  .main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: auto;
    padding-top: 2px;
  }
  .filter-rail {
    width: 260px;
    flex: 0 0 260px;
    height: 100%;
    overflow: auto;
    position: sticky;
    top: 0;
  }
  body:not(.has-filters) .filter-rail {
    display: none !important;
  }

  /* login: desktop shell must NOT steal centering */
  body.need-login {
    height: auto;
    overflow: auto;
  }
  body.need-login .shell {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 24px;
  }
  body.need-login .main {
    width: min(860px, calc(100vw - 48px)) !important;
    height: auto !important;
    overflow: visible !important;
    padding-top: 0 !important;
  }
}

@media (max-width: 899px) {
  .filter-rail {
    order: 2;
  }
  .main {
    order: 3;
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

/* —— План на день —— */
.plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0 0 16px;
}
.plan-day-pills {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: #eef2f6;
  border-radius: 12px;
}
.plan-pill {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #5b6b7c;
  cursor: pointer;
}
.plan-pill:hover { color: #15202b; }
.plan-pill.active {
  background: #fff;
  color: #15202b;
  box-shadow: 0 1px 4px rgba(21, 32, 43, 0.08);
}
.plan-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7a8c;
}
.plan-date-field input[type="date"] {
  border: 1px solid var(--line, #d7dde6);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink, #15202b);
  background: #fff;
}
.plan-day-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5b6b7c;
  margin: 0 0 14px;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; }
}
.plan-panel {
  background: #fff;
  border: 1px solid var(--line, #d7dde6);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(21, 32, 43, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.plan-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
}
.plan-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.plan-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  background: #eef2f6;
  color: #3d4b5c;
}
.plan-issues .plan-panel-head {
  background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
}
.plan-issues .plan-count { background: #d1fae5; color: #065f46; }
.plan-returns .plan-panel-head {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
}
.plan-returns .plan-count { background: #dbeafe; color: #1d4ed8; }
.plan-free .plan-panel-head {
  background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
}
.plan-free .plan-count { background: #fef3c7; color: #92400e; }
.plan-panel-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow: auto;
}
.plan-event {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid #e8eef4;
  border-radius: 12px;
  background: #fbfcfd;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.plan-event:hover {
  border-color: #c5d0dc;
  background: #fff;
}
.plan-event:active { transform: scale(0.995); }
.plan-event.is-issue { border-left: 4px solid #22c55e; }
.plan-event.is-return { border-left: 4px solid #3b82f6; }
.plan-event-time {
  flex: 0 0 auto;
  min-width: 48px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #15202b;
  padding-top: 1px;
}
.plan-event-body { flex: 1 1 auto; min-width: 0; }
.plan-event-auto {
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.plan-event-client {
  font-size: 0.84rem;
  font-weight: 650;
  color: #3d4b5c;
  margin-bottom: 4px;
}
.plan-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.78rem;
  color: #6b7a8c;
}
.plan-free-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
}
.plan-free-card {
  padding: 12px 14px;
  border: 1px solid #e8eef4;
  border-radius: 12px;
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-free-name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.plan-free-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.plan-free-filial {
  font-size: 0.8rem;
  color: #6b7a8c;
}
.plan-free-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.78rem;
  color: #6b7a8c;
  margin-top: 2px;
}
.plan-free-facts b {
  color: #15202b;
  font-weight: 750;
}
.page-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.err {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.4;
}
.ok-banner {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  font-weight: 600;
  font-size: 0.88rem;
}

.list { display: flex; flex-direction: column; gap: 8px; }

.row {
  background: #f6f8fb;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.row.interactive,
.row.expandable {
  cursor: pointer;
}
.row.interactive:hover,
.row.expandable:hover {
  background: #eef5f4;
  border-color: color-mix(in srgb, var(--accent-mid) 32%, var(--line));
  box-shadow: 0 4px 14px rgba(26, 71, 68, 0.06);
}
.row.expandable { padding: 0; overflow: hidden; }
.row-head {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 13px 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.row-head:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.row-head:active { background: #eef3f7; }
.row.expandable.open {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent-mid) 28%, var(--line));
  box-shadow: 0 6px 18px rgba(21, 32, 43, 0.05);
}
.row .t { font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.row .s { color: var(--muted); font-size: 0.82rem; margin-top: 4px; font-weight: 500; line-height: 1.35; }
.row .s2 { color: var(--muted); font-size: 0.78rem; margin-top: 3px; font-weight: 500; opacity: 0.92; }
.row-detail {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.kv {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 6px 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); font-weight: 600; }
.kv .v { font-weight: 600; word-break: break-word; }
.muted { color: var(--muted); font-weight: 600; font-size: 0.84rem; padding: 8px 0; }

.amt-in { color: var(--ok); }
.amt-out { color: var(--danger); }
.amt-zero { color: var(--muted); }

.table-host { width: 100%; min-width: 0; }
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 4px 16px rgba(21, 32, 43, 0.04);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  min-width: 720px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f9;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--accent); background: #eaf0f5; }
.data-table th.sorted { color: var(--accent); }
.data-table th .sort-ind {
  display: inline-block;
  width: 0.7em;
  margin-left: 4px;
  opacity: 0.35;
}
.data-table th.sorted.asc .sort-ind::after { content: "▲"; opacity: 1; }
.data-table th.sorted.desc .sort-ind::after { content: "▼"; opacity: 1; }
.data-table th:not(.sorted) .sort-ind::after { content: "↕"; font-size: 0.75em; }
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-weight: 600;
  line-height: 1.35;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover td { background: #eef5f4; }
.data-table tbody tr.selected td {
  background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
}
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .ctr { text-align: center; }
.data-table .cell-unit {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  margin-left: 2px;
}
.table-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.table-detail {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfd;
}
.table-detail-head {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.data-table tbody tr.table-detail-row td {
  padding: 0 0 10px;
  background: transparent;
  border-bottom: none;
  vertical-align: top;
}
.data-table tbody tr.table-detail-row .table-detail {
  margin: 2px 4px 4px;
  box-shadow: 0 6px 18px rgba(21, 32, 43, 0.06);
}
.detail-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  max-width: 720px;
}
.detail-card-status { margin-bottom: 12px; }

.print-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(21, 32, 43, 0.04);
}
.print-bar-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b7a88);
}
.print-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.print-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  min-width: 132px;
  text-align: left;
}
.print-chip-title {
  font-weight: 700;
  font-size: 0.9rem;
}
.print-chip-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted, #6b7a88);
}
.print-chip-close {
  border-color: color-mix(in srgb, #c45c26 35%, var(--line));
}
.print-chip:disabled {
  opacity: 0.55;
}

.contract-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(760px, 100%);
}
.contract-form .cf-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px 18px;
  box-shadow: 0 4px 16px rgba(21, 32, 43, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contract-form .cf-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.contract-form .cf-footer {
  background: linear-gradient(180deg, #f7faf9 0%, #eef5f4 100%);
  border: 1px solid color-mix(in srgb, var(--accent-mid) 18%, var(--line));
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(26, 71, 68, 0.05);
}
.contract-form .cf-totals {
  margin-bottom: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.contract-form .form-row { gap: 12px; }
.contract-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
.contract-form .quote {
  margin: 0;
  background: #f6f8fb;
  box-shadow: none;
}
.contract-form .hint { margin: 0; }

.svc-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}
.svc-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f6f8fb;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--fg);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.svc-row:hover {
  background: #eef5f4;
  border-color: color-mix(in srgb, var(--accent-mid) 28%, var(--line));
}
.svc-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-mid);
  cursor: pointer;
}
.svc-row input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  text-align: right;
  color: var(--fg);
  outline: none;
}
.svc-row input[type="number"]:focus {
  border-color: color-mix(in srgb, var(--accent-mid) 45%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 80%, transparent);
}
.svc-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.drv-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  min-height: 32px;
}
.drv-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--accent-mid) 16%, transparent);
}
.drv-chip .chip-btn { padding: 2px 8px; font-size: 0.75rem; }

body.is-web .contract-form { max-width: min(820px, 100%); }

.pay-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  vertical-align: middle;
}
.pay-status.st-unpaid { background: #ffe0e6; color: #9f1239; }
.pay-status.st-partial { background: #fef3c7; color: #92400e; }
.pay-status.st-paid { background: #d1fae5; color: #065f46; }
.pay-status.st-cancel { background: #e5e7eb; color: #4b5563; }
.pay-status.st-unknown { background: var(--chip); color: var(--muted); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.filters label,
.filters .filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  min-width: 0;
}
.filters .filter-field.grow {
  flex: 1 1 180px;
}
.filters input[type="date"],
.filters input[type="search"],
.filters input[type="text"],
.filters select {
  border: 1px solid var(--line);
  background: #f3f6f9;
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--fg);
  text-transform: none;
  letter-spacing: normal;
  min-width: 140px;
  width: 100%;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.filters input[type="search"],
.filters input[type="text"] {
  cursor: text;
}
.filters input:hover,
.filters select:hover,
.filters input:focus,
.filters select:focus {
  border-color: color-mix(in srgb, var(--accent-mid) 40%, var(--line));
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 80%, transparent);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-mid);
  margin-left: 6px;
  font-weight: 700;
  vertical-align: middle;
}
.badge-state {
  margin-left: 0;
}
.badge-state-park { background: #e3f7ea; color: #1a7a45; }
.badge-state-rent { background: #e5f0ff; color: #1f4fbf; }
.badge-state-repair { background: #fde8ef; color: #b4235a; }
.badge-state-staff { background: #e8f4fb; color: #1769a3; }
.badge-state-city { background: #fff4d6; color: #9a6b00; }
.badge-state-other { background: #eef2f6; color: #4a5563; }
.pill-dirty { background: #fff1e6; color: #b45309; }
.pill-clean { background: #e8f7ef; color: #1a7a45; }
.auto-color-line {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5b6b7c;
}
.auto-color-value {
  font-weight: 800;
  letter-spacing: 0.01em;
}
.auto-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auto-tabs {
  display: flex;
  gap: 6px;
  padding: 2px;
  background: #eef2f6;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.auto-tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: #5b6b7c;
  cursor: pointer;
}
.auto-tab:hover {
  color: #15202b;
}
.auto-tab.active {
  background: #fff;
  color: #15202b;
  box-shadow: 0 1px 4px rgba(21, 32, 43, 0.08);
}
.auto-orders-summary {
  font-size: 0.82rem;
  font-weight: 650;
  color: #6b7a8c;
  margin-bottom: 10px;
}
.auto-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auto-order {
  padding: 12px 14px;
  border: 1px solid #e4eaf1;
  border-radius: 10px;
  border-left: 4px solid #94a3b8;
  background: #fff;
}
.auto-order.kind-active { border-left-color: #3b82f6; background: #f5f9ff; }
.auto-order.kind-booking { border-left-color: #f59e0b; background: #fffbeb; }
.auto-order.kind-closed { border-left-color: #94a3b8; background: #f8fafc; }
.auto-order-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.auto-order-num {
  font-weight: 800;
  font-size: 0.92rem;
}
.auto-order-client {
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 2px;
}
.auto-order-period {
  font-size: 0.84rem;
  color: #3d4b5c;
  margin-bottom: 4px;
}
.auto-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: #6b7a8c;
  margin-bottom: 8px;
}
.auto-order-meta b { color: #14532d; }
.auto-order-actions {
  display: flex;
  gap: 8px;
}
.badge.order-kind {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.order-kind-active { background: #dbeafe; color: #1d4ed8; }
.order-kind-booking { background: #fef3c7; color: #b45309; }
.order-kind-closed { background: #e2e8f0; color: #475569; }
.order-kind-other { background: #f1f5f9; color: #64748b; }

.debt-line { font-weight: 700; }
.debt-line b { font-weight: 800; }
.debt-line.debt-neg,
.debt-banner.debt-neg { color: #b42318; }
.debt-line.debt-pos,
.debt-banner.debt-pos { color: #15803d; }
.debt-line.debt-zero,
.debt-banner.debt-zero { color: #4b5563; }
.debt-line.debt-unknown,
.debt-banner.debt-unknown { color: #8a97a6; }
.debt-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.debt-banner.debt-neg {
  background: #fef3f2;
  border-color: #f3c0bb;
}
.debt-banner.debt-pos {
  background: #ecfdf3;
  border-color: #a7f3d0;
}
.debt-banner.debt-zero,
.debt-banner.debt-unknown {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.auto-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 2px 12px;
  border-left: 4px solid #9aa8b8;
}
.auto-card.tone-rent { border-left-color: #3b82f6; }
.auto-card.tone-park { border-left-color: #22c55e; }
.auto-card.tone-repair { border-left-color: #e11d48; }
.auto-card.tone-other { border-left-color: #94a3b8; }
.auto-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auto-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink, #15202b);
}
.auto-card-year {
  font-weight: 600;
  color: #6b7a8c;
  font-size: 0.92em;
}
.auto-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.auto-plate {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #15202b;
  background: #fffef6;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 #8af49e;
}

.auto-card-filial {
  font-size: 0.82rem;
  color: #6b7a8c;
}
.auto-engine {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.auto-engine span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f1ff;
  border: 1px solid #c5d8f5;
  color: #1e3a5f;
  font-size: 0.78rem;
  font-weight: 700;
}
.auto-now {
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line, #d7dde6);
}
.auto-now.is-busy {
  background: linear-gradient(135deg, #e8f0ff 0%, #f3e9ff 100%);
  border-color: #b7c9f5;
}
.auto-now.is-free {
  background: linear-gradient(135deg, #e9fbf0 0%, #eefaf6 100%);
  border-color: #9fd9b2;
}
.auto-now-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b7c;
  margin-bottom: 4px;
}
.auto-now-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink, #15202b);
}
.auto-now-status {
  margin-top: 4px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #8a5a00;
  font-size: 0.78rem;
  font-weight: 700;
  width: fit-content;
}
.auto-now-client {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e3a5f;
}
.auto-now-period {
  margin-top: 4px;
  font-size: 0.86rem;
  color: #3d4b5c;
}
.auto-now-money {
  margin-top: 6px;
  font-size: 0.88rem;
  color: #14532d;
}
.auto-now-money b { font-weight: 800; }
.auto-now-remain {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #9a5b00;
}
.auto-now-remain b { font-weight: 800; }
.auto-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 720px) {
  .auto-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.auto-fact {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f7fa;
  border: 1px solid #e4eaf1;
  border-top: 3px solid #8af49e;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.auto-fact:nth-child(2) { border-top-color: #93c5fd; }
.auto-fact:nth-child(3) { border-top-color: #fbbf24; }
.auto-fact:nth-child(4) { border-top-color: #f9a8d4; }
.auto-fact .k {
  font-size: 0.7rem;
  font-weight: 650;
  color: #7a8796;
  letter-spacing: 0.02em;
}
.auto-fact .v {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink, #15202b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.dog-status {
  margin-left: 0;
  white-space: nowrap;
  border: 1px solid transparent;
}
.dog-st-closed {
  background: #ffffff;
  color: #4b5563;
  border-color: #d1d5db;
}
.dog-st-cancelled {
  background: #fdeceb;
  color: #b42318;
  border-color: #f3c0bb;
}
.dog-st-issued {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.dog-st-waiting {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.dog-st-returned {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
.dog-st-default {
  background: var(--chip);
  color: var(--muted);
  border-color: var(--line);
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input,
.view > .toolbar input {
  flex: 1;
  min-width: 140px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f3f6f9;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  outline: none;
}
.toolbar input:focus,
.view input:focus,
.form input:focus,
.form select:focus {
  border-color: color-mix(in srgb, var(--accent-mid) 45%, var(--line));
  background: #fff;
}
.toolbar button,
.chip-btn,
.form button,
button.primary {
  background: var(--chip);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.toolbar button:hover,
.chip-btn:hover,
.form button:hover,
button.primary:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 10px rgba(21, 32, 43, 0.06);
}
.toolbar button:active,
.chip-btn:active,
.form button:active { transform: scale(0.97); }
.toolbar button.primary,
.chip-btn.active,
button.primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.toolbar button.primary:hover,
button.primary:hover {
  background: var(--accent-mid);
  filter: none;
}

.detail {
  background: #f6f8fb;
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 500;
}

.empty {
  color: var(--muted);
  padding: 40px 18px;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
}
.empty-illu {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent-mid);
  font-size: 1.35rem;
  font-weight: 800;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--chip);
  border-top-color: var(--accent-mid);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.section-h {
  margin: 16px 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
}

.counter {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}
.form label.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 4px 0 2px;
}
.form label.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-mid);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form select,
.form input[type="datetime-local"],
.form input[type="date"],
.form input[type="tel"],
.form input[type="text"],
.form input[type="number"],
.form input[type="search"],
.form input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f3f6f9;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.form select { cursor: pointer; }
.form select:hover,
.form input:not([type="checkbox"]):hover,
.form select:focus,
.form input:not([type="checkbox"]):focus {
  border-color: color-mix(in srgb, var(--accent-mid) 45%, var(--line));
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 80%, transparent);
}
.form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 420px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Pointer hand on interactive controls */
a, button, .chip-btn, .tabs button, .row-head, .row.interactive,
.row.expandable, select, label.check, summary {
  cursor: pointer;
}

.cash-contract-hits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}
.cash-contract-hits .chip-btn {
  text-align: left;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.calc-pick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
}
.calc-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding: 4px 2px 8px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfd;
}
.calc-pick-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.calc-pick-item:hover { background: #eef2f7; }
.calc-pick-item.is-busy { opacity: 0.78; }
.calc-pick-item input { margin-top: 3px; flex-shrink: 0; }
.calc-pick-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calc-pick-title { font-size: 0.92rem; font-weight: 800; letter-spacing: -0.02em; }
.calc-pick-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}
.quotes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quote {
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 4px;
}
.quote-err { border-color: #e8b4b4; background: #fff7f7; }
.quote-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.quote-line {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 2px 0;
}
.quote-line b { font-weight: 800; }
.quote-gap { height: 8px; }
.quote-rule {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}
.quote-total {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-mid);
}
.quote-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.field-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Desktop / browser — scale with viewport */
@media (min-width: 760px) {
  body.is-web .shell {
    width: 100%;
    max-width: 100%;
  }
  body.is-web .table-host { margin-top: 4px; }
  body.is-web .data-table { min-width: 960px; font-size: 0.84rem; }
  /* tabs живут в .side — panel только контент, без внутренней 2-col сетки */
  body.is-web .panel {
    display: block;
    grid-template-columns: none;
    min-height: min(820px, calc(100vh - 100px));
    border-radius: 24px;
  }
  body.is-web .view {
    padding: clamp(16px, 2vw, 28px);
    overflow: auto;
    max-height: calc(100vh - 100px);
  }
  body.is-web .brand { font-size: clamp(1.35rem, 2vw, 1.55rem); }
  body.is-web .page-title { font-size: clamp(1.15rem, 1.6vw, 1.28rem); }
  body.is-web .filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    max-width: none;
  }
  body.is-web .filters .filter-field.grow { grid-column: span 2; }
  body.is-web .filters .chip-btn,
  body.is-web .filters > .primary {
    justify-self: start;
    align-self: end;
  }
  body.is-web .list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body.is-web .form { max-width: min(560px, 100%); }
  body.is-web .quote { max-width: min(560px, 100%); }
  body.is-web .row.expandable.open { grid-column: 1 / -1; }
  body.is-web .kv { grid-template-columns: 140px 1fr; }
}

@media (min-width: 1100px) {
  body.is-web .panel {
    min-height: calc(100vh - 88px);
  }
  body.is-web .view { max-height: calc(100vh - 88px); }
  body.is-web .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.is-web .filters { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  body.is-web .data-table { min-width: 1100px; }
}

@media (min-width: 1500px) {
  body.is-web .list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 759px) {
  body.is-web .shell {
    width: 100%;
    max-width: 100%;
    padding: 10px 10px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  body.is-web .filters .filter-field {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }
  body.is-web .filters .filter-field.grow { flex: 1 1 100%; }
}
