@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Syne:wght@400;500;600;700&display=swap');

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

:root {
  --bg:         #080a10;
  --bg-card:    #0d1117;
  --bg-input:   #111827;
  --border:     #1f2937;
  --accent:     #3b82f6;
  --accent-h:   #2563eb;
  --accent-p:   #8b5cf6;
  --accent-ph:  #7c3aed;
  --text:       #f9fafb;
  --muted:      #6b7280;
  --error-bg:   rgba(239, 68, 68, 0.10);
  --error-bd:   rgba(239, 68, 68, 0.30);
  --error-tx:   #f87171;
  --success-bg: rgba(16, 185, 129, 0.10);
  --success-bd: rgba(16, 185, 129, 0.30);
  --success-tx: #34d399;
}

body {
  font-family: 'DM Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Grid achtergrond ────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ── Glow orb ────────────────────────────────────── */
.glow-orb {
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.18) 0%,
    rgba(59, 130, 246, 0.10) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Auth layout ─────────────────────────────────── */
.auth-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

/* ── Auth logo ───────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  display: block;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
}

.auth-logo-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-p));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.auth-logo-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Legacy brand (dashboard) ────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.brand-name {
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Card ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 2rem;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Form elements ───────────────────────────────── */
.form-group {
  margin-bottom: 1.125rem;
}

.form-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .form-input {
  padding-right: 2.75rem;
}

.form-input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
  color: var(--muted);
}

/* ── Wachtwoord toggle ───────────────────────────── */
.pw-toggle {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.pw-toggle:hover {
  color: var(--text);
}

/* ── Button ──────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-p) 100%);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  margin-top: 0.75rem;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.88;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-bd);
  color: var(--error-tx);
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success-tx);
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

/* ── Auth footer link ────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Dashboard layout ────────────────────────────── */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
}

.topbar-brand {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.topbar-name {
  color: var(--text);
}

.topbar-admin {
  color: var(--accent-p);
  text-decoration: none;
  padding: 0.3125rem 0.75rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  transition: border-color 0.15s, background 0.15s;
}

.topbar-admin:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.55);
}

.topbar-logout {
  color: var(--muted);
  text-decoration: none;
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  transition: border-color 0.15s, color 0.15s;
}

.topbar-logout:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Main content ────────────────────────────────── */
.main {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.125rem;
  font-weight: 500;
}

.page-sub {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.page-title-sep {
  color: var(--border);
  margin: 0 0.25rem;
}

.page-title-org {
  color: var(--accent);
}

/* ── Storage bar ─────────────────────────────────── */
.storage-bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.storage-label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.storage-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.storage-value {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Admin ───────────────────────────────────────── */
.admin-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-p);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.admin-org {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

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

.admin-org-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.admin-plan-badge {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.admin-org-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}

.admin-meta-dot {
  opacity: 0.4;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.admin-table th {
  text-align: left;
  padding: 0.625rem 1.25rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.6);
  vertical-align: middle;
  color: var(--text);
}

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

.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.admin-email {
  color: var(--muted) !important;
  font-size: 0.775rem !important;
}

.admin-role-badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.admin-role-badge.admin-role-eigenaar {
  color: var(--accent-p);
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.07);
}

.admin-role-badge.admin-role-superadmin {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.07);
}

.admin-no-users {
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 0.4rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-invite {
  display: inline-flex;
  align-items: center;
  padding: 0.6875rem 1.125rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-p) 100%);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-invite:hover {
  opacity: 0.88;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.btn-danger-sm {
  padding: 0.3rem 0.625rem;
  font-size: 0.725rem;
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 0.875rem;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  margin: 0 auto 1.25rem;
  width: 48px;
  height: 48px;
  opacity: 0.25;
  color: var(--text);
}

.empty-title {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.empty-text {
  font-size: 0.8125rem;
  color: var(--muted);
}
