:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #059669;
  --red: #dc2626;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, #dbeafe 0, transparent 35%),
    radial-gradient(circle at 85% 80%, #d1fae5 0, transparent 35%), #f8fafc;
}
.login-card {
  width: min(420px, 100%);
  background: white;
  padding: 38px;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}
.brand-mark, .logo span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}
.login-card h1 { margin: 18px 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; color: #374151; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #dbeafe; }
textarea { min-height: 86px; resize: vertical; }
.login-card label + label { margin-top: 15px; }
.login-card button { width: 100%; margin-top: 22px; }
.error { color: var(--red); font-size: 13px; margin-top: 12px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar {
  background: #0f172a;
  color: white;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 0 10px 24px; font-size: 19px; }
.logo span { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
nav { display: grid; gap: 5px; }
nav button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 11px 13px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  gap: 12px;
}
nav button:hover, nav button.active { background: #1e293b; color: white; }
.sidebar-user {
  margin-top: auto;
  border-top: 1px solid #334155;
  padding: 18px 6px 0;
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  gap: 9px;
  align-items: center;
}
.sidebar-user strong, .sidebar-user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { color: #94a3b8; margin-top: 2px; font-size: 11px; }
.sidebar-user button { border: 0; background: transparent; color: #94a3b8; font-size: 20px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #2563eb; font-weight: 750; }

main { min-width: 0; }
header {
  min-height: 82px;
  padding: 17px 30px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(10px);
}
header h1 { margin: 0; font-size: 22px; }
header p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
header .primary { margin-left: auto; }
.content { padding: 26px 30px 50px; }
.primary, .secondary, .danger {
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  font-weight: 650;
}
.primary { color: white; background: var(--accent); }
.primary:hover { background: #1d4ed8; }
.secondary { color: #374151; background: #f3f4f6; }
.danger { color: var(--red); background: #fee2e2; }
.icon-button { border: 0; background: transparent; padding: 7px; font-size: 21px; }
#menu-toggle { display: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .search { width: min(340px, 100%); }
.toolbar .date-search { width: 146px; }
.toolbar .filter-select { width: min(280px, 100%); }
.toolbar .spacer { flex: 1; }
.filters-toolbar {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .035);
}
.filters-toolbar input,
.filters-toolbar select {
  min-height: 42px;
  border-radius: 10px;
}
.filters-toolbar .primary {
  min-height: 42px;
  white-space: nowrap;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .025);
}
.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-head h2 { margin: 0; font-size: 22px; }
.dashboard-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.date-filter {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.date-filter label { gap: 4px; font-size: 11px; color: var(--muted); }
.date-filter input,
.date-filter .flatpickr-input { width: 146px; padding: 9px 10px; border-radius: 9px; }
.date-filter button { height: 39px; }
.date-filter #clear-stats {
  width: 39px;
  padding: 0;
  font-size: 20px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric-card {
  display: grid;
  gap: 7px;
  min-height: 124px;
  padding: 18px;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .045);
}
.metric-card.accent {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #1f9daf, #2463eb);
}
.metric-card small { color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-card.accent small,
.metric-card.accent span { color: rgba(255,255,255,.78); }
.metric-card strong { font-size: 25px; line-height: 1.1; }
.metric-card span { color: var(--muted); font-size: 12px; }
.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  margin-bottom: 16px;
}
.side-stack { display: grid; gap: 16px; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; }
.chart-card {
  padding: 18px;
  min-width: 0;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .045);
}
.main-chart { min-height: 392px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.chart-head h2 { margin: 0; font-size: 16px; }
.chart-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.chart-head > strong { color: #229bad; font-size: 20px; white-space: nowrap; }
.chart-box { position: relative; width: 100%; }
.revenue-box { height: 300px; }
.orders-box { height: 142px; }
.donut-wrap { display: grid; grid-template-columns: 138px 1fr; gap: 14px; align-items: center; }
.donut-box { height: 138px; }
.chart-legend { display: grid; gap: 10px; }
.chart-legend div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.chart-legend span { width: 10px; height: 10px; border-radius: 999px; }
.chart-legend strong { font-size: 13px; }
.chart-legend small { color: var(--muted); }
.compact-bars { display: grid; gap: 14px; }
.compact-bars > div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}
.compact-bars > div:last-child { border-bottom: 0; padding-bottom: 0; }
.compact-bars header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.compact-bars header span {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.compact-bars header strong {
  white-space: nowrap;
  font-size: 13px;
}
.compact-bars .bar-bg { width: 100%; }
.compact-bars small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.flatpickr-calendar {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
  z-index: 2147483647;
}
.flatpickr-wrapper { width: 100%; }
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  border-color: var(--accent);
  background: var(--accent);
}
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.section-card { padding: 20px; }
.section-card h2 { margin: 0 0 18px; font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #f9fafb; }
tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f8fbff; }
.clickable-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.clickable-card:hover { border-color: #bfdbfe; box-shadow: 0 8px 24px rgba(37, 99, 235, .08); }
.group-row td {
  background: #eef4ff;
  color: #1e3a8a;
  font-weight: 750;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
}
.group-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: white;
  color: #2563eb;
  font-size: 11px;
}
.table-card { overflow: hidden; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; background: #f3f4f6; }
.badge.green { background: #d1fae5; color: #047857; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.gray { color: #6b7280; }
.actions { display: flex; gap: 7px; }
.actions button { border: 0; border-radius: 7px; padding: 6px 9px; background: #f3f4f6; color: #374151; }
.actions button:disabled { cursor: not-allowed; opacity: .5; }
.client-cell strong, .client-cell small { display: block; }
.client-cell small { color: var(--muted); margin-top: 3px; }
.service-tags { display: flex; gap: 4px; flex-wrap: wrap; max-width: 320px; }
.category-list { display: grid; gap: 14px; }
.category-card { padding: 18px; }
.category-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.category-card h2 { margin: 0; font-size: 17px; }
.category-card small { display: block; margin-top: 4px; color: var(--muted); }
.category-services {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 14px;
}
.empty-inline { color: var(--muted); font-size: 13px; }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.calendar-head h2 { margin: 0; font-size: 22px; text-transform: capitalize; }
.calendar-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.calendar-controls button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 22px;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
}
.calendar-card,
.agenda-card { padding: 18px; border-radius: 18px; }
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}
.calendar-day {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
}
.calendar-day:hover { border-color: #bfdbfe; background: #f8fbff; }
.calendar-day.muted { color: #9ca3af; background: #f9fafb; }
.calendar-day.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px #bfdbfe;
}
.calendar-day.today span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
}
.calendar-day strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: 12px;
}
.agenda-head {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.agenda-head h2 { margin: 0; font-size: 17px; }
.agenda-head small { color: var(--muted); }
.agenda-list { display: grid; gap: 10px; }
.agenda-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}
.agenda-item:hover { border-color: #bfdbfe; background: #f8fbff; }
.agenda-item time {
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
}
.agenda-item strong,
.agenda-item span,
.agenda-item small { display: block; min-width: 0; overflow-wrap: anywhere; }
.agenda-item span { margin-top: 2px; color: #374151; font-size: 13px; }
.agenda-item small { margin-top: 4px; color: var(--muted); }
.agenda-item b { white-space: nowrap; font-size: 13px; }

.bars { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 80px; align-items: center; gap: 9px; font-size: 12px; }
.bar-bg { height: 8px; background: #eef2f7; border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; min-width: 3px; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: 20px; }

dialog {
  width: min(1040px, calc(100% - 28px));
  max-height: 96vh;
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.modal-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head button { margin-left: auto; }
#modal-body { padding: 22px 26px; overflow-y: auto; max-height: calc(100vh - 94px); }
dialog.order-modal {
  width: min(1180px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
}
dialog.order-modal.calendar-open {
  min-height: min(760px, calc(100vh - 28px));
}
dialog.order-modal #modal-body {
  max-height: calc(100vh - 94px);
  overflow: visible;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.service-form { display: grid; gap: 16px; }
.service-form .form-actions { margin-top: 0; }
.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}
.detail-list span,
.price-preview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.detail-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.detail-section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.detail-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}
.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.price-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.price-preview-grid div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fbfdff;
}
.price-preview-grid strong { color: var(--accent); }
.price-preview-grid small { color: var(--muted); font-size: 11px; }
.form-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fbfdff;
}
.form-section h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
  color: #111827;
}
.price-class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.price-class {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: white;
}
.price-class strong {
  display: flex;
  align-items: center;
  min-height: 24px;
  font-size: 13px;
  color: var(--accent);
}
.service-state {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: end;
  gap: 14px;
  background: white;
}
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 7px; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 500;
}
.check input { width: auto; }
.order-total { background: var(--accent-soft); border-radius: 11px; padding: 14px; display: grid; gap: 6px; }
.order-total div { display: flex; justify-content: space-between; }
.order-total strong { font-size: 18px; }
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.wizard-steps button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: white;
  color: var(--muted);
  font-weight: 700;
}
.wizard-steps button.active {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent);
}
.wizard-panel { display: grid; gap: 14px; }
.payment-schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr);
  gap: 18px;
  align-items: start;
}
.schedule-field {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.schedule-field-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: end;
}
.schedule-field-head button {
  height: 43px;
  white-space: nowrap;
}
.schedule-calendar-note {
  color: var(--muted);
  font-size: 12px;
}
.schedule-field .flatpickr-wrapper {
  width: 100%;
}
.schedule-field .flatpickr-calendar.static {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 348px;
  max-width: min(348px, calc(100vw - 44px));
  margin: 0;
}
.schedule-field ~ .flatpickr-calendar,
dialog .flatpickr-calendar {
  border-color: #dbeafe;
}
dialog .flatpickr-months {
  padding-top: 6px;
}
dialog .flatpickr-current-month {
  font-size: 16px;
  font-weight: 800;
}
dialog .flatpickr-weekday {
  color: #64748b;
  font-weight: 800;
}
dialog .flatpickr-day {
  border-radius: 9px;
}
dialog .flatpickr-time {
  border-top: 1px solid #e8eef7;
  min-height: 52px;
}
dialog .flatpickr-time input,
dialog .flatpickr-time .flatpickr-am-pm {
  font-size: 18px;
  font-weight: 800;
}
.client-picker-head,
.car-picker-head {
  display: flex;
  align-items: end;
  gap: 10px;
}
.client-picker-head .search { flex: 1; }
.client-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}
.client-results button {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}
.client-results button:hover { border-color: #bfdbfe; background: #f8fbff; }
.client-results button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px #dbeafe;
}
.client-results strong { font-size: 15px; }
.client-results span { font-weight: 650; }
.client-results small { color: var(--muted); }
.quick-client-form,
.quick-car-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: var(--accent-soft);
}
.quick-client-form .wide { grid-column: 1 / -1; }
.quick-client-form button,
.quick-car-form button { align-self: end; }
.car-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 7px;
}
.car-picker button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}
.car-picker button:hover { border-color: #bfdbfe; background: #f8fbff; }
.car-picker button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px #dbeafe;
}
.car-picker strong { font-size: 15px; line-height: 1.25; }
.car-picker span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #111827;
  color: white;
  font-size: 12px;
  font-weight: 750;
}
.car-picker small { color: var(--muted); }
.service-picker {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(520px, 1.35fr);
  gap: 14px;
}
.service-results,
.selected-services {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}
.service-results button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: white;
  text-align: left;
}
.service-results button:hover { border-color: #bfdbfe; background: #f8fbff; }
.service-results span {
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.service-results small,
.selected-service small { color: var(--muted); }
.selected-service {
  display: grid;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: white;
}
.selected-service-main { min-width: 0; }
.selected-service-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 150px 44px;
  gap: 9px;
  align-items: end;
}
.selected-service label { min-width: 0; }
.selected-service strong,
.selected-service small { display: block; overflow-wrap: anywhere; }
.selected-service strong { line-height: 1.25; }
.selected-service button {
  width: 44px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: #fee2e2;
  color: var(--red);
  font-size: 20px;
}
.wizard-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.wizard-footer button:disabled { opacity: .45; cursor: not-allowed; }
.review-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #111827;
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: .2s;
  pointer-events: none;
  z-index: 20;
}
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .logo strong, nav span, .sidebar-user > div:not(.avatar), .sidebar-user button { display: none; }
  .sidebar { padding-inline: 10px; }
  nav button { justify-content: center; font-size: 18px; }
  .sidebar-user { display: flex; justify-content: center; }
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .date-filter { align-self: stretch; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-layout, .grid-2, .dashboard-grid, .calendar-layout { grid-template-columns: 1fr; }
  .payment-schedule-row { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app { display: block; }
  .sidebar { position: fixed; z-index: 10; width: 230px; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .logo strong, nav span, .sidebar-user > div:not(.avatar), .sidebar-user button { display: block; }
  nav button { justify-content: flex-start; font-size: 15px; }
  .sidebar-user { display: grid; }
  #menu-toggle { display: block; }
  header { padding: 13px 15px; }
  header .primary { padding: 9px 10px; }
  .content { padding: 18px 14px 35px; }
  .toolbar .search,
  .toolbar .date-search,
  .toolbar .filter-select,
  .filters-toolbar .primary { width: 100%; }
  .toolbar .spacer { display: none; }
  .date-filter { display: grid; grid-template-columns: 1fr 1fr; }
  .date-filter input { width: 100%; }
  .date-filter button { width: 100%; }
  .calendar-head { align-items: stretch; flex-direction: column; }
  .calendar-controls { display: grid; grid-template-columns: 40px 1fr 40px; }
  .calendar-day { min-height: 68px; padding: 9px; }
  .agenda-item { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
  .donut-box { margin: 0 auto; max-width: 160px; }
  .form-grid, .checks, .price-class-grid, .service-state, .detail-list, .price-preview-grid, .wizard-steps, .client-results, .quick-client-form, .quick-car-form, .car-picker, .service-picker, .selected-service, .selected-service-controls, .schedule-field-head { grid-template-columns: 1fr; }
  .client-picker-head, .car-picker-head { align-items: stretch; flex-direction: column; }
  .form-grid .wide { grid-column: auto; }
  dialog.order-modal #modal-body { overflow-y: auto; }
}
