.action-icons {
    position: absolute;
    top: -2px; right: -5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.badge-priority {
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: normal;
    font-size: 14px; color: #fff;
    display: inline-block;
}
.badge-type {
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: normal;
    font-size: 14px;
    background-color: #e0e0e0;
    color: #333;
    display: inline-block;
}


.bg-prio-1 { background-color: #ff4d4f; }
.bg-prio-2 { background-color: #ffc107; color: #000 !important; }
.bg-prio-3 { background-color: #5d5fef; }

.view-label { color: #000; font-size: 18px; margin-bottom: 2px; font-weight: 500; }
.view-value { font-size: 18px; color: #333; }
.view-value-grey { font-size: 18px; color: #666; }

.modal-task-dialog {
    max-width: 650px;
    margin: 1.75rem auto;
}

.custom-input {
    background-color: #EFEFEF !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    padding: 10px 15px !important;
    font-size: 14px;
    transition: 0.3s;
    width: 100%;
    color: #333;
}

.custom-input:focus {
    background-color: #fff !important;
    border-color: #ccc !important;
    box-shadow: none !important;
}

.input-readonly {
    background-color: #DCDCDC !important;
    cursor: not-allowed;
    color: #777;
    pointer-events: none;
}


.custom-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
    display: block;
}


.modal-header-clean {
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title-bold {
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0;
}


.btn-close-custom {
    border: none;
    background: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.btn-close-custom:hover { color: #000; }


.btn-submit-task {
    width: 100%;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    transition: all 0.3s;
    margin-top: 10px;
}
.btn-submit-task:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.modal-task-content {
    border-radius: 20px;
    border: none;
    padding: 20px;
    width: 626px;
    background-color: #fff;
}

.font-hanken {
    font-family: 'Hanken Grotesk', sans-serif;
}

.modal-header-clean {
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-bold {
    font-weight: bold;
    margin-bottom: 0;
}

.btn-close-custom {
    border: none;
    background: none;
    font-size: 24px;
    color: #000;
    opacity: 0.5;
    transition: 0.3s;
    cursor: pointer;
}
.btn-close-custom:hover {
    opacity: 1;
}

.modal-footer-clean {
    border-top: none;
    justify-content: center;
    padding-top: 0;
}

.custom-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.custom-input:focus {
    background-color: #fff;
    border-color: #ccc;
    box-shadow: none;
}

.input-readonly {
    background-color: #dcdcdc !important;
    cursor: not-allowed;
    color: #777;
}

.btn-submit-task {
    width: 100%;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    transition: all 0.3s;
}

.btn-submit-task:hover {
    background-color: #333;
    transform: translateY(-2px);
    color: #fff;
}

.project-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.project-header-row .project-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}
.project-header-row .btn {
    transition: transform 0.2s;
}
.header-action-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 10px;
}


.header-action-bar h2 {
    margin: 0;
    font-weight: bold;
    color: #333;
}

.view-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.view-toggle-container {
    display: inline-flex;
    background-color: #e6e6e6;
    border-radius: 30px;
    padding: 4px;
}
.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: 25px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    border: none;
}
.toggle-item:hover {
    text-decoration: none;
    background-color: rgba(255,255,255,0.5);
    color: #333;
}
.toggle-item.active {
    background-color: #8c52ff;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(140, 82, 255, 0.3);
}
.toggle-item img {
    vertical-align: middle;
}
.project-swimlane-wrapper {
    margin-bottom: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #eee;
}
.project-header {
    padding: 10px 15px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    border-left: 5px solid #0d6efd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    transition: background 0.2s;
}
.project-header:hover {
    background: #f1f3f5;
}
.project-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}
.project-body {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    align-items: flex-start;
}
.project-body::-webkit-scrollbar { height: 8px; }
.project-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.project-body::-webkit-scrollbar-thumb:hover { background: #8b8b8b;  }
.column-wrapper {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.column-wrapper
.is-collapsed {
    width: 60px !important;
    min-width: 60px !important;
    cursor: pointer;
    background: #e9ecef;
    border-radius: 12px;
    align-items: center;
    padding-top: 20px;
}
.column-wrapper
.is-collapsed
.kanban-container {
    display: none !important;
}
.column-collapsed-view {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.column-wrapper
.is-collapsed
.column-collapsed-view {
    display: flex;
}
.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: bold;
    white-space: nowrap;
    font-size: 16px; color: #555;
    margin-bottom: 10px;
}

.btn-toggle-col { cursor: pointer;
    opacity: 0.5; margin-left: 8px;
    transition: 0.2s;
}
.btn-toggle-col:hover { opacity: 1;
    transform: scale(1.1);
}




.kanban-board-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
}


.kanban-board-wrapper::-webkit-scrollbar {
    height: 8px;
}

.kanban-board-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.kanban-board-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.kanban-board-wrapper::-webkit-scrollbar-thumb:hover {
    background: #8b8b8b;
}
.kanban-list2 {
    background: #D9D9D9;
    width: 195px;
    height: 42px;
    border-radius: 20px;
    margin: 15px 0px 15px 1005px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
}

.kl {
    width: 50%;
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 5px;
}

.kanban-list2 a {
    text-decoration: none;
    color: #000;
    font-size: 16px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
    height: 100%;
}


.kanban-drag-area {
    flex-grow: 1;
    padding-bottom: 20px;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1px;
}
.kanban-drag-area::-webkit-scrollbar {
    width: 8px;
}


.kanban-drag-area::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}


.kanban-drag-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}


.kanban-drag-area::-webkit-scrollbar-thumb:hover {
    background: #8b8b8b;
}
.task-box:active {
    cursor: grabbing;
}
.task-box {
    cursor: grab;
}
.head-task {
    display: flex;
    gap: 20px;
    align-items: stretch;
}
.date-end-kanban-delay {
    color: rgba(255, 0, 0, 0.70);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding: 8px 0px 4px 0px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.bg-kanban-black,
.bg-kanban-grey,
.bg-kanban-red,
.bg-kanban-orange,
.bg-kanban-blue {
    width: auto !important;
    height: auto !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    gap: 5px;
    white-space: nowrap;
}


.bg-kanban-black {
    background: #151515;
    color: #FFF;
}

.bg-kanban-grey {
    background: #BCBCBC;
    color: #FFF;
}

.bg-kanban-red {
    background: rgba(255, 0, 4, 0.20);
    color: #FF0004;
}

.bg-kanban-orange {
    background: rgba(228, 219, 97, 0.20);
    color: #C3B603;
}

.bg-kanban-blue {
    background: rgba(55, 0, 255, 0.10);
    color: #496DFF;
}
.header-row-kanban {
    position: relative;
    min-height: 20px;
    margin-bottom: 8px;
}
.submenu-kanban {
    position: absolute;
    top: 0px;
    right: 0px;
    cursor: pointer;
}
.pm {
    color: rgba(97, 97, 97, 0.70);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    display: flex;
    justify-content: right;
    padding: 0px 10px 0px 0px;
    margin-top: -21px;
}
.assignee {
    width: 44px;
    height: 21px;
    border-radius: 5px;
    background: rgba(100, 255, 105, 0.50);
    display: flex;
    justify-content: center;
    align-items: center;
}
.time-end-kanban {
    color: #C400C4;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}
.time-end-kanban {
    padding: 0px 0px 15px 0px;
}
.date-end-kanban {
    padding: 8px 0px 4px 0px;
    color: rgba(0, 0, 0, 0.70);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}
.line {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.20);
    margin: 10px 0;
}
.task-desc-kanban {
    color: rgba(0, 0, 0, 0.70);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding: 0px 0px 9px 0px;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    display: block !important;
    height: auto !important;
}
.task-title-kanban {
    color: #000;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding: 20px 0px 0px 0px;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
    word-break: break-all !important;
    display: block !important;
}
.task-box {
    width: auto;
    margin: 15px;
    min-height: 190px;
    height: auto;
    border-radius: 20px;
    border: 1px solid #D9D9D9;
    background: #FFF;
    padding: 15px;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    word-wrap: break-word;
    height: auto !important;
    min-height: 190px !important;
    overflow: visible !important;
}
.task-id-kanban {
    width: 65px;
    height: 21px;
    border-radius: 20px;
    border: 1px solid #E8E8E8;
    background: #FFF;
    color: #000;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kanban-section {
    margin-top: 15px;
}
.kanban-container, .kanban-container-or, .kanban-container-gr {
    width: 363px;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border-top: 5px solid #ccc;
}
.kanban-container {
    border: 1px solid #D9D9D9;
    background: rgba(217, 217, 217, 0.20);
}
.kanban-container-or {
    border: 1px solid #F4F4A6;
    background: rgba(217, 217, 217, 0.20);
}
.kanban-container-gr {
    border: 1px solid #58F181;
    background: rgba(217, 217, 217, 0.20);
}
.head-container, .head-container-or, .head-container-gr {
    width: 363px;
    height: 68px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;

    color: #000;
    font-size: 20px;
    font-weight: 400;
}

.head-container { background: rgba(217, 217, 217, 0.50); }
.head-container-or { background: rgba(253, 180, 54, 0.40); }
.head-container-gr { background: rgba(88, 241, 129, 0.40); }

.head-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}
.head-number {
    width: 30px;
    height: 29px;
    border-radius: 10px;
    background: #D9D9D9;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    margin-left: auto;
    margin-right: 10px;
}

.section h3 {
    color: #000;
    font-size: 36px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-align: center;
    margin: 5px;
}

.btn-search {
    border: none;
    background: #D9D9D9;
    color: black;
    border-radius: 10px;
    padding: 10px 20px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
}


.kanban-header-card {
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); /* เงาจางๆ ดูนุ่มนวล */
    border: 1px solid #edf2f9;
}


.page-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.5rem;
}

.btn-create-project {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

/* 1. ปรับพื้นหลัง */
body, html {
    background-color: #f4f7f9;
    /* ✅ แก้ตรงนี้: เปลี่ยนจาก hidden เป็น auto เพื่อให้มี Scrollbar */
    overflow-y: auto !important;
    height: 100%;
}

.kanban-page-wrapper {
    padding: 10px;
    padding-bottom: 50px; /* เผื่อพื้นที่ด้านล่าง */
}

/* 2. แต่ง Header */
.kanban-header-section {
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 25px;
}

/* 3. หัวข้อตรงกลาง */
.page-centered-title {
    margin: 0;
    font-weight: 800;
    color: #2c3e50;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}
.page-centered-title::after {
    content: ''; display: block; width: 50px; height: 4px;
    background: #0d6efd; margin: 8px auto 0; border-radius: 2px; opacity: 0.8;
}

/* 4. Search & Button */
.search-box { position: relative; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-input { padding-left: 40px; height: 45px; border-radius: 50px; border: 1px solid #e2e8f0; background-color: #f8fafc; transition: 0.3s; }
.search-input:focus { background-color: #fff; border-color: #0d6efd; box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1); }
.btn-create-project { padding: 10px 24px; border-radius: 50px; font-weight: 600; box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2); transition: 0.3s; }
.btn-create-project:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(13, 110, 253, 0.3); }

/* 5. ✅ จัดการ Scrollbar แนวนอน (สำคัญ) */
#kanban-app {
    /* บังคับให้เลื่อนแนวนอนได้ */
    overflow-x: auto !important;
    overflow-y: hidden;
    white-space: nowrap; /* ให้คอลัมน์เรียงต่อกันไปเรื่อยๆ ไม่ตกบรรทัด */
    padding-bottom: 20px; /* เว้นที่ให้ Scrollbar */
}


/* ⭐ แถม: แต่ง Scrollbar ให้สวย (เหมือน Trello) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 5px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }


.sortable-ghost {
    opacity: 0.4;
    background-color: #e2e8f0 !important;
    border: 2px dashed #8c52ff !important;
}

/* ปรับให้โปรเจกต์บอดี้รองรับการจัดวาง */
.project-body {
    display: flex;
    align-items: flex-start; /* สำคัญ: เพื่อให้คอลัมน์ไม่ยืดความสูงตามกันจนลากยาก */
    min-height: 300px;
}

.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed #0d6efd !important;
}