/* =====================================================
   DFTrack - Estilos Principais
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

:root {
  --bg-primary: #050505;
  --bg-secondary: #0f0f0f;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --red-primary: #dc2626;
  --red-hover: #ef4444;
  --red-dark: #b91c1c;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --green: #22c55e;
  --blue: #3b82f6;
  --gray: #6b7280;
  --yellow: #eab308;
  --orange: #f97316;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(220, 38, 38, 0.4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(220, 38, 38, 0.7); }

/* Layout Principal */
#main-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
  z-index: 50;
}

#sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

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

.sidebar-logo .logo-icon {
  color: var(--red-primary);
  font-size: 28px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section-title {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(220, 38, 38, 0.15);
  color: var(--red-primary);
  border-left: 3px solid var(--red-primary);
}

.nav-item .icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--red-primary);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* Main Content */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
#header {
  height: 58px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

/* Content Area */
#content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.stat-card:hover {
  border-color: rgba(220, 38, 38, 0.3);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--red-hover), var(--red-primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s;
  appearance: none;
}

.form-input:focus {
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input::placeholder { color: rgba(255,255,255,0.25); }

select.form-input option {
  background: #1a1a1a;
  color: white;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-on { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-moving { background: rgba(59,130,246,0.15); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.status-off { background: rgba(107,114,128,0.15); color: var(--gray); border: 1px solid rgba(107,114,128,0.2); }
.status-blocked { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.status-online { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-offline { background: rgba(107,114,128,0.15); color: var(--gray); border: 1px solid rgba(107,114,128,0.2); }
.status-active { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-suspended { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.status-pending { background: rgba(234,179,8,0.15); color: var(--yellow); border: 1px solid rgba(234,179,8,0.2); }
.status-paid { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-overdue { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* Map */
#map-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.leaflet-container {
  background: #1a1a1a;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

/* Vehicle Marker */
.vehicle-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.marker-on { background: var(--green); }
.marker-moving { background: var(--blue); }
.marker-off { background: var(--gray); }
.marker-blocked { background: #ef4444; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-xl { max-width: 900px; }
.modal-sm { max-width: 400px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { border-left: 4px solid var(--green); }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid var(--yellow); }
.toast-info { border-left: 4px solid var(--blue); }

/* AI Chat */
.ai-chat-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 500;
  width: 360px;
}

.ai-chat-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.ai-messages {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-msg-user {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.3);
  align-self: flex-end;
  color: var(--text-primary);
}

.ai-msg-bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text-secondary);
}

/* Vehicle Card */
.vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.vehicle-card:hover {
  border-color: rgba(220, 38, 38, 0.3);
  transform: translateY(-2px);
}

.vehicle-card.selected {
  border-color: var(--red-primary);
  background: rgba(220, 38, 38, 0.05);
}

/* Vehicle Image */
.vehicle-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.vehicle-img-placeholder {
  width: 100%;
  height: 80px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255,255,255,0.1);
}

/* Search */
.search-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px 8px 36px;
  color: var(--text-primary);
  font-size: 13px;
  width: 240px;
  transition: all 0.2s;
}

.search-box:focus {
  border-color: rgba(220, 38, 38, 0.4);
  width: 280px;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tab {
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tab.active {
  background: var(--red-primary);
  color: white;
}

.tab:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

/* Loading */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.page-btn:hover, .page-btn.active {
  background: var(--red-primary);
  color: white;
  border-color: var(--red-primary);
}

/* Block Toggle */
.block-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.block-btn.blocked {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  box-shadow: 0 0 15px rgba(220,38,38,0.4);
}

.block-btn.unblocked {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
}

/* Dashboard Specific */
.page-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* Sidebar user */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user:hover {
  background: rgba(255,255,255,0.03);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Section padding */
.section-pad { padding: 20px 24px; }

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100%;
    transition: left 0.3s;
  }
  #sidebar.open { left: 0; }
  
  .ai-chat-container { width: calc(100vw - 32px); right: 16px; }
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
  margin-bottom: 5px;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Map controls */
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s;
  white-space: nowrap;
}

.map-control-btn:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
}

/* Sidebar collapsed labels */
#sidebar.collapsed .nav-item-text,
#sidebar.collapsed .nav-section-title,
#sidebar.collapsed .logo-text,
#sidebar.collapsed .sidebar-user-info,
#sidebar.collapsed .nav-item .badge {
  display: none;
}

/* Finance */
.charge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s;
}

.charge-card:hover {
  border-color: rgba(255,255,255,0.15);
}

/* Geo input */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Pulse animation for online trackers */
.online-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  display: inline-block;
}

.online-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: modalIn 0.2s ease;
}

/* Charts */
.chart-wrapper {
  position: relative;
  height: 220px;
}

/* File Upload */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.05);
}

/* =====================================================
   DFTrack v1.3 - CSS Melhorias de Interface Profissional
   ===================================================== */

/* === LOGO APRIMORADO === */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
}

.logo-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo-text .text-white { color: #f9fafb; }
.logo-text .text-red-500 { color: #ef4444; }

.logo-badge {
  font-size: 9px;
  background: rgba(220,38,38,0.2);
  color: #ef4444;
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 2px;
}

/* === SIDEBAR MELHORADA === */
#sidebar {
  width: 240px;
  background: #111827;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  margin: 2px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  text-decoration: none;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(220,38,38,0.15), rgba(220,38,38,0.05));
  color: #f87171;
  border-left: 3px solid #dc2626;
  padding-left: 13px;
}

.nav-item .icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 7px;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.nav-item.active .icon {
  background: rgba(220,38,38,0.2);
  color: #ef4444;
}

.nav-item:hover .icon {
  background: rgba(255,255,255,0.08);
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4b5563;
  padding: 12px 24px 6px;
}

/* === CARDS DE VEÍCULO APRIMORADOS === */
.vehicle-card {
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.vehicle-card:hover {
  border-color: rgba(220,38,38,0.3);
  background: #1e2436;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.vehicle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(220,38,38,0.4), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.vehicle-card:hover::before {
  opacity: 1;
}

/* === BOTÕES APRIMORADOS === */
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  border: none;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(220,38,38,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #d1d5db;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.15);
}

/* === TABELA DE CLIENTES APRIMORADA === */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: rgba(255,255,255,0.03);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

tbody td {
  padding: 12px 16px;
  font-size: 13px;
  vertical-align: middle;
}

/* === STATUS BADGES APRIMORADOS === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-active {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}

.status-suspended, .status-off {
  background: rgba(107,114,128,0.12);
  color: #9ca3af;
  border: 1px solid rgba(107,114,128,0.2);
}

.status-on {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}

.status-moving {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.2);
}

.status-blocked {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}

/* === FORMULÁRIOS APRIMORADOS === */
.form-input {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.09);
  color: #f9fafb;
  border-radius: 9px;
  padding: 10px 14px;
  width: 100%;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: rgba(220,38,38,0.5);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

/* === MODAL APRIMORADO === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #f9fafb;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

/* === MAPA APRIMORADO === */
#map, #fullMap {
  border-radius: 12px;
  overflow: hidden;
}

.map-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

/* === SPINNER/LOADING === */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === GRID MELHORADO === */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .vehicle-card {
    padding: 12px;
  }
  
  #sidebar {
    width: 60px;
  }
  
  .nav-item-text, .logo-text, .sidebar-user-info {
    display: none;
  }
}

/* === CARDS STATS APRIMORADOS === */
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: rgba(220,38,38,0.2);
  background: rgba(255,255,255,0.04);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

/* === SCROLLBAR CUSTOMIZADA === */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* === TOAST NOTIFICATIONS === */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: #1f2937;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideInRight 0.3s ease;
  cursor: pointer;
}

.toast.error { border-left: 3px solid #dc2626; }
.toast.success { border-left: 3px solid #22c55e; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.info { border-left: 3px solid #3b82f6; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === HEADER APRIMORADO === */
#header {
  height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10,14,21,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* === DASHBOARD WELCOME === */
.dashboard-welcome {
  background: linear-gradient(135deg, rgba(220,38,38,0.12) 0%, rgba(153,27,27,0.06) 50%, rgba(0,0,0,0) 100%);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* === PAGINATION === */
.pagination {
  display: flex;
  gap: 4px;
}

.pagination button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination button:hover { background: rgba(255,255,255,0.1); color: white; }
.pagination button.active { background: #dc2626; color: white; border-color: #dc2626; }

/* === DFTrack v1.4 - UI Profissional Final === */

/* Dashboard stat cards profissionais */
.stat-card-pro {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card-pro::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,0.03), transparent);
  border-radius: 0 16px 0 60px;
}

.stat-card-pro:hover {
  border-color: rgba(220,38,38,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Pulse verde para indicador online */
@keyframes pulse-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* Info row nas modais de detalhes */
.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}

.info-row:last-child { border-bottom: none; }
.info-row .info-label { color: #6b7280; min-width: 120px; font-size: 12px; }
.info-row .info-value { color: #e5e7eb; font-weight: 500; flex: 1; }

/* Botão de bloquear/desbloquear na lista de veículos */
.vehicle-block-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

/* Cards de alerta */
.alert-card {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
}

.alert-danger {
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.2);
  color: #f87171;
}

.alert-warning {
  background: rgba(234,179,8,0.1);
  border-color: rgba(234,179,8,0.2);
  color: #fbbf24;
}

.alert-success {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
  color: #4ade80;
}

.alert-info {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.2);
  color: #60a5fa;
}

/* Plate lookup section */
.plate-lookup-box {
  background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(153,27,27,0.05));
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.plate-lookup-box .lookup-title {
  font-weight: 700;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Input placa com estilo especial */
.plate-input {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
}

/* Imagem de veículo melhorada */
.vehicle-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
}

.vehicle-img-placeholder {
  width: 100%;
  height: 80px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px dashed rgba(255,255,255,0.08);
}

/* Grid responsivo para dashboard */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}

@media (max-width: 900px) {
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Tabs melhoradas */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  width: fit-content;
}

.tab {
  padding: 7px 18px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
  user-select: none;
}

.tab.active {
  background: #dc2626;
  color: white;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.tab:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: #d1d5db;
}

/* Vehicle detail modal image */
.vehicle-detail-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* Camera upload button */
.camera-upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 9px;
  color: #f87171;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.camera-upload-btn:hover {
  background: rgba(220,38,38,0.25);
  border-color: rgba(220,38,38,0.5);
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #ef4444);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Indicador de conexão TCP */
.tcp-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #4b5563;
  padding: 3px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Sombra nos cards ao hover */
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Botão de toggle sidebar */
#sidebarToggle {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  color: #9ca3af;
  transition: all 0.2s;
  font-size: 14px;
}

#sidebarToggle:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

/* Ajuste do grid de stats */
@media (max-width: 640px) {
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
