/* Área do cliente — Meus agendamentos, aplicação do Organon UI Foundations v0.1. */
.customer-appointments-organon-page {
  background: var(--org-sys-color-surface);
  color: var(--org-sys-color-on-surface);
  min-height: 100vh;
}

.customer-appointments-organon-page svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.customer-topbar {
  align-items: center;
  background: color-mix(in srgb, var(--org-sys-color-surface) 94%, transparent);
  border-bottom: 1px solid var(--org-sys-color-outline-variant);
  display: grid;
  gap: var(--org-sys-space-6);
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 5rem;
  padding: var(--org-sys-space-3) max(var(--org-sys-space-6), calc((100vw - var(--org-sys-content-max)) / 2));
  position: sticky;
  top: 0;
  z-index: 30;
}

.customer-brand {
  align-items: center;
  color: var(--org-sys-color-on-surface);
  display: inline-flex;
  gap: var(--org-sys-space-3);
  justify-self: start;
  min-height: var(--org-sys-target-min);
  text-decoration: none;
}

.customer-brand-mark {
  align-items: center;
  background: var(--org-sys-color-primary);
  border-radius: var(--org-sys-shape-medium);
  color: var(--org-sys-color-on-primary);
  display: inline-flex;
  flex: 0 0 2.55rem;
  font-size: 1.4rem;
  font-weight: 750;
  height: 2.55rem;
  justify-content: center;
  letter-spacing: -0.05em;
  width: 2.55rem;
}

.customer-brand-copy {
  display: grid;
}

.customer-brand-copy strong {
  color: var(--org-ref-color-teal-900);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.customer-brand-copy small {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-label-small-size);
  line-height: var(--org-sys-type-label-small-line);
}

.customer-desktop-nav {
  align-items: center;
  display: flex;
  gap: var(--org-sys-space-1);
}

.customer-desktop-nav a {
  align-items: center;
  border-radius: var(--org-sys-shape-full);
  color: var(--org-sys-color-on-surface-variant);
  display: inline-flex;
  font-size: var(--org-sys-type-label-large-size);
  font-weight: var(--org-sys-type-label-large-weight);
  gap: var(--org-sys-space-2);
  min-height: 2.75rem;
  padding: var(--org-sys-space-2) var(--org-sys-space-4);
  text-decoration: none;
}

.customer-desktop-nav a:hover {
  background: color-mix(in srgb, var(--org-sys-color-primary) 8%, transparent);
  color: var(--org-sys-color-on-surface);
}

.customer-desktop-nav a[aria-current='page'] {
  background: var(--org-sys-color-primary-container);
  color: var(--org-sys-color-on-primary-container);
}

.customer-desktop-nav svg,
.customer-logout-button svg,
.customer-bottom-navigation svg,
.customer-refresh-button svg {
  height: 1.25rem;
  width: 1.25rem;
}

.customer-logout-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--org-sys-color-outline-variant);
  border-radius: var(--org-sys-shape-full);
  color: var(--org-sys-color-on-surface-variant);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--org-sys-type-label-large-size);
  font-weight: var(--org-sys-type-label-large-weight);
  gap: var(--org-sys-space-2);
  justify-content: center;
  padding: var(--org-sys-space-2) var(--org-sys-space-4);
}

.customer-logout-button:hover {
  background: var(--org-sys-color-surface-container-high);
  color: var(--org-sys-color-on-surface);
}

.customer-page-shell {
  display: grid;
  gap: var(--org-sys-space-8);
  margin: 0 auto;
  max-width: 74rem;
  padding: var(--org-sys-space-10) var(--org-sys-space-8) var(--org-sys-space-16);
}

.customer-page-heading {
  max-width: 52rem;
}

.customer-kicker,
.customer-section-label,
.customer-appointment-group-label {
  color: var(--org-sys-color-primary);
  font-size: var(--org-sys-type-label-small-size);
  font-weight: var(--org-sys-type-label-small-weight);
  letter-spacing: 0.07em;
  line-height: var(--org-sys-type-label-small-line);
  margin: 0 0 var(--org-sys-space-1);
  text-transform: uppercase;
}

.customer-page-heading h1 {
  color: var(--org-ref-color-teal-900);
  font-size: clamp(2.2rem, 5vw, var(--org-sys-type-display-large-size));
  font-weight: var(--org-sys-type-display-large-weight);
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin-bottom: var(--org-sys-space-2);
}

.customer-page-heading > p:last-child {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-body-large-size);
  margin-bottom: 0;
}

.customer-filter-card {
  align-items: end;
  border: 1px solid transparent;
  box-shadow: none;
  display: grid;
  gap: var(--org-sys-space-8);
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
  padding: var(--org-sys-space-6);
}

.customer-filter-copy {
  max-width: 40rem;
}

.customer-filter-copy h2,
.customer-list-heading h2,
.customer-appointment-group-title {
  color: var(--org-ref-color-teal-900);
  font-size: var(--org-sys-type-headline-small-size);
  font-weight: var(--org-sys-type-headline-small-weight);
  line-height: var(--org-sys-type-headline-small-line);
  margin-bottom: var(--org-sys-space-2);
}

.customer-filter-copy > p:last-child {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-body-medium-size);
  margin-bottom: 0;
}

.customer-filter-actions {
  align-items: end;
  display: flex;
  gap: var(--org-sys-space-3);
}

.customer-status-filter {
  min-width: 13.5rem;
}

.customer-status-filter .org-field-control {
  min-height: 2.75rem;
}

.customer-refresh-button {
  white-space: nowrap;
}

.customer-refresh-button svg {
  transition: transform var(--org-sys-motion-duration-medium) var(--org-sys-motion-easing-standard);
}

.customer-refresh-button:hover svg {
  transform: rotate(45deg);
}

.customer-appointments-section {
  display: grid;
  gap: var(--org-sys-space-6);
}

.customer-list-heading {
  align-items: end;
  display: flex;
  gap: var(--org-sys-space-6);
  justify-content: space-between;
}

.customer-list-heading h2 {
  margin-bottom: 0;
}

.customer-appointment-count {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-label-large-size);
  font-weight: var(--org-sys-type-label-large-weight);
  margin: 0;
}

.customer-appointment-list,
.customer-appointment-group,
.customer-appointment-group-items {
  display: grid;
}

.customer-appointment-list {
  gap: var(--org-sys-space-8);
}

.customer-appointment-group {
  gap: var(--org-sys-space-4);
}

.customer-appointment-group-header {
  align-items: center;
  display: flex;
  gap: var(--org-sys-space-4);
  justify-content: space-between;
}

.customer-appointment-group-title {
  font-size: var(--org-sys-type-title-medium-size);
  line-height: var(--org-sys-type-title-medium-line);
  margin: 0;
}

.customer-appointment-group-count {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-label-small-size);
  font-weight: var(--org-sys-type-label-small-weight);
  margin: 0;
}

.customer-appointment-group-items {
  gap: var(--org-sys-space-4);
}

.customer-appointment-card {
  border-color: var(--org-sys-color-outline-variant);
  box-shadow: none;
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: var(--org-sys-space-6);
}

.customer-appointment-card:hover {
  border-color: color-mix(in srgb, var(--org-sys-color-primary) 38%, var(--org-sys-color-outline-variant));
}

.customer-appointment-header {
  align-items: center;
  display: grid;
  gap: var(--org-sys-space-4);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.customer-business-avatar {
  align-items: center;
  background: var(--org-sys-color-primary-container);
  border: 1px solid var(--org-sys-color-outline-variant);
  border-radius: var(--org-sys-shape-full);
  display: inline-flex;
  height: 3.75rem;
  justify-content: center;
  min-height: 3.75rem;
  overflow: hidden;
  text-decoration: none;
  width: 3.75rem;
}

.customer-business-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.customer-business-avatar-fallback {
  color: var(--org-sys-color-on-primary-container);
  font-size: var(--org-sys-type-title-medium-size);
  font-weight: var(--org-sys-type-title-medium-weight);
  letter-spacing: 0.02em;
}

.customer-appointment-identity {
  min-width: 0;
}

.customer-appointment-business-name {
  color: var(--org-sys-color-primary);
  display: inline-block;
  font-size: var(--org-sys-type-label-large-size);
  font-weight: var(--org-sys-type-label-large-weight);
  margin-bottom: var(--org-sys-space-1);
  overflow-wrap: anywhere;
  text-decoration-thickness: 0.08em;
}

.customer-appointment-identity h3 {
  color: var(--org-ref-color-teal-900);
  font-size: var(--org-sys-type-title-medium-size);
  font-weight: var(--org-sys-type-title-medium-weight);
  line-height: var(--org-sys-type-title-medium-line);
  margin: 0;
}

.appointment-status {
  align-items: center;
  display: inline-flex;
  gap: var(--org-sys-space-2);
  justify-self: end;
}

.appointment-status::before {
  background: currentColor;
  border-radius: var(--org-sys-shape-full);
  content: '';
  height: 0.4rem;
  width: 0.4rem;
}

.appointment-status-neutral {
  background: var(--org-sys-color-info-container);
  color: var(--org-sys-color-info);
}

.customer-appointment-details {
  background: var(--org-sys-color-surface-container-low);
  border-radius: var(--org-sys-shape-medium);
  display: grid;
  gap: var(--org-sys-space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: var(--org-sys-space-4);
}

.customer-appointment-detail {
  display: grid;
  gap: var(--org-sys-space-1);
  min-width: 0;
}

.customer-appointment-detail-label {
  color: var(--org-sys-color-on-surface-variant);
  font-size: var(--org-sys-type-label-small-size);
  font-weight: var(--org-sys-type-label-small-weight);
}

.customer-appointment-detail-value {
  color: var(--org-sys-color-on-surface);
  font-size: var(--org-sys-type-body-medium-size);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.customer-appointment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--org-sys-space-2);
  justify-content: flex-end;
}

.customer-empty-state,
.customer-loading-state {
  align-items: center;
  background: var(--org-sys-color-surface-container-low);
  border: 1px solid var(--org-sys-color-outline-variant);
  border-radius: var(--org-sys-shape-large);
  display: grid;
  justify-items: center;
  min-height: 12rem;
  padding: var(--org-sys-space-8);
  text-align: center;
}

.customer-empty-state-mark {
  align-items: center;
  background: var(--org-sys-color-primary-container);
  border-radius: var(--org-sys-shape-full);
  color: var(--org-sys-color-on-primary-container);
  display: inline-flex;
  height: 3.5rem;
  justify-content: center;
  margin-bottom: var(--org-sys-space-4);
  width: 3.5rem;
}

.customer-empty-state-mark svg {
  height: 1.65rem;
  width: 1.65rem;
}

.customer-empty-state h3 {
  color: var(--org-ref-color-teal-900);
  font-size: var(--org-sys-type-title-medium-size);
  margin-bottom: var(--org-sys-space-2);
}

.customer-empty-state p,
.customer-loading-state p {
  color: var(--org-sys-color-on-surface-variant);
  margin-bottom: 0;
  max-width: 34rem;
}

.customer-loading-spinner {
  animation: customer-spin 800ms linear infinite;
  border: 3px solid var(--org-sys-color-outline-variant);
  border-radius: var(--org-sys-shape-full);
  border-top-color: var(--org-sys-color-primary);
  height: 2rem;
  margin-bottom: var(--org-sys-space-4);
  width: 2rem;
}

.customer-bottom-navigation {
  display: none;
}

@keyframes customer-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 839px) {
  .customer-topbar {
    gap: var(--org-sys-space-3);
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: var(--org-sys-space-6);
  }

  .customer-desktop-nav {
    display: none;
  }

  .customer-page-shell {
    padding-inline: var(--org-sys-space-6);
  }
}

@media (max-width: 599px) {
  .customer-topbar {
    min-height: 4.5rem;
    padding: var(--org-sys-space-2) var(--org-sys-space-4);
  }

  .customer-brand-copy small,
  .customer-logout-button span {
    display: none;
  }

  .customer-logout-button {
    border: 0;
    height: var(--org-sys-target-mobile);
    padding: 0;
    width: var(--org-sys-target-mobile);
  }

  .customer-page-shell {
    gap: var(--org-sys-space-6);
    padding: var(--org-sys-space-8) var(--org-sys-space-4) calc(var(--org-sys-bottom-nav-height) + var(--org-sys-space-10));
  }

  .customer-page-heading h1 {
    font-size: 2.15rem;
  }

  .customer-filter-card {
    align-items: stretch;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .customer-filter-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .customer-status-filter {
    min-width: 0;
  }

  .customer-refresh-button span {
    display: none;
  }

  .customer-refresh-button {
    align-self: end;
    height: 2.75rem;
    padding-inline: var(--org-sys-space-3);
    width: 2.75rem;
  }

  .customer-list-heading {
    align-items: start;
  }

  .customer-appointment-header {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .appointment-status {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: calc(3.75rem + var(--org-sys-space-4));
  }

  .customer-appointment-card {
    padding: 1.25rem;
  }

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

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

  .customer-appointment-actions .org-button {
    width: 100%;
  }

  .customer-bottom-navigation {
    align-items: stretch;
    background: color-mix(in srgb, var(--org-sys-color-surface-container-low) 96%, transparent);
    border-top: 1px solid var(--org-sys-color-outline-variant);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    left: 0;
    min-height: var(--org-sys-bottom-nav-height);
    padding: var(--org-sys-space-1) var(--org-sys-space-3) max(var(--org-sys-space-1), env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 35;
  }

  .customer-bottom-navigation a {
    align-items: center;
    border-radius: var(--org-sys-shape-large);
    color: var(--org-sys-color-on-surface-variant);
    display: flex;
    flex-direction: column;
    font-size: var(--org-sys-type-label-small-size);
    font-weight: var(--org-sys-type-label-small-weight);
    gap: var(--org-sys-space-1);
    justify-content: center;
    min-height: 3.75rem;
    text-decoration: none;
  }

  .customer-bottom-navigation a[aria-current='page'] {
    color: var(--org-sys-color-on-primary-container);
  }

  .customer-bottom-navigation a[aria-current='page'] svg {
    background: var(--org-sys-color-primary-container);
    border-radius: var(--org-sys-shape-full);
    box-sizing: content-box;
    padding: 0.25rem 1rem;
  }

  .toast {
    bottom: calc(var(--org-sys-bottom-nav-height) + var(--org-sys-space-4));
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-refresh-button svg,
  .customer-loading-spinner {
    animation: none;
    transition: none;
  }

  .customer-refresh-button:hover svg {
    transform: none;
  }
}
