/**
 * Customer Pages - Modern Mobile App & Desktop Design
 * Mobile: App-like bottom nav, full-width cards
 * Desktop: Sidebar + main content, professional layout
 */

/* ========== CUSTOMER LAYOUT ========== */
.customer-layout {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50, #f8fafc);
}

.customer-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  overflow-y: auto;
}

.customer-sidebar-brand {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.customer-sidebar-brand a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.customer-sidebar-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  margin: var(--space-3);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
  color: #e2e8f0;
  transition: background 0.2s;
}

.customer-sidebar-profile:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.customer-sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}

.customer-sidebar-name {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.customer-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9375rem;
  font-weight: 500;
}

.customer-sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.customer-sidebar-nav a.active {
  background: rgba(250, 86, 8, 0.15);
  color: #fff;
  border-left: 3px solid var(--primary);
}

.customer-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}

.customer-sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.customer-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.customer-sidebar-footer a:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.customer-sidebar-footer .footer-icon {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  flex-shrink: 0;
}

.customer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.customer-main-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.customer-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--gray-700);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.customer-menu-toggle:hover {
  background: var(--gray-100);
}

.customer-main-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.02em;
}

.customer-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.customer-header-avatar-link {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gray-200);
  transition: transform 0.2s, box-shadow 0.2s;
}

.customer-header-avatar-link:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.customer-header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.customer-content {
  flex: 1;
  padding: var(--space-5);
  overflow-y: auto;
}

/* ========== CUSTOMER CARDS ========== */
.customer-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.customer-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.customer-card-body {
  padding: var(--space-5);
}

.customer-card-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customer-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

/* ========== STAT CARDS ========== */
.customer-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.customer-stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.customer-stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.customer-stat-label {
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
}

.customer-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  display: block;
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}

.customer-stat-card.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.customer-stat-card.primary .customer-stat-label,
.customer-stat-card.primary .customer-stat-value {
  color: #fff;
}

/* ========== HERO SECTION ========== */
.customer-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5);
  margin-bottom: var(--space-6);
  color: #fff;
  box-shadow: 0 8px 24px rgba(250, 86, 8, 0.25);
}

.customer-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
}

.customer-hero-subtitle {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin: 0;
}

.customer-hero-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.customer-hero-label {
  font-size: 0.8125rem;
  opacity: 0.9;
  display: block;
  margin-bottom: 4px;
}

.customer-hero-amount {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ========== LIST ITEMS ========== */
.customer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.customer-list-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.customer-list-item:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateX(4px);
  border-color: var(--primary);
}

.customer-list-item-main {
  flex: 1;
  min-width: 0;
}

.customer-list-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  display: block;
  margin-bottom: 4px;
}

.customer-list-item-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.customer-list-item-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.customer-list-item-amount {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
}

/* ========== SIMPLE HEADER (for pages without sidebar) ========== */
.customer-simple-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-5);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-top: 0;
}

.customer-simple-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
}

.customer-back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.customer-back-btn:hover {
  background: var(--gray-100);
}

.customer-simple-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.02em;
}

/* ========== EMPTY STATES ========== */
.customer-empty {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.customer-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.customer-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 var(--space-2);
}

.customer-empty-desc {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin: 0 0 var(--space-4);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .customer-layout {
    flex-direction: column;
  }

  .customer-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    width: 280px;
  }

  .customer-sidebar.is-open {
    left: 0;
  }

  .customer-menu-toggle {
    display: block;
  }

  .customer-main {
    width: 100%;
  }

  .customer-main-header {
    padding: var(--space-3) var(--space-4);
  }

  .customer-main-title {
    font-size: 1.25rem;
  }

  .customer-content {
    padding: var(--space-4);
  }

  .customer-stat-grid {
    grid-template-columns: 1fr;
  }

  .customer-hero {
    padding: var(--space-5) var(--space-4);
  }

  .customer-hero-amount {
    font-size: 1.5rem;
  }

  .customer-sidebar-profile {
    display: none;
  }

  .customer-simple-header {
    padding: var(--space-3) var(--space-4);
  }

  .customer-simple-title {
    font-size: 1.125rem;
  }
}

/* Mobile overlay when sidebar is open */
@media (max-width: 768px) {
  body.customer-sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* ========== BUTTONS ========== */
.btn-white {
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(255,255,255,0.3);
  font-weight: 600;
}

.btn-white:hover {
  background: rgba(255,255,255,0.9);
  color: var(--primary-dark);
}

/* ========== BOTTOM NAVIGATION (Mobile) ========== */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.app-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2);
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s;
  flex: 1;
  max-width: 80px;
}

.app-bottom-nav a svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.app-bottom-nav a.active {
  color: var(--primary);
}

.app-bottom-nav a span {
  font-size: 0.6875rem;
}

@media (min-width: 769px) {
  .app-bottom-nav {
    display: none;
  }
}

/* Body padding for bottom nav */
body.body-with-bottom-nav {
  padding-bottom: 70px;
}

@media (min-width: 769px) {
  body.body-with-bottom-nav {
    padding-bottom: 0;
  }
}

