:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-warm: #fff7f0;
  --text: #111820;
  --text-soft: #37414a;
  --muted: #6b737c;
  --line: #dce1e6;
  --line-strong: #cbd2d9;
  --accent: #ff7a1a;
  --accent-hover: #e9650c;
  --accent-soft: #ffe7d5;
  --blue: #2563eb;
  --blue-soft: #e9f0ff;
  --green: #15803d;
  --green-soft: #e7f7ed;
  --amber: #b45309;
  --amber-soft: #fff5dc;
  --red: #b91c1c;
  --red-soft: #feecec;
  --violet: #7c3aed;
  --violet-soft: #f1eaff;
  --cyan: #0e7490;
  --cyan-soft: #e4f6fa;
  --slate: #475569;
  --sidebar: #111820;
  --sidebar-soft: #1b242d;
  --shadow: 0 18px 48px rgba(17, 24, 32, 0.08);
  --shadow-soft: 0 8px 24px rgba(17, 24, 32, 0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  --banner-height: 28px;
  --topbar-height: 72px;
  color-scheme: light;
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 2%, rgba(255, 122, 26, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: inherit;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.prototype-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--banner-height);
  padding: 0 16px;
  background: #fff3e8;
  border-bottom: 1px solid #ffd9bd;
  color: #8b3f08;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.prototype-dot,
.state-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.14);
}

.prototype-copy--mobile {
  display: none;
}

.app-shell {
  min-height: 100vh;
  padding-top: var(--banner-height);
}

.sidebar {
  position: fixed;
  inset: var(--banner-height) auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 122, 26, 0.16), transparent 18rem),
    var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.26);
}

.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark--small {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 18px 12px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  text-align: left;
  transition: 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
}

.nav-icon {
  display: grid;
  width: 28px;
  place-items: center;
  font-size: 20px;
  font-weight: 500;
}

.nav-item.is-active .nav-icon {
  color: var(--accent);
}

.nav-count {
  display: grid;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.nav-count--accent,
.nav-item.is-active .nav-count--accent {
  background: var(--accent);
  color: #fff;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.service-state {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.service-state strong,
.service-state small {
  display: block;
}

.service-state strong {
  font-size: 12px;
}

.service-state small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

.help-link {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #fff;
}

.workspace {
  min-width: 0;
  min-height: calc(100vh - var(--banner-height));
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: var(--banner-height);
  z-index: 40;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(203, 210, 217, 0.75);
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(16px);
}

.mobile-brand {
  display: none;
  padding: 0;
  border-radius: 12px;
  background: transparent;
}

.global-search {
  position: relative;
  display: flex;
  width: min(520px, 46vw);
  height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 5px 16px rgba(17, 24, 32, 0.035);
}

.global-search:focus-within {
  border-color: #8cb0ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-icon {
  color: var(--muted);
  font-size: 23px;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.global-search kbd {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
}

.search-results {
  position: fixed;
  z-index: 90;
  top: calc(var(--banner-height) + 62px);
  left: calc(var(--sidebar-width) + 28px);
  width: min(520px, calc(100vw - var(--sidebar-width) - 56px));
  max-height: 420px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.search-result:hover {
  background: var(--surface-soft);
}

.search-result-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #9b4306;
  font-weight: 900;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 2px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 9px;
}

.icon-button,
.profile-button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.icon-button {
  display: grid;
  width: 44px;
  place-items: center;
  border-radius: 12px;
}

.role-switcher select {
  height: 44px;
  max-width: 190px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 44px;
  padding: 4px 12px 4px 4px;
  border-radius: 13px;
  text-align: left;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.profile-copy strong,
.profile-copy small {
  display: block;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.view-root {
  width: 100%;
  max-width: 1720px;
  min-height: calc(100vh - var(--banner-height) - var(--topbar-height));
  padding: 28px;
}

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

.page-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.page-subtitle {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  transition: 140ms ease;
}

.button--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.2);
}

.button--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.button--secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button--danger {
  border-color: #f3bcbc;
  background: #fff;
  color: var(--red);
}

.button--small {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.panel {
  border: 1px solid rgba(220, 225, 230, 0.92);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 132px;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
}

.metric-card::after {
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: var(--metric-tint, var(--accent-soft));
  content: "";
}

.metric-card > * {
  position: relative;
  z-index: 1;
}

.metric-card--action {
  cursor: pointer;
  transition: 150ms ease;
}

.metric-card--action:hover {
  border-color: var(--metric-color);
  transform: translateY(-2px);
}

.metric-card--action:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-top: 13px;
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.metric-note {
  display: block;
  max-width: calc(100% - 18px);
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.metric-open {
  display: block;
  margin-top: 9px;
  color: var(--metric-color);
  font-size: 10px;
  font-weight: 900;
}

.metric-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--metric-tint, var(--accent-soft));
  color: var(--metric-color, var(--accent-hover));
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.panel-head {
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.panel-title small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.panel-body {
  padding: 15px;
}

.link-button {
  padding: 6px;
  background: transparent;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 800;
}

.schedule-list,
.lead-list,
.reminder-list,
.client-list,
.order-list {
  display: grid;
  gap: 9px;
}

.schedule-row,
.lead-row,
.reminder-row,
.client-row,
.order-row {
  display: grid;
  width: 100%;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  transition: 140ms ease;
}

.schedule-row:hover,
.lead-row:hover,
.reminder-row:hover,
.client-row:hover,
.order-row:hover {
  border-color: #bdc7d0;
  box-shadow: 0 8px 20px rgba(17, 24, 32, 0.055);
  transform: translateY(-1px);
}

.schedule-row {
  grid-template-columns: 72px 6px minmax(180px, 1.4fr) minmax(140px, 0.8fr) auto;
  gap: 11px;
  min-height: 74px;
  padding: 9px 12px;
}

.schedule-time strong,
.schedule-time small,
.row-main strong,
.row-main small,
.row-meta strong,
.row-meta small {
  display: block;
}

.schedule-time strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.schedule-time small,
.row-main small,
.row-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-line {
  align-self: stretch;
  border-radius: 99px;
  background: var(--status-color, var(--line-strong));
}

.row-main {
  min-width: 0;
}

.row-main strong,
.row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main strong {
  font-size: 13px;
}

.row-meta {
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge,
.source-badge,
.neutral-badge,
.urgency-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge {
  background: var(--status-bg, #eef1f4);
  color: var(--status-color, var(--slate));
}

.source-badge,
.neutral-badge {
  background: #eef1f4;
  color: var(--slate);
}

.urgency-badge {
  background: var(--red-soft);
  color: var(--red);
}

.reminder-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 65px;
  padding: 9px 10px;
}

.reminder-time {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.workload-list {
  display: grid;
  gap: 15px;
}

.workload-row {
  display: grid;
  gap: 7px;
}

.workload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.workload-head strong {
  font-size: 12px;
}

.workload-head span {
  color: var(--muted);
  font-size: 11px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--accent));
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.filter-chip,
.date-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.filter-chip:hover,
.date-chip:hover {
  border-color: var(--line-strong);
}

.filter-chip.is-active,
.date-chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.data-table tbody tr {
  cursor: pointer;
  transition: 120ms ease;
}

.data-table tbody tr:hover {
  background: #fffaf6;
}

.table-primary {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calendar-head {
  display: grid;
  grid-template-columns: 72px repeat(5, minmax(154px, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.calendar-head-cell {
  min-width: 0;
  padding: 12px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.calendar-head-cell:first-child {
  border-left: 0;
}

.calendar-head-cell strong,
.calendar-head-cell small {
  display: block;
}

.calendar-head-cell strong {
  font-size: 12px;
}

.calendar-head-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-grid {
  position: relative;
  display: grid;
  min-width: 842px;
  grid-template-columns: 72px repeat(5, minmax(154px, 1fr));
}

.time-column,
.master-column {
  position: relative;
  min-height: 640px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 39px,
    var(--line) 39px,
    var(--line) 40px
  );
  background-size: 100% 40px;
}

.time-column {
  border-right: 1px solid var(--line);
  background-color: var(--surface-soft);
}

.time-label {
  position: absolute;
  right: 10px;
  transform: translateY(-7px);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.master-column {
  border-right: 1px solid var(--line);
}

.master-column:last-child {
  border-right: 0;
}

.calendar-event {
  position: absolute;
  right: 5px;
  left: 5px;
  z-index: 2;
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--event-color) 30%, white);
  border-left: 4px solid var(--event-color);
  border-radius: 9px;
  background: var(--event-bg);
  color: var(--text);
  text-align: left;
  box-shadow: 0 5px 14px rgba(17, 24, 32, 0.06);
}

.calendar-event:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.calendar-event strong,
.calendar-event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong {
  font-size: 11px;
}

.calendar-event small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 9px;
}

.agenda-list {
  display: none;
}

.lead-row,
.order-row {
  grid-template-columns: 94px minmax(190px, 1.2fr) minmax(140px, 0.9fr) minmax(120px, 0.7fr) auto;
  gap: 12px;
  min-height: 72px;
  padding: 10px 12px;
}

.client-row {
  grid-template-columns: 50px minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(130px, 0.8fr) auto;
  gap: 12px;
  min-height: 74px;
  padding: 10px 12px;
}

.client-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.bar-chart {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f4;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffab6d);
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.settings-card h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.settings-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.drawer-layer,
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.drawer-layer[hidden],
.modal-layer[hidden],
.search-results[hidden] {
  display: none;
}

.drawer-scrim,
.modal-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 32, 0.38);
  backdrop-filter: blur(2px);
}

.record-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(520px, 100vw);
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(17, 24, 32, 0.18);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(32px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.drawer-head h2 {
  margin: 5px 0 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.close-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 24px;
}

.drawer-body {
  display: grid;
  gap: 15px;
  padding: 18px 20px 110px;
}

.detail-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.detail-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item span,
.detail-item strong {
  display: block;
}

.detail-item span {
  color: var(--muted);
  font-size: 10px;
}

.detail-item strong {
  margin-top: 4px;
  font-size: 12px;
}

.work-lines {
  display: grid;
  gap: 8px;
}

.work-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.work-line:last-child {
  border-bottom: 0;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 14px;
  font-size: 11px;
}

.timeline-item::before {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.timeline-copy strong,
.timeline-copy small {
  display: block;
}

.timeline-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.drawer-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  width: min(520px, 100vw);
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.drawer-actions .button {
  flex: 1;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(17, 24, 32, 0.24);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-body {
  padding: 18px 22px 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  font-size: 13px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #8cb0ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--text-soft);
  font-size: 12px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.conflict-box {
  display: none;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid #f2c990;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #7c3d07;
  font-size: 11px;
}

.conflict-box.is-visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

.toast::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.mobile-nav {
  display: none;
}

.mobile-only {
  display: none;
}

body[data-role="master"] .owner-only,
body[data-role="master"] .receiver-owner-only,
body[data-role="receiver"] .owner-only {
  display: none !important;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 218px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-row {
    grid-template-columns: 66px 5px minmax(170px, 1.2fr) minmax(120px, 0.7fr) auto;
  }

  .profile-copy {
    display: none;
  }

  .profile-button {
    padding-right: 4px;
  }
}

@media (max-width: 920px) {
  .kanban--leads {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .kanban-card-main > strong,
  .kanban-card-main > span,
  .kanban-card-main > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :root {
    --sidebar-width: 78px;
  }

  .brand {
    justify-content: center;
    padding-inline: 12px;
  }

  .brand > span:last-child,
  .nav-item > span:nth-child(2),
  .nav-count,
  .service-state > span:last-child {
    display: none;
  }

  .nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .sidebar-foot {
    justify-content: center;
    padding: 12px;
  }

  .service-state {
    display: none;
  }

  .topbar {
    padding: 0 18px;
  }

  .search-results {
    left: calc(var(--sidebar-width) + 18px);
    width: min(520px, calc(100vw - var(--sidebar-width) - 36px));
  }

  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .lead-row,
  .order-row {
    grid-template-columns: 86px minmax(170px, 1.2fr) minmax(120px, 0.8fr) auto;
  }

  .lead-row > :nth-child(4),
  .order-row > :nth-child(4) {
    display: none;
  }

  .client-row {
    grid-template-columns: 48px minmax(170px, 1.2fr) minmax(150px, 1fr) auto;
  }

  .client-row > :nth-child(4) {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 62px;
  }

  body {
    padding-bottom: 74px;
  }

  .prototype-banner {
    justify-content: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    top: var(--banner-height);
    gap: 10px;
    padding: 0 12px;
  }

  .mobile-brand {
    display: block;
  }

  .global-search {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .global-search kbd,
  .desktop-only,
  .role-switcher {
    display: none !important;
  }

  .profile-button {
    border: 0;
    background: transparent;
  }

  .search-results {
    top: calc(var(--banner-height) + 56px);
    right: 12px;
    left: 12px;
    width: auto;
  }

  .view-root {
    padding: 18px 14px 26px;
  }

  .page-head {
    align-items: flex-start;
    margin-bottom: 17px;
  }

  .page-actions .button--secondary {
    display: none;
  }

  .page-actions .button--primary {
    min-width: 44px;
    padding-inline: 13px;
  }

  .page-actions .button-label {
    display: none;
  }

  .page-title {
    font-size: 25px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 14px;
  }

  .metric-card {
    min-height: 112px;
    padding: 14px;
  }

  .metric-value {
    margin-top: 10px;
    font-size: 27px;
  }

  .metric-label {
    font-size: 10px;
  }

  .metric-icon {
    display: none;
  }

  .panel-head {
    min-height: 56px;
    padding: 12px 13px;
  }

  .panel-body {
    padding: 11px;
  }

  .schedule-row {
    grid-template-columns: 56px 5px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 72px;
    padding: 8px;
  }

  .schedule-row .row-meta {
    display: none;
  }

  .schedule-row .status-badge {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .calendar-shell {
    display: none;
  }

  .agenda-list {
    display: grid;
    gap: 8px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .filter-group {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-chip,
  .date-chip {
    flex: 0 0 auto;
  }

  .lead-row,
  .order-row,
  .client-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 74px;
    padding: 10px;
  }

  .lead-row > :first-child,
  .lead-row > :nth-child(3),
  .lead-row > :nth-child(4),
  .order-row > :first-child,
  .order-row > :nth-child(3),
  .order-row > :nth-child(4),
  .client-row > :first-child,
  .client-row > :nth-child(3),
  .client-row > :nth-child(4) {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 8px;
  }

  .data-table tbody tr {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .data-table td {
    padding: 6px 4px;
    border: 0;
  }

  .data-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .settings-grid,
  .form-grid,
  .detail-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 28px);
    transform: none;
    border-radius: 18px 18px 0 0;
  }

  .record-drawer {
    width: 100%;
  }

  .drawer-body {
    padding-inline: 14px;
  }

  .drawer-head {
    padding: 16px 14px;
  }

  .drawer-actions {
    width: 100%;
    padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    display: grid;
    height: calc(66px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 6px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -10px 30px rgba(17, 24, 32, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 2px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-nav-item > span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav-item small {
    font-size: 9px;
    font-weight: 800;
  }

  .mobile-nav-item.is-active {
    color: var(--accent-hover);
  }

  .mobile-nav-item--primary {
    width: 52px;
    height: 52px;
    min-height: 52px;
    margin: -18px auto 0;
    border: 4px solid var(--bg);
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 122, 26, 0.26);
  }

  .mobile-nav-item--primary small {
    display: none;
  }

  .mobile-only {
    display: initial;
  }

  .toast-region {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 7px;
    padding-inline: 9px;
  }

  .brand-mark--small {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .global-search {
    padding-inline: 9px;
  }

  .global-search input::placeholder {
    color: transparent;
  }

  .view-root {
    padding-inline: 11px;
  }

  .page-subtitle {
    display: none;
  }

  .metric-card {
    min-height: 106px;
  }

  .metric-note {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-row .status-badge {
    display: none;
  }

  .schedule-row {
    grid-template-columns: 50px 5px minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: minmax(96px, 0.7fr) 1fr;
  }

  .bar-row > :last-child {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.catalog-source-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.catalog-source-note > span {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.catalog-source-note strong {
  font-size: 12px;
}

.catalog-source-note small,
.needs-confirmation {
  color: #9a5708;
  font-size: 10px;
}

.modal--print {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  background: #eef1f4;
}

.print-preview-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid #f1c892;
  background: #fff6e8;
  color: #7c3d07;
  font-size: 11px;
}

.print-preview-note strong,
.print-preview-note span {
  display: block;
}

.print-sheet {
  position: relative;
  width: min(794px, calc(100% - 36px));
  min-height: 1080px;
  margin: 18px auto;
  padding: 34px 36px 28px;
  overflow: hidden;
  background: #fff;
  color: #111;
  box-shadow: 0 12px 35px rgba(17, 24, 32, 0.16);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
}

.print-watermark {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  color: rgba(185, 28, 28, 0.08);
  font-size: 104px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.print-act-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
  margin-bottom: 14px;
}

.print-act-head > div {
  display: grid;
  gap: 3px;
}

.print-act-head > div:first-child strong {
  font-size: 17px;
}

.print-act-head > div:last-child {
  justify-items: end;
  text-align: right;
}

.print-info-table,
.print-work-table {
  width: 100%;
  border-collapse: collapse;
}

.print-info-table th,
.print-info-table td,
.print-work-table th,
.print-work-table td {
  border: 1px solid #333;
  padding: 5px 6px;
  vertical-align: top;
}

.print-info-table th {
  width: 33%;
  background: #f3f3f3;
  text-align: left;
}

.print-customer-table {
  margin-top: 10px;
}

.print-customer-table th {
  width: 16%;
}

.print-customer-table td {
  width: 34%;
}

.print-inspection {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0;
  font-size: 11px;
}

.print-checkbox {
  font-size: 18px;
  line-height: 1;
}

.print-sheet h3 {
  margin: 0 0 6px;
  font-size: 12px;
}

.print-work-table th {
  background: #f3f3f3;
  text-align: left;
}

.print-work-table th:first-child,
.print-work-table td:first-child {
  width: 70px;
}

.print-work-table th:last-child,
.print-work-table td:last-child {
  width: 120px;
  text-align: right;
}

.print-work-table tbody tr {
  height: 27px;
}

.print-total,
.print-comment,
.print-consent {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.print-total strong {
  font-size: 12px;
}

.print-comment {
  min-height: 42px;
  padding: 7px;
  border: 1px solid #333;
}

.print-consent p {
  margin: 0;
}

.print-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 24px;
  font-weight: 700;
}

.print-preview-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 720px) {
  .catalog-source-note {
    grid-template-columns: 1fr;
  }

  .print-preview-note {
    display: grid;
  }

  .print-sheet {
    width: calc(100% - 20px);
    min-height: 0;
    margin: 10px;
    padding: 18px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body > * {
    display: none !important;
  }

  body > #modal-layer {
    position: static !important;
    display: block !important;
  }

  #modal-layer .modal-scrim,
  #modal-layer .modal-head,
  #modal-layer .print-preview-note,
  #modal-layer .print-preview-actions {
    display: none !important;
  }

  #modal-layer .modal--print {
    position: static !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  #modal-layer .print-sheet {
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Review fixes, 2026-08-22: clearer positioning and operational controls. */
.search-shell {
  position: relative;
  width: min(520px, 46vw);
}

.search-shell .global-search {
  width: 100%;
}

.search-shell .search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  width: 100%;
  max-width: none;
}

.kanban--scroll {
  grid-template-columns: none;
  grid-auto-columns: minmax(290px, 360px);
  grid-auto-flow: column;
  justify-content: start;
}

.date-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.archive-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.archive-search .local-search {
  max-width: 760px;
}

.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.section-tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.base-table-head.base-vehicle-grid,
.base-table-row.base-vehicle-grid {
  grid-template-columns: minmax(112px, 0.7fr) minmax(150px, 1fr) minmax(170px, 1fr) minmax(165px, 1fr) minmax(150px, 0.85fr) 32px;
}

.base-vehicle-grid > * {
  min-width: 0;
}

.base-vehicle-grid .text-link {
  justify-self: start;
  text-align: left;
}

.report-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.report-filter-bar input[type="date"] {
  min-width: 142px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-weight: 700;
}

.report-presets {
  display: flex;
  gap: 5px;
}

.report-presets button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}

.report-presets button:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.revenue-period-list {
  display: grid;
  gap: 10px;
}

.revenue-period-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(130px, 0.9fr) minmax(150px, 1.6fr) minmax(88px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  text-align: left;
}

.revenue-period-row > span strong,
.revenue-period-row > span small {
  display: block;
}

.revenue-period-row > span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.revenue-period-row > i {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.revenue-period-row > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffad70);
}

.revenue-period-row > strong {
  justify-self: end;
  white-space: nowrap;
}

.funnel-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.funnel-label i {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-style: normal;
  font-weight: 900;
}

.dormant-head,
.dormant-row {
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 1fr) minmax(135px, 0.8fr) minmax(150px, 1fr) minmax(190px, 0.9fr);
}

.dormant-actions {
  display: grid;
  gap: 6px;
}

.dormant-actions .button {
  width: 100%;
}

.profile-summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.profile-summary strong,
.profile-summary small {
  display: block;
}

.profile-summary small {
  color: var(--muted);
  font-size: 11px;
}

.additional-services {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.additional-services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.additional-services-head strong,
.additional-services-head small {
  display: block;
}

.additional-services-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

#booking-extra-services {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

#booking-extra-services:empty {
  margin-top: 0;
}

.additional-service-row {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr) 42px;
  align-items: end;
  gap: 8px;
}

.booking-timing-grid .field > input,
.booking-timing-grid .field > select,
.additional-service-row .field > select,
#lead-close-form select[name="reason"] {
  min-height: 58px;
  padding-top: 13px;
  padding-bottom: 13px;
}

.history-row--call {
  background: var(--surface-soft);
}

.history-date strong,
.history-date small {
  display: block;
}

.history-date small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.track-line.is-quarter {
  opacity: 0.28;
}

.track-line.is-hour {
  opacity: 0.9;
}

.category-editor > div > span strong,
.category-editor > div > span small {
  display: block;
}

@media (max-width: 720px) {
  .search-shell {
    min-width: 0;
    flex: 1;
    width: auto;
  }

  .search-shell .search-results {
    position: fixed;
    top: calc(var(--banner-height) + var(--topbar-height) - 2px);
    right: 12px;
    left: 12px;
    width: auto;
  }

  .archive-search,
  .additional-services-head,
  .report-date-range {
    align-items: stretch;
    flex-direction: column;
  }

  .report-date-range,
  .report-date-range label,
  .report-filter-bar input[type="date"] {
    width: 100%;
  }

  .report-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .revenue-period-row {
    grid-template-columns: 1fr auto;
  }

  .revenue-period-row > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* MVP v2: clearer workflow, resource calendar, full cards and editable settings */
.sidebar-foot {
  position: relative;
  flex-wrap: wrap;
  padding: 12px;
}

.demo-role-switcher {
  display: grid;
  width: 100%;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-role-switcher select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  background: var(--sidebar-soft);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.sidebar-foot .help-link {
  position: absolute;
  right: 12px;
  bottom: 64px;
}

.search-results > button {
  display: grid;
  width: 100%;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 9px 10px;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.search-results > button:hover {
  background: var(--surface-soft);
}

.search-results > button span:nth-child(2),
.search-results > button strong,
.search-results > button small {
  display: block;
  min-width: 0;
}

.search-results > button small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results > button i {
  font-style: normal;
}

.search-kind {
  display: inline-grid !important;
  min-height: 27px;
  place-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #9b4306;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-empty,
.empty-compact {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.panel-caption {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-grid--v2 {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  align-items: start;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.attention-list,
.lead-list,
.history-list,
.order-list {
  display: grid;
  gap: 8px;
}

.call-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.call-task-row > button:first-child {
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  background: transparent;
  text-align: left;
}

.call-results {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.call-results-title {
  font-size: 10px;
}

.call-result-row {
  display: grid;
  width: 100%;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: left;
}

.call-result-row strong,
.call-result-row small {
  display: block;
}

.call-result-row small,
.call-result-row time {
  color: var(--muted);
  font-size: 9px;
}

.call-result-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.call-result-options {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.call-result-options legend {
  margin-bottom: 9px;
  font-weight: 900;
}

.call-result-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.call-result-option:has(input:checked) {
  border-color: #8db1ff;
  background: var(--blue-soft);
}

.call-result-option strong,
.call-result-option small {
  display: block;
}

.call-result-option small {
  margin-top: 3px;
  color: var(--muted);
}

.planned-call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #b9d0ff;
  border-radius: 14px;
  background: #eef4ff;
}

.planned-call-banner strong,
.planned-call-banner small {
  display: block;
}

.planned-call-banner small {
  margin-top: 3px;
  color: var(--muted);
}

.schedule-list--aligned {
  display: grid;
  gap: 8px;
}

.schedule-row--v2 {
  grid-template-columns: 66px 5px minmax(160px, 1fr) 92px 170px;
  gap: 10px;
}

.schedule-row--v2 > * {
  min-width: 0;
}

.schedule-row--v2 .row-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.workload-panel {
  margin-top: 16px;
}

.workload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workload-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.workload-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 11px;
}

.workload-head span {
  color: var(--muted);
}

.toolbar--calendar {
  justify-content: space-between;
}

.date-navigation,
.date-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-current {
  min-width: 210px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 800;
}

.date-strip {
  margin: 16px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.date-chip {
  display: grid;
  min-width: 66px;
  min-height: 54px;
  place-items: center;
  gap: 0;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.date-chip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.date-chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.date-chip.is-active span {
  color: rgba(255, 255, 255, 0.7);
}

.compact-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compact-field select {
  height: 42px;
  min-width: 150px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.resource-calendar {
  min-width: 900px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.resource-axis,
.resource-row {
  display: grid;
  grid-template-columns: 180px minmax(720px, 1fr);
}

.resource-axis {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.resource-name-head,
.resource-master {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.resource-name-head {
  font-size: 11px;
  font-weight: 900;
}

.axis-track,
.resource-track {
  position: relative;
}

.axis-track span {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.axis-track span:first-child {
  transform: translateY(-50%);
}

.axis-track span:last-child {
  transform: translate(-100%, -50%);
}

.resource-row {
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.resource-row:last-child {
  border-bottom: 0;
}

.resource-master strong,
.resource-master small {
  display: block;
}

.resource-master strong {
  font-size: 12px;
}

.resource-master small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.master-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--master-color);
}

.resource-track {
  overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(220, 225, 230, 0.35) calc(12.5% - 1px), rgba(220, 225, 230, 0.35) 12.5%);
}

.track-line {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}

.resource-event {
  position: absolute;
  top: 10px;
  bottom: 10px;
  display: grid;
  min-width: 76px;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  padding: 9px 10px;
  border-left: 4px solid var(--event-color);
  border-radius: 10px;
  background: var(--event-bg);
  color: var(--text);
  cursor: grab;
  text-align: left;
}

.resource-event:active {
  cursor: grabbing;
}

.resource-event--resizable {
  padding-right: 20px;
}

.resource-event--resizable:active,
.resource-event.is-resizing {
  cursor: ew-resize;
}

.resource-resize-handle {
  position: absolute;
  z-index: 2;
  inset: 0 0 0 auto;
  width: 14px;
  cursor: ew-resize;
  touch-action: none;
}

.resource-resize-handle::before {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--event-color) 42%, transparent);
  content: "";
  transform: translateY(-50%);
  transition: background-color 140ms ease, width 140ms ease;
}

.resource-event:hover .resource-resize-handle::before,
.resource-event.is-resizing .resource-resize-handle::before {
  width: 4px;
  background: var(--event-color);
}

.resource-event--continuation {
  cursor: pointer;
  background-image: repeating-linear-gradient(135deg, transparent 0, transparent 9px, rgba(255, 255, 255, 0.34) 9px, rgba(255, 255, 255, 0.34) 18px);
}

.resource-event strong,
.resource-event small,
.resource-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-event strong {
  font-size: 11px;
}

.resource-event small,
.resource-event span {
  color: var(--text-soft);
  font-size: 9px;
}

.agenda-list {
  display: none;
}

.kanban {
  display: grid;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 18px;
  scrollbar-width: thin;
}

.kanban--leads {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.kanban--repairs {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.kanban-column {
  min-height: 410px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
}

.kanban-column > header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.kanban-column > header small {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
}

.kanban-dropzone {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 335px;
}

.kanban-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 5px 14px rgba(17, 24, 32, 0.045);
}

.kanban-card-main {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 14px;
  background: transparent;
  text-align: left;
}

.kanban-card-main > strong {
  margin-top: 3px;
  font-size: 13px;
}

.kanban-card-main > span:not(.kanban-card-top),
.kanban-card-main > small {
  color: var(--muted);
  font-size: 10px;
}

.kanban-card-top,
.kanban-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-card-actions {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.kanban-card-actions button {
  padding: 4px 0;
  background: transparent;
  color: var(--accent-hover);
  font-size: 10px;
  font-weight: 900;
}

.source-badge,
.record-number {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.next-action,
.repair-master,
.repair-money {
  display: block;
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.kanban-empty {
  display: grid;
  min-height: 90px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.base-toolbar,
.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.local-search {
  display: flex;
  min-width: 260px;
  flex: 1;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.local-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.section-tabs,
.settings-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0;
  overflow-x: auto;
}

.section-tab,
.settings-tab {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.section-tab.is-active,
.settings-tab.is-active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.panel-body--flush {
  padding: 0;
}

.base-table,
.staff-table,
.service-table,
.weekly-table,
.dormant-table {
  min-width: 760px;
  overflow: hidden;
}

.base-table-head,
.base-table-row,
.staff-head,
.staff-row,
.service-head,
.service-row,
.weekly-head,
.weekly-row,
.dormant-head,
.dormant-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.base-table-head,
.staff-head,
.service-head,
.weekly-head,
.dormant-head {
  min-height: 42px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.base-table-row,
.staff-row,
.service-row,
.dormant-row {
  width: 100%;
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.dormant-row > span > strong,
.dormant-row > span > small {
  display: block;
}

.dormant-row > span > small {
  margin-top: 3px;
  color: var(--muted);
}

.base-table-row:hover,
.staff-row:hover,
.service-row:hover,
.dormant-row:hover {
  background: var(--surface-soft);
}

.base-client-grid {
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(130px, 0.9fr) minmax(150px, 1fr) 32px;
}

.base-vehicle-grid {
  grid-template-columns: minmax(105px, 0.7fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, auto) 32px;
}

.staff-head,
.staff-row {
  grid-template-columns: minmax(190px, 1.5fr) minmax(100px, 0.7fr) minmax(130px, 0.9fr) minmax(120px, 0.8fr) minmax(100px, auto) 25px;
}

.service-head,
.service-row {
  grid-template-columns: minmax(190px, 1.5fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(90px, 0.6fr) 90px 25px;
}

.weekly-head,
.weekly-row {
  grid-template-columns: minmax(150px, 1fr) 100px 120px minmax(170px, 1fr);
}

.dormant-head,
.dormant-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(140px, 1fr) 110px;
}

.base-table-row strong,
.base-table-row small,
.staff-row strong,
.staff-row small,
.service-row strong,
.service-row small {
  display: block;
}

.base-table-row small,
.staff-row small,
.service-row small {
  margin-top: 2px;
  color: var(--muted);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-open,
.text-link,
.entity-link {
  background: transparent;
}

.text-link {
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 900;
}

.access-state {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.access-state.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.detail-page-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.back-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-weight: 800;
}

.detail-title h1,
.detail-title p {
  margin: 0;
}

.detail-title h1 {
  margin-top: 3px;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.detail-title p {
  margin-top: 4px;
  color: var(--muted);
}

.detail-page-grid,
.record-detail-grid,
.analytics-grid,
.settings-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.analytics-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.analytics-column {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.analytics-column .panel {
  min-width: 0;
}

.record-detail-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
}

.record-main,
.record-side {
  display: grid;
  gap: 14px;
}

.detail-card,
.settings-card,
.current-process {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.detail-card h2,
.detail-card h3,
.settings-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-card-head h2,
.detail-card-head h3 {
  margin-bottom: 14px;
}

.comment-text,
.settings-card p,
.vehicle-note p {
  margin: 0;
  color: var(--text-soft);
}

.vehicle-card-grid {
  display: grid;
  gap: 10px;
}

.vehicle-card,
.entity-link,
.selected-entity,
.vehicle-choice {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.vehicle-card:hover,
.entity-link:hover,
.vehicle-choice:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.vehicle-card strong,
.vehicle-card small,
.entity-link strong,
.entity-link small,
.selected-entity strong,
.selected-entity small,
.vehicle-choice strong,
.vehicle-choice small {
  display: block;
}

.vehicle-card small,
.entity-link small,
.selected-entity small,
.vehicle-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.vehicle-card-icon,
.profile-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.history-row {
  display: grid;
  width: 100%;
  grid-template-columns: 58px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  text-align: left;
}

.history-date {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
}

.current-process {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-color: #f1c49f;
  background: var(--surface-warm);
}

.current-process span,
.current-process strong,
.current-process small {
  display: block;
}

.current-process span,
.current-process small {
  color: var(--muted);
  font-size: 10px;
}

.record-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}

.process-path {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.process-path b {
  padding: 5px 8px;
  border-radius: 999px;
}

.process-path b.is-current {
  background: var(--text);
  color: #fff;
}

.next-action-box,
.vehicle-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.next-action-box span,
.next-action-box strong,
.vehicle-note span {
  display: block;
}

.next-action-box span,
.vehicle-note span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.work-lines,
.timeline,
.money-summary {
  display: grid;
  gap: 9px;
}

.work-line,
.money-summary > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.money-summary small,
.money-summary strong {
  display: block;
}

.money-summary small {
  color: var(--muted);
}

.money-received strong {
  color: var(--green);
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-copy strong,
.timeline-copy small {
  display: block;
}

.timeline-copy small {
  color: var(--muted);
  font-size: 9px;
}

.report-filter-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-filter-bar select {
  min-width: 135px;
  height: 40px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.report-period-label {
  margin-left: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
}

.trend-chart {
  display: flex;
  height: 220px;
  align-items: end;
  justify-content: space-around;
  gap: 10px;
  padding-top: 24px;
  border-bottom: 1px solid var(--line);
}

.trend-column {
  display: grid;
  height: 100%;
  min-width: 42px;
  flex: 1;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.trend-value {
  position: relative;
  width: min(46px, 70%);
  min-height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ff9a51, var(--accent));
}

.trend-value b {
  position: absolute;
  inset: -20px 50% auto auto;
  transform: translateX(50%);
  color: var(--text);
  font-size: 8px;
  white-space: nowrap;
}

.funnel-list,
.direction-list,
.workload-list {
  display: grid;
  gap: 11px;
}

.funnel-row,
.direction-row,
.workload-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.5fr) auto auto;
  align-items: center;
  gap: 10px;
  background: transparent;
  font-size: 10px;
  text-align: left;
}

.funnel-row {
  grid-template-columns: minmax(150px, 1fr) auto;
  min-height: 42px;
}

.funnel-row .funnel-track {
  grid-column: 1 / -1;
}

.direction-row {
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 1fr) auto 40px;
  min-height: 42px;
}

.workload-list--report .workload-row {
  grid-template-columns: 1fr;
  min-height: 42px;
  gap: 8px;
}

.analytics-column .revenue-period-row,
.analytics-column .funnel-row,
.analytics-column .direction-row,
.analytics-column .workload-row {
  font-size: 11px;
}

.funnel-track,
.direction-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.funnel-track i,
.direction-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.direction-row small {
  display: block;
  color: var(--muted);
}

.dormant-panel {
  margin-top: 16px;
  overflow-x: auto;
}

.settings-secondary-grid .settings-card {
  min-height: 210px;
}

.schedule-settings-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.schedule-settings-summary > span {
  padding: 12px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.schedule-settings-summary small,
.schedule-settings-summary strong {
  display: block;
}

.schedule-settings-summary small {
  color: var(--muted);
}

.mini-staff-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.mini-staff-row small {
  color: var(--muted);
}

.settings-item-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.settings-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.settings-item-row strong,
.settings-item-row small {
  display: block;
}

.settings-item-row small {
  margin-top: 3px;
  color: var(--muted);
}

.form-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:first-child {
  padding-top: 0;
}

.form-section-title,
.profile-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.form-section-title > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 900;
}

.form-section-title h3,
.form-section-title p {
  margin: 0;
}

.form-section-title h3 {
  font-size: 14px;
}

.form-section-title p {
  color: var(--muted);
  font-size: 10px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.booking-master-field {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.booking-master-field legend {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.master-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.master-choice {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.master-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.master-choice-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--master-color);
}

.master-choice strong,
.master-choice small {
  display: block;
  min-width: 0;
}

.master-choice small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-choice > b {
  color: var(--muted);
  font-size: 9px;
}

.master-choice.is-selected {
  border-color: #7ea6ff;
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.09);
}

.master-choice.is-busy {
  background: #fff7f7;
}

.master-choice.is-busy > b {
  color: var(--red);
}

.booking-plan-summary,
.workday-plan {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #b9d0ff;
  border-radius: 11px;
  background: #eef4ff;
  font-size: 10px;
}

.booking-plan-summary:empty {
  display: none;
}

.booking-plan-summary span,
.workday-plan span {
  color: var(--muted);
}

.workday-plan span {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.choice-results,
.vehicle-choice-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.choice-results > button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}

.choice-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.vehicle-choice.is-selected,
.selected-entity {
  border-color: #8cb0ff;
  background: var(--blue-soft);
}

.payment-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f1c49f;
  border-radius: 11px;
  background: var(--surface-warm);
}

.input-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-suffix input {
  min-width: 0;
  flex: 1;
}

.security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.permission-table {
  min-width: 660px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.permission-table > div {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(110px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.permission-table > div:first-child {
  background: var(--surface-soft);
  font-size: 10px;
}

.schedule-editor,
.category-editor {
  display: grid;
  gap: 8px;
}

.schedule-edit-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(4, minmax(100px, 0.7fr));
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.category-editor > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.category-editor small {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .dashboard-grid--v2,
  .record-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-calendar {
    overflow-x: auto;
  }
}

@media (max-width: 920px) {
  .resource-calendar {
    min-width: 0;
  }

  .resource-axis,
  .resource-row {
    grid-template-columns: 150px minmax(640px, 1fr);
    min-width: 790px;
  }

  .detail-page-grid,
  .analytics-grid,
  .analytics-columns,
  .settings-secondary-grid {
    grid-template-columns: 1fr;
  }

  .schedule-row--v2 {
    grid-template-columns: 66px 5px minmax(0, 1fr) minmax(120px, auto);
  }

  .schedule-row--v2 .row-meta {
    display: none;
  }

  .base-table,
  .staff-table,
  .service-table,
  .weekly-table {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .demo-role-switcher,
  .sidebar-foot .help-link,
  .resource-calendar {
    display: none;
  }

  .search-results > button {
    grid-template-columns: 50px minmax(0, 1fr) auto;
  }

  .master-choice-grid {
    grid-template-columns: 1fr;
  }

  .additional-service-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .additional-service-row .field {
    grid-column: 1;
  }

  .additional-service-row .icon-button {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: end;
  }

  .planned-call-banner,
  .call-task-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .planned-call-banner {
    flex-direction: column;
  }

  .prototype-copy--desktop {
    display: none;
  }

  .prototype-copy--mobile {
    display: inline;
  }

  .agenda-list {
    display: grid;
    gap: 8px;
  }

  .mobile-section-title {
    margin: 10px 0 2px;
    font-size: 15px;
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
  }

  .workload-grid,
  .schedule-settings-summary {
    grid-template-columns: 1fr 1fr;
  }

  .kanban--leads,
  .kanban--repairs {
    grid-template-columns: repeat(3, minmax(250px, 82vw));
  }

  .kanban--repairs {
    grid-template-columns: repeat(4, minmax(250px, 82vw));
  }

  .base-table,
  .staff-table,
  .service-table,
  .weekly-table,
  .dormant-table {
    min-width: 0;
  }

  .base-table-head,
  .staff-head,
  .service-head,
  .weekly-head,
  .dormant-head {
    display: none;
  }

  .base-table-row,
  .staff-row,
  .service-row,
  .weekly-row,
  .dormant-row {
    grid-template-columns: 1fr auto;
    gap: 7px;
    margin: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .base-table-row > *,
  .staff-row > *,
  .service-row > *,
  .weekly-row > *,
  .dormant-row > * {
    grid-column: 1;
  }

  .base-table-row > :last-child,
  .staff-row > :last-child,
  .service-row > :last-child,
  .dormant-row > :last-child {
    grid-column: 2;
    grid-row: 1;
  }

  .detail-page-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-page-head .page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .back-button {
    width: fit-content;
  }

  .current-process {
    grid-template-columns: 1fr auto;
  }

  .current-process .button {
    grid-column: 1 / -1;
  }

  .process-path {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .report-filter-bar label,
  .report-filter-bar select {
    min-width: calc(50% - 5px);
    flex: 1;
  }

  .report-period-label {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .trend-chart {
    height: 180px;
  }

  .direction-row {
    grid-template-columns: minmax(110px, 1fr) minmax(90px, 1fr) auto;
  }

  .direction-row > :last-child {
    display: none;
  }

  .schedule-edit-row {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-edit-row .checkbox-row {
    grid-column: 1 / -1;
  }

  .permission-table {
    min-width: 620px;
  }

  .modal-body {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .schedule-row--v2 {
    grid-template-columns: 54px 4px minmax(0, 1fr);
  }

  .schedule-row--v2 .row-actions {
    grid-column: 3;
    justify-content: flex-start;
  }

  .workload-grid,
  .schedule-settings-summary {
    grid-template-columns: 1fr;
  }

  .date-current {
    min-width: 0;
    flex: 1;
    font-size: 11px;
  }

  .toolbar--calendar,
  .base-toolbar {
    align-items: stretch;
  }

  .toolbar--calendar .compact-field,
  .toolbar--calendar select,
  .local-search {
    width: 100%;
    min-width: 0;
  }

  .history-row {
    grid-template-columns: 48px minmax(0, 1fr) 16px;
  }

  .history-row .status-badge {
    display: none;
  }

  .detail-page-head .page-actions {
    grid-template-columns: 1fr;
  }
}
