:root {
  --sidebar-background: #111419;
  --primary-color: #5932ea;
  --secondary-color: #1f246c;
  --danger-color: red;
  --danger-hover-color: #cc0000;
  --inactive-color: #868c98;
  --background-color: white;
  --border-color: #77777747;
  --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --transition: 0.3s ease;
  --color-primary: #5932ea;
  --color-secondary: #f3f1fe;
  --color-accent: #007bff;
  --color-text-default: #525866;
  --color-text-muted: #868c98;
  --color-background: white;
  --color-border: #e2e4e9;
  --color-hover-darken: #1f246c;
  --box-shadow-default: 0px 1px 2px 0px rgba(228, 229, 231, 0.24);
  --transition-default: all 0.3s ease-in-out;
  --border-radius-default: 4px;
  --font-size-small: 12px;
  --font-size-default: 14px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
}

.inter-400 {
  font-weight: 400;
  line-height: 20px;
}

.inter-500 {
  font-weight: 500;
  line-height: 20px;
}

.albert-500 {
  font-weight: 500;
  line-height: 120%;
}

.albert-700 {
  font-weight: 700;
  line-height: 120%;
}

.roboto-600 {
  font-weight: 600;
  line-height: 120%;
}

/* ASIDE */
#aside {
  position: relative;
  width: 232px;
  height: 100vh;
  background-color: var(--sidebar-background);
  transition: width var(--transition);
}

#toggle-aside {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 36px;
  position: absolute;
  top: 90%;
  left: 100%;
  transform: translate(-50%, -50%);
  width: 36px;
  border-radius: 8px;
  background-color: var(--color-background);
  cursor: pointer;
  z-index: 110;
  box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.13);
}

#aside.compact {
  width: 80px;
}

/* Logo Container */
#aside-logo-container {
  height: 81px;
  position: relative;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

#aside-logo-container .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 68px; /* Ajuste conforme necessário */
  transition: all 0.3s ease;
}

#aside-logo-container .icon svg {
  width: 100%;
  height: auto;
  transition: all 0.3s ease;
}

/* Logo para estado normal */
#aside-logo-container .icon {
  opacity: 1;
  transform: scale(1);
}

/* Visibilidade logo-full / logo-collapsed */
#aside .logo-collapsed { display: none; }
#aside.compact .logo-full { display: none; }
#aside.compact .logo-collapsed { display: flex; }

/* Logo para estado collapsed */
#aside.compact #aside-logo-container .icon {
}

/* Logo alternativa para estado collapsed */
#aside.compact #aside-logo-container::after {
  content: "";
  position: absolute;
  background-image: url("assets/svg/logo1.svg"); /* Caminho para logo compacta */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: all 0.3s ease;
}

#aside.compact #aside-logo-container::after {
  opacity: 1;
  transform: scale(1);
}

#aside-logo-container a {
  display: flex;
  align-items: center;
}

#aside-logo-container img {
  max-width: 100%;
  height: auto;
  transition: max-width var(--transition);
}

#aside.compact #aside-logo-container img {
  max-width: 50px;
}

#aside-logo-container .text {
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 18.75px;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition);
}

#aside.compact #aside-logo-container .text {
  opacity: 0;
  width: 0;
  margin-left: 0;
}

/* Navegação */
#aside nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

#aside nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 100vh;
}

#aside nav ul li {
  width: 100%;
}

#aside nav ul li a {
  display: flex;
  align-items: center;
  padding: 12px 28px;
  text-decoration: none;
  color: #868b96;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  height: 48px;
  transition: all var(--transition);
}

#aside nav ul li a:hover {
  background: rgba(22, 163, 74, 0.25);
}

#aside nav ul li a.active {
  background: rgba(22, 163, 74, 0.25);
  color: #22c55e;

  .text {
    color: #22c55e;
  }
}

#aside nav ul li a.active .icon img {
  filter: invert(1);
}

#aside nav ul li a .icon {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

#aside nav ul li a .icon img {
  width: 20px;
  height: 20px;
}

#aside nav ul li a .text {
  color: var(--inactive-color);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition);
}

/* Dropdown */
#aside nav ul > li.dropdown {
  position: relative;
}

#aside nav ul > li.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background-color: #f9f9f9;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  width: 304px;
  height: 320px;
  z-index: 1000;
}

#aside nav ul > li.dropdown .dropdown-menu li {
  width: 100%;
}

#aside nav ul > li.dropdown .dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 10px;
  text-decoration: none;
  color: #333;
}

#aside nav ul > li.dropdown .dropdown-menu a:hover {
  background-color: #f0f0f0;
}

/* Estado compacto */
#aside.compact nav ul > li > a .text {
  opacity: 0;
  width: 0;
  display: none;
}

#aside.compact nav ul > li > a .icon {
  margin-right: 0;
}

#aside nav ul li a {
  transition: all 0.3s ease;
}

#aside nav ul li a.active {
  background: rgba(22, 163, 74, 0.25);
  color: #22c55e;
}

#aside nav ul li:last-child a.active {
  .text {
    color: #e55148;
  }

  .icon img {
    filter: none;
  }
}

#aside nav ul li a.active .icon img {
  filter: invert(48%) sepia(64%) saturate(2232%) hue-rotate(125deg)
    brightness(100%) contrast(101%);
}

/* Logout */
#aside nav ul li:last-child a:hover {
  background: transparent;
}

#aside nav ul li:last-child:hover {
  background: rgba(22, 163, 74, 0.25);
}

#aside nav ul li:last-child a.active {
  background: transparent;
}

#aside nav ul li:last-child a {
  color: var(--background-color);
}

#aside nav ul li:last-child {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
  padding: 12px 0;
}

/* Estrutura Principal */
#sidebar {
  position: relative;
  width: 374px;
  background-color: transparent;
  transition: var(--transition-default);

  .sidebar-content {
    .color {
      background-color: white;
    }

    #sidebar-nav {
      display: flex;
      align-items: center;
      padding: 12px 16px 12px 16px;
      gap: 16px;

      #buttons {
        margin: 0;
        padding: 0;
        height: 40px;
        width: 286px;
        display: flex;
        list-style: none;
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        background-color: #f1f2f5;

        li {
          width: 135px;
          height: 32px;
          border-radius: 8px;
          padding: 6px 11px;
          display: flex;
          justify-content: center;
          align-items: center;

          a {
            color: #adb2bd;
            font-size: 14px;
            font-weight: 600;
            line-height: 20px;
            letter-spacing: -0.084px;
          }
        }

        li.active {
          background-color: white;

          a {
            color: #031207;
          }
        }
      }
    }

    #sidebar-alerts-container {
      display: flex;
      max-height: 40px;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid #dee1e6;
      background-color: white;
      align-items: center;
    }
  }
}

/* #sidebar.collapsed { transition: none; } — REMOVIDO.
   Estava bloqueando a transição de volta (width: 0 → 374px) ao expandir.
   Agora o #sidebar mantém transition: all 0.3s ease em ambos os estados. */

.left-content {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 999;
  height: 100vh;
  display: flex;
}

/* ===== CORREÇÃO: BOTTOMBAR COM PADDING DINÂMICO ===== */
#bottombar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  transition: padding-left 0.3s ease !important;
  z-index: 997 !important;
}

/* sidebar header */
#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0 16px;

  #sidebar-burger-menu {
    cursor: pointer;
  }

  #header-title {
    color: #031207;

    /* Title/H7 Title */
    font-size: 18px;
    font-weight: 700;
    line-height: 120%;
  }

  .device_add_btn button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: #16a34a;
  }
}

#sidebar-header {
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

#sidebar-header.collapsed {
  justify-content: center; /* Centraliza conteúdo quando colapsado */
  width: 60px; /* Mesma largura do sidebar colapsado */
}

#sidebar-header.collapsed h6 {
  display: none; /* Oculta o título */
}

#sidebar-header.collapsed .btn-group,
#sidebar-header.collapsed .btn {
  /* Ajusta botões para ficarem centralizados */
  margin: 0 auto;
}

/* Se tiver ícone de adicionar */
#sidebar-header.collapsed .btn-group .btn i,
#sidebar-header.collapsed .btn i {
  margin: 0; /* Remove margens */
}

#sidebar-indicators {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 16px 0 16px;
  box-sizing: border-box;
}

.indicator-block {
  width: 100%;
  background-color: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.indicator-content {
  display: flex;
  align-items: center;
  padding: 8px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #dee1e6;
  background: #fff;
}

.indicator-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.indicator-icon img {
  object-fit: contain;
}

.indicator-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.indicator-number {
  font-size: 14px;
  color: #031207;
}

.indicator-text {
  font-size: 11px;
  color: #868b96;
  letter-spacing: 0.22px;
}

/* Responsividade */
@media (max-width: 768px) {
  #sidebar-indicators {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MAPA — MOBILE: #aside + #sidebar (.left-content) off-canvas
   Aditivo: não remove nada do comportamento desktop existente,
   só entra em vigor em telas <= 768px. Escopado fora do admin
   (que reusa #aside com seu próprio tratamento mobile).
   ============================================================ */
#map-mobile-overlay {
  display: none;
}
@media (max-width: 768px) {
  body:not(.admin-layout) .left-content {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  body:not(.admin-layout) .left-content.mobile-open {
    transform: translateX(0);
  }
  body:not(.admin-layout) #aside,
  body:not(.admin-layout) #sidebar {
    height: 100vh !important;
  }
  /* #aside fica com largura fixa; #sidebar ocupa o resto da tela —
     evita o painel combinado (175+235=410px) ficar mais largo que
     o celular e cortar o conteúdo da lista de veículos. */
  body:not(.admin-layout) .left-content {
    width: 100vw;
    max-width: 100vw;
  }
  body:not(.admin-layout) #sidebar,
  body:not(.admin-layout) #sidebar:not(.collapsed) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-right: 0 !important;
    flex: 1 1 auto !important;
  }
  /* Some o botão de compactar (faz sentido só no desktop; no
     mobile o painel é tudo-ou-nada via hambúrguer) */
  body:not(.admin-layout) #toggle-aside {
    display: none !important;
  }
  #map-mobile-toggle {
    display: flex !important;
  }
  #map-mobile-overlay.show {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
  }
  body.map-mobile-menu-open {
    overflow: hidden;
  }

  /* #map-controls tem ~12 botões empilhados — em telas baixas isso
     ultrapassa a altura disponível e invade o painel de widgets
     (#bottombar) embaixo. Limita a altura e deixa rolar por dentro
     em vez de sobrepor o painel. */
  #map-controls {
    max-height: calc(100vh - 230px) !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #map-controls::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }

  /* #btn-sidebar-collapse é position:fixed, mas vive DENTRO do
     .left-content — que agora tem transform (translateX) no
     mobile. Isso faz o .left-content se tornar o container de
     referência do botão (regra do CSS), deixando sua posição/
     clique imprevisíveis. Fixa explicitamente e garante que
     fique sempre acima de tudo e clicável. */
  body:not(.admin-layout) #btn-sidebar-collapse {
    position: absolute !important;
    top: 22px !important;
    left: 185px !important;
    z-index: 1100 !important;
    pointer-events: auto !important;
  }
  body:not(.admin-layout):has(#aside.compact) #btn-sidebar-collapse {
    left: 56px !important;
  }

  /* Hambúrguer interno do cabeçalho "Meus dispositivos" — some no
     mobile, fica redundante com o hambúrguer externo que já abre/
     fecha o painel todo. */
  body:not(.admin-layout) #sidebar-header > a:first-child {
    display: none !important;
  }
}

/* Botão hambúrguer flutuante — abre/fecha o #aside+#sidebar no
   mobile (mesmo botão, mesmo lugar, alterna o estado).
   Escondido por padrão (desktop); a media query acima reativa
   com display:flex em telas <= 768px. */
#map-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1060;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 1px solid #e2e4e9;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  color: #525866;
  cursor: pointer;
}
#map-mobile-toggle .icon {
  width: 20px;
  height: 20px;
  display: flex;
}
#map-mobile-toggle .icon svg {
  width: 100%;
  height: 100%;
}

/* Navbar Tabs */
.nav-tabs {
  border-bottom: 1px solid transparent;
}

.nav-tabs > li {
  float: left;
  margin-bottom: -1px;
}

.nav-tabs > li > a {
  margin-right: 2px;
  line-height: 1.42857;
  border: 1px solid transparent;
  border-radius: 0;
}

.nav-tabs > li > a:hover {
  border-color: var(--color-background) var(--color-background) transparent;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
  color: #031207;
  background-color: white;
  cursor: default;
  width: 137px;
  height: 32px;
}

/* Navegação Padrão */
.nav-default {
  font-size: var(--font-size-small);
  line-height: 20px;
  font-weight: 600;
  background-color: #f9f9f9;
}

.nav-default > li > a {
  border-color: transparent;
  border-radius: 0;
}

.nav-default > li.complete > a,
.nav-default > li.complete > a:focus,
.nav-default > li.complete > a:hover {
  color: #202020;
  background-color: var(--color-background);
  cursor: default;
}

/* Tab Content */
.sidebar-content .tab-content {
  transition: var(--transition-default);
}

/* Tab Panes — Garante que as abas funcionam corretamente */
.sidebar-content .tab-pane {
  display: none !important;
  width: 100%;
  overflow: visible !important;
}

.sidebar-content .tab-pane.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Tab pane content — garante visibilidade do conteúdo */
.sidebar-content .tab-pane-header,
.sidebar-content .tab-pane-body {
  display: block !important;
  width: 100%;
}

/* Search Container */
#search-container .form-control {
  padding-left: 40px;
  padding-right: 15px;
  font-size: 14px; /* Tamanho da fonte */
  color: #031207; /* Cor do texto */
  background-color: white;
  font-weight: 500; /* Peso da fonte */
  border: 1px solid #dee1e6; /* Borda do input */
  border-radius: 8px; /* Cantos arredondados */
  transition: all 0.3s ease; /* Transição suave */
}

#search-container .form-control::placeholder {
  color: #868b96; /* Cor do placeholder */
  opacity: 0.7; /* Opacidade do placeholder */
}

#search-container .form-control:focus {
  outline: none;
  border-color: #16a34a; /* Cor da borda no foco */
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.2); /* Sombra no foco */
}

#search-container {
  position: relative;
}

#search-container span {
  position: absolute;
  left: 10px; /* Ajuste conforme necessário */
  top: 50%;
  transform: translateY(30%);
  z-index: 10;
  pointer-events: none; /* Permite clicar através do ícone */
}

#search-icon {
  width: 20px;
  height: 20px;
  color: #adb2bd;
}

/* Vehicle List */
#aside-vehicle-list {
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-default);
  background-color: var(--color-background);
  transition: var(--transition-default);
}

#aside-vehicle-list .text {
  color: var(--color-text-default);
  text-align: center;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  letter-spacing: -0.072px;
}

#aside-vehicle-list .icon {
  display: inline-flex;
  align-items: center;
  width: 20px;
  height: 20px;
}

#aside-vehicle-list .icon svg {
  fill: var(--color-text-default);
  width: 100%;
  height: 100%;
}

#aside-vehicle-list:hover {
  background-color: darken(var(--color-accent), 10%);
}

#aside-vehicle-list:focus {
  background-color: darken(var(--color-accent), 15%);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

#vehicle-list {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(5px);
  height: 800.406px;
  padding: 16px 16px 20px 16px;
}

#history-list {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(5px);
  height: 800.406px;
  padding: 16px 16px 20px 16px;
}

#sidebar-header,
#sidebar-indicators,
#sidebar-nav,
.tab-content .tab-pane-header {
  background-color: white;
}

/* Sidebar Collapse Button */
#btn-sidebar-collapse {
  display: none;
  height: 36px;
  width: 36px;
  border-radius: 8px;
  background-color: var(--color-background);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  margin: 16px 16px 0 0;
  z-index: 99;
}

/* Btn-sidebar-collapse é IRMÃO de #sidebar (não filho), usa sibling selector.
   A regra principal de visibilidade está em toggle-buttons-fix.css.
   Aqui forçamos para garantir que aparece quando colapsado. */
#sidebar.collapsed ~ #btn-sidebar-collapse {
  display: flex !important;
}

/* Widgets — bloco CUSTOM removido para preservar layout HORIZONTAL nativo.
   Backup completo em light-indigo.css.bak */

/*  */
#map-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: blur(10px) !important;
}

.map-control-group {
  display: flex;
  flex-direction: column;
}

.map-control-group .btn-group-vertical {
  display: grid;
  gap: 6px;
}

#map-controls .map-control-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
  border: 1px solid #e2e4e9 !important;
  border-radius: 8px !important;
  color: #525866 !important;
  font-size: 1.1em !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

#map-controls .map-control-btn:hover {
  background: linear-gradient(135deg, #1b99bd 0%, #25b5d1 100%) !important;
  color: white !important;
  border-color: #1b99bd !important;
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(27, 153, 189, 0.25) !important;
}

#map-controls .map-control-btn:active {
  transform: translateY(0) scale(0.98) !important;
}

#map-controls .map-control-btn.active {
  background: linear-gradient(135deg, #1b99bd 0%, #25b5d1 100%) !important;
  color: white !important;
  border-color: #1b99bd !important;
  box-shadow: 0 4px 12px rgba(27, 153, 189, 0.3) !important;
}

#map-controls #zoom-control {
  & > button:nth-child(1) {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  & > button:nth-child(2) {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
  }
}

#map-controls-layers .map-control-btn i {
  font-size: 1.2em !important;
}

/* Tooltip customization */
#map-controls .btn {
  position: relative;
}

/* Dark theme support */
#map-controls .map-control-btn i {
  transition: color 0.25s ease !important;
}

/* ============================================================
   LEAFLET CONTROL LAYERS - Modern Styling
   ============================================================ */

.leaflet-control-layers {
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  background: white !important;
}

.leaflet-control-layers-list {
  padding: 0 !important;
}

.leaflet-control-layers-base,
.leaflet-control-layers-overlays {
  padding: 8px !important;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  display: flex !important;
  align-items: center !important;
  padding: 8px 6px !important;
  margin: 2px 0 !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.leaflet-control-layers-base label:hover,
.leaflet-control-layers-overlays label:hover {
  background: rgba(27, 153, 189, 0.05) !important;
}

.leaflet-control-layers-base label > div,
.leaflet-control-layers-overlays label > div {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  gap: 8px !important;
}


.leaflet-control-layers-base label span,
.leaflet-control-layers-overlays label span {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #525866 !important;
}

.leaflet-control-layers-separator {
  border-top: 1px solid #e2e4e9 !important;
  margin: 6px 0 !important;
}

.device-card {
  background-color: white;
  border: 1px solid #dee1e6;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.device-location {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--neutral-300, #dee1e6);
  border-bottom: 1px solid var(--neutral-300, #dee1e6);

  .location-text {
    display: flex;
    flex-direction: column;
    gap: 2px;

    p,
    span {
      margin: 0;
      padding: 0;
    }

    P {
      color: var(--text-main-900, #0a0d14);
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.12px;
    }

    span {
      color: var(--text-soft-400, #868c98);
      font-size: 12px;
      font-weight: 400;
      line-height: 120%; /* 14.4px */
      letter-spacing: 0.12px;
    }
  }
}

.device-footer {
  display: flex;
  gap: 16px;
  margin-top: 16px;

  a {
    width: 32px;
    height: 32px;
    display: flex;
    border-radius: 999px;
    border: 1px solid var(--stroke-soft-200, #e2e4e9);
    background: var(--bg-white-0, #fff);
    box-shadow: 0px 1px 2px 0px rgba(82, 88, 102, 0.06);
    padding: 6px;
    justify-content: center;
    align-items: center;
  }
}

.plate {
  font-weight: bold;
  font-size: 1.2em;
}

.tracking-code {
  color: #6c757d;
}

.header-actions .btn {
  margin-left: 10px;
}

.device-info {
  padding: 15px;
}

.connection-details,
.location-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.movement-status {
  color: green;
}

.card-container.device-list-item {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  transition: all 0.3s ease;

  &:hover {
    border: 2px solid #16a34a;
  }
}

.card-container.device-list-item .card-content {
  padding: 24px;
}

.card-container.device-list-item .first-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-container.device-list-item .first-text {
  display: flex;
  flex-direction: column;
}

.card-container.device-list-item .first-text span {
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
}

#plate-text {
  color: #adb2bd;

  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 120%;
}

#name-text {
  color: #111419;

  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 120%;
}

#connection-text {
  color: #494e57;
  font-size: 12px;
  font-weight: 500;
  line-height: 120%;
}

.card-container.device-list-item .first-text span[data-device="name"] {
  font-weight: bold;
  color: #2c3e50;
}

.card-container.device-list-item .first-icon {
  display: flex;
  gap: 8px;

  .icon {
    width: 28px;
    height: 28px;
    padding: 4px;
    border: 1px solid #dee1e6;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.card-container.device-list-item .btn {
  background-color: #3498db;
  border: none;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.card-container.device-list-item .btn:hover {
  background-color: #2980b9;
}

.card-container.device-list-item .icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: cover;
  background-position: center;
}

.card-container.device-list-item .map-change {
  background-image: url("path/to/map-icon.png");
}

.card-container.device-list-item .second-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e9ebef;
  justify-content: space-between;

  .speed-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
}

#km-number-text {
  color: #031207;

  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 120%;

  span {
    color: #868b96;
    text-align: center;

    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
  }
}

.card-container.device-list-item .second-row span:last-of-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
}

.card-container.device-list-item .last-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  .icon {
    width: 32px;
    height: 32px;
  }
}

.address-column {
  display: flex;
  flex-direction: column;

  #first-address {
    color: #031207;

    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: 120%;
  }

  #last-address {
    color: #868b96;

    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px; /* 133.333% */
  }
}

.card-container.device-list-item .last-row span {
  color: #666;
  font-size: 13px;
}

.card-container.device-list-item .first-text span:contains("[") {
  color: #888;
  font-style: italic;
}

.card-container.device-list-item [data-device="detect_engine"] {
  color: white;
}

.card-container.device-list-item [data-device="detect_engine"].on {
  background-color: #16a34a;
}

.card-container.device-list-item [data-device="detect_engine"].off {
  background-color: #df1c41;
}

.card-container.device-list-item [data-device="status"] {
  font-weight: bold;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
}

/* widgets — display:grid removido para preservar layout HORIZONTAL nativo */

/* ============================================================
   BLOCO DE WIDGETS CUSTOM (que interferiam) — REMOVIDO.
   Backup completo em style_mapa.css.before-cleanup
   ============================================================ */

/* SENSORES — agora usa o JS NATIVO que gera <table>, então não precisa
   de CSS custom para .sensors-grid / .sensor-block. */

/* rework left-cntent */
#sidebar {
  margin-right: 16px;
  transition: width 0.3s ease-in-out;
}

#sidebar.collapsed {
  padding: 0;
}

#sidebar-header {
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out,
    width 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}

#sidebar:not(.collapsed) #sidebar-header {
  opacity: 1;
  visibility: visible;
}

#sidebar.collapsed #sidebar-header {
  width: 60px; /* Largura compacta */
  justify-content: center;
}

#sidebar.collapsed #sidebar-header .header-content {
  display: none; /* Oculta conteúdo adicional quando compactado */
}

/* #widgets .btn-widgets-collapse, #widgets.collapsed, #widgets.expanded —
   regras CUSTOM removidas que interferiam no layout horizontal nativo do bottombar */

#sidebar-header.hidden {
  display: none;
}

#sidebar.collapsed #sidebar-header {
  display: none;
}

#sidebar:not(.collapsed) #sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#sidebar {
  /* Transição explícita (não usa 'all' pra evitar conflito com fadeIn/Out)
     Sincronizada com #aside (0.3s ease) e #bottombar (transition padding 0.3s ease) */
  transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease !important;
  z-index: 100;
}

#sidebar.collapsed {
  width: 0px !important; /* ou a largura mínima desejada */
  opacity: 0;
}

#sidebar:not(.collapsed) {
  width: 374px; /* ou a largura máxima desejada */
}

#sidebar .sidebar-content {
  display: none; /* Inicialmente escondido */
  overflow: visible;
}

#sidebar:not(.collapsed) .sidebar-content {
  display: block; /* Visível apenas quando não está colapsado */
}

#street-view-icon {
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 1px solid #dee1e6;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* history tab */
.tab-pane-header {
  padding: 0 16px 16px 16px;
}

.header-container {
  display: flex;
  flex-direction: column;
  gap: 12px;

  button {
    height: 44px;
  }

  .second-row .dropdown.open .dropdown-menu {
    height: auto;

    a {
      color: #111419;
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
    }
  }
}

.first-row {
  width: 100%;
  overflow: visible;
  position: relative;
}

.first-row .device-selector {
  min-width: 0;
}

.first-row .bootstrap-select .dropdown-menu {
  max-width: 100%;
  width: 100%;
  left: 0 !important;
  right: 0 !important;
  margin-right: 0;
  overflow-x: hidden;
}

.second-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.device-selector {
  width: 100%;
}

.period-selector .input-group {
  width: 100%;
}

.period-selector .form-control {
  width: 100%;
}

.period-selector {
  width: 100%;
}

/* Fix para timeselect: neutraliza position:absolute do modal-selects-fix.css */
.timeselect > .btn.dropdown-toggle input.bs-input.form-control,
.timeselect .btn .bs-input {
  position: static !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: #333 !important;
  outline: none !important;
  pointer-events: none !important;
  vertical-align: middle !important;
}

.timeselect {
  color: #031207 !important;
  background-color: white !important;
  opacity: 1 !important;
}

.timeselect option {
  color: #031207 !important;
}

.input-group-btn .timeselect {
  color: #031207 !important;
}

.order-btn,
.actions-btn {
  button {
    max-height: 44px;
    display: flex;
    padding: 12px;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    border: 1px solid #e2e4e9;
    background: #fff;
  }
}

.third-row {
  width: 100%;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Estilização dos dropdowns */
.dropdown-menu {
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee1e6;
  border-radius: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  color: #333;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
  color: #000;
}

.dropdown-item i,
.dropdown-item .icon {
  margin-right: 10px;
  opacity: 0.7;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: 1px solid #dee1e6;
  color: #666;
}

.dropdown-toggle:hover {
  background-color: #f5f5f5;
  color: #333;
}

.dropdown-toggle i,
.dropdown-toggle .icon {
  opacity: 0.7;
}

.btn-outline-secondary {
  background-color: transparent;
  border-color: #dee1e6;
  color: #666;
}

.btn-outline-secondary:hover {
  background-color: #f5f5f5;
  border-color: #d0d0d0;
  color: #333;
}

/* Dropdown divider */
.dropdown-divider {
  border-top: 1px solid #dee1e6;
  margin: 8px 0;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropdown-toggle .placeholder {
  margin-left: 5px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item i {
  opacity: 0.7;
  margin-right: 8px;
}

/* Alerts */
/* Estilo geral para o container dos cards */
.alert-cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px; /* Espaçamento entre os cards */
  padding: 15px;
}

/* Estilo para cada card de alerta */
.alert-card {
  background-color: #fff; /* Cor de fundo do card */
  border: 1px solid #ddd; /* Borda do card */
  border-radius: 8px; /* Bordas arredondadas */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra do card */
  width: calc(33.333% - 15px); /* Largura do card (3 por linha) */
  min-width: 250px; /* Largura mínima do card */
  overflow: hidden; /* Para evitar overflow */
  transition: transform 0.2s; /* Efeito de transição */
}

/* Efeito de hover no card */
.alert-card:hover {
  transform: translateY(-5px); /* Eleva o card ao passar o mouse */
}

/* Estilo para o cabeçalho do card */
.card-header {
  display: flex;
  justify-content: space-between; /* Espaço entre data e menu */
  align-items: center; /* Alinha verticalmente */
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd; /* Borda inferior */

  .card-header-actions i {
    display: flex;
    padding: 4px;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-radius: 8px;
    border: 1px solid var(--neutral-300, #dee1e6);
    background: var(--neutral-White, #fff);
  }
}

/* Estilo para a data e horário */
.alert-date {
  font-weight: bold; /* Negrito */
  color: #333; /* Cor do texto */
}

/* Estilo para a mensagem do alerta */
.alert-message {
  margin: 0; /* Remove margens */
  color: #555; /* Cor do texto */
}

/* Estilo para o rodapé do card */
.card-footer {
  display: flex; /* Flexbox para alinhar ícone e texto */
  align-items: center; /* Alinha verticalmente */
  border-top: 1px solid #ddd; /* Borda superior */
  padding-top: 16px;
}

/* Estilo para o ícone de localização */
.icon-location {
  margin-right: 8px; /* Espaçamento à direita do ícone */
  color: #007bff; /* Cor do ícone */
}

/* Responsividade */
@media (max-width: 768px) {
  .alert-card {
    width: calc(50% - 15px); /* 2 por linha em telas menores */
  }
}

@media (max-width: 480px) {
  .alert-card {
    width: 100%; /* 1 por linha em telas muito pequenas */
  }
}

/* .copy-btn removido — era de widget custom */

.dropdown-menu.open {
  ul {
    margin-top: 12px;
  }
}

#events_tab {
  #first-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #e9ebef;

    span {
      color: #031207;
      font-size: 18px;
      font-weight: 700;
      line-height: 120%;
    }

    button {
      width: 25px;
      height: 25px;
      display: flex;
      padding: 2px;
      justify-content: center;
      align-items: center;
      gap: 2px;
      border-radius: 999px;
      border: 1px solid #dee1e6;
      background: var(--neutral-White, #fff);

      span {
        font-size: 13px;
      }
    }
  }

  #second-row {
    display: flex;
    padding-top: 16px;
    gap: 8px;
    align-items: center;

    .device_add_btn button {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 6px;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: 1px solid transparent;
      background-color: #16a34a;
    }

    input {
      max-height: 36px;
      padding-left: 15px;
    }

    input:focus {
      outline: none;
      border-color: #16a34a;
      box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
    }
  }

  #content-row {
    table {
      padding: 16px 16px 20px 16px;
      border-collapse: separate;
      background: rgba(241, 242, 245, 0.88);
      backdrop-filter: blur(5px);
    }

    .tab-pane-body {
      background-color: #f4f4f4; /* Cor de fundo da área de conteúdo */
      border-radius: 8px; /* Bordas arredondadas */
    }

    .events-cards-container {
      display: flex;
      flex-direction: column;
      gap: 15px; /* Espaçamento entre os cartões */
    }

    .event-card {
      background-color: #ffffff; /* Cor de fundo do cartão */
      border: 1px solid #dcdcdc; /* Borda do cartão */
      border-radius: 8px; /* Bordas arredondadas */
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra do cartão */
      transition: transform 0.2s; /* Transição suave ao passar o mouse */
      cursor: pointer; /* Cursor de ponteiro ao passar o mouse */
      padding: 24px;
    }

    .event-card:hover {
      transform: translateY(-2px); /* Efeito de elevação ao passar o mouse */
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      border-bottom: 1px solid #e0e0e0; /* Borda inferior do cabeçalho */
      border-top-left-radius: 8px; /* Bordas arredondadas no topo esquerdo */
      border-top-right-radius: 8px; /* Bordas arredondadas no topo direito */
    }

    .card-header-info {
      display: flex;
      flex-direction: column;
      gap: 5px;

      div span {
        color: #494e57;
        font-size: 12px;
        font-weight: 700;
        line-height: 120%;
      }

      span {
        color: #111419;
        font-size: 16px;
        font-weight: 700;
        line-height: 120%;
      }
    }

    .time,
    .date,
    .vehicle {
      font-size: 14px; /* Tamanho da fonte para data e hora */
      color: #555; /* Cor do texto */
    }

    .vehicle {
      font-weight: bold; /* Negrito para o nome do veículo */
      color: #333; /* Cor do texto */
    }

    .card-header-actions {
      display: flex;
      align-items: center;

      i {
        font-size: 14px;
        color: #031207;
        background-color: white;
        font-weight: 500;
        border: 1px solid #dee1e6;
        border-radius: 8px;
        transition: all 0.3s ease;
        max-height: 20px;
        max-width: 20px;
        padding: 12px;
      }
    }

    .btn-group {
      position: relative; /* Para posicionar o dropdown */
    }

    .card-content {
      display: flex;
      align-items: center;
      padding: 12px;
      margin: 16px 0;
      align-items: center;
      gap: 12px;
      align-self: stretch;
      border-radius: 8px;
      background: #fef7ec;

      .alert-toast span {
        color: #b47818
        font-size: 14px;
        font-style: normal;
        font-weight: 500;
        line-height: 120%; /* 16.8px */
      }
    }

    .card-footer {
      border-top: 1px solid #e0e0e0; /* Borda superior do rodapé */
      display: flex;
      align-items: center;
      border-bottom-left-radius: 8px; /* Bordas arredondadas no fundo esquerdo */
      border-bottom-right-radius: 8px; /* Bordas arredondadas no fundo direito */
    }

    .location-info {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .icon.location {
      margin-right: 8px; /* Espaçamento entre o ícone e o texto */
      color: #666; /* Cor do ícone */
    }

    .location-details {
      color: #868b96;
      font-size: 14px;
      font-weight: 500;
      line-height: 120%;
    }
  }
}

.header-container {
  .second-row .dopdown-menu {
  }
}

/* VEICULOS */
.admin-layout > .content {
  min-height: 0;
  margin-top: 0;
  margin-bottom: -0;
  padding-top: 0;
  background-color: #f9f9fb;

  .container-fluid {
    padding-left: 0;
    padding-right: 0;

    .panel,
    .plan {
      margin-bottom: 0;
      border: none;
      border-radius: 0;
      -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0.05);
      box-shadow: 0 0 0 rgba(0, 0, 0, 0.05);
    }
  }
}

#header {
  display: flex;
  padding: 12px 32px 12px 296px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #dee1e6;
  background: #fff;
  justify-content: space-between;

  p {
    color: #031207;
    font-size: 20px;
    font-weight: 700;
    line-height: 120%;
    margin: 0;
  }

  #user-row {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  #user-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  #user-info {
    p {
      color: #111419;
      font-size: 14px;
      font-weight: 500;
      line-height: 20px; /* 142.857% */
      letter-spacing: -0.084px;
    }

    span {
      overflow: hidden;
      color: #494e57;
      text-overflow: ellipsis;
      font-size: 12px;
      font-weight: 400;
      line-height: 16px;
    }
  }
}

.admin-layout {
  overflow-y: hidden;
  #admin-content {
    overflow-y: auto; /* Permite o scroll vertical */
    height: calc(100vh - 64px);
    padding: 32px 32px 32px 264px;
    overscroll-behavior: contain;
    padding-bottom: 42px;
    background-color: #fff !important;
    scroll-behavior: smooth; /* Suaviza o scroll */
  }

  /* Esconde a barra de rolagem no Chrome, Edge e Safari */
  #admin-content::-webkit-scrollbar {
    display: none;
  }

  /* Esconde a barra de rolagem no Firefox */
  #admin-content {
    scrollbar-width: none;
  }

  .panel-heading {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #dee1e6;
    background: #fff;

    #widgets-list {
      ul {
        margin: 0 0 16px 0;
        padding: 0;
        list-style: none;
        display: flex;
        gap: 16px;

        li {
          width: -webkit-fill-available;
        }
      }
    }
    #controls-list {
      display: flex;
      gap: 16px;
      align-items: center;

      .panel-form,
      .search,
      #input-search {
        display: flex;
        flex-grow: 1;
      }

      .order-dropdown button {
        display: flex;
        width: 177px;
        padding: 10px 10px 10px 10px;
        align-items: center;
        gap: 8px;
        border-radius: 6px;
        border: 1px solid #e2e4e9;
        background: #fff;
        box-shadow: 0px 1px 2px 0px rgba(228, 229, 231, 0.24);
        height: 44px;

        p {
          color: #0a0d14;
          text-overflow: ellipsis;
          font-size: 14px;

          font-weight: 400;
          line-height: 20px;
          letter-spacing: -0.084px;

          margin: 0;
        }
      }

      .heading-btn {
        display: flex;
        padding: 10px;
        justify-content: center;
        align-items: center;
        gap: 2px;

        span {
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }

      .border {
        border-radius: 8px;
        border: 1px solid #e2e4e9;
      }

      .green-heading-btn {
        display: flex;
        padding: 10px;
        justify-content: center;
        align-items: center;
        gap: 4px;
        border: none;
        border-radius: 8px;
        background: #16a34a;
        height: 44px;
        box-shadow: 0px 1px 2px 0px rgba(55, 93, 251, 0.08);

        p {
          color: #fff;
          text-align: center;
          font-size: 14px;
          font-weight: 500;
          line-height: 120%;
        }
      }
    }

    #controls {
      display: flex;
      padding: 0px 16px;
      justify-content: center;
      align-items: center;
      gap: 16px;
      border-right: 1px solid #e2e4e9;
      border-left: 1px solid #e2e4e9;

      #select-view {
        display: flex;
        gap: 16px;
      }
    }

    .widget-item {
      display: flex;
      padding: 16px;
      align-items: center;
      gap: 16px;
      border-radius: 8px;
      border: 1px solid #dee1e6;
      background: #fff;
      min-height: 80px;

      span {
      }

      .widget-text {
        display: flex;
        flex-direction: column;
        gap: 2px;

        p {
          color: #031207;
          text-align: left;
          font-size: 20px;
          font-weight: 700;
          line-height: 1.2;
          margin: 0;
        }

        span {
          color: #666771;
          text-align: left;
          font-size: 14px;
          font-weight: 400;
          line-height: 1.2;
        }
      }

      @media (max-width: 1299px) {
        padding: 10px 12px;
        gap: 10px;
        min-height: 70px;

        .icon {
          flex-shrink: 0;
          min-width: 28px;
          width: 28px;
          height: 28px;

          svg {
            width: 28px;
            height: 28px;
          }
        }

        .widget-text {
          gap: 1px;

          p {
            font-size: 15px;
            line-height: 1.1;
          }

          span {
            font-size: 11px;
            line-height: 1.1;
            max-width: 85px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }

      @media (max-width: 992px) {
        padding: 8px 10px;
        gap: 8px;
        min-height: 65px;

        .icon {
          flex-shrink: 0;
          min-width: 24px;
          width: 24px;
          height: 24px;

          svg {
            width: 24px;
            height: 24px;
          }
        }

        .widget-text {
          gap: 0;

          p {
            font-size: 13px;
            line-height: 1.1;
          }

          span {
            font-size: 10px;
            line-height: 1.1;
            max-width: 75px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }

      @media (max-width: 768px) {
        padding: 8px;
        gap: 6px;
        min-height: 60px;

        .icon {
          flex-shrink: 0;
          min-width: 22px;
          width: 22px;
          height: 22px;

          svg {
            width: 22px;
            height: 22px;
          }
        }

        .widget-text {
          gap: 0;

          p {
            font-size: 12px;
            line-height: 1;
          }

          span {
            font-size: 9px;
            line-height: 1;
            max-width: 70px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }
    }
  }

  .panel-body {
    margin-top: 16px;

    .table-responsive {
      border-radius: 12px;
      overflow-x: hidden;
      scroll-behavior: smooth; /* Suaviza o scroll */
    }

    .table-responsive::-webkit-scrollbar {
      display: none;
    }

    .nav-pagination {
      margin-top: 16px;
    }

    thead tr th {
      color: #0a0d14;
      font-size: 12px;
      font-weight: 700;
      line-height: 120%;
      text-transform: uppercase;
      padding: 16px 24px;
    }

    tbody tr:not(:last-child) {
      border-bottom: 1px solid #e0e0e0; /* Cor e espessura da borda personalizáveis */
    }
  }
}

input[type="checkbox"] {
  /* Esconde o checkbox original */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Dimensões do checkbox customizado */
  width: 18px;
  height: 18px;

  /* Espaçamento */
  margin: 0;

  /* Estilo da borda */
  border: 2px solid #a0a0a0;
  border-radius: 4px;

  /* Transição suave */
  transition: all 0.2s ease;

  /* Cursor */
  cursor: pointer;

  /* Posicionamento */
  vertical-align: middle;

  /* Efeito de fundo quando selecionado */
  &:checked {
    background-color: #007bff; /* Cor de fundo quando selecionado */
    border-color: #007bff;

    /* Ícone de check */
    &::after {
      content: "✔";
      display: block;
      color: white;
      text-align: center;
      font-size: 12px;
      line-height: 18px;
    }
  }

  /* Estado de hover */
  &:hover {
    border-color: #007bff;
  }

  /* Foco */
  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
  }
}

#device-data {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 24px;
}

#device-data .device-plate {
  margin-bottom: 2px;
}

/* Estilos base para parágrafos */
#device-data .device-name,
#device-data .device-plate,
#device-data .device-connection {
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

#device-data .device-name {
  overflow: hidden;
  color: #0a0d14;
  font-size: 16px;
  font-weight: 700;
  line-height: 120%;
}

#device-data .device-plate,
#device-data .device-connection {
  color: #494e57;
  font-size: 12px;
  font-weight: 400;
  line-height: 120%;
  letter-spacing: 0.12px;

  span {
    margin-left: 3px;
  }
}

/* Estilos para valores destacados */
#device-data .device-plate-value,
#device-data .device-connection-value {
  color: #111419;
  font-size: 12px;
  font-weight: 600;
  line-height: 120%;
  letter-spacing: 0.12px;
  margin: 0;
  padding: 0;
}

/* Opcional: Reset global para parágrafos */
#device-data p {
  margin: 0;
  padding: 0;
}

.device-grid {
  display: flex;
  flex-wrap: wrap;
  margin: -10px; /* Compensa o padding interno */
}

.device-grid-item {
  padding: 10px;
  width: 100%;
}

/* Mobile (padrão) - 1 coluna */
.device-grid-item {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Tablet - 2 colunas */
@media (min-width: 576px) {
  .device-grid-item {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Desktop - 5 colunas */
@media (min-width: 992px) {
  .device-grid-item {
    flex: 0 0 calc(100% / 5);
    max-width: calc(100% / 5);
  }
}

.device-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;

  &:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  h3 {
    margin: 0;
    font-size: 1.2rem;
    flex-grow: 1;
  }
}

.device-status {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-left: 10px;
}

.device-details {
  flex-grow: 1;

  p {
    margin: 5px 0;
  }

  .icon_imei,
  .icon_sim {
    margin-right: 6px;
  }
}

.device-additional-details {
  p {
    display: flex;
    align-items: center;
  }
}

.device-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* Ajustes para dispositivos menores */
@media (max-width: 576px) {
  .device-header h3 {
    font-size: 1rem;
  }

  .device-details p {
    font-size: 0.8rem;
  }
}

/* GRID */
#device-data.grid {
  padding: 0;
}

.device-header-container,
.device-header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;

  div {
    text-align: end;

    p {
      margin: 0;
      padding: 0;
    }
  }
}

.device-grid {
  .device-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;

    #device-data {
      display: grid;
      grid-template-columns: 1fr;
      width: 100%;
      overflow: hidden;

      .device-plate,
      .device-name,
      .device-connection {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        width: 100%;
      }

      .device-plate {
        color: #adb2bd;
        font: 500 12px "Albert Sans";
        text-transform: uppercase;

        span {
          color: inherit;
        }
      }

      .device-name {
        color: #0a0d14;
        font: 700 16px "Albert Sans";
        line-height: 120%;
      }

      p:nth-child(3) {
        color: var(--neutral-700, #494e57);
        font: 400 12px Inter;
        line-height: 120%;
        letter-spacing: 0.12px;

        span {
          color: inherit; // Usa a cor do pai
        }
      }
    }

    .device-header-container {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
    }
  }

  .device-row {
    padding-bottom: 16px;

    .label {
      color: var(--neutral-White, #fff);
      font: 500 12px Inter;
      line-height: 120%;
      letter-spacing: 0.24px;
    }

    div {
      p {
        color: #202020;
        text-align: right;
        font: 700 16px "Albert Sans";
        line-height: 120%;
      }

      span {
        color: #6b7280;
        text-align: right;
        font: 500 10px Inter;
        line-height: 13.5px;
      }
    }
  }

  .device-details {
    padding: 12px;
    border-radius: 8px;
    background: var(--neutral-0, #f3f4f6);
    margin-bottom: 16px;

    .device-additional-details {
      display: flex;
      flex-direction: column;
      gap: 8px;

      .detail-item {
        display: flex;
        justify-content: space-between;
        align-items: center;

        &:nth-child(2) {
          border-bottom: 1px solid var(--neutral-300, #dee1e6);
          padding-bottom: 8px;
        }

        &:last-child {
          border-bottom: none;
          padding-bottom: 0;

          p {
            color: #525866;
            font: 400 12px "Albert Sans";
            line-height: 120%;
          }

          span {
            color: #494e57;
            font: 500 12px "Albert Sans";
            letter-spacing: 0.12px;
            height: 42.14px;
            display: flex;
            align-items: flex-start;
            text-align: start;
          }
        }
      }
    }

    .flex {
      display: flex;
      align-items: center;

      p {
        color: var(--text-sub-500, #525866);
        font: 400 12px "Albert Sans";
        line-height: 120%;
      }

      span {
        font-size: 16px;
        color: #666;
      }
    }

    .detail-item > span {
      overflow: hidden;
      color: var(--text-main-900, #0a0d14);
      text-align: center;
      text-overflow: ellipsis;
      font: 600 12px "Albert Sans";
      line-height: 120%;
    }
  }
}

#user-data {
  display: flex;
  align-items: center;
  gap: 16px;

  #user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    p:first-child {
      color: var(--text-main-900, #0a0d14);
      text-overflow: ellipsis;
      font-size: 16px;
      font-weight: 700;
      line-height: 120%;
      margin: 0 0 6px 0;
    }

    #cpf {
      margin-bottom: 6px;
    }

    div {
      display: flex;
      gap: 6px;
      align-items: flex-start;
      height: auto;
      flex-wrap: wrap;

      span {
        color: var(--neutral-700, #494e57);
        font-size: 12px;
        font-weight: 400;
        line-height: 1.4;
        letter-spacing: 0.12px;
        margin: 0;
      }

      p {
        color: var(--neutral-900, #111419);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.4;
        letter-spacing: 0.12px;
        margin: 0;
      }
    }
  }
}

.input-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid #e2e4e9;
  background: #fff;
  box-shadow: 0px 1px 2px 0px rgba(228, 229, 231, 0.24);
  padding: 10px 10px 10px 30px;
  width: 568px;
}

#add-user-btn {
  margin: 0;
}

/* DASHBOARD */
.container-fluid {
  padding: 32px 32px 32px 264px;
}

#block_device_distance,
#block_latest_tasks,
#block_device_activity {
  display: none;
}

#dashboard_blocks > div {
  background-color: white;
}

#block_device_status_counts,
#block_device_overview {
  width: 100%; /* Faz com que ambos os blocos ocupem a largura completa dentro de sua coluna */

  .panel-title {
    display: none;
  }
}

#block_device_status_counts .panel-default,
#block_device_overview .panel-default {
  height: 675px;
}

#block_latest_events,
#block_latest_events > div,
#block_latest_events .dashboard-content {
  height: 656px;
  width: 100%;
}
#dashboard_blocks {
  display: grid;
  grid-template-areas:
    "half2 half1"
    "full full";
  grid-template-columns: 1fr 1fr; /* Duas colunas, cada uma com metade do espaço */
  grid-template-rows: auto auto; /* Ajuste automático das linhas */
  grid-gap: 10px; /* Se desejar um espaçamento entre os itens */
}

/* .panel-heading {
  display: none;
} */

#block_latest_events {
  grid-area: full;
  overflow: hidden;
}

/* #block_device_status_counts {
  grid-area: half1;
} */

#block_device_events {
  grid-area: half1;
}

#block_device_overview {
  grid-area: half2;
  background-color: transparent !important;
}

/* Responsividade */
/* @media (max-width: 768px) {
  #dashboard_blocks {
    grid-template-columns: 1fr;
  }

  #block_latest_events {
    grid-column: 1; 
  }

  #block_device_status_counts,
  #block_device_overview {
    grid-column: 1; 
  }
} */
.text {
  display: inline-block;
}
.bs-searchbox:before, .form-group.search:before {
  /* line-height: 41px; */
}

.dropdown-menu, .leaflet-control-layers .leaflet-control-layers-list {
  min-width: 175px !important;
  border-radius: 12px;
}

/* ============================================================
   WIDGETS - Modern Design (DRAMATIC REDESIGN)
   ============================================================ */

/* btn-collapse — mantém o posicionamento original do tema (relativo ao #bottombar).
   Apenas sobrescreve aparência visual. */
#widgets .btn-collapse {
  background: #22c55e !important;
  color: white !important;
  border-radius: 6px 6px 0 0 !important;
  box-shadow: 0 -4px 10px rgba(34, 197, 94, 0.25) !important;
  transition: background 0.2s ease, box-shadow 0.2s ease !important;
}

#widgets .btn-collapse:hover {
  background: #16a34a !important;
  box-shadow: 0 -6px 14px rgba(34, 197, 94, 0.4) !important;
}

#widgets .btn-collapse:before,
#widgets .btn-collapse:after {
  border-bottom-color: #22c55e !important;
  border-top-color: #22c55e !important;
}

#widgets .btn-collapse i {
  color: white !important;
}

#widgets .widget {
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%) !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
  margin-left: 12px !important;
  width: 240px !important;
  min-width: 240px !important;
  height: auto !important;
  max-height: 170px !important;
  position: relative !important;
}

#widgets .widget:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06) !important;
}

#widgets .widget:empty {
  display: none !important;
}

#widgets .widget + .widget {
  margin-left: 12px !important;
}

#widgets .widget-heading {
  background: linear-gradient(135deg, #8b7dde 0%, #a89dd8 100%) !important;
  border-bottom: none !important;
  padding: 0px 4px !important;
  font-size: 0.85em !important;
  font-weight: 700 !important;
  color: white !important;
  position: relative !important;
}

#widgets .widget-heading::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, rgba(255,255,255,0.2), transparent) !important;
}

#widgets .widget-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-weight: 700 !important;
  color: white !important;
  min-width: 0 !important;
}

#widgets .widget-title .icon {
  color: white !important;
  font-size: 1.3em !important;
  margin-right: 0 !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

#widgets .widget-title span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 0.95em !important;
  letter-spacing: 0.3px !important;
}

#widgets .widget-title [data-device="status"] {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

#widgets .widget-title [data-device="status-text"] {
  font-size: 0.7em !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

#widgets .widget-body {
  padding: 12px 14px !important;
  color: #525866 !important;
  background: white !important;
  max-height: 145px !important;
  overflow-y: auto !important;
  overflow-x: hidden;
}

#widgets .widget-body {
  height: auto !important;
  min-height: 145px !important;
  max-height: 145px !important;
}

#widgets .widget-body table {
  margin-bottom: 0 !important;
}

#widgets .widget-body table tr > td {
  padding: 5px 4px !important;
  border: none !important;
  color: #525866 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  transition: color 0.2s ease !important;
}

#widgets .widget-body table tr > td:first-child {
  font-weight: 600 !important;
  color: #868b96 !important;
  padding-right: 6px !important;
  white-space: nowrap !important;
  font-size: 1em !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}

#widgets .widget-body table tr > td:last-child {
  font-weight: 500 !important;
  color: #031207 !important;
  text-align: right !important;
}

#widgets .widget-body table tr > td:hover {
  color: inherit !important;
  background: transparent !important;
}

#widgets .widget-body .widget-empty {
  text-align: center !important;
  color: #868b96 !important;
  background: url('../images/no-data.png') right bottom no-repeat !important;
}

#widgets .widget-body .widget-empty > p {
  font-size: 0.85em !important;
}

/* Widget Actions */
#widgets .widget-heading .widget-actions {
  float: right !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Spacing between widgets */
#widgets .widgets-content {
  padding: 2px 0px 8px !important;
}

/* ============================================================
   WIDGET DEVICE - Modern Layout (ENHANCED)
   ============================================================ */

#widgets .widget-device .widget-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0px 4px !important;
}

#widgets .widget-device .widget-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
  margin: 0 !important;
  min-width: 0 !important;
}

#widgets .widget-device .widget-title .icon {
  font-size: 1.4em !important;
  color: white !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

#widgets .widget-device .widget-title span {
  font-weight: 700 !important;
  color: white !important;
  font-size: 0.95em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  letter-spacing: 0.3px !important;
}

#widgets .widget-device .widget-status-badge {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 4px 4px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 20px !important;
  font-size: 0.65em !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
  color: white !important;
  backdrop-filter: blur(4px) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
}

#widgets .widget-device .status-indicator {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  box-shadow: 0 0 8px currentColor, inset 0 0 3px rgba(0, 0, 0, 0.2) !important;
  animation: status-pulse 2s ease-in-out infinite !important;
}

@keyframes status-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

#widgets .widget-device .status-text {
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
}

/* Status colors */
#widgets .widget-device [data-device="status"][style*="background: rgb(34, 197, 94)"],
#widgets .widget-device [data-device="status"][style*="rgb(34, 197, 94)"] {
  background: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
}

#widgets .widget-device [data-device="status"][style*="rgb(239, 68, 68)"],
#widgets .widget-device [data-device="status"][style*="rgb(220, 38, 38)"] {
  background: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

#widgets .widget-device [data-device="status"][style*="rgb(168, 85, 247)"],
#widgets .widget-device [data-device="status"][style*="rgb(147, 51, 234)"] {
  background: #a855f7 !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5) !important;
}

/* Info Grid */
#widgets .widget-device .widget-info-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  padding: 0px 4px !important;
}

#widgets .widget-device .info-item {
  display: flex !important;
  gap: 10px !important;
  padding: 7px 7px !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f8 100%) !important;
  border-radius: 10px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid #efefef !important;
  position: relative !important;
  overflow: hidden !important;
  max-width: 95%;
  word-wrap: break-word !important;
  white-space: normal !important;
}

#widgets .widget-device .info-item::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 3px !important;
  background: linear-gradient(180deg, #5932ea 0%, #7c3aed 100%) !important;
  opacity: 0 !important;
  transition: opacity 0.25s ease !important;
}

#widgets .widget-device .info-item:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%) !important;
  border-color: #c7d2fe !important;
  box-shadow: 0 2px 8px rgba(89, 50, 234, 0.08) !important;
}

#widgets .widget-device .info-item:hover::before {
  opacity: 1 !important;
}

#widgets .widget-device .info-icon {
  display: none !important;
}

#widgets .widget-device .info-content {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: 100% !important;
}

#widgets .widget-device .info-label {
  font-size: 0.6em !important;
  font-weight: 700 !important;
  color: #999 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 3px !important;
}

#widgets .widget-device .info-value {
  font-size: 0.85em !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  word-break: break-word !important;
  word-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}

#widgets .widget-device .info-value.full-text {
  white-space: normal !important;
}

#widgets .widget-device .info-preview {
  display: none !important;
}

/* Widget Body */
#widgets .widget-device .widget-body {
  padding: 2px 2px !important;
  height: auto !important;
  min-height: 145px !important;
  max-height: 145px !important;
  overflow-y: auto !important;
  background: white !important;
  overflow-x: hidden;
}

/* Widget width */
#widgets .widget-device .widget-info-grid {
  width: 240px !important;
}

/* ============================================================
   WIDGET SENSORS - Modern Card Style (Same as Widget Device)
   ============================================================ */

#widgets .widget-sensors .widget-body {
  padding: 0px !important;
  height: auto !important;
  min-height: 145px !important;
  max-height: 145px !important;
  overflow-y: auto !important;
  background: white !important;
  overflow-x: hidden;
}

/* Tabelas dentro do widget-sensors */
#widgets .widget-sensors .table {
  display: table !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 4px !important;
  border-collapse: collapse !important;
}

/* Cada row - HOVER NA TR */
#widgets .widget-sensors .table tr {
  display: table-row !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  height: 36px;
  border-left: 3px solid transparent !important;
}

#widgets .widget-sensors .table tr:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%) !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12) !important;
  border-left: 3px solid #22c55e !important;
}

/* Widget Location e Driver - Hover */
#widget-location .table tr,
#widget-driver .table tr {
  border-left: 3px solid transparent !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#widget-location .table tr:hover,
#widget-driver .table tr:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%) !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12) !important;
  border-left: 3px solid #22c55e !important;
}

/* Widget Location e Driver - Cells - SEM HOVER */
#widget-location .table tr > td,
#widget-driver .table tr > td {
  padding: 8px 10px !important;
  border: none !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #495057 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: normal !important;
  border-bottom: 1px solid #f0f0f0 !important;
  background: transparent !important;
}

#widget-location .table tr > td:hover,
#widget-driver .table tr > td:hover {
  background: transparent !important;
  color: inherit !important;
}

/* Cells - SEM HOVER */
#widgets .widget-sensors .table tr > td {
  padding: 8px 10px !important;
  border: none !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #495057 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: normal !important;
  border-bottom: 1px solid #f0f0f0 !important;
  background: transparent !important;
}

#widgets .widget-sensors .table tr > td:hover {
  background: transparent !important;
}

#widgets .widget-sensors .table tr > td:first-child {
  font-weight: 600 !important;
  color: #495057 !important;
  width: auto !important;
}

#widgets .widget-sensors .table tr > td:last-child {
  text-align: right !important;
  font-weight: 500 !important;
  color: #1f2937 !important;
}

/* Ícones dos sensores - HIDE */
#widgets .widget-sensors .table tr > td .icon {
  display: none !important;
}

/* Widget Sensors - widget-empty (botão de adicionar) */
#widgets .widget-sensors .widget-empty {
  padding: 8px !important;
  text-align: center !important;
}

#widgets .widget-sensors .widget-empty .btn {
  font-size: 0.85em !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
}

/* ============================================================
   WIDGET GPRS COMMAND - Modern Layout
   ============================================================ */

#widgets .widget-gprs-command .widget-body {
  padding: 0px 2px !important;
  height: auto !important;
  min-height: 145px !important;
  max-height: 145px !important;
  overflow-y: auto !important;
  background: white !important;
}

#widgets .widget-gprs-command .table {
  display: table !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 4px !important;
  border-collapse: collapse !important;
}

#widgets .widget-gprs-command .table tr {
  display: table-row !important;
  padding: 0 !important;
  background: transparent !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#widgets .widget-gprs-command .table tr:hover {
  background: rgba(89, 50, 234, 0.04) !important;
}

#widgets .widget-gprs-command .table tr > td {
  padding: 10px 12px !important;
  border: none !important;
  border-bottom: 1px solid #f0f0f0 !important;
  font-size: 12px !important;
  color: #495057 !important;
  line-height: 1.4 !important;
}

#widgets .widget-gprs-command .table tr > td:first-child {
  font-weight: 600 !important;
  color: #2c3e50 !important;
}

#widgets .widget-gprs-command .table tr > td:last-child {
  text-align: center !important;
  padding: 8px !important;
}

/* Botão de enviar comando - Modern Style (apenas na tabela, não no header) */
#widgets .widget-gprs-command .table .send-command {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid #e0e0e0 !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f8 100%) !important;
  color: #1b99bd !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-size: 14px !important;
  margin: 0 !important;
}

#widgets .widget-gprs-command .table .send-command:hover {
  background: linear-gradient(135deg, #1b99bd 0%, #25b5d1 100%) !important;
  color: white !important;
  border-color: #1b99bd !important;
  box-shadow: 0 4px 12px rgba(27, 153, 189, 0.2) !important;
  transform: scale(1.05) !important;
}

#widgets .widget-gprs-command .table .send-command:active {
  transform: scale(0.95) !important;
}

/* ============================================================
   WIDGET ESPECÍFICAS - Ajustes adicionais
   ============================================================ */

/* Widget Image - sem padding */
#widgets .widget-image .widget-body,
#widgets .widget-camera .widget-body,
#widgets .widget-streetview .widget-body {
  padding: 0 !important;
  border-radius: 0 0 14px 14px !important;
}

/* Melhorias gerais de tabelas nos widgets */
#widgets .widget-body table {
  font-size: 0.8em !important;
}

#widgets .widget-body table tr > td {
  padding: 8px 10px !important;
  transition: all 0.2s ease !important;
}

/* ============================================================
   WIDGET SCROLLBAR - Thin Style (Colors from theme-colors.css)
   ============================================================ */


#widgets .widget-body::-webkit-scrollbar {
  width: 5px !important;
}

#widgets .widget-body::-webkit-scrollbar-track {
  background: transparent !important;
}

#widgets .widget-body::-webkit-scrollbar-thumb {
  border-radius: 3px !important;
}

/* ============================================================
   CLUSTERS - Premium Modern Design with Glassmorphism
   ============================================================ */

.cluster-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  text-align: center !important;
  background: linear-gradient(145deg, rgba(89, 50, 234, 0.95) 0%, rgba(168, 85, 247, 0.95) 100%) !important;
  border: 2.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  box-shadow:
    0 0 40px rgba(89, 50, 234, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.3) !important;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  backdrop-filter: blur(10px) !important;
  overflow: hidden !important;
}

.cluster-inner::before {
  content: '' !important;
  position: absolute !important;
  top: -50% !important;
  left: -50% !important;
  width: 200% !important;
  height: 200% !important;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168,85,247,0.1), transparent 50%) !important;
  animation: cluster-shimmer 3s ease-in-out infinite !important;
}

.cluster-inner:hover {
  box-shadow:
    0 0 60px rgba(89, 50, 234, 0.7),
    0 12px 48px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.4) !important;
  transform: scale(1.15) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  background: linear-gradient(145deg, rgba(107, 66, 245, 1) 0%, rgba(186, 120, 255, 1) 100%) !important;
}

.cluster-inner:after {
  content: '' !important;
  display: none !important;
}

.cluster-inner b {
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 2 !important;
  background: transparent !important;
  border-radius: 0 !important;
  line-height: 1 !important;
  font-size: 1.3em !important;
  font-weight: 900 !important;
  letter-spacing: -0.5px !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
}

@keyframes cluster-shimmer {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-5px, -5px);
  }
}

/* Clusters com cores diferentes baseado no tipo/status */
.marker-cluster .cluster-inner {
  background: linear-gradient(145deg, rgba(89, 50, 234, 0.95) 0%, rgba(168, 85, 247, 0.95) 100%) !important;
}

.marker-cluster:hover .cluster-inner {
  background: linear-gradient(145deg, rgba(107, 66, 245, 1) 0%, rgba(186, 120, 255, 1) 100%) !important;
}

/* ============================================================
   POPUPS - Modern Design
   ============================================================ */

.popup-content-modern {
  background: white !important;
  border: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.popup-header-modern {
  background: linear-gradient(135deg, #5932ea 0%, #7c3aed 100%) !important;
  color: white !important;
  padding: 14px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  border-bottom: none !important;
}

.popup-header-icon {
  font-size: 1.2em !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

.popup-title-modern {
  font-size: 0.95em !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  flex: 1 !important;
}

.popup-close-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
}

.popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: white !important;
}

.popup-body-modern {
  padding: 16px !important;
  max-height: 400px !important;
  overflow-y: auto !important;
}

.popup-info-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.popup-info-item {
  display: flex !important;
  gap: 12px !important;
  padding: 12px !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f8 100%) !important;
  border-radius: 10px !important;
  border: 1px solid #efefef !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.popup-info-item::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 3px !important;
  background: linear-gradient(180deg, #5932ea 0%, #7c3aed 100%) !important;
  opacity: 0 !important;
  transition: opacity 0.25s ease !important;
}

.popup-info-item:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%) !important;
  border-color: #c7d2fe !important;
  box-shadow: 0 2px 8px rgba(89, 50, 234, 0.08) !important;
}

.popup-info-item:hover::before {
  opacity: 1 !important;
}

.popup-info-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  background: linear-gradient(135deg, #5932ea 0%, #7c3aed 100%) !important;
  color: white !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  font-size: 0.75em !important;
  box-shadow: 0 2px 6px rgba(89, 50, 234, 0.2) !important;
}

.popup-info-content {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.popup-info-label {
  font-size: 0.6em !important;
  font-weight: 700 !important;
  color: #999 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 3px !important;
}

.popup-info-value {
  font-size: 0.85em !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  word-break: break-word !important;
  line-height: 1.35 !important;
}

.popup-info-link {
  font-size: 0.85em !important;
  font-weight: 600 !important;
  color: #5932ea !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.popup-info-link:hover {
  color: #7c3aed !important;
}

/* Leaflet popup customization */
.leaflet-popup-history {
  border-radius: 12px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.leaflet-popup-history .leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.1) !important;
  background: white !important;
}

.leaflet-popup-history .leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
}

.leaflet-popup-history .leaflet-popup-tip {
  background: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Device popup wrapper improvements */
.leaflet-popup-device .leaflet-popup-content-wrapper {
  background: transparent !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.leaflet-popup-device .leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  max-width: 420px !important;
  min-width: 380px !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.leaflet-popup-device .leaflet-popup-tip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: none !important;
}

/* ============================================================
   DEVICE POPUPS - Modern Design
   ============================================================ */

.device-popup-modern {
  background: linear-gradient(to bottom, #ffffff 0%, #f0f8fb 100%) !important;
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  max-width: 420px !important;
  min-width: 380px !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 70vh !important;
  height: auto !important;
}

.device-popup-header {
  background: linear-gradient(135deg, #1b99bd 0%, #25b5d1 100%) !important;
  color: white !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  border-bottom: none !important;
  flex-shrink: 0 !important;
  border: none !important;
  border-radius: 14px 14px 0 0 !important;
  overflow: hidden !important;
}

.device-popup-header > * {
  background: transparent !important;
}

.device-popup-header .device-popup-nav {
  background: transparent !important;
  gap: 4px !important;
}

.device-popup-header .device-popup-nav li a {
  background: transparent !important;
}

.device-popup-header .device-popup-nav li a i {
  font-size: 1.1em !important;
}

.device-popup-nav {
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  background: transparent !important;
}

.device-popup-nav li {
  margin: 0 !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  float: none !important;
  margin-bottom: 0 !important;
}

.device-popup-nav li a {
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 8px 12px !important;
  font-size: 0.95em !important;
  transition: all 0.25s ease !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  min-width: 36px !important;
  height: 36px !important;
}

.device-popup-nav li a:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: transparent !important;
  transform: translateY(-1px) !important;
}

.device-popup-nav li.active a {
  color: white !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: transparent !important;
  width: auto !important;
  height: auto !important;
  border-bottom: none !important;
}

.device-popup-close {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  min-width: 36px !important;
  height: 36px !important;
  color: white !important;
  border: none !important;
}

.device-popup-close:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: rotate(90deg) !important;
}

.device-popup-title {
  font-size: 0.85em !important;
  font-weight: 700 !important;
  color: white !important;
  letter-spacing: 0.3px !important;
  flex: 1 !important;
  padding-left: 10px !important;
  max-width: 200px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.device-popup-body {
  padding: 0 !important;
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 250px !important;
}

.device-popup-body,
.device-popup-body .tab-pane {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(27, 153, 189, 0.5) transparent !important;
}

.device-popup-body::-webkit-scrollbar,
.device-popup-body .tab-pane::-webkit-scrollbar {
  width: 4px !important;
}

.device-popup-body::-webkit-scrollbar-track,
.device-popup-body .tab-pane::-webkit-scrollbar-track {
  background: transparent !important;
  border-radius: 2px !important;
}

.device-popup-body::-webkit-scrollbar-thumb,
.device-popup-body .tab-pane::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(27, 153, 189, 0.4) 0%, rgba(27, 153, 189, 0.6) 100%) !important;
  border-radius: 2px !important;
  border: 1px solid rgba(27, 153, 189, 0.2) !important;
}

.device-popup-body::-webkit-scrollbar-thumb:hover,
.device-popup-body .tab-pane::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(27, 153, 189, 0.6) 0%, rgba(27, 153, 189, 0.8) 100%) !important;
  border-color: rgba(27, 153, 189, 0.4) !important;
}

.device-popup-tab {
  padding: 14px !important;
}

.device-popup-info-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.device-popup-info-item {
  display: flex !important;
  gap: 10px !important;
  padding: 10px !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f8 100%) !important;
  border-radius: 8px !important;
  border: 1px solid #efefef !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.device-popup-info-item::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 3px !important;
  background: linear-gradient(180deg, #1b99bd 0%, #25b5d1 100%) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

.device-popup-info-item:hover {
  background: linear-gradient(135deg, #e0f4f8 0%, #d9f0f5 100%) !important;
  border-color: #7fd4e0 !important;
  box-shadow: 0 2px 8px rgba(27, 153, 189, 0.1) !important;
}

.device-popup-info-item:hover::before {
  opacity: 1 !important;
}

.device-popup-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  background: linear-gradient(135deg, #1b99bd 0%, #25b5d1 100%) !important;
  color: white !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
  font-size: 0.75em !important;
  box-shadow: 0 2px 6px rgba(27, 153, 189, 0.2) !important;
}

.device-popup-content {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.device-popup-label {
  font-size: 0.65em !important;
  font-weight: 700 !important;
  color: #999 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  margin-bottom: 2px !important;
}

.device-popup-value {
  font-size: 0.8em !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  word-break: break-word !important;
  line-height: 1.3 !important;
}

.device-popup-extra {
  margin-top: 8px !important;
  border-top: 1px solid #e2e4e9 !important;
  padding-top: 8px !important;
}

.device-popup-toggle {
  padding: 10px 16px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  color: #1b99bd !important;
  font-size: 0.85em !important;
  transition: all 0.3s ease !important;
  background: rgba(27, 153, 189, 0.08) !important;
  border: 1px solid rgba(27, 153, 189, 0.2) !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  min-width: 120px !important;
}

.device-popup-toggle:hover {
  color: white !important;
  background: rgba(27, 153, 189, 0.25) !important;
  border-color: rgba(27, 153, 189, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(27, 153, 189, 0.15) !important;
}

.device-popup-toggle:active {
  transform: translateY(0) !important;
}

.device-popup-toggle i {
  font-size: 0.9em !important;
  color: inherit !important;
  transition: transform 0.3s ease !important;
}

.device-popup-toggle[aria-expanded="true"] i {
  transform: rotate(180deg) !important;
}

/* ============================================================
   DEVICE POPUP — compacto no mobile. O popup estava ocupando
   quase a tela toda (380-420px largura, até 70-80vh altura),
   cobrindo o próprio veículo no mapa abaixo dele.
   ============================================================ */
@media (max-width: 768px) {
  .leaflet-popup-device .leaflet-popup-content {
    min-width: 260px !important;
    max-width: 86vw !important;
    max-height: 50vh !important;
  }
  .device-popup-modern {
    min-width: 260px !important;
    max-width: 86vw !important;
    max-height: 50vh !important;
  }
  .device-popup-body {
    max-height: 160px !important;
  }
  .device-popup-tab {
    padding: 10px !important;
  }
  .device-popup-info-item {
    padding: 8px !important;
    gap: 8px !important;
  }
  .device-popup-icon {
    width: 26px !important;
    height: 26px !important;
  }
  .device-popup-title {
    max-width: 140px !important;
  }
}

/* Collapse behavior within scrollable popup */
#device-side-params {
  overflow: visible !important;
  transition: all 0.3s ease !important;
}

#device-side-params.show {
  display: block !important;
}

/* Ensure tab-content respects flex layout */
.device-popup-body .tab-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  border-radius: 0 0 14px 14px !important;
  overflow: hidden !important;
}

.device-popup-body .tab-pane {
  display: none !important;
  flex-direction: column !important;
  border-radius: 0 0 14px 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 500px !important;
}

.device-popup-body .tab-pane.active {
  display: flex !important;
  flex-direction: column !important;
  border-radius: 0 0 14px 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 500px !important;
}

#gps-device-parameters-view {
  width: 100% !important;
  border-radius: 0 0 14px 14px !important;
}
/* ============================================================
   HISTORY BOTTOMBAR - Modern Standardized Header
   ============================================================ */

#bottom-history {
  border-radius: 0 !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.09) !important;
  background: white !important;
}

#bottom-history .bottom-history-header {
  background: linear-gradient(135deg, #f8f9fa, #f1f3f5) !important;
  border-bottom: 1px solid #e9ecef !important;
  padding: 8px 12px !important;
  min-height: 42px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

/* Main tabs (Graph / Data Log / ×) */
#bottom-history .bottom-history-header .nav-tabs {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
}

#bottom-history .bottom-history-header .nav-tabs > li {
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  display: inline-flex !important;
}

#bottom-history .bottom-history-header .nav-tabs > li > a.btn {
  font-size: 11px !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  border: 1px solid #dee2e6 !important;
  color: #6c757d !important;
  background: white !important;
  margin: 0 2px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

#bottom-history .bottom-history-header .nav-tabs > li > a.btn:hover {
  border-color: #1b99bd !important;
  color: #1b99bd !important;
  background: rgba(27, 153, 189, 0.06) !important;
}

#bottom-history .bottom-history-header .nav-tabs > li.active > a.btn,
#bottom-history .bottom-history-header .nav-tabs > li.active > a.btn:hover,
#bottom-history .bottom-history-header .nav-tabs > li.active > a.btn:focus {
  background: linear-gradient(135deg, #1b99bd, #158fa0) !important;
  border-color: transparent !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 6px rgba(27, 153, 189, 0.25) !important;
}

/* Close button (×) */
#bottom-history .bottom-history-header .btn-close {
  color: #999 !important;
  font-size: 14px !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: 4px !important;
}

#bottom-history .bottom-history-header .btn-close:hover {
  background: #fff0f0 !important;
  border-color: #f5c6c6 !important;
  color: #e74c3c !important;
}

/* Sensor chips — modern design */
#bottom-history #graph_sensors {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  list-style: none !important;
}

#bottom-history #graph_sensors > li {
  display: inline-flex !important;
  margin: 0 !important;
}

#bottom-history #graph_sensors > li > a {
  font-size: 11px !important;
  padding: 5px 12px !important;
  border-radius: 14px !important;
  color: #6c757d !important;
  border: 1px solid #e9ecef !important;
  background: white !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

#bottom-history #graph_sensors > li > a:hover {
  background: rgba(27, 153, 189, 0.08) !important;
  color: #1b99bd !important;
  border-color: rgba(27, 153, 189, 0.35) !important;
}

#bottom-history #graph_sensors > li.active > a {
  background: rgba(27, 153, 189, 0.12) !important;
  color: #1b99bd !important;
  border-color: rgba(27, 153, 189, 0.4) !important;
  font-weight: 600 !important;
}

/* Graph controls */
#bottom-history .graph-controls {
  background: #fafbfc !important;
  border-bottom: 1px solid #ecedef !important;
  padding: 6px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

#bottom-history .graph-controls .nav-pills {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#bottom-history .graph-controls .nav-pills > li {
  display: inline-flex !important;
  margin: 0 !important;
}

#bottom-history .graph-controls .nav-pills .btn {
  height: 28px !important;
  width: 28px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  border: 1px solid #dee2e6 !important;
  background: white !important;
  color: #495057 !important;
  transition: all 0.15s ease !important;
}

#bottom-history .graph-controls .nav-pills .btn:hover {
  background: rgba(27, 153, 189, 0.1) !important;
  border-color: #1b99bd !important;
  color: #1b99bd !important;
}

#bottom-history #historySpeed {
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  border: 1px solid #dee2e6 !important;
  background: white !important;
}

#bottom-history #hoverdata,
#bottom-history #hoverdata-date {
  font-size: 11px !important;
  color: #495057 !important;
  padding: 3px 8px !important;
  background: white !important;
  border: 1px solid #e9ecef !important;
  border-radius: 12px !important;
}

/* Collapse Control Button — Expande o bottombar quando oculto */
.collapse-control {
  position: fixed !important;
  bottom: 16px !important;
  right: 16px !important;
  z-index: 996 !important;
  display: none !important;
  width: 44px !important;
  height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, #1b99bd 0%, #158fa0 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(27, 153, 189, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.collapse-control.visible {
  display: flex !important;
}

.collapse-control:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(27, 153, 189, 0.4) !important;
}

.collapse-control a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  color: white !important;
  font-size: 18px !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
}

.collapse-control a::before {
  content: "▲" !important;
}

.leaflet-popup-content{
  border-radius: 16px !important;
}

/* ===== MELHORIAS GERAIS NOS POPUPS DO LEAFLET ===== */
.leaflet-popup {
  border-radius: 16px !important;
}

.leaflet-popup-content-wrapper {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14), 0 3px 12px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #e5e7eb !important;
  overflow: hidden !important;
}

.leaflet-popup-tip {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 50% !important;
}

/* Melhoria no conteúdo do popup */
.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  max-width: 420px !important;
}

/* Bordas mais redondas para elementos dentro dos popups */
.leaflet-popup .form-control,
.leaflet-popup input,
.leaflet-popup select {
  border-radius: 10px !important;
  border: 1px solid #d1d5db !important;
}

.leaflet-popup .form-control:focus,
.leaflet-popup input:focus,
.leaflet-popup select:focus {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1) !important;
}

/* ===== ESTILO MODERNO PARA GEOFENCES ===== */
.leaflet-popup-geofence .name {
  display: block !important;
  white-space: nowrap !important;
  padding: 8px 12px !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  text-shadow: none !important;
  background-color: rgba(22, 163, 74, 0.4) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(4px) !important;
  color: #1f2937 !important;
}

.leaflet-popup-route .name {
  display: block !important;
  white-space: nowrap !important;
  padding: 8px 12px !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  text-shadow: none !important;
  background-color: rgba(22, 163, 74, 0.4) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(4px) !important;
  color: #1f2937 !important;
}

/* ===== ESTILO MODERNO PARA NOMES DE VEÍCULOS ===== */
.leaf-device-marker .name {
  border-radius: 16px !important;
  padding: 6px 12px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid rgba(229, 231, 235, 0.6) !important;
}

.leaf-device-marker .name i {
  font-style: normal !important;
  display: inline-block !important;
  white-space: nowrap !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  color: #1f2937 !important;
  font-weight: 500 !important;
  font-size: 12px !important;
}

.leaflet-control-layers label div {
    padding: 6px 2px !important;
}
.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
  width: auto !important;
}

/* ===== MENU DO VEÍCULO: CORES DINÂMICAS POR TEMA ===== */

/* Cor padrão do texto (Light Blue) */
.dlr-menu .dropdown-menu > li > a,
.dlr-menu .dropdown-menu > li > a .text,
body > .dropdown-menu.dlr-menu-floating li a,
body > .dropdown-menu.dlr-menu-floating li a .text {
  color: #2c3e50 !important;
}

/* LIGHT BLUE - Padrão (#1b99bd) */
body[data-theme="light-blue"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-blue"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-blue"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-blue"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #2c3e50 !important;
}

/* LIGHT GREEN (#2faf62) */
body[data-theme="light-green"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-green"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-green"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-green"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #1e5631 !important;
}

/* LIGHT INDIGO (#2F337A) */
body[data-theme="light-indigo"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-indigo"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-indigo"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-indigo"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #2c3466 !important;
}

/* LIGHT ORANGE (#cc7e1a) */
body[data-theme="light-orange"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-orange"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-orange"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-orange"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #5a3a1f !important;
}

/* LIGHT PINK (#f56f8b) */
body[data-theme="light-pink"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-pink"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-pink"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-pink"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #5a1f35 !important;
}

/* LIGHT RED (#e56061) */
body[data-theme="light-red"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-red"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-red"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-red"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #5a1f1f !important;
}

/* LIGHT BLACK (#333) */
body[data-theme="light-black"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-black"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-black"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-black"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #1a1a1a !important;
}

/* LIGHT WIN10 BLUE (#2c82d8) */
body[data-theme="light-win10-blue"] .dlr-menu .dropdown-menu > li > a,
body[data-theme="light-win10-blue"] .dlr-menu .dropdown-menu > li > a .text,
body[data-theme="light-win10-blue"] > .dropdown-menu.dlr-menu-floating li a,
body[data-theme="light-win10-blue"] > .dropdown-menu.dlr-menu-floating li a .text {
  color: #1a4073 !important;
}

/* ===== ÍCONES: COR SIMPLES SEGUINDO O TEMA ===== */

/* Todos os ícones do menu seguem a cor do tema (simples e limpo) */

/* LIGHT BLUE (Padrão) */
.dlr-menu .dropdown-menu .icon,
body > .dropdown-menu.dlr-menu-floating .icon {
  color: #1b99bd !important;
}

/* LIGHT GREEN */
body[data-theme="light-green"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-green"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #2faf62 !important;
}

/* LIGHT INDIGO */
body[data-theme="light-indigo"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-indigo"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #2F337A !important;
}

/* LIGHT ORANGE */
body[data-theme="light-orange"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-orange"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #cc7e1a !important;
}

/* LIGHT PINK */
body[data-theme="light-pink"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-pink"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #f56f8b !important;
}

/* LIGHT RED */
body[data-theme="light-red"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-red"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #e56061 !important;
}

/* LIGHT BLACK */
body[data-theme="light-black"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-black"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #333 !important;
}

/* LIGHT WIN10 BLUE */
body[data-theme="light-win10-blue"] .dlr-menu .dropdown-menu .icon,
body[data-theme="light-win10-blue"] > .dropdown-menu.dlr-menu-floating .icon {
  color: #2c82d8 !important;
}

/* Hover: ícones ficam mais opacos e em destaque */
.dlr-menu .dropdown-menu > li > a:hover .icon,
body > .dropdown-menu.dlr-menu-floating li a:hover .icon {
  opacity: 1 !important;
  filter: brightness(1.1);
  transform: scale(1.15);
}

/* ===== ANIMAÇÕES E EFEITOS AVANÇADOS ===== */

/* Ícones com transição suave de escala e cor */
.dlr-menu .dropdown-menu > li > a .icon,
body > .dropdown-menu.dlr-menu-floating li a .icon {
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

/* Item do menu com transição suave */
.dlr-menu .dropdown-menu > li > a,
body > .dropdown-menu.dlr-menu-floating li a {
  position: relative;
  overflow: hidden;
}

/* Pseudo-elemento para background animado no hover */
.dlr-menu .dropdown-menu > li > a::before,
body > .dropdown-menu.dlr-menu-floating li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(27, 153, 189, 0.05), transparent);
  transition: left 0.4s ease;
  z-index: -1;
}

.dlr-menu .dropdown-menu > li > a:hover::before,
body > .dropdown-menu.dlr-menu-floating li a:hover::before {
  left: 100%;
}

/* ===== INDICADORES DE AÇÃO (BARRA ESQUERDA COLORIDA) ===== */

/* Default hover color (Light Blue) */
.dlr-menu .dropdown-menu > li > a:hover,
body > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #1b99bd !important;
}

/* Light Green */
body[data-theme="light-green"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-green"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #2faf62 !important;
}

/* Light Indigo */
body[data-theme="light-indigo"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-indigo"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #2F337A !important;
}

/* Light Orange */
body[data-theme="light-orange"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-orange"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #cc7e1a !important;
}

/* Light Pink */
body[data-theme="light-pink"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-pink"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #f56f8b !important;
}

/* Light Red */
body[data-theme="light-red"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-red"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #e56061 !important;
}

/* Light Black */
body[data-theme="light-black"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-black"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #333 !important;
}

/* Light Win10 Blue */
body[data-theme="light-win10-blue"] .dlr-menu .dropdown-menu > li > a:hover,
body[data-theme="light-win10-blue"] > .dropdown-menu.dlr-menu-floating li a:hover {
  border-left-color: #2c82d8 !important;
}

/* ===== CHECKBOX SIMPLES E LIMPO ===== */
.group-list > li.device-list-item > .checkbox {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
}

.group-list > li.device-list-item > .checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
}

.group-list > li.device-list-item > .checkbox label {
  /* display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 3px !important;
  background: #fff !important;
  border: 1.5px solid #bdc3c7 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
  padding: 0 !important; */
}



.group-list > li.device-list-item > .checkbox input[type="checkbox"]:checked + label:after {
  content: "✓" !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: bold !important;
}

/* Responsividade do menu em telas pequenas */
@media (max-width: 768px) {
  body > .dropdown-menu.dlr-menu-floating {
    min-width: 240px;
    max-width: 300px;
    font-size: 11px;
  }
  body > .dropdown-menu.dlr-menu-floating li a {
    padding: 8px 12px !important;
  }
  .dlr-menu .dropdown-menu > li > a {
    padding: 8px 12px !important;
  }
}

.dropdown-menu .open{
  top:0px;
}

.input-group-addon, .input-group-btn {
    width: 25% !important;
}
.padding-5{
    paddging-right:5px !important;
    padding-left:5px !important;
}
.form-horizontal .control-label {
  padding:0px !important;
}
.group .group-heading .btn-group .options {
  display:none !important;
}
#reports_create .modal-dialog {
  width: 900px !important;
  max-width: 95% !important;
}
#reports_create .bootstrap-select .dropdown-menu.open {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
}

#reports_create .bootstrap-select .bs-searchbox:before {
  line-height:55px !important;
}