/* ระบบแผนงานและติดตามงบประมาณโครงการ — CSS เฉพาะระบบ (สีเน้นใช้ตัวแปรธีม --ac*) */
.gate { min-height: 100vh; min-height: 100dvh; padding: 24px 16px; display: grid; place-items: center; background: var(--page-bg, #f3f5fb); }
.gate-card { width: min(640px, 100%); border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.gate-head { padding: 26px 24px 20px; color: #fff; background: linear-gradient(135deg, var(--hero-1), var(--ac) 60%, var(--ac-2)); display: flex; gap: 14px; align-items: center; }
.gate-head .ic { width: 54px; height: 54px; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; background: rgba(255,255,255,.18); flex: 0 0 auto; }
.gate-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; } .gate-head p { margin: 2px 0 0; opacity: .9; font-size: .9rem; }
.gate-body { padding: 20px 24px 24px; color: var(--ink-2); line-height: 1.7; } .gate-body ol { padding-left: 20px; }
.txt-h { font-weight: 800; color: var(--ac-ink); margin: 6px 0 8px; display: flex; gap: 8px; align-items: center; }

/* หน้าเข้าสู่ระบบ: การ์ด 2 ฝั่ง */
.login-page { background: radial-gradient(circle at 10% 10%, var(--ac-soft), transparent 40%), var(--page-bg, #f3f5fb); }
.lg-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.lg-card { width: min(1020px, 100%); display: grid; grid-template-columns: 41fr 59fr; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 30px 70px -30px rgba(8,62,44,.35); border: 1px solid var(--line); }
.lg-side { position: relative; padding: 40px 36px; color: #fff; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(circle at 75% 15%, rgba(255,255,255,.2), transparent 45%), linear-gradient(150deg, var(--hero-1), var(--ac) 55%, var(--ac-2)); }
.lg-side::after { content: ''; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.lg-ic { width: 60px; height: 60px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); }
.lg-side h1 { font-size: 1.7rem; font-weight: 800; line-height: 1.35; margin: 22px 0 10px; }
.lg-desc { opacity: .92; line-height: 1.7; margin: 0 0 26px; }
.lg-feat { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }
.lg-feat li { display: flex; gap: 12px; align-items: flex-start; }
.lg-feat li > span { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); }
.lg-feat b { display: block; font-size: .98rem; } .lg-feat small { display: block; opacity: .86; font-size: .84rem; }
.lg-main { padding: 44px 44px 36px; }
.lg-main h2 { font-size: 1.9rem; font-weight: 800; margin: 0; color: var(--ink, #0f172a); }
.lg-org { color: #64748b; margin: 2px 0 24px; }
.lg-in { position: relative; margin-bottom: 18px; }
.lg-in > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.lg-in .form-control { min-height: 50px; padding-left: 44px; padding-right: 48px; border-radius: 14px; }
.lg-in .form-control:focus { border-color: var(--ac); box-shadow: 0 0 0 4px var(--ac-soft); }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: #94a3b8; border-radius: 10px; cursor: pointer; }
.lg-btn { width: 100%; min-height: 54px; border: 0; border-radius: 16px; color: #fff; font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  background: linear-gradient(90deg, var(--ac), var(--ac-2)); box-shadow: 0 14px 28px -12px var(--ac); }
.lg-btn:hover { filter: brightness(1.06); }
.demo-accts { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 8px; }
.demo-acct { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; text-align: left; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.demo-acct:hover, .demo-acct.on { border-color: var(--ac); background: var(--ac-soft); }
.demo-acct > i { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--ac), var(--ac-2)); flex: 0 0 auto; }
.demo-acct b { display: block; font-size: .86rem; color: var(--ink); } .demo-acct small { display: block; font-size: .72rem; color: #64748b; }
@media (max-width: 767.98px) {
  .lg-wrap { padding: 0; place-items: stretch; }
  .lg-card { grid-template-columns: 1fr; border-radius: 0; border: 0; min-height: 100dvh; box-shadow: none; align-content: start; }
  .lg-side { padding: 22px 20px 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .lg-side .lg-ic { width: 46px; height: 46px; font-size: 1.25rem; }
  .lg-side h1 { font-size: 1.12rem; margin: 0; flex: 1 1 200px; }
  .lg-desc, .lg-feat { display: none; }
  .lg-main { padding: 24px 20px 32px; } .lg-main h2 { font-size: 1.5rem; }
}

/* เมนู/แถบบน */
.sb-user { display: flex; gap: 10px; align-items: center; color: #fff; padding: 4px 8px 10px; }
.sb-user .av { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.sb-user b { display: block; font-size: .88rem; line-height: 1.3; } .sb-user small { opacity: .8; font-size: .74rem; }
.sb-foot form button.sb-link { border: 0; background: none; text-align: left; }
.tb-year { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--ac-soft); color: var(--ac-ink); font-weight: 800; font-size: .82rem; border: 1px solid var(--ac-line); white-space: nowrap; }

/* ส่วนประกอบเฉพาะระบบ */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.panel { margin-bottom: 18px; }
.panel-body { padding: 16px 18px; }
.bbar { display: flex; height: 9px; min-width: 90px; border-radius: 99px; background: #e9eef5; overflow: hidden; }
.bbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ac), var(--ac-2)); }
.bbar i.rs { background: #FF9F0A; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dt td.num, .dt th.num { text-align: right; }
.muted { color: var(--muted, #64748b); }
.small-note { font-size: .82rem; color: var(--muted, #64748b); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.qchart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; height: 230px; padding: 10px 6px 0; border-bottom: 2px solid var(--line); }
.qcol { display: flex; gap: 6px; align-items: end; justify-content: center; height: 100%; position: relative; }
.qcol .b { width: min(38px, 40%); border-radius: 8px 8px 0 0; position: relative; min-height: 2px; }
.qcol .b.pl { background: #cbd5e1; } .qcol .b.ac { background: linear-gradient(180deg, var(--ac-2), var(--ac)); }
.qcol .b span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 800; white-space: nowrap; color: var(--ink); }
.qlabels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding-top: 6px; }
.big-pct { font-size: 2.6rem; font-weight: 800; color: var(--ac-ink); line-height: 1; }
.ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(var(--ac) calc(var(--p) * 1%), #e9eef5 0); display: grid; place-items: center; margin: 0 auto; }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.ring b { font-size: 1.6rem; font-weight: 800; color: var(--ac-ink); display: block; line-height: 1.1; } .ring small { font-size: .72rem; color: var(--muted); }
.src-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.src-row:last-child { border-bottom: 0; }
.src-row .bbar { grid-column: 1 / -1; }
.strat-h td { background: var(--ac-soft) !important; color: var(--ac-ink); font-weight: 800; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .form-select, .filters .form-control { width: auto; min-width: 160px; max-width: 100%; }
.ph-wrap { position: relative; }
.ph-btn { position: absolute; right: 8px; top: -34px; }
.fld-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 6px; }
.fld-h .form-label { margin: 0; }
.ph-list { text-align: left; max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.ph-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; line-height: 1.55; }
.ph-list label:has(input:checked) { border-color: var(--ac); background: var(--ac-soft); }
.ph-list input { margin-top: 5px; accent-color: var(--ac); flex: 0 0 auto; }
.act-table input, .act-table select { min-width: 110px; }
.act-table td { vertical-align: middle; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; } .kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; } .steps span { padding: 4px 10px; border-radius: 999px; background: #eef1f6; font-size: .78rem; font-weight: 700; color: var(--muted); }
.steps span.on { background: var(--ac); color: #fff; } .steps span.done { background: var(--ac-soft); color: var(--ac-ink); }
.doc-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.doc-card h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; } .doc-card p { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.pre { white-space: pre-line; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-row td { background: #fff7ed !important; }
@media (max-width: 575.98px) { .qchart { height: 190px; gap: 6px; } .filters .form-select, .filters .form-control { min-width: 0; flex: 1 1 140px; } .kv { grid-template-columns: 1fr; } }
@media print { html.vs-demo body > .vsd-wm { display: block !important; } }
