/* ==========================================================================
   ธีมหลังบ้าน อบต.วังหินลาด — โทนกรมท่า/น้ำเงินเข้ม + ทอง, ฟอนต์ Sarabun (ฟอนต์มาตรฐานงานราชการ)
   ไฟล์นี้โหลดต่อจาก admin.css (ทับเฉพาะหน้าตา ไม่แก้ตรรกะ) — ปรับสีได้ที่ตัวแปรด้านล่าง
   ========================================================================== */
:root {
    --wl-navy:      #14284b;   /* พื้นเมนูซ้าย */
    --wl-navy-dk:   #0d1c36;
    --wl-navy-lt:   #1d3a6b;
    --wl-primary:   #1f4e8c;   /* ปุ่มหลัก/ลิงก์ */
    --wl-primary-dk:#173d70;
    --wl-gold:      #e0b252;   /* ไฮไลต์เมนูที่เลือก/หัวข้อกลุ่ม */
    --wl-ink:       #1d2939;   /* ตัวอักษรหลัก */
    --wl-ink-2:     #475467;   /* ตัวอักษรรอง */
    --wl-line:      #dde3ec;
    --wl-bg:        #f2f5f9;
}

/* ---------- ฟอนต์ + พื้นฐาน ---------- */
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body, body.c-app {
    font-family: 'Sarabun', 'Noto Sans Thai', 'Prompt', -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--wl-ink);
    background-color: var(--wl-bg);
}
input, select, textarea, button, .btn, .form-control, .custom-select { font-family: inherit; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 600; color: #101c33; letter-spacing: 0; }
strong, b { font-weight: 600; }
a { color: var(--wl-primary); }
a:hover { color: var(--wl-primary-dk); }
.c-body, .c-main { background-color: var(--wl-bg); }
.text-muted { color: #667085 !important; }

/* ---------- เมนูด้านซ้าย (Sidebar) ---------- */
body .c-sidebar {
    background: linear-gradient(180deg, var(--wl-navy) 0%, var(--wl-navy-dk) 100%);
    box-shadow: 3px 0 14px rgba(8, 18, 40, .28);
}
body .c-sidebar .c-sidebar-brand {
    background: var(--wl-navy-dk);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
body .c-sidebar .c-sidebar-nav { padding-bottom: 1rem; }
body .c-sidebar .c-sidebar-nav-title {
    color: var(--wl-gold);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 1.3rem 1.1rem .45rem;
}
body .c-sidebar .c-sidebar-nav-link,
body .c-sidebar .c-sidebar-nav-dropdown-toggle {
    color: #eef3fc;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    padding: .78rem 1.05rem;
    border-left: 4px solid transparent;
    transition: background-color .15s, border-color .15s;
}
body .c-sidebar .c-sidebar-nav-icon { color: #a9bddd; flex: 0 0 2.1rem; }
body .c-sidebar .c-sidebar-nav-link:hover,
body .c-sidebar .c-sidebar-nav-dropdown-toggle:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .09);
}
body .c-sidebar .c-sidebar-nav-link:hover .c-sidebar-nav-icon { color: #fff; }
body .c-sidebar .c-sidebar-nav-link.c-active,
body .c-sidebar .c-active.c-sidebar-nav-dropdown-toggle {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(224, 178, 82, .26) 0%, rgba(255, 255, 255, .07) 100%);
    border-left-color: var(--wl-gold);
}
body .c-sidebar .c-sidebar-nav-link.c-active .c-sidebar-nav-icon { color: var(--wl-gold); }
body .c-sidebar .c-sidebar-nav-dropdown.c-show { background: rgba(0, 0, 0, .16); }
body .c-sidebar .c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle { background: rgba(255, 255, 255, .06); color: #fff; }
body .c-sidebar .c-sidebar-nav-dropdown-items { background: rgba(0, 0, 0, .18); }
body .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link {
    color: #d2ddf1;
    font-size: .95rem;
    font-weight: 400;
    padding: .62rem 1rem .62rem 3.2rem;
}
body .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link:hover { color: #fff; }
body .c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link.c-active { color: #fff; font-weight: 600; }
body .c-sidebar .c-sidebar-nav-dropdown-toggle::after { opacity: .8; }
body .c-sidebar .c-sidebar-minimizer { background: var(--wl-navy-dk); }
body .c-sidebar .badge { font-weight: 600; }
body .c-sidebar .badge-warning { background: var(--wl-gold); color: #3b2a05; }
.c-sidebar-nav::-webkit-scrollbar { width: 6px; }
.c-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }

/* ---------- แถบบน / เส้นทาง ---------- */
.c-header { border-bottom: 1px solid var(--wl-line); box-shadow: 0 1px 4px rgba(20, 40, 75, .06); }
.c-header .c-header-nav .c-header-nav-link { font-weight: 500; color: var(--wl-ink-2); }
.c-subheader { background: #fff; border-bottom: 1px solid var(--wl-line); min-height: 44px; }
.breadcrumb { background: transparent; font-size: .95rem; }
.breadcrumb-item.active { color: var(--wl-ink-2); }
.breadcrumb-item a { color: var(--wl-primary); font-weight: 500; }
.user-login {
    background: linear-gradient(90deg, var(--wl-navy-lt) 0%, var(--wl-primary) 100%);
    color: #fff;
    height: 32px;
    line-height: 32px;
    font-size: .95rem;
    letter-spacing: .1px;
}

/* ---------- การ์ด / ตาราง ---------- */
.card {
    border: 1px solid var(--wl-line);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(20, 40, 75, .07);
    background: #fff;
}
.card-header {
    background: #fff;
    color: var(--wl-navy);
    font-weight: 600;
    border-bottom: 1px solid var(--wl-line);
    border-radius: 10px 10px 0 0;
    padding: .95rem 1.25rem;
}
.card-header h5, .card-header .h5 { font-size: 1.1rem; margin: 0; color: var(--wl-navy); }
.card-header .fa { color: var(--wl-primary); }
.card-footer { background: #fafbfd; border-top: 1px solid var(--wl-line); border-radius: 0 0 10px 10px; }
.card-body { color: var(--wl-ink); }

.table { color: var(--wl-ink); font-size: .97rem; }
.table thead th {
    background: #eaf0f8;
    color: #14284b;
    font-weight: 600;
    font-size: .93rem;
    border-top: 0;
    border-bottom: 2px solid #c9d5e6;
    vertical-align: middle;
    white-space: nowrap;
}
.table td, .table th { border-top: 1px solid #e8edf4; padding: .75rem .8rem; }
.table-striped tbody tr:nth-of-type(odd) { background-color: #f8fafd; }
.table tbody tr:hover { background-color: #eaf2fd; }
table.dataTable thead .sorting:before, table.dataTable thead .sorting:after { opacity: .35; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border: 1px solid #c3cddd; border-radius: 8px; }

/* ---------- ฟอร์ม ---------- */
label { font-weight: 500; color: #243453; margin-bottom: .35rem; }
.form-control, .custom-select {
    color: var(--wl-ink);
    background-color: #fff;
    border: 1px solid #bcc7d9;
    border-radius: 8px;
    min-height: 2.65rem;
    font-size: 1rem;
}
.form-control::placeholder { color: #8a95a8; opacity: 1; }
.form-control:focus, .custom-select:focus {
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 .2rem rgba(31, 78, 140, .16);
}
.form-control:disabled, .form-control[readonly] { background-color: #eef1f6; color: #55617a; }
.input-group-text { background: #eef2f8; border: 1px solid #bcc7d9; color: var(--wl-navy); }
.form-text, small.text-muted { color: #667085; }

/* ---------- ปุ่ม / ป้าย ---------- */
.btn { border-radius: 8px; font-weight: 500; letter-spacing: .1px; }
.btn-primary, .btn-primary:focus { color: #fff; background-color: var(--wl-primary); border-color: var(--wl-primary); }
.btn-primary:hover, .btn-primary:active { background-color: var(--wl-primary-dk); border-color: var(--wl-primary-dk); }
.btn-outline-primary { color: var(--wl-primary); border-color: var(--wl-primary); }
.btn-outline-primary:hover { background-color: var(--wl-primary); border-color: var(--wl-primary); color: #fff; }
.btn-link { color: var(--wl-primary); }
.btn-link:hover { color: var(--wl-primary-dk); }
.bg-primary { background-color: var(--wl-primary) !important; }
.text-primary { color: var(--wl-primary) !important; }
.badge { font-weight: 600; letter-spacing: .1px; }
.page-item.active .page-link { background-color: var(--wl-primary); border-color: var(--wl-primary); }
.page-link { color: var(--wl-primary); }
input:checked + .slider { background-color: var(--wl-primary); }
input:focus + .slider { box-shadow: 0 0 1px var(--wl-primary); }
.alert { border-radius: 8px; }
.alert-info { background: #eaf3ff; border-color: #c4dcfa; color: #123c6f; }

/* ---------- หน้าเข้าสู่ระบบ / สมัครสมาชิก ---------- */
body.c-app.flex-row { background: linear-gradient(135deg, #e8eef8 0%, #f5f7fb 100%); }
body.c-app.flex-row .card.text-white.bg-primary { background: linear-gradient(160deg, var(--wl-navy) 0%, var(--wl-primary) 100%) !important; border-color: var(--wl-navy); }
body.c-app.flex-row .card.text-white .btn-outline-light, body.c-app.flex-row .card.text-white .btn-primary { border-radius: 8px; }

/* ---------- มือถือ ---------- */
@media (max-width: 575.98px) {
    body, body.c-app { font-size: 15.5px; }
    .card-header { padding: .8rem 1rem; }
    .table td, .table th { padding: .6rem .55rem; }
}

/* ---------- แก้ซ้ำ: ตาราง DataTables / หัวข้อในกล่องสีเข้ม ---------- */
table.dataTable tbody tr > * { box-shadow: none !important; }          /* ใช้แถบสลับสีของธีมแทน (อ่านง่ายกว่า) */
table.dataTable tbody tr > .sorting_1 { background-color: rgba(31, 78, 140, .035); }
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6 { color: inherit; }
.text-white p, .text-white .card-body { color: rgba(255, 255, 255, .95); }

/* ---------- ช่องเลือก (select) : เว้นที่ให้ลูกศร ตัวเลขไม่ทับกัน ---------- */
select, select.form-control, select.custom-select, .custom-select,
.dataTables_wrapper .dataTables_length select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding: .4rem 2.4rem .4rem 1rem !important;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231f4e8c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .85rem center; background-size: 14px;
    line-height: 1.5; cursor: pointer;
}
select[multiple], select[size]:not([size="1"]) { background-image: none; padding-right: 1rem !important; }
div.dataTables_wrapper div.dataTables_length select { width: 92px !important; min-width: 92px; margin: 0 .6rem; display: inline-block; }
.dataTables_wrapper .dataTables_length label, .dataTables_wrapper .dataTables_filter label { display: inline-flex; align-items: center; margin-bottom: 0; }
.dataTables_wrapper .dataTables_filter input { margin-left: .6rem; padding: .4rem .9rem; }

/* ---------- ฟอร์มแก้ไขคำร้องของฉัน (ใช้ช่องกรอกชุดเดียวกับหน้า E-Service) ---------- */
.myrq-form .hm-fm-sec { border: 0; border-top: 1px solid var(--wl-line); margin: 0; padding: 16px 0 6px; min-width: 0; }
.myrq-form .hm-fm-sec legend { width: auto; font-weight: 700; color: var(--wl-navy); padding: 0; margin-bottom: 10px; font-size: 1.05rem; }
.myrq-form .hm-fm-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 18px; }
.myrq-form .hm-fm-f { grid-column: span 12; min-width: 0; }
@media (min-width: 760px) { .myrq-form .hm-fm-w6 { grid-column: span 6; } }
.myrq-form .hm-fm-l { display: block; font-weight: 600; color: #243453; margin-bottom: 6px; }
.myrq-form .hm-fm-req { color: #c62828; }
.myrq-form .hm-fm-i { width: 100%; border: 1px solid #bcc7d9; border-radius: 8px; padding: .5rem .75rem; font: inherit; background: #fff; color: var(--wl-ink); }
.myrq-form select.hm-fm-i { padding-right: 2.4rem; }
.myrq-form .hm-fm-i:focus { outline: 0; border-color: var(--wl-primary); box-shadow: 0 0 0 3px rgba(31, 78, 140, .15); }
.myrq-form textarea.hm-fm-i { min-height: 96px; resize: vertical; }
.myrq-form .hm-fm-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.myrq-form .hm-fm-opt { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 1.5; font-weight: 400; }
.myrq-form .hm-fm-opt input { margin-top: 6px; flex: none; }
.myrq-form .hm-fm-ack { padding: 10px 12px; background: var(--wl-bg); border-radius: 8px; }
.myrq-form .hm-fm-h { display: block; font-size: .85rem; color: var(--wl-ink-2); margin-top: 4px; }
.myrq-form .hm-fm-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--wl-bg); color: var(--wl-ink-2); }

/* ---------- แถบวัดความปลอดภัยรหัสผ่าน ---------- */
.pw-meter { display: none; margin: -.5rem 0 1rem; font-size: .88rem; }
.pw-meter .pw-bar { height: 8px; border-radius: 99px; background: #e3e8f0; overflow: hidden; }
.pw-meter .pw-bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
.pw-meter .pw-txt { margin-top: 4px; }
.pw-meter .pw-tip { color: var(--wl-ink-2); font-size: .82rem; margin-top: 2px; }

/* ปุ่มรูปตา แสดง/ซ่อนรหัสผ่าน */
.pw-eye-wrap{position:relative;display:block;flex:1 1 auto;min-width:0;width:100%}
.input-group .pw-eye-wrap{width:1%;flex:1 1 auto}
.pw-eye{position:absolute;top:0;right:0;width:42px;padding:0;border:0;background:transparent;color:#6b7a90;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:5}
.pw-eye:hover,.pw-eye.on{color:#1f4e8c}
.pw-eye:focus{outline:2px solid #c9a24a;outline-offset:-2px;border-radius:6px}
