/* ธีมสีของ OANPGS — โหลดท้ายสุดในทุกหน้า (layouts/app) */
:root {
    --c-forest: #14532d; --c-green: #1f7a3a; --c-leaf: #4caf50; --c-lime: #9ccc3c;
    --c-teal: #0f8b8d; --c-sky: #2f80c9; --c-amber: #e89a10; --c-berry: #b8467a;
    --accent: var(--c-leaf);
    --ink: #1d2b1f; --muted: #5c6b5e;
}
body { color: var(--ink); background: #f3f7f0 radial-gradient(1200px 380px at 10% -80px, #dff1d6 0, transparent 70%) no-repeat,
       radial-gradient(900px 340px at 95% -60px, #d5efee 0, transparent 70%) no-repeat; background-color: #f3f7f0; }

/* ---------- แถบบน ---------- */
.navbar-oan { background: linear-gradient(100deg, #124a28 0%, #1f7a3a 45%, #13858a 100%) !important; box-shadow: 0 2px 10px rgba(12, 60, 30, .25); }
.navbar-oan .navbar-brand { display: flex; align-items: center; gap: .55rem; }
.navbar-oan .brand-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.4); vertical-align: middle; }
.navbar-oan .brand-mark { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #b7e36a, #4caf50); display: grid; place-items: center; font-size: 17px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.btn-menu { border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 10px; padding: .3rem .6rem; display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.08); }
.btn-menu:hover, .btn-menu:focus-visible { background: rgba(255,255,255,.2); color: #fff; }
.btn-menu .bars { width: 18px; height: 2px; background: currentColor; position: relative; display: inline-block; border-radius: 2px; }
.btn-menu .bars::before, .btn-menu .bars::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.btn-menu .bars::before { top: -6px; } .btn-menu .bars::after { top: 6px; }
.page-chip { font-size: .8rem; background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; padding: .15rem .65rem; white-space: nowrap; }

/* ---------- เมนูข้าง ---------- */
.side-menu { --bs-offcanvas-width: 300px; background: #fbfdf9; }
.side-menu .offcanvas-header { background: linear-gradient(120deg, #155c2a, #1f7a3a 55%, #13858a); color: #fff; }
.side-section { padding: .6rem .6rem .4rem; border-bottom: 1px solid #e6ede3; }
.side-title { font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--sec); padding: .2rem .55rem .35rem; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: .42rem .55rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.side-link:hover { background: color-mix(in srgb, var(--sec) 10%, #fff); color: var(--ink); }
.side-link.active { background: var(--sec); color: #fff; font-weight: 600; }
.side-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: color-mix(in srgb, var(--sec) 14%, #fff); flex-shrink: 0; }
.side-link.active .side-icon { background: rgba(255,255,255,.22); }
.side-leaf { --sec: #2e8b3e; } .side-teal { --sec: #0f7f86; } .side-amber { --sec: #c27c00; } .side-sky { --sec: #2f73b5; } .side-berry { --sec: #a8406f; }

/* ---------- หัวข้อหน้า ---------- */
main h1 { color: var(--c-forest); }
main > h1::after, main .d-flex > h1::after, main .d-flex > div > h1::after, main .card-body > h1::after {
    content: ''; display: block; width: 54px; height: 4px; border-radius: 3px; margin-top: .4rem;
    background: linear-gradient(90deg, var(--c-leaf), var(--c-teal), var(--c-amber)); }
main h2.h5, main h2.h6.text-success, .dash-card h2 { color: var(--c-forest) !important; }

/* ---------- การ์ด: แถบสีด้านบนหมุนเวียนตามคอลัมน์ ---------- */
.row > :nth-child(6n+2) { --accent: var(--c-teal); }
.row > :nth-child(6n+3) { --accent: var(--c-amber); }
.row > :nth-child(6n+4) { --accent: var(--c-sky); }
.row > :nth-child(6n+5) { --accent: var(--c-berry); }
.row > :nth-child(6n+6) { --accent: var(--c-lime); }
.card-oan, .card-site, .dash-card, .trace-card {
    border: 0 !important; border-radius: 14px !important; background: #fff;
    box-shadow: inset 0 4px 0 var(--accent), 0 2px 10px rgba(20, 70, 35, .07) !important; }
.post-card { box-shadow: 0 2px 10px rgba(20, 70, 35, .08) !important; }
.post-card:hover { box-shadow: 0 6px 18px rgba(20, 70, 35, .16) !important; }

/* ตัวเลขหลัก (KPI) เป็นการ์ดสีพาสเทลคนละสี */
.kpi, .dash-kpi {
    background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 13%, #fff), #fff 75%) !important;
    box-shadow: inset 4px 0 0 var(--accent), 0 2px 10px rgba(20, 70, 35, .07) !important; border-radius: 14px !important; }
.kpi .v { color: color-mix(in srgb, var(--accent) 70%, #0b2a14) !important; }

/* hero หน้าแรก */
.hero h1 { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.hero { background: linear-gradient(120deg, #155c2a 0%, #1f7a3a 35%, #2a9a4a 65%, #13858a 100%) !important; box-shadow: 0 8px 24px rgba(15, 80, 40, .25); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(183, 227, 106, .35), transparent 70%); pointer-events: none; }

/* ---------- ตาราง ---------- */
.table > thead > tr > th, .table thead th { background: #e8f4e3; color: #25553a; border-bottom-color: #cfe5c7; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f1f8ee; }
.table-light, .table-light > th { --bs-table-bg: #e8f4e3; }

/* ---------- ปุ่ม ---------- */
.btn-oan { background: linear-gradient(120deg, #1f7a3a, #2a9a4a) !important; border: 0 !important; color: #fff !important; box-shadow: 0 2px 6px rgba(31, 122, 58, .3); }
.btn-oan:hover, .btn-oan:focus-visible { background: linear-gradient(120deg, #17652f, #13858a) !important; color: #fff !important; }
.btn-outline-success { --bs-btn-color: #1f7a3a; --bs-btn-border-color: #8cc79a; --bs-btn-hover-bg: #1f7a3a; --bs-btn-hover-border-color: #1f7a3a; }
.nav-tabs .nav-link.active { border-top: 3px solid var(--c-leaf); color: var(--c-forest); font-weight: 600; }
.pagination { --bs-pagination-active-bg: #1f7a3a; --bs-pagination-active-border-color: #1f7a3a; --bs-pagination-color: #1f7a3a; flex-wrap: wrap; }
.form-control:focus, .form-select:focus { border-color: #7cc28a; box-shadow: 0 0 0 .2rem rgba(76, 175, 80, .2); }
.alert-success { background: #e6f5e4; border-color: #bfe3b9; color: #1d5a2d; }
.badge.text-bg-success { background: #1f8a3e !important; }
a { color: #1d7a45; } a:hover { color: #0f8b8d; }
.navbar a, .side-link, .btn, .page-link, .hero a { text-decoration: none; }

/* ---------- ส่วนท้าย ---------- */
.site-footer { background: linear-gradient(100deg, #10391f, #155c2a 55%, #0e5f62); color: rgba(255,255,255,.8); border: 0 !important; }
.site-footer a { color: #c9f0a8; }

@media print {
    body { background: #fff !important; }
    .navbar-oan, .site-footer, .side-menu { display: none !important; }
    .card-oan, .card-site, .dash-card, .trace-card, .kpi, .dash-kpi { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ปุ่มเข้าสู่ระบบด้วย LINE (สีตามแนวทางของ LINE) — claude/consumer-line-login.md */
.btn-line { background: #06C755; border-color: #06C755; color: #fff; font-weight: 600; }
.btn-line:hover, .btn-line:focus { background: #05b34c; border-color: #05b34c; color: #fff; }
.me-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #e9f5ec; }
