/* Customer Analytics Page Styles - Enhanced Design */

.analytics-container {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 2rem;
}

/* Header Styling */
.analytics-header {
    margin-bottom: 2rem;
    padding: 0;
}

.analytics-header .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.analytics-header .btn-outline-primary {
    border: 2px solid #0ea5e9;
    color: #0ea5e9;
    background: white;
}

.analytics-header .btn-outline-primary:hover:not(:disabled) {
    background: #0ea5e9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.analytics-header .btn-success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.analytics-header .btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.analytics-header .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.analytics-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analytics-title i {
    color: #0ea5e9;
}

.analytics-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0.5rem 0 0 0;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.metric-card.customers-card .metric-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.metric-card.revenue-card .metric-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.metric-card.avg-card .metric-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.metric-card.outstanding-card .metric-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.metric-card.discount-card .metric-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.metric-info {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-detail {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* Filters Card */
.filters-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.filters-header {
    margin-bottom: 1.5rem;
}

.filters-header h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filters-header h5 i {
    color: #0ea5e9;
}

.filters-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label i {
    color: #0ea5e9;
    font-size: 0.85rem;
}

.filter-input,
.filter-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    outline: none;
}

.category-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.category-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
    gap: 0.5rem;
}

.category-checkbox:hover {
    background: #e2e8f0;
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.1);
}

.category-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.category-checkbox input[type="checkbox"]:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

.category-checkbox .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #334155;
    font-size: 0.95rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-checkbox input[type="checkbox"]:checked + .form-check-label {
    color: #0ea5e9;
    font-weight: 600;
}

.category-checkbox .form-check-label i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.filters-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters-actions .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filters-actions .btn-primary {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.filters-actions .btn-primary:hover {
    background: #0284c7;
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.filters-actions .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #64748b;
}

.filters-actions .btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-navigation .btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-navigation .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.tab-navigation .btn-primary {
    background: #0ea5e9;
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.tab-navigation .btn-primary:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.tab-navigation .btn-outline-primary {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: white;
}

.tab-navigation .btn-outline-primary:hover {
    background: #0ea5e9;
    color: white;
    transform: translateY(-2px);
}

/* Chart Card */
.chart-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.chart-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-title i {
    color: #0ea5e9;
}

.chart-body {
    padding: 2rem;
}

/* Top Customers List */
.top-customers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-customer-row {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.top-customer-row:hover {
    background: #f1f5f9;
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.rank-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.customer-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.customer-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.revenue-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.revenue-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* Segment Cards */
.segment-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.segment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.segment-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.segment-header h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.segment-header h5 i {
    color: #0ea5e9;
}

.segment-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.segment-stats {
    display: flex;
    gap: 1rem;
}

.segment-stat {
    text-align: center;
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0ea5e9;
}

/* ============================================
   Card-Based Segment Design (Like Expenses & Sales)
   ============================================ */

.segments-container {
    width: 100%;
}

.segments-intro {
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
}

.segments-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.segments-title i {
    color: #0ea5e9;
}

.segments-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.segment-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    font-weight: 500;
}

.segment-summary-badge .fw-bold {
    font-size: 1.25rem;
}

/* Empty State Styling */
.empty-state {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 2px dashed #e2e8f0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #cbd5e1;
}

.empty-state-icon i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Modern Segment Card */
.segment-card-modern {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid #e9ecef;
}

/* Gradient top border */
.segment-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
    transition: height 0.3s ease;
}

.segment-card-modern:nth-child(1)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.segment-card-modern:nth-child(2)::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.segment-card-modern:nth-child(3)::before {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.segment-card-modern:nth-child(4)::before {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.segment-card-modern:nth-child(5)::before {
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
}

.segment-card-modern:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.segment-card-modern:hover::before {
    height: 6px;
}

/* Segment Header */
.segment-card-header-modern {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.segment-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segment-icon-large-modern {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.segment-pulse {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    opacity: 0;
    animation: pulse-animation 2s ease-out infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Match icon colors with card order */
.segment-card-modern:nth-child(1) .segment-icon-large-modern,
.segment-card-modern:nth-child(1) .segment-pulse {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.segment-card-modern:nth-child(2) .segment-icon-large-modern,
.segment-card-modern:nth-child(2) .segment-pulse {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.segment-card-modern:nth-child(3) .segment-icon-large-modern,
.segment-card-modern:nth-child(3) .segment-pulse {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.segment-card-modern:nth-child(4) .segment-icon-large-modern,
.segment-card-modern:nth-child(4) .segment-pulse {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.segment-card-modern:nth-child(5) .segment-icon-large-modern,
.segment-card-modern:nth-child(5) .segment-pulse {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

.segment-card-modern:hover .segment-icon-large-modern {
    transform: scale(1.15) rotate(8deg);
}

.segment-title-section-modern {
    flex: 1;
}

.segment-name-modern {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.segment-description-modern {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* Segment Stats Grid */
.segment-stats-grid-modern {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    background: white;
}

.segment-stat-box-modern {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-stat-box-modern:hover {
    background: linear-gradient(135deg, #eef6fb 0%, #f8fafc 100%);
    border-color: #cfe9ff;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.stat-box-icon-modern {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.stat-box-icon-modern.customers-icon-modern {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.stat-box-icon-modern.revenue-icon-modern {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.stat-box-icon-modern.average-icon-modern {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.segment-stat-box-modern:hover .stat-box-icon-modern {
    transform: scale(1.15) rotate(-5deg);
}

.stat-box-content-modern {
    flex: 1;
    min-width: 0;
}

.stat-box-label-modern {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-box-value-modern {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

/* Progress Bar */
.stat-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stat-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.stat-progress-bar-revenue {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.stat-progress-bar-average {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

/* Segment Footer */
.segment-card-footer-modern {
    padding: 1.5rem 1.75rem;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.segment-insight {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    font-weight: 500;
    line-height: 1.5;
}

.segment-insight i {
    color: #f59e0b;
    opacity: 0.9;
    flex-shrink: 0;
    margin-top: 2px;
}

.segment-contribution {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #eef6fb 0%, #f1f5f9 100%);
    border-radius: 8px;
    font-size: 0.85rem;
}

.contribution-label {
    color: #64748b;
    font-weight: 600;
}

.contribution-value {
    color: #0ea5e9;
    font-weight: 700;
    font-size: 1rem;
}

/* ============================================
   Modern Discounts Tab Styles
   ============================================ */

.discounts-container {
    width: 100%;
}

.discounts-intro {
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
}

.discounts-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.discounts-title i {
    color: #f59e0b;
}

.discounts-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.discount-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    font-weight: 500;
}

/* Discount Metric Cards */
.discount-metric-card {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.discount-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.3s ease;
}

.discount-metric-card.total-card::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.discount-metric-card.average-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

.discount-metric-card.orders-card::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.discount-metric-card.penetration-card::before {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.discount-metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.discount-metric-card:hover::before {
    height: 6px;
}

.discount-card-inner {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 140px;
}

.discount-metric-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.discount-metric-card.total-card .discount-metric-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.discount-metric-card.average-card .discount-metric-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.discount-metric-card.orders-card .discount-metric-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.discount-metric-card.penetration-card .discount-metric-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.discount-metric-card:hover .discount-metric-icon {
    transform: scale(1.1) rotate(5deg);
}

.discount-metric-content {
    flex: 1;
}

.discount-metric-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
}

.discount-metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.discount-metric-trend {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
}

.discount-metric-progress {
    margin-top: 0.75rem;
}

.discount-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.discount-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Discount Table Card */
.discount-table-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.discount-table-header {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.discount-table-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.discount-table-title i {
    color: #f59e0b;
}

.discount-table-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.discount-table-badge {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.discount-table-body {
    padding: 2rem;
}

/* Discount Services Grid */
.discount-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.discount-service-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.discount-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #f59e0b;
}

.discount-service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.discount-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

.discount-service-info {
    flex: 1;
    min-width: 0;
}

.discount-service-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discount-service-count {
    font-size: 0.85rem;
    color: #64748b;
}

.discount-service-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.discount-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.discount-stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.discount-stat-value.discount-percentage {
    color: #f59e0b;
}

.discount-service-progress {
    margin-top: 1rem;
}

.discount-service-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.discount-service-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Modern Trends Tab Styles
   ============================================ */

.trends-container {
    width: 100%;
}

.trends-intro {
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
}

.trends-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.trends-title i {
    color: #0ea5e9;
}

.trends-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.trends-period-selector .btn-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.trends-period-selector .btn {
    border-radius: 0;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.trends-period-selector .btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: #0ea5e9;
}

/* Trends Summary Cards */
.trends-summary-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.trends-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.3s ease;
}

.trends-summary-card.customers::before {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

.trends-summary-card.orders::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.trends-summary-card.revenue::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.trends-summary-card.avg-value::before {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.trends-summary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.trends-summary-card:hover::before {
    height: 6px;
}

.trends-summary-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.trends-summary-card.customers .trends-summary-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.trends-summary-card.orders .trends-summary-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.trends-summary-card.revenue .trends-summary-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.trends-summary-card.avg-value .trends-summary-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.trends-summary-card:hover .trends-summary-icon {
    transform: scale(1.1) rotate(5deg);
}

.trends-summary-content {
    flex: 1;
}

.trends-summary-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
}

.trends-summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.trends-summary-period {
    font-size: 0.85rem;
    color: #64748b;
}

/* Trends Table Styles (Replaces Timeline) */
.trends-table {
    margin: 0;
}

.trends-table .table {
    margin-bottom: 0;
}

.trends-table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 1.25rem 1rem;
    white-space: nowrap;
}

.trends-table thead th i {
    color: #0ea5e9;
    opacity: 0.8;
}

.trends-table-row {
    transition: all 0.3s ease;
}

.trends-table-row:hover {
    background: linear-gradient(135deg, #eef6fb 0%, #f8fafc 100%) !important;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

/* Period Column */
.period-column {
    min-width: 180px;
}

.period-cell {
    padding: 0.5rem 0;
}

.period-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.period-badge i {
    font-size: 0.85rem;
}

/* Metric Cells */
.metric-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.metric-cell.revenue,
.metric-cell.avg-value {
    align-items: flex-end;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.metric-value.revenue-value {
    color: #10b981;
}

.metric-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

/* Mini Progress Bars */
.mini-progress-bar {
    width: 60px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.mini-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-progress-fill.orders-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

/* Performance Indicator */
.performance-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.performance-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 150px;
}

.performance-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.performance-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.performance-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.performance-percentage {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    min-width: 35px;
    text-align: right;
}

.performance-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Performance Classes */
.high-performance .performance-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.high-performance .performance-label {
    color: #10b981;
}

.medium-performance .performance-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.medium-performance .performance-label {
    color: #f59e0b;
}

.low-performance .performance-fill {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.low-performance .performance-label {
    color: #ef4444;
}

/* Totals Row */
.trends-totals-row {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-weight: 700;
}

.trends-totals-row td {
    padding: 1rem;
    border-top: 2px solid #cbd5e1;
}

.trends-totals-row strong {
    color: #1e293b;
    font-size: 1.05rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .discounts-intro,
    .trends-intro {
        padding: 1.25rem;
    }
    
    .discount-services-grid {
        grid-template-columns: 1fr;
    }
    
    .trends-timeline-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .trends-date-badge {
        width: 100%;
    }
    
    .trends-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .discount-metric-card,
    .trends-summary-card {
        min-height: auto;
    }
    
    .discount-card-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }
    
    .trends-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .discount-summary-badge,
    .segment-summary-badge {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}
