/* ===================================================
   admin.css — สไตล์สำหรับระบบ Admin (admin.php, login.php)
   =================================================== */

:root {
    --hospital-orange: #fd873e;
    --hospital-orange-active: #fd873e;
    --btn-edit-yellow: #ffc643;
    --btn-delete-red: #df707b;
    --modal-btn-cancel-bg: #ffffff;
    --modal-btn-cancel-border: #6c757d;
    --modal-btn-cancel-text: #495057;
    --modal-btn-cancel-hover-bg: #f8f9fa;
}
body { font-family: sans-serif; }
.text-hospital { color: var(--hospital-orange) !important; }

/* แถบบาร์ส้มทึบหัวแท็บ */
.nav-tabs {
    background-color: var(--hospital-orange) !important;
    padding: 8px 8px 0 8px;
    border-radius: 8px 8px 0 0;
    border-bottom: none !important;
    display: flex;
    align-items: flex-end;
}

.nav-tabs .nav-link {
    color: #ffffff !important;
    font-weight: bold;
    font-size: 15px;
    border: none !important;
    padding: 10px 22px;
    margin-right: 6px;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-tabs .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.nav-tabs .icon-news { color: #ffffff !important; }
.nav-tabs .icon-events { color: #ffffff !important; }
.nav-tabs .icon-dept { color: #ffffff !important; }

.nav-tabs .nav-link.active {
    background-color: #ffffff !important;
    color: var(--hospital-orange) !important;
}
.nav-tabs .nav-link.active .icon-news,
.nav-tabs .nav-link.active .icon-events,
.nav-tabs .nav-link.active .icon-dept {
    color: var(--hospital-orange) !important;
}

.admin-form-container {
    background-color: #f8f9fa !important;
    padding: 16px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    margin-top: 16px;
    margin-bottom: 16px;
}

.admin-table-scroll {
    max-height: 62vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #ffffff;
}

.admin-table-scroll table {
    min-width: 980px;
}

.dept-content-scroll .dept-content-table {
    display: table !important;
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 900px;
    white-space: normal !important;
}

.admin-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.dept-content-table td,
.dept-content-table th {
    vertical-align: middle;
}

.dept-content-table td:nth-child(1) {
    width: 220px;
}

.dept-content-table td:nth-child(2) {
    width: 260px;
    white-space: normal;
    word-break: break-word;
}

.dept-content-file-cell {
    width: 460px;
    max-width: 460px;
    overflow: hidden;
}

.dept-content-section-badge {
    display: inline-block;
    width: auto;
    max-width: 220px;
    white-space: normal;
    line-height: 1.35;
    text-align: left;
    word-break: break-word;
}

.admin-file-link {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.admin-file-link a {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.btn-outline-edit-style {
    background-color: #fff !important;
    color: var(--btn-edit-yellow) !important;
    border: 1.5px solid var(--btn-edit-yellow) !important;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-outline-edit-style:hover {
    background-color: rgba(255, 179, 0, 0.15) !important;
    color: var(--btn-edit-yellow) !important;
    border: 1.5px solid var(--btn-edit-yellow) !important;
}

.btn-outline-delete-style {
    background-color: #fff !important;
    color: var(--btn-delete-red) !important;
    border: 1.5px solid var(--btn-delete-red) !important;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-outline-delete-style:hover {
    background-color: rgba(220, 53, 69, 0.12) !important;
    color: var(--btn-delete-red) !important;
    border: 1.5px solid var(--btn-delete-red) !important;
}

.btn-hospital-orange {
    background-color: var(--hospital-orange) !important;
    border-color: var(--hospital-orange) !important;
    color: white !important;
    font-weight: bold;
}
.btn-hospital-orange:hover {
    background-color: var(--hospital-orange-active) !important;
    border-color: var(--hospital-orange-active) !important;
}

.badge-orange-style {
    background-color: var(--hospital-orange);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
}
.form-check-input:checked {
    background-color: var(--hospital-orange) !important;
    border-color: var(--hospital-orange) !important;
}

.modal-footer .btn-secondary,
.modal-footer button[data-bs-dismiss="modal"] {
    background-color: var(--modal-btn-cancel-bg) !important;
    border: 1px solid var(--modal-btn-cancel-border) !important;
    color: var(--modal-btn-cancel-text) !important;
    font-weight: bold !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease;
}

.modal-footer .btn-secondary:hover,
.modal-footer button[data-bs-dismiss="modal"]:hover {
    background-color: var(--modal-btn-cancel-hover-bg) !important;
    color: #000000 !important;
}

.modal-footer .btn-hospital-orange {
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background-color: var(--hospital-orange) !important;
    border: 1px solid var(--hospital-orange) !important;
    color: #ffffff !important;
    font-weight: bold !important;
}
.modal-footer .btn-hospital-orange:hover {
    background-color: var(--hospital-orange-active) !important;
    border-color: var(--hospital-orange-active) !important;
}

/* dept-content-scroll (จาก admin.php) */
.dept-content-scroll {
    max-height: 520px;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}
.dept-content-scroll .dept-content-table {
    display: table !important;
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 900px;
    margin-bottom: 0 !important;
    white-space: normal !important;
}
.dept-content-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    box-shadow: inset 0 -1px 0 #dee2e6;
}
.dept-content-table th,
.dept-content-table td { white-space: normal !important; vertical-align: middle; }
.dept-content-table .col-section { width: 22%; }
.dept-content-table .col-title   { width: 25%; }
.dept-content-table .col-file    { width: 35%; }
.dept-content-table .col-order   { width: 7%;  }
.dept-content-table .col-action  { width: 11%; }

/* Banner preview thumbnail (จาก admin.php) */
.banner-thumb {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Responsive */
@media (max-width: 767.98px) {
    .nav-tabs {
        flex-direction: column;
        align-items: stretch;
        padding: 6px;
        border-radius: 8px;
    }
    .nav-tabs .nav-link {
        margin-right: 0;
        margin-bottom: 4px;
        border-radius: 4px !important;
        padding: 12px 16px;
        justify-content: center;
    }

    .admin-form-container textarea,
    .admin-form-container input[type="text"],
    .admin-form-container input[type="file"] {
        width: 100% !important;
    }

    .admin-form-container .col-md-2 {
        width: 100% !important;
        margin-top: 8px;
    }

    .admin-form-container .form-check.form-switch {
        text-align: left !important;
        padding-left: 3em !important;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal-dialog {
        margin: 10px;
    }
}
/* ===================================================
   🛠️ แก้ไขบั๊กเส้นใต้สีฟ้ายาวล้นตารางในหน้ารายการ Admin
   =================================================== */
.admin-file-link a {
    display: inline-block !important;
    width: fit-content !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}