/**
 * Combined Dashboard Styles
 * Mixed Sales + Calls dashboard styling
 */

/* Stats Grid - 8 cards in 2 rows */
.combined-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .combined-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .combined-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Combined Stat Card */
.combined-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.combined-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.combined-stat-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.combined-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.combined-stat-icon svg {
    width: 24px;
    height: 24px;
}

.combined-stat-icon.revenue {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.combined-stat-icon.calls {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.combined-stat-icon.deals {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.combined-stat-icon.productivity {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.combined-stat-icon.conversion {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.combined-stat-icon.time {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
}

.combined-stat-content {
    flex: 1;
    min-width: 0;
}

.combined-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combined-stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Performer Cards */
.combined-performer-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .combined-performer-cards {
        grid-template-columns: 1fr;
    }
}

.combined-performer-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.combined-performer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.combined-performer-card.calls {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.combined-performer-card.sales {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
}

.combined-performer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.combined-performer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.combined-performer-info {
    flex: 1;
}

.combined-performer-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.combined-performer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6366f1;
    font-weight: 500;
}

.combined-performer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.combined-performer-stat {
    text-align: center;
}

.combined-performer-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.combined-performer-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combined-performer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 14px;
    gap: 12px;
}

/* Combined Leaderboard Table */
.combined-leaderboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.combined-leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: none;
    flex-wrap: wrap;
    gap: 12px;
}

/* Leaderboard Date Badge */
.leaderboard-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
}

.leaderboard-date-badge svg {
    color: var(--gray-400);
}

/* Leaderboard Date Presets */
.leaderboard-date-presets {
    display: flex;
    gap: 8px;
    padding: 0 24px 16px 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
}

.leaderboard-date-presets .date-preset-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaderboard-date-presets .date-preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.leaderboard-date-presets .date-preset-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .leaderboard-date-presets {
        padding: 0 16px 12px 16px;
        gap: 6px;
    }

    .leaderboard-date-presets .date-preset-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .leaderboard-date-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
}

.combined-leaderboard-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.combined-leaderboard-title svg {
    width: 20px;
    height: 20px;
    color: var(--gray-500);
}

.combined-table {
    width: 100%;
    border-collapse: collapse;
}

.combined-table thead {
    background: var(--gray-50);
}

.combined-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.combined-table th.number-cell {
    text-align: right;
}

.combined-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

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

.combined-table tr:hover {
    background: var(--gray-50);
}

.combined-table .rank-cell {
    width: 50px;
    font-weight: 600;
    color: var(--gray-400);
    text-align: center;
}

.combined-table .number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.combined-table .revenue-highlight {
    font-weight: 600;
    color: #059669;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Badges */
.productivity-badge,
.conversion-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.productivity-badge.good,
.conversion-badge.good {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.productivity-badge.warning,
.conversion-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.productivity-badge.danger,
.conversion-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Empty State */
.combined-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.combined-empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 8px;
}

.combined-empty-state p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Page Header */
.combined-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.combined-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
}

.combined-page-title svg {
    width: 28px;
    height: 28px;
    color: #6366f1;
}

.combined-page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Mobile Combined Dashboard Improvements */
@media (max-width: 768px) {
    .combined-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .combined-page-title {
        font-size: 20px;
    }

    .combined-page-title svg {
        width: 24px;
        height: 24px;
    }

    .combined-stat-card {
        padding: 16px;
    }

    .combined-stat-card-inner {
        gap: 12px;
    }

    .combined-stat-icon {
        width: 40px;
        height: 40px;
    }

    .combined-stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .combined-stat-value {
        font-size: 20px;
    }

    .combined-performer-card {
        padding: 16px;
    }

    .combined-performer-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .combined-performer-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .combined-performer-name {
        font-size: 14px;
    }

    .combined-performer-stats {
        gap: 8px;
    }

    .combined-performer-stat-value {
        font-size: 16px;
    }

    .combined-leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .combined-leaderboard-title {
        font-size: 14px;
    }

    /* Table scroll container */
    .combined-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .combined-table th,
    .combined-table td {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .user-avatar-small {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .user-info {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .combined-page-title {
        font-size: 18px;
    }

    .combined-stat-card-inner {
        flex-direction: column;
        text-align: center;
    }

    .combined-stat-value {
        font-size: 18px;
    }

    .combined-stat-label {
        font-size: 10px;
    }

    .combined-performer-header {
        flex-direction: column;
        text-align: center;
    }

    .combined-performer-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .combined-performer-stat {
        padding: 8px;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 8px;
    }

    .combined-table th,
    .combined-table td {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Hide less important columns on very small screens */
    .combined-table .hide-mobile {
        display: none;
    }

    .productivity-badge,
    .conversion-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
}
