:root {
  /* Tokens Oficiais Design System SISTEMMA */
  --primary: #266435;
  --primary-light: #619D53;
  --primary-subtle: #edf7ee;
  --bg-main: #FFF9F3;
  --bg-card: #ffffff;
  --text-main: #000000;
  --text-muted: #5E6659;
  --border: rgba(38, 100, 53, 0.16);
  --border-focus: #266435;
  --success: #619D53;
  --success-bg: #edf7ee;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Modo Escuro (Dark Mode) - Paleta Verde Floresta Corporativa */
[data-theme="dark"] {
  --primary: #619D53;
  --primary-light: #7cb86e;
  --primary-subtle: #162417;
  --bg-main: #0d170f;
  --bg-card: #152418;
  --text-main: #f1f5f9;
  --text-muted: #9D9F9E;
  --border: rgba(97, 157, 83, 0.25);
  --border-focus: #619D53;
  --success-bg: rgba(97, 157, 83, 0.2);
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.15);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --primary: #619D53;
    --primary-light: #7cb86e;
    --primary-subtle: #162417;
    --bg-main: #0d170f;
    --bg-card: #152418;
    --text-main: #f1f5f9;
    --text-muted: #9D9F9E;
    --border: rgba(97, 157, 83, 0.25);
    --border-focus: #619D53;
    --success-bg: rgba(97, 157, 83, 0.2);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
}

h1, h2, h3, .exec-kpi-val, .kpi-num, .login-header h2 {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.03em;
}

.subtitulo, .section-tag, .badge, .tab-pill-badge, .main-nav-tab, .filter-label {
  font-family: 'Outfit', sans-serif;
}

.mono, .plate-badge, .vehicle-plate {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: 'tnum';
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #266435 0%, #122b17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
  border: 1px solid var(--border);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  color: var(--primary-light);
  background: var(--primary-subtle);
  padding: 0.6rem;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-main);
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(38, 100, 53, 0.2);
}

.login-error {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  text-align: center;
}

.btn-login {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}

.btn-login:hover {
  background-color: #1c4d28;
}

.btn-login svg {
  width: 18px;
  height: 18px;
}

.login-hint {
  text-align: center;
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.login-hint code {
  background: var(--primary-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--primary-light);
}

/* Navbar */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary-light);
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.brand .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Switcher */
.theme-selector {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-theme {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-theme.active {
  background: var(--primary);
  color: #ffffff;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
}

/* User Badge & Manage Users Button */
.current-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 600;
}

.current-user-badge svg {
  color: var(--text-muted);
}

.role-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.role-pill-adm {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .role-pill-adm {
  background: rgba(30, 58, 138, 0.4);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.role-pill-consulta {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid var(--border);
}

[data-theme="dark"] .role-pill-consulta {
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-manage-users {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-subtle);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--primary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-manage-users:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-manage-users svg {
  width: 15px;
  height: 15px;
}

/* Container */
.main-container {
  max-width: 1400px;
  width: 100%;
  margin: 1rem auto;
  padding: 0 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Controls */
.controls-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.8rem 6.5rem 0.8rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-main);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-clear {
  position: absolute;
  right: 5.5rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: none;
}

.btn-camera {
  position: absolute;
  right: 0.4rem;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-camera:hover {
  background-color: var(--primary-light);
}

.btn-camera svg {
  width: 16px;
  height: 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 160px;
}

.filter-group label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-group select {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-main);
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.25rem;
  min-height: 550px;
}

/* Sidebar List */
.sidebar-list {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 220px);
}

.list-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.vehicle-items {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vehicle-card {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vehicle-card:hover {
  background-color: var(--primary-subtle);
  border-color: var(--border);
}

.vehicle-card.active {
  background-color: var(--primary-subtle);
  border-color: var(--primary-light);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vehicle-placa {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-filial {
  background-color: var(--border);
  color: var(--text-main);
}

.badge-alert {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-ok {
  background-color: var(--success-bg);
  color: var(--success);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Detail Panel */
.detail-panel {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.empty-state {
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 1rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

/* Vehicle Details */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.detail-title h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Action Buttons Bar */
.action-buttons-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-action-whatsapp {
  background-color: #25D366;
  color: #ffffff;
  border-color: #25D366;
}

.btn-action-whatsapp:hover {
  background-color: #1eb855;
  color: #ffffff;
}

.btn-action svg {
  width: 15px;
  height: 15px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background-color: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-subtext {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.alert-banner {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--warning);
  font-size: 0.825rem;
  margin-bottom: 1.25rem;
}

.alert-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.info-table th, .info-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.info-table th {
  background-color: var(--bg-main);
  color: var(--text-muted);
  width: 32%;
  font-weight: 500;
}

.history-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.history-table th {
  background-color: var(--bg-main);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.675rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

/* Modal de Gerenciamento de Usuários (ADM) */
.users-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.users-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.users-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.users-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--primary-light);
}

.users-header-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.users-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.users-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.user-create-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.user-create-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.user-form-grid .form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.user-form-grid .form-group input,
.user-form-grid .form-group select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  background: var(--bg-card);
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-create-user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-create-user:hover {
  background: #1d4ed8;
}

.btn-create-user svg {
  width: 16px;
  height: 16px;
}

.form-feedback {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  text-align: center;
  font-weight: 600;
}

.form-feedback-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-feedback-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.users-list-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.users-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.users-list-hint {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.users-table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--bg-card);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.users-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.675rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.users-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.btn-delete-user {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-user:hover {
  background: var(--danger-bg);
}

/* Modal do Scanner de Câmera */
.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.camera-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.camera-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.camera-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.camera-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Moldura de Placa de Carro */
.plate-guide {
  position: absolute;
  width: 82%;
  height: 90px;
  border: 2px dashed #619D53;
  border-radius: 8px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.guide-header {
  background: #003399;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 2px;
}

.guide-footer {
  background: rgba(0, 0, 0, 0.6);
  color: #38bdf8;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
}

.scan-status {
  font-size: 0.825rem;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.scan-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.camera-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.btn-action-camera {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-camera svg {
  width: 16px;
  height: 16px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background-color: var(--bg-card);
  margin-top: auto;
}

/* ========================================================
   Mobile Responsiveness & Adaptive Navigation (Tabs)
   ======================================================== */

.mobile-tabs-bar {
  display: none;
}

.mobile-back-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Prevent iOS Safari forced auto-zoom on input tap */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Compact Navbar */
  .nav-container {
    padding: 0.5rem 0.75rem;
  }
  .brand {
    gap: 0.5rem;
  }
  .logo-icon {
    width: 24px;
    height: 24px;
  }
  .brand h1 {
    font-size: 0.95rem;
  }
  .brand .subtitle {
    display: none;
  }
  .header-right {
    gap: 0.4rem;
  }
  .btn-theme {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
  .btn-logout {
    padding: 0.4rem;
    font-size: 0.75rem;
  }
  .btn-logout span {
    display: none;
  }

  .btn-manage-users {
    padding: 0.4rem;
    font-size: 0.75rem;
  }
  .btn-manage-users span {
    display: none;
  }

  .current-user-badge {
    padding: 0.2rem 0.35rem;
    font-size: 0.7rem;
    gap: 0.25rem;
  }
  .current-user-badge span:first-of-type {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Main Container Spacing */
  .main-container {
    padding: 0 0.5rem;
    margin: 0.5rem auto;
    gap: 0.65rem;
  }

  /* Controls Card & Search */
  .controls-card {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    gap: 0.65rem;
  }

  .btn-cam-label {
    display: none;
  }

  .search-box input {
    padding: 0.7rem 4.5rem 0.7rem 2.3rem;
  }

  .search-icon {
    left: 0.7rem;
    width: 16px;
    height: 16px;
  }

  .btn-clear {
    right: 3.2rem;
  }

  .btn-camera {
    right: 0.35rem;
    padding: 0.45rem 0.65rem;
  }

  .filter-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-group {
    width: 100%;
    min-width: 100%;
  }

  /* Mobile Tabs Navigation (Segmented Bar) */
  .mobile-tabs-bar {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
  }

  .mobile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.25);
  }

  /* Mobile Grid View Toggling */
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: auto;
  }

  /* View: LIST active */
  .dashboard-grid[data-mobile-view="list"] .sidebar-list {
    display: flex !important;
    max-height: none;
    border-radius: var(--radius-md);
  }

  .dashboard-grid[data-mobile-view="list"] .detail-panel {
    display: none !important;
  }

  /* View: DETAIL active */
  .dashboard-grid[data-mobile-view="detail"] .sidebar-list {
    display: none !important;
  }

  .dashboard-grid[data-mobile-view="detail"] .detail-panel {
    display: block !important;
    max-height: none;
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  /* Mobile Back to List Button */
  .mobile-back-bar {
    display: block;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
  }

  .btn-back-to-list {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    justify-content: center;
  }

  /* Detail Content Tuning on Mobile */
  .detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .detail-title h2 {
    font-size: 1.35rem;
  }

  .detail-subtitle {
    font-size: 0.8rem;
  }

  /* Quick Action Buttons (Touch-friendly grid) */
  .action-buttons-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    width: 100%;
  }

  .btn-action-whatsapp {
    grid-column: span 2;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    justify-content: center;
  }

  .btn-action {
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  /* KPIs: 2 clean columns on phones */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .kpi-card {
    padding: 0.65rem 0.75rem;
  }

  .kpi-title {
    font-size: 0.65rem;
  }

  .kpi-value {
    font-size: 1.15rem;
  }

  /* Info Table: Prevents overflow from long chassis/series */
  .info-table {
    margin-bottom: 1.25rem;
  }

  .info-table th {
    width: 38%;
    font-size: 0.75rem;
    padding: 0.5rem 0.4rem;
  }

  .info-table td {
    font-size: 0.8rem;
    padding: 0.5rem 0.4rem;
    word-break: break-all;
  }

  /* Vehicle Card Touch Targets */
  .vehicle-card {
    padding: 0.85rem;
    gap: 0.35rem;
  }

  .vehicle-placa {
    font-size: 1rem;
  }

  /* History Table */
  .history-container {
    -webkit-overflow-scrolling: touch;
  }

  .history-table th, .history-table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ========================================================
   Guias Principais do Sistema (Consulta vs. Dashboard)
   ======================================================== */
.main-nav-tabs-wrapper {
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  padding: 0 1.25rem;
}

.main-nav-tabs {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-top: 0.45rem;
}

.main-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.main-nav-tab:hover {
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.06);
}

.main-nav-tab.active {
  color: #266435;
  background: var(--bg-card);
  border-color: var(--border);
  border-bottom: 3px solid #266435;
}

[data-theme="dark"] .main-nav-tab.active {
  color: #93c5fd;
  border-bottom-color: #60a5fa;
}

.tab-pill-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: #266435;
  color: #ffffff;
}

.tab-pill-orange {
  background: #e56619;
  color: #ffffff;
}

/* ========================================================
   Indicadores em Paralelo na Ficha Técnica (Ficha x App)
   ======================================================== */
.badge-ficha-navy {
  background-color: #266435;
  color: #ffffff;
}

.badge-app-orange {
  background-color: #e56619;
  color: #ffffff;
}

.badge-audit-green {
  background-color: #2d8c56;
  color: #ffffff;
}

.badge-audit-red {
  background-color: #c02626;
  color: #ffffff;
}

.parallel-section-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  margin-bottom: 1.5rem;
}

.parallel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.parallel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.parallel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.parallel-col {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-top: 4px solid #266435;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.parallel-col-ficha {
  border-top-color: #266435;
}

.parallel-col-app {
  border-top-color: #e56619;
}

.parallel-col-audit {
  border-top-color: #2d8c56;
}

.parallel-col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.parallel-col-ficha .parallel-col-title {
  color: #266435;
}
[data-theme="dark"] .parallel-col-ficha .parallel-col-title {
  color: #93c5fd;
}

.parallel-col-app .parallel-col-title {
  color: #e56619;
}

.parallel-col-audit .parallel-col-title {
  color: #2d8c56;
}

.parallel-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.parallel-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

.parallel-metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.parallel-foot-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.4rem;
  margin-top: auto;
}

.parallel-bar-wrap {
  margin-top: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

.parallel-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.parallel-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  display: flex;
}

.parallel-bar-fill-ficha {
  background: #266435;
  height: 100%;
  transition: width 0.3s ease;
}

.parallel-bar-fill-app {
  background: #e56619;
  height: 100%;
  transition: width 0.3s ease;
}

.history-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.history-header-row .section-title {
  margin-bottom: 0;
}

.history-source-tabs {
  display: inline-flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  gap: 0.2rem;
}

.history-src-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-src-btn.active {
  background: #266435;
  color: #ffffff;
}

.history-src-btn[data-src="app"].active {
  background: #e56619;
  color: #ffffff;
}

/* ========================================================
   GUIA 2: DASHBOARD EXECUTIVO & INDICADORES (AUDITORIA)
   Visual idêntico à aba DASHBOARD da planilha Google Sheets
   ======================================================== */
.exec-dashboard-container {
  gap: 1.15rem;
}

.exec-hero-banner {
  background: linear-gradient(135deg, #266435 0%, #619D53 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.exec-hero-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(229, 102, 25, 0.95);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.exec-hero-left h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.exec-hero-left p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.88);
}

.exec-hero-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.exec-filter-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exec-filter-box label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.exec-filter-box select {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #e56619;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.exec-action-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-exec-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 0.52rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-exec-action:hover {
  background: #e56619;
  border-color: #e56619;
}

/* Sub-navegação de Seções */
.exec-section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: var(--bg-card);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.exec-pill {
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exec-pill:hover {
  border-color: #266435;
  color: var(--text-main);
}

.exec-pill.active {
  background: #266435;
  color: #ffffff;
  border-color: #266435;
}

/* KPIs Executivos Globais */
.exec-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.75rem;
}

.exec-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid #266435;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exec-kpi-card.kpi-orange { border-top-color: #e56619; }
.exec-kpi-card.kpi-green { border-top-color: #2d8c56; }
.exec-kpi-card.kpi-gold { border-top-color: #f2a50c; }
.exec-kpi-card.kpi-red { border-top-color: #c02626; }
.exec-kpi-card.kpi-sky { border-top-color: #1e99e0; }

.exec-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.exec-kpi-val {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-main);
}

.exec-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Barra de Legenda Oficial */
.exec-legend-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.76rem;
}

.legend-title {
  font-weight: 700;
  color: var(--text-main);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-item .dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

/* Blocos de Gráficos e Tabelas */
.exec-block {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.exec-block-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 5px solid #266435;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exec-block-header h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
}

.exec-block-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.exec-block-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-subtle);
  color: var(--primary);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.exec-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.exec-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exec-chart-wide,
.exec-chart-full {
  grid-column: span 2;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.chart-card-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-tag {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-main);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 290px;
}

.chart-canvas-tall {
  height: 340px;
}

/* Tabelas Auditáveis da Aba INDICADORES */
.audit-tables-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audit-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.audit-table-titlebar {
  background: #266435;
  color: #ffffff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.audit-table-titlebar h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

.audit-table-titlebar span {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.audit-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.audit-table th {
  background: #619D53;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.67rem;
  padding: 0.55rem 0.7rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.audit-table td {
  padding: 0.52rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
}

.audit-table tbody tr:hover {
  background: var(--primary-subtle);
}

.audit-table tr.audit-total-row td {
  background: rgba(26, 34, 125, 0.09);
  font-weight: 800;
  border-top: 2px solid #266435;
}

[data-theme="dark"] .audit-table tr.audit-total-row td {
  background: rgba(59, 130, 246, 0.18);
}

.placa-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 800;
  color: #266435;
  background: #e0e7ff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(26, 34, 125, 0.25);
  text-decoration: none;
  transition: all 0.15s ease;
}

.placa-link:hover {
  background: #266435;
  color: #ffffff;
}

.audit-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.audit-three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 980px) {
  .exec-charts-grid,
  .audit-two-col,
  .audit-three-col,
  .parallel-grid {
    grid-template-columns: 1fr;
  }
  .exec-chart-wide,
  .exec-chart-full {
    grid-column: span 1;
  }
}

/* Print Stylesheet for PDF */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .navbar, .controls-card, .sidebar-list, .footer, .action-buttons-bar, .login-overlay, .exec-section-pills, .exec-action-btns {
    display: none !important;
  }
  .detail-panel {
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    padding: 0 !important;
  }
}

/* ====================================================================
   CENTRAL MULTI-TIER, FILAS SLA, SCD & GOVERNANÇA POPs
   ==================================================================== */
.multitier-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.multitier-sla-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.multitier-sla-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.multitier-sla-card.tier1 { border-left: 5px solid #b91c1c; }
.multitier-sla-card.tier2 { border-left: 5px solid #f59e0b; }
.multitier-sla-card.tier3 { border-left: 5px solid #0284c7; }
.multitier-sla-card.tier4 { border-left: 5px solid #8b5cf6; }
.multitier-sla-card.total { border-left: 5px solid #266435; }

.msc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.msc-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.msc-scd {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

.msc-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.msc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.msc-footer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border);
  padding-top: 0.45rem;
}

/* Badges de Tiers & Camadas */
.badge-tier1 {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.badge-tier2 {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.badge-tier3 {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.badge-tier4 {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}
.badge-total {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-camada1 {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.badge-camada2 {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #a5b4fc;
}

/* SCD Score Pill */
.scd-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
}

.scd-score-pill.scd-tier1 {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.scd-score-pill.scd-tier2 {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.scd-score-pill.scd-tier3 {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #7dd3fc;
}
.scd-score-pill.scd-tier4 {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

/* SCD Queue Filter Buttons */
.scd-filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.scd-pill {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scd-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.scd-pill.active {
  background: #266435;
  color: #ffffff;
  border-color: #266435;
  box-shadow: 0 2px 4px rgba(26, 34, 125, 0.25);
}

/* Button Detail Link in Table Rows */
.btn-detail-link {
  background: #266435;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-detail-link:hover {
  background: #e56619;
  box-shadow: 0 2px 6px rgba(229, 102, 25, 0.35);
}

/* Multi-Tier Mini Pills in Vehicle Cards */
.multitier-mini-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.mt-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
}

.mt-pill.cam1 { background: #d1fae5; color: #065f46; }
.mt-pill.cam2 { background: #e0e7ff; color: #3730a3; }
.mt-pill.t1 { background: #fee2e2; color: #991b1b; }
.mt-pill.t2 { background: #fef3c7; color: #92400e; }
.mt-pill.t3 { background: #e0f2fe; color: #0369a1; }
.mt-pill.t4 { background: #f3e8ff; color: #6b21a8; }

/* POP Rules Cards Grid */
.pop-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.pop-rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pop-rule-card.pop-01 { border-top: 4px solid #b91c1c; }
.pop-rule-card.pop-02 { border-top: 4px solid #7c3aed; }
.pop-rule-card.pop-03 { border-top: 4px solid #059669; }

.pop-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.pop-rule-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.pop-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .multitier-sla-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .msc-scd {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .pop-rule-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .scd-pill {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .scd-pill.active {
  background: #619D53;
  border-color: #619D53;
  color: #ffffff;
}


