﻿/* ==========================================================================
   Shopee ProfitPro - Design System & Modern Styles
   ========================================================================== */

:root {
  --primary: #EE4D2D;
  --primary-hover: #D73C1D;
  --primary-light: rgba(238, 77, 45, 0.1);
  --secondary: #2660A4;
  --success: #10B981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --info: #3B82F6;
  --info-light: rgba(59, 130, 246, 0.12);
  
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #0F172A;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-white: #F8FAFC;
  --border-color: #E2E8F0;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 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);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #EE4D2D, #FF7337);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.4);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #FFFFFF;
}

.brand-text span {
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 500;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  margin-bottom: 16px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for Nav Menu */
.nav-menu::-webkit-scrollbar {
  width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-btn i {
  width: 20px;
  height: 20px;
}

.nav-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  color: #FFFFFF;
  background: linear-gradient(90deg, var(--primary), #FF7337);
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.35);
}

/* Sub-Menu Sidebar Accordion */
.nav-sub-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  margin-top: 4px;
  margin-bottom: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  margin-left: 16px;
}

.nav-sub-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #CBD5E1;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-sub-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 6px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid rgba(59, 130, 246, 0.4);
  margin: 2px 0 6px 6px;
  border-radius: 0 6px 6px 0;
  transition: all 0.3s ease;
}

.nav-sub-menu.open {
  display: flex !important;
}

.nav-sub-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.shop-info {
  display: flex;
  flex-direction: column;
}

.shop-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.shop-status {
  font-size: 0.72rem;
  color: #38BDF8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: #10B981;
  border-radius: 50%;
}

.btn-reset-demo {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-reset-demo:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #FFFFFF;
}

/* Sub-Navigation Tabs Bar */
.subnav-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #F1F5F9;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  margin-bottom: 20px;
}

.subnav-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.subnav-btn:hover {
  background: #E2E8F0;
  color: #1E293B;
}

.subnav-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
}

/* Main Content Area */
.main-content {
  margin-left: 270px;
  flex: 1;
  padding: 32px;
  max-width: calc(100vw - 270px);
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.header-title h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.header-title p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Tab Switching */
.tab-content {
  display: none !important;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block !important;
}

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

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

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

.metrics-grid.col-4 {
  grid-template-columns: repeat(4, 1fr);
}

.metrics-grid.col-5 {
  grid-template-columns: repeat(5, 1fr);
}

.metrics-grid.col-6 {
  grid-template-columns: repeat(6, 1fr);
}


.metric-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.metric-card.highlight-orange {
  background: linear-gradient(135deg, #FFF7F5, #FFFFFF);
  border-left: 4px solid var(--primary);
}

.metric-card.highlight-blue {
  background: linear-gradient(135deg, #EFF6FF, #FFFFFF);
  border-left: 4px solid var(--info);
}

.metric-card.highlight-red {
  background: linear-gradient(135deg, #FEF2F2, #FFFFFF);
  border-left: 4px solid var(--danger);
}

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

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.icon-wrapper {
  width: 32px;
  height: 32px;
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.metric-value.text-orange { color: var(--primary); }
.metric-value.text-purple { color: #8B5CF6; }

.metric-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.card-body {
  padding: 24px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Action Bars & Filters */
.section-action-bar, .filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: white;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  background: white;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.readonly-input {
  background-color: #F1F5F9;
  color: #64748B;
  font-weight: 600;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-4 { flex: 0 0 calc(33.333% - 11px); }
.col-6 { flex: 0 0 calc(50% - 8px); }
.col-12 { flex: 0 0 100%; }

.form-divider {
  border-top: 1px dashed var(--border-color);
  margin: 20px 0 16px 0;
  text-align: center;
  position: relative;
}

.form-divider span {
  background: white;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  top: -10px;
}

/* Live Calc Box in Modal */
.live-calc-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.calc-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.calc-item.highlight {
  color: var(--primary);
  font-weight: 700;
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  grid-column: span 1;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.max-h-400 {
  max-height: 400px;
  overflow-y: auto;
}

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

.data-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: #FAFBFD;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: #B45309; }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: #F1F5F9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(238, 77, 45, 0.4);
}

.btn-secondary {
  background: #0F172A;
  color: white;
}

.btn-secondary:hover {
  background: #1E293B;
}

.btn-outline {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

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

/* Modals & Scroll Features */
.modal, .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal.active, .modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  overflow: hidden;
}

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

.modal-content.modal-lg {
  max-width: 760px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  z-index: 10;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Scrollable Modal Body */
.modal-body {
  padding: 24px;
  max-height: 65vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  z-index: 10;
}

/* Fee pill breakdown styling */
.fee-pill {
  font-size: 0.72rem;
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  display: inline-block;
  margin: 1px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .grid-2-col {
    grid-template-columns: 1fr;
  }
}

/* Packing Preparation Checklist & Scan Resi UI */
.highlight-border-orange {
  border-left: 4px solid var(--primary) !important;
}

.badge-orange {
  background: #FFF7ED;
  color: var(--primary);
  border: 1px solid #FFEDD5;
}

.align-end {
  align-items: flex-end;
}

.prep-checklist-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prep-item-card {
  background: #FAFBFD;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.prep-item-card:hover {
  background: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.prep-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.max-h-500 {
  max-height: 500px;
  overflow-y: auto;
}

.gap-3 { gap: 12px; }
.font-lg { font-size: 1.05rem; }
.font-md { font-size: 0.92rem; }
.font-sm { font-size: 0.8rem; }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.focus-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.15); }

/* Global Date Range Filter Bar */
.global-filter-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.global-filter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chips {
  display: flex;
  gap: 6px;
  align-items: center;
}

.filter-chip {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.filter-custom-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-date-input {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: inherit;
}

/* Stock Badges */
.badge-stock-safe {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.badge-stock-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  animation: pulseWarning 2s infinite;
}

.badge-stock-danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

@keyframes pulseWarning {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}




/* ==========================================================================
   MOBILE VS LAPTOP/DESKTOP ADAPTIVE DESIGN SYSTEM (SHIELD & TOUCH-READY)
   ========================================================================== */

/* Mobile Close Button & Drawer Elements */
.btn-mobile-close {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mobile-close:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #FFFFFF;
}

.btn-mobile-menu-toggle {
  display: none;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.btn-mobile-menu-toggle:active {
  background: #F1F5F9;
  transform: scale(0.96);
}

.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.mobile-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #EE4D2D;
  letter-spacing: -0.3px;
}

.mobile-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Mobile Bottom Navigation Bar (App-like Feel) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 995;
  padding: 4px 6px;
  justify-content: space-around;
  align-items: center;
  user-select: none;
}

.mobile-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748B;
  font-size: 0.68rem;
  font-weight: 700;
  border: none;
  background: transparent;
  cursor: pointer;
  flex: 1;
  height: 100%;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-bottom-nav-item i {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.mobile-bottom-nav-item.active {
  color: #EE4D2D;
  font-weight: 800;
}

.mobile-bottom-nav-item.active i {
  color: #EE4D2D;
  stroke-width: 2.5;
  transform: translateY(-2px);
}

/* --- MOBILE & TABLET LAYOUT (SCREEN WIDTH < 900px) --- */
@media (max-width: 899px) {
  body {
    font-size: 14px;
    background-color: #F1F5F9;
  }

  .app-container {
    display: block;
    width: 100%;
    overflow-x: hidden;
  }

  /* Off-Canvas Slide Drawer Sidebar */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 290px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

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

  .btn-mobile-menu-toggle {
    display: flex !important;
  }

  .mobile-top-bar {
    display: flex !important;
  }

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

  /* Main Content Area adjustments on Mobile */
  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100% !important;
    padding: 12px 12px 90px 12px !important;
    box-sizing: border-box !important;
  }

  /* Header adjustments */
  .top-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .header-title h1 {
    font-size: 1.25rem !important;
  }

  .header-title p {
    font-size: 0.8rem !important;
  }

  .store-selector-container,
  .user-session-bar,
  .global-filter-container {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .global-filter-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .filter-chips {
    overflow-x: auto !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
  }

  .filter-chip {
    flex-shrink: 0 !important;
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
  }

  /* Metrics Grid on Mobile: Clean 2-Columns */
  .metrics-grid,
  .metrics-grid.col-3,
  .metrics-grid.col-4,
  .metrics-grid.col-5,
  .metrics-grid.col-6 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .metric-card {
    padding: 14px 12px !important;
    border-radius: 12px !important;
  }

  .metric-label {
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }

  .metric-value {
    font-size: 1.15rem !important;
    margin-top: 4px !important;
  }

  .metric-subtext {
    font-size: 0.7rem !important;
  }

  /* 2-Columns to Single Column Stack */
  .grid-2-col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Cards & Forms on Mobile */
  .card {
    border-radius: 12px !important;
    margin-bottom: 14px !important;
  }

  .card-header {
    padding: 14px 16px !important;
  }

  .card-header h3 {
    font-size: 0.98rem !important;
  }

  .card-body {
    padding: 14px 16px !important;
  }

  /* Form inputs touch-friendly */
  .form-control,
  .form-select,
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select {
    min-height: 44px !important;
    font-size: 0.92rem !important;
    border-radius: 8px !important;
  }

  .form-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .form-group.col-6 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Buttons on Mobile */
  .btn {
    min-height: 44px !important;
    font-size: 0.92rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Table Smooth Horizontal Scroll & Compact Padding */
  .table-responsive {
    border-radius: 8px !important;
    border: 1px solid #E2E8F0 !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 8px !important;
  }

  .data-table {
    min-width: 540px !important;
    font-size: 0.8rem !important;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px !important;
  }

  /* Modal Dialog on Mobile: Sheet from bottom / full */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
    margin: 10px auto !important;
  }

  .modal-body {
    padding: 16px !important;
    max-height: 60vh !important;
  }
}

/* --- LAPTOP & DESKTOP LAYOUT (SCREEN WIDTH >= 900px) --- */
@media (min-width: 900px) {
  .btn-mobile-close {
    display: none !important;
  }

  .btn-mobile-menu-toggle {
    display: none !important;
  }

  .mobile-top-bar {
    display: none !important;
  }

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

  .mobile-backdrop {
    display: none !important;
  }

  .sidebar {
    display: flex !important;
    transform: none !important;
    position: fixed !important;
    width: 270px !important;
    height: 100vh !important;
  }

  .main-content {
    margin-left: 270px !important;
    max-width: calc(100vw - 270px) !important;
    padding: 32px !important;
  }

  .metrics-grid.col-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .metrics-grid.col-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .metrics-grid.col-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .metrics-grid.col-6 {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  .grid-2-col {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
}
