:root {
  --bg1: #0b1220;
  --bg2: #070a12;
  --card: rgba(255,255,255,0.07);
  --card2: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.14);
  --text: rgba(255,255,255,0.94);
  --muted: rgba(255,255,255,0.68);
  --accent: #4f8cff;
  --accent2: #22d3ee;
  --danger: #ff4d6d;
  --ok: #2ee59d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(124,92,255,.20), transparent 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(34,211,238,.18), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

.container { max-width: 1120px; margin: 0 auto; padding: 26px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.brand { display: flex; gap: 10px; align-items: center; }
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  object-fit: contain;
  padding: 6px;
}
.brand h1 { font-size: 16px; margin: 0; letter-spacing: 0.2px; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }

.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-top: 18px; }
@media (max-width: 900px){ .grid { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

.card h2 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.table th, .table td {
  padding: 12px 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.table th { text-align: left; color: var(--muted); font-weight: 600; }
.table tr:hover td { background: rgba(255,255,255,0.04); }

input, select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.20);
  color: var(--text);
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(124,92,255,0.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.12);
}
label { display:block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }

.btn {
  display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(79,140,255,0.24), rgba(34,211,238,0.16));
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-0.5px); }
.btn-danger { background: rgba(255,77,109,0.15); border-color: rgba(255,77,109,0.35); }
.btn-ghost { background: transparent; }

.flash {
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card2);
  margin-bottom: 12px;
}
.flash.ok { border-color: rgba(46,229,157,0.35); }
.flash.err { border-color: rgba(255,77,109,0.35); }

.actions { display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.topbar .actions { margin-top: 0; align-items: center; justify-content: flex-end; }
.topbar .muted { font-size: 12px; }

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(0,0,0,0.16);
}
.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: linear-gradient(135deg, rgba(79,140,255,0.70), rgba(34,211,238,0.55));
  color: rgba(255,255,255,0.95);
}
.profile-meta { line-height: 1.05; }
.profile-name { font-size: 12px; font-weight: 700; }
.profile-role { font-size: 11px; color: var(--muted); }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}
.loading-overlay.is-visible { display: flex; }
.loading-card {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(10,14,25,0.75);
  border-radius: 18px;
  padding: 18px 18px;
  width: min(460px, 92vw);
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
  border-top-color: rgba(255,255,255,0.85);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-weight: 700; }
.loading-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Auth pages */
.auth-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 0 8px;
}
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.auth-logo--big {
  width: min(260px, 70vw);
  height: auto;
}
.auth-card {
  width: 100%;
  max-width: 460px;
}
.auth-logo {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.35));
}
.auth-card h2 {
  font-size: 22px;
  margin: 0 0 10px;
  text-align: center;
}
.auth-card .muted { margin: 0; line-height: 1.35; }
