/**
 * Unya 2.0 — Booking Grid
 *
 * 15-min timeline (X) × Technicians (Y) with stacked staff load row.
 */

.unya-booking-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background:
      radial-gradient(circle at 0% 0%,
          color-mix(in oklch, var(--unya-accent-soft, rgba(56,189,248,0.18)) 32%, transparent) 0,
          transparent 48%),
      color-mix(in oklch, var(--unya-bg-panel, #020617) 94%, black 6%);
  border: 1px solid color-mix(in oklch, var(--unya-border, #1e293b) 88%, transparent);
  box-shadow:
      0 24px 55px rgba(0, 0, 0, 0.75),
      0 0 0 1px color-mix(in oklch, var(--unya-border, #1e293b) 70%, transparent 30%);
}

.unya-booking-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--unya-text-strong, #e5e7eb);
  margin: 0 0 4px;
}

.unya-booking-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--unya-text-muted, #9ca3af);
}

/* Toolbar */
.unya-booking-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in oklch, var(--unya-bg-muted, #020617) 90%, transparent);
  border: 1px solid color-mix(in oklch, var(--unya-border, #1e293b) 90%, transparent);
}

.unya-booking-toolbar-left,
.unya-booking-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unya-btn-link {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--unya-text-muted, #9ca3af);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.unya-btn-link:hover {
  background: color-mix(in oklch, var(--unya-accent-soft, rgba(56,189,248,0.16)) 70%, transparent);
  color: var(--unya-text, #e5e7eb);
  transform: translateY(-0.5px);
}

/* Grid shell */
.unya-booking-grid {
  margin-top: 4px;
  border-radius: 16px;
  border: 1px solid color-mix(in oklch, var(--unya-border, #1e293b) 90%, transparent);
  background: radial-gradient(circle at 50% 0%,
              color-mix(in oklch, var(--unya-accent-soft, rgba(96,165,250,0.24)) 40%, transparent) 0,
              transparent 55%),
              color-mix(in oklch, var(--unya-bg-panel, #020617) 96%, black 4%);
  overflow: hidden;
}

.unya-booking-grid-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px 12px;
}

/* Header timeline */
.unya-booking-grid-header {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 6px;
}

.unya-booking-grid-header-label {
  flex: 0 0 180px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--unya-text-soft, #9ca3af);
}

.unya-booking-grid-header-track {
  display: flex;
  align-items: flex-end;
  gap: 0;
  position: relative;
  min-height: 20px;
}

.unya-booking-slot-label {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
  border-left: 1px solid rgba(148, 163, 184, 0.25);
}

.unya-booking-slot-label:last-child {
  border-right: 1px solid rgba(148, 163, 184, 0.25);
}

.unya-booking-slot-label-text {
  font-size: 0.7rem;
  color: var(--unya-text-soft, #9ca3af);
}

.unya-booking-slot-label-dot {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.6);
}

/* Volume row */
.unya-booking-grid-volume-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.unya-booking-grid-volume-label {
  flex: 0 0 180px;
  font-size: 0.7rem;
  color: var(--unya-text-soft, #9ca3af);
}

.unya-booking-grid-volume-track {
  display: flex;
  align-items: flex-end;
  gap: 0;
  position: relative;
  height: 32px;
}

.unya-booking-volume-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.unya-booking-volume-bar:last-child {
  border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.unya-booking-volume-bar-inner {
  width: 60%;
  height: var(--unya-volume-height, 0%);
  border-radius: 999px 999px 0 0;
  background: linear-gradient(
      180deg,
      color-mix(in oklch, var(--unya-brand-1, #38bdf8) 70%, var(--unya-brand-2, #6366f1) 30%) 0%,
      color-mix(in oklch, var(--unya-brand-1, #38bdf8) 25%, black 75%) 100%
  );
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
}

/* Staff rows */
.unya-booking-grid-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unya-booking-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.unya-booking-row-label {
  flex: 0 0 180px;
  padding: 6px 8px;
  border-radius: 10px;
  background: color-mix(in oklch, var(--unya-bg-muted, #020617) 90%, transparent);
  border: 1px solid rgba(30, 64, 175, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.unya-booking-staff-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--unya-text, #e5e7eb);
}

.unya-booking-staff-role {
  font-size: 0.7rem;
  color: var(--unya-text-soft, #9ca3af);
}

.unya-booking-row-track {
  position: relative;
  flex: 1 0 auto;
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(30, 64, 175, 0.45);
  background:
      repeating-linear-gradient(
          to right,
          rgba(30, 64, 175, 0.45) 0,
          rgba(30, 64, 175, 0.45) 1px,
          transparent 1px,
          transparent var(--unya-slot-width, 80px)
      ),
      radial-gradient(circle at 50% 0%,
          color-mix(in oklch, var(--unya-accent-soft, rgba(56,189,248,0.18)) 35%, transparent) 0,
          transparent 55%),
      color-mix(in oklch, #020617 96%, black 4%);
  overflow: hidden;
}

/* Booking blocks */
.unya-booking-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 8px;
  padding: 4px 6px;
  background: linear-gradient(
      135deg,
      color-mix(in oklch, var(--unya-booking-color, #38bdf8) 65%, #22c55e 35%),
      color-mix(in oklch, var(--unya-booking-color, #38bdf8) 40%, #0f172a 60%)
  );
  border: 1px solid rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow:
      0 10px 22px rgba(0, 0, 0, 0.75),
      0 0 0 1px rgba(15, 23, 42, 0.85);
  cursor: pointer;
  overflow: hidden;
}

.unya-booking-block[data-status="pending"] {
  opacity: 0.85;
  background: linear-gradient(
      135deg,
      color-mix(in oklch, #facc15 80%, #f97316 20%),
      color-mix(in oklch, #facc15 30%, #0f172a 70%)
  );
}

.unya-booking-block[data-status="in_progress"] {
  box-shadow:
      0 0 0 1px rgba(56, 189, 248, 0.9),
      0 10px 24px rgba(15, 23, 42, 0.9);
}

.unya-booking-block-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.unya-booking-block-title {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unya-booking-block-meta {
  font-size: 0.7rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsiveness */
@media (max-width: 800px) {
  .unya-booking-shell {
    padding: 14px;
  }

  .unya-booking-row-label {
    flex-basis: 140px;
  }

  .unya-booking-grid-header-label,
  .unya-booking-grid-volume-label {
    flex-basis: 140px;
  }
}

@media (max-width: 600px) {
  .unya-booking-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .unya-booking-toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }
}
