/* ==============================================================
   CARDS COMPONENT
   Standard containers and dashboard widgets
   ============================================================== */

/* Base Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Dashboard Stat Card (Legacy/Simple) */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    background: rgba(var(--primary-rgb), 0.02);
}

/* ==============================================================
   PREMIUM STAT CARDS REDESIGN
   ============================================================== */
.stat-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px 28px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.stat-card-premium:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
    background: rgba(var(--primary-rgb), 0.05);
}

.stat-card-premium::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.stat-card-premium:hover::before {
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.12) 0%, transparent 70%);
    transform: scale(1.4);
}

.stat-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card-premium:hover .stat-icon-box {
    transform: scale(1.1) rotate(-8deg);
}

/* Balanced Color Palette for Icons */
.stat-icon-box.orange { 
    background: rgba(245, 158, 11, 0.12); 
    color: #f59e0b; 
    box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.stat-icon-box.green { 
    background: rgba(16, 185, 129, 0.12); 
    color: #10b981; 
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.stat-icon-box.blue { 
    background: rgba(59, 130, 246, 0.12); 
    color: #3b82f6; 
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.stat-icon-box.pink { 
    background: rgba(236, 72, 153, 0.12); 
    color: #ec4899; 
    box-shadow: 0 8px 16px -4px rgba(236, 72, 153, 0.25);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.stat-info-premium {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label-premium {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value-premium {
    font-size: 26px;
    font-weight: 850;
    color: var(--text-main);
    margin: 0;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
}

.stat-action-hint {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--primary);
    margin-left: auto;
}

.stat-card-premium:hover .stat-action-hint {
    opacity: 1;
    transform: translateX(0);
}

/* Clickable Alert Variant (e.g. Commissions Pending) */
.stat-card-clickable {
    cursor: pointer;
    border-color: rgba(234, 179, 8, 0.25) !important;
    background: rgba(234, 179, 8, 0.04) !important;
}

.stat-card-clickable:hover {
    border-color: rgba(234, 179, 8, 0.6) !important;
    background: rgba(234, 179, 8, 0.08) !important;
    box-shadow: 0 20px 40px -15px rgba(234, 179, 8, 0.25) !important;
    transform: translateY(-6px);
}

.stat-card-clickable::before {
    background: radial-gradient(circle, rgba(234, 179, 8, 0.08) 0%, transparent 70%) !important;
}

/* ==============================================================
   TABLE CARD UTILITIES
   ============================================================== */

/* Table Card Uniformity (Minimum height for small tables) */
.card:has(.table-responsive), 
.card-table,
.card-table-premium {
    min-height: 55vh;
    display: flex;
    flex-direction: column;
}

.card:has(.table-responsive) .table-responsive,
.card-table .table-responsive,
.card-table-premium .table-responsive {
    flex: 1;
}

/* Dashboard Specific Cards & Info Blocks */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.6);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.dashboard-card-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.dashboard-card-header h3 i {
    width: 20px;
    height: 20px;
}

.info-block {
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-block:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

/* ==============================================================
   RESPONSIVENESS (Rule 38)
   ============================================================== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 20px;
    }

    .stat-card-premium {
        padding: 20px;
    }

    .stat-value-premium {
        font-size: 22px;
    }

    .dashboard-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card:has(.table-responsive), 
    .card-table,
    .card-table-premium {
        min-height: auto;
    }
}
