/* ===== COMPONENTS — Precision Orchestrator ===== */

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--body-md);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary — yellow, for critical actions only */
.btn--primary {
  background: var(--primary-container);
  color: var(--on-primary);
  box-shadow: 0 4px 16px rgba(255, 221, 0, 0.1);
}

.btn--primary:hover {
  filter: brightness(1.08);
}

/* Secondary — surface-highest background */
.btn--secondary {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

.btn--secondary:hover {
  background: var(--surface-bright);
}

/* Tertiary — text only */
.btn--tertiary {
  background: transparent;
  color: var(--on-surface-variant);
  padding: var(--space-sm);
}

.btn--tertiary:hover {
  color: var(--on-surface);
}

/* Icon button */
.btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--on-surface-variant);
  opacity: 0.7;
}

.btn--icon:hover {
  background: var(--surface-container-highest);
  color: var(--primary-container);
  opacity: 1;
}

/* Button sizes */
.btn--sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--body-sm);
}

.btn--lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--body-lg);
}

.btn--full {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--body-md);
}


/* ===== CARDS ===== */
/* No borders. Separation through surface color shifts and whitespace. */
.card {
  background: var(--surface-container);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: background var(--transition-base);
}

.card:hover {
  background: var(--surface-container-high);
}

.card--low {
  background: var(--surface-container-low);
}

.card--low:hover {
  background: var(--surface-container);
}

.card--flat {
  background: var(--surface-container-low);
}

.card--flat:hover {
  background: var(--surface-container-low);
}

.card--interactive {
  cursor: pointer;
}

/* Metric Card */
.metric-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
}

.metric-card__label {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.7;
  margin-bottom: var(--space-sm);
}

.metric-card__value {
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--on-surface);
  letter-spacing: -0.02em;
}

.metric-card__trend {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  font-size: var(--body-sm);
}

.metric-card__trend--up {
  color: #4ade80;
}

.metric-card__trend--down {
  color: var(--error);
}


/* ===== INPUTS ===== */
/* No bottom line. Surface-container bg, sm radius. */
.input {
  width: 100%;
  background: var(--surface-container);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--body-md);
  color: var(--on-surface);
  transition: box-shadow var(--transition-fast);
}

.input::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.input:focus {
  box-shadow: 0 0 0 1px rgba(255, 226, 81, 0.4);
}

.input--search {
  padding-left: 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group__label {
  font-size: var(--label-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}

/* Select */
.select {
  width: 100%;
  background: var(--surface-container);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--body-md);
  color: var(--on-surface);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5L6 8L9 5' stroke='%23cfc6ab' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}

.select:focus {
  box-shadow: 0 0 0 1px rgba(255, 226, 81, 0.4);
}


/* ===== CHIPS & BADGES ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.125rem var(--space-sm);
  border-radius: var(--radius-md);
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chip--confirmed {
  background: rgba(255, 221, 0, 0.1);
  color: var(--primary-fixed-dim);
}

.chip--pending {
  background: rgba(255, 219, 120, 0.1);
  color: var(--tertiary-container);
}

.chip--cancelled {
  background: rgba(255, 180, 171, 0.1);
  color: var(--error);
}

.chip--completed {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

/* Status dot */
.chip__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.chip__dot--pulse {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-xs);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--primary-container);
  color: var(--on-primary);
}

/* Insight Chip (special component) */
.insight-chip {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(255, 219, 120, 0.05);
  padding: var(--space-md);
  border-radius: var(--radius-xl);
}

.insight-chip__icon {
  background: var(--tertiary-container);
  color: var(--on-tertiary);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.insight-chip__text {
  font-size: var(--body-sm);
  color: var(--on-surface-variant);
  opacity: 0.7;
}

.insight-chip__highlight {
  color: var(--primary-container);
  font-weight: 700;
}


/* ===== TABLES ===== */
/* No divider lines. Hover state uses surface-variant. */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-spacing: 0;
}

.table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--label-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.table td {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--body-md);
  vertical-align: middle;
}

.table tbody tr {
  background: var(--surface-container);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.table tbody tr:nth-child(even) {
  background: var(--surface-container-low);
}

.table tbody tr:hover {
  background: var(--surface-variant);
}

.table--rounded tbody tr:first-child td:first-child {
  border-radius: var(--radius-xl) 0 0 0;
}
.table--rounded tbody tr:first-child td:last-child {
  border-radius: 0 var(--radius-xl) 0 0;
}
.table--rounded tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-xl);
}
.table--rounded tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-xl) 0;
}

/* Sortable header */
.table__sort {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.table__sort:hover {
  color: var(--on-surface);
  opacity: 1;
}

.table__sort-icon {
  font-size: 1rem;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.table__sort--active .table__sort-icon {
  opacity: 1;
  color: var(--primary-container);
}


/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: var(--space-xs);
}

.tabs__tab {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--body-md);
  font-weight: 500;
  color: var(--on-surface-variant);
  opacity: 0.6;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.tabs__tab:hover {
  color: var(--on-surface);
  opacity: 1;
}

.tabs__tab--active {
  background: var(--surface-container-highest);
  color: var(--primary-container);
  font-weight: 700;
  opacity: 1;
}


/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  font-size: var(--body-sm);
  font-weight: 600;
  color: var(--on-surface-variant);
  transition: all var(--transition-fast);
}

.pagination__btn:hover {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

.pagination__btn--active {
  background: var(--primary-container);
  color: var(--on-primary);
}

.pagination__btn:disabled {
  opacity: 0.3;
  cursor: default;
}


/* ===== BOOKING CARD (List Item) ===== */
.booking-item {
  background: var(--surface-container);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: background var(--transition-base);
  cursor: pointer;
}

.booking-item:hover {
  background: var(--surface-container-high);
}

.booking-item__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-low);
  width: 4rem;
  height: 5rem;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.booking-item__date-month {
  font-size: var(--body-sm);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--on-surface-variant);
  opacity: 0.7;
  font-weight: 700;
}

.booking-item__date-day {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--on-surface);
}

.booking-item__date--accent {
  border-left: 4px solid var(--primary-container);
}

.booking-item__details {
  flex: 1;
  min-width: 0;
}

.booking-item__title {
  font-size: var(--title-md);
  font-weight: 700;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.booking-item__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--body-sm);
  color: var(--on-surface-variant);
  opacity: 0.7;
}

.booking-item__meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.booking-item__meta-item .material-symbols-outlined {
  font-size: 1rem;
}

.booking-item__price {
  color: var(--on-surface);
  font-weight: 600;
}

.booking-item__staff {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  flex-shrink: 0;
}

.booking-item__staff-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.booking-item__staff-label {
  font-size: var(--label-sm);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.5;
  font-weight: 700;
}

.booking-item__staff-name {
  font-size: var(--body-md);
  font-weight: 600;
  color: var(--on-surface);
}

.booking-item__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .booking-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .booking-item__staff {
    padding: 0;
  }
}


/* ===== SLIDE-OVER MODAL ===== */
.slide-over {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: 30rem;
  max-width: 100vw;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-elevated);
  transform: translateX(100%);
  transition: transform var(--transition-slide);
  overflow-y: auto;
}

.slide-over--open {
  transform: translateX(0);
}

.slide-over__backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.slide-over__backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.slide-over__content {
  padding: var(--space-xl);
}

.slide-over__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2xl);
}

.slide-over__close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  background: var(--surface-container-highest);
  border-radius: var(--radius-lg);
  color: var(--on-surface);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.slide-over__close:hover {
  background: var(--surface-bright);
}


/* ===== TIMELINE ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline__item {
  position: relative;
  padding-left: var(--space-lg);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(76, 71, 50, 0.2);
}

.timeline__dot {
  position: absolute;
  left: -3px;
  top: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary-container);
}

.timeline__dot--muted {
  background: var(--surface-container-highest);
}

.timeline__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-container);
  margin-bottom: var(--space-xs);
}

.timeline__label--muted {
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.timeline__text {
  font-size: var(--body-sm);
  color: var(--on-surface);
  opacity: 0.8;
  line-height: 1.6;
}

.timeline__text--muted {
  opacity: 0.5;
  font-style: italic;
}


/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  font-size: 3rem;
  color: var(--on-surface-variant);
  opacity: 0.3;
  margin-bottom: var(--space-md);
}

.empty-state__title {
  font-size: var(--headline-sm);
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: var(--body-md);
  color: var(--on-surface-variant);
  opacity: 0.6;
  max-width: 24rem;
}


/* ===== LOADING ===== */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--surface-container-highest);
  border-top-color: var(--primary-container);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}


/* ===== TOAST / NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-container-highest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  font-size: var(--body-md);
  transform: translateY(120%);
  transition: transform var(--transition-slide);
}

.toast--visible {
  transform: translateY(0);
}

.toast--success {
  color: #4ade80;
}

.toast--error {
  color: var(--error);
}
