/* ========================================
   Quotes Dashboard
   ======================================== */

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-selector label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.period-select {
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.period-select:hover {
    border-color: #cbd5e1;
}

.period-select:focus {
    border-color: #059669;
}

/* ========================================
   Cache Notice
   ======================================== */
.cache-notice {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 24px;
}

.cache-notice i {
    color: #cbd5e1;
}

/* ========================================
   Stat Cards Override
   ======================================== */
.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon.pending {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-icon.quoted {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.won {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.rate {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon.margin {
    background: #fce7f3;
    color: #db2777;
}

.stat-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.stat-trend.up {
    background: #d1fae5;
    color: #059669;
}

.stat-trend.down {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   Chart Card
   ======================================== */
.chart-card {
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    margin-bottom: 24px;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.chart-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.chart-card-body {
    padding: 16px 24px 24px;
    position: relative;
    height: 340px;
}

/* ========================================
   Leaderboards
   ======================================== */
.leaderboard-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.leaderboard-section-title i {
    color: #64748b;
    font-size: 14px;
}

.office-select {
    margin-left: auto;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.office-select:hover {
    border-color: #cbd5e1;
}

.office-select:focus {
    border-color: #059669;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.leaderboard-card {
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.leaderboard-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-title i {
    color: #059669;
    font-size: 13px;
}

.leaderboard-body {
    padding: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s ease;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: #f8fafc;
}

.leaderboard-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #64748b;
}

.leaderboard-rank.gold {
    background: #fef3c7;
    color: #d97706;
}

.leaderboard-rank.silver {
    background: #f1f5f9;
    color: #475569;
}

.leaderboard-rank.bronze {
    background: #ffedd5;
    color: #c2410c;
}

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-detail {
    font-size: 11px;
    color: #94a3b8;
}

.leaderboard-value {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
}

/* ========================================
   Leaderboard Bar
   ======================================== */
.leaderboard-bar-track {
    flex: 1;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.leaderboard-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.leaderboard-bar-fill.green {
    background: #059669;
}

.leaderboard-bar-fill.blue {
    background: #2563eb;
}

.leaderboard-bar-fill.purple {
    background: #7c3aed;
}

/* ========================================
   Refresh Button
   ======================================== */
#refresh-dashboard-btn .fa-arrows-rotate.spinning {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
