/* sv-cliente-extras.css
 * Estilos que faltavam em area-cliente.html:
 *   1) Cards de Veículos Monitorados (Radar)  — antes vinham do styles.css (não carregado aqui)
 *   2) Histórico em cards (mesmo estilo do despachante)
 *
 * Usa as variáveis já definidas em area-cliente-light.css e adiciona aliases
 * para as variáveis esperadas pelas classes copiadas (--bg-card, --text, etc).
 */

:root {
  --bg-card: #ffffff;
  --text: var(--text-main, #1f2933);
  --text-secondary: #374151;
  --radius: 12px;
  --radius-sm: 8px;
  --info: #2563eb;
  --primary-dark: var(--primary-strong, #256d42);
}

/* ============================================================
 * RADAR — Vehicle monitor cards
 * ============================================================ */

.monit-vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  transition: border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  max-width: 640px;
}
.monit-vehicle-card:hover { border-color: rgba(34, 197, 94, 0.4); }
.monit-vehicle-card.paused { opacity: 0.55; filter: saturate(0.5); }
.monit-vehicle-card.paused .vc-hero { background: #64748b !important; }

.vc-hero {
  position: relative;
  background: var(--primary);
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  z-index: 1;
}
.vc-hero-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}
.vc-hero-info { flex: 1; min-width: 0; }
.vc-hero-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vc-hero-plate {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.vc-hero-status {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.vc-hero-status .pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.vc-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
.vc-gauge {
  background: var(--bg-card);
  padding: 12px 8px;
  text-align: center;
  position: relative;
}
.vc-gauge:hover { background: rgba(34,197,94,0.03); }
.vc-gauge-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  background: var(--bg);
  color: var(--text-secondary);
}
.vc-gauge-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}
.vc-gauge-label {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.vc-gauge.has-alert::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.vc-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 14px 6px;
}
.vc-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.vc-tag i { font-size: 0.58rem; color: var(--text-muted); }
.vc-tag.notif-off { color: var(--text-muted); }

.vc-cta-bar { padding: 0 14px 10px; }
.vc-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}
.vc-cta-btn:hover { background: var(--text-secondary); }
.vc-cta-btn i { font-size: 0.85rem; }
.vc-cta-btn .vc-cta-count {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  margin-left: 4px;
}

.vc-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
}
.vc-scan-area { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.vc-last-check {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vc-last-check i { flex-shrink: 0; font-size: 0.6rem; }
.vc-scan-progress { display: flex; flex-direction: column; gap: 2px; }
.vc-scan-track {
  height: 3px; background: var(--border); border-radius: 2px;
  overflow: hidden; width: 100%; max-width: 140px;
}
.vc-scan-bar { height: 100%; border-radius: 2px; background: var(--primary); transition: width 0.6s ease; }
.vc-scan-label {
  font-size: 0.55rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px; font-weight: 500;
}
.vc-scan-label i { font-size: 0.5rem; color: var(--text-muted); }

.vc-actions { display: flex; gap: 4px; }
.vc-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.vc-action-btn:hover { background: var(--bg); color: var(--text-secondary); border-color: var(--text-muted); }
.vc-action-btn.btn-play:hover  { color: var(--primary); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.04); }
.vc-action-btn.btn-pause:hover { color: var(--accent); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.04); }
.vc-action-btn.btn-delete:hover{ color: var(--danger); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.04); }

.monit-empty-state, .monit-loading-state, .monit-login-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.monit-empty-state i, .monit-loading-state i { font-size: 2.2rem; color: var(--border); margin-bottom: 12px; display: block; }
.monit-empty-state h4, .monit-login-state h4 { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 8px; font-family: var(--font-d); }
.monit-empty-state p, .monit-login-state p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.monit-login-state .monit-login-icon-ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(47,138,83,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 1.4rem;
}
.monit-login-btn {
  background: var(--primary); color: #fff;
  border: 0; padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.monit-login-btn:hover { background: var(--primary-dark); }

.monit-toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600;
  z-index: 10000;
  transform: translateY(20px); opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.monit-toast.show { transform: translateY(0); opacity: 1; }
.monit-toast-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.monit-toast-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ============================================================
 * HISTÓRICO em cards (mesmo estilo do despachante)
 * ============================================================ */

.hist-list { display: flex; flex-direction: column; gap: 10px; }

.hist-row {
  display: grid;
  grid-template-columns: 76px 1fr 130px 150px 90px;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.hist-row:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(47,138,83,0.10), 0 0 0 1px rgba(47,138,83,0.18);
}

.hist-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font: 800 22px var(--font-d);
  color: #fff;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #16a34a 0%, #0d9488 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 2px 6px rgba(17,24,39,0.10);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.hist-thumb i { font-size: 28px; color: rgba(255,255,255,0.92); }
.hist-thumb.is-vicon {
  width: auto; height: auto;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
}
.hist-thumb.is-vicon .sv-vicon { --vi-size: 56px; }

.hist-meta { min-width: 0; }
.hist-meta .top {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.hist-meta .marca {
  font: 600 13px var(--font-b);
  color: var(--text-main, #1f2933);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-meta .sub {
  font: 500 12px var(--font-b);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-meta .date-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px var(--font-b);
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
}
.hist-meta .date-pill i { font-size: 9px; }

.hist-col {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.hist-col label {
  font: 700 9px var(--font-b);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hist-col .v {
  font: 600 13px var(--font-data);
  color: var(--text-main, #1f2933);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-col.status .v { font-family: var(--font-b); font-weight: 700; }
.hist-col.status .v.ok { color: var(--primary); }
.hist-col.status .v.warn { color: var(--warning, #d97706); }
.hist-col.status .v.err { color: var(--danger, #c2410c); }
.hist-col.status .v.idle { color: var(--text-muted); }

.hist-actions {
  display: flex; gap: 6px; justify-content: flex-end;
}
.hist-actions button {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.hist-actions button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: rgba(47,138,83,0.06);
}
.hist-actions button:disabled { opacity: 0.5; cursor: wait; }

@media (max-width: 900px) {
  .hist-row { grid-template-columns: 56px 1fr 80px; gap: 10px; padding: 12px; }
  .hist-row .hist-col.cpf,
  .hist-row .hist-col.renavam { display: none; }
  .hist-thumb { width: 48px; height: 48px; font-size: 18px; }
}

/* ==========================================================================
   Meus Recursos — vehicle group + collapsible recurso rows
   ========================================================================== */
.rcv-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.rcv-group[open] { border-color: rgba(47,138,83,0.28); box-shadow: 0 1px 0 rgba(47,138,83,0.04), 0 6px 18px -10px rgba(47,138,83,0.18); }
.rcv-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.rcv-group > summary::-webkit-details-marker { display: none; }
.rcv-group-head {
  display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1;
}
.rcv-group-chev {
  color: var(--text-muted); font-size: 12px;
  transition: transform .18s ease;
}
.rcv-group[open] > summary .rcv-group-chev { transform: rotate(90deg); color: var(--primary); }
.rcv-plate-wrap { flex: 0 0 auto; }
.rcv-plate-fallback {
  display: inline-block; padding: 6px 10px;
  background: #f3f4f6; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-data, monospace); font-weight: 700; font-size: 13px;
  letter-spacing: 1px; color: var(--text-main);
}
.rcv-group-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcv-group-info strong {
  font-family: var(--font-d, inherit);
  font-size: 15px; font-weight: 700; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcv-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rcv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--paper-deep, #f6f4ef);
  font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border);
}
.rcv-chip i { font-size: 10px; opacity: 0.7; }
.rcv-group-count {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
}
.rcv-count-num {
  font-family: var(--font-d, inherit); font-weight: 800; font-size: 22px;
  color: var(--primary-strong, var(--primary)); line-height: 1;
}
.rcv-count-lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
}
.rcv-group-body {
  padding: 4px 14px 14px;
  background: var(--paper-deep, #fafaf7);
  border-top: 1px solid var(--border);
}
.rcv-recurso {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 10px;
  overflow: hidden;
}
.rcv-recurso[open] { border-color: rgba(47,138,83,0.28); }
.rcv-recurso > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rcv-recurso > summary::-webkit-details-marker { display: none; }
.rcv-rec-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.rcv-rec-chev { color: var(--text-muted); font-size: 11px; transition: transform .18s; }
.rcv-recurso[open] > summary .rcv-rec-chev { transform: rotate(90deg); color: var(--primary); }
.rcv-rec-id {
  font-family: var(--font-data, monospace); font-size: 11px;
  background: var(--paper-deep, #f6f4ef);
  color: var(--text-muted);
  padding: 3px 8px; border-radius: 6px; flex: 0 0 auto;
}
.rcv-rec-title {
  font-weight: 600; font-size: 13px; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.rcv-rec-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
.rcv-rec-progress {
  height: 4px; background: var(--paper-deep, #f0eee8);
  border-radius: 4px; overflow: hidden; margin: 12px 0 14px;
}
.rcv-rec-bar { height: 100%; transition: width .3s; }
.rcv-rec-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.rcv-rec-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rcv-rec-cell span {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-muted);
}
.rcv-rec-cell strong {
  font-size: 13px; color: var(--text-main); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcv-rec-actions {
  display: flex; justify-content: flex-end; margin-top: 14px;
}
.rcv-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background .15s, transform .1s;
}
.rcv-cta:hover { background: var(--primary-strong, var(--primary)); }
.rcv-cta:active { transform: translateY(1px); }
@media (max-width: 720px) {
  .rcv-rec-grid { grid-template-columns: repeat(2, 1fr); }
  .rcv-group-info strong { font-size: 14px; }
}

/* ==========================================================================
   Meus Pedidos — vehicle card + pending priorities checklist
   ========================================================================== */
.ped-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ped-card[open] { border-color: rgba(47,138,83,0.28); box-shadow: 0 1px 0 rgba(47,138,83,0.04), 0 6px 18px -10px rgba(47,138,83,0.18); }
.ped-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.ped-card-summary::-webkit-details-marker { display: none; }
.ped-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.ped-chev { color: var(--text-muted); font-size: 12px; transition: transform .18s; }
.ped-card[open] > summary .ped-chev { transform: rotate(90deg); color: var(--primary); }
.ped-plate-wrap { flex: 0 0 auto; }
.ped-head-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ped-head-info strong {
  font-family: var(--font-d, inherit); font-weight: 700; font-size: 15px;
  color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ped-head-meta {
  font-family: var(--font-data, monospace); font-size: 11px;
  color: var(--text-muted); letter-spacing: 0.3px;
}
.ped-head-right {
  display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
}
.ped-valor {
  font-family: var(--font-d, inherit); font-weight: 700; font-size: 16px;
  color: var(--text-main);
}
.ped-body {
  padding: 14px 18px 18px;
  background: var(--paper-deep, #fafaf7);
  border-top: 1px solid var(--border);
}
.ped-body-row {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start;
  margin-bottom: 12px;
}
.ped-body-cell { display: flex; flex-direction: column; gap: 4px; }
.ped-body-cell > span {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-muted);
}
.ped-body-cell > strong { font-size: 13px; color: var(--text-main); font-weight: 600; }
.ped-body-cell:last-child { flex-direction: row; flex-wrap: wrap; gap: 6px; align-self: center; }
.ped-progress {
  height: 5px; background: rgba(0,0,0,0.06);
  border-radius: 5px; overflow: hidden; margin: 4px 0 14px;
}
.ped-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-strong, var(--primary)));
  transition: width .35s ease;
}
.ped-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ped-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
}
.ped-step .ped-step-glyph { font-size: 11px; opacity: 0.65; }
.ped-step > i:first-child { font-size: 12px; }
.ped-step-done {
  background: rgba(47,138,83,0.08);
  border-color: rgba(47,138,83,0.28);
  color: var(--primary-strong, var(--primary));
}
.ped-step-done > i:first-child { color: var(--primary); }
.ped-step-current {
  background: rgba(217,119,6,0.10);
  border-color: rgba(217,119,6,0.35);
  color: var(--warning, #b45309);
  font-weight: 600;
}
.ped-step-current > i:first-child { color: var(--warning, #d97706); animation: ped-pulse 1.6s ease-in-out infinite; }
.ped-step-upcoming { opacity: 0.65; }
.ped-step-idle { opacity: 0.5; }
@keyframes ped-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
.ped-terminal {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
}
.ped-terminal-success { background: rgba(47,138,83,0.10); color: var(--primary-strong, var(--primary)); }
.ped-terminal-danger  { background: rgba(194,65,12,0.10); color: var(--danger, #c2410c); }
.ped-terminal-info    { background: rgba(37,99,235,0.10); color: var(--accent, #2563eb); }
.ped-cta-row {
  margin-top: 16px; display: flex; justify-content: flex-end;
}
.ped-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px -3px rgba(47,138,83,0.4);
}
.ped-cta:hover { background: var(--primary-strong, var(--primary)); box-shadow: 0 4px 14px -4px rgba(47,138,83,0.5); }
.ped-cta:active { transform: translateY(1px); }
@media (max-width: 720px) {
  .ped-card-summary { flex-direction: column; align-items: flex-start; }
  .ped-head-right { width: 100%; justify-content: space-between; }
  .ped-steps { gap: 6px; }
  .ped-step { padding: 6px 10px; font-size: 11px; }
}
