/**
 * 看板样式
 * Painel de Tarefas em Tempo Real
 */

/* ==================== 全局 ==================== */
body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==================== Live 指示灯 ==================== */
.blink {
    animation: blink-animation 1.5s ease-in-out infinite;
    font-size: 0.6rem;
    vertical-align: middle;
}

@keyframes blink-animation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

#liveIndicator {
    font-size: 0.8rem;
    padding: 0.35em 0.7em;
}

#lastUpdateTime {
    font-size: 0.8rem;
}

/* ==================== 声音开关按钮 ==================== */
.sound-toggle {
    font-size: 1rem;
    padding: 0.2em 0.5em;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.sound-toggle.btn-outline-secondary {
    opacity: 0.6;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.85;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 2px;
}

.stat-overdue { background: linear-gradient(135deg, #dc3545, #c82333); }
.stat-pending { background: linear-gradient(135deg, #ffc107, #e0a800); color: #212529; }
.stat-pending .stat-label { color: #212529; }
.stat-locked  { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
.stat-total   { background: linear-gradient(135deg, #6c757d, #565e64); }

/* 数字为 0 时降低醒目度 */
.stat-card.zero {
    opacity: 0.6;
}

/* ==================== 看板列 ==================== */
.board-column {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.board-column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.financeiro-header  { background: linear-gradient(135deg, #fd7e14, #e8590c); }
.faturamento-header { background: linear-gradient(135deg, #198754, #157347); }
.vendedor-header    { background: linear-gradient(135deg, #0dcaf0, #0aa2c0); color: #212529; }

.board-column-body {
    min-height: 120px;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    padding: 0.5rem;
}

/* 滚动条样式 */
.board-column-body::-webkit-scrollbar {
    width: 5px;
}

.board-column-body::-webkit-scrollbar-track {
    background: transparent;
}

.board-column-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.board-column-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ==================== 任务卡片 ==================== */
.board-task {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.board-task:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 状态边框 */
.board-task.status-overdue {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.board-task.status-pending {
    border-left: 4px solid #ffc107;
}

.board-task.status-locked {
    border-left: 4px solid #0d6efd;
    background: #f0f6ff;
}

/* 卡片头部 */
.board-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.board-task-type {
    font-weight: 600;
    font-size: 0.95rem;
}

.board-task-status {
    font-size: 0.75rem;
    padding: 0.2em 0.55em;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.board-task-status.overdue {
    background: #dc3545;
    color: #fff;
}

.board-task-status.pending {
    background: #ffc107;
    color: #212529;
}

.board-task-status.locked {
    background: #0d6efd;
    color: #fff;
}

/* 卡片详情 */
.board-task-details {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.6;
}

.board-task-details .detail-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.board-task-details .detail-row i {
    width: 16px;
    text-align: center;
    color: #888;
}

/* 时间信息 */
.board-task-time {
    font-size: 0.78rem;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-overdue {
    color: #dc3545;
    font-weight: 600;
}

.time-urgent {
    color: #fd7e14;
    font-weight: 600;
}

.time-normal {
    color: #6c757d;
}

.time-locked {
    color: #0d6efd;
    font-weight: 500;
}

/* 脉冲动画（超时任务） */
.board-task.status-overdue .board-task-status {
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==================== 空状态 ==================== */
.board-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #adb5bd;
}

.board-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.board-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==================== Vendedor 统计 ==================== */
.vendedor-stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.vendedor-stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-width: 180px;
}

.vendedor-stat-item .vendedor-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.vendedor-stat-item .vendedor-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: #dc3545;
    margin-left: auto;
}

.vendedor-stat-item .vendedor-count.zero {
    color: #198754;
}

/* ==================== 加载状态 ==================== */
.board-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
}

.board-loading p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 991px) {
    .board-column-body {
        max-height: 50vh;
    }
    
    .stat-card {
        padding: 0.8rem 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 767px) {
    .stat-card {
        padding: 0.7rem 0.9rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .vendedor-stat-grid {
        flex-direction: column;
    }
    
    .vendedor-stat-item {
        min-width: auto;
    }
}
