/* Responsive Visibility */
.desktop-view {
  display: none;
}

.mobile-view {
  display: block;
}

@media (max-width: 1023px) {
  /* Lock body scroll on mobile — only content containers scroll.
     Scoped to customer-layout so login page is unaffected. */
  body.customer-layout {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  body.customer-layout .mobile-view {
    height: 100%;
    overflow: hidden;
  }
}

@media (min-width: 1024px) {
  .desktop-view {
    display: block;
  }

  .mobile-view {
    display: none;
  }
}

.animate-bounce-subtle {
  animation: bounce-subtle 3s infinite;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.mobile-bg {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

/* Desktop Sidebar Styles */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: #64748B;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background-color: #F8FAFC;
  color: #1E293B;
}

.sidebar-link.active {
  background-color: #EFF6FF;
  /* blue-50 */
  color: #1D4ED8;
  /* blue-700 */
  border-left-color: transparent;
  /* Remove border if using full rounded bg */
  font-weight: 700;
}

/* Desktop Card Styles */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid transparent;
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stats-card-container {
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stats-card-blue {
  background-color: #EFF6FF;
  border: 1px solid #DBEAFE;
}

.stats-card-orange {
  background-color: #FFF7ED;
  border: 1px solid #FFEDD5;
}

.stats-card-red {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
}

.stats-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.stats-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  /* Subtle separator */
  padding-top: 16px;
  flex-wrap: wrap;
  /* Allow wrapping to prevent overlap */
  gap: 8px;
}

.stats-value-large {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.stats-label {
  font-size: 14px;
  color: #4B5563;
  font-weight: 500;
}

.stats-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stats-icon-blue {
  background-color: #3B82F6;
}

.stats-icon-yellow {
  background-color: #F59E0B;
}

.stats-icon-red {
  background-color: #EF4444;
}

/* Support Button Fix */
.support-btn {
  width: 100%;
  padding: 10px;
  background-color: #1D4ED8;
  /* blue-700 */
  color: white !important;
  /* Force white text */
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.support-btn:hover {
  background-color: #1E40AF;
  /* blue-800 */
}

/* Middle Section Grid */
.middle-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (min-width: 1024px) {
  .middle-section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.middle-section-stacked {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.view-all-link {
  font-size: 14px;
  color: #2563EB;
  font-weight: 600;
  text-decoration: none;
}

.action-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 24px;
  height: 100%;
}

/* Refer Earn Banner */
.refer-earn-banner {
  background: linear-gradient(to right, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

/* Active Chit Grid */
.active-chits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .active-chits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Extracted Inline Styles */

/* Sidebar */
.dashboard-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid #E2E8F0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-padding {
  padding: 24px;
}

.support-box-wrapper {
  padding: 24px;
}

.support-box {
  padding: 20px;
  background: #FFF7ED;
  border-radius: 12px;
  border: 1px solid #FFEDD5;
}

/* Global Reset */
* {
  box-sizing: border-box;
}

/* Main Layout */
/* Content Wrapper for Right Side */
.dashboard-content-wrapper {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header inside Wrapper */
.dashboard-header {
  background: white;
  height: 72px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  border-bottom: 1px solid #F1F5F9;
  padding: 0 32px;
  /* Restore padding */
}

/* Remove special header logo section styles if no longer needed or adjust */
.header-logo-section {
  display: flex;
  align-items: center;
  margin-right: auto;
}

/* Main Content Area */
.dashboard-main {
  flex: 1;
  padding: 0;
  /* Content padding handles inside */
  width: 100%;
}

/* Actions align right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dashboard-content-padding {
  padding: 32px;
}

/* Mobile View Styles */
.mobile-bg {
  background: #F8F9FA;
}

.mobile-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid #F1F5F9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  /* Safe area top spacer is handled via the inner div in the HTML */
}

.mobile-header-flex {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile header height: safe-area + 56px content row */
:root {
  --mobile-header-height: calc(env(safe-area-inset-top, 0px) + 56px);
  --mobile-nav-height: calc(env(safe-area-inset-bottom, 0px) + 60px);
}

.mobile-content-wrapper {
  /* Fixed scroll container: starts below fixed header, ends above fixed nav */
  position: fixed;
  top: var(--mobile-header-height);
  left: 0;
  right: 0;
  bottom: var(--mobile-nav-height);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 24px;
  background: #F8FAFC;
}

.mobile-savings-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid #F3F4F6;
}

.mobile-stat-box {
  border-radius: 12px;
  padding: 12px;
}

.mobile-stat-box-blue {
  background: #EFF6FF;
}

.mobile-stat-box-yellow {
  background: #FEF3C7;
}

.mobile-stat-box-green {
  background: #ECFDF5;
}

.mobile-stat-box-red {
  background: #FEF2F2;
}

.mobile-card-blue {
  background: #EFF6FF;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #DBEAFE;
}

.mobile-card-due {
  background: #FFF5F5;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #FED7D7;
}

.referral-banner {
  background: #F0F9FF;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #BAE6FD;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #E5E7EB;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 50;
}

.mobile-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  text-decoration: none;
  color: #6B7280;
}

.mobile-nav-link.active {
  color: #2563EB;
}

.icon-box-border {
  border: 1.5px solid currentColor;
  padding: 1px;
  border-radius: 4px;
}