/* =====================================================================
   EventSaaS admin theme — layered over Bootstrap 5.3
   A calm operations console: deep slate sidebar, paper-white workspace,
   one confident accent. Tenant panels override --accent from branding.
   ===================================================================== */
:root {
  --sidebar-bg: #0f172a;
  --sidebar-fg: #cbd5e1;
  --sidebar-fg-active: #ffffff;
  --sidebar-active: rgba(99, 102, 241, 0.18);
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --workspace: #f6f7fb;
  --card-border: #eceef3;
  --ink: #1e2433;
  --ink-soft: #6b7280;
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--workspace);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Shell layout ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex: 0 0 256px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
  color: #fff; font-weight: 700; letter-spacing: -0.01em; font-size: 1.05rem;
}
.sidebar .brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.sidebar .nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #64748b; padding: 14px 12px 6px;
}
.sidebar a.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  color: var(--sidebar-fg); text-decoration: none;
  border-radius: 9px; font-size: .9rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar a.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-fg-active); }
.sidebar a.nav-item svg { width: 18px; height: 18px; opacity: .85; flex: 0 0 18px; }
.sidebar .sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }

.workspace { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; }
.topbar .who { font-size: .82rem; color: var(--ink-soft); text-align: right; line-height: 1.2; }
.topbar .who strong { color: var(--ink); display: block; font-weight: 600; }

.content { padding: 26px; flex: 1; }

/* ---- Cards ---- */
.card { border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-title { font-weight: 650; letter-spacing: -0.01em; }

.stat-card { border: 1px solid var(--card-border); border-radius: 14px; background: #fff; padding: 18px 18px 16px; height: 100%; }
.stat-card .label { font-size: .78rem; color: var(--ink-soft); font-weight: 500; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.stat-card .value.small { font-size: 1.3rem; }
.stat-card .chip { font-size: .7rem; padding: 2px 8px; border-radius: 20px; background: #eef2ff; color: var(--accent); font-weight: 600; }

/* ---- Tables ---- */
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--card-border); }
.table td { vertical-align: middle; font-size: .9rem; }
.badge-soft { font-weight: 600; font-size: .72rem; padding: 4px 9px; border-radius: 20px; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-draft { background: #e2e8f0; color: #334155; }
.badge-open { background: #dbeafe; color: #1e40af; }

/* ---- Buttons / accents ---- */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { filter: brightness(.94); color: var(--accent-ink); }
.form-label { font-weight: 600; font-size: .82rem; color: #374151; }
.form-control, .form-select { border-radius: 9px; border-color: #e2e6ee; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .18rem rgba(79,70,229,.14); }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 500px at 50% -10%, #1e293b, var(--workspace)); padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 34px 30px; box-shadow: 0 24px 60px rgba(15,23,42,.16); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 22px; }
.auth-brand .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: grid; place-items: center; color: #fff; font-weight: 800; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -280px; z-index: 50; transition: left .2s; box-shadow: 12px 0 40px rgba(0,0,0,.3); }
  .sidebar.open { left: 0; }
  .app-shell.sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 40; }
}
