/* ═══════════════════════════════════════════════════════════════
   admin/assets/checklist-modal.css — T2.4 (2026-05-11)
   ───────────────────────────────────────────────────────────────
   Styles do modal de checklist de peças (admin/pedidos.html).
   Depende de admin-base.css (tokens) + admin-data.css (.modal base).
   ═══════════════════════════════════════════════════════════════ */

/* ─── Body do modal ──────────────────────────────────────────── */
.checklist-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--admin-text);
}

/* ─── Cabeçalho — meta do pedido ─────────────────────────────── */
.checklist-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 24px;
  padding: 12px 14px;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
}

.checklist-meta strong {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  margin-bottom: 2px;
}

.checklist-banner {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  background: var(--admin-info-soft, rgba(80, 140, 220, 0.12));
  color: var(--admin-info, #4a8fc7);
  border-left: 3px solid var(--admin-info, #4a8fc7);
}

/* ─── Accordion por jogo ─────────────────────────────────────── */
.checklist-jogo {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.checklist-jogo[open] {
  border-color: var(--admin-gold-soft, rgba(212, 160, 23, 0.3));
}

.checklist-jogo-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--admin-surface-2);
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
}

.checklist-jogo[open] > .checklist-jogo-summary {
  border-bottom-color: var(--admin-border);
}

.checklist-jogo-summary::-webkit-details-marker { display: none; }
.checklist-jogo-summary::marker { display: none; }

.checklist-jogo-summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: var(--admin-text-faint);
  transition: transform 0.18s ease;
  width: 12px;
  text-align: center;
}

.checklist-jogo[open] > .checklist-jogo-summary::before {
  transform: rotate(90deg);
}

.checklist-jogo-summary:hover {
  background: var(--admin-surface);
}

.checklist-jogo-nome {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--admin-text);
}

.checklist-jogo-count {
  font-size: 0.72rem;
  color: var(--admin-text-muted);
  letter-spacing: 0.06em;
  padding: 3px 8px;
  background: var(--admin-surface);
  border-radius: var(--r-pill);
}

.checklist-jogo-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.checklist-jogo-badge.is-warn {
  background: rgba(245, 165, 30, 0.15);
  color: #d4880a;
}

.checklist-jogo-empty {
  padding: 16px 14px;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  background: var(--admin-card);
}

.checklist-jogo-empty a {
  color: var(--admin-gold);
  text-decoration: underline;
}

/* ─── Lista de componentes ────────────────────────────────────── */
.checklist-itens {
  background: var(--admin-card);
  padding: 6px 0;
}

.checklist-item {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) 110px minmax(280px, 1fr) minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--admin-border);
  cursor: default;
  transition: background 0.12s ease;
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item:hover {
  background: var(--admin-surface);
}

.checklist-item-nome {
  font-size: 0.88rem;
  color: var(--admin-text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.checklist-grupo {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--admin-gold-soft, rgba(212, 160, 23, 0.16));
  color: var(--admin-gold, #d4a017);
  text-transform: uppercase;
}

.checklist-validado-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: rgba(245, 165, 30, 0.12);
  color: #d4880a;
  cursor: help;
}

/* ─── Qtd encontrada ─────────────────────────────────────────── */
.checklist-item-qtd {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checklist-qtd-input {
  width: 60px;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-align: center;
  background: var(--admin-surface);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease;
}

.checklist-qtd-input:focus {
  outline: none;
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 2px var(--admin-gold-soft, rgba(212, 160, 23, 0.2));
}

.checklist-qtd-input[readonly] {
  background: var(--admin-surface-2);
  color: var(--admin-text-muted);
  cursor: not-allowed;
}

.checklist-qtd-esperada {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  white-space: nowrap;
}

/* ─── Condição (radio group) ─────────────────────────────────── */
.checklist-item-cond {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.checklist-cond-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-size: 0.78rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-pill);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.checklist-cond-opt:hover { border-color: var(--admin-text-faint); }

.checklist-cond-opt input {
  /* Esconde o radio nativo sem afetar layout nem capturar mouse.
     `clip` + `width:1px` é o pattern acessível (visualmente hidden) que
     mantém o input no fluxo pra screen readers + form submission. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checklist-cond-emoji {
  font-size: 0.85rem;
  line-height: 1;
}

.checklist-cond-opt.is-active.is-ok {
  background: rgba(34, 156, 100, 0.16);
  border-color: rgba(34, 156, 100, 0.4);
  color: #1d9c64;
}

.checklist-cond-opt.is-active.is-faltando {
  background: rgba(220, 90, 90, 0.16);
  border-color: rgba(220, 90, 90, 0.4);
  color: #c54545;
}

.checklist-cond-opt.is-active.is-danificado {
  background: rgba(245, 165, 30, 0.16);
  border-color: rgba(245, 165, 30, 0.4);
  color: #d4880a;
}

.checklist-cond-opt input:disabled + .checklist-cond-emoji,
.checklist-cond-opt input:disabled ~ .checklist-cond-label {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Observação por item ────────────────────────────────────── */
.checklist-item-obs {
  display: flex;
}

.checklist-obs-input {
  width: 100%;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  background: var(--admin-surface);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease;
}

.checklist-obs-input:focus {
  outline: none;
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 2px var(--admin-gold-soft, rgba(212, 160, 23, 0.2));
}

.checklist-obs-input::placeholder {
  color: var(--admin-text-faint);
  font-style: italic;
}

.checklist-obs-input[readonly] {
  background: var(--admin-surface-2);
  color: var(--admin-text-muted);
}

/* ─── Observações gerais (textarea no final) ─────────────────── */
.checklist-obs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-obs-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
}

.checklist-obs-textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  background: var(--admin-surface);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  resize: vertical;
  transition: border-color 0.15s ease;
}

.checklist-obs-textarea:focus {
  outline: none;
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 2px var(--admin-gold-soft, rgba(212, 160, 23, 0.2));
}

.checklist-obs-textarea[readonly] {
  background: var(--admin-surface-2);
  color: var(--admin-text-muted);
}

/* ─── Botão "Tudo OK" no summary do jogo ─────────────────────── */
.btn-sm {
  padding: 4px 10px;
  font-size: 0.74rem;
  line-height: 1.3;
}

.checklist-jogo-summary .btn-sm {
  margin-left: auto;
}

/* ─── Badge "checklist com divergência" na tabela de pedidos ── */
.checklist-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-family: var(--font-ui);
  background: var(--admin-surface);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.checklist-trigger-btn:hover {
  border-color: var(--admin-gold);
  color: var(--admin-gold);
}

.checklist-trigger-btn.has-divergencia {
  background: rgba(220, 90, 90, 0.1);
  border-color: rgba(220, 90, 90, 0.35);
  color: #c54545;
}

.checklist-trigger-btn.has-ok {
  background: rgba(34, 156, 100, 0.1);
  border-color: rgba(34, 156, 100, 0.35);
  color: #1d9c64;
}

.checklist-trigger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Responsividade ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .checklist-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
  }

  .checklist-item-cond {
    justify-content: flex-start;
  }
}
