/* Buttons */
.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .2px;
  transition: background .15s, opacity .15s, transform .05s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Ensure <a class="btn"> looks like a button */
a.btn { text-decoration: none; }
a.btn:visited { color: #fff; }

.btn:hover {
  background: var(--primary-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: #fff;
  color: var(--primary);
  border-color: rgba(15,23,42,.22);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: rgba(15,23,42,.12);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 2px 0 rgba(15,23,42,.02);
}

.card.compact {
  padding: 12px;
}

/* Alerts */
.alert {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.alert.success {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  color: #166534;
}

.alert.error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.25);
  color: #991b1b;
}

/* Pilot banner (copy-only; no logic) */
.banner {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(2,132,199,.08);
}

.banner strong { font-weight: 700; }

/* Status UI */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(15,23,42,.03);
  font-size: 13px;
  font-weight: 650;
}

.timeline {
  margin: 10px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  font-size: 13px;
}

.step.done {
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.22);
}

.step.active {
  background: rgba(2,132,199,.10);
  border-color: rgba(2,132,199,.22);
}

.step.todo {
  background: rgba(15,23,42,.02);
}

.next-action {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.10);
  font-size: 14px;
}

/* Debug JSON (kept for pilot troubleshooting; hidden by default) */
details.debug {
  margin-top: 10px;
}

details.debug > summary {
  cursor: pointer;
  color: rgba(15,23,42,.72);
  font-size: 13px;
}

/* JSON viewer */
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.08);
}

/* Utility spacing */
.mt-2 { margin-top: 10px; }
.mb-2 { margin-bottom: 10px; }

/* Tables (admin dashboard) */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table thead th {
  font-weight: 600;
  color: rgba(15,23,42,.72);
}

/* Issue report output */
#senderIssueOut, #driverIssueOut { min-height: 80px; white-space: pre-wrap; }

/* Sender/Driver gating (pilot convenience) */
.locked .requires-sender { display: none; }
.locked .requires-driver { display: none; }

#senderAuthControls, #driverAuthControls { margin-top: 10px; }

.hidden { display: none; }

/* Auth-gated dashboards */
.locked #senderDashboard, .locked #driverDashboard { display: none; }

/* ✅ IMPORTANT: keep auth area visible even when unlocked (so Logout is always available) */
.unlocked #senderAuthArea, .unlocked #driverAuthArea { display: block; }

/* Inline action result (sender/driver) */
.result { margin-top: 10px; }
.result .alert { margin: 0; }
.details-hint { margin-top: 8px; }
