:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #e91e8c;
  --accent-dim: #ad1457;
  --success: #34a853;
  --error: #ea4335;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #14171d;
}

.brand .logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
}

.brand .subtitle {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.card,
.dashboard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h1,
.dashboard h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1115;
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent-dim);
  border-color: transparent;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #252a33;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none;
  font-weight: 600;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: var(--error);
  margin-top: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar h1 {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.data-table th {
  background: #14171d;
  color: var(--muted);
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #1e3a2f;
  border: 1px solid var(--success);
  color: #b7e1c4;
}

.alert.error {
  background: #3a1e1e;
  border-color: var(--error);
  color: #f5b4b4;
}

.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: var(--card);
  color: var(--text);
  max-width: 480px;
  width: calc(100% - 32px);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal-inner {
  padding: 22px;
}

.modal-inner h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-actions .btn {
  font-size: 0.85rem;
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.whoami {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .whoami {
    display: none;
  }
}

.table-loading {
  padding: 10px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.pager-label {
  font-size: 0.88rem;
  color: var(--muted);
}

.modal.modal-wide {
  max-width: 560px;
}

.admin-list {
  max-height: min(50vh, 360px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.admin-row:last-child {
  border-bottom: none;
}

.admin-row .email {
  color: var(--muted);
  font-size: 0.82rem;
}

select.status-select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f1115;
  color: var(--text);
  font-size: 0.85rem;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
