/* 老板端专用样式 */

/* 公司统计 */
.company-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.company-stats .stat-item {
    text-align: center;
    min-width: 65px;
}

.company-stats .stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.company-stats .stat-label {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
}

.company-stats .stat-divider {
    font-size: 16px;
    opacity: 0.5;
}

/* 公司总览 */
.company-container {
    padding: 20px;
}

.company-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.company-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.company-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.company-card-subtitle {
    color: #666;
    font-size: 14px;
}

.company-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item-large {
    text-align: center;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.stat-value-large {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label-large {
    font-size: 13px;
    color: #666;
}

.stat-change {
    font-size: 12px;
    margin-top: 5px;
}

.change-up {
    color: #52c41a;
}

.change-down {
    color: #f5222d;
}

/* 岗位管理 */
.management-container {
    padding: 20px;
}

.employee-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.employee-table th {
    background: #f8f9ff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e8e8e8;
}

.employee-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.employee-table tr:hover {
    background: #f0f2ff;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-boss {
    background: #f0f7ff;
    color: #667eea;
}

.role-manager {
    background: #f6ffed;
    color: #52c41a;
}

.role-supervisor {
    background: #fff7e6;
    color: #fa8c16;
}

.role-employee {
    background: #f0f0f0;
    color: #666;
}

.status-active {
    color: #52c41a;
    font-weight: 500;
}

.status-inactive {
    color: #f5222d;
    font-weight: 500;
}

/* 数据分析 - 老板战情室 */
.analysis-container {
    padding: 16px;
}

/* 顶部指标卡 */
.analytics-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-kpi-card {
    background: white;
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.08);
    position: relative;
    overflow: hidden;
}

.analytics-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.analytics-kpi-card.kpi-calls::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.analytics-kpi-card.kpi-effective::before { background: linear-gradient(90deg, #52c41a, #73d13d); }
.analytics-kpi-card.kpi-rate::before { background: linear-gradient(90deg, #fa8c16, #ffc53d); }
.analytics-kpi-card.kpi-idle::before { background: linear-gradient(90deg, #ff4d4f, #ff7875); }

.analytics-kpi-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.analytics-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1.1;
}

.analytics-kpi-sub {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.analytics-kpi-sub .up { color: #52c41a; }
.analytics-kpi-sub .down { color: #ff4d4f; }

/* 时间范围切换 */
.analytics-range-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    padding: 4px;
    background: #f0f0f5;
    border-radius: 10px;
}

.range-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.range-btn.active {
    background: #667eea;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

/* 团队业绩 */
.team-perf-summary {
    font-size: 13px;
}

.team-perf-total {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 8px 0 14px;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}

.team-perf-groups {
    display: flex;
    gap: 10px;
}

.team-perf-group {
    flex: 1;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #e8e8ff;
}

.team-perf-group-name {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 13px;
}

.team-perf-group-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.team-perf-group-stats span {
    padding: 2px 0;
}

.pf-visit { color: #9C27B0; }
.pf-sign { color: #4CAF50; }
.pf-payment { color: #FF9800; }

/* 时段分布图（纯CSS柱状图） */
.analytics-section-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.08);
    margin-bottom: 16px;
}

.analytics-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding: 0 4px;
    border-bottom: 1px solid #f0f0f0;
}

.analytics-hour-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.analytics-hour-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 2px;
    background: linear-gradient(to top, #667eea, #90a0ff);
    transition: all 0.3s;
}

.analytics-hour-bar .bar-effective {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #52c41a;
    border-radius: 4px 4px 0 0;
    opacity: 0.85;
}

.analytics-hour-label {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    white-space: nowrap;
}

.analytics-hour-rate {
    font-size: 9px;
    color: #52c41a;
    font-weight: 600;
    margin-bottom: 2px;
}

/* 闲置预警列表 */
.analytics-idle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analytics-idle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.analytics-idle-item.idle-warning {
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #d46b08;
}

.analytics-idle-item.idle-danger {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #cf1322;
}

.analytics-idle-item.idle-ok {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

/* 团队对比表 */
.analytics-team-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.analytics-team-table th {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.analytics-team-table td {
    font-size: 13px;
    color: #333;
    padding: 10px;
    background: #fafafa;
    border-radius: 0;
}

.analytics-team-table tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.analytics-team-table tr td:last-child {
    border-radius: 0 10px 10px 0;
}

.analytics-team-table tr:hover td {
    background: #f0f2ff;
}

.analytics-team-name {
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
}

.analytics-team-name:hover {
    text-decoration: underline;
}

.value-better { color: #52c41a; font-weight: 600; }
.value-worse { color: #ff4d4f; font-weight: 600; }
.value-neutral { color: #999; }

/* 成员排行展开区 */
.analytics-member-expand {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
}

.analytics-member-expand.show {
    display: block;
}

.analytics-member-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.analytics-member-row:last-child {
    border-bottom: none;
}

.analytics-member-rank {
    width: 24px;
    font-weight: 600;
    color: #999;
    font-size: 12px;
}

.analytics-member-name {
    flex: 1;
    font-weight: 500;
}

.analytics-member-name {
    cursor: pointer;
    color: #667eea;
}

.analytics-member-stat {
    width: 60px;
    text-align: right;
    font-size: 12px;
    color: #666;
}

/* 个人详情浮层 */
.analytics-employee-detail {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.4);
    padding: 20px;
    overflow-y: auto;
}

.analytics-employee-detail.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.emp-detail-card {
    background: linear-gradient(135deg, #f8f9ff, #f0f2ff);
    border-radius: 16px;
    border: 1px solid #e8e8ff;
    padding: 24px 20px 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
}

.emp-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.emp-detail-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.emp-detail-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
}

.emp-detail-close:hover {
    color: #333;
}

.emp-detail-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.emp-detail-kpi {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.emp-detail-kpi-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.emp-detail-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.emp-detail-kpi-label {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.emp-vs-team {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.emp-vs-team-item {
    padding: 8px 14px;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 排名栏 */
.analytics-ranking {
    display: flex;
    gap: 20px;
}

.analytics-ranking-col {
    flex: 1;
}

.analytics-ranking-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.analytics-ranking-item .rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-right: 10px;
    color: white;
}

.rank-1 { background: #ffc53d; }
.rank-2 { background: #b3b3b3; }
.rank-3 { background: #d4a574; }
.rank-other { background: #e8e8e8; color: #999 !important; }

.analytics-ranking-item .name {
    flex: 1;
}

.analytics-ranking-item .stat {
    font-weight: 600;
    color: #667eea;
}

/* 周趋势迷你图 */
.analytics-weekly {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.analytics-weekly-day {
    flex: 1;
    text-align: center;
}

.analytics-weekly-bar {
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.analytics-weekly-bar-inner {
    width: 16px;
    border-radius: 3px 3px 0 0;
    background: #667eea;
    min-height: 4px;
    position: relative;
}

.analytics-weekly-bar-inner .eff {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #52c41a;
    border-radius: 3px 3px 0 0;
}

.analytics-weekly-date {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* 员工选择卡片悬停效果 */
.analytics-employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.2);
}

/* 空状态/加载态 */
.analytics-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.analytics-empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
    .analytics-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-hourly-chart {
        height: 120px;
    }
    .emp-detail-kpi {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-ranking {
        flex-direction: column;
        gap: 10px;
    }
    .analytics-team-table {
        font-size: 12px;
    }
}

/* 系统设置 */
.settings-container {
    padding: 20px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.settings-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

.settings-input:focus {
    border-color: #667eea;
    outline: none;
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.settings-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.settings-checkbox span {
    font-size: 14px;
    color: #333;
}

/* 营收图表 */
.revenue-chart {
    height: 200px;
    background: #f8f9ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

.revenue-bar {
    flex: 1;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 10px;
}

.revenue-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.revenue-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .company-stats {
        gap: 8px;
    }
    
    .company-stats .stat-item {
        min-width: 55px;
    }
    
    .company-stats .stat-value {
        font-size: 18px;
    }
    
    .company-summary {
        grid-template-columns: 1fr;
    }
    
    .employee-table {
        display: block;
        overflow-x: auto;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .revenue-chart {
        flex-direction: column;
        height: auto;
        align-items: stretch;
    }
    
    .revenue-bar {
        height: 30px;
        border-radius: 0 4px 4px 0;
    }
    
    .revenue-label {
        position: static;
        margin-top: 5px;
    }
    
    .revenue-value {
        position: static;
        margin-bottom: 5px;
    }
}
/* 闲置明细板块（个人详情浮层内） */
.emp-idle-section {
    margin-top: 16px;
    padding: 12px;
    background: #fff8f8;
    border-radius: 10px;
    border: 1px solid #ffe8e8;
}

.emp-idle-grid {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.emp-idle-stat {
    font-size: 13px;
    color: #666;
    background: white;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #ffd4d4;
}

.emp-idle-num {
    font-size: 20px;
    font-weight: 700;
    color: #ff4d4f;
    margin-right: 2px;
}

/* 可点击区域统一指针样式 */
.clickable-idle, .clickable-emp, .clickable-team, .analytics-team-name {
    cursor: pointer !important;
}

/* X5浏览器防选中 */
#analysisContainer, #analysisContainer * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    touch-action: manipulation !important;
}
