:root {
  --bg: #0b0f17;
  --panel: #131a26;
  --border: #232f43;
  --text: #e6edf7;
  --muted: #8b9bb4;
  --gold: #eab308;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-demo {
  background: rgba(234, 179, 8, 0.16);
  color: var(--gold);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.badge-ok {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
}

.badge-err {
  background: rgba(239, 68, 68, 0.16);
  color: var(--red);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.card-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

button,
.btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #243044;
  color: var(--text);
}

.btn-gold {
  background: var(--gold);
  color: #111827;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.status-msg {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: #0f1623;
  border: 1px solid var(--border);
}

.login-wrap {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.login-wrap h1 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.form-group {
  margin-top: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
}

.error-box {
  margin-top: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.85rem;
}
