/* วังจันทร์ Jobs — สไตล์ของแอป ทับ Bootstrap 5.3 เฉพาะที่จำเป็น
   มือถือก่อน: แถบนำทางล่างบนจอเล็ก, เมนูบน + footer เต็มบนจอ ≥992px
   สี: กรมท่า (แบรนด์/ปุ่มหลัก) · ส้ม (ปุ่ม "ลงประกาศ" เท่านั้น) · เขียว (สถานะดี/เน้นคำ) */

:root {
    --brand: #0f2a5c;
    --brand-dark: #0a1f47;
    --brand-soft: #e8edf7;
    --brand-ink: #ffffff;
    --accent: #f26a1b;
    --accent-dark: #d95a10;
    --good: #2e8b3d;
    --good-soft: #e6f4e8;
    --ink: #1f2933;
    --ink-muted: #6b7280;
    --surface: #ffffff;
    --surface-alt: #f3f5f9;
    --line: #e3e8ee;
    --bottom-nav-h: 64px;

    /* ให้ลิงก์และปุ่มของ Bootstrap เดินตามสีแบรนด์ ไม่ใช่ฟ้าหรือเขียวเริ่มต้น */
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-color-rgb: 15, 42, 92;
}

body {
    font-family: "Sarabun", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--surface-alt);
    color: var(--ink);
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
}

.container-narrow,
.container-wide {
    width: 100%;
    margin-inline: auto;
    padding-inline: 1rem;
}
.container-narrow { max-width: 640px; }
.container-wide { max-width: 1140px; }

/* ---------- ปุ่ม ---------- */

.btn-success {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-success {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
}
.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--accent-dark);
    --bs-btn-active-border-color: var(--accent-dark);
    font-weight: 600;
}
.text-success { color: var(--good) !important; }

/* ---------- แถบบน ---------- */

.app-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .55rem 0;
}
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--brand);
    white-space: nowrap;
}
.app-brand i { color: var(--good); font-size: 1.4rem; }
.app-brand .brand-jobs { color: var(--good); }

.top-nav { display: none; gap: 1.6rem; margin-inline: 2rem auto; }
.top-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .92rem;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
}
.top-nav a:hover, .top-nav a.active { color: var(--brand); border-bottom-color: var(--accent); }

.top-search { display: none; position: relative; width: 250px; }
.top-search input { padding-left: 2.2rem; font-size: .88rem; border-radius: .6rem; }
.top-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ink-muted); }

.app-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: var(--brand);
    text-decoration: none;
    font-size: 1.2rem;
}
.app-bar-btn:hover { background: var(--brand-soft); }
.app-bar-badge { position: absolute; top: .1rem; right: 0; font-size: .62rem; }

.app-main { padding-block: 1rem; }
.main-full { padding: 0; }

@media (min-width: 992px) {
    .top-nav, .top-search { display: flex; }
    .app-main { padding-block: 1.5rem; }
}

/* ---------- แถบนำทางล่าง (มือถือ) ---------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1035;
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    height: var(--bottom-nav-h);
    color: var(--ink-muted);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 500;
}
.bottom-nav-item i { font-size: 1.25rem; }
.bottom-nav-item.active { color: var(--brand); font-weight: 700; }
/* ปุ่มกลาง "ลงประกาศ" เป็นวงกลมส้มยื่นขึ้นเหนือแถบ ตามภาพ */
.bottom-nav-post i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    margin-top: -1.3rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 4px 12px rgba(242, 106, 27, .45);
}
.bottom-nav-post { color: var(--ink-muted); }

@media (min-width: 992px) {
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}

/* ---------- หน้าแรก: hero + กล่องค้นหา ---------- */

.hero {
    position: relative;
    background: #dff0f3 url("../img/hero.svg") center bottom / cover no-repeat;
    padding: 1.6rem 0 4.6rem;
    text-align: center;
}
/* ภาพที่ผู้ดูแลแนบ (สุ่มจาก admin_hero.php) — ทับขาวโปร่งไว้ให้ตัวหนังสือสีเข้มอ่านออกทุกภาพ */
.hero.has-img {
    background: linear-gradient(rgba(255, 255, 255, var(--hero-veil, .65)), rgba(255, 255, 255, calc(var(--hero-veil, .65) * .7))), var(--hero-img) center / cover no-repeat, #dff0f3;
}
.hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 .3rem;
}
.hero h1 span { color: var(--good); }
.hero p { margin: 0 0 1.1rem; color: #33445f; font-size: .95rem; }

.search-card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(15, 42, 92, .15);
    text-align: left;
    display: grid;
    grid-template-columns: 1fr;
    gap: .6rem;
}
.search-card label { font-size: .75rem; font-weight: 600; color: var(--ink-muted); margin-bottom: .15rem; }
.search-card .form-control, .search-card .form-select { font-size: .9rem; }
.search-card .btn { font-weight: 700; padding-block: .55rem; }

@media (min-width: 768px) {
    .hero { padding: 2.6rem 0 5.6rem; text-align: left; }
    .hero h1 { font-size: 2.6rem; }
    .hero p { font-size: 1.05rem; }
    .search-card { grid-template-columns: 1.4fr 1fr 1fr 1fr auto; align-items: end; max-width: 880px; }
}

/* แถบหมวดงานที่ซ้อนขึ้นไปทับขอบล่างของ hero */
.cat-strip {
    position: relative;
    margin-top: -3rem;
    background: var(--surface);
    border-radius: 1rem;
    padding: .9rem .6rem;
    box-shadow: 0 6px 22px rgba(15, 42, 92, .1);
    display: flex;
    gap: .2rem;
    overflow-x: auto;
}
.cat-item {
    flex: 1 0 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
}
.cat-item:hover { color: var(--brand); }
.cat-tile {
    width: 3rem;
    height: 3rem;
    border-radius: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* โทนสีของหมวดงาน — เลือกด้วย category_id % 6 ใช้ร่วมกันทั้งแถบหมวดและการ์ดงาน */
.tone-0 { background: #e6f4e8; color: #2e8b3d; }
.tone-1 { background: #fff1e0; color: #e07a10; }
.tone-2 { background: #fde8e8; color: #d64545; }
.tone-3 { background: #e3f0ff; color: #2a6fd6; }
.tone-4 { background: #efe8fb; color: #7048c6; }
.tone-5 { background: #fff6d6; color: #c28a00; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 1.6rem 0 .7rem; }
.section-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; color: var(--brand); }
.section-head a { font-size: .85rem; text-decoration: none; font-weight: 600; }

/* ---------- การ์ดงาน ---------- */

.job-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; }
@media (min-width: 768px) { .job-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }
@media (min-width: 992px) { .job-grid { grid-template-columns: repeat(3, 1fr); } }

.job-card {
    position: relative;
    display: flex;
    gap: .8rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .9rem;
    padding: .7rem;
    margin-bottom: .7rem;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.job-grid .job-card { margin-bottom: 0; }
.job-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(15, 42, 92, .1); }

.job-card-thumb {
    position: relative;
    flex: none;
    width: 5.2rem;
    min-height: 5.2rem;
    border-radius: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.job-card-thumb.has-photo { padding: 0; overflow: hidden; background: var(--surface-alt); }
.job-card-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* แกลเลอรีรูปในหน้ารายละเอียดงาน */
.job-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.job-gallery a { display: block; border-radius: .8rem; overflow: hidden; background: var(--surface-alt); aspect-ratio: 4 / 3; }
.job-gallery a:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.job-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb { position: relative; width: 6rem; }
.upload-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .6rem; border: 1px solid var(--line); }
.avatar { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; background: var(--brand-soft); border: 1px solid var(--line); }
.job-card-new {
    position: absolute;
    top: .3rem;
    left: .3rem;
    background: var(--good);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    padding: .05rem .4rem;
    border-radius: .3rem;
}
.job-card-body { flex: 1; min-width: 0; }
.job-card-title { font-weight: 700; font-size: .98rem; margin: 0 0 .1rem; line-height: 1.3; }
.job-card-employer { color: var(--ink-muted); font-size: .8rem; margin-bottom: .2rem; }
.job-card-wage { color: var(--brand); font-weight: 700; }
.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .8rem;
    color: var(--ink-muted);
    font-size: .8rem;
    margin-top: .3rem;
}
.job-card-meta i { margin-right: .2rem; }
.job-card-tag {
    display: inline-block;
    margin-top: .4rem;
    border: 1px solid currentColor;
    border-radius: .35rem;
    padding: 0 .45rem;
    font-size: .72rem;
    font-weight: 600;
    background: transparent !important;
}

/* บนจอกว้างการ์ดใน grid เรียงแนวตั้ง: ภาพเต็มความกว้างด้านบน ปุ่มอยู่ล่าง */
@media (min-width: 768px) {
    .job-grid .job-card { flex-direction: column; padding: .6rem; }
    .job-grid .job-card-thumb { width: 100%; min-height: 6.2rem; font-size: 2.6rem; }
    .job-card-more {
        display: block;
        margin-top: .6rem;
        text-align: center;
        border: 1px solid var(--line);
        border-radius: .5rem;
        padding: .3rem;
        font-size: .82rem;
        font-weight: 600;
        color: var(--brand);
    }
    .job-card:hover .job-card-more { background: var(--brand); border-color: var(--brand); color: #fff; }
}
.job-card-more { display: none; }
@media (min-width: 768px) { .job-grid .job-card-more { display: block; } }

/* ---------- ชิป ---------- */

.chip-row { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; }
.chip {
    flex: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    padding: .3rem .8rem;
    font-size: .82rem;
    text-decoration: none;
    white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.section-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .9rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.section-title { font-size: .95rem; font-weight: 700; margin: 0 0 .7rem; color: var(--brand); }

/* ---------- แบนเนอร์เชิญลงประกาศ + พื้นที่ให้บริการ ---------- */

.cta-banner {
    background: linear-gradient(135deg, var(--brand), #1b4a9a);
    color: #fff;
    border-radius: 1rem;
    padding: 1.4rem;
    height: 100%;
}
.cta-banner h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 .5rem; }
.cta-banner p { opacity: .9; font-size: .9rem; margin: 0 0 .8rem; }
.cta-banner ul { list-style: none; padding: 0; margin: 0 0 1.1rem; font-size: .9rem; line-height: 2; }
.cta-banner li i { color: #7ddc8a; margin-right: .45rem; }

/*
 * การ์ดพื้นที่ให้บริการ: ปุ่มตำบลที่ผู้ดูแลปักหมุดต้องเกาะ "จุดบนแผนที่" ไม่ใช่ขอบการ์ด
 * ภาพจึงเป็น <img> จริงกว้างเต็มการ์ด (การ์ดสูงตามภาพ) แล้วปุ่มวางเป็น % ของภาพนั้น
 * — ไม่ครอปภาพเลย ทุกจอจึงเห็นแผนที่ครบและปุ่มไม่หลุดขอบ
 * ขนาดปุ่มสเกลตามความกว้างการ์ด (cqw) ไม่งั้นบนจอแคบภาพเล็กลงแต่ปุ่มเท่าเดิมจนซ้อนกัน
 */
.area-card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; position: relative; overflow: hidden; container-type: inline-size; }
.area-map { display: block; position: relative; }
.area-map img { display: block; width: 100%; height: auto; }
.area-card-body { position: absolute; inset: 0; padding: 1.4rem; z-index: 2; pointer-events: none; }
.area-card-body a { pointer-events: auto; }
.area-card h2, .area-card p { text-shadow: 0 0 6px var(--surface), 0 0 3px var(--surface); }
.area-card h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; color: var(--brand); }
.area-card h2 span { color: var(--good); }
.area-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: .2rem .25rem .2rem 0;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: var(--good-soft);
    color: var(--good);
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
}
.area-chip:hover { background: var(--good); color: #fff; }
.area-chip { white-space: nowrap; }
/* จุดกึ่งกลางปุ่มคือพิกัดที่บันทึกไว้ — ชื่อตำบลยาวสั้นไม่ทำให้จุดเลื่อน */
.area-chip.pinned {
    position: absolute; margin: 0; z-index: 1;
    transform: translate(-50%, -50%);
    font-size: clamp(.6rem, 3.2cqw, .88rem);
    padding: .3em .75em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.feature-tile { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; height: 100%; }
.feature-tile i { font-size: 1.5rem; color: var(--brand); }
.feature-tile h3 { font-size: .95rem; font-weight: 700; margin: .5rem 0 .25rem; }
.feature-tile p { font-size: .82rem; color: var(--ink-muted); margin: 0; }

/* ---------- สถานะ ---------- */

.status-pill { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }
.status-neutral { background: var(--surface-alt); color: var(--ink-muted); }
.status-info    { background: #e7f1ff; color: #0b5ed7; }
.status-warn    { background: #fff3cd; color: #997404; }
.status-good    { background: var(--good-soft); color: var(--good); }
.status-bad     { background: #fde8e8; color: #b42318; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem .8rem; font-size: .88rem; }
.timeline li::before {
    content: '';
    position: absolute;
    left: -1.42rem;
    top: .35rem;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--brand);
}
.timeline-time { color: var(--ink-muted); font-size: .78rem; }

.contact-box { background: var(--good-soft); border: 1px solid var(--good); border-radius: .7rem; padding: .8rem 1rem; }
.contact-box-masked { background: var(--surface-alt); border-color: var(--line); color: var(--ink-muted); }

.dev-otp-banner { background: #fff8db; border: 1px dashed #d9b400; border-radius: .6rem; padding: .7rem 1rem; font-size: .9rem; }
.dev-otp-code { font-size: 1.4rem; font-weight: 700; letter-spacing: .3rem; }

.empty-state { text-align: center; color: var(--ink-muted); padding: 2.5rem 1rem; }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .5; }

/* ---------- Footer ---------- */

.app-footer { background: var(--brand); color: #cfd8ec; margin-top: 2rem; padding: 2rem 0 1rem; font-size: .85rem; }
.app-footer h4 { color: #fff; font-size: .9rem; font-weight: 700; margin: 0 0 .6rem; }
.app-footer a { color: #cfd8ec; text-decoration: none; display: block; padding: .15rem 0; }
.app-footer a:hover { color: #fff; }
.app-footer .footer-brand { color: #fff; font-size: 1.2rem; font-weight: 700; }
.app-footer .footer-brand span { color: #7ddc8a; }
.app-footer-note { margin: 1.4rem 0 0; padding-top: .9rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .75rem; text-align: center; }

/* ---------- ปุ่มลอย "ติดตั้งแอป" (includes/pwa_install_fab.php) ----------
   ซ้ายล่างโดยตั้งใจ — ต้องยกสูงกว่าแถบนำทางล่างบนมือถือ */
.pwa-install-fab {
    position: fixed;
    left: 1rem;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + .75rem);
    z-index: 1041;
    display: flex;
    align-items: center;
    gap: .45rem;
    height: 2.8rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
    opacity: 0;
    transform: translateY(14px) scale(.9);
    transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1), background .12s ease;
}
@media (min-width: 992px) { .pwa-install-fab { bottom: 1.25rem; } }
.pwa-install-fab.show { opacity: 1; transform: translateY(0) scale(1); animation: pwa-fab-bob 2.6s ease-in-out .45s infinite; }
.pwa-install-fab:hover { background: var(--brand-dark); }
.pwa-install-fab:active { transform: scale(.96); }
.pwa-install-fab i { font-size: 1.1rem; }
.pwa-install-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--brand);
    z-index: -1;
    opacity: .55;
    animation: pwa-fab-pulse 2.6s ease-out infinite;
}
@keyframes pwa-fab-bob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1); } }
@keyframes pwa-fab-pulse { 0% { transform: scale(1); opacity: .55; } 70% { transform: scale(1.45); opacity: 0; } 100% { transform: scale(1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .pwa-install-fab { transition: opacity .2s ease; transform: none; }
    .pwa-install-fab.show { animation: none; transform: none; }
    .pwa-install-fab-pulse { animation: none; opacity: 0; }
}

.pwa-ios-sheet {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity .25s ease;
}
.pwa-ios-sheet.show { opacity: 1; }
.pwa-ios-box {
    position: relative;
    width: 100%;
    max-width: 26rem;
    background: var(--surface);
    color: var(--ink);
    border-radius: 1.1rem;
    padding: 1.25rem 1.25rem 1.4rem;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .35);
    transform: translateY(18px);
    transition: transform .25s cubic-bezier(.34, 1.2, .64, 1);
}
.pwa-ios-sheet.show .pwa-ios-box { transform: translateY(0); }
.pwa-ios-close {
    position: absolute;
    top: .5rem;
    right: .7rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
.pwa-ios-title { font-size: 1.05rem; font-weight: 700; margin: 0 2rem .4rem 0; }
.pwa-ios-title i { color: var(--brand); }
.pwa-ios-lead { font-size: .85rem; color: var(--ink-muted); margin: 0 0 .9rem; }
.pwa-ios-steps { margin: 0; padding-left: 1.15rem; font-size: .9rem; line-height: 1.9; }
.pwa-ios-steps i { color: var(--brand); }
.pwa-ios-note { font-size: .78rem; color: var(--ink-muted); margin: .9rem 0 0; }

/* ---------- ปฏิทินไทย (thai-datepicker.js) และช่องเวลา 24 ชม. ---------- */

.tdp {
    position: absolute;
    z-index: 1080;
    width: 288px;
    max-width: calc(100vw - 16px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .8rem;
    box-shadow: 0 10px 30px rgba(15, 42, 92, .18);
    padding: .6rem;
}
.tdp-head { display: flex; gap: .3rem; align-items: center; margin-bottom: .4rem; }
.tdp-sel { flex: 1; min-width: 0; font-size: .85rem; padding: .2rem .3rem; border: 1px solid var(--line); border-radius: .4rem; background: #fff; }
.tdp-nav { width: 2rem; height: 2rem; border: 0; background: var(--brand-soft); color: var(--brand); border-radius: .4rem; font-size: 1.2rem; line-height: 1; }
.tdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.tdp-dow { font-size: .72rem; color: var(--ink-muted); padding: .2rem 0; font-weight: 600; }
.tdp-day { border: 0; background: transparent; border-radius: .4rem; height: 2.1rem; font-size: .88rem; color: var(--ink); }
.tdp-day:hover { background: var(--brand-soft); }
.tdp-day.is-today { outline: 1px solid var(--accent); }
.tdp-day.is-sel { background: var(--brand); color: #fff; }
.tdp-foot { display: flex; justify-content: space-between; margin-top: .4rem; }
.tdp-foot button { border: 0; background: transparent; color: var(--brand); font-weight: 600; font-size: .85rem; padding: .2rem .4rem; }

.time24 { display: flex; align-items: center; gap: .3rem; }
.time24 select { flex: 1; min-width: 0; }

/* ---------- การ์ดผู้รับงาน (workers.php) ---------- */

.worker-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .9rem;
    padding: .8rem;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.worker-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(15, 42, 92, .1); }
.worker-card-head { display: flex; gap: .7rem; align-items: flex-start; text-decoration: none; color: inherit; }
.worker-card .avatar { width: 3.2rem; height: 3.2rem; flex: none; }
.worker-name { font-weight: 700; font-size: 1rem; color: var(--brand); }
.worker-headline { font-size: .88rem; color: var(--ink); }
.worker-meta { font-size: .78rem; color: var(--ink-muted); }
.worker-card .chip { font-size: .72rem; padding: .15rem .55rem; }
.min-w-0 { min-width: 0; }

/* ---------- ทางเข้าสองฝั่งบนหน้าแรก ---------- */

.entry-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: .9rem; }
@media (min-width: 768px) { .entry-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }

.entry-card {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    background: var(--surface);
    border-radius: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 26px rgba(15, 42, 92, .12);
    border: 2px solid transparent;
    transition: transform .12s ease, border-color .12s ease;
}
.entry-card:hover { transform: translateY(-2px); color: inherit; }
.entry-card.for-worker:hover { border-color: var(--good); }
.entry-card.for-employer:hover { border-color: var(--accent); }
.entry-ico {
    flex: none;
    width: 3rem;
    height: 3rem;
    border-radius: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.entry-card.for-worker .entry-ico { background: var(--good-soft); color: var(--good); }
.entry-card.for-employer .entry-ico { background: #fde8d9; color: var(--accent-dark); }
.entry-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .2rem; }
.entry-card p { font-size: .85rem; color: var(--ink-muted); margin: 0 0 .5rem; line-height: 1.4; }
.entry-go { font-size: .85rem; font-weight: 700; }
.entry-card.for-worker .entry-go { color: var(--good); }
.entry-card.for-employer .entry-go { color: var(--accent-dark); }
