* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

.inline-badge {
  font-size: 0.78rem;
  color: #94a3b8;
}

.summary {
  border-bottom: 1px solid #1e293b;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.summary h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #f8fafc;
}

.kpi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.kpi span {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.77rem;
}

.summary-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.btn {
  border: 1px solid #0e7490;
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: #e0f2fe;
  padding: 7px 11px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-soft {
  border: 1px solid #334155;
  background: #111827;
  color: #dbeafe;
}

.btn-ghost {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
}

.btn-danger {
  border: 1px solid #9f1239;
  background: linear-gradient(135deg, #be123c, #9f1239);
  color: #ffe4e6;
}

.btn-small {
  padding: 5px 9px;
  font-size: 0.72rem;
  border-radius: 7px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.groups {
  margin-bottom: 12px;
}

.groups h4,
.devices h4 {
  margin: 0 0 8px;
  color: #cbd5e1;
  font-size: 0.98rem;
  font-weight: 700;
}

.group-chip {
  display: inline-block;
  margin: 0 6px 6px 0;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  color: #cbd5e1;
  background: #0f172a;
}

.devices {
  overflow-x: auto;
}

.devices table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.devices th,
.devices td {
  text-align: left;
  border-bottom: 1px solid #1e293b;
  padding: 8px 8px;
  color: #cbd5e1;
  font-size: 0.86rem;
  vertical-align: middle;
}

.device-open-btn:not(.status-pill) {
  border: none;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}

.device-open-btn:not(.status-pill):hover {
  color: #67e8f9;
}

.devices th {
  color: #94a3b8;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  min-width: 62px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-online {
  color: #d1fae5;
  background: #064e3b;
  border-color: #065f46;
}

.status-offline {
  color: #ffe4e6;
  background: #4c0519;
  border-color: #881337;
}

.status-unknown {
  color: #fef3c7;
  background: #451a03;
  border-color: #92400e;
}

.assign-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 3px;
}

.assign-cell.dirty {
  border-color: #a16207;
  background: rgba(161, 98, 7, 0.12);
}

.assign-select,
.env-select {
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.82rem;
  min-width: 120px;
}

.warning,
.error {
  margin-top: 9px;
}

body.unauth-mode {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

@media (max-width: 980px) {
  .summary-actions {
    gap: 6px;
  }

  .btn {
    padding: 7px 10px;
    font-size: 0.78rem;
  }
}
