﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background-color: #e6f2ff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.approve-logo {
    display: flex;
    justify-content: space-between; /* ดันซ้าย-กลาง-ขวาแยก */
    align-items: center;
    background-color: #19428A;
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
    padding: 15px 25px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

    .approve-logo img {
        height: 40px;
        width: auto;
    }

.user-area {
    display: flex;
    align-items: center;
    gap: 10px; /* เว้นระยะระหว่างชื่อกับปุ่ม */
}

.user-name {
    font-size: 1rem;
    font-weight: 300;
}

.btn-logout {
    font-size: 18px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s ease, color 0.2s ease;
}

    .btn-logout i {
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .btn-logout:hover {
        color: #ff4d4f; /* เปลี่ยนสีไอคอนและข้อความเวลาชี้ */
        transform: scale(1.1); /* ขยายปุ่มเล็กน้อย */
    }

        .btn-logout:hover i {
            transform: rotate(20deg) scale(1.2); /* หมุน + ขยายไอคอน */
        }


/* 📱 สำหรับมือถือ (จอเล็กกว่า 768px) */
@media (max-width: 768px) {
    .approve-logo {
        display: flex;
        flex-direction: column; /* โลโก้ + ชื่อเรียงแนวตั้ง */
        align-items: center; /* ชื่อ + โลโก้อยู่ตรงกลาง */
        font-size: 1.2rem;
        padding: 10px 15px;
        position: relative; /* เพื่อให้ user-area position absolute */
    }

        .approve-logo img {
            height: 30px;
            margin: 10px 0;
        }

    .user-name {
        font-size: 12px;
        margin-top: 5px;
        display: none;
    }

    /* ปุ่ม Logout อยู่มุมขวาสุด แต่ชื่อยังอยู่ตรงกลาง */
    .user-area {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-direction: column;
    }

    .btn-logout {
        font-size: 18px;
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
    }
}


main {
    flex: 1;
    display: flex;
    justify-content: flex-start; /* ชิดซ้าย */
    align-items: flex-start;
    padding: 15px 10px;
    width: 100%; /* เพิ่มให้เต็ม container */
}

.approve-page .content-card {
    /* style ปกติของ content-card */
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
}

.content-card table {
    width: 100%;
    border-collapse: collapse;
}

/* Container ของ filter */
.filter-container {
    display: flex;
    flex-wrap: wrap; /* ถ้าหน้าจอเล็ก input/select จะลงบรรทัดใหม่ */
    gap: 10px; /* เว้นระยะระหว่าง input/select */
    margin-bottom: 20px; /* เว้นระยะจาก content ด้านล่าง */
    justify-content: center; /* จัดกึ่งกลางแนวนอน */
    align-items: center; /* จัดกึ่งกลางแนวตั้ง */
}

/* ช่องค้นหา */
#searchInput {
    flex: 1 1 200px; /* ขยายตามพื้นที่ ใช้ min-width 200px */
    max-width: 400px; /* กำหนดขนาดสูงสุด */
    padding: 10px 15px;
    height: 45px; /* กำหนดความสูงเท่ากับ select */
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    #searchInput:focus {
        border-color: #66b3ff;
        box-shadow: 0 0 5px rgba(102, 179, 255, 0.5);
    }

/* Select ฟิลเตอร์ */
.filter-container select {
    flex: 1 1 150px; /* ขยายตามพื้นที่ ใช้ min-width */
    max-width: 250px; /* กำหนดขนาดสูงสุด */
    padding: 10px 15px;
    height: 45px; /* ความสูงเท่ากับ input */
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    background-color: #f0f8ff; /* ฟ้าอ่อนพาสเทล */
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .filter-container select:focus {
        border-color: #66b3ff;
        box-shadow: 0 0 5px rgba(102, 179, 255, 0.5);
    }

/* Container ของตาราง */
.table-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
}

    /* ตารางเต็ม container */
    .table-container table {
        font-size: 0.9rem;
        width: 100%; /* เต็มความกว้าง container */
        background-color: #ffffff;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border-radius: 10px;
        overflow: hidden;
        font-family: 'Prompt', sans-serif;
    }


    /* Header */
    .table-container th {
        background-color: #19428A; /* พาสเทลฟ้า */
        color: white;
        font-weight: 100;
        padding: 12px;
        text-align: center;
        letter-spacing: 1px;
    }


    /* Cell */
    .table-container td {
        padding: 10px;
        text-align: center;
        border-bottom: 1px solid #e0e0e0;
        color: #333;
    }

    /* Row สลับสี */
    .table-container tbody tr:nth-child(even) {
        background-color: #f0f8ff;
    }

    /* Hover highlight */
    .table-container tbody tr:hover {
        background-color: #cce6ff;
    }

/* ป้าย status */
td.status {
    align-items: center;
    justify-content: center; /* เนื้อหาอยู่ตรงกลาง */
    gap: 6px;
    padding: 6px 16px; /* padding ปรับตามต้องการ */
    height: 60px; /* ความสูงของ row */
    border-radius: 20px;
    font-weight: 300;
    font-size: 0.95rem;
    color: white;
    background: linear-gradient(145deg, #48699F, #5A7ECF);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
    box-sizing: border-box; /* กัน padding ทำให้ overflow */
}

/* ไอคอนผ่าน pseudo-element */
.status.pending::before {
    content: "⏳";
    margin-right: 6px;
    font-size: 1.1rem;
}

.status.approved::before {
    content: "✅";
    margin-right: 6px;
    font-size: 1.1rem;
}

.status.rejected::before {
    content: "❌";
    margin-right: 6px;
    font-size: 1.1rem;
}

button {
    border: none;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.8rem;
    margin: 0.4px;
    user-select: none;
    touch-action: manipulation;
}

button.approve,
button.reject,
button.flow,
button.PDF {
    border: none;
    padding: 10px 20px; /* ลดความสูงและความกว้าง */
    font-weight: 500;
    border-radius: 20px; /* มุมมนพอดี */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* ลดเงาเล็กน้อย */
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.8rem; /* ลดขนาดฟอนต์ */
    margin: 0.4px; /* ลดช่องว่างระหว่างปุ่ม */
    user-select: none;
    touch-action: manipulation;
}

button.approve {
    background: #00C2D6;
    color: white;
}

    button.approve:hover {
        background: #5fa75f;
        box-shadow: 0 5px 15px rgba(127,201,127,0.4);
    }

button.reject {
    background: #FF4F03;
    color: white;
}

    button.reject:hover {
        background: #e66f7f;
        box-shadow: 0 5px 15px rgba(255,143,163,0.4);
    }

button.flow {
    background: #A3B2D1;
    color: white;
}

    button.flow:hover {
        background: #7ea7ff;
        box-shadow: 0 5px 15px rgba(160,196,255,0.4);
    }

button.PDF {
    background: #48699F;
    color: white;
}

    button.PDF:hover {
        background: #9f95ff;
        box-shadow: 0 5px 15px rgba(189,178,255,0.4);
    }


/* Desktop */
.desktop-table {
    display: table; /* แสดงตาราง */
}

.mobile-cards {
    display: none; /* ซ่อนการ์ด */
}

/* Responsive มือถือ */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column; /* stack ลงแนวตั้ง */
        align-items: stretch; /* ให้เต็มความกว้าง */
    }

        #searchInput, .filter-container select {
            width: 100%;
        }

    .desktop-table {
        display: none; /* ซ่อน table บนมือถือ */
    }

    main {
        padding: 5px;
    }

    .content-card {
        padding: 8px;
        margin-bottom: 8px;
    }

    .table-container {
        padding: 0;
        overflow-x: auto;
    }

        .table-container table {
            font-size: 0.85rem;
            min-width: 600px;
        }

        .table-container th, .table-container td {
            padding: 6px;
        }

    #searchInput, .filter-container select {
        width: 100%;
        max-width: none;
        flex: none;
    }

    button.approve,
    button.reject {
        display: inline-block;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-card {
        background: #fff;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

        .mobile-card p {
            margin: 5px 0;
            font-size: 0.9rem;
        }

        .mobile-card .status {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 5px;
            font-weight: 600;
        }

        .mobile-card .actions {
            margin-top: 10px;
            display: flex;
            flex-wrap: wrap; /* ให้ปุ่มขึ้นบรรทัดใหม่เมื่อเต็ม */
            gap: 5px; /* ช่องว่างระหว่างปุ่ม */
            justify-content: flex-start; /* เริ่มจากซ้าย */
        }

            .mobile-card .actions button {
                min-width: 150px; /* ปรับขั้นต่ำปุ่มไม่เล็กเกินไป */
                max-width: 200px; /* ปรับสูงสุดปุ่มไม่ใหญ่เกินไป */
            }

        .mobile-card p {
            display: flex;
            justify-content: space-between;
            gap: 4px; /* เว้นช่องเล็กน้อย */
            text-align: right;
        }

            .mobile-card p strong {
                margin-right: 10px;
                flex: 0 0 auto; /* label ไม่ขยาย */
                max-width: 40%; /* กัน label กินพื้นที่เกิน */
            }

            .mobile-card p span {
                flex: 1 1 auto; /* value ยืดได้ */
                min-width: 50%; /* ให้เหลือพื้นที่แสดง */
                word-break: break-word; /* ตัดคำเวลายาว */
                white-space: normal; /* ให้ขึ้นบรรทัดใหม่ได้ */
            }
}

body {
    font-family: Arial, sans-serif;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#pagination {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    min-width: 38px;
    text-align: center;
}

    .page-btn:hover:not(:disabled) {
        background: #eff6ff;
        border-color: #93c5fd;
        color: #1d4ed8;
    }

    .page-btn.active {
        background: #2563eb;
        border-color: #2563eb;
        color: #fff;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    }

    .page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        background: #f8fafc;
    }

.page-dots {
    padding: 4px 2px;
    color: #94a3b8;
    font-size: 14px;
    user-select: none;
    display: flex;
    align-items: center;
}

@media screen and (max-width: 640px) {
    #pagination {
        gap: 3px;
    }

    .page-btn {
        padding: 6px 0;
        min-width: 32px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* ============================================
   WORKFLOW MODAL — World-class Design System
   ============================================ */

/* --- Modal overlay --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'Prompt', sans-serif;
    box-sizing: border-box;
    /* จัดกลางจอ */
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.modal .close {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #64748b;
    font-size: 0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: all 0.15s ease;
    z-index: 1;
}
.modal .close::before { content: "\00d7"; font-size: 22px; line-height: 1; }
.modal .close:hover { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; }

/* --- Modal content --- */
.modal-content {
    position: relative;
    background: #ffffff;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
}

/* --- Info header --- */
.modal-content .info-lines {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 28px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.modal-content .info-lines .info-line {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.modal-content .info-lines .info-line::before {
    display: none;
}

.modal-content .info-lines .info-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Container for workflow content */
#historyContainer {
    padding: 24px 28px 28px;
}

/* --- Version / Section --- */
.wf-section {
    margin-bottom: 32px;
}
.wf-section:last-child { margin-bottom: 0; }

.wf-section-header {
    margin-bottom: 20px;
}

.wf-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.wf-section-label {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.wf-section-id {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    font-family: 'SF Mono', 'Fira Code', monospace;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.wf-section-id.visible {
    max-width: 400px;
    opacity: 1;
}

.wf-section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    transition: all 0.2s ease;
}
.wf-section-toggle:hover { background: #f1f5f9; color: #475569; }
.wf-section-toggle svg { transition: transform 0.2s ease; }
.wf-section-toggle.open svg { transform: rotate(180deg); }

/* --- Timeline --- */
.wf-timeline {
    position: relative;
}

/* --- Node (each step) --- */
.wf-node {
    display: flex;
    gap: 20px;
    position: relative;
}

/* Rail: dot + connector */
.wf-node-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.wf-node-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Dot colors by status */
.wf-dot--approved    { background: #10b981; }
.wf-dot--rejected    { background: #ef4444; }
.wf-dot--pending     { background: #f59e0b; }
.wf-dot--delegated   { background: #3b82f6; }
.wf-dot--created     { background: #6366f1; }
.wf-dot--warning     { background: #f59e0b; }
.wf-dot--escalated   { background: #8b5cf6; }
.wf-dot--changed     { background: #14b8a6; }
.wf-dot--resubmitted { background: #6366f1; }
.wf-dot--returned    { background: #ef4444; }

.wf-node-connector {
    width: 2px;
    flex: 1;
    background: #e2e8f0;
    min-height: 16px;
}

/* Content */
.wf-node-content {
    flex: 1;
    padding-bottom: 24px;
    min-width: 0;
}

.wf-node--last .wf-node-content {
    padding-bottom: 0;
}

.wf-node-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    padding-top: 6px;
}

.wf-node-step {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.wf-node-step--returned {
    color: #dc2626;
}

.wf-node-seq {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* --- Person cards --- */
.wf-node-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wf-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.wf-person:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Person icon */
.wf-person-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wf-icon--approved    { background: #ecfdf5; color: #10b981; }
.wf-icon--rejected    { background: #fef2f2; color: #ef4444; }
.wf-icon--pending     { background: #fffbeb; color: #f59e0b; }
.wf-icon--delegated   { background: #eff6ff; color: #3b82f6; }
.wf-icon--created     { background: #eef2ff; color: #6366f1; }
.wf-icon--warning     { background: #fffbeb; color: #f59e0b; }
.wf-icon--escalated   { background: #f5f3ff; color: #8b5cf6; }
.wf-icon--changed     { background: #f0fdfa; color: #14b8a6; }
.wf-icon--resubmitted { background: #eef2ff; color: #6366f1; }
.wf-icon--returned    { background: #fef2f2; color: #ef4444; }

/* Person info */
.wf-person-info {
    flex: 1;
    min-width: 0;
}

.wf-person-name {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.3;
}

.wf-person-role {
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.3;
}

.wf-person-date {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.3;
}

/* Person status badge */
.wf-person-status {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.wf-status--approved    { background: #ecfdf5; color: #059669; }
.wf-status--rejected    { background: #fef2f2; color: #dc2626; }
.wf-status--pending     { background: #fffbeb; color: #d97706; }
.wf-status--delegated   { background: #eff6ff; color: #2563eb; }
.wf-status--created     { background: #eef2ff; color: #4f46e5; }
.wf-status--warning     { background: #fffbeb; color: #d97706; }
.wf-status--escalated   { background: #f5f3ff; color: #7c3aed; }
.wf-status--changed     { background: #f0fdfa; color: #0d9488; }
.wf-status--resubmitted { background: #eef2ff; color: #4f46e5; }
.wf-status--returned    { background: #fef2f2; color: #dc2626; }

/* --- Responsive --- */
@media screen and (max-width: 640px) {
    .modal { padding: 8px; }

    .modal-content {
        border-radius: 10px;
        max-height: 96vh;
    }

    .modal-content .info-lines {
        padding: 14px 16px;
        gap: 12px;
        flex-direction: column;
    }

    #historyContainer { padding: 16px; }

    .wf-node { gap: 14px; }

    .wf-node-rail { width: 30px; }

    .wf-node-dot {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .wf-person {
        padding: 10px 12px;
        gap: 10px;
    }

    .wf-person-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .wf-person-name { font-size: 13px; }
    .wf-person-status { font-size: 11px; padding: 3px 8px; }

    .wf-node-step { font-size: 13px; }

    .modal .close { top: 10px; right: 10px; }
}

/*file modal*/
.file-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px; /* ให้มือถือมี margin รอบ ๆ */
    box-sizing: border-box;
}

    .file-modal .close {
        position: absolute;
        top: 1px;
        right: 10px;
        font-size: 30px;
        font-weight: bold;
        cursor: pointer;
        color: #888;
    }

        .file-modal .close:hover {
            color: #000;
        }

/* Modal content */
.modal-content-file {
    position: relative; /* สำคัญสำหรับ close button */
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 700px;
    max-height: max-content;
    /*overflow-y: auto;*/
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    /* Title */
    .modal-content-file h4 {
        margin: 0 0 20px 0;
        text-align: center;
        color: #19428A; /* สีตามต้องการ */
    }

    /* สำหรับไฟล์ report แค่ขีดรอบ ๆ */
    .modal-content-file.report-file {
        border: 1px dashed #ff9800; /* ขีดเส้นประสีส้ม */
        padding: 18px; /* ลด padding เล็กน้อยให้เส้นไม่ติดขอบ */
        border-radius: 10px; /* ถ้าต้องการให้มุมโค้งเหมือนปกติ */
    }

/* Container ไฟล์เป็น grid */
.files-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    width: 100%;
    justify-items: center;
}

/* ไอคอน + ชื่อไฟล์ */
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    word-break: break-word; /* ข้อความยาวตัดบรรทัด */
    font-size: 12px;
}

    /* ไอคอนไฟล์ */
    .file-item img {
        width: 50px;
        height: 50px;
        margin-bottom: 5px;
    }

    /* hover effect */
    .file-item:hover {
        transform: scale(1.05);
        transition: transform 0.2s;
    }


/* สำหนับ summary ตอนนี้ปิดใช้งาน */
#summary {
    margin: 10px 0;
    font-weight: bold;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

    #summary .summary-box {
        flex: 1 1 150px;
        padding: 15px;
        border-radius: 8px;
        background: #fff;
        text-align: center;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        font-size: 16px;
        font-weight: 150;
    }

    #summary.hidden {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
    }

.summary-approved {
    border-left: 5px solid #00C2D6;
    color: #19428A;
}

.summary-rejected {
    border-left: 5px solid #FF4F03;
    color: #19428A;
}

.summary-pending {
    border-left: 5px solid #A3B2D1;
    color: #19428A;
}

@media (max-width: 600px) {
    .mobile-toggle {
        display: block;
        z-index: 100;
        position: relative;
        margin: 10px auto;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 6px;
        border: none;
        background: #48699F;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    #summary {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
        transition: all 0.4s ease;
        width: 100%;
        margin: 0 auto;
    }

        #summary.visible {
            max-height: 500px;
            opacity: 1;
            pointer-events: auto;
        }

        #summary .summary-box {
            flex: 1 1 40px;
            width: 100%;
            margin-bottom: 8px;
            padding: 8px 12px;
            font-size: 14px;
            line-height: 1.2;
        }
}

@media (min-width: 601px) {
    .mobile-toggle {
        display: none;
    }
}
