/* Wspólny motyw wizualny (zgodny z OTA Server) */
body {
  padding-top: 70px;
  background-color: #f8f9fa;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-badge {
  font-size: 0.85rem;
}

.page-table td,
.device-table td,
.firmware-table td {
  vertical-align: middle;
}

.page-section-title {
  margin-bottom: 1rem;
}

.card-dark-header {
  background-color: #343a40;
  color: #fff;
}

.device-status-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.lwm-status-online {
  background-color: #28a745;
  color: #fff;
}

.lwm-status-offline {
  background-color: #e83e8c;
  color: #fff;
}

.lwm-status-unknown {
  background-color: #ffc107;
  color: #212529;
}

#map {
  height: 400px;
  width: 100%;
}

.site-footer {
  margin-top: 3rem;
  padding: 1rem 0;
  border-top: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 0.85rem;
}

.login-page {
  padding-top: 120px;
}

.editable:hover {
  background-color: #f1f3f5;
  cursor: pointer;
}

.edit-mode {
  display: flex;
  gap: 10px;
}

.edit-mode input {
  flex-grow: 1;
}

.card-stat-online {
  background-color: #28a745;
}

.card-stat-offline {
  background-color: #e83e8c;
}

/* Mobile-friendly tabela urządzeń */
@media (max-width: 767.98px) {
  .device-table-mobile .device-topic-col {
    display: none;
  }

  .device-table-mobile thead {
    display: none;
  }

  .device-table-mobile,
  .device-table-mobile tbody,
  .device-table-mobile tr,
  .device-table-mobile td {
    display: block;
    width: 100%;
  }

  .device-table-mobile tr {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
  }

  .device-table-mobile td {
    border: 0;
    border-bottom: 1px dashed #e9ecef;
    padding: 0.35rem 0.25rem;
  }

  .device-table-mobile td:last-child {
    border-bottom: 0;
    padding-top: 0.5rem;
  }

  .device-table-mobile td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
  }

  .device-table-mobile td::before {
    display: none;
  }

  .device-table-mobile .btn {
    width: 100%;
  }
}

/* Konfigurator urządzenia — wiersze w stylu ustawień iOS */
.settings-list .form-group:last-child {
  margin-bottom: 0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row-slider {
  flex-direction: column;
  align-items: stretch;
}

.settings-row-slider .custom-range {
  width: 100%;
}

.settings-label {
  font-weight: 500;
  color: #212529;
}

.timer-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.timer-disabled .btn-apply-field {
  opacity: 1;
  pointer-events: auto;
}

.timer-window-row {
  border: 1px solid #dee2e6;
}

.timer-day-label {
  font-size: 0.875rem;
  font-weight: normal;
  cursor: pointer;
  user-select: none;
}

.config-json-preview {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  max-height: 400px;
  resize: vertical;
}

.service-cmd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
