:root {
  --bg: #0f1115;
  --panel: #161922;
  --border: #262b38;
  --text: #e4e6eb;
  --text-dim: #9aa0ac;
  --accent: #4061bb;         /* brand blue — links, nav, identity */
  --accent-green: #52dd6b;   /* brand green — primary CTA buttons */
  --accent-lavender: #c4c6e7; /* brand lavender — secondary accents */
  --danger: #e05a5a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 1.25rem 1.25rem;
}

.sidebar-brand img {
  height: 28px;
  width: 28px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-nav a {
  padding: 0.6rem 1.25rem;
  color: var(--text-dim);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-nav a.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: rgba(64, 97, 187, 0.12);
}

.sidebar-footer {
  padding: 0.75rem 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.content {
  flex: 1;
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}

.content-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.logout-form { display: inline; margin: 0; }
.logout-form button {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.logout-form button:hover { color: var(--text); text-decoration: underline; }

.content-body {
  padding: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
}

th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

th {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.empty-state {
  color: var(--text-dim);
  padding: 1.5rem 0;
}

.stat-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  min-width: 140px;
}

.stat-card .value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-card .label {
  color: var(--accent-lavender);
  font-size: 0.85rem;
  opacity: 0.85;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}

.status-healthy, .status-running { color: #4ade80; border-color: #4ade8055; }
.status-draining, .status-provisioning, .status-migrating, .status-pending_payment { color: #facc15; border-color: #facc1555; }
.status-offline, .status-stopped, .status-decommissioned, .status-provision_failed { color: var(--danger); border-color: #e05a5a55; }

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 320px;
}

.auth-card h1 {
  margin-top: 0;
  font-size: 1.2rem;
}

.auth-card input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.auth-card button {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.btn-primary {
  background: var(--accent-green);
  color: #0f1115;
}
