:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1f2937;
  --border: #2f3b4d;
  --text: #e5edf5;
  --muted: #9aa9bd;
  --accent: #5eead4;
  --danger: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #081019 0%, #0d1117 100%);
  color: var(--text);
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.hero,
.panel,
.messages {
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 18px;
}

.auth-box,
.panel-head,
.actions {
  display: flex;
  gap: 12px;
}

.auth-box {
  flex-direction: column;
  min-width: 280px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.messages {
  min-height: 48px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--muted);
}

.messages.success { color: var(--accent); }
.messages.error { color: var(--danger); }

.panel {
  display: none;
  padding: 20px;
}

.panel.active { display: block; }

.panel-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card,
.list-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.card strong { font-size: 1.3rem; }

.list {
  display: grid;
  gap: 10px;
}

.list-item.stacked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.subpanel {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table button {
  margin-right: 8px;
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.status-badge.active {
  color: #8ef0b0;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.25);
}

.status-badge.pending {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.16);
  border-color: rgba(234, 179, 8, 0.28);
}

.status-badge.overdue,
.status-badge.suspended {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.28);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.status-chip.online {
  color: #8ef0b0;
  background: rgba(34, 197, 94, 0.15);
}

.status-chip.offline {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
}

button,
input,
select {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1723;
  color: var(--text);
  padding: 10px 12px;
}

button { cursor: pointer; }
button:hover { border-color: var(--accent); }
input { width: 100%; }

.link-button {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent);
  text-align: left;
}

@media (max-width: 900px) {
  .hero,
  .list-item.stacked,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}
