.admin-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---- Login ---- */
.login-screen {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-card);
}

.login-card h1 {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.login-card button {
  width: 100%;
  margin-top: 12px;
}

/* ---- Header ---- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 { margin: 0; color: var(--ink); }

/* ---- Stats ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--red);
  font-family: var(--font-display);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Filter ---- */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-row select {
  width: auto;
  margin-bottom: 0;
}

.filter-row label {
  margin-bottom: 0;
  white-space: nowrap;
}

/* ---- Orders list ---- */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.order-info { flex: 1; min-width: 220px; }

/* No telemovel o cartao empilha.
   Em ecra estreito os 220px minimos do bloco do nome nao cabiam ao lado da
   foto, e o nome transbordava por cima do botao de pagar. */
@media (max-width: 560px) {
  .order-card {
    align-items: flex-start;
    gap: 12px;
  }

  .order-link {
    flex: 1 1 100%;
    align-items: flex-start;
    gap: 12px;
  }

  .order-info { min-width: 0; }

  .order-thumb {
    width: 64px;
    height: 64px;
  }

  /* Preco e botao lado a lado, a ocupar a largura toda por baixo. */
  .order-action {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  .order-amount { margin-bottom: 0; }

  .order-action .btn-primary,
  .order-action .btn-secondary {
    white-space: nowrap;
  }
}

.order-info .name { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.order-info .meta { font-size: 12px; color: var(--text-muted); }

.order-financials {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.order-financials .label { color: var(--text-muted); font-size: 11px; }

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  /* Sem "capitalize": em portugues dava "Aguarda Pagamento Do Envio", com
     as preposicoes em maiuscula. O texto ja vem escrito como deve ser. */
  white-space: nowrap;
}

.status-pending_payment { background: var(--gold-light); color: var(--gold-deep); }
.status-purchasing { background: #e0edff; color: #1d4ed8; }
.status-at_warehouse { background: #f1e7fd; color: #7c3aed; }
.status-awaiting_shipping_payment { background: #fdecd2; color: #b45309; }
.status-shipping_paid { background: #e0edff; color: #1d4ed8; }
.status-shipped { background: #e0f6e9; color: #16a34a; }
.status-delivered { background: #daf3e4; color: #15803d; }
.status-cancelled { background: var(--red-light); color: var(--red-deep); }
.status-abandoned { background: #f3f0ec; color: #79706a; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(42, 29, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px -12px rgba(42, 29, 20, 0.35);
}

.modal-content h2 { margin-top: 0; }

/* ---------- Fotos de inspeção no painel ---------- */
.qc-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin: 14px 0;
  max-height: 280px;
  overflow-y: auto;
}

.qc-admin-item { position: relative; }

.qc-admin-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* O botão de remover fica por cima da própria miniatura. */
.qc-admin-item button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
