/*---------- เพิ่มฟอนต์ Sarabun ----------*/
@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

html,
body {
    font-family: Sarabun !important;
    margin: 0px;
}

div:where(.swal2-container).swal2-backdrop-show,
div:where(.swal2-container).swal2-noanimation {
    z-index: 9999;
}
.rounded-16 {
    border-radius: 16px !important;
}
.box_read0 {
    background-color: #FFF;
}

.box_read1 {
    background-color: rgba(0, 0, 0, 0.051);
}

.show {
    display: block !important;
}

.link {
    cursor: pointer;
}

tr.topic_inbox:hover {
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
    z-index: 999;
}

.box_bysend {
    background-color: rgb(91 172 255 / 24%);
    border-radius: 100px;
    padding: 0px 15px;
}

.btn-close {
    background-color: #e5e4e4;
}

.box_send {
    --bs-offcanvas-width: 550px;
}

.box_card {
    box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
}

.box_search {
    display: none;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    position: absolute;
    z-index: 99;
    box-shadow: 0 0.375rem 1rem 0 rgba(58, 53, 65, 0.12);
}

.box_cancel {
    position: absolute;
    margin: -20px auto;
    padding: 7px;
    background-color: #607d8ba6;
    width: 98%;
    z-index: 4;
}

.box_cancel p {
    margin: 0px auto;
    color: #cb0000;
    background-color: #fff;
    width: fit-content;
    padding: 0 10px;
    border-radius: 20px;
}

.timeline {
    position: relative;
    /*height: 100%;*/
    width: 100%;
    padding: 0;
    list-style: none;
}

.timeline li {
    padding-bottom: 15px;
}

.timeline .timeline-item {
    position: relative;
    padding-left: 1.4rem;
}

.timeline .timeline-item .timeline-point {
    position: absolute;
    left: -0.38rem;
    top: 12px;
    z-index: 2;
    display: block;
    height: .75rem;
    width: .75rem;
    border-radius: 50%;
    background-color: #8c57ff;
    box-shadow: 0 0 0 10px #fff;
}

.timeline .timeline-point-primary {
    background-color: #8c57ff !important;
    outline: 3px solid rgba(140, 87, 255, .12);
}

.timeline-item {
    /*html:not([dir=rtl]) */
    border-left: 1px solid #e6e5e8;
}

/*-------------------------- แก้ไขไฟล์ต้นฉบับ --------------------------*/
.bg-menu-theme {
    background-color: #28243d !important;
    color: #ffffff;
}

.bg-menu-theme .menu-inner-shadow {
    background: linear-gradient(#28243d 41%, #28243d00 95%, rgba(255, 255, 255, 0));
}

.menu-vertical .menu-item .menu-link {
    font-size: 14px;
    letter-spacing: 0.15px;
}

.menu-vertical .menu-inner .menu-item.active>.menu-link {
    font-weight: 400;
}

.bg-menu-theme .menu-link,
.bg-menu-theme .menu-horizontal-prev,
.bg-menu-theme .menu-horizontal-next {
    color: #ffffff;
}

.bg-menu-theme .menu-link,
.bg-menu-theme .menu-horizontal-prev,
.bg-menu-theme .menu-horizontal-next:hover {
    color: #ffffff !important;
}

.bg-menu-theme .menu-item>.menu-link:not(.menu-toggle):hover {
    background-color: rgba(67, 89, 113, 0.5);
}

.menu-icon::before {
    font-size: 20px;
}

.select2-container--default .select2-selection--multiple {
    background-color: white;
    border: 1px solid #d4d3d5;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: text;
    padding-bottom: 5px;
    padding-right: 5px;
    position: relative;
}

.select2-container {
    width: 100% !important;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.47;
    color: #544f5a;
    appearance: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d4d3d5;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container {
    z-index: 9999;
}

.was-validated span.select2-selection:invalid {
    border: 1px solid #ff4c51;
}

.was-validated span.select2-selection:valid {
    border: 1px solid #56ca00;
}

div:where(.swal2-container) {
    z-index: 99999;
}

.bg-label-danger2 {
    background-color: #ff4c51 !important;
    color: #ffffff !important;
}

.bg-label-danger3 {
    background-color: #9d0006 !important;
    color: #ffffff !important;
}

/*
.avatar {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
}*/


/*----------------- รายการรับหนังสือ -----------------------*/
.read_doc {
    background-color: #0000000d;
}
.page-header-card {

    background: linear-gradient(135deg,
            #ffffff 0%,
            #f8fbff 100%);

    border-radius: 24px;

    padding: 1.4rem 1.5rem;

    border: 1px solid #e9eef7;

    box-shadow: 0 8px 24px rgba(0, 0, 0, .05);

    position: relative;

    overflow: hidden;
}

.page-header-card::before {

    content: '';

    position: absolute;

    top: -40px;
    right: -40px;

    width: 140px;
    height: 140px;

    background: rgba(105, 108, 255, .08);

    border-radius: 50%;
}

.header-icon {

    width: 56px;
    height: 56px;

    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;


    background: linear-gradient(135deg,
            #696cff,
            #5fd0ff);

    color: #fff;

    box-shadow: 0 8px 18px rgba(105, 108, 255, .25);
}

tr.read_doc .header-icon {


    background: linear-gradient(135deg,
            #69ff69,
            #5fd0ff);

}

.mdi:before,
.mdi-set {
    font-size: unset;
}

.header-icon i {
    font-size: 33px !important;
}
/*
.btn-primary {

    background: linear-gradient(135deg,
            #696cff,
            #5fd0ff);

    border: none;
}

.btn-primary:hover {

    transform: translateY(-2px);

    box-shadow: 0 10px 20px rgba(105, 108, 255, .2);
}
*/
@media (max-width: 768px) {

    .page-header-card {

        padding: 1rem;
        border-radius: 20px;
    }

    .header-icon {

        width: 48px;
        height: 48px;

        font-size: 1.3rem;
    }

    .btn {

        width: 100%;
    }
}


.doc-card {

    background: #fff;

    border-radius: 24px;

    padding: 1.2rem;

    border: 1px solid #edf0f7;

    transition: .25s;

    cursor: pointer;

    height: 100%;

    position: relative;
}

.doc-card:hover {

    transform: translateY(-4px);

    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
}

.doc-card.unread {

    border-left: 5px solid #696cff;

    background: linear-gradient(180deg,
            #ffffff 0%,
            #f8fbff 100%);
}

.doc-topic {

    font-size: 1rem;

    font-weight: 700;

    line-height: 1.5;

    color: #233255;

    min-height: 48px;
}

.doc-meta {

    font-size: .88rem;

    color: #6b7280;
}

.doc-meta div {

    margin-bottom: .45rem;

    display: flex;

    align-items: center;

    gap: .45rem;
}

.doc-avatar {

    width: 42px;

    height: 42px;

    border-radius: 50%;

    object-fit: cover;
}

.unread-dot {

    width: 10px;

    height: 10px;

    background: #ff3e1d;

    border-radius: 50%;
}

.Searchinbox .input-group-text,
.Searchinbox input {
    border-radius: 50rem;

}

.receive-tabs {
    display: flex;
    gap: 14px;
    margin: 10px auto;
    flex-wrap: wrap;
}

.receive-tab {
    background: #fff;
    border: 1px solid #edf2f7;
    padding: 5px 13px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
}

.receive-tab span {
    min-width: 28px;
    height: 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: #eff6ff;
}






.btn-open {
    border: none;
    padding: 14px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
}

.btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, .35);
}

@media (max-width: 992px) {

    .doc-card {
        flex-direction: column;
        align-items: stretch;
    }

    .doc-sender {
        min-width: unset;
    }

    .doc-action {
        width: 100%;
    }

    .btn-open {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {

    .doc-card {
        padding: 18px;
        border-radius: 22px;
    }

    .doc-left {
        gap: 14px;
    }

    .doc-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 24px;
        border-radius: 18px;
    }

    .doc-title {
        font-size: 16px;
    }

    .doc-meta {
        gap: 12px;
        font-size: 13px;
    }

    .doc-sender {
        padding: 12px;
    }
}


/*-------------------------------------------------- รายการหนังสือ ----------------------------------*/
.receive-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.doc-card {

    position: relative;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    background: #fff;

    border-radius: 24px;

    padding: 22px;

    margin-bottom: 18px;

    border: 1px solid #edf1f7;

    transition: .25s ease;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .04);

    overflow: hidden;

}

.doc-card:hover {

    transform: translateY(-4px);

    box-shadow:
        0 18px 40px rgba(0, 0, 0, .08);

}

/* ========================= */

.doc-card.unread {

    background:
        linear-gradient(135deg,
            #fff8f8,
            #fffdfd);

    border-left: 6px solid #ff8c8c;

}

.doc-card.read {

    background:
        linear-gradient(135deg,
            #f8fbff,
            #ffffff);

    border-left: 6px solid #a9c8ff;

    opacity: .92;

}

/* ========================= */

.doc-status-dot {

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: #ff6b6b;

    position: absolute;

    top: 18px;
    right: 18px;

    box-shadow:
        0 0 0 6px rgba(255, 107, 107, .15);

}

.read-dot {

    background: #7ea8ff;

    box-shadow:
        0 0 0 6px rgba(126, 168, 255, .15);

}

/* ========================= */

.doc-left {

    display: flex;
    align-items: flex-start;
    gap: 18px;

    flex: 1;

}

.doc-icon {

    width: 72px;
    height: 72px;

    border-radius: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(135deg,
            #ffd6d6,
            #ffe9e9);

    color: #ff5e5e;

    font-size: 28px;

    flex-shrink: 0;

}

.read-icon {

    background:
        linear-gradient(135deg,
            #dbe9ff,
            #edf4ff);

    color: #5d8fff;

}

/* ========================= */

.doc-content {

    flex: 1;

}

.doc-badges {

    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    margin-bottom: 10px;

}

.badge-ui {

    padding: 6px 12px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 700;

}

.badge-danger {

    background: #ffe1e1;
    color: #d94141;

}

.badge-unread {

    background: #fff0c9;
    color: #d08a00;

}

.badge-read {

    background: #ddeaff;
    color: #3f76df;

}

/* ========================= */

.doc-title {

    font-size: 18px;

    font-weight: 800;

    color: #2f3542;

    line-height: 1.5;

    margin-bottom: 12px;

}

/* ========================= */

.doc-meta {

    display: flex;
    flex-wrap: wrap;
    gap: 18px;

    color: #7c8597;

    font-size: 14px;

}

.doc-meta div {

    display: flex;
    align-items: center;
    gap: 8px;

}

/* ========================= */

.doc-sender {

    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 260px;

}

.doc-sender img {

    width: 58px;
    height: 58px;

    border-radius: 50%;

    object-fit: cover;

    border: 3px solid #fff;

    box-shadow:
        0 6px 16px rgba(0, 0, 0, .08);

}

.sender-name {

    font-size: 15px;
    font-weight: 700;

    color: #2d3748;

}

.sender-mail {

    font-size: 13px;

    color: #7b8798;

    margin-top: 2px;

}

.sender-dept {

    font-size: 13px;

    color: #98a2b3;

    margin-top: 2px;

}

/* ========================= */

.doc-action {

    flex-shrink: 0;

}

.btn-open {

    border: none;

    background:
        linear-gradient(135deg,
            #ff9090,
            #ffb4b4);

    color: #fff;

    padding: 12px 18px;

    border-radius: 16px;

    font-weight: 700;

    display: flex;
    align-items: center;
    gap: 10px;

    transition: .25s ease;

}

.btn-open:hover {

    transform: scale(1.04);

}

.read-btn {

    background:
        linear-gradient(135deg,
            #8db7ff,
            #b8d2ff);

}

/* ========================= */

@media(max-width: 992px) {

    .doc-card {

        flex-direction: column;
        align-items: stretch;

    }

    .doc-sender {

        min-width: 100%;

    }

    .doc-action {

        width: 100%;

    }

    .btn-open {

        width: 100%;
        justify-content: center;

    }

}

/*-------------------------------------- ส่งหนังสือ --------------------------------------*/

.mail-wrapper {
    /*max-width:1100px;*/
    margin: auto;
    /*padding:30px 20px;*/
}

.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 0px;
    flex-wrap: wrap;
}

.mail-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.mail-header p {
    margin-top: 6px;
    color: #64748b;
}

.mail-actions-top {
    display: flex;
    gap: 12px;
}

.mail-card {
    background: #fff;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .06);
}


.receiver-box {
    min-height: 58px;
    border: 1px solid #dbe3ee;
    border-radius: 18px;
    padding: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
}

.receiver-box input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 180px;
    font-size: 1rem;
    font-family: inherit;
}

.receiver-tag {
    background: #e8f1ff;
    color: #2563eb;
    padding: 8px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .92rem;
    font-weight: 500;
}

.receiver-tag i {
    cursor: pointer;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.urgency-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.urgency-item {
    flex: 1;
    min-width: 120px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    border: 2px solid transparent;
    transition: .25s;
    background: #f8fafc;
}

.urgency-item input {
    display: none;
}

.urgency-item.normal {
    background: #eef2ff;
    color: #4338ca;
}

.urgency-item.normal.active {
    border-color: #4338ca;
}


.urgency-item.warning {
    background: #fff7ed;
    color: #ea580c;
}

.urgency-item.warning.active {
    border-color: #ea580c;
}

.urgency-item.orange {
    background: #fff1f2;
    color: #f97316;
}

.urgency-item.orange.active {
    border-color: #f97316;
}

.urgency-item.danger {
    background: #fef2f2;
    color: #dc2626;
}

.urgency-item.danger.active {
    border-color: #dc2626;
}

.type-group {
    display: flex;
    gap: 12px;
}

.type-item {
    flex: 1;
    height: 56px;
    border-radius: 18px;
    border: 1px solid #dbe3ee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: .25s;
    background: #fff;
}

.type-item.active {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.type-item input {
    display: none;
}

.input-modern {
    width: 100%;
    height: 58px;
    border-radius: 18px;
    border: 1px solid #dbe3ee;
    padding: 0 18px;
    font-size: 1rem;
    outline: none;
    transition: .25s;
}

.input-modern:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .1);
}

.textarea-modern {
    width: 100%;
    min-height: 180px;
    border-radius: 20px;
    border: 1px solid #dbe3ee;
    padding: 18px;
    resize: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    transition: .25s;
}

.textarea-modern:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .1);
}


.upload-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #e0ecff;
    color: #2563eb;
    margin: auto;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}


.btn-upload {
    border: none;
    background: #2563eb;
    color: #fff;
    height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.file-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.file-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.file-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.file-icon.pdf {
    background: #fef2f2;
    color: #dc2626;
}

.file-icon.image {
    background: #ecfeff;
    color: #0891b2;
}

.file-item h4 {
    margin: 0;
    font-size: .96rem;
}

.file-item span {
    color: #64748b;
    font-size: .88rem;
}

.remove-file {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    cursor: pointer;
    transition: .2s;
}

.remove-file:hover {
    background: #fee2e2;
    color: #dc2626;
}

.mail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    gap: 12px;
}


.btn-light {
    height: 52px;
    padding: 0 22px;
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
    display: flex;
    align-items: center;
    gap: 10px;
}



.btn-light {
    background: #f1f5f9;
    color: #334155;
}

@media(max-width:768px) {

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .mail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mail-actions-top,
    .footer-right {
        width: 100%;
    }

    .btn-primary,
    .btn-light {
        flex: 1;
        justify-content: center;
    }

    .mail-footer {
        flex-direction: column;
        align-items: stretch;
    }

}



.receiver-box {
    position: relative;
    width: 100%;
}

.receiver-box input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    outline: none;
}

.suggestions {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    display: none;
    overflow: hidden;
    z-index: 999;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.suggestion-item small {
    color: #888;
}

.suggestion-item:hover {
    background: #f3f6ff;
}




/*----- boxส่ง้อกสาร ------*/
.overlay.open,
.overlay2.open {
    display: flex;
}

.overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 80px 24px 24px;
}

.overlay2 {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.compose-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: auto;
    /*calc(100vh - 100px);*/
    animation: slideUp 0.2s ease;
}
.overlay2 .compose-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: auto;
    /*calc(100vh - 100px);*/
    animation: slideUp 0.2s ease;
}

.compose-header {
    background: #3c4043;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    color: #fff;
    flex-shrink: 0;
}

.compose-title {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.compose-controls {
    display: flex;
    gap: 4px;
}

.compose-ctrl {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.compose-body {
    overflow-y: auto;
    max-height: 650px;
    height: calc(100vh - 100px);
    flex: 1;
}

/*



*/
.compose-field input,
.compose-field select,
.compose-field textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #80868b;
    background: none;
}

.compose-field textarea {
    resize: none;
    min-height: 80px;
    padding-top: 8px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.grp-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
    display: block;
    width: 100%;
}

.toggle-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--gray-300);
    background: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-btn.active-normal {
    background: #e8f0fe;
    border-color: #1a56db;
    color: #1a56db;
}

.compose-footer {
    padding: 12px 16px;
    border-top: 1px solid #e8eaed;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}




/*-- ฟอร์มส่ง ถึง ---*/
.compose-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.compose-field label {
    width: 60px;
    color: #222;
    font-size: 14px;
    flex-shrink: 0;
    font-weight: 600;
}

/* wrapper */

.receiver-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}



/* tag */

.receiver-tag {
    display: flex;
    align-items: center;
    gap: 7px;

    background: #e8f0fe;
    color: #1967d2;

    border-radius: 999px;

    padding: 6px 10px;

    font-size: 14px;
}

.receiver-tag .remove {
    cursor: pointer;
}

/* suggestions */

.suggestions {
    position: absolute;

    top: calc(100% + 6px);
    left: 78px;
    right: 0;
    width: 70%;
    background: #fff;

    border-radius: 14px;

    border: 1px solid #ececec;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);

    overflow: hidden;

    z-index: 999;

    display: none;
}

/* item */

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 14px;

    cursor: pointer;
}

.suggestion-item:hover {
    background: #f6f9ff;
}

/* avatar */

.suggestion-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #dbe7ff;
    color: #1967d2;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 600;
}

/* info */

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 600;
}

.suggestion-email {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*--- ชั้นความเร็ว ---*/



.option-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.grp-label {
    width: 95px;
    color: #222;
    font-size: 14px;
    flex-shrink: 0;
    font-weight: 600;
}

.option-item input {
    display: none;
}

.option-item span {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid #dcdcdc;
    background: #fff;
    cursor: pointer;
    transition: .2s;
    font-size: 13px;
}

.option-item span:hover {
    background: #f5f5f5;
}

/* ชั้นความเร็ว */

.option-item input[value="normal"]:checked+span {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.option-item input[value="fast"]:checked+span {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.option-item input[value="urgent"]:checked+span {
    background: #fd7e14;
    border-color: #fd7e14;
    color: #fff;
}

.option-item input[value="superurgent"]:checked+span {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* ประเภทหนังสือ */

.option-item input[value="inside"]:checked+span {
    background: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

.option-item input[value="outside"]:checked+span {
    background: #20c997;
    border-color: #20c997;
    color: #fff;
}

@media (max-width: 768px) {
    .option-group {
        align-items: flex-start;
    }

    .grp-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

/*---- รายละเอียด ---*/
.form-group {
    margin: 18px 10px;
}


.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #dcdcdc;
    background: #fff;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all .2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-textarea::placeholder {
    color: #999;
}

.form-textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    background: #fff;
}

.form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #777;
}

@media (max-width: 768px) {
    .form-textarea {
        min-height: 120px;
        font-size: 16px;
    }
}

.compose-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ปุ่มทั้งหมด */

.compose-footer button {
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

/* ส่งเอกสาร */

.btn-send {
    background: #0d6efd;
    color: #fff;
}

.btn-send:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

/* บันทึกร่าง */

.btn-draft {
    background: #ffc107;
    color: #222;
}

.btn-draft:hover {
    background: #ffca2c;
    transform: translateY(-1px);
}

/* ยกเลิก */

.btn-cancel-small {
    background: #f1f3f5;
    color: #444;
}

.btn-cancel-small:hover {
    background: #e2e6ea;
}

/* mobile */

@media (max-width: 768px) {
    .compose-footer {
        flex-direction: column;
    }

    .compose-footer button {
        width: 100%;
    }
}

.upload-zone {
    border: 2px dashed #cfd8e3;
    border-radius: 18px;
    padding: 28px 20px;
    margin: 10px;
    text-align: center;
    background: #f8fbff;
    transition: .2s;
}

.upload-zone.dragging {
    border-color: #0d6efd;
    background: #eef5ff;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-zone p {
    margin: 0;
    font-weight: 600;
}

.upload-zone small {
    color: #777;
}

.upload-btn {
    margin-top: 14px;
    border: none;
    background: #0d6efd;
    color: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eef4ff;
    border: 1px solid #d6e4ff;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
}

.file-chip button {
    border: none;
    background: none;
    color: red;
    cursor: pointer;
}

.btn-send:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.filter-card {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
}

.doc-table-wrap {
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
    background: #fff;
}

.doc-table {
    margin: 0;
    vertical-align: middle;
}

.doc-table thead th {
    background: #f7f8fb;
    border-bottom: 1px solid #eceef5;
    font-size: 14px;
    font-weight: 600;
    color: #5b6475;
    white-space: nowrap;
    padding: 14px;
}

.doc-table tbody td {
    padding: 16px 14px;
    border-color: #f0f2f7;
}

.doc-table tbody tr:hover {
    background: #fafcff;
}

.doc-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.doc-sub {
    font-size: 13px;
    color: #6b7280;
}

.doc-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 12px;
    background: #f4f7ff;
    color: #3867ff;
    font-size: 13px;
    text-decoration: none;
    transition: .2s;
}

.doc-file:hover {
    background: #e9efff;
}

.badge-status {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-unread {
    background: #fff3cd;
    color: #856404;
}

.status-read {
    background: #d1f7df;
    color: #0f7b42;
}

.status-cancel {
    background: #f1f1f1;
    color: #666;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 0;
    transition: .2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-view {
    background: #eef3ff;
    color: #3867ff;
}

.btn-edit {
    background: #fff4db;
    color: #d68a00;
}

.btn-cancel {
    background: #ffe5e5;
    color: #dc3545;
}

.btn-action:hover {
    transform: translateY(-1px);
}

/* CARD MOBILE */

.doc-card {
    display: none;
}

.doc-mobile-card {
    border: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
    padding: 0px !important;
}



.doc-no {
    font-size: 13px;
    font-weight: 600;
    color: #3867ff;
    margin-bottom: 8px;
}

.doc-mobile-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.5;
    margin-bottom: 12px;
}

.doc-info {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
    align-items: flex-start;
}

.doc-info i {
    margin-top: 3px;
}

.doc-action-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.doc-action-group .btn {
    flex: 1;
    border-radius: 14px;
}

.read-progress {
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

/* =========================
ประเภทเอกสาร
========================= */

.doc-type-box {
    line-height: 1.4;
}

.doc-type-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

/* =========================
ผู้รับเอกสาร
========================= */

.receiver-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receiver-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.receiver-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.receiver-detail {
    min-width: 0;
}

.receiver-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receiver-email {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receiver-more {
    font-size: 12px;
    color: #3867ff;
    font-weight: 600;
    padding-left: 52px;
}

/* =========================
Badge ชั้นความเร็ว
========================= */

.badge {
    width: fit-content;
    font-size: 11px;
    padding: 7px 10px;
}

@media (max-width: 991px) {

    .doc-desktop {
        display: none*;
    }

    .doc-card {
        display: block;
    }
}

.receiver-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* fallback ตัวอักษร */

.avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3867ff;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================
   NMPLUS DOCUMENT VIEW
========================= */

.nm-docview {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    font-family: "Sarabun", sans-serif;
}

/* Header */
.nm-docview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 10px 24px;
    border-bottom: 1px solid #ececec;
}

.nm-docview-title {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
}

.nm-docview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nm-docview-iconbtn {
    width: 42px;
    height: 42px;

    border: none;
    background: #f5f5f5;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
    color: #444;

    transition: .2s;
}

.nm-docview-iconbtn:hover {
    background: #eaeaea;
}

/* Sender */
.nm-docview-sender {
    display: flex;
    align-items: flex-start;
    gap: 15px;

    padding: 15px 24px;
    border-bottom: 1px solid #f1f1f1;
}

.nm-docview-avatar {
    width: 50px;
    height: 50px;

    border-radius: 50%;
    background: #2157ff;

    color: #fff;
    font-size: 18px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.nm-docview-sender-info {
    width: 100%;
}

.nm-docview-sender-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 4px;
}

.nm-docview-sender-top h6 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.nm-docview-time {
    font-size: 14px;
    color: #8a8a8a;
}

.nm-docview-meta {
    font-size: 14px;
    color: #6d6d6d;

    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nm-docview-badge {
    background: #ffebeb;
    color: #d40000;

    padding: 4px 10px;
    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;
}

/* Content */
.nm-docview-content {
    padding: 28px 24px;

    color: #333;
    font-size: 17px;
    line-height: 2.1;
}

.nm-docview-content p {
    margin-bottom: 28px;
}

/* Files */
.nm-docview-files {
    padding: 0 24px 24px;
}

.nm-docview-file-title {
    font-size: 15px;
    font-weight: 700;

    margin-bottom: 14px;

    display: flex;
    align-items: center;
    gap: 8px;
}

.nm-docview-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nm-docview-file-item {
    width: 250px;

    border: 1px solid #e6e6e6;
    border-radius: 14px;

    padding: 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: inherit;

    transition: .2s;
}

.nm-docview-file-item:hover {
    background: #f9f9f9;
    border-color: #d9d9d9;
}

.nm-docview-file-icon {
    width: 44px;
    height: 44px;

    border-radius: 10px;
    background: #f3f3f3;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
}

.nm-docview-file-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 160px;
}

.nm-docview-file-sub {
    font-size: 13px;
    color: #888;
}

/* Footer */
.nm-docview-footer {
    padding: 22px 24px;

    border-top: 1px solid #f1f1f1;

    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.nm-docview-file-icon i {
    font-size: 34px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {

    .nm-docview-title {
        font-size: 22px;
    }

    .nm-docview-sender-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .nm-docview-file-item {
        width: 100%;
    }

    .nm-docview-content {
        font-size: 16px;
        line-height: 1.9;
    }

}