/* ==========================================================================
   RATHNAYAKA FAMILY FUND - LUXURY DESIGN SYSTEM & STYLESHEET
   Deep Navy & Metallic Gold Premium Palette
   ========================================================================== */

:root {
  /* Deep Navy Palette */
  --navy-darkest: #071220;
  --navy-dark: #0B1B32;
  --navy-primary: #102847;
  --navy-medium: #1B3B66;
  --navy-light: #28538D;
  --navy-card: #0F223D;

  /* Metallic Gold Palette */
  --gold-light: #FFE082;
  --gold-accent: #D4AF37;
  --gold-dark: #AA820A;
  --gold-muted: #C5A059;

  /* Gradients */
  --gold-gradient: linear-gradient(135deg, #F3D275 0%, #D4AF37 50%, #AA820A 100%);
  --gold-border-gradient: linear-gradient(135deg, #F5D67D, #BF953F, #FCF6BA, #B38728);
  --navy-gradient: linear-gradient(180deg, #0B1B32 0%, #102847 50%, #1B3B66 100%);
  --navy-header-gradient: linear-gradient(135deg, #071220 0%, #0F223D 100%);
  --card-dark-gradient: linear-gradient(145deg, #0B1B32 0%, #102847 100%);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(212, 175, 55, 0.25);

  /* Backgrounds & Neutrals */
  --bg-light: #F6F8FC;
  --surface-white: #FFFFFF;
  --card-border: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --divider: #E2E8F0;

  /* Status Colors */
  --status-paid: #059669;
  --status-paid-bg: #ECFDF5;
  --status-paid-border: #6EE7B7;

  --status-pending: #D97706;
  --status-pending-bg: #FFFBEB;
  --status-pending-border: #FCD34D;

  --status-overdue: #DC2626;
  --status-overdue-bg: #FEF2F2;
  --status-overdue-border: #FCA5A5;

  --status-upcoming: #4F46E5;
  --status-upcoming-bg: #EEF2FF;
  --status-upcoming-border: #A5B4FC;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-gold: 0 8px 24px -4px rgba(212, 175, 55, 0.35);
  --shadow-navy: 0 8px 24px -4px rgba(7, 18, 32, 0.4);

  /* Dimensions & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-width: 270px;
  --header-height: 70px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', 'Inter', sans-serif;
  color: var(--navy-darkest);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--navy-medium);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold-dark);
}

/* Connection Banner */
.connection-banner {
  background: var(--status-pending);
  color: #fff;
  padding: 6px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.connection-banner.hidden {
  display: none !important;
}
.spinner-pulse {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: var(--navy-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 40, 71, 0.25);
}
.btn-primary:hover {
  background: var(--navy-medium);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 40, 71, 0.35);
  color: #fff;
}

.btn-gold {
  background: var(--gold-gradient);
  color: var(--navy-darkest);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -2px rgba(212, 175, 55, 0.5);
  color: var(--navy-darkest);
}

.btn-outline {
  background: transparent;
  border-color: var(--card-border);
  color: var(--navy-primary);
}
.btn-outline:hover {
  border-color: var(--navy-medium);
  background: rgba(16, 40, 71, 0.04);
}

.btn-danger {
  background: var(--status-overdue);
  color: #fff;
}
.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-1px);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */

.card {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-gold-border {
  border: 1px solid rgba(212, 175, 55, 0.35);
  position: relative;
}
.card-gold-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.card-navy {
  background: var(--card-dark-gradient);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.card-navy h1, .card-navy h2, .card-navy h3, .card-navy h4 {
  color: #ffffff;
}

/* Status Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-paid {
  background: var(--status-paid-bg);
  color: var(--status-paid);
  border: 1px solid var(--status-paid-border);
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid var(--status-pending-border);
}

.badge-overdue {
  background: var(--status-overdue-bg);
  color: var(--status-overdue);
  border: 1px solid var(--status-overdue-border);
}

.badge-upcoming {
  background: var(--status-upcoming-bg);
  color: var(--status-upcoming);
  border: 1px solid var(--status-upcoming-border);
}

.badge-admin {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(170, 130, 10, 0.25));
  color: var(--gold-dark);
  border: 1px solid var(--gold-accent);
}

.badge-member {
  background: rgba(16, 40, 71, 0.08);
  color: var(--navy-primary);
  border: 1px solid rgba(16, 40, 71, 0.2);
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-darkest);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: var(--surface-white);
  border: 1.2px solid var(--card-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-helper {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ==========================================================================
   AUTHENTICATION VIEW (SPLASH & AUTH)
   ========================================================================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-darkest);
  background-image: radial-gradient(circle at 50% 20%, #152B4B 0%, #071220 70%);
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.auth-header {
  background: var(--navy-gradient);
  padding: 36px 28px 28px;
  text-align: center;
  color: #fff;
  position: relative;
}

.auth-brand-logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2.5px solid var(--gold-accent);
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
}

.auth-subtitle {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 12px;
  background: var(--gold-gradient);
  color: var(--navy-darkest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.2px;
  border-radius: 20px;
  text-transform: uppercase;
}

.auth-body {
  padding: 30px 28px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}
.auth-alert.visible {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-alert.error {
  background: var(--status-overdue-bg);
  color: var(--status-overdue);
  border: 1px solid var(--status-overdue-border);
}
.auth-alert.success {
  background: var(--status-paid-bg);
  color: var(--status-paid);
  border: 1px solid var(--status-paid-border);
}

/* ==========================================================================
   APP SHELL LAYOUT (ADMIN & USER)
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar (Admin Portal) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy-darkest);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.sidebar-header {
  padding: 22px 20px;
  background: var(--navy-header-gradient);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold-accent);
  padding: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.nav-item:hover i {
  color: var(--gold-light);
}

.nav-item.active {
  background: var(--navy-medium);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.nav-item.active i {
  color: var(--gold-accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gold-gradient);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--status-overdue);
  color: #fff;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy-darkest);
  font-size: 14px;
  border: 1.5px solid var(--gold-accent);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header / Topbar */
.topbar {
  height: var(--header-height);
  background: var(--surface-white);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-darkest);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body {
  flex: 1;
  padding: 28px;
}

/* ==========================================================================
   USER PORTAL (MEMBER VIEW)
   ========================================================================== */

.user-layout .main-wrapper {
  margin-left: 0;
}

.user-navbar {
  background: var(--navy-darkest);
  color: #fff;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: var(--shadow-navy);
}

.user-navbar .topbar {
  background: transparent;
  border-bottom: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.user-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Greeting Hero Banner */
.hero-banner {
  background: var(--navy-gradient);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212, 175, 55, 0.25);
  margin-bottom: 24px;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

/* Total Fund Stat Card */
.total-fund-card {
  background: var(--navy-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  border: 1.5px solid var(--gold-accent);
  box-shadow: var(--shadow-gold);
  position: relative;
  margin-bottom: 24px;
}

.total-fund-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 6px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* KPI Metric Cards */
.kpi-card {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.kpi-info .kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-info .kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-darkest);
  line-height: 1.2;
}

.kpi-info .kpi-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: #F8FAFC;
  padding: 14px 18px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--navy-darkest);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--card-border);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

/* Photo Album Card */
.album-card {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(212, 175, 55, 0.4);
}

.album-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.album-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--navy-darkest);
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.album-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-darkest);
  margin-bottom: 4px;
}

.album-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-primary);
  background: rgba(16, 40, 71, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.album-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
  flex: 1;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 18, 32, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: var(--transition);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-darkest);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}
.modal-close:hover {
  color: var(--navy-darkest);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #F8FAFC;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--navy-darkest);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
  min-width: 280px;
}
.toast.success {
  background: #064E3B;
  border-left: 4px solid var(--status-paid);
}
.toast.error {
  background: #7F1D1D;
  border-left: 4px solid var(--status-overdue);
}
.toast.info {
  background: var(--navy-primary);
  border-left: 4px solid var(--gold-accent);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 40, 71, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--navy-medium);
  margin-bottom: 16px;
}
.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-darkest);
  margin-bottom: 6px;
}
.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto 20px;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Controls Defaults (Desktop) */
#mobile-menu-btn {
  display: none;
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.mobile-sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 32, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}
body.sidebar-open, body.modal-open {
  overflow: hidden !important;
}

/* User Navbar Classes */
.user-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.user-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.user-brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.user-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Mobile Bottom Navigation (Member Portal) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--navy-darkest);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  z-index: 990;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn i {
  font-size: 18px;
  transition: var(--transition);
}
.mobile-nav-btn:hover {
  color: #ffffff;
}
.mobile-nav-btn.active {
  color: var(--gold-light);
}
.mobile-nav-btn.active i {
  color: var(--gold-accent);
  transform: translateY(-2px);
}

/* Table Enhancements */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: #fff;
  position: relative;
}
.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(16, 40, 71, 0.2);
  border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-track {
  background: #F8FAFC;
}

.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy-light);
  padding: 6px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--divider);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Strictly Mobile-First & Touch-Friendly Adaptations
   ========================================================================== */

/* 1. TABLET SCREENS (<= 1024px) */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 20px; }
  .content-body { padding: 22px 20px; }
}

/* 2. MOBILE & PHABLET SCREENS (<= 768px) */
@media (max-width: 768px) {
  /* Prevent any horizontal screen sway */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Prevent auto-zooming on iOS inputs while keeping sleek aesthetic */
  .form-control, input, select, textarea {
    font-size: 16px !important;
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 42px;
  }
  .btn-sm {
    min-height: 34px;
    padding: 6px 10px;
  }

  /* Admin Shell Responsive Adaptations */
  #mobile-menu-btn {
    display: inline-flex !important;
  }

  .mobile-sidebar-close {
    display: inline-flex !important;
  }

  .sidebar {
    width: min(290px, 84vw);
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 1001;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100%;
  }

  .topbar {
    height: 60px;
    padding: 0 14px;
  }

  .topbar-left {
    gap: 10px;
    min-width: 0;
  }

  .topbar-title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .topbar-right {
    gap: 8px;
  }

  .content-body {
    padding: 14px 12px;
  }

  /* Member Portal Mobile Navigation */
  .user-container {
    padding: 14px 12px 84px !important; /* Space for bottom navigation bar */
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  #user-nav-photos-btn {
    display: none !important; /* Managed by bottom navigation on mobile */
  }

  .user-navbar .topbar {
    height: 56px;
    padding: 0 12px;
  }

  .user-brand-title {
    font-size: 14px;
    letter-spacing: 0.3px;
  }

  .user-brand-sub {
    display: none;
  }

  /* Grids Stack Gracefully */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Card Ergonomics */
  .card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .hero-banner {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
  }
  .hero-banner::after {
    display: none;
  }

  .total-fund-card {
    padding: 18px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }

  .total-fund-amount {
    font-size: clamp(24px, 7.5vw, 34px);
    line-height: 1.15;
    margin: 4px 0 8px;
    word-break: break-word;
  }

  /* KPI Metric Cards */
  .kpi-card {
    padding: 14px 12px;
    gap: 12px;
  }
  .kpi-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .kpi-info .kpi-value {
    font-size: 18px;
  }

  /* Data Tables Mobile Experience */
  .table-scroll-hint {
    display: flex !important;
  }

  .data-table th, .data-table td {
    padding: 10px 8px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  /* Modals: Native Mobile Bottom-Sheet UX */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 88vh !important;
    transform: translateY(100%);
    border-bottom: none !important;
  }
  .modal-overlay.active .modal-box {
    transform: translateY(0);
  }
  .modal-header {
    padding: 16px 18px;
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-body {
    padding: 18px 16px;
  }
  .modal-footer {
    padding: 14px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Auth Screens on Mobile */
  .auth-wrapper {
    padding: 14px 10px;
    align-items: flex-start;
  }
  .auth-box {
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin: 20px auto;
  }
  .auth-header {
    padding: 24px 16px 18px;
  }
  .auth-brand-logo {
    width: 66px;
    height: 66px;
    margin-bottom: 10px;
  }
  .auth-title {
    font-size: 16.5px;
    letter-spacing: 1px;
  }
  .auth-subtitle {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 2px 10px;
  }
  .auth-body {
    padding: 20px 16px;
  }

  /* Toast Positioning */
  .toast-container {
    bottom: 74px; /* Sits above mobile bottom nav bar */
    left: 12px;
    right: 12px;
    align-items: center;
  }
  .toast {
    width: 100%;
    min-width: auto;
    font-size: 13px;
    padding: 12px 16px;
  }
}

/* 3. COMPACT SMARTPHONE SCREENS (<= 480px) */
@media (max-width: 480px) {
  .logout-label {
    display: none;
  }

  .btn-logout-top {
    padding: 6px 9px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12.5px;
  }

  .topbar-title {
    max-width: 145px;
    font-size: 15px;
  }

  .user-brand-title {
    font-size: 13px;
  }

  .sidebar-logo {
    width: 34px;
    height: 34px;
  }

  /* Card content stacking */
  .album-card {
    padding: 16px 14px;
  }
  .album-header {
    gap: 10px;
  }
  .album-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .album-heading {
    font-size: 15.5px;
  }
}

