/* Central theme: near-black, quiet, expensive. White text carries the page; red only marks the one thing to press
   (primary button, current tab, focus). Status colours are muted and used for small marks, never big fills.
   Explanations are hidden behind ⓘ / focus and decisions go through a small dialog — keep pages calm.
   Every page links this file; page-specific CSS goes in the page. */
/* one family per @import: if one fails to load the others still do */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&display=swap");
/* Google Sans has its own Thai glyphs — pin Thai characters to Noto Sans Thai Looped (variable file, Thai range only) */
@font-face {
  font-family: "Central Thai"; font-weight: 400 700; font-display: swap;
  src: url("https://fonts.gstatic.com/s/notosansthailooped/v16/B50iF6pOpWTRcGrhOVJJ3-oPfY7WQuFu5R36MIjwurFMX_p0KVmQBWnPNGrg.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  /* same palette as One Click (AP Pay 1 Click/public/index.html) so both tools look like one product */
  --bg: #08080a; --panel: #111114; --panel-2: #16161a; --raised: rgba(255, 255, 255, .035); --field: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .14); --edge: rgba(255, 255, 255, .06);
  --text: #ffffff; --muted: #a9a9b3; --faint: #74747e;
  --neon: #ff3b30; --neon-deep: #d92d23; --neon-soft: rgba(255, 59, 48, .12); --neon-line: rgba(255, 59, 48, .4);
  --glow: 0 0 0 1px var(--line-strong), 0 16px 48px rgba(0, 0, 0, .7);
  --green: #30d158; --amber: #ff9f0a; --red: #ff453a; --blue: #64d2ff;
  --radius: 14px;
  /* English + numbers in Google Sans, Thai in Noto Sans Thai Looped. No monospace. */
  --font: "Central Thai", "Google Sans", "Google Sans Flex", "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 14.5px/1.6 var(--font); min-height: 100vh;
  background: radial-gradient(1200px 500px at 50% -260px, rgba(255, 59, 48, .06), transparent 70%), var(--bg);
}
main { max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; }
@media (max-width: 600px) { main { padding: 0 16px 56px; } }

/* top bar: logo · tabs · status/user — sticky and frosted */
header {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 18px; align-items: center;
  margin: 0 -24px 28px; padding: 10px 24px; border-bottom: 1px solid rgba(255, 59, 48, .28);
  background: rgba(8, 8, 10, .84); backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px);
}
@media (max-width: 600px) { header { margin: 0 -16px 20px; padding: 8px 16px; gap: 10px; flex-wrap: wrap; } }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; }
/* banner has a black backdrop: crop to the artwork and let "screen" drop the black into the page */
.brand img { display: block; height: 40px; aspect-ratio: 4.6; width: auto; object-fit: cover; mix-blend-mode: screen; }
@media (max-width: 600px) { .brand img { height: 32px; } }
.head-end { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
h1 { font-size: 22px; font-weight: 600; margin: 0; color: #fff; }
.tagline { font-size: 11px; letter-spacing: .16em; color: var(--muted); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; display: flex; gap: 8px; align-items: center; color: #fff; }
/* page title like One Click: short red bar + one-line subtitle under it */
h2.title { font-size: 20px; font-weight: 600; gap: 10px; margin: 0 0 4px; }
h2.title::before { content: ""; width: 3px; height: 20px; border-radius: 2px; background: var(--neon); flex: none; }
.panel > h2.title { font-size: 16px; margin-bottom: 4px; } .panel > h2.title::before { height: 16px; }
.sub { margin: 0 0 18px 13px; font-size: 12.5px; color: var(--muted); }
/* red-edged notice (One Click "มีตัวช่วยนำทาง") */
.notice { border: 1px solid var(--neon-line); background: rgba(255, 59, 48, .05); border-radius: 12px; padding: 12px 16px; font-size: 13px; color: var(--text); margin-bottom: 16px; }
.notice b { color: var(--neon); }
/* search & filter row: fields in a line, buttons at the end */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
/* type chips in tables: ฝาก green · ถอน red · others grey */
.type { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 6px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.type.in { color: var(--green); background: rgba(48, 209, 88, .1); border-color: rgba(48, 209, 88, .25); }
.type.out { color: var(--red); background: rgba(255, 69, 58, .1); border-color: rgba(255, 69, 58, .25); }
h3 { font-size: 13px; margin: 22px 0 8px; color: var(--muted); font-weight: 500; }

.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.on::before { background: var(--green); }
.badge.warn::before { background: var(--amber); }
.badge.bad::before { background: var(--red); }

button { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 15px; font: inherit; font-weight: 500; cursor: pointer; background: transparent; color: var(--text); transition: background .15s, border-color .15s, color .15s, transform .05s; }
button:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .24); }
button:active { transform: scale(.98); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--neon-soft); border-color: var(--neon); }
button.primary { border-color: transparent; background: var(--neon); color: #fff; font-weight: 600; }
button.primary:hover { background: #ff5147; }
button.danger { border-color: rgba(255, 107, 97, .45); color: var(--red); }
button.danger:hover { background: rgba(255, 107, 97, .1); }
button.ghost { border-color: transparent; color: var(--muted); }
button.ghost:hover { color: #fff; background: rgba(255, 255, 255, .06); }
button:disabled { opacity: .45; cursor: default; }
button.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }

input, select, textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; font: inherit; color-scheme: dark; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
select option, select optgroup { background: #141418; color: var(--text); }
select option:checked { background: var(--neon); color: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-soft); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }

/* tables: white on black, grey header, readable on a phone (scroll sideways, first column stays) */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; color: #fff; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { color: var(--faint); font-weight: 500; font-size: 12px; background: var(--panel-2); position: sticky; top: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .015); }
tbody tr:hover td { background: rgba(255, 255, 255, .04); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.table-wrap table tr:last-child td { border-bottom: 0; }
@media (max-width: 700px) {
  th, td { padding: 9px 10px; font-size: 13px; }
  .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel-2); box-shadow: 1px 0 0 var(--line); }
}

.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.ok { color: var(--green); } .warn { color: var(--amber); } .bad { color: var(--red); }
::selection { background: rgba(255, 59, 48, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── hide, then show ── */
/* field hints appear only while you are in that field */
.hint { display: block; font-size: 12px; color: var(--faint); line-height: 1.45; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .2s, opacity .2s, margin .2s; }
:focus-within > .hint, .hint.keep { max-height: 80px; opacity: 1; margin-top: 5px; }
/* ⓘ next to a heading: click to read the explanation */
.info { width: 20px; height: 20px; padding: 0; border-radius: 50%; font-size: 11px; font-weight: 600; line-height: 1; color: var(--faint); border-color: var(--line-strong); flex: none; }
.info:hover, .info.on { color: #fff; border-color: var(--muted); background: transparent; }
.pop {
  position: absolute; z-index: 40; max-width: min(380px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 12px;
  background: #16161b; border: 1px solid var(--line-strong); box-shadow: var(--glow); font-size: 13px; color: var(--muted); line-height: 1.55;
  animation: pop-in .14s ease-out;
}
.pop b { color: #fff; font-weight: 500; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
/* dropdown menu (user menu, alerts) */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: 12px; background: #16161b; border: 1px solid var(--line-strong); box-shadow: var(--glow); z-index: 40; animation: pop-in .14s ease-out; }
.menu > button { display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.menu .menu-label { padding: 6px 10px 8px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
/* confirm dialog */
.dialog-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .15s; }
.dialog { width: min(420px, 100%); background: #111115; border: 1px solid var(--line-strong); border-radius: 16px; padding: 22px; box-shadow: var(--glow); animation: pop-in .16s ease-out; }
.dialog h4 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #fff; display: flex; gap: 10px; align-items: center; }
.dialog h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.dialog.danger h4 i { background: var(--red); }
.dialog p { margin: 0; color: var(--muted); font-size: 13.5px; }
.dialog input { margin-top: 14px; text-align: center; letter-spacing: .3em; font-size: 18px; }
.dialog .row { justify-content: flex-end; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
