:root {
  --bg: #0f1016;
  --surface: #171925;
  --surface-2: #1f2232;
  --text: #f8f5f2;
  --muted: #a8adbf;
  --line: #2f344a;
  --accent: #d8a3ad;
  --accent-2: #9abcae;
  --danger: #ef7d7d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top, #1a1d2c, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  z-index: 0;
}
.bg-glow-1 { width: 360px; height: 360px; background: var(--accent); top: -120px; left: -80px; }
.bg-glow-2 { width: 360px; height: 360px; background: var(--accent-2); right: -80px; bottom: -120px; }

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 24px;
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  margin: 0 0 6px;
}
.brand-small { font-size: 1.6rem; }
.muted { color: var(--muted); margin-top: 0; }
.hidden { display: none; }

.card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.login-card { max-width: 460px; margin: 80px auto; }

label { display: block; margin: 10px 0 6px; font-weight: 600; color: #d8dcef; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101320;
  color: var(--text);
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #151515;
}
.btn-secondary { background: var(--surface-2); color: var(--text); }
.full { width: 100%; margin-top: 14px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: #ebedf8;
  background: #111423;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
}
.stat-card h3 { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }
.stat-card p { margin: 0; font-size: 1.5rem; font-weight: 700; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.toolbar {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr auto;
  gap: 8px;
  width: min(760px, 100%);
}

.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.details-card { min-height: 320px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}
.detail-item h4 { margin: 0 0 4px; color: var(--muted); font-size: .82rem; }
.detail-item p { margin: 0; font-size: 1rem; font-weight: 700; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th { color: #c8cee3; font-size: .9rem; }
.action-group { display: flex; flex-wrap: wrap; gap: 6px; }
.action-btn {
  border: 1px solid var(--line);
  background: #121628;
  color: #e8ecfb;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .78rem;
  cursor: pointer;
}
.action-btn:hover { border-color: var(--accent-2); }

.status {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .78rem;
  text-transform: capitalize;
  font-weight: 700;
}
.status.active { background: rgba(114, 232, 168, 0.18); color: #95f2bb; }
.status.provisioning { background: rgba(240, 210, 131, 0.2); color: #ffe09b; }
.status.suspended, .status.cancelled { background: rgba(255, 131, 131, 0.18); color: #ffadad; }

.modal {
  width: min(920px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #131726;
  color: var(--text);
  padding: 18px;
}
.modal::backdrop { background: rgba(6,7,10,0.72); }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.users-list-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
}
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 260px;
  overflow: auto;
}
.activity-list li {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-meta {
  color: var(--muted);
  font-size: .82rem;
}
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}
.tab-btn {
  border: 1px solid var(--line);
  background: #111524;
  color: #d2d9ef;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1b1b1b;
  border-color: transparent;
}
.tab-content { margin-top: 6px; }

.error { color: var(--danger); min-height: 20px; }

@media (max-width: 820px) {
  .container { padding: 16px; }
  .panel-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .section-head, .topbar { flex-direction: column; align-items: flex-start; }
}
