:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 35%, #0f172a 100%);
  color: #0f172a;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto 2rem auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem 0 1rem;
  max-width: 960px;
  margin: 0 auto;
  color: white;
}

.site-header h1 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.site-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  opacity: 0.8;
  margin: 0;
}

.refresh-state {
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.85);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  background: #2563eb;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #1d4ed8;
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.panel {
  background: white;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.15);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.view-switcher {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
}

.view-switcher .view-btn {
  padding: 0.35rem 0.9rem;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
}

.view-switcher .view-btn.active {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.panel-actions button {
  margin-left: 0.5rem;
}

.muted {
  color: #475569;
  font-size: 0.9rem;
}

.note {
  margin-top: 1rem;
  line-height: 1.4;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.field input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
}

.error {
  color: #dc2626;
  min-height: 1.2rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 680px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.table-container {
  width: 100%;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable .arrow {
  margin-left: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.resource-section {
  margin-top: 1.2rem;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.resource-bar {
  width: 100%;
  height: 1.2rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
  display: flex;
}

.resource-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.resource-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.resource-legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.resource-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.status-pill.offline {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.status-pill.unknown {
  background: rgba(251, 191, 36, 0.2);
  color: #b45309;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.stats dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
}

.stats dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}
