/* =====================================================================
   DJ Freios — painel-extras.css
   Estilos das novidades (aba Triagens, coluna Pronto, aba Devolvidos e janela de devolução).
   É carregado DEPOIS do style.css e não altera nenhum estilo antigo.
   ===================================================================== */

/* ===================== TRIAGENS (pré-atendimentos do site) ===================== */
.tab-count.tab-count-new { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.tab-count.tab-count-new.has-new { background: var(--c-waiting); color: #1a1405; animation: pulse 1.6s infinite; }
.tri-list { padding: 4px 28px 28px; display: flex; flex-direction: column; gap: 22px; }
.tri-list:empty::after { content: "Nenhuma triagem aguardando. Quando um cliente enviar o pré-atendimento pelo site, ele aparece aqui na hora."; display: block; text-align: center; color: var(--text-faint); font-size: 14px; padding: 40px 10px; border: 1px dashed var(--border-soft); border-radius: var(--radius-md); }
.tri-day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: 0.4px; }
.tri-day-head small { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.tri-day-head .tri-day-count { background: rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 1px 10px; font-size: 13px; }
.tri-day-head.is-today { color: var(--c-waiting); }
.tri-day-head.is-past { color: var(--c-rejected); }
.tri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tri-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-left: 3px solid var(--c-waiting); border-radius: var(--radius-md); box-shadow: var(--shadow-card); display: flex; flex-direction: column; overflow: hidden; }
.tri-card.tri-confirmada { border-left-color: var(--c-progress); }
.tri-card.tri-late { box-shadow: 0 0 0 1px rgba(255, 84, 112, 0.45), var(--shadow-card); }
.tri-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); background: rgba(255, 255, 255, 0.02); }
.tri-when { display: flex; align-items: baseline; gap: 8px; }
.tri-when b { font-family: 'Rajdhani', sans-serif; font-size: 24px; color: var(--accent); line-height: 1; }
.tri-when span { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.tri-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tri-pill { font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.tri-pill.p-nova { background: var(--c-waiting-bg); color: var(--c-waiting); }
.tri-pill.p-confirmada { background: var(--c-progress-bg); color: var(--c-progress); }
.tri-pill.p-late { background: var(--c-rejected-bg); color: var(--c-rejected); }
.tri-body { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tri-vehicle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tri-plate { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: 1.5px; background: #0b1220; border: 1px solid var(--border-soft); padding: 3px 10px; border-radius: 6px; color: #ffd54a; }
.tri-model { font-size: 15.5px; font-weight: 700; }
.tri-client { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tri-client strong { color: var(--text-main); font-weight: 600; }
.tri-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tri-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: rgba(255, 255, 255, 0.07); color: var(--text-main); }
.tri-tag.warn { background: var(--c-waiting-bg); color: var(--c-waiting); }
.tri-tag.danger { background: var(--c-rejected-bg); color: var(--c-rejected); }
.tri-defect { font-size: 13.5px; color: var(--text-main); line-height: 1.5; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 9px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tri-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.tri-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-soft); cursor: zoom-in; transition: var(--transition); }
.tri-thumb:hover { border-color: var(--accent); transform: scale(1.04); }
.tri-meta { font-size: 11.5px; color: var(--text-faint); }
.tri-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; }
.tri-actions button { font-family: inherit; font-size: 12.5px; font-weight: 600; border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; border: 1px solid var(--border-soft); background: var(--bg-panel-2); color: var(--text-main); transition: var(--transition); }
.tri-actions button:hover { border-color: var(--accent); }
.tri-actions .t-primary { background: linear-gradient(135deg, var(--accent), #3b5bdb); border-color: transparent; color: #fff; }
.tri-actions .t-whats { background: rgba(56, 217, 122, 0.14); border-color: rgba(56, 217, 122, 0.45); color: var(--c-done); }
.tri-actions .t-whats:hover { background: rgba(56, 217, 122, 0.24); }
.tri-actions .t-cancel { margin-left: auto; color: var(--danger); background: transparent; border-color: rgba(255, 84, 112, 0.35); }
.tri-actions .t-cancel:hover { background: rgba(255, 84, 112, 0.14); border-color: var(--danger); }
.tri-photo-big { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-sm); background: #000; }

/* ===================== COLUNA "PRONTO" ===================== */
.column-ready .column-header { border-top: 3px solid var(--c-done); background: var(--c-done-bg); }
.column-ready .vehicle-card { border-left: 3px solid var(--c-done); }
.column-ready .card-status-pill { background: var(--c-done-bg); color: var(--c-done); }
.btn-card-action.btn-return { background: rgba(56, 217, 122, 0.14); border-color: rgba(56, 217, 122, 0.45); width: auto; padding: 0 10px; }
.btn-card-action.btn-return:hover { background: var(--c-done); border-color: var(--c-done); color: #06210f; }

/* ===================== ABA "DEVOLVIDOS" ===================== */
#historyList:empty::after { content: "Nenhum veículo devolvido encontrado para os filtros selecionados."; }
.history-col .h-cond { font-weight: 600; white-space: normal; }
.history-col .h-cond.ok { color: var(--c-done); }
.history-col .h-cond.none { color: var(--text-faint); font-style: italic; font-weight: 400; }
.history-col .h-note { white-space: normal; font-size: 12.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }

/* ===================== JANELA "DEVOLVER VEÍCULO" ===================== */
.return-vehicle { font-size: 15px; font-weight: 600; line-height: 1.5; margin-bottom: 16px; }
.return-vehicle strong { font-family: 'Rajdhani', sans-serif; font-size: 18px; letter-spacing: 1px; color: #ffd54a; }
.return-vehicle span { font-weight: 400; font-size: 13px; color: var(--text-muted); }
.return-fieldset { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; min-width: 0; }
.return-fieldset legend { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 10px; padding: 0; }
.return-option { position: relative; display: block; cursor: pointer; }
.return-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.return-option span { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-panel-2); border: 1.5px solid var(--border-soft); border-radius: var(--radius-md); font-size: 14.5px; font-weight: 600; transition: var(--transition); }
.return-option span::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--text-faint); transition: var(--transition); }
.return-option:hover span { border-color: var(--c-done); }
.return-option input:checked + span { border-color: var(--c-done); background: var(--c-done-bg); color: var(--c-done); }
.return-option input:checked + span::before { border-color: var(--c-done); background: radial-gradient(circle, var(--c-done) 0 45%, transparent 50%); }
.return-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
#formReturn .form-error { margin-bottom: 4px; }

@media (max-width: 860px) {
  .tri-list { padding: 4px 16px 20px; }
  .tri-grid { grid-template-columns: 1fr; }
}
