body.login-body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: linear-gradient(to right, #f4f7fb, #ffffff);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 80%;
  height: 80%;
  background: white;
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.15);
}

.login-panel {
  width: 40%;
  padding: 60px;
}

.login-brand img {
  width: 64px;
}

.login-brand h2 {
  margin-top: 20px;
}

.input-group {
  margin-top: 20px;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(to right, #2563eb, #4f46e5);
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.login-error {
  color: red;
  margin-top: 10px;
}

.login-right-panel {
  width: 60%;
  padding: 60px;
  color: white;
  background: linear-gradient(to bottom, #0f172a, #020617);
}

/* ============== APP SHELL (DASHBOARD, MEMBERSHIP, PROJECTS) ============== */

body.app-body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #020617; /* dark blue/black */
  color: #e5e7eb;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background: #020617;
  border-right: 1px solid #111827;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 20px;
}

.app-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.app-logo span {
  font-size: 16px;
  font-weight: 600;
}

/* Sidebar nav */
.app-nav {
  flex: 1;
  margin-top: 8px;
}

.app-nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  padding: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 999px;
  color: #9ca3af;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
  background: #111827;
  color: #e5e7eb;
}

.sidebar-link.active {
  background: #1d4ed8;
  color: #f9fafb;
}

/* User footer */
.app-sidebar-footer {
  padding: 12px;
  border-top: 1px solid #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.app-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Main content */
.app-main {
  flex: 1;
  background: #020617;
  padding: 20px 24px;
  overflow-y: auto;
}

/* Top bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.app-page-title {
  font-size: 22px;
  font-weight: 600;
}

/* Account dropdown */
.app-account {
  position: relative;
}

.app-account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}

.app-account-menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: #020617;
  border-radius: 8px;
  padding: 6px 0;
  border: 1px solid #1f2937;
  min-width: 160px;
  display: none;
  z-index: 50;
}

.app-account-menu.open {
  display: block;
}

.app-account-menu button {
  background: none;
  border: none;
  color: #e5e7eb;
  padding: 8px 12px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.app-account-menu button:hover {
  background: #111827;
}

/* Section animation we defined earlier */
.section-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.section-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Simple cards (for dashboard metrics – visuals later) */
.card {
  border-radius: 16px;
  background: #020617;
  border: 1px solid #111827;
  padding: 16px;
}

/* =========== LIGHT DASHBOARD LOOK =========== */

body.light-dashboard .app-main.app-main-light {
  background: #f3f4f6;
  color: #111827;
}

/* Grid layouts */
.dash-row {
  margin-bottom: 20px;
}

.dash-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dash-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr;
  gap: 16px;
}

/* Cards */
body.light-dashboard .card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-header h3 {
  margin: 0;
  font-size: 16px;
}

.card-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.card-body {
  margin-top: 4px;
}

/* KPI cards */
.kpi-card {
  padding: 16px 18px;
}

.kpi-label {
  font-size: 13px;
  color: #6b7280;
}

.kpi-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
}

/* Side summary panel */
.card-side .side-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 6px;
}

.side-item:last-child {
  border-bottom: none;
}

.side-item span {
  color: #6b7280;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.data-table th {
  font-weight: 600;
  color: #6b7280;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

/* ---- Missing grid helper (fixes long blank scroll) ---- */
.dash-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Make sure cards never collapse */
.card {
  min-height: 80px;
}

/* Ensure canvases have a height */
canvas {
  min-height: 150px;
}

.section-card {
  animation: fadeUp .6s ease forwards;
}

@keyframes fadeUp {
  from {opacity:.4; transform:translateY(10px)}
  to {opacity:1; transform:none}
}

.sidebar-link.active {
  background:#2563eb;
  color:white;
}
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-link {
  border: none;
  background: none;
  color: #2563eb;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Membership dropdown fix */
.sidebar-group {
  margin-top: 6px;
}

.sidebar-dropdown {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #cbd5e1;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.sidebar-dropdown:hover {
  background: rgba(255,255,255,0.08);
}

.sidebar-group.open .sidebar-dropdown {
  background: #2563eb;
  color: white;
}

.sidebar-submenu {
  display: none;
  margin-top: 4px;
}

.sidebar-group.open .sidebar-submenu {
  display: block;
}

.submenu-link {
  display: block;
  padding: 8px 18px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.submenu-link:hover {
  background: rgba(255,255,255,.08);
}

.chevron {
  float: right;
  font-size: 0.7rem;
}

/* Membership filters */
.membership-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-search {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  min-width: 240px;
}

.membership-toolbar select {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.muted {
  color: #6b7280;
  font-size: 0.85rem;
}
.btn-mini {
  padding: 4px 8px;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-mini.danger {
  background: #dc2626;
}

.btn-mini:hover {
  opacity: .85;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  font-size: .85rem;
}

.form-group input,
.form-group select {
  padding: .5rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.form-span {
  grid-column: span 2;
}
