.device-page {
  padding: 20px;
  background: #f4f7f8;
  min-height: calc(100vh - 58px);
}

.device-header,
.device-panel,
.device-support {
  background: #fff;
  border: 1px solid #dfe8ec;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(28, 45, 56, .05);
}

.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.device-header h2 {
  margin: 0;
  color: #1f2933;
  font-weight: 850;
  font-size: 24px;
}

.device-header p,
.device-panel p {
  margin: 4px 0 0;
  color: #6b7c86;
  font-size: 13px;
}

.device-support {
  padding: 14px;
  margin-bottom: 14px;
}

.device-support-title {
  font-weight: 850;
  color: #26333b;
  margin-bottom: 10px;
}

.device-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.device-support-card {
  border: 1px solid #e2ebef;
  border-radius: 8px;
  padding: 11px;
  background: #f8fbfc;
}

.device-support-card strong {
  display: block;
  color: #22313f;
}

.device-support-card span {
  display: block;
  color: #6b7c86;
  font-size: 12px;
  margin-top: 4px;
}

.device-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.device-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.device-panel h3 {
  margin: 0;
  color: #26333b;
  font-size: 17px;
  font-weight: 850;
}

.device-filters {
  display: flex;
  gap: 8px;
  min-width: 340px;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #e7f5f2;
  color: #197465;
  font-size: 12px;
  white-space: nowrap;
}

.device-chip.offline,
.device-chip.error {
  background: #fdecec;
  color: #b42318;
}

.device-chip.new {
  background: #eef2f7;
  color: #52616b;
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.device-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.device-form-grid label span {
  display: block;
  margin-bottom: 6px;
  color: #40545e;
  font-weight: 750;
  font-size: 13px;
}

.device-span-2 {
  grid-column: span 2;
}

.device-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 28px;
}

.device-check span {
  margin: 0 !important;
}

@media (max-width: 900px) {
  .device-header,
  .device-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .device-filters,
  .device-form-grid {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .device-span-2 {
    grid-column: span 1;
  }
}

#deviceModal .modal-dialog {
  max-width: 860px;
  margin-inline: auto;
}

#deviceModal .modal-content {
  border-radius: 12px;
  overflow: hidden;
}

#deviceModal .modal-header {
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e0e9ed;
  background: #f8fbfc;
}

#deviceModal .modal-title {
  font-size: 16px;
  font-weight: 900;
  color: #22313f;
}

#deviceModal .modal-body {
  padding: 16px;
}

#deviceModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e0e9ed;
}

#deviceModal .modal-footer > * {
  margin: 0;
}

#deviceModal .form-control,
#deviceModal .form-select,
#deviceModal textarea {
  min-height: 40px;
}

.device-form-grid {
  grid-template-columns: repeat(2, minmax(210px, 1fr));
}
