/* admin.css - Estilos do Painel Administrativo do Gestor de Frotas (Desktop) */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 48px);
  width: 100%;
}

/* Sidebar do Gestor */
.admin-sidebar {
  width: 270px;
  flex-shrink: 0;
  border-radius: 0;
  border-right: 1px solid var(--border-subtle);
  border-top: none;
  border-bottom: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: #080d1a;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.sidebar-header-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .sidebar-header-badge {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.brand-text h3 {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #f8fafc;
}

.brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(17, 28, 53, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta strong {
  display: block;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  width: 100%;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: #38bdf8;
  border-left: 3px solid #38bdf8;
}

.nav-icon {
  font-size: 1.1rem;
}

.nav-text {
  flex: 1;
}

.nav-badge, .nav-badge-warn, .nav-badge-danger {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
}

.nav-badge { background: #1e293b; color: #cbd5e1; }
.nav-badge-warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.nav-badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.compliance-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Área Principal */
.admin-main {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.topbar-title-block h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.topbar-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-select-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  width: auto;
}

/* KPIs de Frota */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.kpi-card {
  padding: 18px;
  border-top: 3px solid var(--primary);
  background: rgba(17, 28, 53, 0.7);
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.kpi-card.clickable {
  cursor: pointer;
  user-select: none;
}

.kpi-card.clickable:hover {
  transform: translateY(-3px);
  background: rgba(26, 42, 78, 0.9);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.kpi-card.active-filter {
  background: rgba(28, 46, 88, 0.95);
  box-shadow: 0 0 0 2px var(--accent-cyan), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.kpi-card.border-green { border-top-color: var(--success); }
.kpi-card.border-green.active-filter { box-shadow: 0 0 0 2px var(--success), 0 8px 24px rgba(16, 185, 129, 0.25); }

.kpi-card.border-blue { border-top-color: var(--primary); }
.kpi-card.border-blue.active-filter { box-shadow: 0 0 0 2px var(--primary), 0 8px 24px rgba(37, 99, 235, 0.3); }

.kpi-card.border-yellow { border-top-color: var(--warning); }
.kpi-card.border-yellow.active-filter { box-shadow: 0 0 0 2px var(--warning), 0 8px 24px rgba(245, 158, 11, 0.25); }

.kpi-card.border-red { border-top-color: var(--danger); }
.kpi-card.border-red.active-filter { box-shadow: 0 0 0 2px var(--danger), 0 8px 24px rgba(239, 68, 68, 0.3); }

.filter-active-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  letter-spacing: 0.5px;
}

.pill-success { background: var(--success-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.pill-primary { background: var(--primary-light); color: #93c5fd; border: 1px solid rgba(37, 99, 235, 0.4); }
.pill-warning { background: var(--warning-bg); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.pill-danger { background: var(--danger-bg); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

.table-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

.table-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  margin: 4px 0;
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Tabelas Densas de Gestão */
.data-table-card {
  padding: 20px;
}

.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table th {
  background: rgba(9, 14, 26, 0.6);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tr.row-pending td {
  background: rgba(245, 158, 11, 0.05);
}

.plate-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prefix-tag {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.vehicle-desc strong {
  display: block;
}

.vehicle-desc small {
  color: var(--text-muted);
}

.badge-status-green { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); font-weight: 600; }
.badge-status-blue { background: rgba(37, 99, 235, 0.22); color: #93c5fa; border: 1px solid rgba(59, 130, 246, 0.35); font-weight: 600; }
.badge-status-yellow { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); font-weight: 600; }
.badge-status-red { background: rgba(239, 68, 68, 0.22); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); font-weight: 600; animation: pulseGlow 2s infinite; }
.badge-status-gray { background: rgba(100, 116, 139, 0.22); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.35); font-weight: 600; }

/* Semáforo de CNH */
.semaphore-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.semaphore-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.semaphore-green .semaphore-light { background: #10b981; box-shadow: 0 0 6px #10b981; }

.semaphore-yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.semaphore-yellow .semaphore-light { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

.semaphore-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.semaphore-red .semaphore-light { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

.semaphore-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Auditoria & Conciliação de Gap */
.audit-intro-box {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
}

.audit-intro-icon {
  font-size: 2.2rem;
}

.split-audit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.audit-card {
  padding: 18px;
}

.gap-photo-view {
  background: #000;
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gap-photo-view img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 6px;
}

.audit-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: #090e1a;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.metric-value {
  font-size: 0.95rem;
}

/* Régua de Preventivas */
.preventive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.preventive-card {
  padding: 14px;
}

.preventive-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.bg-success { background: #10b981; }
.bg-warning { background: #f59e0b; }
.bg-danger  { background: #ef4444; }

/* Relatórios */
.report-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.report-action-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-action-card h4 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.report-action-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Central de Alertas e Notificações por E-mail */
.alerts-config-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.alert-rule-card {
  padding: 16px;
  background: rgba(11, 17, 32, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.alert-rule-card:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(56, 189, 248, 0.3);
}

.alert-rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.alert-rule-header strong {
  font-size: 0.92rem;
  color: #f1f5f9;
}

.email-log-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pill-oleo { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-freios { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.pill-emplac { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-cnh { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.pill-teste { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }

.email-preview-box {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  font-family: Arial, sans-serif;
}

.email-preview-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.email-preview-meta {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
}

.email-preview-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1e293b;
}

.email-preview-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}

/* --- Media Queries Responsivas do Painel Administrativo --- */
@media (max-width: 992px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
  }
  .sidebar-brand {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .sidebar-user-card {
    display: none;
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .nav-item.active {
    border-left: none;
    border-bottom: 3px solid #38bdf8;
    background: rgba(37, 99, 235, 0.15);
  }
  .sidebar-footer {
    display: none;
  }
  .admin-main {
    padding: 16px 12px;
  }
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .table-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .table-header-right {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
  .vehicle-admin-card {
    padding: 14px;
  }
}

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

/* --- Miniaturas e Modo Grade da Gestão de Pátio --- */
.vehicle-thumb-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patio-vehicle-thumbnail {
  width: 58px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  cursor: pointer;
  background: #0f172a;
  flex-shrink: 0;
}

.patio-vehicle-thumbnail:hover {
  transform: scale(1.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  z-index: 10;
  position: relative;
  border-color: #38bdf8;
}

.view-mode-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.btn-toggle-view {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-view.active {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Modo Grade / Cards de Veículos */
.patio-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.patio-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.patio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  border-color: rgba(56, 189, 248, 0.45);
}

.patio-card-media {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #090d16;
  cursor: pointer;
}

/* Scrim gradient overlay to guarantee 100% legibility on light/white car backgrounds */
.patio-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.65) 0%,
    rgba(15, 23, 42, 0.15) 35%,
    transparent 60%,
    rgba(15, 23, 42, 0.5) 100%
  );
  z-index: 1;
}

.patio-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.patio-card:hover .patio-card-img {
  transform: scale(1.06);
}

/* Status badge with solid high contrast, pure white text, and glowing status dot */
.patio-card-status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 5px 12px;
  border-radius: 9999px;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.patio-card:hover .patio-card-status {
  transform: translateY(-1px);
}

.patio-card-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Disponível: Green */
.patio-card-status.badge-status-green {
  background: #047857 !important;
  border: 1.5px solid #34d399 !important;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.65);
}
.patio-card-status.badge-status-green::before {
  background: #a7f3d0;
  box-shadow: 0 0 8px #a7f3d0;
}

/* Em Viagem: Blue */
.patio-card-status.badge-status-blue {
  background: #1d4ed8 !important;
  border: 1.5px solid #60a5fa !important;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.65);
}
.patio-card-status.badge-status-blue::before {
  background: #bfdbfe;
  box-shadow: 0 0 8px #bfdbfe;
}

/* Na Oficina: Amber */
.patio-card-status.badge-status-yellow {
  background: #b45309 !important;
  border: 1.5px solid #fbbf24 !important;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.65);
}
.patio-card-status.badge-status-yellow::before {
  background: #fde68a;
  box-shadow: 0 0 8px #fde68a;
}

/* Apuração de Gap: Red */
.patio-card-status.badge-status-red {
  background: #b91c1c !important;
  border: 1.5px solid #f87171 !important;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.75);
  animation: pulse-gap-card 1.8s infinite;
}
.patio-card-status.badge-status-red::before {
  background: #fecaca;
  box-shadow: 0 0 8px #fecaca;
}

/* Baixado: Slate */
.patio-card-status.badge-status-gray {
  background: #334155 !important;
  border: 1.5px solid #94a3b8 !important;
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.55);
}
.patio-card-status.badge-status-gray::before {
  background: #e2e8f0;
  box-shadow: 0 0 8px #e2e8f0;
}

@keyframes pulse-gap-card {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6), 0 4px 12px rgba(185, 28, 28, 0.75);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0), 0 4px 16px rgba(239, 68, 68, 0.9);
  }
}

.patio-card-cat {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.88);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.patio-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.patio-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.patio-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px 0;
  line-height: 1.25;
}

.patio-card-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.patio-card-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-metric {
  display: flex;
  flex-direction: column;
}

.card-metric .metric-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  font-weight: 700;
}

.card-metric strong, .card-metric span {
  font-size: 0.9rem;
  color: #f1f5f9;
  font-weight: 700;
}

.text-cyan {
  color: #38bdf8 !important;
}

.patio-card-footer {
  margin-top: auto;
}

/* Modal Lightbox de Foto do Veículo */
.vehicle-photo-lightbox {
  max-width: 650px;
  width: 95%;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.lightbox-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  background: #000;
}

.lightbox-body {
  padding: 18px 22px;
}

.lightbox-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
}

.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

/* =========================================================
   Modo Claro (Light Theme) - Gestão de Pátio e Cartões
   ========================================================= */
html[data-theme="light"] .view-mode-toggle {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

html[data-theme="light"] .btn-toggle-view {
  color: #475569;
}

html[data-theme="light"] .btn-toggle-view.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

html[data-theme="light"] .patio-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .patio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
}

html[data-theme="light"] .patio-card-media {
  background: #f1f5f9;
}

html[data-theme="light"] .patio-card-media::after {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.65) 0%,
    rgba(15, 23, 42, 0.15) 35%,
    transparent 60%
  );
}

html[data-theme="light"] .patio-card-title {
  color: #0f172a;
  font-weight: 800;
}

html[data-theme="light"] .patio-card-sub {
  color: #475569;
}

html[data-theme="light"] .patio-card-metrics-grid {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

html[data-theme="light"] .card-metric .metric-label {
  color: #475569;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

html[data-theme="light"] .card-metric strong,
html[data-theme="light"] .card-metric span {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
}

html[data-theme="light"] .card-metric strong.text-cyan,
html[data-theme="light"] .patio-card-sub strong.text-cyan {
  color: #0284c7 !important;
  font-weight: 800;
}

html[data-theme="light"] .sec-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

html[data-theme="light"] .btn-ver-veiculo,
html[data-theme="light"] .btn-outline-primary {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

html[data-theme="light"] .btn-ver-veiculo:hover,
html[data-theme="light"] .btn-outline-primary:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

html[data-theme="light"] .vehicle-photo-lightbox {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .lightbox-title {
  color: #0f172a;
}

html[data-theme="light"] .lightbox-body {
  color: #334155;
}

/* Suíte de Relatórios Analíticos e Filtros por Período */
.report-filter-bar {
  padding: 18px 20px;
  margin-bottom: 20px;
}

.period-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.period-chip {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.period-chip:hover {
  background: rgba(30, 58, 138, 0.5);
  color: #fff;
  border-color: var(--accent-cyan);
}

.period-chip.active {
  background: var(--primary);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.35);
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: flex-end;
}

.subtab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 2px;
  overflow-x: auto;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.subtab-btn.active {
  color: var(--accent-cyan);
  background: rgba(14, 165, 233, 0.12);
  border-bottom: 3px solid var(--accent-cyan);
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

html[data-theme="light"] .period-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .period-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

html[data-theme="light"] .period-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

html[data-theme="light"] .subtab-nav {
  border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .subtab-btn {
  color: #64748b;
}

html[data-theme="light"] .subtab-btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

html[data-theme="light"] .subtab-btn.active {
  color: #0284c7;
  background: #e0f2fe;
  border-bottom-color: #0284c7;
}

/* Modal de Configuração de Impressão e Calendário (Sem rolagem horizontal) */
.modal-card {
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.print-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
}

.calendar-input-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.calendar-input-card:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
  background: rgba(15, 23, 42, 0.75);
}

.calendar-input-card label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.calendar-input-card input[type="date"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}

.print-filter-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.print-filter-options-grid .form-group {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.print-filter-options-grid select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
}

.print-modal-preview-box {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(30, 58, 138, 0.12) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.print-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.print-preview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.print-kpi-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.print-kpi-item .label {
  display: block;
  font-size: 0.70rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-kpi-item .value {
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
}

.print-preview-mini-table {
  max-height: 160px;
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 25, 0.6);
}

.print-preview-mini-table table {
  width: 100%;
  font-size: 0.75rem;
  border-collapse: collapse;
}

.print-preview-mini-table th {
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  position: sticky;
  top: 0;
}

.print-preview-mini-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .calendar-input-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="light"] .calendar-input-card input[type="date"] {
  color: #0f172a;
}

html[data-theme="light"] .print-modal-preview-box {
  background: #f0f9ff;
  border-color: #bae6fd;
}

html[data-theme="light"] .print-kpi-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .print-preview-mini-table {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .print-preview-mini-table th {
  background: #f1f5f9;
  color: #475569;
}

html[data-theme="light"] .print-preview-mini-table td {
  border-bottom-color: #f1f5f9;
}

/* ==========================================================================
   MÓDULO DE AGENDAMENTOS E RESERVA DE VEÍCULOS OFICIAIS
   ========================================================================== */

.agendamentos-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* Barra de Ferramentas / Filtros de Agendamento */
.agendamento-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.toolbar-filters-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-filters-group .filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-filters-group .filter-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar-filters-group .form-control {
  min-width: 160px;
  font-size: 0.82rem;
  padding: 6px 10px;
  height: 36px;
}

.toolbar-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-mode-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.btn-toggle-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-toggle-mode:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-toggle-mode.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   CALENDÁRIO MENSAL INTERATIVO
   ========================================================================== */

.calendar-wrapper {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  padding: 16px;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.calendar-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cal-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-month-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  min-width: 200px;
  text-align: center;
  letter-spacing: 0.3px;
}

.cal-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.status-agendado { background: #0284c7; }
.legend-dot.status-em_andamento { background: #f59e0b; }
.legend-dot.status-concluido { background: #10b981; }

/* Dias da Semana (Cabeçalho do Calendário) */
.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.8px;
  padding: 6px 0;
}

.weekday-header {
  padding: 4px;
}

/* Grade de Células do Calendário */
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-cell {
  min-height: 110px;
  max-height: 150px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  transition: all 0.2s ease;
  overflow: hidden;
}

.calendar-day-cell.current-month {
  cursor: pointer;
}

.calendar-day-cell.current-month:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
  background: rgba(8, 13, 26, 0.3);
  cursor: default;
}

.calendar-day-cell.is-today {
  border: 1.5px solid #0284c7;
  background: rgba(2, 132, 199, 0.08);
  box-shadow: inset 0 0 12px rgba(2, 132, 199, 0.15);
}

.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
}

.cell-day-number {
  font-weight: 700;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.calendar-day-cell.is-today .cell-day-number {
  color: #38bdf8;
  font-weight: 800;
}

.cell-today-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #0284c7;
  color: #fff;
  padding: 2px 6px;
  border-radius: 9999px;
  letter-spacing: 0.4px;
}

.btn-cell-quick-add {
  opacity: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.calendar-day-cell:hover .btn-cell-quick-add {
  opacity: 1;
}

.btn-cell-quick-add:hover {
  background: #0284c7;
  border-color: #38bdf8;
}

/* Lista de Eventos dentro de Cada Dia */
.cell-events-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

.cell-events-list::-webkit-scrollbar {
  width: 3px;
}

.cell-events-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.cal-event-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.cal-event-pill:hover {
  transform: scale(1.02);
  filter: brightness(1.2);
}

.cal-event-time {
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  opacity: 0.9;
}

.cal-event-veh {
  font-weight: 700;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
}

.cal-event-driver {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cores por Status do Evento */
.cal-event-pill.status-agendado {
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(14, 165, 233, 0.5);
  color: #38bdf8;
}

.cal-event-pill.status-em_andamento {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  animation: pulseAmber 2.2s infinite;
}

.cal-event-pill.status-concluido {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.cal-event-pill.status-cancelado {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  text-decoration: line-through;
  opacity: 0.75;
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ==========================================================================
   VISUALIZAÇÃO 2: LISTA / AGENDA DETALHADA
   ========================================================================== */

.agenda-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-list-header {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 6px;
}

.agenda-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-card {
  display: grid;
  grid-template-columns: 140px 1fr 160px;
  gap: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.agenda-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.agenda-card.border-pulse-blue {
  border-left: 4px solid #f59e0b;
}

/* Coluna de Data/Hora na Lista */
.agenda-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  min-height: 120px;
}

.agenda-weekday {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.6px;
}

.agenda-day-big {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #f8fafc;
  margin: 4px 0;
}

.agenda-month {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.agenda-time-pill {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  color: #e2e8f0;
}

.agenda-time-pill small {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Coluna Principal da Lista */
.agenda-main-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.agenda-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pill.status-agendado {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.5);
}

.status-pill.status-em_andamento {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-pill.status-concluido {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-pill.status-cancelado {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  text-decoration: line-through;
}

.agenda-sec-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #94a3b8;
}

.agenda-vehicle-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agenda-veh-avatar {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agenda-veh-meta h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
}

.agenda-veh-meta p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.agenda-driver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.agenda-driver-label {
  color: var(--text-muted);
}

.agenda-driver-name {
  color: #f1f5f9;
}

.agenda-cnh-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-radius: 4px;
}

.agenda-route-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.route-item {
  display: flex;
  flex-direction: column;
}

.route-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.route-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.route-arrow {
  color: #38bdf8;
  font-size: 1rem;
}

.agenda-purpose-box {
  font-size: 0.8rem;
}

.purpose-label {
  font-weight: 700;
  color: #94a3b8;
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.purpose-text {
  color: #cbd5e1;
  margin: 0;
  line-height: 1.35;
}

.agenda-notes-box {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Coluna de Ações na Lista */
.agenda-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: center;
}

.agenda-actions-col .btn {
  width: 100%;
  font-size: 0.8rem;
}

/* ==========================================================================
   FEEDBACK DE CONFLITO E VALIDAÇÕES DO MODAL
   ========================================================================== */

.conflito-feedback-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-width: 1.5px;
  border-style: solid;
}

.conflito-feedback-box.conflito-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.conflito-feedback-box.conflito-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.conflito-feedback-box.conflito-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

.quick-chip-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-loc {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-loc:hover {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  border-color: #38bdf8;
}

/* ==========================================================================
   FICHA DETALHADA E IMPRESSÃO DE AGENDAMENTO
   ========================================================================== */

.detalhes-agd-header-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.detalhes-brand-shield {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.detalhes-header-text {
  flex: 1;
}

.detalhes-header-text h4 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: #f8fafc;
}

.detalhes-header-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0;
}

.detalhes-header-text small {
  font-size: 0.72rem;
  color: #64748b;
}

.detalhes-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detalhe-sub-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.detalhe-card-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detalhe-sub-card h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.detalhe-sub-card p {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin: 3px 0;
}

.cronograma-row {
  display: flex;
  gap: 24px;
  font-size: 0.82rem;
}

.cronograma-row p {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
}

.trajeto-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.trajeto-row p {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 2px;
}

.trajeto-arrow {
  font-size: 1.1rem;
  color: #38bdf8;
}

.finalidade-destaque {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-left: 3px solid #0284c7;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 6px 0;
}

.detalhes-meta-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

/* ==========================================================================
   TEMA CLARO (LIGHT THEME) OVERRIDES PARA AGENDAMENTOS
   ========================================================================== */

html[data-theme="light"] .agendamento-toolbar {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .view-mode-toggle {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

html[data-theme="light"] .btn-toggle-mode {
  color: #475569;
}

html[data-theme="light"] .btn-toggle-mode:hover {
  color: #0f172a;
  background: #e2e8f0;
}

html[data-theme="light"] .btn-toggle-mode.active {
  background: #0284c7;
  color: #ffffff;
}

html[data-theme="light"] .calendar-wrapper {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .calendar-month-heading {
  color: #0f172a;
}

html[data-theme="light"] .calendar-weekdays-row {
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
}

html[data-theme="light"] .calendar-day-cell {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .calendar-day-cell.current-month:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}

html[data-theme="light"] .calendar-day-cell.other-month {
  background: #f1f5f9;
  opacity: 0.5;
}

html[data-theme="light"] .calendar-day-cell.is-today {
  background: #f0f9ff;
  border-color: #0284c7;
}

html[data-theme="light"] .cell-day-number {
  color: #334155;
}

html[data-theme="light"] .calendar-day-cell.is-today .cell-day-number {
  color: #0284c7;
}

html[data-theme="light"] .btn-cell-quick-add {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .btn-cell-quick-add:hover {
  background: #0284c7;
  color: #ffffff;
}

html[data-theme="light"] .cal-event-pill.status-agendado {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

html[data-theme="light"] .cal-event-pill.status-em_andamento {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

html[data-theme="light"] .cal-event-pill.status-concluido {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

html[data-theme="light"] .cal-event-pill.status-cancelado {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

html[data-theme="light"] .agenda-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .agenda-date-col {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .agenda-day-big {
  color: #0f172a;
}

html[data-theme="light"] .agenda-time-pill {
  background: #f1f5f9;
  color: #334155;
}

html[data-theme="light"] .agenda-veh-meta h4 {
  color: #0f172a;
}

html[data-theme="light"] .agenda-driver-name {
  color: #0f172a;
}

html[data-theme="light"] .agenda-route-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .route-val {
  color: #0f172a;
}

html[data-theme="light"] .purpose-text {
  color: #334155;
}

html[data-theme="light"] .detalhes-agd-header-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .detalhes-header-text h4 {
  color: #0f172a;
}

html[data-theme="light"] .detalhe-sub-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .detalhe-sub-card h4 {
  color: #0f172a;
}

html[data-theme="light"] .detalhe-sub-card p {
  color: #334155;
}

html[data-theme="light"] .cronograma-row p {
  color: #0f172a;
}

html[data-theme="light"] .trajeto-row {
  background: #f8fafc;
}

html[data-theme="light"] .trajeto-row p {
  color: #0f172a;
}

html[data-theme="light"] .finalidade-destaque {
  background: #f1f5f9;
  color: #0f172a;
}

/* Responsividade do Calendário e Agenda */
@media (max-width: 900px) {
  .agendamento-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-filters-group {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-actions-group {
    justify-content: space-between;
  }
  .agenda-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .agenda-date-col {
    flex-direction: row;
    justify-content: space-around;
    min-height: auto;
  }
  .detalhes-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   POPUP MODAIS DO SISTEMA DE AGENDAMENTOS
   ========================================================================== */

#modal-admin-container {
  position: relative;
  z-index: 3000;
}

.modal-overlay:not(.d-none):not([style*="display: none"]),
.modal-backdrop:not(.d-none):not([style*="display: none"]) {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(4, 8, 20, 0.82) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  z-index: 3000 !important;
  overflow-y: auto !important;
}

.modal-overlay.d-none,
.modal-backdrop.d-none,
.d-none {
  display: none !important;
}

.modal-animate {
  animation: popupScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes popupScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.printable-modal {
  max-width: 820px !important;
  width: 100% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

html[data-theme="light"] .modal-overlay,
html[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.6) !important;
}

html[data-theme="light"] .printable-modal {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   ESTILOS PARA GESTÃO DE MULTAS E INFRAÇÕES DE TRÂNSITO (AIT)
   ========================================================================== */
.btn-preset-infracao {
  transition: all 0.18s ease-in-out;
  font-size: 0.72rem !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  cursor: pointer;
}

.btn-preset-infracao:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.badge-infracao {
  transition: transform 0.15s ease;
}

.badge-infracao:hover {
  transform: scale(1.02);
}

html[data-theme="light"] #form-infracao-viagem .form-control {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] #form-infracao-viagem .form-label {
  color: #334155 !important;
}



