/*
 * ธีมฟอร์ม "เพิ่ม/แก้ไขหน่วยงาน" (manage_category.php) — โทน bento
 * การ์ดขาว, ฟ้า #1877f2, Noto Sans Thai, มุมโค้ง, จัดกลุ่มเป็นสัดส่วน
 */

/* จัดฟอร์มไว้กึ่งกลางจอ: ทำ .main__content เป็น flex column + align-items center
   (รับประกันกึ่งกลาง โดยไม่พึ่ง margin auto ที่ถูกกฎ app.css ทับ) */
.main__content.categories.category-create {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}
.main__content.categories.category-create .categories__head,
.main__content.categories.category-create .table-wrap {
    width: 100%;
    max-width: 720px;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.main__content.categories.category-create .categories__head {
    margin: 2px 0 16px !important;
    padding: 0 !important;
    background: transparent !important;   /* เอากรอบขาว/เส้นใต้รอบหัวข้อออก */
    border: 0 !important;
    border-bottom: 0 !important;
}
.main__content.categories.category-create .categories__head h2 {
    font-family: inherit !important;
    margin: 0;
    padding: 0 !important;
    font-size: 22px;
    font-weight: 800;
    color: #101828;
}

/* การ์ดฟอร์ม */
.main__content.categories.category-create .table-wrap {
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    padding: 24px 26px;
    overflow: visible;
}
.main__content.categories.category-create .form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
}

/* แต่ละกลุ่ม */
.category-create .form-group {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.category-create .form-group > label,
.category-create .category-create__select > span,
.category-create label.label-block {
    margin: 0;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
    text-align: left !important;
}
.category-create .important { color: #e11d48; }

/* ช่องกรอกข้อความ */
.category-create input[type="text"].form-control,
.category-create input#name {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #1d2939;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.category-create input[type="text"].form-control:focus,
.category-create input#name:focus {
    outline: 0;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .15);
}

/* แถวที่มี select (ความสำคัญ / ประเภท) -> label บน + กล่อง select */
.category-create .category-create__select {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 7px;
}
.category-create .category-create__select .dropdown-select {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 200px;
    max-width: 240px;
    min-height: 46px;
    padding: 4px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.category-create .category-create__select .dropdown-select:hover,
.category-create .category-create__select .dropdown-select.active {
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .12);
}
.category-create .category-create__select .dropdown-select .label,
.category-create .category-create__select .dropdown-select span {
    font-size: 14px;
    font-weight: 600;
    color: #1d2939;
}

/* ===== กลุ่มตัวเลือก (radio) แบบการ์ดเลือกได้ ===== */
.category-create .radio-group .radio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.category-create .radio-custom {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 13px 15px;
    border: 1.5px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.category-create .radio-custom:hover {
    border-color: #b9d3fb;
    background: #fafcff;
}
.category-create .radio-custom input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1877f2;
    cursor: pointer;
    flex: 0 0 auto;
}
.category-create .radio-custom label {
    margin: 0;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
/* เมื่อเลือก -> ขอบฟ้า + พื้นฟ้าอ่อน (ใช้ :has) */
.category-create .radio-custom:has(input[type="radio"]:checked) {
    border-color: #1877f2;
    background: #eff5ff;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .1);
}
.category-create .radio-custom:has(input[type="radio"]:checked) label {
    color: #1456b8;
    font-weight: 700;
}

/* ===== หน้าต่างเลือกผู้ใช้ (auto-assign specific) ===== */
.category-create #select-users-window {
    border: 1px dashed #d8dce3;
    border-radius: 12px;
    padding: 16px;
    background: #fbfcfe;
}
.category-create #select-users-window hr { display: none; }
.category-create #search-for-user {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
}
.category-create .autoassign-users {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
    padding: 4px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #fff;
}
.category-create .autoassign-users .checkbox-custom {
    padding: 8px 10px;
    border-radius: 8px;
}
.category-create .autoassign-users .checkbox-custom:hover {
    background: #f5f6f8;
}
.category-create #select-all,
.category-create #deselect-all {
    display: inline-block;
    margin-top: 4px;
    color: #1877f2;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.category-create #select-all:hover,
.category-create #deselect-all:hover { text-decoration: underline; }

/* ===== ระยะดำเนินการ (due date) — input + หน่วย แถวเดียว ===== */
.category-create .form-group:has(#due-date-amount) {
    flex-direction: column;
}
.category-create #due-date-amount {
    width: 110px !important;
    margin: 0 !important;
    padding: 11px 13px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
}
.category-create #due-date-amount:focus {
    outline: 0;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .15);
}
/* ให้ amount + หน่วย อยู่แถวเดียว */
.category-create .form-group:has(#due-date-amount) {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "label label label" "amount unit note";
    align-items: center;
    gap: 8px 10px;
}
.category-create .form-group:has(#due-date-amount) > label { grid-area: label; }
.category-create #due-date-amount { grid-area: amount; }
.category-create .form-group:has(#due-date-amount) #id1 { grid-area: unit; }
.category-create .form-group:has(#due-date-amount) > div:last-child {
    grid-area: note;
    color: #98a2b3;
    font-size: 13px;
}

/* กล่องแจ้งเตือนสีน้ำเงิน (ouwa) -> subtle */
.category-create .notice-flash .notification.blue {
    padding: 10px 14px;
    border-radius: 10px;
    background: #eff5ff;
    border: 1px solid #d6e4ff;
    color: #1456b8;
    font-size: 13px;
}

/* ===== ปุ่มบันทึก ===== */
.category-create .form > .btn,
.category-create button[type="submit"].btn {
    align-self: flex-start !important;
    width: auto !important;
    min-width: 168px;
    margin-top: 8px;
    padding: 12px 28px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: #1877f2 !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(24, 119, 242, .26) !important;
    transition: background-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.category-create .form > .btn:hover,
.category-create button[type="submit"].btn:hover {
    background: #1567d8 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(24, 119, 242, .32) !important;
}
