/* ล้างค่าเริ่มต้นที่ Elementor ชอบมารบกวน */
.bm-wrapper {
    font-family: 'Kanit', sans-serif;
    width: 100%;
    color: #334155;
    box-sizing: border-box;
    padding: 20px 0 !important;
}
.bm-wrapper p, .bm-wrapper h3 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

/* 1. ปุ่มไตรมาส (บังคับเว้นระยะด้านล่าง 40px ไม่ให้ทับการ์ด) */
.bm-tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px !important;
    margin-bottom: 40px !important;
}
.bm-tab {
    font-family: 'Kanit', sans-serif;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.bm-tab.active {
    background: #257CFF !important;
    color: #ffffff !important;
    border-color: #257CFF !important;
    box-shadow: 0 4px 12px rgba(37, 124, 255, 0.25) !important;
}

/* 2. การ์ด (ปรับ grid ให้พอดีกับ 4 ใบ) */
.bm-cards-grid {
    display: grid;
    /* ให้เป็น 2 คอลัมน์ บนจอเล็ก และ 4 คอลัมน์บนจอใหญ่ */
    grid-template-columns: repeat(2, 1fr); 
    gap: 32px !important;
    margin-bottom: 48px !important;
}

@media (min-width: 1024px) {
    .bm-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


.bm-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 20px !important;
    padding: 32px 24px !important;
    position: relative;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}
.bm-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 20px 20px 0 0;
}
.bm-card:nth-child(1)::before { background: #257CFF; }
.bm-card:nth-child(2)::before { background: #F45A2A; }
.bm-card:nth-child(3)::before { background: #10B981; }
.bm-card:nth-child(4)::before { background: #8b5cf6; } /* สีม่วง */

.bm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px !important;
    width: 100%;
}
.bm-card-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #64748b;
}
.bm-icon-box {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bm-icon-box svg { width: 24px; height: 24px; }
.bm-icon-box.blue { background: #eff6ff; color: #257CFF; }
.bm-icon-box.orange { background: #fff7ed; color: #F45A2A; }
.bm-icon-box.green { background: #ecfdf5; color: #10B981; }
.bm-icon-box.purple { background: #f5f3ff; color: #8b5cf6; } /* สีม่วง */

.bm-card-number {
    font-size: 42px !important; /* ปรับขนาดลงนิดนึงเผื่อ 4 ใบเบียดกัน */
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    line-height: 1 !important;
}
.text-dark { color: #1e293b; }

.bm-card-desc { font-size: 14px !important; color: #94a3b8; }
.text-orange-light { color: #ea580c; background: #fff7ed; padding: 6px 12px; border-radius: 20px; display: inline-block; font-weight: 500;}
.text-green-light { color: #059669; background: #ecfdf5; padding: 6px 12px; border-radius: 20px; display: inline-block; font-weight: 500;}
.text-purple-light { color: #7c3aed; background: #f5f3ff; padding: 6px 12px; border-radius: 20px; display: inline-block; font-weight: 500;}

/* 3. กราฟ (บังคับแยกบรรทัดและเพิ่มความหนาแท่ง) */
.bm-graph-box {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    padding: 36px 32px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
.bm-graph-header {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1e293b;
    margin-bottom: 30px !important;
}
.bm-scroll-area {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 20px;
}
.bm-scroll-area::-webkit-scrollbar { width: 6px; }
.bm-scroll-area::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.bm-scroll-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.bm-task-item { margin-bottom: 28px !important; } /* ขยายระยะห่างระหว่างแต่ละกราฟ */
.bm-task-item:last-child { margin-bottom: 0 !important; }
.bm-task-info {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px !important; /* เว้นระยะระหว่างข้อความกับแท่งกราฟ */
}
.bm-task-name { font-size: 16px !important; font-weight: 500 !important; color: #334155; }
.bm-task-stats { font-size: 15px !important; font-weight: 600 !important; color: #0f172a; }
.bm-task-stats span { color: #94a3b8; font-weight: 400; margin-left: 6px; }

.bm-progress-bg {
    width: 100%; 
    background-color: #f1f5f9; 
    height: 14px !important; /* เพิ่มความหนาของแท่งกราฟให้อ่านง่าย */
    border-radius: 10px; 
    overflow: hidden;
}
.bm-progress-bar {
    height: 100% !important; 
    background: linear-gradient(90deg, #F2373D 0%, #F45A2A 100%);
    border-radius: 10px; 
    width: 0%; 
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}