/* ==========================================================================
   Business Finance - Design System & Stylesheet (Mobile-First)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(16, 185, 129, 0.2);
  --accent: #3b82f6;
  
  --dark-bg: #090d16;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active: #10b981;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-focus: #10b981;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --warning: #f59e0b;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 20px rgba(16, 185, 129, 0.25);
  
  /* Dimensions & Spacing */
  --header-height: 64px;
  --bottom-nav-height: 68px;
  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   Typography & Badges
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-slate {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Alerts & Messages
   ========================================================================== */
.alert-container {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: #fca5a5;
}

.btn-outline-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-group {
  margin-bottom: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-error {
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Auth Layout (Login & Register)
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
              #f8fafc;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: fadeIn 0.4s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.auth-title {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   App Shell Layout (Header, Desktop Sidebar, Mobile Bottom Bar)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Desktop Sidebar - Hidden on Mobile */
.desktop-sidebar {
  display: none;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Extra bottom padding on mobile to accommodate bottom nav bar */
  padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
}

/* Mobile & Top Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-store-info {
  min-width: 0;
}

.header-store-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.header-tag {
  font-size: 0.6875rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.content-container {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
  transition: var(--transition);
}

.bottom-nav-item:hover {
  color: var(--primary);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px);
  stroke: var(--primary);
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.welcome-hero {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 60%, #047857 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.4);
}

.welcome-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-hero h1 {
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.welcome-hero p {
  color: #a7f3d0;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.store-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.kasir { background: #eff6ff; color: #3b82f6; }
.stat-icon.catatan { background: #fef3c7; color: #d97706; }
.stat-icon.laporan { background: #ecfdf5; color: #10b981; }
.stat-icon.profil { background: #f3e8ff; color: #9333ea; }

.stat-info h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-info p {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Placeholder Page Card */
.placeholder-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  max-width: 540px;
  margin: 1.5rem auto;
}

.placeholder-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Desktop Responsive Styles (Media Query >= 768px)
   ========================================================================== */
@media (min-width: 768px) {
  /* Hide Mobile Bottom Bar */
  .bottom-nav {
    display: none;
  }

  /* Reset Mobile Main Wrapper Bottom Padding */
  .main-wrapper {
    padding-bottom: 2rem;
  }

  /* Show Desktop Sidebar */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid #1e293b;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 60;
  }

  .sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid #1e293b;
  }

  .sidebar-brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
  }

  .sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    overflow-y: auto;
  }

  .sidebar-nav-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: #64748b;
    padding: 0.5rem 0.75rem 0.25rem;
  }

  .sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sidebar-text);
    transition: var(--transition);
  }

  .sidebar-nav-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
  }

  .sidebar-nav-link.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--sidebar-active);
    border-left: 3px solid var(--sidebar-active);
  }

  .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: #1e293b;
  }

  .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
  }

  .sidebar-user-details {
    min-width: 0;
    flex: 1;
  }

  .sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-user-phone {
    font-size: 0.6875rem;
    color: #94a3b8;
  }

  .header-store-name {
    max-width: 320px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .welcome-hero {
    padding: 2.25rem 2rem;
  }

  .welcome-hero h1 {
    font-size: 1.75rem;
  }
}

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

/* ==========================================================================
   Menu & Category Management Components (Mobile-First)
   ========================================================================== */

/* Page Header Action Bar */
.page-topbar {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.topbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* Big Thumb-Friendly CTA Button */
.btn-thumb {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  touch-action: manipulation;
}

/* Category Filter Pills (Horizontal Scroll on Mobile) */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  -webkit-overflow-scrolling: touch;
}

.category-filter-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-pill {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1.5px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: #cbd5e1;
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.filter-pill .pill-badge {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
}

.filter-pill.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Search Bar */
.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  min-height: 46px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 0.9375rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Product Card / List (Mobile-First) */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.product-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.product-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-category-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.product-price {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Large, Thumb-Friendly Action Buttons */
.btn-action-edit {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.btn-action-edit:hover {
  background: #dcfce7;
  transform: scale(1.05);
}

.btn-action-delete {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.btn-action-delete:hover {
  background: #fee2e2;
  transform: scale(1.05);
}

/* Empty State */
.empty-state-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-subtle);
  padding: 3rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Form Select Dropdown */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Delete Confirmation Card */
.delete-confirm-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid #fecaca;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 480px;
  margin: 2rem auto;
  box-shadow: var(--shadow-lg);
}

.delete-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--danger-light);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.delete-target-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0 1.5rem;
  text-align: left;
}

/* Category Management List */
.category-item-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.category-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.category-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Desktop Overrides for Menu & Topbar */
@media (min-width: 768px) {
  .page-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .topbar-actions {
    width: auto;
  }

  .search-input-wrap {
    max-width: 320px;
  }

  .product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-card {
    padding: 1.25rem;
  }
}

/* ==========================================================================
   KASIR / POS SYSTEM STYLES (Mobile-First & Desktop Split)
   ========================================================================== */

/* Main Layout Grid */
.pos-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  /* Extra bottom space for mobile floating cart bar */
  padding-bottom: 5.5rem;
}

/* POS Menu Items Grid */
.pos-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .pos-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pos-item-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 0.875rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  text-align: left;
  user-select: none;
  touch-action: manipulation;
  box-shadow: var(--shadow-sm);
}

.pos-item-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pos-item-btn:active {
  transform: scale(0.97);
}

.pos-item-btn.in-cart {
  border-color: var(--primary);
  background: #f0fdf4;
}

.pos-item-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-item-price {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--primary);
}

.pos-item-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* Mobile Floating Cart Summary Bar */
.mobile-cart-bar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 0.5rem);
  left: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #064e3b, #059669);
  color: white;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 25px rgba(6, 78, 59, 0.4);
  z-index: 45;
  cursor: pointer;
  animation: slideUp 0.3s ease;
}

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-bar-badge {
  background: white;
  color: #065f46;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-bar-total {
  font-size: 1.0625rem;
  font-weight: 800;
}

.cart-bar-label {
  font-size: 0.6875rem;
  color: #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cart-bar-action {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Mobile Cart Drawer (Bottom Sheet) */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.cart-drawer {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-header {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-title {
  font-size: 1.125rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.cart-item-info {
  min-width: 0;
  flex: 1;
}

.cart-item-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cart-item-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-stepper {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: var(--text-main);
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: var(--transition);
}

.btn-stepper:active {
  background: #e2e8f0;
  transform: scale(0.92);
}

.stepper-value {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
}

.cart-item-subtotal {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 70px;
  text-align: right;
}

.cart-drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Desktop Split View for POS */
.desktop-cart-panel {
  display: none;
}

@media (min-width: 768px) {
  .pos-layout {
    flex-direction: row;
    align-items: flex-start;
    padding-bottom: 1.5rem;
  }

  .pos-menu-column {
    flex: 1;
    min-width: 0;
  }

  .pos-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hide Mobile Floating Bar */
  .mobile-cart-bar {
    display: none;
  }

  /* Show Desktop Cart Panel */
  .desktop-cart-panel {
    display: flex;
    flex-direction: column;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    max-height: calc(100vh - var(--header-height) - 2.5rem);
    flex-shrink: 0;
  }
}

@media (min-width: 1100px) {
  .pos-menu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .desktop-cart-panel {
    width: 400px;
  }
}

/* ==========================================================================
   Payment Modal (Cash / QRIS)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.payment-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-method-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  margin: 1.25rem 0;
}

.method-tab {
  padding: 0.625rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  background: transparent;
  color: var(--text-muted);
}

.method-tab.active {
  background: white;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Quick Cash Chips */
.cash-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cash-chip {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: var(--transition);
}

.cash-chip:hover {
  background: #ecfdf5;
  border-color: var(--primary);
  color: var(--primary);
}

.cash-chip:active {
  transform: scale(0.95);
}

.change-display-box {
  background: #f8fafc;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.change-display-box.valid {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.change-display-box.invalid {
  background: var(--danger-light);
  border-color: #fca5a5;
}

.change-amount-text {
  font-size: 1.5rem;
  font-weight: 800;
}

.change-amount-text.valid { color: #065f46; }
.change-amount-text.invalid { color: #991b1b; }

/* ==========================================================================
   Digital Receipt (Struk ala Thermal Paper)
   ========================================================================== */
.receipt-wrapper {
  max-width: 420px;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.receipt-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
  border: 1px solid #e2e8f0;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
}

/* Zigzag top and bottom edges */
.receipt-header-branding {
  text-align: center;
  margin-bottom: 1.25rem;
}

.receipt-store-title {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.receipt-divider {
  border: none;
  border-top: 1.5px dashed #94a3b8;
  margin: 0.875rem 0;
}

.receipt-meta-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #475569;
}

.receipt-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  line-height: 1.35;
}

.receipt-item-name {
  font-weight: 600;
  color: var(--text-main);
}

.receipt-footer-greeting {
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 1.25rem;
}

/* WhatsApp Share Button */
.btn-whatsapp {
  background: #25d366;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-1px);
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   CATATAN PENGELUARAN (EXPENSE TRACKER) STYLES
   ========================================================================== */

.expense-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .expense-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.expense-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition);
}

.expense-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.expense-summary-card.total {
  border-left: 4px solid var(--danger);
}

.expense-summary-card.modal {
  border-left: 4px solid var(--primary);
}

.expense-summary-card.operasional {
  border-left: 4px solid #f59e0b;
}

.summary-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card-amount {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.summary-card-amount.total { color: var(--danger); }
.summary-card-amount.modal { color: var(--primary); }
.summary-card-amount.operasional { color: #d97706; }

/* Expense Type Badges */
.badge-modal {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-operasional {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Expense Item Cards */
.expense-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.expense-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.expense-item-info {
  min-width: 0;
  flex: 1;
}

.expense-item-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.expense-item-notes {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.expense-item-amount {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--danger);
  white-space: nowrap;
}

/* Expense Type Switcher (Thumb Buttons) */
.type-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.125rem;
}

.type-switch-btn {
  padding: 0.875rem 0.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: var(--transition);
  touch-action: manipulation;
}

.type-switch-btn:hover {
  border-color: #cbd5e1;
}

.type-switch-btn.active.modal {
  border-color: var(--primary);
  background: #ecfdf5;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.type-switch-btn.active.operasional {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* History Date Filter Bar */
.history-filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

/* ==========================================================================
   LAPORAN KEUANGAN (FINANCIAL REPORTS) STYLES
   ========================================================================== */

/* Report Main Tabs */
.report-tabs-wrapper {
  background: #f1f5f9;
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.report-tab-link {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.report-tab-link:hover {
  color: var(--text-main);
}

.report-tab-link.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Period Filter Bar */
.report-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.report-nav-arrows {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.report-arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.report-arrow-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* 3 Main KPI Big Cards */
.report-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 680px) {
  .report-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.report-kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.report-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.report-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.report-kpi-card.sales::before { background: linear-gradient(90deg, #10b981, #059669); }
.report-kpi-card.expenses::before { background: linear-gradient(90deg, #ef4444, #f43f5e); }
.report-kpi-card.profit::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }

.kpi-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.kpi-value.sales { color: #047857; }
.kpi-value.expenses { color: #b91c1c; }
.kpi-value.profit { color: #1d4ed8; }
.kpi-value.loss { color: #dc2626; }

.kpi-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Growth badges */
.growth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.growth-badge.up {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.growth-badge.down {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.growth-badge.neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Secondary Stat Grid (AOV, Count, Best/Worst Day) */
.report-sub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 680px) {
  .report-sub-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.report-sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sub-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sub-card-value {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-main);
}

.sub-card-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Expense Breakdown Proportional Bar */
.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.breakdown-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breakdown-bar-container {
  height: 14px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  margin-bottom: 0.875rem;
}

.bar-segment.modal {
  background: #10b981;
  transition: width 0.4s ease;
}

.bar-segment.operasional {
  background: #f59e0b;
  transition: width 0.4s ease;
}

.breakdown-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.legend-dot.modal { background: #10b981; }
.legend-dot.operasional { background: #f59e0b; }

.legend-text-wrap {
  display: flex;
  flex-direction: column;
}

.legend-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.legend-amount {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-main);
}

.legend-pct {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Top Menu Leaderboard */
.top-menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.leaderboard-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  transition: var(--transition);
}

.leaderboard-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.rank-badge.rank-1 {
  background: #fef3c7;
  color: #b45309;
  border: 2px solid #f59e0b;
}

.rank-badge.rank-2 {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #94a3b8;
}

.rank-badge.rank-3 {
  background: #ffedd5;
  color: #c2410c;
  border: 2px solid #fb923c;
}

.rank-badge.rank-other {
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.leaderboard-info {
  min-width: 0;
  flex: 1;
}

.leaderboard-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.leaderboard-value {
  text-align: right;
  flex-shrink: 0;
}

.leaderboard-porsi {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--primary);
}

.leaderboard-rev {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Chart Container Card */
.report-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chart-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-main);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 240px;
}

@media (min-width: 680px) {
  .chart-canvas-wrap {
    height: 280px;
  }
}

/* ==========================================================================
   REFERRAL SYSTEM & PROFILE STYLES
   ========================================================================== */

.referral-card-hero {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.referral-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.referral-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #064e3b;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.referral-hero-desc {
  font-size: 0.875rem;
  color: #047857;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.referral-code-box {
  background: #ffffff;
  border: 2px dashed #10b981;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.referral-code-text {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #065f46;
  font-family: 'Courier New', Courier, monospace;
}

.btn-copy-code {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  touch-action: manipulation;
  transition: var(--transition);
}

.btn-copy-code:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.btn-copy-code:active {
  transform: scale(0.95);
}

.profile-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .profile-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.profile-meta-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-item-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.meta-item-val {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.btn-outline-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-weight: 700;
}

.btn-outline-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

