/* OrbitPay Credit Union Portal — Layout & Components
   Uses the design tokens from the base44 design. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, hsl(var(--background)), hsl(var(--background-elevated)));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: transparent; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 16rem;
  background: hsl(var(--background-elevated) / 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid hsl(var(--border));
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 39;
}
.sidebar-overlay.show { display: block; }

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: none !important; }
}

.main {
  flex: 1; min-width: 0;
  margin-left: 0;
  background: transparent;
}
@media (min-width: 1024px) {
  .main { margin-left: 16rem; }
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: hsl(var(--background-elevated) / 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid hsl(var(--border));
}
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.625rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
@media (min-width: 1024px) { .menu-toggle { display: none; } }
.topbar-brand { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.brand-mark {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.brand-mark-sm { width: 1.75rem; height: 1.75rem; font-size: 0.875rem; }
.topbar-title { font-weight: 700; color: hsl(var(--primary)); font-size: 0.95rem; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.user-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  font-size: 0.8rem;
  color: hsl(var(--foreground));
}
.user-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
}
.signout-btn {
  padding: 0.35rem 0.75rem; border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem; font-weight: 500;
}
.signout-btn:hover { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }

/* Sidebar inner */
.sidebar-inner { padding: 0.75rem 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem; }
.brand-name { font-weight: 700; color: hsl(var(--primary)); font-size: 0.95rem; }
.brand-sub { font-size: 0.7rem; color: hsl(var(--muted-foreground)); }
.nav-section { padding: 0.25rem; }
.nav-section-label {
  font-size: 0.7rem; font-weight: 700;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.75rem 0.75rem 0.4rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.625rem;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.15s;
}
.nav-item:hover { background: hsl(var(--secondary)); }
.nav-item.active {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.12), hsl(var(--accent) / 0.12));
  color: hsl(var(--primary));
  font-weight: 600;
  border-left: 3px solid hsl(var(--primary));
  padding-left: calc(0.75rem - 3px);
}
.nav-icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.icon { display: inline-flex; vertical-align: middle; }
.icon svg { width: 1.1rem; height: 1.1rem; }

/* Content */
.content { padding: 1.5rem; max-width: 80rem; margin: 0 auto; }
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.875rem; font-weight: 800; color: hsl(var(--primary)); }
.page-sub { color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: hsl(var(--primary)); }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-shell {
  width: 100%; max-width: 26rem;
  background: hsl(var(--card));
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 8px 32px hsl(var(--primary) / 0.06);
  border: 1px solid hsl(var(--border));
}
.auth-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white;
  border-radius: 9999px;
  font-size: 0.7rem; font-weight: 600;
  margin-bottom: 1rem;
}
.auth-title { font-size: 1.875rem; font-weight: 800; color: hsl(var(--primary)); margin-bottom: 0.25rem; line-height: 1.1; }
.auth-sub { color: hsl(var(--muted-foreground)); font-size: 0.875rem; margin-bottom: 1.5rem; }
.field-label { display: block; font-size: 0.8rem; font-weight: 600; margin: 0.75rem 0 0.4rem; color: hsl(var(--foreground)); }
.field-label .req { color: hsl(var(--destructive)); }
.input-wrap {
  display: flex; align-items: center;
  border: 1px solid hsl(var(--input));
  border-radius: 0.625rem;
  background: hsl(var(--card));
  transition: border-color 0.15s;
}
.input-wrap:focus-within { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1); }
.input-icon { padding: 0 0.5rem 0 0.75rem; color: hsl(var(--muted-foreground)); display: flex; }
.input-icon svg { width: 1.1rem; height: 1.1rem; }
.form-input {
  flex: 1; border: none; outline: none;
  padding: 0.7rem 0.75rem 0.7rem 0;
  background: transparent;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  width: 100%;
}
.form-input::placeholder { color: hsl(var(--muted-foreground)); }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin: 0.75rem 0 1rem; }
.checkbox-row input { accent-color: hsl(var(--primary)); }

.btn-primary {
  display: block; width: 100%;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white; border: none;
  border-radius: 0.625rem;
  font-size: 0.95rem; font-weight: 600;
  transition: all 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px hsl(var(--primary) / 0.25); }
.btn-outline {
  display: block; width: 100%;
  padding: 0.7rem 1rem;
  background: transparent;
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
  border-radius: 0.625rem;
  font-size: 0.875rem; font-weight: 500;
  margin-top: 0.5rem;
}
.btn-outline:hover { background: hsl(var(--primary) / 0.05); }
.link { color: hsl(var(--primary)); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; }
.divider { display: flex; align-items: center; gap: 0.5rem; margin: 1.25rem 0; color: hsl(var(--muted-foreground)); font-size: 0.7rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: hsl(var(--border)); }
.social-row { display: flex; gap: 0.5rem; }
.social-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.625rem;
  font-size: 0.8rem; font-weight: 500;
  color: hsl(var(--foreground));
}
.auth-foot { text-align: center; font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-top: 1.25rem; }

.alert { padding: 0.6rem 0.75rem; border-radius: 0.5rem; font-size: 0.8rem; margin-bottom: 0.75rem; }
.alert-error { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); }
.alert-success { background: hsl(var(--success) / 0.1); color: hsl(var(--success)); }

/* Dashboard */
.hero-banner {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white;
  padding: 1.5rem;
  border-radius: 1.25rem;
  margin-bottom: 1.5rem;
}
.hero-title { font-size: 1.5rem; font-weight: 700; }
.hero-sub { color: hsl(0 0% 100% / 0.85); margin-top: 0.25rem; font-size: 0.875rem; }

.profile-strip {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all 0.15s;
}
.profile-strip:hover { box-shadow: 0 4px 12px hsl(var(--primary) / 0.08); }
.profile-avatar {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem;
  flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 700; }
.profile-email { color: hsl(var(--muted-foreground)); font-size: 0.8rem; }
.profile-tags { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.tag { font-size: 0.65rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 9999px; }
.tag-warning { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.tag-success { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.chevron { width: 1.25rem; height: 1.25rem; color: hsl(var(--muted-foreground)); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.metric-card {
  padding: 1.25rem;
  border-radius: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  color: white;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.metric-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.9; }
.metric-value { font-size: 1.875rem; font-weight: 800; margin: 0.5rem 0 0.25rem; }
.metric-sub { font-size: 0.8rem; opacity: 0.9; }
.metric-gradient-1 { background: linear-gradient(135deg, hsl(330 75% 60%), hsl(20 90% 60%)); }
.metric-gradient-2 { background: linear-gradient(135deg, hsl(150 60% 45%), hsl(170 70% 40%)); }
.metric-gradient-3 { background: linear-gradient(135deg, hsl(220 50% 25%), hsl(200 60% 35%)); }
.metric-gradient-4 { background: linear-gradient(135deg, hsl(280 60% 75%), hsl(310 50% 75%)); }

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.action-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.action-card:hover { box-shadow: 0 4px 12px hsl(var(--primary) / 0.08); border-color: hsl(var(--primary) / 0.3); }
.action-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 0.625rem;
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.5rem;
}
.action-icon svg { width: 1.25rem; height: 1.25rem; }
.action-label { font-weight: 700; font-size: 0.9rem; color: hsl(var(--foreground)); }
.action-sub { color: hsl(var(--muted-foreground)); font-size: 0.8rem; margin-top: 0.25rem; }

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: 1rem;
  overflow: hidden;
}
.card-title { font-weight: 700; font-size: 1.1rem; }
.card-sub { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.list-item:hover { background: hsl(var(--secondary)); }
.list-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.list-icon {
  width: 2.25rem; height: 2.25rem; border-radius: 0.5rem;
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-icon svg { width: 1.1rem; height: 1.1rem; }
.list-title { font-weight: 600; font-size: 0.9rem; }
.list-sub { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.list-right { font-weight: 700; font-size: 0.9rem; }
.amount { font-weight: 700; }

.empty-state {
  background: hsl(var(--card));
  border: 1px dashed hsl(var(--border));
  border-radius: 1.25rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.empty-state svg { width: 2.5rem; height: 2.5rem; opacity: 0.5; }

.loading-state { padding: 2rem; text-align: center; color: hsl(var(--muted-foreground)); }
.spinner {
  width: 1.5rem; height: 1.5rem; border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-sm { font-size: 0.875rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }

.form-row { margin-bottom: 0.75rem; }
.form-row .input-wrap { background: hsl(var(--secondary)); }
