/* Account, tracking & admin */
.portal-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.portal-layout.wide {
  max-width: 1100px;
}

.portal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.portal-card h1,
.portal-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}

.portal-card .lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.auth-tab.active {
  background: rgba(232, 67, 147, 0.12);
  border-color: rgba(232, 67, 147, 0.4);
  color: var(--text);
}

.auth-pane {
  display: none;
}

.auth-pane.active {
  display: block;
}

.checkout-mode {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.mode-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}

.mode-option:has(input:checked) {
  border-color: rgba(232, 67, 147, 0.55);
  background: rgba(232, 67, 147, 0.06);
}

.mode-option input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.mode-option strong {
  display: block;
  margin-bottom: 0.15rem;
}

.mode-option span {
  font-size: 0.85rem;
  color: var(--muted);
}

.account-fields {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.account-fields.hidden {
  display: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-badge.pending_payment {
  background: rgba(255, 193, 7, 0.15);
  color: #ffd666;
}

.status-badge.paid,
.status-badge.processing {
  background: rgba(93, 211, 158, 0.12);
  color: var(--success);
}

.status-badge.dispatched {
  background: rgba(155, 89, 182, 0.18);
  color: #d4a8f0;
}

.status-badge.delivered {
  background: rgba(93, 211, 158, 0.2);
  color: #8ef0c4;
}

.status-badge.cancelled {
  background: rgba(255, 120, 120, 0.12);
  color: #ff9f9f;
}

.order-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--surface);
  transition: border-color 0.15s;
}

.order-card:hover {
  border-color: rgba(232, 67, 147, 0.35);
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.order-card h3 {
  margin: 0;
  font-size: 1rem;
}

.order-card .meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.order-card .ref {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 1.25rem 2rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
}

.timeline li.done .timeline-dot {
  border-color: var(--success);
  background: var(--success);
}

.timeline li.current .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline li.pending .timeline-dot {
  border-color: var(--border);
  background: var(--surface);
}

.timeline strong {
  display: block;
  font-size: 0.92rem;
}

.timeline span {
  font-size: 0.82rem;
  color: var(--muted);
}

.tracking-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(155, 89, 182, 0.1);
  border: 1px solid rgba(155, 89, 182, 0.25);
}

.tracking-box a {
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state .btn {
  margin-top: 1rem;
}

/* Admin */
.admin-shell {
  padding: 1.5rem 0 3rem;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.admin-top h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.admin-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.stat-pill.active {
  border-color: rgba(232, 67, 147, 0.45);
  color: var(--text);
}

.stat-pill strong {
  color: var(--text);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  align-items: start;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tr {
  cursor: pointer;
}

.admin-table tr:hover td,
.admin-table tr.selected td {
  background: rgba(232, 67, 147, 0.06);
}

.admin-table tr.selected td {
  border-bottom-color: rgba(232, 67, 147, 0.2);
}

.admin-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.admin-detail h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.admin-detail .detail-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-detail label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.65rem 0 0.3rem;
}

.admin-artwork {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin: 0.5rem 0;
}

.track-mini {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.track-mini li {
  padding: 0.2rem 0;
}

.admin-login {
  max-width: 400px;
  margin: 4rem auto;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

@media (max-width: 960px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail {
    position: static;
  }
}
