/* Quickshine DASH — Native Appointments v0.7 */

.appointments-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.appointments-heading h1,
.appointment-detail-hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.appointments-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--qs-muted);
  font-size: 12px;
}

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

.appointment-stat {
  border: 1px solid var(--qs-border);
  border-radius: 16px;
  background: #fff;
  padding: 17px;
  box-shadow: var(--qs-shadow);
}

.appointment-stat span {
  color: var(--qs-muted);
  font-size: 10px;
}

.appointment-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 27px;
}

.appointment-stat small {
  display: block;
  margin-top: 9px;
  color: var(--qs-muted);
  font-size: 8px;
  line-height: 1.45;
}

.appointment-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 170px 150px auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid var(--qs-border);
  padding: 14px 16px;
}

.appointment-toolbar input,
.appointment-toolbar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--qs-border);
  border-radius: 9px;
  background: #fff;
  padding: 0 10px;
  outline: 0;
  font-size: 9px;
}

.appointment-list {
  display: grid;
}

.appointment-row {
  display: grid;
  grid-template-columns: 96px minmax(180px, 1fr) minmax(160px, .9fr) 130px 130px 36px;
  gap: 13px;
  align-items: center;
  border-bottom: 1px solid var(--qs-border);
  padding: 14px 16px;
  cursor: pointer;
}

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

.appointment-row:hover {
  background: var(--qs-primary-soft);
}

.appointment-row__time {
  display: flex;
  flex-direction: column;
}

.appointment-row__time strong {
  font-size: 10px;
}

.appointment-row__time span,
.appointment-row__customer span,
.appointment-row__vehicle span {
  margin-top: 4px;
  color: var(--qs-muted);
  font-size: 7px;
}

.appointment-row__customer,
.appointment-row__vehicle {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.appointment-row__customer strong,
.appointment-row__vehicle strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-row__arrow {
  color: var(--qs-primary);
  font-size: 16px;
  font-weight: 800;
}

.appointment-pill {
  display: inline-flex;
  width: max-content;
  min-height: 23px;
  align-items: center;
  border-radius: 999px;
  background: #edf2f5;
  padding: 0 8px;
  color: #596875;
  font-size: 7px;
  font-weight: 750;
}

.appointment-pill--confirmed,
.appointment-pill--complete,
.appointment-pill--ready {
  background: var(--qs-success-soft);
  color: var(--qs-success);
}

.appointment-pill--in-progress {
  background: #e9f0ff;
  color: #4168b0;
}

.appointment-pill--scheduled,
.appointment-pill--ordered {
  background: var(--qs-warning-soft);
  color: var(--qs-warning);
}

.appointment-pill--cancelled,
.appointment-pill--needs-action {
  background: var(--qs-danger-soft);
  color: var(--qs-danger);
}

.appointment-empty {
  padding: 60px 20px;
  text-align: center;
}

.appointment-empty strong {
  display: block;
  font-size: 14px;
}

.appointment-empty p {
  margin: 7px 0 0;
  color: var(--qs-muted);
  font-size: 9px;
}

.appointment-form-page {
  max-width: 1120px;
}

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

.appointment-form-panel {
  padding: 19px;
}

.appointment-form-section + .appointment-form-section {
  margin-top: 22px;
  border-top: 1px solid var(--qs-border);
  padding-top: 19px;
}

.appointment-form-section h2 {
  margin: 0 0 13px;
  font-size: 14px;
}

.appointment-form-section p {
  margin: -6px 0 14px;
  color: var(--qs-muted);
  font-size: 8px;
}

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

.appointment-summary-card {
  position: sticky;
  top: 94px;
}

.appointment-summary-list {
  display: grid;
}

.appointment-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  border-bottom: 1px solid var(--qs-border);
  padding: 12px 15px;
}

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

.appointment-summary-row span {
  color: var(--qs-muted);
  font-size: 8px;
}

.appointment-summary-row strong {
  max-width: 165px;
  font-size: 8px;
  text-align: right;
}

.appointment-detail-tools {
  display: flex;
  margin-bottom: 12px;
}

.appointment-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--qs-border);
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--qs-shadow);
}

.appointment-detail-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.appointment-date-block {
  display: grid;
  width: 62px;
  min-width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 15px;
  background: var(--qs-primary);
  color: #fff;
  text-align: center;
}

.appointment-date-block strong {
  font-size: 20px;
  line-height: 1;
}

.appointment-date-block span {
  margin-top: -5px;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.appointment-detail-identity p {
  margin: 7px 0 0;
  color: var(--qs-muted);
  font-size: 9px;
}

.appointment-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.appointment-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .7fr);
  gap: 17px;
  margin-top: 17px;
  align-items: start;
}

.appointment-detail-main,
.appointment-detail-sidebar {
  display: grid;
  gap: 17px;
}

.appointment-detail-list {
  display: grid;
}

.appointment-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--qs-border);
  padding: 12px 16px;
}

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

.appointment-detail-row span {
  color: var(--qs-muted);
  font-size: 8px;
}

.appointment-detail-row strong {
  max-width: 65%;
  font-size: 8px;
  text-align: right;
}

.appointment-prep-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 15px;
}

.prep-card {
  border: 1px solid var(--qs-border);
  border-radius: 11px;
  background: var(--qs-soft);
  padding: 12px;
}

.prep-card span {
  display: block;
  color: var(--qs-muted);
  font-size: 7px;
}

.prep-card strong {
  display: block;
  margin-top: 6px;
  font-size: 10px;
}

.appointment-notes {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--qs-border);
  border-radius: 10px;
  padding: 11px;
  resize: vertical;
  outline: 0;
  font-size: 9px;
}

.appointment-danger-zone {
  border-color: #efcccc;
}

.appointment-danger-zone .panel__header {
  background: #fffafa;
}

@media (max-width: 1180px) {
  .appointment-toolbar {
    grid-template-columns: minmax(200px, 1fr) repeat(2, 150px);
  }

  .appointment-toolbar > :nth-child(4),
  .appointment-toolbar > :nth-child(5) {
    grid-row: 2;
  }

  .appointment-row {
    grid-template-columns: 90px minmax(170px, 1fr) minmax(140px, .8fr) 120px 34px;
  }

  .appointment-row__filter {
    display: none;
  }
}

@media (max-width: 900px) {
  .appointment-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .appointment-form-layout,
  .appointment-detail-grid {
    grid-template-columns: 1fr;
  }

  .appointment-summary-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .appointments-heading,
  .appointment-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .appointment-stats {
    grid-template-columns: 1fr;
  }

  .appointment-toolbar {
    grid-template-columns: 1fr;
  }

  .appointment-toolbar > * {
    grid-row: auto !important;
  }

  .appointment-row {
    grid-template-columns: 75px minmax(0, 1fr) 28px;
  }

  .appointment-row__vehicle,
  .appointment-row__status,
  .appointment-row__filter {
    display: none;
  }

  .appointment-detail-actions {
    justify-content: flex-start;
  }

  .appointment-prep-grid {
    grid-template-columns: 1fr;
  }
}
