/**
 * Dashboard Styles - RepriceMax
 * Premium modern dashboard design
 */

/* =============================================
   DESIGN TOKENS
   ============================================= */
.container-xxl {
    --kpi-primary: #696cff;
    --kpi-success: #28c76f;
    --kpi-info: #00bad1;
    --kpi-warning: #ff9f43;
    --kpi-danger: #ff4c51;
    --kpi-secondary: #a8aaae;
    --card-radius: 14px;
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes welcomeShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-8px, -12px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -8px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5px, 8px); }
}

/* Entrance stagger for cards */
.welcome-card {
    animation: cardEnter 0.4s ease-out both;
}

.kpi-card,
.metric-card {
    animation: cardEnter 0.4s ease-out both;
}

.chart-card {
    animation: cardEnter 0.5s ease-out 0.2s both;
}

.table-card,
.insights-card {
    animation: cardEnter 0.5s ease-out 0.3s both;
}

/* Stagger KPI and metric cards */
.row > *:nth-child(1) > .kpi-card,
.row > *:nth-child(1) > .metric-card { animation-delay: 0.05s; }
.row > *:nth-child(2) > .kpi-card,
.row > *:nth-child(2) > .metric-card { animation-delay: 0.1s; }
.row > *:nth-child(3) > .kpi-card,
.row > *:nth-child(3) > .metric-card { animation-delay: 0.15s; }
.row > *:nth-child(4) > .kpi-card { animation-delay: 0.2s; }

/* Stagger bottom row */
.row > *:nth-child(1) > .table-card { animation-delay: 0.3s; }
.row > *:nth-child(2) > .table-card { animation-delay: 0.35s; }
.row > *:nth-child(3) > .insights-card { animation-delay: 0.4s; }

/* =============================================
   WELCOME CARD
   ============================================= */
.welcome-card {
    background: linear-gradient(-45deg, #7c3aed, #6366f1, #818cf8, #6d28d9) !important;
    background-size: 300% 300% !important;
    animation: welcomeShift 12s ease infinite, cardEnter 0.4s ease-out both;
    border: none !important;
    border-radius: var(--card-radius) !important;
    position: relative;
    overflow: hidden;
}

.welcome-card .card-body {
    position: relative;
    z-index: 2;
    padding: 1.5rem 1.75rem;
}

.welcome-card h4 {
    font-size: 1.375rem;
    letter-spacing: -0.25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Welcome buttons styling */
.welcome-card .btn-light {
    background: rgba(255, 255, 255, 0.92) !important;
    border: none !important;
    color: #6366f1 !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.welcome-card .btn-light:hover {
    background: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.welcome-card .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    backdrop-filter: blur(4px);
}

.welcome-card .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px);
}

/* Floating orbs decoration */
.welcome-decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.welcome-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.welcome-orb--1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    top: -60px;
    right: -40px;
    animation: float1 8s ease-in-out infinite;
}

.welcome-orb--2 {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    bottom: -50px;
    right: 15%;
    animation: float2 10s ease-in-out infinite;
}

.welcome-orb--3 {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    top: 10px;
    right: 30%;
    animation: float3 12s ease-in-out infinite;
}

/* Welcome select */
.welcome-select {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    width: auto;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.welcome-select:focus {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.15) !important;
}

.welcome-select option {
    background-color: #2f3349;
    color: #e4e6ef;
}

/* Refresh button spin */
#refreshDashboard.is-loading .ti-refresh {
    animation: spin 0.8s linear infinite;
}

#refreshDashboard.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* =============================================
   KPI CARDS (Primary)
   ============================================= */
.kpi-card {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: var(--card-radius) !important;
    transition: var(--card-transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

/* Colored hover glow per card type */
.kpi-card[data-stat="totalRevenue"]:hover {
    box-shadow: 0 8px 30px rgba(105, 108, 255, 0.18);
}

.kpi-card[data-stat="grossProfit"]:hover {
    box-shadow: 0 8px 30px rgba(40, 199, 111, 0.18);
}

.kpi-card[data-stat="netMargin"]:hover {
    box-shadow: 0 8px 30px rgba(0, 186, 209, 0.18);
}

.kpi-card[data-stat="buyBoxWinRate"]:hover {
    box-shadow: 0 8px 30px rgba(255, 159, 67, 0.18);
}

/* Colored left accent bar */
.kpi-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--card-radius) 0 0 var(--card-radius);
}

.kpi-accent--primary { background: linear-gradient(to bottom, var(--kpi-primary), #8b8eff); }
.kpi-accent--success { background: linear-gradient(to bottom, var(--kpi-success), #5dd99a); }
.kpi-accent--info { background: linear-gradient(to bottom, var(--kpi-info), #33d4ea); }
.kpi-accent--warning { background: linear-gradient(to bottom, var(--kpi-warning), #ffb76b); }
.kpi-accent--danger { background: linear-gradient(to bottom, var(--kpi-danger), #ff7a7d); }

.kpi-card .card-body {
    padding: 1.25rem;
}

/* Gradient icon container */
.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.08);
}

.kpi-icon--primary {
    background: linear-gradient(135deg, rgba(105, 108, 255, 0.18) 0%, rgba(105, 108, 255, 0.06) 100%);
    color: var(--kpi-primary);
}

.kpi-icon--success {
    background: linear-gradient(135deg, rgba(40, 199, 111, 0.18) 0%, rgba(40, 199, 111, 0.06) 100%);
    color: var(--kpi-success);
}

.kpi-icon--info {
    background: linear-gradient(135deg, rgba(0, 186, 209, 0.18) 0%, rgba(0, 186, 209, 0.06) 100%);
    color: var(--kpi-info);
}

.kpi-icon--warning {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.18) 0%, rgba(255, 159, 67, 0.06) 100%);
    color: var(--kpi-warning);
}

.kpi-icon--danger {
    background: linear-gradient(135deg, rgba(255, 76, 81, 0.18) 0%, rgba(255, 76, 81, 0.06) 100%);
    color: var(--kpi-danger);
}

/* Value display */
.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

/* Label */
.kpi-label {
    font-size: 0.8125rem;
    color: var(--kpi-secondary);
    font-weight: 500;
}

/* Trend indicator */
.kpi-trend {
    font-size: 0.75rem;
}

/* =============================================
   METRIC CARDS (Secondary row)
   ============================================= */
.metric-card {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: var(--card-radius) !important;
    transition: var(--card-transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.metric-card .card-body {
    padding: 1rem 1.25rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.metric-card:hover .metric-icon {
    transform: scale(1.06);
}

.metric-icon--primary {
    background: linear-gradient(135deg, rgba(105, 108, 255, 0.16) 0%, rgba(105, 108, 255, 0.05) 100%);
    color: var(--kpi-primary);
}

.metric-icon--warning {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.16) 0%, rgba(255, 159, 67, 0.05) 100%);
    color: var(--kpi-warning);
}

.metric-icon--secondary {
    background: linear-gradient(135deg, rgba(168, 170, 174, 0.16) 0%, rgba(168, 170, 174, 0.05) 100%);
    color: var(--kpi-secondary);
}

/* =============================================
   CHART CARDS
   ============================================= */
.chart-card {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: var(--card-radius) !important;
    transition: var(--card-transition);
}

.chart-card .card-header {
    background: transparent;
    padding: 1.25rem 1.5rem 0;
}

.chart-card .card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0;
}

.chart-card .card-body {
    padding: 0.5rem 1rem 1rem;
}

.chart-card .card-footer {
    background: transparent;
    padding: 0 1.25rem 1.25rem;
}

#repricingActivityChart {
    min-height: 280px;
}

/* Empty state for charts */
.chart-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
    color: var(--kpi-secondary);
}

.chart-empty-state i {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 0.75rem;
}

/* =============================================
   TABLE CARDS
   ============================================= */
.table-card {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: var(--card-radius) !important;
    overflow: hidden;
}

.table-card .card-header {
    background: transparent;
    padding: 1.25rem 1.5rem;
}

.table-card .card-title {
    font-weight: 600;
    font-size: 1rem;
}

.table-card thead th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--kpi-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    background: transparent;
}

.table-card tbody td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s ease;
}

.table-card tbody tr:last-child td {
    border-bottom: none;
}

.table-card tbody tr {
    transition: background-color 0.15s ease;
}

.table-card tbody tr:hover {
    background-color: rgba(105, 108, 255, 0.04);
}

/* Top Movers Table specifics */
#topMoversTable .text-truncate {
    max-width: 120px;
}

/* Avatar styles for tables */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
}

.avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 600;
    font-size: 0.75rem;
}

#topMoversTable .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* =============================================
   INSIGHTS CARD
   ============================================= */
.insights-card {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: var(--card-radius) !important;
    overflow: hidden;
}

.insights-card .card-header {
    background: transparent;
    padding: 1.25rem 1.25rem 0.75rem;
}

/* Modern pill-style tabs */
.nav-pills-modern {
    gap: 0.375rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 3px;
}

.nav-pills-modern .nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    color: inherit;
    transition: all 0.2s ease;
    border: none;
    position: relative;
}

.nav-pills-modern .nav-link:hover {
    background: rgba(105, 108, 255, 0.06);
}

.nav-pills-modern .nav-link.active {
    background: rgba(105, 108, 255, 0.14) !important;
    color: var(--kpi-primary) !important;
    box-shadow: 0 1px 3px rgba(105, 108, 255, 0.12);
}

/* =============================================
   ALERT ITEMS (JS-rendered)
   ============================================= */
#alertsContainer {
    max-height: 380px;
    overflow-y: auto;
}

/* New alert card design */
.alert-item-card {
    padding: 0.875rem;
    border-radius: 12px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.02);
    margin-bottom: 0.625rem;
}

.alert-item-card:last-child {
    margin-bottom: 0;
}

.alert-item-card:hover {
    background: rgba(105, 108, 255, 0.04);
    transform: translateX(2px);
}

.alert-item-card--danger { border-left-color: var(--kpi-danger); }
.alert-item-card--warning { border-left-color: var(--kpi-warning); }
.alert-item-card--info { border-left-color: var(--kpi-info); }
.alert-item-card--success { border-left-color: var(--kpi-success); }

.alert-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.alert-icon-wrap--danger {
    background: rgba(255, 76, 81, 0.12);
    color: var(--kpi-danger);
}

.alert-icon-wrap--warning {
    background: rgba(255, 159, 67, 0.12);
    color: var(--kpi-warning);
}

.alert-icon-wrap--info {
    background: rgba(0, 186, 209, 0.12);
    color: var(--kpi-info);
}

.alert-icon-wrap--success {
    background: rgba(40, 199, 111, 0.12);
    color: var(--kpi-success);
}

.alert-item-card h6 {
    font-size: 0.8125rem;
    font-weight: 600;
}

.alert-item-card p {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Alert action button */
.alert-action-btn {
    display: block;
    width: 100%;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.alert-action-btn--danger {
    background: rgba(255, 76, 81, 0.1);
    color: var(--kpi-danger);
}
.alert-action-btn--danger:hover {
    background: var(--kpi-danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 76, 81, 0.3);
}

.alert-action-btn--warning {
    background: rgba(255, 159, 67, 0.1);
    color: var(--kpi-warning);
}
.alert-action-btn--warning:hover {
    background: var(--kpi-warning);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 159, 67, 0.3);
}

.alert-action-btn--info {
    background: rgba(0, 186, 209, 0.1);
    color: var(--kpi-info);
}
.alert-action-btn--info:hover {
    background: var(--kpi-info);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 186, 209, 0.3);
}

.alert-action-btn--success {
    background: rgba(40, 199, 111, 0.1);
    color: var(--kpi-success);
}
.alert-action-btn--success:hover {
    background: var(--kpi-success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 199, 111, 0.3);
}

/* Fallback for old alert-item class */
.alert-item {
    transition: all 0.2s ease;
}

.alert-item .alert-icon {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   ACTIVITY TIMELINE (JS-rendered)
   ============================================= */
#recentActivityContainer {
    max-height: 380px;
    overflow-y: auto;
}

.activity-timeline {
    position: relative;
    padding-left: 0;
}

.activity-timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1rem;
    margin-bottom: 0;
}

.activity-timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 18px;
    width: 2px;
    bottom: 0;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
}

.activity-timeline-item--last::before {
    display: none;
}

.activity-timeline-marker {
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2.5px solid;
    z-index: 1;
}

.activity-timeline-marker--info {
    border-color: var(--kpi-info);
    background: rgba(0, 186, 209, 0.15);
}

.activity-timeline-marker--success {
    border-color: var(--kpi-success);
    background: rgba(40, 199, 111, 0.15);
}

.activity-timeline-marker--danger {
    border-color: var(--kpi-danger);
    background: rgba(255, 76, 81, 0.15);
}

.activity-timeline-marker--secondary {
    border-color: var(--kpi-secondary);
    background: rgba(168, 170, 174, 0.15);
}

.activity-timeline-marker--primary {
    border-color: var(--kpi-primary);
    background: rgba(105, 108, 255, 0.15);
}

.activity-timeline-content h6 {
    font-size: 0.8125rem;
    font-weight: 600;
}

.activity-timeline-content small {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* =============================================
   COMPETITOR LIST (JS-rendered)
   ============================================= */
.competitor-item {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease;
}

.competitor-item:last-child {
    border-bottom: none !important;
}

.competitor-item:hover {
    background-color: rgba(105, 108, 255, 0.04);
}

.competitor-rank {
    flex-shrink: 0;
}

.rank-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.rank-number--top {
    background: linear-gradient(135deg, rgba(105, 108, 255, 0.15), rgba(105, 108, 255, 0.05));
    color: var(--kpi-primary);
}

.rank-number--default {
    background: rgba(0, 0, 0, 0.04);
    color: var(--kpi-secondary);
}

.competitor-bar-wrap {
    height: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.competitor-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--kpi-danger), var(--kpi-warning));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   BADGE LABELS
   ============================================= */
.badge.bg-label-success {
    background-color: rgba(40, 199, 111, 0.16) !important;
    color: #28c76f !important;
}

.badge.bg-label-danger {
    background-color: rgba(255, 76, 81, 0.16) !important;
    color: #ff4c51 !important;
}

.badge.bg-label-warning {
    background-color: rgba(255, 159, 67, 0.16) !important;
    color: #ff9f43 !important;
}

.badge.bg-label-info {
    background-color: rgba(0, 186, 209, 0.16) !important;
    color: #00bad1 !important;
}

.badge.bg-label-secondary {
    background-color: rgba(168, 170, 174, 0.16) !important;
    color: #a8aaae !important;
}

.badge.bg-label-primary {
    background-color: rgba(105, 108, 255, 0.16) !important;
    color: #696cff !important;
}

/* =============================================
   LOADING PLACEHOLDERS (Shimmer)
   ============================================= */
.placeholder-glow .placeholder {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.06) 25%,
        rgba(0, 0, 0, 0.12) 50%,
        rgba(0, 0, 0, 0.06) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* =============================================
   APEXCHARTS OVERRIDES
   ============================================= */
.apexcharts-legend-text {
    font-size: 12px !important;
}

.apexcharts-tooltip {
    box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.12) !important;
    border-radius: 10px !important;
    border: none !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
}

/* =============================================
   SCROLLBAR STYLING
   ============================================= */
#alertsContainer::-webkit-scrollbar,
#recentActivityContainer::-webkit-scrollbar {
    width: 4px;
}

#alertsContainer::-webkit-scrollbar-track,
#recentActivityContainer::-webkit-scrollbar-track {
    background: transparent;
}

#alertsContainer::-webkit-scrollbar-thumb,
#recentActivityContainer::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

#alertsContainer::-webkit-scrollbar-thumb:hover,
#recentActivityContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Firefox scrollbar */
#alertsContainer,
#recentActivityContainer {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */

/* Extra Large screens (1400px+) */
@media (min-width: 1400px) {
    .kpi-value {
        font-size: 2rem;
    }
}

/* Large screens (1200px - 1399px) */
@media (max-width: 1399.98px) {
    .kpi-value {
        font-size: 1.5rem;
    }

    #topMoversTable .text-truncate {
        max-width: 100px;
    }
}

/* Medium-Large screens (992px - 1199px) */
@media (max-width: 1199.98px) {
    .kpi-value {
        font-size: 1.375rem;
    }

    .kpi-card .card-body {
        padding: 1rem;
    }

    .kpi-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 1.1rem;
    }

    .metric-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    #repricingActivityChart {
        min-height: 250px;
    }

    .table-card thead th,
    .table-card tbody td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Tablet screens (768px - 991px) */
@media (max-width: 991.98px) {
    .welcome-card .row {
        text-align: center;
    }

    .welcome-card .d-flex.justify-content-md-end {
        justify-content: center !important;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    #repricingActivityChart {
        min-height: 280px;
    }

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

/* Mobile screens (576px - 767px) */
@media (max-width: 767.98px) {
    .container-xxl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .welcome-card .card-body {
        padding: 1rem;
    }

    .welcome-card h4 {
        font-size: 1.125rem;
    }

    .kpi-value {
        font-size: 1.375rem;
    }

    .kpi-card .card-body {
        padding: 0.875rem;
    }

    .metric-card .card-body {
        padding: 0.875rem;
    }

    .metric-icon {
        width: 40px;
        height: 40px;
    }

    #topMoversTable .text-truncate {
        max-width: 80px;
    }

    #repricingActivityChart {
        min-height: 220px;
    }
}

/* Extra small screens (below 576px) */
@media (max-width: 575.98px) {
    .kpi-value {
        font-size: 1.25rem;
    }

    .kpi-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .kpi-label {
        font-size: 0.75rem;
    }

    .metric-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .table-card thead th {
        font-size: 0.625rem;
        padding: 0.5rem;
    }

    .table-card tbody td {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    #topMoversTable .avatar-sm {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    #alertsContainer .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }

    .nav-pills-modern .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.25rem;
    }

    .alert-item-card {
        padding: 0.75rem;
    }

    .activity-timeline-item {
        padding-left: 1.5rem;
    }
}

/* =============================================
   DARK MODE
   ============================================= */
[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .chart-card,
[data-bs-theme="dark"] .table-card,
[data-bs-theme="dark"] .insights-card {
    background: rgba(47, 51, 73, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.06) !important;
}

[data-bs-theme="dark"] .kpi-card[data-stat="totalRevenue"]:hover {
    box-shadow: 0 8px 30px rgba(105, 108, 255, 0.25);
}

[data-bs-theme="dark"] .kpi-card[data-stat="grossProfit"]:hover {
    box-shadow: 0 8px 30px rgba(40, 199, 111, 0.25);
}

[data-bs-theme="dark"] .kpi-card[data-stat="netMargin"]:hover {
    box-shadow: 0 8px 30px rgba(0, 186, 209, 0.25);
}

[data-bs-theme="dark"] .kpi-card[data-stat="buyBoxWinRate"]:hover {
    box-shadow: 0 8px 30px rgba(255, 159, 67, 0.25);
}

[data-bs-theme="dark"] .metric-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .welcome-card {
    background: linear-gradient(-45deg, #6d28d9, #5b5bd6, #7c7cf0, #5a21b6) !important;
    background-size: 300% 300% !important;
}

[data-bs-theme="dark"] .table-card thead th {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    color: #8b8b9a;
}

[data-bs-theme="dark"] .table-card tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .table-card tbody tr:hover {
    background-color: rgba(105, 108, 255, 0.06);
}

[data-bs-theme="dark"] .alert-item-card {
    background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .alert-item-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .activity-timeline-item::before {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .competitor-item {
    border-bottom-color: rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme="dark"] .competitor-item:hover {
    background-color: rgba(105, 108, 255, 0.06);
}

[data-bs-theme="dark"] .rank-number--default {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .competitor-bar-wrap {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .nav-pills-modern {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .nav-pills-modern .nav-link:hover {
    background: rgba(105, 108, 255, 0.08);
}

[data-bs-theme="dark"] .nav-pills-modern .nav-link.active {
    background: rgba(105, 108, 255, 0.18) !important;
    box-shadow: 0 1px 3px rgba(105, 108, 255, 0.2);
}

[data-bs-theme="dark"] .placeholder-glow .placeholder {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

[data-bs-theme="dark"] #alertsContainer::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] #recentActivityContainer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] #alertsContainer::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] #recentActivityContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] #alertsContainer,
[data-bs-theme="dark"] #recentActivityContainer {
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Fix alert items in dark mode (JS-generated bg-light) */
[data-bs-theme="dark"] .alert-item.bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Fix activity border-bottom in dark mode */
[data-bs-theme="dark"] .activity-item.border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

/* =============================================
   RTL SUPPORT
   ============================================= */
[dir="rtl"] .kpi-accent {
    left: auto;
    right: 0;
    border-radius: 0 var(--card-radius) var(--card-radius) 0;
}

[dir="rtl"] .alert-item-card {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .alert-item-card--danger { border-right-color: var(--kpi-danger); }
[dir="rtl"] .alert-item-card--warning { border-right-color: var(--kpi-warning); }
[dir="rtl"] .alert-item-card--info { border-right-color: var(--kpi-info); }
[dir="rtl"] .alert-item-card--success { border-right-color: var(--kpi-success); }

[dir="rtl"] .alert-item-card:hover {
    transform: translateX(-2px);
}

[dir="rtl"] .activity-timeline-item {
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .activity-timeline-item::before {
    left: auto;
    right: 7px;
}

[dir="rtl"] .activity-timeline-marker {
    left: auto;
    right: 0;
}

[dir="rtl"] .welcome-orb--1 {
    right: auto;
    left: -40px;
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    .welcome-card {
        display: none !important;
    }

    .kpi-card,
    .metric-card {
        break-inside: avoid;
    }

    .kpi-card:hover,
    .metric-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .kpi-card,
    .metric-card,
    .chart-card,
    .table-card,
    .insights-card,
    .welcome-card,
    .alert-item-card,
    .activity-timeline-marker,
    .nav-pills-modern .nav-link,
    .kpi-icon,
    .metric-icon,
    .alert-action-btn,
    .competitor-bar {
        transition: none !important;
        animation: none !important;
    }

    .kpi-card:hover,
    .metric-card:hover {
        transform: none !important;
    }

    .welcome-orb {
        animation: none !important;
    }
}
