:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #65717a;
  --line: #d7dee3;
  --panel: #ffffff;
  --page: #f4f6f7;
  --green: #277a5b;
  --green-soft: #dff0e8;
  --blue: #276d9c;
  --blue-soft: #e4eef8;
  --amber: #a06516;
  --amber-soft: #f5e8d4;
  --red: #b33a3a;
  --red-soft: #f3dfdf;
  --shadow: 0 14px 36px rgba(31, 42, 50, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.home-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(180deg, rgba(244, 246, 247, 0.92), rgba(244, 246, 247, 1)),
    linear-gradient(90deg, rgba(39, 122, 91, 0.12), rgba(39, 109, 156, 0.1));
}

.home-nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.home-brand {
  color: var(--ink);
}

.home-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  gap: 22px;
  align-items: start;
}

.home-copy {
  min-height: 560px;
  display: grid;
  align-content: center;
  gap: 22px;
  padding-right: 20px;
}

.home-copy h1 {
  max-width: 760px;
  font-size: clamp(2rem, 4.8vw, 4.35rem);
  line-height: 1.02;
}

.home-lede {
  max-width: 670px;
  margin: 0;
  color: #4d5d67;
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  line-height: 1.55;
}

.home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.home-actions span {
  color: var(--muted);
  font-size: 0.9rem;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(620px, 100%);
}

.home-stats div,
.preview-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  display: grid;
  gap: 3px;
}

.home-stats strong,
.preview-metrics strong {
  font-size: 1.6rem;
}

.home-stats span,
.preview-metrics span {
  color: var(--muted);
  font-size: 0.86rem;
}

.login-panel,
.home-preview {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  position: sticky;
  top: 24px;
}

.login-heading {
  padding: 18px 18px 4px;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 14px 18px 18px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.88rem;
}

.login-form input,
.login-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.login-submit {
  width: 100%;
  min-height: 44px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.88rem;
}

.customer-portal {
  min-height: 100vh;
  --customer-primary: #2f855a;
  --customer-accent: #2b6cb0;
  --customer-bg: #f4f6f7;
  background: var(--customer-bg);
}

.customer-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 3px solid var(--customer-primary);
  background: #fff;
}

.customer-portal .brand-subline,
.customer-portal .eyebrow {
  color: var(--customer-accent);
}

.customer-portal .primary-button {
  background: var(--customer-primary);
}

.customer-portal .ghost-button:hover {
  border-color: var(--customer-accent);
  color: var(--customer-accent);
}

.customer-main {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.customer-login-panel,
.customer-card,
.customer-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.customer-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 24px;
  align-items: start;
  padding: 26px;
  border-top: 5px solid var(--customer-primary);
}

.customer-card,
.customer-summary {
  border-top: 4px solid var(--customer-accent);
}

.customer-login-panel h1,
.customer-summary h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
}

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

.customer-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.customer-contact-summary {
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 750;
}

.customer-mileage-card {
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--customer-accent) 8%, #fff);
}

.customer-mileage-card span {
  color: var(--muted);
  font-weight: 800;
}

.customer-mileage-card strong {
  font-size: 2rem;
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.customer-card {
  padding: 18px;
}

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

.customer-appointment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.customer-appointment-form .wide {
  grid-column: 1 / -1;
}

.guest-service-field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.guest-service-field legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.guest-service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guest-service-option {
  min-height: 96px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.guest-service-option:has(input:checked) {
  border-color: var(--customer-primary);
  background: color-mix(in srgb, var(--customer-primary) 6%, #fff);
}

.guest-service-option input {
  width: 20px;
  min-height: 20px;
  margin: 2px 0 0;
}

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

.guest-service-option strong {
  color: var(--ink);
  line-height: 1.2;
}

.guest-service-option small {
  margin-top: 5px;
  color: var(--muted);
}

.guest-service-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: 10px;
  align-items: end;
}

.customer-duration-summary {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.customer-appointment-form .admin-actions-row.wide {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.customer-appointment-form input,
.customer-appointment-form select,
.customer-appointment-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.customer-appointment-form textarea {
  padding-top: 10px;
  resize: vertical;
}

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

.customer-list-item,
.customer-empty {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--customer-primary) 6%, #fff);
}

.dealer-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dealer-color-grid input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
}

.customer-list-item span,
.customer-list-item small,
.customer-empty {
  color: var(--muted);
}

.customer-list-item .ghost-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
}

.embed-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.embed-box span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.88rem;
}

.embed-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  color: var(--ink);
  background: #f7fbfb;
}

.home-preview {
  grid-column: 1 / -1;
  overflow: hidden;
}

.preview-top {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-top span {
  color: var(--muted);
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 70px repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.preview-grid > * {
  min-height: 54px;
  display: grid;
  align-items: center;
  padding: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-job {
  color: var(--ink);
  border-left: 4px solid var(--blue);
  font-weight: 750;
}

.preview-job.express {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.preview-job.mechanical {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.preview-job.body {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #101820;
  color: #f7fbfb;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

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

.brand-subline {
  color: inherit;
  font-weight: 800;
  line-height: 1.05;
}

.brand small {
  color: #aebbc3;
  margin-top: 2px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  padding: 0;
}

.dealer-logo-preview {
  min-height: 92px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faf9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--muted);
  font-weight: 750;
}

.dealer-logo-preview img {
  max-width: 220px;
  max-height: 68px;
  object-fit: contain;
}

.panel,
.metric-card,
.grid-panel,
.capacity-card,
.waitlist-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar .panel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  font-weight: 750;
}

.dealership-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 12px;
}

.store-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 2px;
}

.store-button strong,
.store-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-button span {
  color: #b6c1c8;
  font-size: 0.84rem;
}

.store-button.active {
  background: #f7fbfb;
  color: var(--ink);
}

.store-button.active span {
  color: var(--muted);
}

.coverage-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  color: #d9e2e6;
  font-size: 0.9rem;
}

.coverage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coverage-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #f7fbfb;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
}

.admin-stack {
  display: grid;
  gap: 10px;
  padding: 0 12px 14px;
}

.admin-stack label {
  display: grid;
  gap: 6px;
  color: #d9e2e6;
  font-size: 0.82rem;
  font-weight: 750;
}

.admin-stack input,
.admin-stack select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 9px;
}

.admin-stack select option {
  color: var(--ink);
}

.admin-stack hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 4px 0;
}

.admin-actions,
.admin-split,
.admin-resource-form,
.admin-user-form {
  display: grid;
  gap: 8px;
}

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

.admin-actions .ghost-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.82rem;
}

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

.admin-subhead {
  display: block;
  margin-bottom: 8px;
  color: #f7fbfb;
  font-size: 0.88rem;
}

.admin-list {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-list-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #f7fbfb;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-list-item small,
.admin-empty,
.empty-sidebar {
  color: #b6c1c8;
  font-size: 0.78rem;
}

.admin-list-item .link-button {
  color: #f0c4c4;
}

.admin-resource-form {
  grid-template-columns: minmax(0, 1fr) 98px 38px;
}

.admin-user-form {
  grid-template-columns: 1fr;
}

.admin-user-form .ghost-button {
  min-height: 36px;
}

.user-row small {
  line-height: 1.35;
}

.empty-sidebar {
  padding: 0 12px 14px;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
}

h2 {
  font-size: 1.28rem;
}

.topbar-actions,
.date-control,
.toolbar,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.group-switcher select {
  min-height: 38px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.link-button,
.icon-button,
.segment {
  border-radius: 6px;
  border: 1px solid var(--line);
  min-height: 38px;
  background: #fff;
  color: var(--ink);
}

.primary-button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  padding: 0 14px;
  font-weight: 750;
}

.ghost-button,
.danger-button {
  padding: 0 13px;
}

.active-control {
  border-color: #172026;
  background: #172026;
  color: #fff;
}

.danger-button {
  color: var(--red);
  border-color: #e5b8b8;
}

.link-button {
  border: 0;
  min-height: auto;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 750;
}

.icon-button {
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-weight: 850;
}

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

.metric-card {
  padding: 14px;
  min-height: 112px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 2rem;
}

.metric-card.alert {
  border-color: #e6c9a4;
  background: #fffaf2;
}

.scheduler {
  display: grid;
  gap: 12px;
}

.admin-workspace {
  display: grid;
  gap: 12px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}

.admin-page {
  display: grid;
  gap: 12px;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-workspace .admin-page-grid.serviceops-time-past {
  display: grid !important;
}

.admin-page-grid.wide {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

#adminTeamPage .admin-page-grid.wide {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
}

.admin-page-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-workspace label.serviceops-time-past,
.admin-workspace button.serviceops-time-past,
.admin-workspace li.serviceops-time-past,
.admin-workspace div.serviceops-time-past {
  display: revert !important;
}

.admin-workspace .admin-page-panel.serviceops-time-past {
  display: grid !important;
}

.admin-page-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.88rem;
}

.admin-page-panel input,
.admin-page-panel select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.compact-heading {
  padding: 0;
}

.hours-list,
.detail-panel,
.chip-row {
  display: grid;
  gap: 8px;
}

.hours-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(92px, 1fr) minmax(92px, 1fr);
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.hours-row label {
  margin: 0;
  min-width: 0;
}

.hours-row span {
  font-size: 0.78rem;
}

.hours-row input[type="time"],
.hours-row input[type="date"],
.inline-form input {
  width: 100%;
  min-width: 0;
}

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

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

.store-hours .check-row,
.tech-hours .check-row {
  grid-column: 1 / -1;
}

.store-hours input[type="time"],
.tech-hours input[type="time"] {
  padding: 0 8px;
  font-size: 0.95rem;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
}

.admin-page .check-row input {
  width: 18px;
  min-height: 18px;
}

.inline-form {
  display: grid;
  gap: 8px;
}

.admin-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-form.three {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

#adminTeamPage .inline-form.three {
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto;
}

.detail-row {
  align-items: start;
}

.detail-row .detail-panel {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.time-off-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #6d4b14;
  font-size: 0.8rem;
}

.time-off-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  cursor: pointer;
}

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

.admin-page-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.admin-page-row.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.admin-page-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-page-row small {
  color: var(--muted);
}

.user-select-button {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}

.check-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.check-list .check-row {
  color: var(--ink) !important;
  font-size: 0.86rem;
}

.compact-check-list {
  gap: 4px;
  padding: 8px;
}

.access-check-row {
  cursor: pointer;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 6px;
}

.access-check-row:hover {
  background: #eef4f1;
}

.access-check-row input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px !important;
  height: 22px;
  min-height: 22px;
  cursor: pointer;
  accent-color: var(--green);
}

.access-check-row span {
  cursor: pointer;
  line-height: 1.25;
}

.select-all-row {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 2px;
  padding-bottom: 10px;
  font-weight: 800;
}

.toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.date-control input,
.search-box input {
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #f8fafb;
}

.segment {
  border: 0;
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
}

.segment.active {
  background: #172026;
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.grid-panel {
  overflow: auto;
  box-shadow: var(--shadow);
}

.schedule-grid {
  min-width: 860px;
  display: grid;
  grid-template-columns: 86px repeat(var(--resource-count), minmax(162px, 1fr));
}

.schedule-empty-state {
  width: 100%;
  padding: 16px 18px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.grid-cell {
  min-height: 66px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.grid-cell.appointment-cell {
  display: grid;
}

.grid-cell.header,
.grid-cell.time {
  position: sticky;
  z-index: 2;
  background: #f8fafb;
}

.grid-cell.header {
  top: 0;
  min-height: 70px;
  padding: 12px;
  font-weight: 800;
}

.grid-cell.header small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

.grid-cell.corner {
  left: 0;
  z-index: 4;
}

.grid-cell.time {
  left: 0;
  z-index: 3;
  display: grid;
  place-items: start center;
  padding-top: 12px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.86rem;
}

.slot {
  width: 100%;
  min-height: 66px;
  height: 100%;
  border: 0;
  background: #fff;
  padding: 6px;
  text-align: left;
}

.slot:hover,
.slot:focus-visible {
  outline: 2px solid #94bfdc;
  outline-offset: -2px;
}

.appointment {
  min-height: 54px;
  height: 100%;
  border-radius: 6px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 3px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  color: #193348;
}

.appointment.mechanical {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.appointment.express {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.appointment.body {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.appointment.priority {
  box-shadow: inset 0 0 0 2px rgba(179, 58, 58, 0.34);
}

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

.appointment strong {
  font-size: 0.9rem;
}

.appointment span,
.appointment small {
  font-size: 0.78rem;
}

.day-panel {
  display: grid;
  gap: 12px;
}

.capacity-bars,
.waitlist {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.capacity-row {
  display: grid;
  gap: 6px;
}

.capacity-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.bar-track {
  height: 10px;
  border-radius: 99px;
  background: #e8edf0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--fill);
  background: var(--green);
}

.bar-fill.warn {
  background: var(--amber);
}

.bar-fill.full {
  background: var(--red);
}

.waitlist-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: #fff;
}

.waitlist-item strong,
.waitlist-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waitlist-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.appointment-dialog {
  width: min(1080px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.appointment-dialog::backdrop {
  background: rgba(16, 24, 32, 0.45);
}

.appointment-dialog form {
  padding: 18px;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.86rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.form-grid textarea {
  resize: vertical;
}

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

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
  color: var(--ink) !important;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.dialog-actions {
  margin-top: 16px;
  justify-content: end;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

@media (max-width: 1040px) {
  .home-main {
    grid-template-columns: 1fr;
  }

  .home-copy {
    min-height: auto;
    padding-right: 0;
  }

  .login-panel {
    position: static;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .dealership-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .coverage-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-layout,
  .admin-page-grid,
  .admin-page-grid.wide,
  .metrics,
  .customer-login-panel,
  .customer-grid {
    grid-template-columns: 1fr;
  }

  .hours-row,
  .inline-form.three {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .home-nav {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .home-main {
    width: calc(100% - 28px);
    padding: 28px 0;
  }

  .home-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-stats,
  .preview-metrics {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 58px repeat(2, minmax(116px, 1fr));
    overflow-x: auto;
  }

  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar,
  .topbar-actions,
  .admin-page-header,
  .toolbar,
  .date-control,
  .search-box {
    align-items: stretch;
    flex-direction: column;
  }

  .dealership-list,
  .coverage-list,
  .day-panel,
  .form-grid,
  .customer-appointment-form,
  .guest-service-list,
  .guest-service-details {
    grid-template-columns: 1fr;
  }

  .customer-header,
  .customer-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segment {
    flex: 1 0 auto;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
