:root {
  --night: #0B0F2E; --night2: #141A45; --ink: #0D1233; --lime: #C8F31D; --mint: #3CF0C8; --sky: #5FC8FF; --blue: #2440F0;
  --bg: #F4F6FB; --card: #fff; --line: #E2E6F0; --muted: #5B6180; --on-night: #E8ECFF; --on-night-muted: #AEB6E0;
  --ok: #157A52; --ok-bg: #DDF5EA; --warn: #8A5A00; --warn-bg: #FFF1CC; --bad: #B42318; --bad-bg: #FDE3E0; --info: #1F3BBF; --info-bg: #E2E8FF;
  --grad: linear-gradient(90deg, #C8F31D, #3CF0C8, #5FC8FF, #2440F0);
  --r: 14px; --r-lg: 20px;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
html, body { margin: 0 }
body { font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column }
h1, h2, h3, .btn, .kicker, .brand span, .big-price, .stat b { font-family: Lexend, "Be Vietnam Pro", sans-serif; line-height: 1.2 }
h1, h2, h3 { margin: 0 }
p { margin: 0 }
a { color: var(--blue) }
[hidden] { display: none !important }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px }
.muted { color: var(--muted) } .small { font-size: 14px }
.show-xs { display: none }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 20px;
  font-weight: 700; font-size: 16px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; min-height: 46px; text-align: center }
.btn:hover { filter: brightness(1.12) }
.btn:disabled { opacity: .55; cursor: wait }
.btn.big { font-size: 17px; padding: 14px 24px; min-height: 54px }
.btn.sm { font-size: 14px; padding: 7px 14px; min-height: 38px }
.btn.lime { background: var(--lime); color: var(--ink) }
.btn.light { background: #fff; color: var(--ink) }
.btn.outline { background: transparent; color: var(--on-night); box-shadow: inset 0 0 0 2px rgba(232,236,255,.45) }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line) }
.btn.danger { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad-bg) }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--night); color: var(--on-night); display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08) }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-night) }
.brand img { height: 26px; width: auto }
.brand span { font-weight: 600; font-size: 17px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25) }
.top-r { display: flex; align-items: center; gap: 10px }
.top-r .btn { white-space: nowrap }
.soon { display: inline-flex; align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,.3); color: rgba(255,255,255,.7); border-radius: 999px; padding: 6px 14px; font: 600 14px/1.2 Lexend, sans-serif; cursor: default; white-space: nowrap }
.soon i { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 3px 8px }
.lnk { color: var(--on-night-muted); text-decoration: none; font-weight: 500; font-size: 15px }
.lnk:hover { color: #fff }

/* login */
.login-sec { padding: 48px 16px 64px; display: grid; place-items: center; flex: 1 }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 24px; display: flex; flex-direction: column; gap: 8px }
.login-card h2 { font-size: 26px }
.login-card label { font-weight: 600; font-size: 14px; margin-top: 6px }
.login-card input { font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; width: 100% }
.login-card input:focus { border-color: var(--blue); outline: none }
.login-card .btn { margin-top: 12px }
.btn.google { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); margin-top: 8px }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 10px 0 2px }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line) }
.pending { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px }
.pending .book { grid-template-columns: 1fr }
.welcome { text-align: left }
.welcome h1 { font-size: 28px }
.ok-badge { width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 28px; font-weight: 800; animation: pop .6s cubic-bezier(.2,1.4,.4,1) both }
.intro { background: var(--night); color: var(--on-night); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px }
.intro h2 { color: #fff; font-size: 20px } .intro .muted { color: var(--on-night-muted) } .intro .when { font-weight: 600; color: #fff }
.intro label { color: var(--on-night-muted) } .intro .acts { display: flex; flex-wrap: wrap; gap: 8px }
@keyframes pop { from { transform: scale(.4); opacity: 0 } }
.msg { color: var(--bad); min-height: 1.4em; font-size: 14px }

/* dashboard */
.dash { flex: 1; padding: 24px 0 56px }
.dash .wrap { display: flex; flex-direction: column; gap: 18px }
.hello h1 { font-size: 28px }
.call { background: var(--night); color: var(--on-night); border-radius: var(--r-lg); padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; overflow: hidden }
.call::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--grad) }
.call h2 { font-size: 20px; color: #fff }
.call p { color: var(--on-night-muted); font-size: 15px; margin-top: 4px }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.stat span { color: var(--muted); font-size: 13px }
.stat b { font-size: 24px; font-variant-numeric: tabular-nums }
.stat.owe b { color: var(--bad) }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.panel h2 { font-size: 18px }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.book label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--muted) }
.book .full { grid-column: 1 / -1 }
.book input, .book select, .book textarea { font: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; width: 100% }
.book textarea { min-height: 80px; resize: vertical }
.blist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px }
.blist li { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px }
.blist .when { font-weight: 600 }
.blist .acts { display: flex; flex-wrap: wrap; gap: 8px }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #EEF0F6; white-space: nowrap; align-self: flex-start }
.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.info { background: var(--info-bg); color: var(--info) }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r) }
table { width: 100%; border-collapse: collapse; font-size: 15px }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top }
tr:last-child td { border-bottom: 0 }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.empty { color: var(--muted); padding: 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r) }

/* footer */
.foot { background: var(--night); color: var(--on-night-muted); padding: 22px 0; font-size: 14px }
.foot .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap }
.foot b { color: #fff }
.foot a { color: var(--on-night) }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px) }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr } .stats { grid-template-columns: 1fr 1fr }
}
@media (max-width: 600px) {
  .hide-xs { display: none }
  .show-xs { display: block }
  .book { grid-template-columns: 1fr }
  .call .btn { width: 100% }
  .brand span { font-size: 15px; padding-left: 8px } .brand img { height: 22px } .soon i { display: none } .soon { padding: 5px 9px; font-size: 12px } .top { padding: 10px 12px } .top-r { gap: 6px } .top-r .btn.sm { padding: 7px 12px; font-size: 13px } .brand { gap: 7px } .brand span { font-size: 14px; padding-left: 7px }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } * { transition: none !important; animation: none !important } }
