:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf5;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.login-card {
  max-width: 420px;
  margin: 8vh auto;
}

.brand h1 { margin: 0 0 0.25rem; font-size: 1.75rem; }
.brand p { margin: 0 0 1.5rem; color: var(--muted); }

form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover { background: var(--accent-hover); }
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.error { color: var(--danger); font-size: 0.9rem; margin-top: 0.75rem; }

#dashboard-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.topbar h1 { margin: 0; }
.topbar p { margin: 0.25rem 0 0; color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.stat-card .value { font-size: 1.75rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 0.85rem; }

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h2 { margin: 0; font-size: 1.1rem; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.suspended { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge.trial { background: rgba(245,158,11,0.15); color: var(--warning); }

.actions button {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  margin-right: 0.25rem;
}

code.key {
  background: #0f1419;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.usage { color: var(--accent); }

.usage-bar {
  margin-top: 0.35rem;
  height: 6px;
  background: #0f1419;
  border-radius: 999px;
  overflow: hidden;
  max-width: 120px;
}

.usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
