/* Modern Store Focus Tracking System - Styles */

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Date Badge Styles */
.date-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.date-recent {
    background: var(--success-bg);
    color: var(--success-dark);
    border: 1px solid var(--success-light);
}

.date-good {
    background: var(--warning-bg);
    color: var(--warning-dark);
    border: 1px solid var(--warning-light);
}

.date-warning {
    background: rgba(245, 101, 101, 0.1);
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.date-old {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
    border: 1px solid var(--danger-light);
}

.date-none {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-300);
}

/* Activity Badge Styles */
.activity-badge, .plan-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
    cursor: help;
}

.has-activity {
    background: rgba(245, 101, 101, 0.1);
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.no-activity {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-300);
}

.has-plan {
    background: var(--success-bg);
    color: var(--success-dark);
    border: 1px solid var(--success-light);
}

.no-plan {
    background: var(--warning-bg);
    color: var(--warning-dark);
    border: 1px solid var(--warning-light);
}

/* Design System Variables */
:root {
    /* Modern Color Palette */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    --secondary: #0EA5E9;
    --secondary-dark: #0284C7;
    --secondary-light: #38BDF8;
    
    --success: #10B981;
    --success-dark: #059669;
    --success-light: #34D399;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    --warning: #F59E0B;
    --warning-dark: #D97706;
    --warning-light: #FCD34D;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --danger-light: #F87171;
    
    --info: #3B82F6;
    --info-dark: #2563EB;
    --info-light: #60A5FA;
    
    --purple: #A855F7;
    --purple-dark: #9333EA;
    --purple-light: #C084FC;
    
    /* Gray Scale */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --gradient-secondary: linear-gradient(135deg, #0EA5E9 0%, #6366F1 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    --gradient-info: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    --gradient-purple: linear-gradient(135deg, #C084FC 0%, #A855F7 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 50%, #F0F9FF 100%);
    color: var(--gray-800);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Theme Colors for Sections */
[data-active-section="domestic"] { --section-theme: var(--primary); --section-gradient: var(--gradient-primary); }
[data-active-section="overseas_sales"] { --section-theme: var(--success); --section-gradient: var(--gradient-success); }
[data-active-section="overseas_purchases"] { --section-theme: var(--secondary); --section-gradient: var(--gradient-secondary); }
[data-active-section="overseas_financial"] { --section-theme: var(--warning); --section-gradient: var(--gradient-warning); }
[data-active-section="government"] { --section-theme: #F43F5E; --section-gradient: linear-gradient(135deg, #FB7185 0%, #E11D48 100%); }
[data-active-section="credit"] { --section-theme: var(--purple); --section-gradient: var(--gradient-purple); }

/* Top Global Bar */
.top-global-bar {
    background: white;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0;
    z-index: 1005;
    position: sticky;
    top: 0;
    transition: all var(--transition-base);
}

/* Optional: Slight color tint for the bar background */
[data-active-section="domestic"] .top-global-bar { background: rgba(99, 102, 241, 0.02); }
[data-active-section="overseas_sales"] .top-global-bar { background: rgba(16, 185, 129, 0.02); }
[data-active-section="overseas_purchases"] .top-global-bar { background: rgba(14, 165, 233, 0.02); }
[data-active-section="overseas_financial"] .top-global-bar { background: rgba(245, 158, 11, 0.02); }
[data-active-section="government"] .top-global-bar { background: rgba(244, 63, 94, 0.02); }
[data-active-section="credit"] .top-global-bar { background: rgba(168, 85, 247, 0.02); }

.global-tabs-wrapper {
    display: flex;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    gap: 0;
}

.global-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.global-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.825rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 3.5px solid transparent;
    position: relative;
}

.global-tab:hover {
    color: var(--section-theme);
    background: rgba(0,0,0,0.02);
}

.global-tab.active {
    color: var(--section-theme);
    border-bottom-color: var(--section-theme);
    background: white;
}

.global-tab i {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Modern Navbar */
.navbar-modern {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0.5rem 0;
    position: sticky;
    top: 45.1px; /* Precise height of top-global-bar */
    z-index: 1000;
    transition: all var(--transition-base);
}

.navbar-modern.scrolled {
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.95);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.brand-logo:hover {
    transform: scale(1.05) rotate(-5deg);
    box-shadow: var(--shadow-lg);
}

.brand-logo i {
    font-size: 20px;
    color: white;
}

.brand-text-wrapper {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: -2px;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.nav-item i {
    font-size: 18px;
}

.nav-indicator {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.nav-item.active .nav-indicator {
    width: 30px;
}

.notification-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    margin-left: 4px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
    margin: 0 8px;
}

.nav-item-selector {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin: 0 12px;
    transition: all var(--transition-fast);
}

.nav-item-selector:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.nav-item-selector i {
    color: var(--primary);
}

.modern-select-nav {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0 4px;
    outline: none;
}

.user-menu {
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-700);
    cursor: pointer;
}

/* Main Container */
.main-container {
    padding: 1rem 1.5rem;
    /* max-width: 1400px; */
    max-width: 95%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.glass-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

/* Filter Section */
.filter-card {
    padding: 0;
}

.filter-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.filter-title i {
    color: var(--primary);
}

.btn-icon {
    background: white;
    border: 1px solid var(--gray-200);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-600);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.filter-body {
    padding: 1.5rem;
}

/* Modern Input Styles */
.search-input-group {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 18px;
    pointer-events: none;
}

.modern-input {
    padding: 12px 40px 12px 42px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: white;
    color: var(--gray-800);
    width: 100%;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.modern-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    pointer-events: none;
}

.modern-input:not(:placeholder-shown) ~ .search-clear {
    opacity: 1;
    pointer-events: all;
}

.search-clear:hover {
    color: var(--danger);
}

/* Modern Select */
.modern-select {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: white;
    color: var(--gray-800);
    cursor: pointer;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.modern-select-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 8px;
}

/* Modern Buttons */
.btn-modern-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-modern-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-modern-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

/* Advanced Filters */
.advanced-filters {
    display: none;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    animation: slideDown 0.3s ease;
}

.advanced-filters.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: block;
}

/* Loading Progress Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
    padding: 2rem;
}

.progress-circle {
    position: relative;
    margin: 0 auto 2rem;
    width: 100px;
    height: 100px;
}

.progress-ring {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 8;
    cx: 50px;
    cy: 50px;
    r: 40px;
}

.progress-circle-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    cx: 50px;
    cy: 50px;
    r: 40px;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    animation: progressAnimation 2s ease-in-out infinite;
}

.progress-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-title {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.loading-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.loading-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.step.active {
    opacity: 1;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.step i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.step span {
    font-size: 0.875rem;
    font-weight: 500;
}

@keyframes progressAnimation {
    0% {
        stroke-dashoffset: 251.2;
    }
    50% {
        stroke-dashoffset: 125.6;
    }
    100% {
        stroke-dashoffset: 251.2;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
}

/* Stats Container */
.stats-container {
    overflow-x: auto;
    margin: 0 -8px;
    display: none; /* Hidden by default */
}

.stats-scroll {
    display: flex;
    gap: 16px;
    padding: 0 8px;
    min-width: min-content;
}

/* Stat Cards */
.stat-card {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.gradient-primary { background: var(--gradient-primary); }
.gradient-secondary { background: var(--gradient-secondary); }
.gradient-success { background: var(--gradient-success); }
.gradient-warning { background: var(--gradient-warning); }
.gradient-info { background: var(--gradient-info); }
.gradient-purple { background: var(--gradient-purple); }

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon i {
    font-size: 24px;
    color: white;
}

.stat-content {
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.stat-trend {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-trend.up { color: #10F981; }
.stat-trend.down { color: #FF6B6B; }

/* Map Section */
.map-section {
    margin-bottom: 2rem;
}

.map-card {
    padding: 0;
}

.map-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-title-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.map-view-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-view-select {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    min-width: 220px;
    font-weight: 500;
}

.map-view-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
    outline: none;
}

.map-view-select option {
    background: white;
    color: var(--gray-700);
    padding: 0.5rem;
}

.map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.map-title i {
    color: var(--primary);
}

.map-controls {
    display: flex;
    gap: 8px;
}

.map-container {
    position: relative;
    height: 500px;
    background: var(--gray-100);
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 400;
}

.legend-toggle {
    background: white;
    border: 1px solid var(--gray-200);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.legend-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.legend-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.legend-content.show {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legend-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.legend-dot.focus { background: var(--warning); }
.legend-dot.active { background: var(--success); }
.legend-dot.inactive { background: var(--gray-400); }

/* Table Section */
.table-section {
    margin-top: 2rem;
}

.table-card {
    padding: 0;
}

.table-header {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.table-title i {
    color: var(--primary);
}

.count-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Modern Table */
.table-responsive {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    background: white;
    font-size: 0.9rem;
}

.modern-table thead {
    background: var(--gray-50);
}

.modern-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.th-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sortable Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05) !important;
}

.sortable .th-content {
    justify-content: space-between;
}

.sort-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    opacity: 0.5;
    margin-left: auto;
}

.sortable:hover .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.sortable.sort-asc .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.sortable.sort-asc .sort-icon::before {
    content: '\f0de'; /* fa-sort-up */
}

.sortable.sort-desc .sort-icon::before {
    content: '\f0dd'; /* fa-sort-down */
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.pagination-select {
    width: auto;
    min-width: 140px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.modern-pagination {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.modern-pagination .page-item {
    display: flex;
}

.modern-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.modern-pagination .page-link:hover {
    background: var(--gray-50);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
}

.modern-pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--gray-100);
    border-color: var(--gray-200);
    cursor: not-allowed;
    transform: none;
}

.modern-pagination .page-item.disabled .page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .pagination-info {
        justify-content: space-between;
    }
    
    .modern-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Work Tracking Card */
.work-tracking-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.work-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.work-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.work-title i {
    color: #10B981;
    font-size: 1.2rem;
}

.work-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.work-month {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.work-body {
    padding: 0;
    overflow: visible;
    transition: all 0.3s ease;
}

.work-body.collapsed {
    max-height: 0;
    padding: 0;
}

.work-table-container {
    overflow-x: auto;
    overflow-y: visible;
}

.work-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    background: white;
}

.work-table thead th {
    background: var(--gray-50);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.work-header-cell {
    width: 200px;
    min-width: 200px;
    text-align: left !important;
    padding-left: 1rem !important;
    background: var(--gray-100) !important;
    border-right: 1px solid var(--gray-200);
}

.work-day-header {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.work-spacer {
    width: 200px;
    min-width: 200px;
    background: var(--gray-100) !important;
    border-right: 1px solid var(--gray-200);
}

.day-cell {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.work-table tbody tr {
    transition: background-color 0.2s ease;
}

.work-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.02);
}

.work-row-header {
    background: var(--gray-50);
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    left: 0;
    z-index: 5;
}

.work-cell {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 40px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    position: relative;
    background: white;
}

.work-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.work-status:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-completed {
    background: #10B981;
}

.status-partial {
    background: #F59E0B;
}

.status-pending {
    background: #E5E7EB;
    color: var(--gray-600);
}

.status-na {
    background: transparent;
}

/* Sunday styling (non-working day) */
.weekend-cell {
    background: rgba(239, 68, 68, 0.05) !important;
}

.weekend-day {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #DC2626 !important;
}

/* Today highlighting */
.today-cell {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 2px solid #3B82F6 !important;
}

.today-day {
    background: #3B82F6 !important;
    color: white !important;
}

@media (max-width: 768px) {
    .work-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .work-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .work-header-cell {
        width: 150px;
        min-width: 150px;
    }
    
    .work-spacer {
        width: 150px;
        min-width: 150px;
    }
    
    .day-cell {
        width: 25px;
        min-width: 25px;
        max-width: 25px;
    }
    
    .work-cell {
        width: 25px;
        min-width: 25px;
        max-width: 25px;
        height: 35px;
    }
    
    .work-status {
        width: 16px;
        height: 16px;
        font-size: 0.625rem;
    }
}

.th-content i {
    color: var(--gray-400);
    font-size: 14px;
}

.modern-table tbody tr {
    transition: all var(--transition-fast);
    cursor: pointer;
}

.modern-table tbody tr:hover {
    background: var(--gray-50);
    transform: translateX(4px);
}

.modern-table tbody tr.selected {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.focus {
    background: var(--warning-bg);
    color: var(--warning-dark);
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success-dark);
}

.status-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-600);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.action-btn.view:hover { background: var(--info); border-color: var(--info); }
.action-btn.call:hover { background: var(--success); border-color: var(--success); }
.action-btn.navigate:hover { background: var(--secondary); border-color: var(--secondary); }

/* Modern Modal */
.modern-modal .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
}

.modern-modal .modal-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modern-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--gray-800);
}

.modern-modal .modal-title i {
    color: var(--primary);
}

.btn-close-modern {
    background: white;
    border: 1px solid var(--gray-200);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-600);
}

.btn-close-modern:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.modern-modal .modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label i {
    color: var(--gray-400);
    font-size: 14px;
}

.modern-modal .modal-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.fab-main:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-xl);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
}

.fab-menu.show {
    opacity: 1;
    pointer-events: all;
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: 12px 16px;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.9rem;
}

.fab-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(-8px);
}

.fab-label {
    font-size: 0.85rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Store Detail Modal */
.store-detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.2s ease-out;
}

.store-detail-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 95vw;
    width: 95%;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.3s ease-out;
}

.store-detail-modal-overlay.closing {
    animation: fadeOut 0.2s ease-in;
}

.store-detail-modal-overlay.closing .store-detail-modal-content {
    animation: scaleOut 0.2s ease-in;
}

.detail-section {
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.detail-label i {
    width: 20px;
    text-align: center;
}

.detail-value {
    font-size: 1rem;
    color: #111827;
    font-weight: 500;
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-scroll {
        overflow-x: auto;
        scrollbar-width: thin;
    }
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--transition-base);
        z-index: 999;
    }
    
    .nav-menu.show {
        transform: translateY(0);
        opacity: 1;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    /* Main Container */
    .main-container {
        padding: 1rem;
    }
    
    /* Stats */
    .stat-card {
        min-width: 150px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Map */
    .map-container {
        height: 400px;
    }
    
    /* Table */
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* FAB */
    .fab-container {
        bottom: 16px;
        right: 16px;
    }
    
    .fab-main {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    /* Filter Cards */
    .filter-actions {
        width: 100%;
    }
    
    .filter-actions button {
        flex: 1;
    }
    
    /* Cards */
    .glass-card {
        border-radius: var(--radius-md);
        margin: 0 -0.5rem;
    }
    
    /* Table */
    .modern-table {
        font-size: 0.8rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .th-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .th-content i {
        display: none;
    }
}

/* Work Tracking Table Styles */
.work-tracking-card {
    margin-bottom: 2rem;
    overflow: visible !important;
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid #E5E7EB;
}

.work-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}

.work-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.work-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.work-table-container {
    overflow: visible;
    background: white;
    border-radius: 8px;
}

.work-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.work-table thead th {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #6B7280;
    border-bottom: 2px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 10;
}

.work-header-cell {
    text-align: left !important;
    padding-left: 1rem !important;
    width: 200px;
    min-width: 200px;
}

.work-day-cell {
    width: auto;
    font-size: 0.875rem;
    white-space: nowrap;
}

.work-day-cell.weekend {
    background: rgba(239, 68, 68, 0.05);
    color: #DC2626;
}

.work-task-cell {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #1F2937;
    background: #F9FAFB;
    border-right: 2px solid #E5E7EB;
    position: sticky;
    left: 0;
    z-index: 5;
    width: 200px;
    min-width: 200px;
}

.work-status-cell {
    padding: 0.5rem;
    text-align: center;
    border-bottom: 1px solid #F3F4F6;
    border-right: 1px solid #F3F4F6;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.work-status-cell:hover {
    background: #F9FAFB;
}

.work-status-cell.weekend {
    background: rgba(239, 68, 68, 0.02);
}

.work-status-cell.today {
    background: rgba(99, 102, 241, 0.05);
    border: 2px solid var(--primary);
    font-weight: 700;
}

.work-status-cell.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-dark);
}

.work-status-cell.planned {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
}

.work-status-cell i {
    font-size: 0.875rem;
}

/* Total cells styling */
.work-total-cell {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    font-weight: 700;
    text-align: center;
    padding: 0.75rem;
    border-left: 2px solid #D1D5DB;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    right: 0;
    z-index: 3;
}

.total-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.total-count.grand {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    min-width: 50px;
    height: 50px;
    font-size: 1.3rem;
}

.total-row {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-top: 3px solid #D1D5DB;
}

.total-row .work-task-cell {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    font-weight: 700;
    padding: 1rem;
}

.total-row .work-total-cell {
    border-top: 3px solid #D1D5DB;
}

.total-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.total-label i {
    font-size: 1.25rem;
}

.grand-total {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 2px solid #10B981;
}

/* Legend Styles */
.work-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    flex-shrink: 0;
}

.work-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #E5E7EB;
}

.legend-box.completed {
    background: rgba(16, 185, 129, 0.3);
    border-color: var(--success);
}

.legend-box.planned {
    background: rgba(245, 158, 11, 0.3);
    border-color: var(--warning);
}

.legend-box.today {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.legend-box.weekend {
    background: rgba(239, 68, 68, 0.1);
    border-color: #DC2626;
}

/* Section visibility */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Truck info styles */
.truck-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.truck-info i {
    font-size: 1.25rem;
}

.truck-info span {
    font-weight: 600;
}

/* Visit count styles */
.visit-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-dark);
    padding: 0.25rem 0.5rem;
}

.visit-count.planned {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-dark);
}

.visit-count.empty {
    background: transparent;
    color: #9CA3AF;
    font-weight: 400;
}

.work-status-cell.today .visit-count {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Week navigation */
.week-display {
    font-size: 1rem;
    color: #1F2937;
    min-width: 180px;
    text-align: center;
}

/* Store Modal Styles */
.store-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.store-modal-overlay.closing {
    animation: fadeOut 0.3s ease;
}

.store-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.store-modal-content .modal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-modal-content .modal-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.modal-summary {
    margin-bottom: 1.5rem;
}

.summary-header {
    margin-bottom: 1rem;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.type-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
}

.type-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.type-summary-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.type-summary-badge i {
    font-size: 0.75rem;
}

.type-summary-badge strong {
    font-weight: 700;
    font-size: 0.9rem;
}

.store-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.store-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
    animation: slideInItem 0.3s ease forwards;
    opacity: 0;
}

.store-list-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.store-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.store-info-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.store-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1F2937;
}

.store-name i {
    color: #6B7280;
    flex-shrink: 0;
}

.store-name span {
    flex: 1;
}

.store-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1.5rem;
}

.store-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.store-type-badge i {
    font-size: 0.75rem;
}

.store-status {
    flex-shrink: 0;
    font-size: 1.25rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInItem {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Truck Map Styles */
.truck-map-container {
    position: relative;
    background: white;
}

#truckMap {
    height: 500px;
    width: 100%;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.truck-map-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 250px;
    z-index: 1000;
}

.map-legend-section {
    margin-bottom: 1rem;
}

.map-legend-section:last-child {
    margin-bottom: 0;
}

.legend-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.store-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Custom Marker Icon */
.custom-marker-icon {
    background: transparent !important;
    border: none !important;
}

/* Sequence Marker */
.sequence-marker {
    background: transparent !important;
    border: none !important;
}

/* Marker Popup */
.marker-popup {
    min-width: 200px;
}

.leaflet-popup-content {
    margin: 10px;
}

/* Route Line Styles */
.leaflet-interactive {
    cursor: pointer;
}

.leaflet-interactive:hover {
    opacity: 1 !important;
}

/* Leaflet Pane Z-Index Control */
/* ลำดับ: marker-pane (ล่างสุด) -> overlay-pane (เส้นทาง) -> marker ที่เลือก (บนสุด) */
.leaflet-marker-pane {
    z-index: 400 !important;
}

.leaflet-overlay-pane {
    z-index: 500 !important;
}

.leaflet-shadow-pane {
    z-index: 300 !important;
}

/* Modern Marker Styles */
.modern-marker {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Truck info hover effect */
.truck-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.work-task-cell:hover .truck-info {
    transform: translateX(4px);
}

/* Daily Store List Styles */
.daily-sections-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daily-section {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s;
}

.daily-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.daily-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.day-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.daily-count {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 600;
}

.daily-stores-list {
    padding: 0.5rem;
}

.daily-store-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--gray-300);
}

.daily-store-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.daily-store-item:last-child {
    margin-bottom: 0;
}

.daily-store-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.store-order {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.store-name-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.store-name-text {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.store-type-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.store-type-badge-small i {
    font-size: 0.7rem;
}

/* Responsive adjustments for work table */
@media (max-width: 768px) {
    .work-table {
        font-size: 0.75rem;
    }

    .work-day-cell {
        min-width: 80px;
        padding: 0.5rem 0.25rem;
    }

    .work-task-cell {
        min-width: 150px;
        font-size: 0.8rem;
    }

    .truck-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .visit-count {
        min-width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .week-display {
        font-size: 0.875rem;
        min-width: 150px;
    }

    .work-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Store modal responsive */
    .store-modal-content {
        max-width: 95%;
    }

    .type-summary {
        padding: 0.75rem;
        gap: 0.375rem;
    }

    .type-summary-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .type-summary-badge strong {
        font-size: 0.8rem;
    }

    .store-list-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .store-name {
        order: 1;
        width: 100%;
    }

    .store-type-badge {
        order: 3;
        flex: 1;
        justify-content: center;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .store-status {
        order: 4;
        font-size: 1rem;
    }

    /* Truck map responsive */
    #truckMap {
        height: 400px;
    }

    .truck-map-legend {
        position: relative;
        top: 0;
        right: 0;
        max-width: 100%;
        margin: 1rem;
    }

    .legend-items {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /* Daily store list responsive */
    .daily-sections-container {
        grid-template-columns: 1fr;
    }

    .daily-store-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .store-order {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .store-name-text {
        font-size: 0.85rem;
    }

    .store-type-badge-small {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ============================================
   Account Journey Dashboard Styles
   ============================================ */

/* Journey Stats Cards */
.journey-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #E5E7EB;
    display: flex;
    gap: 0.75rem;
    transition: all 0.2s;
}

.journey-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.journey-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.journey-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.journey-stat-label {
    font-size: 0.875rem;
    color: #6B7280;
    font-weight: 500;
}

.journey-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.journey-stat-value-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.journey-stat-date {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
    white-space: nowrap;
}

.journey-stat-detail {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Journey Sections */
.journey-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #E5E7EB;
}

.journey-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journey-section-title i {
    width: 20px;
    text-align: center;
}

/* Sales Chart Container */
.sales-chart-container {
    position: relative;
    height: 280px;
    padding: 0.5rem;
}

.sales-chart-container canvas {
    max-height: 100%;
}

/* Metric Boxes */
.metric-box {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #E5E7EB;
}

.metric-label {
    font-size: 0.875rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #10B981;
}

.metric-change.negative {
    color: #EF4444;
}

/* Timeline */
.journey-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 12px;
    height: 12px;
    background: #6366F1;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #6366F1;
}

.timeline-item:not(:last-child) .timeline-marker::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 1rem);
    background: #E5E7EB;
}

.timeline-content {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.timeline-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: #6366F1;
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.timeline-badge.delivery {
    background: #10B981;
}

.timeline-badge.credit {
    background: #F59E0B;
}

.timeline-body {
    font-size: 0.875rem;
    color: #6B7280;
}

/* History Grid 3 Columns */
.history-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1.5rem;
}

.history-scroll-container {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 0.75rem;
}

.history-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.history-scroll-container::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.history-scroll-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.history-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.history-card {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    margin-bottom: 0.625rem;
    transition: all 0.2s;
}

.history-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.history-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: #111827;
    flex-shrink: 0;
}

.history-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.history-badge.badge-visit {
    background: #6366F120;
    color: #6366F1;
}

.history-badge.badge-paid {
    background: #10B98120;
    color: #10B981;
}

.history-badge.badge-unpaid {
    background: #EF444420;
    color: #EF4444;
}

.history-badge.badge-exchange {
    background: #F59E0B20;
    color: #F59E0B;
}

.history-badge.badge-return {
    background: #EF444420;
    color: #EF4444;
}

.history-body {
    font-size: 0.8rem;
    color: #6B7280;
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.history-date-line {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.4rem;
}

.history-invoice {
    font-size: 0.75rem;
    color: #6366F1;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.history-items {
    font-size: 0.75rem;
    color: #6B7280;
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.history-amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10B981;
    margin-top: 0.375rem;
}

.history-reason {
    font-size: 0.7rem;
    color: #9CA3AF;
    font-style: italic;
    margin-top: 0.3rem;
}

@media (max-width: 768px) {
    .history-grid-3col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .history-scroll-container {
        max-height: 300px;
    }
}

.timeline-amount {
    font-weight: 600;
    color: #10B981;
}

/* Product Rows */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.product-row:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6366F1;
    min-width: 40px;
    text-align: center;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #111827;
    font-size: 0.9rem;
}

.product-qty {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

.product-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #10B981;
}

/* Contact Items */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.contact-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-item i {
    width: 20px;
    text-align: center;
    color: #6366F1;
}

.contact-item span {
    flex: 1;
}

.shop-detail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #6366F1;
    color: white;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.shop-detail-button:hover {
    background: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.shop-detail-button i {
    color: white;
    font-size: 0.875rem;
    width: auto;
}

.contact-person {
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    margin-bottom: 0.75rem;
}

.contact-name {
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.contact-name i {
    color: #6366F1;
}

.contact-position {
    font-size: 0.875rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.contact-phone {
    font-size: 0.875rem;
    color: #6366F1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.contact-phone:hover {
    color: #4F46E5;
}

.map-button {
    display: block;
    padding: 0.75rem;
    background: #34A853;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 0.75rem;
}

.map-button:hover {
    background: #2d8e47;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 168, 83, 0.3);
}

.map-button i {
    margin-right: 0.5rem;
}

/* Credit Info */
.credit-info {
    margin-top: 1rem;
}

.credit-usage {
    margin-bottom: 1rem;
}

.credit-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.credit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
    transition: width 0.3s ease;
}

.credit-bar-fill.warning {
    background: linear-gradient(90deg, #F59E0B 0%, #FCD34D 100%);
}

.credit-bar-fill.danger {
    background: linear-gradient(90deg, #EF4444 0%, #F87171 100%);
}

.credit-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6B7280;
}

.credit-terms {
    font-size: 0.875rem;
    color: #111827;
    padding: 0.5rem;
    background: #F9FAFB;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credit-terms i {
    color: #6366F1;
}

.credit-overdue {
    padding: 0.75rem;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    color: #DC2626;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credit-overdue i {
    font-size: 1.25rem;
}

/* Issue Cards */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.issue-card {
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.issue-card:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.issue-card.resolved {
    background: rgba(16, 185, 129, 0.05);
    border-color: #D1FAE5;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.issue-priority {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-weight: 600;
}

.issue-priority.high {
    background: #FEE2E2;
    color: #DC2626;
}

.issue-priority.medium {
    background: #FEF3C7;
    color: #D97706;
}

.issue-priority.low {
    background: #E0E7FF;
    color: #6366F1;
}

.issue-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    background: #E5E7EB;
    color: #6B7280;
}

.issue-card.resolved .issue-status {
    background: #D1FAE5;
    color: #059669;
}

.issue-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.issue-date {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Opportunity Cards */
.opportunities-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.opportunity-card {
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.opportunity-card:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.opportunity-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.opportunity-value {
    font-size: 0.875rem;
    color: #10B981;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.opportunity-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill.negotiation {
    background: linear-gradient(90deg, #F59E0B 0%, #FCD34D 100%);
}

.progress-fill.proposal {
    background: linear-gradient(90deg, #6366F1 0%, #818CF8 100%);
}

.progress-fill.qualified {
    background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
}

.progress-label {
    font-size: 0.875rem;
    color: #6B7280;
    white-space: nowrap;
}

/* Journey Grid Layout */
.journey-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.journey-col-8 {
    grid-column: span 8;
}

.journey-col-4 {
    grid-column: span 4;
}

.journey-col-6 {
    grid-column: span 6;
}

.journey-col-12 {
    grid-column: span 12;
}

/* Quick Stats Wrapper */
.quick-stats-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Legacy support */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments for Journey Dashboard */
@media (max-width: 900px) {
    .journey-col-8,
    .journey-col-4 {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .journey-grid {
        gap: 1rem;
    }

    .quick-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .journey-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .journey-stat-value {
        font-size: 1.1rem;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    .product-row {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .product-rank {
        font-size: 1rem;
        min-width: 32px;
    }

    .contact-person {
        padding: 0.75rem;
    }

    .timeline-content {
        padding: 0.5rem;
    }

    .issue-card,
    .opportunity-card {
        padding: 0.75rem;
    }

    .journey-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .quick-stats-row {
        grid-template-columns: 1fr;
    }

    .quick-stats-grid {
        grid-template-columns: 1fr;
    }

    .store-detail-modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .journey-grid {
        gap: 0.75rem;
    }

    .metric-box {
        padding: 0.75rem;
    }
}

/* ========================================
   Customer Journey Category Cards Styles
   ======================================== */

.customer-journey-container {
    padding: 2rem 0;
}

.journey-header {
    text-align: center;
    margin-bottom: 3rem;
}

.journey-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.journey-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

.category-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.category-icon.modern-trade {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-icon.local-modern-trade {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.category-icon.freshmart {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.category-icon.traditional-trade {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.category-icon.clmv {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.category-icon.border-channel {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.category-icon.distributor {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.category-icon.sales {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.category-desc {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.category-arrow {
    font-size: 1.25rem;
    color: #9ca3af;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.category-card:hover .category-arrow {
    color: #667eea;
    transform: translateX(5px);
}

#categoryDataContainer {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 992px) {
    .journey-title {
        font-size: 2rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .category-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .journey-title {
        font-size: 1.75rem;
    }

    .journey-subtitle {
        font-size: 1rem;
    }

    .category-card {
        padding: 1.25rem;
    }

    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .category-title {
        font-size: 1.25rem;
    }

    .category-desc {
        font-size: 0.875rem;
    }
}

/* Category Data Display Styles */
.category-data-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.stat-card .stat-info {
    text-align: left;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    color: #1f2937;
}
/* Filters and User Selector - Premium Glass Design */
.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.glass-filter-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 2px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.glass-filter-group:hover, .glass-filter-group:focus-within {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-light);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.08);
}

.glass-filter-group .input-group-text i {
    font-size: 1rem;
    opacity: 0.8;
}

.glass-filter-group .form-select, 
.glass-filter-group .form-control {
    color: var(--gray-800) !important;
    font-size: 0.9rem;
    box-shadow: none !important;
}

/* Date Input Specifics */
input[type="date"]::-webkit-calendar-picker-indicator {
 cursor: pointer;
 opacity: 0.6;
 transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
 opacity: 1;
}

/* Preset Pill Group */
.preset-pill-group {
    display: flex;
    background: #a3a3a3;
    padding: 4px;
    border-radius: 100px;
    gap: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn-preset-pill {
    border: none;
    background: transparent;
    color: white;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-preset-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-preset-pill.active {
    background: #1a1a1b;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Custom Date Pill */
.custom-date-pill {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #dbeafe; /* light blue border */
    padding: 2px 10px;
    border-radius: 100px;
    gap: 8px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

.date-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.custom-date-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px 12px;
    font-size: 0.85rem;
    color: #1e293b;
    background: white;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    width: 140px;
}

.custom-date-pill input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

.btn-apply-date {
    background: #1a1a1b;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-apply-date:hover {
    transform: scale(1.1);
    background: #000;
}

.btn-apply-date i {
    font-size: 1.25rem;
}

/* Flatter Table Layout */
.table-filter-section {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.filter-strip {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 12px */
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 10px; /* Reduced from 12px */
    height: 38px;
    gap: 8px; /* Reduced from 10px */
    transition: all 0.2s ease;
}

.filter-item:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

.filter-item i {
    color: #64748b;
    font-size: 0.95rem;
    opacity: 0.8;
}

.filter-item input, 
.filter-item select {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    padding: 0;
    cursor: pointer;
}

.filter-item input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.filter-label-inline {
    font-size: 0.72rem; /* Slighly smaller */
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.search-box-strip {
    flex: 1 1 180px; /* Flex factor 1, shrinkable, basis 180px */
    min-width: 150px;
}

.table-view-section {
    background: transparent;
    border-radius: 0;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.view-summary-card {
    background: white;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.summary-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-details {
    display: flex;
    align-items: center;
    gap: 24px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.summary-item strong {
    color: #1e293b;
    font-weight: 700;
}

.summary-item i {
    color: var(--primary-color);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .view-summary-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .summary-details {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
}

.table-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 4px;
}

/* Need Card Styles */
.need-card {
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease-in-out !important;
}

.need-card:hover {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-2px);
}

.need-card i {
    transition: color 0.2s ease;
}

.need-card:hover i {
    color: #2563eb !important;
}

/* Sticky Table Column and Header */
#storeListTable thead th {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

#storeListTable .sticky-col-1 {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: white !important;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

#storeListTable .sticky-col-2 {
    position: sticky;
    left: 40px;
    z-index: 10;
    background-color: white !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}

/* Intersection of sticky header and sticky columns */
#storeListTable thead th.sticky-col-1 {
    z-index: 120;
    left: 0;
}

#storeListTable thead th.sticky-col-2 {
    z-index: 120;
    left: 40px;
}

/* Responsive table wrapper adjustment */
.table-responsive {
    overflow: auto;
    max-height: 70vh;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

