/* =====================================================================
   Society Manager — Modern Colorful / Glassmorphism Design System
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Core gradient palette */
  --grad-violet: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  --grad-blue:   linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --grad-pink:   linear-gradient(135deg, #ec4899 0%, #f97316 100%);
  --grad-green:  linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --grad-amber:  linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-indigo: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-sunset: linear-gradient(135deg, #f43f5e 0%, #f59e0b 50%, #facc15 100%);
  --grad-ocean:  linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);

  --primary: #6d28d9;
  --primary-soft: #7c3aed;
  --accent: #f97316;
  --ink: #1e1b2e;
  --muted: #6b7280;
  --sidebar-width: 264px;

  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px rgba(76, 29, 149, 0.10);
  --card-radius: 18px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(124, 58, 237, 0.14), transparent 40%),
    radial-gradient(circle at 92% 18%, rgba(236, 72, 153, 0.13), transparent 38%),
    radial-gradient(circle at 18% 90%, rgba(20, 184, 166, 0.13), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(245, 158, 11, 0.10), transparent 40%),
    #f6f5fb;
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .brand, .stat-card h3 {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

/* ---------- Auth pages ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(124, 58, 237, 0.55), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.45), transparent 45%),
    radial-gradient(circle at 25% 85%, rgba(6, 182, 212, 0.45), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(245, 158, 11, 0.35), transparent 45%),
    linear-gradient(135deg, #2a1357 0%, #4c1d95 45%, #6d28d9 100%);
}
.auth-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 2;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(30, 10, 70, 0.35);
}
.auth-card .fa-building-shield {
  background: var(--grad-violet);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-card .btn-primary {
  background: var(--grad-violet);
  border: none;
}

/* ---------- App shell ---------- */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(195deg, #2a1357 0%, #4c1d95 55%, #5b21b6 100%);
  color: #fff;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.25s ease;
  box-shadow: 4px 0 24px rgba(76, 29, 149, 0.18);
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.app-sidebar .brand {
  padding: 22px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}
.app-sidebar .brand i {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.3rem;
}
/* Logo in sidebar */
.sidebar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  padding: 2px;
}
/* Logo in login page */
.login-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  margin: 0 auto 4px;
  filter: drop-shadow(0 4px 12px rgba(76,29,149,0.25));
}

.app-sidebar .nav-link {
  color: rgba(255,255,255,0.72);
  padding: 11px 20px;
  margin: 2px 12px;
  font-size: 0.91rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 11px;
  border-left: none;
  transition: all 0.18s ease;
}
.app-sidebar .nav-link i {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}
.app-sidebar .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  transform: translateX(2px);
}
.app-sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.95), rgba(236,72,153,0.9));
  color: #fff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
.app-sidebar .nav-section {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
  padding: 18px 24px 6px;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}
.app-topbar h5 {
  font-weight: 700;
  color: var(--ink);
}
.app-content {
  padding: 28px;
  flex: 1;
}
.app-footer {
  padding: 16px 28px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

/* ---------- Glass cards ---------- */
.card {
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--glass-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(124, 58, 237, 0.10);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--ink);
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  padding: 16px 20px;
}

/* ---------- Stat / gradient cards ---------- */
.stat-card {
  border: none;
  border-radius: var(--card-radius);
  color: #fff;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(76, 29, 149, 0.22);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.14);
  border-radius: 50%;
}
.stat-card .icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
}
.stat-card h3 { font-weight: 800; margin: 12px 0 0; position: relative; z-index: 1; }
.stat-card p { margin: 0; opacity: 0.92; font-size: 0.85rem; position: relative; z-index: 1; }

.bg-grad-1 { background: var(--grad-violet); }
.bg-grad-2 { background: var(--grad-sunset); }
.bg-grad-3 { background: var(--grad-green); }
.bg-grad-4 { background: var(--grad-pink); }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
  border-bottom: none;
  padding: 13px 16px;
}
.table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  border-color: rgba(124, 58, 237, 0.07);
}
.table-hover tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

/* ---------- Badges ---------- */
.badge-soft-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.badge-soft-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.badge-soft-danger  { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }
.badge-soft-info    { background: linear-gradient(135deg, #dbeafe, #c7d2fe); color: #3730a3; }
.badge-soft-secondary { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; }
.badge {
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.74rem;
}

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; font-size: 0.88rem; }
.btn-primary {
  background: var(--grad-violet);
  border: none;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.32);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--grad-violet);
  filter: brightness(1.08);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}
.btn-success {
  background: var(--grad-green);
  border: none;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
.btn-success:hover { background: var(--grad-green); filter: brightness(1.08); }
.btn-danger, .btn-outline-danger:hover {
  background: var(--grad-pink);
  border: none;
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.3);
}
.btn-outline-primary {
  border: 1.5px solid #c4b5fd;
  color: var(--primary);
}
.btn-outline-primary:hover { background: var(--grad-violet); border-color: transparent; }
.btn-outline-secondary { border: 1.5px solid #e2e8f0; color: var(--muted); }
.btn-light {
  background: rgba(124, 58, 237, 0.07);
  border: none;
  color: var(--primary);
}
.btn-light:hover { background: rgba(124, 58, 237, 0.14); color: var(--primary); }
.btn-warning { background: var(--grad-amber); border: none; color: #fff; }
.btn-sm { border-radius: 8px; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid #e9e4f7;
  padding: 9px 13px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.7);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.15);
}
.form-label { font-weight: 600; font-size: 0.85rem; color: var(--ink); }

/* ---------- Modals ---------- */
.modal-content {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 25px 60px rgba(30, 10, 70, 0.25);
}
.modal-header { border-bottom: 1px solid rgba(124, 58, 237, 0.10); }
.modal-footer { border-top: 1px solid rgba(124, 58, 237, 0.10); }
.modal-title { font-family: 'Outfit', sans-serif; font-weight: 700; }

/* ---------- List groups ---------- */
.list-group-item {
  background: transparent;
  border-color: rgba(124, 58, 237, 0.08);
  padding: 14px 18px;
}

/* ---------- Alerts ---------- */
.alert { border: none; border-radius: 14px; font-weight: 500; }
.alert-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.alert-danger  { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }
.alert-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.alert-info    { background: linear-gradient(135deg, #dbeafe, #c7d2fe); color: #3730a3; }

/* ---------- Dropdowns ---------- */
.dropdown-menu {
  border-radius: 14px;
  border: 1px solid rgba(124, 58, 237, 0.1);
  box-shadow: 0 16px 40px rgba(76, 29, 149, 0.18);
  padding: 8px;
}
.dropdown-item { border-radius: 9px; padding: 8px 12px; font-size: 0.88rem; }
.dropdown-item:hover { background: rgba(124, 58, 237, 0.08); }

/* ---------- Misc ---------- */
.text-primary { color: var(--primary) !important; }
::selection { background: rgba(124, 58, 237, 0.25); }
