/* ธีมเดียวกับระบบบันทึกชั่วโมงบินและแฟ้มประวัตินักบิน: แถบดำ + เส้นทอง, แดงฝูงบินที่ 6, พื้นขาวนวล
   (ค่าสีคัดลอกจาก tpad-hr.pages.dev 2 ธ.ค. 2569 — ถ้าระบบหลักเปลี่ยนธีม ให้แก้ที่นี่ให้ตรงกัน) */
:root{
  --bg:#faf7f2;--surface:#fff;--sunk:#f4efe8;--ink:#141414;--muted:#5e554e;--faint:#8a8079;--line:#e8e1d9;--line-2:#d9d0c6;
  --accent:#9e1b1f;--accent-ink:#fff;--accent-soft:#fbecec;--gold:#e3b71b;
  --good:#1f7a3d;--good-bg:#e5f3ea;--warn:#7a5c00;--warn-bg:#fbf1c9;--bad:#9e1b1f;--bad-bg:#fbecec;
  --r-ip:#7a5c00;--r-tp:#7a4e33;--r-p:#9e1b1f;--r-cp:#5e554e;--r-ip-bg:#fbf1c9;--r-tp-bg:#f3e8de;--r-p-bg:#fbecec;--r-cp-bg:#efeae4;
  --bar:#121212;--bar-muted:#b9aea3;--line-green:#06c755;
  --shadow:0 1px 2px rgba(20,14,8,.04),0 2px 8px rgba(20,14,8,.04);--shadow-lg:0 12px 40px rgba(20,14,8,.18);
  --font:'Sarabun',Tahoma,'Leelawadee UI',sans-serif;--mono:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;
  --r:12px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0f0e0d;--surface:#1a1816;--sunk:#141210;--ink:#f3efea;--muted:#b5aba2;--faint:#8a8079;--line:#322c27;--line-2:#423a33;
  --accent:#ef6b6f;--accent-ink:#0f0e0d;--accent-soft:#3a1c1e;--gold:#f0c93a;
  --good:#6fcf8f;--good-bg:#17301f;--warn:#f0c93a;--warn-bg:#2e2716;--bad:#f28b8e;--bad-bg:#3a1c1e;
  --r-ip:#f0c93a;--r-tp:#d9a985;--r-p:#ef6b6f;--r-cp:#b5aba2;--r-ip-bg:#2e2716;--r-tp-bg:#2a211b;--r-p-bg:#3a1c1e;--r-cp-bg:#26221f;
  --bar:#0a0a0a;--shadow:none;--shadow-lg:0 12px 40px rgba(0,0,0,.6);color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0f0e0d;--surface:#1a1816;--sunk:#141210;--ink:#f3efea;--muted:#b5aba2;--faint:#8a8079;--line:#322c27;--line-2:#423a33;
  --accent:#ef6b6f;--accent-ink:#0f0e0d;--accent-soft:#3a1c1e;--gold:#f0c93a;
  --good:#6fcf8f;--good-bg:#17301f;--warn:#f0c93a;--warn-bg:#2e2716;--bad:#f28b8e;--bad-bg:#3a1c1e;
  --r-ip:#f0c93a;--r-tp:#d9a985;--r-p:#ef6b6f;--r-cp:#b5aba2;--r-ip-bg:#2e2716;--r-tp-bg:#2a211b;--r-p-bg:#3a1c1e;--r-cp-bg:#26221f;
  --bar:#0a0a0a;--shadow:none;--shadow-lg:0 12px 40px rgba(0,0,0,.6);color-scheme:dark}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.65 var(--font);-webkit-font-smoothing:antialiased}
h1,h2,h3{text-wrap:balance;margin:0;line-height:1.3}
h1{font-size:1.55rem;font-weight:700;letter-spacing:-.01em}
a{color:var(--accent)}
.mono,.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.wrap{max-width:1120px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:20px}

/* ---------- แถบบน ---------- */
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);background:var(--bar);z-index:21}
.bar{background:var(--bar);color:#fff;border-bottom:2px solid var(--gold);position:sticky;top:env(safe-area-inset-top,0px);z-index:20}
.bar .wrap{display:flex;align-items:center;gap:12px;min-height:60px;padding-top:8px;padding-bottom:8px}
.bar img{display:block;flex:none}
.bar .sep{width:1px;height:28px;background:var(--bar-muted);opacity:.4}
.bar .home{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none!important;margin-right:auto;min-width:0;border-radius:8px}
.bar .home:hover .nm b{color:var(--gold)}
.bar .home:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.bar .nm{line-height:1.25;min-width:0}
.bar .nm b{display:block;letter-spacing:.02em;font-size:.98rem}
.bar .nm span{display:block;font-size:.76rem;color:var(--bar-muted)}
@media (max-width:560px){.bar .nm span{display:none}h1{font-size:1.3rem}}

/* ปุ่มสลับโหมดสี (แบบเดียวกับระบบบันทึกชั่วโมงบิน) */
#themeBtn{flex:none;padding:0;border:0;background:none;min-height:36px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;cursor:pointer;-webkit-tap-highlight-color:transparent}
#themeBtn .tk{position:relative;display:block;width:56px;height:30px;border-radius:999px;background:#5b8fd6;border:1px solid #ffffff55;box-shadow:inset 0 1px 3px #0005;transition:background-color .45s ease}
#themeBtn[aria-checked="true"] .tk{background:#1d2340;border-color:#ffffff40}
#themeBtn .ti{position:absolute;top:7px;width:14px;height:14px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;opacity:.75;transition:opacity .3s}
#themeBtn .ti.sun{left:8px}
#themeBtn .ti.moon{right:8px;fill:#fff;stroke:none}
#themeBtn .kn{position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#ffd34d;box-shadow:0 1px 3px #0006,0 0 10px #ffd34d99;transform:translateX(26px);transition:transform .45s cubic-bezier(.4,0,.2,1),background-color .45s ease}
#themeBtn .ki{position:absolute;inset:4px;width:16px;height:16px;transition:opacity .3s,transform .45s}
#themeBtn .ki.sun{fill:none;stroke:#8a5a00;stroke-width:2.2;stroke-linecap:round}
#themeBtn .ki.moon{fill:#4b5275;opacity:0;transform:rotate(-60deg)}
#themeBtn[aria-checked="true"] .kn{transform:translateX(0);background:#e6e9f5;box-shadow:0 1px 3px #0008,0 0 8px #c7d2fe66}
#themeBtn[aria-checked="true"] .ki.sun{opacity:0;transform:rotate(60deg)}
#themeBtn[aria-checked="true"] .ki.moon{opacity:1;transform:none}
#themeBtn[aria-checked="true"] .ti.moon,#themeBtn[aria-checked="false"] .ti.sun{opacity:0}
#themeBtn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
@media (prefers-reduced-motion:reduce){#themeBtn *{transition:none!important}}
