:root {
  --bg: #0E1014; --surface: #171A21; --surface2: #12151B; --line: #262A33; --line2: #333845;
  --fg: #F4F5F7; --muted: #AEB4C0; --dim: #8A91A0;
  --accent: #FE2C55; --accent-ink: #fff; --cyan: #25F4EE;
  --ok-bg: #0F2A2A; --ok: #7FF5F1; --warn-bg: #2C2410; --warn: #FFD27A; --bad-bg: #2A1219; --bad: #FF8BA0;
  --free: #2BD47D; --busy: #F0445E; --boot: #F2B43C;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: 'IBM Plex Sans Thai', system-ui, sans-serif; font-size: 15px; line-height: 1.6; }
a { color: var(--cyan); text-decoration: none; } a:hover { color: #9FFBF8; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
img { max-width: 100%; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .dim { color: var(--dim); font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2, .grid3, .grid4 { display: grid; gap: 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.hl { border-color: var(--accent); }
.card h3 { font-size: 17px; }
.big { font-size: 26px; font-weight: 700; }
.lbl { font-size: 13px; color: var(--dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line2); background: transparent; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: #4A5060; color: var(--fg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.cyan { background: var(--cyan); border-color: var(--cyan); color: #0E1014; }
.btn.danger { color: var(--bad); border-color: #4A2530; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

input, textarea, select { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: #0F1116; color: var(--fg); padding: 10px 12px; font: inherit; }
textarea { resize: vertical; }
label { font-size: 13.5px; color: var(--muted); display: block; margin-bottom: 4px; }
.field { display: flex; flex-direction: column; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.gray { background: #22242B; color: var(--muted); }
.pill.live { background: var(--accent); color: #fff; }

.flash { padding: 12px 16px; border-radius: 12px; font-size: 14.5px; }
.flash.ok { background: var(--ok-bg); color: #CFFBF9; } .flash.err { background: var(--bad-bg); color: #FFD7DF; }

.tblwrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--dim); font-weight: 500; padding: 10px; border-bottom: 1px solid #2C313B; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #22262E; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
.plus { color: var(--ok); } .minus { color: var(--bad); }

/* โครงหน้าสมาชิก/แอดมิน: เมนูซ้าย + เนื้อหา (มือถือ: เมนูขึ้นบน) */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 250px; padding: 18px 12px; border-right: 1px solid #1F232B; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 15px; }
.side a:hover { color: var(--fg); background: #161920; }
.side a.on { background: #1E222B; color: var(--fg); }
.side .who { margin-top: auto; padding: 12px 14px 0; font-size: 13px; color: var(--dim); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 760px) {
  .side { max-width: none; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #1F232B; }
  .side .who { margin: 0; width: 100%; }
  .main { padding: 18px 16px; }
}
.chsel { padding: 0 6px 12px; margin-bottom: 6px; border-bottom: 1px solid #1F232B; }
.chsel label { padding: 0 8px; font-size: 12.5px; color: var(--dim); }
@media (max-width: 760px) { .chsel { width: 100%; border: 0; } }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid #22262E; font-size: 15px; color: var(--fg); margin: 0; cursor: pointer; }
.toggle input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; }
.toggle small { display: block; color: var(--dim); font-size: 12.5px; }
.plist a.prow { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; color: var(--fg); border: 1px solid transparent; }
.plist a.prow:hover { background: #1B1F27; }
.plist a.prow.on { background: #1E222B; border-color: var(--line2); }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #262A33; flex: none; }
.bag { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.bag.off { background: #333845; color: var(--muted); }
.phone { aspect-ratio: 9 / 16; width: 100%; max-width: 300px; border-radius: 18px; background: #23262E center / cover no-repeat; position: relative; overflow: hidden; border: 1px solid var(--line2); }
.phone .person { position: absolute; left: 50%; bottom: 0; width: 70%; height: 70%; background: #3B404C; border-radius: 45% 45% 10px 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; transform-origin: bottom center; }
.phone .sticker { position: absolute; right: 7%; top: 22%; padding: 6px 10px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; max-width: 45%; }
.phone .clock { position: absolute; left: 7%; top: 5%; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
input[type=range] { min-height: 0; padding: 0; accent-color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); padding: 4px 10px 16px; }
.mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.pagehead h1 { font-size: 28px; }

/* เครื่องไลฟ์: จอคอม + ขีดที่ว่าง */
.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.machine { align-items: center; text-align: center; }
.slots { display: flex; gap: 6px; width: 100%; }
.slot { flex: 1; height: 10px; border-radius: 99px; }
.slot.free { background: var(--free); } .slot.busy { background: var(--busy); } .slot.mine { background: var(--busy); outline: 2px solid var(--fg); outline-offset: 2px; } .slot.boot { background: var(--boot); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 20px; height: 8px; border-radius: 99px; margin-right: 6px; vertical-align: middle; }

/* หน้า Landing */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
.top nav { display: flex; gap: 24px; } .top nav a { color: var(--muted); } .top nav a:hover { color: var(--fg); }
@media (max-width: 760px) { .top nav { display: none; } }
.hero { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; padding: 48px 0 64px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.sec { padding: 56px 0; border-top: 1px solid #1C1F27; display: flex; flex-direction: column; gap: 22px; }
.sec h2 { font-size: clamp(24px, 4vw, 32px); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--accent); }
.step { font-size: 28px; font-weight: 700; color: var(--accent); }
.check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check li { padding-left: 26px; position: relative; color: var(--muted); }
.check li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 10px; height: 6px; border-left: 2px solid var(--free); border-bottom: 2px solid var(--free); transform: rotate(-45deg); }
.check.no li::before { width: 12px; height: 2px; border: 0; background: var(--boot); top: 12px; transform: none; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
details summary { cursor: pointer; font-weight: 600; min-height: 28px; }
details p { margin-top: 10px; color: var(--muted); }
footer { border-top: 1px solid #1C1F27; padding: 28px 0 48px; color: var(--dim); font-size: 13px; }
