.stats-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats article.attention::before,
.stats article.attention strong {
  color: var(--warn);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr);
  gap: var(--gap);
  align-items: stretch;
}

.dashboard-grid.lower {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr);
}

.dashboard-grid .panel {
  margin: 0;
  min-height: 168px;
  display: flex;
  flex-direction: column;
}

.dashboard-grid .panel .table-wrap,
.dashboard-grid .panel > ul {
  flex: 1;
}

.availability {
  font-size: 24px;
  color: var(--blue-bright);
  font-weight: 700;
}

.health-bar {
  height: 10px;
  margin: 22px 20px 12px;
  background: #0d1728;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.health-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--accent));
}

.health-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 20px;
  color: var(--muted);
  font-size: 13px;
}

.health-summary a,
.panel-title a,
.activity-card a {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.attention-panel,
.quiet-panel {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 168px;
}

.attention-panel {
  border-color: rgba(245, 166, 35, 0.45);
  background: linear-gradient(120deg, rgba(245, 166, 35, 0.1), #162338);
}

.attention-panel h1,
.quiet-panel h1 {
  margin: 4px 0;
  font-size: 18px;
}

.attention-panel p,
.quiet-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--warn);
  font-weight: 600;
}

.quiet-panel .eyebrow,
.success-empty {
  color: var(--ok);
}

.activity-card ul {
  list-style: none;
  margin: 0;
  padding: 4px 20px 14px;
}

.activity-card li {
  display: grid;
  gap: 2px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.activity-card li:last-child {
  border: 0;
}

.activity-card li span {
  font-size: 12px;
  color: var(--blue-bright);
}

.activity-card li b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card li time {
  font-size: 11px;
  color: var(--muted);
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.search-form,
.filter-form {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.search-form input {
  max-width: 460px;
}

.filter-form input {
  min-width: 180px;
  flex: 1;
}

.filter-form select {
  max-width: 200px;
}

.search-form button,
.filter-form button {
  background: #0d1728;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.search-form button:hover,
.filter-form button:hover {
  border-color: var(--blue-bright);
}

.search-form a,
.filter-form a {
  color: var(--muted);
  padding: 9px;
  white-space: nowrap;
}

.customers-panel {
  max-width: none;
}

.customer-link {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.customer-link:hover b {
  color: var(--blue-bright);
}

.customer-detail-nav {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.customer-detail-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.customer-detail-nav a:hover {
  color: var(--blue-bright);
}

.card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.card-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.card-actions > a,
.row-actions > a:not(.ssh):not(.web):not(.files) {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.card-actions form,
.row-actions form {
  display: inline;
}

.link-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.row-actions {
  white-space: nowrap;
}

.row-actions .ssh,
.row-actions .web,
.row-actions .files {
  padding: 5px 14px;
}

.edit-panel,
.message-panel,
.manual-panel,
.enrollment-panel {
  max-width: 960px;
}

.manual-wrap .manual-panel {
  max-width: 960px;
}

.edit-panel.wide {
  max-width: 960px;
}

.edit-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.form-actions > a {
  color: var(--muted);
}

.message-panel {
  padding: 24px 20px;
}

.message-panel h1 {
  margin: 0 0 8px;
  border: 0;
  padding: 0;
}

.message-panel p {
  color: var(--muted);
  margin: 0 0 18px;
}

@media (max-width: 1150px) {
  .stats-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .devices-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form {
    flex-wrap: wrap;
  }

  .filter-form input,
  .filter-form select {
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 900px) {
  .stats-four,
  .dashboard-grid,
  .dashboard-grid.lower,
  .cards {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .panel,
  .attention-panel,
  .quiet-panel {
    min-height: 0;
  }

  .search-form,
  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form input,
  .filter-form input,
  .filter-form select {
    max-width: none;
    width: 100%;
  }

  .row-actions {
    flex-wrap: wrap;
  }
}
