/* ===== ฟอนต์หลักของทั้งเว็บ: Google Sans (มีชุดอักษรไทยครบ) ===== */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&display=swap");

/* สำรองไว้ใช้ตอนเน็ตล่ม/เข้าไม่ถึง Google Fonts — อ่านจากไฟล์ในเครื่อง */
@font-face {
    font-family: "TH SarabunPSK Web";
    src: url("fonts-for-this-doc/THSarabunPSK.ttf") format("truetype");
    /* ฟอนต์นี้มีแค่ 2 น้ำหนักจริง จึงกระจายช่วงให้ครอบคลุมค่าที่ CSS เรียกใช้ */
    font-weight: 100 400;
    font-style: normal;
    font-display: swap;
    /* TH SarabunPSK มี x-height เล็กกว่าฟอนต์ทั่วไปมาก จึงขยาย glyph ให้ขนาดใกล้เคียง
       Google Sans เวลาตกมาใช้ตัวสำรอง — ค่านี้มีผลกับ Sarabun เท่านั้น */
    size-adjust: 130%;
}

@font-face {
    font-family: "TH SarabunPSK Web";
    src: url("fonts-for-this-doc/THSarabunPSK-Bold.ttf") format("truetype");
    /* คลุม 500 ขึ้นไป ไม่งั้น font-weight: 500 จะถูกปัดลงไปใช้ตัวปกติ */
    font-weight: 500 900;
    font-style: normal;
    font-display: swap;
    size-adjust: 130%;
}

:root {
    --app-font: "Google Sans", "TH SarabunPSK Web", "Sarabun", "Leelawadee UI", Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

/* Anchor links (#faq, #contact, ...) must clear the sticky topbar */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--app-font);
    background: radial-gradient(circle at top left, rgba(17, 98, 214, 0.12), transparent 30%),
        linear-gradient(180deg, #f3f6fb 0%, #eef2f8 55%, #ffffff 100%);
    color: #172033;
}

/* form controls ไม่สืบทอดฟอนต์จาก body โดยปริยาย ต้องบังคับให้ใช้ฟอนต์เดียวกัน */
input,
button,
select,
textarea,
optgroup {
    font-family: inherit;
}

.app-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.topbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 45px rgba(21, 49, 98, 0.12);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 14px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: block;
    object-fit: contain;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 12px;
    color: #5f6f8b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.topnav {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    min-width: 0;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.topnav::-webkit-scrollbar {
    display: none;
}

.topnav-link {
    text-decoration: none;
    color: #4b5d78;
    background: #f6f8ff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.topnav-link.active,
.topnav-link:hover {
    background: #1f67e0;
    color: #ffffff;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #1f67e0 0%, #0a3a8d 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(31, 103, 224, 0.16);
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: #1f67e0;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #174eb2;
    transform: translateY(-1px);
}

/* Login Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.48);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    padding: 22px;
    border-radius: 28px;
    box-shadow: 0 34px 80px rgba(15, 23, 42, 0.18);
    max-width: 560px;
    width: min(94%, 560px);
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.25s ease;
    display: flex;
    flex-direction: column;
}

.detail-modal-content {
    padding: 22px;
}

.detail-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    border-bottom: 1px solid #eef2ff;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.detail-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6c63ff 0%, #3f7cff 100%);
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 18px 36px rgba(63, 114, 255, 0.2);
}

.detail-summary {
    flex: 1;
    display: grid;
    gap: 10px;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.detail-report-number {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.detail-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.14);
    font-size: 12px;
    font-weight: 700;
}

.detail-info-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 6px;
    align-items: center;
    color: #475569;
    font-size: 14px;
}

.detail-info-row .detail-label {
    justify-self: end;
    color: #66738f;
    font-weight: 600;
    white-space: nowrap;
}

/* ป้ายระดับความสำคัญ: ปกติ=เขียว ด่วน=ส้ม เร่งด่วน=แดง */
.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.priority-badge.priority-low {
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
}

.priority-badge.priority-medium {
    color: #c2410c;
    background: rgba(249, 115, 22, 0.16);
}

.priority-badge.priority-high {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
}

.status-filter-card,
.stat-card.status-filter-card,
.status-filter-card * {
    cursor: pointer !important;
}

.status-filter-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.status-filter-card:hover {
    transform: translateY(-2px);
}

.status-filter-card.active {
    box-shadow: 0 18px 40px rgba(31, 103, 224, 0.18);
    border-color: #1f67e0;
}
/* ระยะห่างระหว่างแถวรายละเอียด ให้ตรงกับ modal แจ้งเตือน (#notificationDetailModal) */
.detail-grid {
    display: grid;
    gap: 10px;
}

.detail-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    gap: 10px;
    align-items: start;
}

.detail-row.full-width {
    grid-template-columns: 1fr;
}

/* หมายเหตุ: กฎสำหรับจอมือถือของ modal รายละเอียดอยู่ท้ายไฟล์
   (ดู "Repair detail modal — mobile") เพราะกฎพื้นฐานของ .status-stepper
   ถูกประกาศไว้ด้านล่างบล็อกนี้ ถ้าวาง @media ไว้ตรงนี้จะโดน override */

.detail-label {
    color: #66738f;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.detail-row span {
    color: #111827;
    line-height: 1.6;
}

.detail-row.full-width p {
    margin: 6px 0 0;
    color: #334155;
    line-height: 1.75;
}

.status-stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 18px;
}

.status-stepper .step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
    padding: 0 4px;
}

.status-stepper .step .track {
    position: absolute;
    top: 11px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #d8deec;
    z-index: 0;
}

.status-stepper .step:first-child .track {
    display: none;
}

.status-stepper .step.is-done .track,
.status-stepper .step.is-current .track {
    background: #22c55e;
}

.status-stepper .node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    background: #f4f6fb;
    border: 2px solid #d8deec;
    color: #97a1b8;
    font-size: 12px;
    font-weight: 700;
}

.status-stepper .step.is-done .node {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

.status-stepper .step.is-current .node {
    background: #eef3ff;
    border-color: #3f7cff;
    color: #3f7cff;
    box-shadow: 0 0 0 4px #eef3ff;
}

.status-stepper .step .label {
    font-size: 12.5px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.status-stepper .step.is-pending .label {
    color: #66738f;
    font-weight: 600;
}

.status-stepper .step .stamp {
    font-size: 11px;
    color: #66738f;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    min-height: 15px;
}

.status-stepper.is-rejected {
    opacity: 0.55;
}

.reject-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fdecec;
    border: 1px solid rgba(220, 38, 38, 0.25);
    margin-bottom: 18px;
}

.reject-banner .mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc2626;
    color: #ffffff;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 13px;
    font-weight: 800;
}

.reject-banner .txt {
    display: grid;
    gap: 2px;
}

.reject-banner .txt .t1 {
    font-size: 13.5px;
    font-weight: 700;
    color: #dc2626;
}

.reject-banner .txt .t2 {
    font-size: 12px;
    color: #66738f;
    font-variant-numeric: tabular-nums;
}

/* เหตุผลที่ผู้ดูแลระบุตอนกดปฏิเสธ — ผู้แจ้งต้องอ่านออกง่ายที่สุดในกล่องนี้ */
.reject-banner .txt .t3 {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #7f1d1d;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.reject-banner .txt .t3 .reason-label {
    font-weight: 700;
}

/* ── กล่องกรอกเหตุผลปฏิเสธ (SweetAlert) ── */
.reject-reason-box {
    text-align: left;
}

.reject-reason-hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #64748b;
}

.reject-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.reject-reason-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.reject-reason-chip:hover {
    border-color: #f87171;
    background: #fef2f2;
    color: #b91c1c;
}

.reject-reason-chip.is-active {
    border-color: #dc2626;
    background: #fdecec;
    color: #b91c1c;
}

.reject-reason-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

.reject-reason-input:focus {
    border-color: #dc2626;
    background: #fffafa;
}

.reject-reason-counter {
    margin-top: 4px;
    font-size: 11.5px;
    color: #94a3b8;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.detail-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 260px;
    border-radius: 20px;
    display: block;
    object-fit: contain;
    margin-top: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.detail-placeholder {
    width: 100%;
    min-height: 200px;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    margin-top: 10px;
}


.date-relative {
    display: block;
    font-weight: 600;
}

.date-absolute {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 400;
}

.detail-image-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-image-col {
    flex: 1 1 200px;
    min-width: 160px;
}

.detail-image-col .detail-image,
.detail-image-col .detail-placeholder {
    margin-top: 0;
    height: 220px;
    min-height: 220px;
}

.detail-image-col .detail-image {
    width: 100%;
    object-fit: contain;
    background: #f8fafc;
}

.detail-image-caption {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #66738f;
}

@media (max-width: 480px) {
    .detail-image-grid {
        flex-direction: column;
    }
}

.detail-placeholder-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.detail-placeholder-icon svg {
    width: 72px;
    height: 72px;
}

.detail-placeholder-label {
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.detail-modal-content {
    overflow-y: auto;
}

.detail-modal-content::-webkit-scrollbar {
    width: 8px;
}

.detail-modal-content::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.25);
    border-radius: 999px;
}

.detail-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.detail-image {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    margin-top: 12px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 18px;
    top: 18px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #8892a8;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #172033;
}

.modal-content h2 {
    margin: 0 0 24px;
    font-size: 24px;
    color: #172033;
    text-align: center;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.25);
    border-radius: 999px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form .form-group {
    display: grid;
    gap: 8px;
}

.login-form label {
    font-size: 14px;
    color: #4b5d78;
    font-weight: 600;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    border: 1px solid #d8e0f1;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #172033;
    background: #f8fbff;
    outline: none;
    transition: border-color 0.2s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
    border-color: #1f67e0;
    background: #ffffff;
}

.login-form .checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-form .checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.login-form small {
    display: block;
    font-size: 12px;
    color: #8892a8;
    margin-top: 6px;
    margin-bottom: 8px;
}

.forgot-password {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #1f67e0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #0a3a8d;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.hero-copy {
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 36px;
    box-shadow: 0 20px 45px rgba(21, 49, 98, 0.1);
}

.eyebrow {
    margin: 0 0 14px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1f67e0;
}

.hero-copy h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #131a2c;
}

.hero-text {
    margin: 18px 0 24px;
    color: #566075;
    font-size: 16px;
    line-height: 1.8;
    max-width: 610px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    cursor: pointer;
    border: none;
    border-radius: 14px;
    padding: 13px 20px;
    font-family: inherit;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #1f67e0;
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(31, 103, 224, 0.16);
}

.btn-secondary {
    background: #f6f8ff;
    color: #1f67e0;
}

.hero-summary {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: stretch;
}

.stat-card {
    border-radius: 24px;
    padding: 24px 22px;
    display: grid;
    gap: 10px;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(21, 49, 98, 0.08);
}

.stat-label {
    font-size: 14px;
    color: #64748b;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    color: #111827;
}

.stat-card.primary {
    border-left: 4px solid #1f67e0;
}

.stat-card.accent {
    border-left: 4px solid #0a8fde;
}

.stat-card.success {
    border-left: 4px solid #16a34a;
}

.stat-card.info {
    border-left: 4px solid #6366f1;
}

.stat-card.active {
    background-color: #007bff;
    color: white;
}

.stat-card.active .stat-label,
.stat-card.active .stat-value {
    color: white;
}

.show-all {
    cursor: pointer;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

.report-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 32px;
}

.form-card,
.sticky-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
}

.form-card {
    padding: 32px;
}

.sticky-card {
    padding: 28px;
}

.report-form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 10px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    color: #4b5d78;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d8e0f1;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    color: #172033;
    background: #f8fbff;
    outline: none;
}

.form-group select:disabled {
    color: #1a1a1a;
    background: #f0f4ff;
    opacity: 1;
    cursor: not-allowed;
}

.form-group input[type="file"] {
    padding: 12px 14px;
    background: #ffffff;
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.char-counter {
    justify-self: end;
    margin-top: -6px;
    font-size: 13px;
    color: #7c8aa5;
    font-variant-numeric: tabular-nums;
}

.char-counter.is-near-limit {
    color: #b26a00;
}

.char-counter.is-at-limit {
    color: #c0392b;
    font-weight: 600;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid #d8e0f1;
    border-radius: 16px;
    background: #f8fbff;
    cursor: pointer;
    font-size: 14px;
    color: #172033;
    white-space: nowrap;
    word-break: keep-all;
    line-break: strict;
    overflow-wrap: normal;
    min-width: max-content;
    flex-wrap: nowrap;
}

.radio-label-text {
    white-space: nowrap;
}

.radio-label input {
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: none;
    flex-shrink: 0;
    accent-color: #1f67e0;
}

.info-note {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #eef4ff;
    color: #1f4672;
    border: 1px solid #d8e4ff;
    font-size: 14px;
}

.file-group input {
    padding: 12px 14px;
}

.form-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.steps-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 10px;
    color: #4f5c74;
}

.steps-list li {
    list-style-type: disc;
}

.contact-box {
    margin-top: 24px;
    padding: 22px;
    border-radius: 20px;
    background: #f4f7ff;
    color: #1f3d7a;
    display: grid;
    gap: 8px;
}

.sticky-card {
    position: sticky;
    top: 24px;
}



.info-title {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.info-value {
    font-size: 34px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}

.info-note {
    color: #58607d;
    font-size: 14px;
    line-height: 1.7;
}

.table-panel {
    background: #ffffff;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(21, 49, 98, 0.1);
}

.table-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.section-label {
    margin: 0 0 10px;
    font-size: 13px;
    color: #1f67e0;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.table-panel-header h2 {
    margin: 0;
    font-size: 26px;
    color: #111827;
}

.section-text {
    margin: 12px 0 0;
    color: #5b677f;
    font-size: 15px;
    line-height: 1.8;
    max-width: 560px;
}

.table-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6f8ff;
    border-radius: 16px;
    padding: 12px 16px;
    min-width: 320px;
}

.search-box span {
    font-size: 16px;
    color: #1f67e0;
}

.search-box input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    color: #172033;
    font-size: 15px;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f6f8ff;
    border-radius: 16px;
    flex-wrap: wrap;
}

.table-controls button {
    white-space: nowrap;
}

.btn.btn-info {
    background: #06b6d4;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn.btn-info:hover:not(:disabled) {
    background: #0891b2;
}

.btn.btn-info:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.table-wrapper {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* Scroll-shadow hint: fades in only on the side that still has
       hidden content, so phone users know the table can be scrolled
       even though the scrollbar itself is hidden below. */
    background:
        linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to right, rgba(255, 255, 255, 0), #fff 70%) 100% 0,
        linear-gradient(to right, rgba(20, 40, 80, 0.16), rgba(255, 255, 255, 0)),
        linear-gradient(to left, rgba(20, 40, 80, 0.16), rgba(255, 255, 255, 0)) 100% 0;
    background-repeat: no-repeat;
    background-color: #fff;
    background-size: 24px 100%, 24px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
}

.table-wrapper::-webkit-scrollbar {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
}

.table-wrapper table th,
.table-wrapper table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.table-wrapper table td.assigned-cell {
    text-align: center !important;
    vertical-align: middle !important;
}

th,
td {
    padding: 18px 20px;
}

thead {
    background: #f9fbff;
}

th {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #66738f;
}

tbody tr {
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f4f7ff;
}

td {
    color: #374557;
    font-size: 14px;
}

.detail-btn {
    border: 1px solid #dbe4fb;
    border-radius: 999px;
    padding: 10px 16px;
    background: #ffffff;
    color: #1f67e0;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.detail-btn:hover {
    background: #f6f8ff;
}

/* Checkbox styles */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1f67e0;
    cursor: pointer;
    vertical-align: middle;
}

.report-checkbox {
    cursor: pointer;
}

th input[type="checkbox"],
td input[type="checkbox"] {
    margin: 0;
}

.status {
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
}

.status.pending {
    background: rgba(245, 174, 66, 0.14);
    color: #c56c0a;
}

.status.in-progress {
    background: rgba(59, 130, 246, 0.12);
    color: #234fcc;
}

.report-image-wrapper {
    margin-top: 18px;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
    max-width: 120px;
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
}

.report-image {
    display: block;
    width: 120px !important;
    max-width: 120px !important;
    height: auto !important;
    max-height: 120px !important;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #d8e0f1;
    box-shadow: 0 18px 40px rgba(21, 49, 98, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-image:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 48px rgba(21, 49, 98, 0.12);
}

@media (max-width: 760px) {
    .report-image-wrapper {
        max-width: 120px;
        width: auto;
    }
    .report-image {
        width: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }
}

.image-modal-content {
    max-width: 90vw;
    width: min(96%, 720px);
    max-height: 90vh;
    padding: 16px;
}

.image-modal-content img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.image-modal-close:hover {
    transform: scale(1.05);
}

.status.accept {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.status.done {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.status.cancelled {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.pagination {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination button {
    border: 1px solid #d7dfee;
    background: #ffffff;
    color: #1b2a42;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background: #f6f8ff;
}

.pagination button.active {
    background: #1f67e0;
    color: #ffffff;
    border-color: transparent;
}

@media (max-width: 1120px) {
    .hero-panel,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 810px) {
    .topnav {
        overflow-x: auto;
    }

    .search-box {
        min-width: 100%;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 18px 20px;
    }

    .hero-actions,
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .search-box {
        width: 100%;
    }
}

/* Statistics Page Styles */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card-full {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
}

.stat-card-full h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #172033;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 16px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
    color: #172033;
}

.all-types-panel {
    background: #ffffff;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
    margin-top: 20px;
}

.all-types-panel.hidden {
    display: none;
}

.btn-see-more {
    min-width: auto;
}

.stat-detail {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
}

.stat-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-detail-header h4 {
    margin: 0;
    font-size: 16px;
    color: #172033;
}

.badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge.primary {
    background: rgba(31, 103, 224, 0.14);
    color: #1f67e0;
}

.badge.accent {
    background: rgba(10, 143, 222, 0.14);
    color: #0a8fde;
}

.badge.success {
    background: rgba(22, 163, 74, 0.14);
    color: #16a34a;
}

.stat-detail-content {
    display: grid;
    gap: 16px;
}

.progress-item {
    display: grid;
    gap: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4b5d78;
    font-weight: 600;
}

.percentage {
    color: #1f67e0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #f0f4ff;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-fill.success {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.progress-fill.accent {
    background: linear-gradient(90deg, #0a8fde, #3b82f6);
}

.progress-fill.pending {
    background: linear-gradient(90deg, #f5ae42, #fbbf24);
}

.progress-fill.cancelled {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

@media (max-width: 1120px) {
    .statistics-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* Help Page Styles */
.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Full width hero for help page */
.help-page .report-hero {
    display: block;
}

.help-page .hero-copy {
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 36px;
    box-shadow: 0 20px 45px rgba(21, 49, 98, 0.1);
}

.help-page .hero-copy h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #131a2c;
}

.help-page .hero-text {
    margin: 18px 0 24px;
    color: #566075;
    font-size: 16px;
    line-height: 1.8;
}

.help-page .hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.help-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.help-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(21, 49, 98, 0.12);
}

.help-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.help-card h3 {
    margin: 12px 0 8px;
    font-size: 18px;
    color: #172033;
}

.help-card p {
    margin: 0 0 16px;
    color: #566075;
    font-size: 14px;
    line-height: 1.6;
}

.help-link {
    color: #1f67e0;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.help-link:hover {
    color: #0a3a8d;
}

.help-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 22px 50px rgba(21, 49, 98, 0.08);
}

.help-section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid #e5ebf3;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #172033;
}

.steps-container {
    display: grid;
    gap: 20px;
}

.step {
    display: flex;
    gap: 20px;
}

.step-number {
    min-width: 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f67e0, #0a3a8d);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #172033;
}

.step-content p {
    margin: 0;
    color: #566075;
    font-size: 14px;
}

.help-text {
    color: #566075;
    line-height: 1.8;
}

.help-text p {
    margin: 0 0 12px;
}

.help-text ol {
    margin: 12px 0;
    padding-left: 24px;
}

.help-text li {
    margin-bottom: 8px;
}

.faq-container {
    display: grid;
    gap: 12px;
}

.faq-item {
    background: #f9fbff;
    border-radius: 16px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 700;
    color: #172033;
    user-select: none;
    transition: background 0.2s ease;
}

.faq-item summary:hover {
    background: #f0f4ff;
}

.faq-item[open] summary {
    background: #f0f4ff;
}

.faq-answer {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e5ebf3;
    color: #566075;
    font-size: 14px;
    line-height: 1.7;
}

.faq-answer p {
    margin: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.contact-item {
    background: #f9fbff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.contact-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.contact-item h4 {
    margin: 8px 0;
    font-size: 16px;
    color: #172033;
}

.contact-item p {
    margin: 4px 0;
    color: #1f67e0;
    font-weight: 700;
}

.contact-item small {
    display: block;
    color: #566075;
    font-size: 12px;
    margin-top: 8px;
}

.tips-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tip-item {
    display: flex;
    gap: 16px;
    background: #f9fbff;
    border-radius: 16px;
    padding: 20px;
}

.tip-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.tip-item strong {
    color: #172033;
    margin-bottom: 4px;
}

.tip-item div {
    color: #566075;
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 1120px) {
    .help-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tips-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   RESPONSIVE LAYOUT ADDITIONS — Mobile & Tablet
   ================================================ */

/* Hamburger navigation button (hidden on desktop) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(31, 103, 224, 0.18);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    padding: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    background: #f6f8ff;
    border-color: rgba(31, 103, 224, 0.35);
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #4b5d78;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── Tablet (≤900px): form layouts ─── */
@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
        top: auto;
    }

    .report-hero {
        grid-template-columns: 1fr;
    }
}

/* ─── Mobile (≤768px) ─── */
@media (max-width: 768px) {
    /* Show hamburger */
    .nav-hamburger {
        display: flex;
    }

    /* Topbar becomes flex so nav wraps to next row */
    .topbar-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 16px;
        gap: 10px;
        max-width: 100%;
    }

    .brand {
        flex: 1;
        min-width: 0;
        gap: 10px;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        display: none;
    }

    /* Right side (profile + notification + hamburger) */
    .navbar-right {
        order: 2;
        gap: 8px;
    }

    /* Mobile nav — full-width row below header */
    .topnav {
        order: 3;
        width: 100%;
        overflow-x: visible !important;
        display: none !important;
        flex-direction: column;
        gap: 4px;
        padding: 10px 0 6px;
        border-top: 1px solid #eef2ff;
        margin-top: 2px;
    }

    .topnav.mobile-open {
        display: flex !important;
    }

    .topnav-link {
        border-radius: 12px;
        padding: 12px 16px;
        font-size: 13px;
        text-align: left;
        width: 100%;
        flex-shrink: 1;
        white-space: normal;
    }

    /* Content spacing */
    .app-shell {
        padding: 16px 14px 32px;
    }

    /* Hero */
    .hero-copy {
        padding: 24px 20px;
    }

    .hero-copy h1 {
        font-size: 26px;
        letter-spacing: -0.02em;
    }

    .hero-text {
        font-size: 14px;
        margin: 12px 0 16px;
    }

    /* Stat cards — 2 columns on tablet/mobile */
    .hero-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .stat-value {
        font-size: 26px;
    }

    /* Table panel */
    .table-panel {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .table-panel-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .table-panel-header h2 {
        font-size: 20px;
    }

    .section-text {
        font-size: 13px;
    }

    /* Table controls stack vertically */
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    /* Form cards */
    .form-card {
        padding: 20px 16px;
    }

    .sticky-card {
        padding: 20px 16px;
    }
}

/* ─── Small Mobile (≤480px) ─── */
@media (max-width: 480px) {
    .app-shell {
        padding: 12px 10px 24px;
    }

    /* Single column stat cards */
    .hero-summary {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding: 18px 14px;
    }

    .hero-copy h1 {
        font-size: 22px;
    }

    /* Form fields stack */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Table panel tighter */
    .table-panel {
        padding: 14px 12px;
        border-radius: 16px;
    }

    /* Contact grid single column */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 22px;
    }

    .pagination button {
        padding: 10px 13px;
        min-width: 40px;
        min-height: 40px;
        font-size: 13px;
    }
}

/* ─── Repair detail modal — mobile (≤640px) ───────────────────────────
   ต้องอยู่ท้ายไฟล์เพื่อให้ชนะ cascade: กฎพื้นฐานของ .status-stepper /
   .detail-row มี specificity เท่ากัน จึงตัดสินด้วยลำดับใน source */
@media (max-width: 640px) {
    .modal {
        padding: 12px;
    }

    .modal-content:not(.image-modal-content) {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        border-radius: 20px;
        padding: 18px 16px;
    }

    .detail-modal-content {
        padding: 18px 16px;
    }

    .modal-close {
        top: 8px;
        right: 8px;
        font-size: 26px;
        line-height: 1;
        padding: 4px 8px;
    }

    /* หัว modal */
    .detail-header {
        gap: 12px;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    .detail-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
        flex: none;
        box-shadow: 0 10px 20px rgba(63, 114, 255, 0.18);
    }

    .detail-summary {
        min-width: 0;
        gap: 8px;
    }

    .detail-meta-row {
        gap: 8px;
    }

    .detail-report-number {
        font-size: 13.5px;
        overflow-wrap: anywhere;
    }

    .detail-pill {
        padding: 5px 10px;
        font-size: 11px;
    }

    .detail-info-row {
        font-size: 13px;
        column-gap: 8px;
    }

    .detail-info-row .detail-label {
        justify-self: start;
    }

    /* Stepper: แนวนอน 4 คอลัมน์ล้นจอ -> เปลี่ยนเป็น timeline แนวตั้ง */
    .status-stepper {
        grid-template-columns: 1fr;
        margin-bottom: 14px;
    }

    .status-stepper .step {
        grid-template-columns: 24px minmax(0, 1fr);
        justify-items: start;
        align-items: start;
        text-align: left;
        column-gap: 12px;
        row-gap: 2px;
        padding: 0 0 14px;
    }

    .status-stepper .step:last-child {
        padding-bottom: 0;
    }

    .status-stepper .step .node {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .status-stepper .step .label {
        grid-column: 2;
        grid-row: 1;
    }

    .status-stepper .step .stamp {
        grid-column: 2;
        grid-row: 2;
        font-size: 11.5px;
    }

    /* เส้นเชื่อมกลายเป็นแนวตั้ง: ลากจากใต้ node ลงไปหา node ถัดไป */
    .status-stepper .step .track,
    .status-stepper .step:first-child .track {
        display: block;
        top: 26px;
        left: 11px;
        width: 2px;
        height: calc(100% - 26px);
    }

    .status-stepper .step:last-child .track {
        display: none;
    }

    .status-stepper .step.is-current .track {
        background: #d8deec;
    }

    /* รายละเอียด: ป้ายกำกับขึ้นบรรทัดของตัวเอง กันข้อความล้น */
    .detail-grid {
        display: grid;
        row-gap: 12px;
    }

    .detail-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .detail-row span {
        overflow-wrap: anywhere;
    }

    .detail-row.full-width p {
        margin-top: 2px;
    }

    .detail-image {
        max-height: 220px;
        border-radius: 14px;
    }
}

/* ── Modal ดาวน์โหลดรายงาน (ใช้ร่วมกัน: ประวัติการใช้งาน + สถิติ) ── */
.export-modal .modal-content { padding: 26px 28px 22px; }
.export-modal h2 { margin-bottom: 6px; font-size: 22px; }

.export-sub-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.export-sub { color: #64748b; font-size: 13px; margin: 0; }
.export-reset {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}
.export-reset:hover { color: #1d4ed8; }

.export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.export-grid .form-group { gap: 6px; min-width: 0; }
.export-grid .form-group label { font-size: 13px; }
.export-grid .form-group input,
.export-grid .form-group select {
    padding: 11px 13px;
    font-size: 14px;
    border-radius: 12px;
}
.export-full { grid-column: 1 / -1; }

.date-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.date-chip {
    border: 1px solid #d8e0f1;
    background: #f8fbff;
    color: #4b5d78;
    border-radius: 999px;
    padding: 7px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.date-chip:hover { border-color: #2563eb; color: #2563eb; }
.date-chip.active { background: #2563eb; border-color: #2563eb; color: #ffffff; }

.format-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}
.format-option {
    border: 1px solid #d8e0f1;
    background: #f8fbff;
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    cursor: pointer;
    text-align: left;
    display: grid;
    gap: 3px;
    transition: all 0.15s ease;
}
.format-option:hover { border-color: #2563eb; }
.format-option .format-name { font-size: 14px; font-weight: 700; color: #172033; }
.format-option .format-hint { font-size: 12px; color: #64748b; }
.format-option.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb inset;
}
.format-option.active .format-name { color: #1d4ed8; }

.export-status {
    margin: 18px 0 0;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #eff6ff;
    color: #1d4ed8;
}
.export-status.warn  { background: #fef3c7; color: #92400e; }
.export-status.error { background: #fee2e2; color: #b91c1c; }

.export-actions { display: flex; gap: 10px; margin-top: 14px; }
.export-actions .btn { flex: 1; text-align: center; }
.export-actions .btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 520px) {
    .export-modal .modal-content { padding: 22px 18px 18px; }
    .export-grid { grid-template-columns: minmax(0, 1fr); }
    .format-picker { grid-template-columns: minmax(0, 1fr); }
}


/* รายการหัวข้อที่จะใส่ในไฟล์ (หน้าสถิติ) */
.section-list {
    display: grid;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #d8e0f1;
    background: #f8fbff;
    border-radius: 12px;
    padding: 10px 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.section-item:hover { border-color: #2563eb; }

.section-item input { width: 17px; height: 17px; accent-color: #2563eb; cursor: pointer; }

.section-item .section-name { font-size: 14px; font-weight: 600; color: #172033; }

.section-item .section-count { margin-left: auto; font-size: 12px; color: #64748b; white-space: nowrap; }

.section-item:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
