:root {
  --phixd-red: #b91c1c;
  --ink: #111827;
  --line: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

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

.touch-card {
  min-height: 148px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.touch-card:active {
  transform: scale(0.98);
}

.fade-enter {
  animation: fadeUp 260ms ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #030712;
  color: #f9fafb;
}

.call-overlay.hidden {
  display: none;
}

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

.call-stage {
  position: relative;
  min-height: 100vh;
  background: #020617;
  overflow: hidden;
}

.video-container {
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #111827;
  object-fit: cover;
}

.video-pip {
  position: absolute;
  left: 1rem;
  bottom: 5.75rem;
  width: 180px;
  aspect-ratio: 16 / 10;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: #111827;
  object-fit: cover;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100vh;
  padding: 1rem;
  background: #111827;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.chat-messages {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-message {
  max-width: 86%;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #374151;
  color: #f9fafb;
}

.chat-message.self {
  align-self: flex-end;
  background: #b91c1c;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}

.chat-input,
.diagnostic-form input[type="text"],
.diagnostic-form input[type="number"],
.diagnostic-form textarea {
  width: 100%;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  padding: 0.65rem 0.75rem;
}

.chat-send,
.approve-btn,
.call-control-btn {
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-weight: 800;
  background: #b91c1c;
  color: #ffffff;
}

.call-controls {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: min(92%, 760px);
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.86);
  backdrop-filter: blur(12px);
}

.call-control-btn {
  background: #374151;
}

.call-control-btn.active {
  background: #b91c1c;
}

.call-control-btn.danger {
  background: #991b1b;
}

.pulse-ring {
  width: 5rem;
  height: 5rem;
  border-radius: 999px;
  border: 4px solid rgba(248, 113, 113, 0.8);
  animation: pulseRing 1.4s ease-out infinite;
}

@keyframes pulseRing {
  0% {
    opacity: 1;
    transform: scale(0.72);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.diagnostic-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 48vh;
  overflow-y: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.diagnostic-form label {
  display: block;
  color: #d1d5db;
  font-weight: 700;
}

.diagnostic-form input[type="checkbox"],
.diagnostic-form input[type="radio"] {
  margin-right: 0.45rem;
}

.status-pill {
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-booked {
  background: #fee2e2;
  color: #991b1b;
}

.status-deposited,
.status-in_progress {
  background: #fef3c7;
  color: #92400e;
}

.status-quality_check {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-ready,
.status-complete {
  background: #dcfce7;
  color: #166534;
}

.status-cancelled {
  background: #e5e7eb;
  color: #374151;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.admin-tab.active {
  background: #b91c1c;
  color: #ffffff;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  left: calc(-50% + 1.2rem);
  right: calc(50% + 1.2rem);
  height: 3px;
  background: #d1d5db;
}

.timeline-step:first-child::before {
  display: none;
}

.timeline-step.done::before {
  background: #16a34a;
}

@media (max-width: 720px) {
  .timeline-step::before {
    left: 1.05rem;
    right: auto;
    top: -1rem;
    width: 3px;
    height: 1.4rem;
  }

  .call-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 42vh;
  }

  .call-stage {
    min-height: 58vh;
  }

  .chat-panel {
    height: 42vh;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .video-pip {
    width: 132px;
    bottom: 5rem;
  }

  .diagnostic-form {
    max-height: 18vh;
  }
}
