/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E FONTES
   ========================================================================== */

   body {
    margin: 0;
    font-family: 'Lato', sans-serif;
    background: #fdfdfd;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  h2, h3 {
      font-family: 'Poppins', sans-serif;
  }
  
  p, span, a, li, dt, dd, td, th, label, input, select, button {
      font-family: 'Lato', sans-serif;
  }
  
/* ==========================================================================
   2. PÁGINA DE LOGIN
   ========================================================================== */
  
  .login-body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
  
  .login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
  }
  
  .login-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  
  .login-card h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
  }
  
  .logo-login {
    margin-bottom: 30px;
  }
  
  .logo-login img {
    max-width: 180px;
    height: auto;
  }
  
  .input-group {
    margin-bottom: 20px;
    text-align: left;
  }
  
  .input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
  }
  
  .input-group input[type="text"],
  .input-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
  }
  
  .input-group input:focus {
    border-color: #ec6619;
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 102, 25, 0.2);
  }
  
  .login-button {
    background-color: #ec6619;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
  }
  
  .login-button:hover {
    background-color: #b33300;
  }
  
  @keyframes fadeOutUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
  }
  
  .login-card.logging-in {
    animation: fadeOutUp 0.5s forwards;
  }
  
/* ==========================================================================
   3. ESTRUTURA PRINCIPAL DO DASHBOARD
   ========================================================================== */
  
  .app {
    display: flex;
    height: 100vh;
  }
  
  main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: #F9FAFB;
  }
  
  .sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease-in-out, background-color 0.3s ease, border-right-color 0.3s ease;
  }
  
  .sidebar.collapsed {
    width: 80px;
  }
  
  .sidebar .logo {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .logo img {
    max-width: 100%;
    height: auto;
  }

  .client-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
    display: block;
    margin: 0 auto;
  }
  
  .sidebar nav {
    flex-grow: 1;
  }
  
  .sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
  }
  
  .sidebar nav ul li {
    cursor: pointer;
    margin: 0 0.5rem;
  }
  
  .sidebar nav ul li a {
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  .sidebar nav ul li:hover a,
  .sidebar nav ul li.active a {
    background: #FFFBEB;
    color: #D97706;
  }
  
  .sidebar.collapsed ._text_10oo3_67 {
    display: none;
  }
  
  .sidebar.collapsed nav ul li a {
    justify-content: center;
  }
  
  .toggle-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f3f4f6;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
  }
  
  .content-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }
  
  .content-section.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
  }
  
/* ==========================================================================
   4. COMPONENTES GERAIS (Cards, Tabelas, Filtros, etc.)
   ========================================================================== */
  
  /* --- Estilo dos Cards --- */
  .card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
  }
  
  ._card_14g8r_30 { /* Classe genérica do card */
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
  }
  
  ._card_14g8r_30:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  }
  
  ._cardHeader_14g8r_44 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
  }
  
  ._cardHeader_14g8r_44 h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #111827;
    font-weight: 500;
    word-break: break-word;
  }
  
  ._controllerIcon_14g8r_67 {
    text-align: center;
    margin: 20px 0;
    color: #ec6619;
  }
  
  .card-location {
    margin-bottom: 16px; 
    text-align: center;
    color: #6b7280;
  }
  
  .card-details-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
      margin-top: auto;
      padding-top: 10px;
      border-top: 1px solid #f3f4f6;
      width: 100%;
  }
  
  .central-id, .central-vpn {
      font-size: 0.8em;
      color: #6b7280;
      text-align: center;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
  }
  
  .central-id strong, .central-vpn strong {
      font-family: 'Courier New', Courier, monospace;
      color: #374151;
      font-size: 1.1em;
  }
  
  /* --- Estilo dos Status --- */
  ._status_14g8r_51 {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
  }
  
  ._online_14g8r_57, .status.ativo {
    background-color: #dcfce7;
    color: #166534;
    border-color: #4ade80;
  }
  
  ._offline_14g8r_62 {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #f87171;
  }
  
  /* --- Estilos da Tabela --- */
  table {
    width: 100%;
    border-collapse: collapse;
  }
  
  th, td {
    border: 1px solid #e5e7eb;
    padding: 12px 15px;
    text-align: left;
  }
  
  th {
    background-color: #f9fafb;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
  }
  
  .view-acessos-btn {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
  }
  
  .view-acessos-btn:hover {
    background-color: #e5e7eb;
  }
  
  /* --- Estilos dos Filtros e Busca --- */
  .central-filter-container, .filter-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .filter-select {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    min-width: 200px;
  }
  
  .search-container {
    display: flex;
    align-items: center;
  }
  
  .search-input {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    outline: none;
    min-width: 200px;
    border-right: none;
    height: 43px;
    box-sizing: border-box;
  }
  
  .search-btn, .clear-btn {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
    height: 43px;
    box-sizing: border-box;
  }
  
  .search-btn {
    border-radius: 0 8px 8px 0;
  }
  
  .clear-btn {
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: #ef4444;
    font-weight: bold;
  }
  
/* ==========================================================================
   5. ESTILOS DO MODAL DE ACESSOS
   ========================================================================== */
  
  .modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .modal-overlay.active {
    display: flex;
    opacity: 1;
  }
  
  .modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
  }
  
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  
  .modal-header h3 {
    margin: 0;
  }
  
  .modal-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #9ca3af;
  }
  
  .acessos-detail-list {
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
  }
  
  .acesso-item-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    list-style-type: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }
  
  .acesso-item-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f3f4f6;
    text-align: center;
  }
  
  .acesso-item-header h4 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
  }
  
  .acesso-item-body {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
  }
  
  .detail-pair {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .detail-label {
    font-weight: 600;
    color: #4b5563;
    margin-right: 1rem;
    white-space: nowrap;
  }
  
  .detail-value {
    color: #111827;
    text-align: right;
    font-weight: 500;
    word-break: break-word;
  }
  
  .period-pair {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    border-top: 1px dashed #d1d5db;
    padding-top: 0.85rem;
    margin-top: 0.5rem;
  }
  
  .period-value {
    text-align: left;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #374151;
  }
  
/* ==========================================================================
   6. DARK MODE
   ========================================================================== */
  
  body.dark-mode {
    background-color: #18181b;
    color: #e0e0e0;
  }
  
  body.dark-mode main {
    background-color: #18181b;
  }
  
  body.dark-mode .sidebar {
    background: #27272a;
    border-right-color: #3f3f46;
  }
  
  body.dark-mode .sidebar .logo,
  body.dark-mode ._cardHeader_14g8r_44,
  body.dark-mode .modal-header {
    border-bottom-color: #3f3f46;
  }
  
  body.dark-mode .sidebar nav ul li a {
    color: #a1a1aa;
  }
  
  body.dark-mode .sidebar nav ul li:hover a,
  body.dark-mode .sidebar nav ul li.active a {
    background: #3f3f46;
    color: #fb923c;
  }
  
  body.dark-mode .toggle-btn,
  body.dark-mode .view-acessos-btn:hover {
    background-color: #3f3f46;
    color: #a1a1aa;
  }
  
  body.dark-mode ._card_14g8r_30,
  body.dark-mode .login-card {
    background-color: #27272a;
    border-color: #3f3f46;
  }
  
  body.dark-mode ._cardHeader_14g8r_44 h3,
  body.dark-mode .modal-header h3,
  body.dark-mode .detail-value {
    color: #f4f4f5;
  }
  
  body.dark-mode ._controllerIcon_14g8r_67 svg {
    fill: #fb923c;
  }
  
  body.dark-mode .card-location,
  body.dark-mode .central-id, 
  body.dark-mode .central-vpn {
    color: #a1a1aa;
  }
  
  body.dark-mode .central-id strong, 
  body.dark-mode .central-vpn strong {
    color: #e4e4e7;
  }
  
  body.dark-mode .card-details-container {
    border-top-color: #3f3f46;
  }
  
  body.dark-mode th {
    background-color: #3f3f46;
    color: #f4f4f5;
  }
  
  body.dark-mode td,
  body.dark-mode th {
    border-color: #3f3f46;
  }
  
  body.dark-mode ._online_14g8r_57,
  body.dark-mode .status.ativo {
    background-color: #14532d;
    color: #86efac;
    border-color: #4ade80;
  }
  
  body.dark-mode ._offline_14g8r_62 {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #f87171;
  }
  
  body.dark-mode .filter-select,
  body.dark-mode .search-input {
    background-color: #27272a;
    border-color: #3f3f46;
    color: #e0e0e0;
  }
  
  body.dark-mode .filter-select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23a1a1aa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  }
  
  body.dark-mode .search-btn,
  body.dark-mode .clear-btn {
    background-color: #3f3f46;
    border-color: #3f3f46;
  }
  
  body.dark-mode .modal-content {
    background: #27272a;
  }
  
  body.dark-mode .acesso-item-card {
    background-color: #18181b;
    border-color: #3f3f46;
  }
  
  body.dark-mode .acesso-item-header {
    background-color: #27272a;
    border-bottom-color: #3f3f46;
  }
  
  body.dark-mode .acesso-item-header h4 {
    color: #f4f4f5;
  }
  
  body.dark-mode .detail-label {
    color: #a1a1aa;
  }
  
  body.dark-mode .period-value {
    color: #d4d4d8;
  }
  
  body.dark-mode .period-pair {
    border-top-color: #3f3f46;
  }
  
  body.dark-mode .view-acessos-btn {
    background-color: #3f3f46;
    border-color: #52525b;
    color: #e4e4e7;
  }

/* ==========================================================================
   7. ESTILOS DA PÁGINA DE CONFIGURAÇÕES
   ========================================================================== */

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding-top: 1rem;
}

.config-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, border-color 0.3s;
}

.config-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: border-color 0.3s;
}

.config-card__header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.config-card__icon {
  font-size: 1.5rem;
  color: #ec6619;
}

.config-card__body {
  padding: 1rem;
  font-size: 0.9rem;
  color: #4b5563;
  flex-grow: 1;
}

.config-card__body p {
  margin-top: 0;
  line-height: 1.6;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.status-item:last-child {
  border-bottom: none;
}

.status-item span:last-child {
  font-weight: 600;
}

.status-indicator {
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.status-indicator.online {
  background-color: #dcfce7;
  color: #166534;
}

.resource-links {
  margin-top: 1rem;
}

.resource-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.resource-button.postman {
  background-color: #FF6C37;
  color: white;
}

.resource-button.postman:hover {
  background-color: #e65622;
}

/* --- Dark Mode para a página de Configurações --- */

body.dark-mode .config-card {
  background-color: #27272a;
  border-color: #3f3f46;
}

body.dark-mode .config-card__header {
  border-bottom-color: #3f3f46;
}

body.dark-mode .config-card__header h3,
body.dark-mode .config-card__body,
body.dark-mode .status-item span {
  color: #f4f4f5;
}

body.dark-mode .config-card__icon {
  color: #fb923c;
}

body.dark-mode .status-item {
  border-bottom-color: #3f3f46;
}

body.dark-mode .status-indicator.online {
  background-color: #14532d;
  color: #86efac;
}

body.dark-mode .resource-button.postman svg {
  fill: white;
}
/* ==========================================================================
   8. MELHORIAS DE LAYOUT PARA CARD DE EQUIPAMENTO
   ========================================================================== */

.equipment-details dt, 
.equipment-details dd {
  float: none;
  width: auto;
  margin: 0;
}

.equipment-details {
  display: grid;
  grid-template-columns: auto 1fr; 
  gap: 0.5rem 1rem;               
  align-items: center;
  margin-top: 1rem;
}

.equipment-details dt {
  font-weight: 600;       
  color: #4b5563;
}

.equipment-details dd {
  text-align: right;      
  word-break: break-all;
  color: #111827;
}
        
/* --- Dark Mode para os detalhes do equipamento --- */
body.dark-mode .equipment-details dt {
    color: #9ca3af;
}

body.dark-mode .equipment-details dd {
    color: #d1d5db;
}
/* ==========================================================================
   9. DARK MODE TOGGLE SWITCH (VERSÃO ATUALIZADA)
   ========================================================================== */

/* Container que segura o botão e o texto */
.dark-mode-toggle-container {
  position: absolute; /* ALTERADO: para se posicionar dentro do <main> */
  top: 2rem; /* Alinha com o padding do <main> */
  right: 2rem; /* Alinha com o padding do <main> */
  display: flex;
  align-items: center;
  z-index: 1000;
  
  /* ALTERADO: Removemos o estilo do container */
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* O "invólucro" do switch (interruptor) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

/* Esconde o checkbox padrão do HTML */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* O "trilho" do interruptor */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}

/* O círculo/botão que desliza */
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Sombra sutil no botão */
}

/* Estilo para quando o interruptor está LIGADO */
input:checked + .slider {
  background-color: #ec6619; /* Cor laranja da sua marca */
}

input:focus + .slider {
  box-shadow: 0 0 1px #ec6619;
}

/* Animação do círculo deslizando quando LIGADO */
input:checked + .slider:before {
  transform: translateX(22px);
}

/* NOVO: Esconde o texto "Modo Escuro" */
.dark-mode-label {
  display: none;
}