/* =====================================================
   ศูนย์บริหารความสุขและความปลอดภัย - Main Stylesheet
   ===================================================== */

/* CSS Variables */
:root {
    --navy:   #0B1D51;
    --blue:   #024CAA;
    --orange: #EC8305;
    --gray:   #DBD3D3;
	--gold:   #FFD700;
	--green:  #00FF00;
    --lavender: #F5EFFF;
    --white:  #ffffff;
    --dark:   #111827;
    --text:   #374151;
    --shadow: 0 4px 20px rgba(11, 29, 81, 0.12);
    --shadow-lg: 0 8px 40px rgba(11, 29, 81, 0.18);
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body, select, input, textarea, button {
    font-family: 'Sarabun', 'Prompt', 'TH Sarabun New', 'Tahoma', sans-serif;
    font-size: 16px;
    color: var(--text);
    background: var(--lavender);
    line-height: 1.7;
}
a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; }
.container-fluid { padding: 0 20px; }
@media(max-width:575px){
    .container { padding-left: 10px !important; padding-right: 10px !important; }
}

/* =====================================================
   HEADER / TOP BAR
   ===================================================== */
#top-bar {
    background: var(--navy);
    color: var(--gray);
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 2px solid var(--orange);
}
#top-bar .top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
#top-bar a { color: var(--gray); }
#top-bar a:hover { color: var(--green); }
#top-bar .top-right { display: flex; gap: 15px; align-items: center; }

/* HEADER BRAND */
#site-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    padding: 18px 0;
    position: relative;
    overflow: hidden;
}
#site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(236, 131, 5, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
#site-header .header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}
#site-header .site-logo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid var(--orange);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-placeholder {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid var(--orange);
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 30px;
    color: var(--white);
}
#site-header .site-title-wrap { flex: 1; }
#site-header .site-title {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    letter-spacing: 0.3px;
    line-height: 1.3;
}
#site-header .site-subtitle {
    color: var(--orange);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* =====================================================
   NAVIGATION
   ===================================================== */
#main-nav {
    background: var(--blue);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
#main-nav .navbar {
    padding: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    min-height: unset;
}
#main-nav .navbar-collapse {
    border: none !important;
    box-shadow: none !important;
}
#main-nav .navbar-toggler {
    border-color: rgba(255,255,255,0.5);
    margin: 8px 0;
}
#main-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
#main-nav .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-size: 14.5px;
    font-weight: 500;
    padding: 14px 18px !important;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}
#main-nav .navbar-nav .nav-link:hover,
#main-nav .navbar-nav .nav-link.active {
    color: var(--gold) !important;
    border-bottom-color: var(--orange);
    background: rgba(255,255,255,0.06);
}
#main-nav .dropdown-menu {
    background: var(--navy);
    border: none;
    border-top: 3px solid var(--orange);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    margin-top: 0;
}
#main-nav .dropdown-item {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    padding: 10px 20px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
#main-nav .dropdown-item:hover {
    background: rgba(236,131,5,0.15);
    color: var(--gold);
    border-left-color: var(--orange);
}
#main-nav .dropdown-submenu { position: relative; }
#main-nav .dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -3px;
    border-top: 3px solid var(--orange);
}
#main-nav .dropdown-submenu:hover > .dropdown-menu { display: block; }

/* =====================================================
   BANNER SLIDER
   ===================================================== */
#banner-slider {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    width: 100%;
}
#banner-slider .carousel-inner { background: var(--navy); }
#banner-slider .item,
#banner-slider .carousel-item {
    width: 100%;
}
#banner-slider .item img,
#banner-slider .carousel-item img,
#banner-slider .carousel-inner > .item > img,
#banner-slider .carousel-inner > .item > a > img {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
    background: var(--navy);
}
#banner-slider .carousel-caption {
    background: linear-gradient(to top, rgba(11,29,81,0.75), transparent);
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px 15px;
    text-align: left;
    border-radius: 0;
}
#banner-slider .carousel-caption h3 {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    margin-bottom: 0;
}
#banner-slider .carousel-indicators { bottom: 5px; }
#banner-slider .carousel-indicators li { border-radius: 4px; width: 25px; height: 4px; }
#banner-slider .left.carousel-control,
#banner-slider .right.carousel-control { background-image: none !important; width: 45px; }
.banner-placeholder {
    height: 420px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--white);
}
.banner-placeholder h2 { font-size: 2rem; font-weight: 700; }
.banner-placeholder p { color: var(--orange); font-size: 1.1rem; margin-top: 8px; }

/* =====================================================
   SECTION COMMON
   ===================================================== */
section { padding: 50px 0; }
.section-title {
    position: relative;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 30px;
    padding-bottom: 14px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 55px;
    height: 4px;
    background: linear-gradient(to right, var(--orange), var(--blue));
    border-radius: 2px;
}
.section-title.center { text-align: center; }
.section-title.center::after { left: 50%; transform: translateX(-50%); }

/* =====================================================
   NEWS CARDS
   ===================================================== */
#news-section { background: var(--white); }

/* ── การ์ดข่าวสูงเท่ากันทุกอัน ── */
#news-section .row { display: flex; flex-wrap: wrap; }
#news-section .col-md-3 { display: flex; flex-direction: column; }

.news-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--white);
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.news-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.news-card .card-img-top { height: 200px; object-fit: cover; transition: transform 0.4s ease; }
.news-card:hover .card-img-top { transform: scale(1.05); }
.news-card .card-img-wrap { overflow: hidden; flex-shrink: 0; }
.news-card .card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.news-card .card-category, .news-card-flex .card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--lavender);
    color: var(--blue);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.news-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.news-card .card-text { font-size: 13.5px; color: #6b7280; }
.news-card .card-date { font-size: 12.5px; color: #9ca3af; margin-bottom: 12px; }
.news-card .card-date i { color: var(--orange); margin-right: 4px; }
.news-card .btn-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    border: none;
    background: none;
    transition: var(--transition);
    margin-top: auto;
}
.news-card .btn-read:hover { color: var(--orange); gap: 10px; }

/* =====================================================
   DOCUMENTS SECTION
   ===================================================== */
#docs-section { background: var(--lavender); }
.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(11,29,81,0.07);
    transition: var(--transition);
    border-left: 4px solid transparent;
}
.doc-item:hover { border-left-color: var(--orange); transform: translateX(4px); box-shadow: var(--shadow); }
.doc-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), var(--navy));
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-size: 20px; flex-shrink: 0;
}
.doc-info { flex: 1; }
.doc-info h5 { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.doc-info small { color: #9ca3af; font-size: 12.5px; }
.doc-badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--orange); color: var(--white); font-weight: 600; }

/* =====================================================
   STATS COUNTER
   ===================================================== */
#stats-bar { background: linear-gradient(135deg, var(--navy), var(--blue)); padding: 30px 0; color: var(--white); }
.stat-item { text-align: center; padding: 10px; }
.stat-item .stat-num { font-size: 2rem; font-weight: 800; color: var(--orange); display: block; line-height: 1; }
.stat-item .stat-label { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 4px; }
.stat-divider { border-left: 1px solid rgba(255,255,255,0.2); }

/* =====================================================
   FOOTER
   ===================================================== */
#site-footer { background: var(--navy); color: rgba(255,255,255,0.8); padding: 45px 0 0; }
#site-footer h5 { color: var(--orange); font-weight: 700; margin-bottom: 18px; font-size: 1.80rem; }
#site-footer p, #site-footer li { font-size: 13.5px; line-height: 1.8; }
#site-footer a { color: rgba(255,255,255,0.7); font-size: 13.5px; }
#site-footer a:hover { color: var(--gold); }
#site-footer ul { list-style: none; padding: 0; }
#site-footer ul li { padding: 4px 0; }
#site-footer ul li::before { content: '›'; color: var(--orange); margin-right: 8px; font-weight: 700; }
.footer-bottom { background: rgba(0,0,0,0.25); padding: 14px 0; margin-top: 30px; font-size: 13px; text-align: center; color: rgba(255,255,255,0.5); }
.footer-bottom a { color: var(--orange); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--blue), var(--navy));
    color: var(--white); border: none; padding: 10px 24px; border-radius: 25px;
    font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-custom:hover { background: linear-gradient(135deg, var(--navy), #060f2e); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(2,76,170,0.4); color: var(--white); }
.btn-orange { background: var(--orange); color: var(--white); border: none; padding: 10px 24px; border-radius: 25px; font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition); }
.btn-orange:hover { background: #c96e02; transform: translateY(-2px); color: var(--white); }
.btn-outline-navy { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 8px 22px; border-radius: 25px; font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition); }
.btn-outline-navy:hover { background: var(--navy); color: var(--white); }

/* =====================================================
   FORMS
   ===================================================== */
.form-control { border: 2px solid var(--gray); border-radius: var(--radius); padding: 10px 15px; font-size: 14.5px; transition: var(--transition); font-family: 'Sarabun', 'Prompt', sans-serif; }
select, select.form-control {
    font-family: 'Sarabun', 'Prompt', sans-serif !important;
    font-size: 15px !important; line-height: 2 !important;
    height: auto !important; min-height: 46px !important; padding: 8px 15px !important;
    -webkit-appearance: auto; appearance: auto; vertical-align: middle;
}
select option { font-family: 'Sarabun', 'Prompt', sans-serif; font-size: 15px; line-height: 2; padding: 6px 0; }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,76,170,0.12); outline: none; }
.form-label { font-weight: 600; font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.form-group { margin-bottom: 18px; }
.input-eye-wrap { position: relative; }
.input-eye-wrap .form-control { padding-right: 44px; }
.input-eye-wrap .eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #9ca3af; transition: var(--transition); padding: 0; }
.input-eye-wrap .eye-btn:hover { color: var(--blue); }

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 60%, #1a6dd0 100%); display: flex; align-items: center; justify-content: center; padding: 30px 15px; position: relative; overflow: hidden; }
.auth-page::before { content: ''; position: absolute; width: 500px; height: 500px; background: rgba(236,131,5,0.07); border-radius: 50%; top: -100px; right: -100px; pointer-events: none; }
.auth-page::after { content: ''; position: absolute; width: 300px; height: 300px; background: rgba(245,239,255,0.05); border-radius: 50%; bottom: -50px; left: -50px; pointer-events: none; }
.auth-card { background: var(--white); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); position: relative; z-index: 2; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .auth-icon { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy)); display: inline-flex; align-items: center; justify-content: center; font-size: 36px; color: var(--white); margin-bottom: 12px; box-shadow: 0 8px 20px rgba(2,76,170,0.35); }
.auth-logo h4 { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.auth-logo p { font-size: 13px; color: #6b7280; }

/* =====================================================
   ADMIN DASHBOARD
   ===================================================== */
#admin-wrapper { display: flex; min-height: 100vh; }
#admin-sidebar { width: 260px; background: linear-gradient(180deg, var(--navy) 0%, #081640 100%); color: var(--white); flex-shrink: 0; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; transition: var(--transition); }
#admin-sidebar .sidebar-brand { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; }
#admin-sidebar .sidebar-brand .brand-icon { width: 55px; height: 55px; border-radius: 50%; background: var(--orange); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 8px; }
#admin-sidebar .sidebar-brand h6 { font-size: 1.30rem; font-weight: 700; margin: 0; color: var(--white); }
#admin-sidebar .sidebar-brand small { color: var(--orange); font-size: 11px; }
#admin-sidebar .sidebar-menu { padding: 15px 0; }
#admin-sidebar .menu-header { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.35); padding: 12px 20px 5px; }
#admin-sidebar .sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: rgba(255,255,255,0.75); font-size: 14px; transition: var(--transition); border-left: 3px solid transparent; cursor: pointer; text-decoration: none; }
#admin-sidebar .sidebar-link:hover, #admin-sidebar .sidebar-link.active { background: rgba(236,131,5,0.15); color: var(--white); border-left-color: var(--orange); text-decoration: none; }
#admin-sidebar .sidebar-link .menu-icon { font-size: 16px; width: 20px; text-align: center; }
#admin-sidebar .sidebar-link .badge-count { margin-left: auto; background: var(--orange); border-radius: 10px; font-size: 10px; padding: 2px 7px; font-weight: 700; }
#admin-main { margin-left: 260px; flex: 1; background: #f0f4f8; min-height: 100vh; }
#admin-topbar { background: var(--white); padding: 12px 25px; border-bottom: 1px solid var(--gray); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
#admin-topbar .page-title { font-size: 2rem; font-weight: 700; color: var(--navy); margin: 0; }
#admin-topbar .admin-user { display: flex; align-items: center; gap: 10px; }
#admin-topbar .admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 14px; font-weight: 700; }
#admin-content { padding: 25px; }
.admin-stat-card { border-radius: var(--radius-lg); padding: 24px; color: var(--white); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.admin-stat-card .stat-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 50px; opacity: 0.2; }
.admin-stat-card h3 { font-size: 2.2rem; font-weight: 800; margin-bottom: 4px; }
.admin-stat-card p { font-size: 13.5px; opacity: 0.85; margin: 0; }
.stat-blue { background: linear-gradient(135deg, var(--blue), var(--navy)); }
.stat-orange { background: linear-gradient(135deg, var(--orange), #b86302); }
.stat-teal { background: linear-gradient(135deg, #0e7490, #0c4a6e); }
.stat-purple { background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.admin-table { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table thead th { background: var(--navy); color: var(--white); font-weight: 600; font-size: 13.5px; border: none; padding: 13px 16px; }
.admin-table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 14px; border-bottom: 1px solid var(--gray); }
.admin-table tbody tr:hover { background: var(--lavender); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.admin-card .card-header-custom { background: var(--white); border-bottom: 2px solid var(--lavender); padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; }
.admin-card .card-header-custom h5 { font-size: 1.80rem; font-weight: 700; color: var(--navy); margin: 0; display: flex; align-items: center; gap: 10px; font-family: 'Sarabun', 'Prompt', sans-serif; }
.admin-card .card-header-custom h5 i { color: var(--orange); }
.admin-card .card-body-custom { padding: 22px; }
.badge-status { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
#sidebar-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--navy); cursor: pointer; }

/* =====================================================
   BREADCRUMB
   ===================================================== */
.breadcrumb-bar { background: var(--white); padding: 10px 0; border-bottom: 1px solid var(--gray); font-size: 13px; }
.breadcrumb { margin: 0; padding: 0; background: none; }
.breadcrumb-item a { color: var(--blue); }
.breadcrumb-item.active { color: var(--orange); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--gray); }

/* =====================================================
   NEWS DETAIL PAGE
   ===================================================== */
.news-detail { max-width: 850px; margin: 0 auto; }
.news-detail .cover-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 25px; }
.news-detail h1 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; line-height: 1.35; }
.news-detail .meta { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; font-size: 13.5px; color: #6b7280; }
.news-detail .meta i { color: var(--orange); }
.news-detail .content { font-size: 15.5px; line-height: 1.85; color: var(--text); }

/* =====================================================
   PROFILE PAGE
   ===================================================== */
.profile-avatar-wrap { text-align: center; position: relative; display: inline-block; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--blue); box-shadow: var(--shadow); }
.avatar-upload-btn { position: absolute; bottom: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: var(--white); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: var(--transition); }
.avatar-upload-btn:hover { background: #c96e02; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert-custom { border-radius: var(--radius); padding: 12px 18px; font-size: 14px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; border: none; }
.alert-success-custom { background: #d1fae5; color: #065f46; }
.alert-error-custom { background: #fee2e2; color: #991b1b; }
.alert-info-custom { background: var(--lavender); color: var(--navy); }

/* =====================================================
   RESPONSIVE — Tablet (≤991px)
   ===================================================== */
@media (max-width: 991px) {
    #banner-slider .item img,
    #banner-slider .carousel-item img,
    #banner-slider .carousel-inner > .item > img { max-height: 320px; }
    #banner-slider .carousel-caption h3 { font-size: 1.1rem; }
    #banner-slider .carousel-caption { padding: 14px 20px; }
    #admin-sidebar { transform: translateX(-260px); }
    #admin-sidebar.open { transform: translateX(0); }
    #admin-main { margin-left: 0; }
    #sidebar-toggle { display: block; }
    .banner-placeholder { height: 280px; }
    .banner-placeholder h2 { font-size: 1.4rem; }
    .col-md-3.col-sm-6 { width: 50%; }
    .news-card .card-img-top { height: 180px; }
}

/* =====================================================
   RESPONSIVE — Mobile Landscape (≤767px)
   ===================================================== */
@media (max-width: 767px) {
    #site-header .site-title { font-size: 1.4rem; }
    #site-header .site-subtitle { font-size: 0.88rem; }
    .logo-placeholder, #site-header .site-logo { width: 52px; height: 52px; font-size: 20px; }
    #banner-slider .item img,
    #banner-slider .carousel-item img,
    #banner-slider .carousel-inner > .item > img { max-height: 220px; }
    #banner-slider .carousel-caption { display: none; }
    .banner-placeholder { height: 200px; }
    .stat-divider { border-left: none; border-top: 1px solid rgba(255,255,255,0.2); }
    .auth-card { padding: 28px 20px; }
    #admin-content { padding: 14px; }
    section { padding: 30px 0; }
    .section-title { font-size: 2rem; }
    .news-filter-tabs { flex-wrap: wrap; gap: 6px; }
    .admin-card { overflow-x: auto; }

    /* ── mobile: การ์ดข่าว 1 คอลัมน์ ── */
    #news-section .col-md-3 {
        width: 100% !important;
        float: none !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .news-card .card-img-top {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
    .news-card { margin-bottom: 16px; }
}

/* =====================================================
   RESPONSIVE — Mobile Portrait (≤575px)
   ===================================================== */
@media (max-width: 575px) {
    .container { padding-left: 10px !important; padding-right: 10px !important; }
    #site-header { padding: 10px 0; }
    #site-header .site-title { font-size: 1.15rem; }
    #site-header .site-subtitle { font-size: 0.8rem; }
    .logo-placeholder, #site-header .site-logo { width: 46px; height: 46px; font-size: 18px; }
    .navbar-brand { font-size: 14px; }
    #banner-slider .item img,
    #banner-slider .carousel-inner > .item > img { max-height: 180px; object-fit: cover; }
    .banner-placeholder { height: 160px; }
    .banner-placeholder h2 { font-size: 1.1rem; }
    #stats-bar .col-xs-6 { font-size: 12px; }
    section { padding: 24px 0; }
    .section-title { font-size: 2rem; }
    .col-md-3.col-sm-6 { width: 100% !important; padding-left: 6px !important; padding-right: 6px !important; }
    .news-card { border-radius: 12px; }
    .news-card .card-img-wrap { overflow: hidden; }
    .news-card .card-img-top { width: 100% !important; height: 210px !important; object-fit: cover; display: block; }
    .news-card .card-body { padding: 14px; }
    .news-card .card-title { font-size: 0.95rem; }
    .news-row-flex { margin: 0 -6px; }
    .news-col { width: 100%; padding: 0 6px; }
    .news-card-flex .card-img-area { height: 210px; }
    .news-card-flex .card-img-area img { width: 100%; height: 100%; object-fit: cover; }
    .news-card-flex .card-body-flex { padding: 14px; }
    .doc-card { padding: 14px; }
    .auth-card { padding: 24px 16px; margin: 10px; }
    #top-bar { padding: 5px 0; }
    #top-bar .top-right { gap: 8px; }
    #top-bar .top-right a { font-size: 11px; }
    #admin-content { padding: 10px; }
    .admin-card .card-header-custom { padding: 12px 14px; }
    .admin-card .card-header-custom h5 { font-size: 0.95rem; }
    .admin-card .card-body-custom { padding: 14px; }
}

/* =====================================================
   RESPONSIVE — Small Mobile (≤400px)
   ===================================================== */
@media (max-width: 400px) {
    .container { padding-left: 8px !important; padding-right: 8px !important; }
    .news-card .card-img-top { height: 180px !important; }
    .news-card-flex .card-img-area { height: 180px; }
    #site-header .site-title { font-size: 1rem; }
    .logo-placeholder, #site-header .site-logo { width: 40px; height: 40px; font-size: 16px; }
    .auth-card { padding: 20px 12px; }
}

/* Scrollbar */
#admin-sidebar::-webkit-scrollbar { width: 5px; }
#admin-sidebar::-webkit-scrollbar-track { background: transparent; }
#admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

/* Print */
@media print { #main-nav, #top-bar, #site-footer, #stats-bar { display: none !important; } }

/* ===== FIX: Select dropdown Thai font & visibility ===== */
select, select.form-control, .form-control[type="select"], .admin-form select, .form-group select {
    font-family: 'Sarabun', 'Prompt', sans-serif !important;
    font-size: 15px !important;
    color: #1f2937 !important;
    line-height: 1.8 !important;
    height: 46px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* =====================================================
   INFOGRAPHIC SLIDER
   ===================================================== */
#infographic-section {
    background: #fff;
    padding: 0;
    overflow: hidden;
}
#ig-slider { width: 100%; overflow: hidden; }
#ig-track-wrap { width: 100%; overflow: hidden; }
#ig-track { display: flex; width: 100%; }
.ig-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
}
.ig-slide img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    max-height: 42vw;
    object-fit: cover;
}
@media (max-width: 991px) { .ig-slide img { max-height: 50vw; } }
@media (max-width: 767px) { .ig-slide img { max-height: 60vw; } }
@media (max-width: 480px) { .ig-slide img { max-height: 72vw; } }