.connectedDevices-page .device-item {
  display: flex;
  align-items: center;
  background-color: var(--background-color-main-light-gray);
  border: 1px solid var(--border-light-mode);
  border-radius: 8px;
  padding: 20px;
  margin: 8px;
}

.connectedDevices-page .devices-main-container .device-item {
  margin-bottom: 5px !important;
}

.connectedDevices-page .device-item:last-child {
  margin-bottom: 0;
}

.connectedDevices-page {
  width: 100%;
}

.security-card-header {
  background: var(--background-color-main-light-gray);
  padding: 6px 6px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light-mode);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center !important;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-thowine-black-light);
  display: block;
  width: 100%;
  justify-content: center;
}

.section-description {
  font-size: 1rem;
  color: #6c757d;
  margin: 0 auto;
  max-width: 650px;
  line-height: 1.5;
  display: block;
  width: 100%;
  text-align: center !important;
}

/* --- Container Principal da Lista --- */
.devices-main-container {
  background: var(--background-color-main-light);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--border-light-mode);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.connectedDevices-page #devices-list-container {
  display: flex;
  flex-direction: column;
}

/* --- Estados de Interface --- */
.connectedDevices-page #devices-loading,
.connectedDevices-page #devices-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #6c757d;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #dee2e6;
  margin-top: 20px;
}

.connectedDevices-page #devices-loading i {
  font-size: 28px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

html.dark-theme .connectedDevices-page .device-item:last-child {
  background-color: var(--background-main-dark-mode);
}

.connectedDevices-page .device-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f3f5;
  color: #495057;
  border-radius: 50%;
  margin-right: 20px;
}

.connectedDevices-page .device-icon i {
  font-size: 22px;
}

.connectedDevices-page .device-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.connectedDevices-page .device-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.connectedDevices-page .device-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
}

.connectedDevices-page .current-device-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0d6efd;
  background-color: #e7f0ff;
  padding: 4px 10px;
  border-radius: 20px;
}

.connectedDevices-page .device-meta {
  font-size: 0.875rem;
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* --- Modal e Botões --- */
.connectedDevices-page #revokeDeviceModal {
  display: none;
  margin-top: 15px;
  padding: 20px;
  background-color: #fef7f7;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.connectedDevices-page #revokeDeviceModal.show {
  display: block;
  opacity: 1;
}

.btn.btn-secondary.btn-sm.revoke-device-btn {
  background-color: var(--primary-color);
  color: var(--text-thowine-black-light);
  font-weight: 700;
}

html.dark-theme .btn.btn-secondary.btn-sm.revoke-device-btn {
  background-color: var(--primary-color);
  color: var(--text-thowine-black-light);
  font-weight: 700;
}

.connectedDevices-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

/* --- Responsividade Mobile --- */
@media (max-width: 600px) {
  .connectedDevices-page .device-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }
  .connectedDevices-page .device-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .connectedDevices-page .device-actions {
    margin-left: 0;
    margin-top: 15px;
    width: 100%;
  }
  .connectedDevices-page .device-actions .btn {
    width: 100%;
  }
}

/* --- DARK MODE FIX --- */
html.dark-theme .security-card-header {
  background-color: var(--background-dark-mode-menu-lateral);
  border-color: var(--border-dark-mode);
}

html.dark-theme .devices-main-container {
  background-color: var(--background-dark-mode-menu-lateral);
  border: none;
  color: var(--text-thowine-dark);
}

html.dark-theme .section-title {
  color: var(--text-thowine-dark);
}
html.dark-theme .section-description {
  color: var(--text-thowine-dark);
}

html.dark-theme .connectedDevices-page .device-item {
  background-color: var(--background-main-dark-mode);
  border: 1px solid var(--border-dark-mode);
  border-radius: 8px;
  box-shadow: none !important;
  margin: 8px !important;
}

html.dark-theme .connectedDevices-page .device-name {
  color: var(--text-thowine-dark);
}
html.dark-theme .connectedDevices-page .device-meta {
  color: var(--text-thowine-dark);
  background-color: transparent !important;
}

html.dark-theme .connectedDevices-page .device-icon {
  background-color: rgba(255, 255, 255, 0.05);
  color: #b0b0b0;
}

html.dark-theme .connectedDevices-page #revokeDeviceModal {
  background-color: #3a2a2a;
  border-color: #6b4444;
}
