@font-face { font-family: Padauk; src: url(/fonts/Padauk-Regular.woff) format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: Padauk; src: url(/fonts/Padauk-Bold.woff) format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-SemiBold.woff) format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-Bold.woff) format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-ExtraBold.woff) format('woff'); font-weight: 800; font-display: swap; }

:root {
  --surface: #FFFFFF; --soft: #F4F8EE; --line: #DCE5D3; --line2: #E8EEE1;
  --ink: #1F2A1C; --muted: #55624F; --action: #2F7420; --on-action: #FFFFFF;
  --green-text: #2F7420; --orange-text: #A84B15; --error: #B3261E; --error-tint: #FBE3E1;
  --ok-tint: #E3F1D8; --info: #1F5FA8; --info-tint: #E3EDF9;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --my: Padauk, 'Noto Sans Myanmar', 'Myanmar Text', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--soft); color: var(--ink); font-family: var(--sans), var(--my); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.my { font-family: var(--my); }
.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: 600; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.h1 { margin: 0; font-size: 22px; line-height: 1.6; font-weight: 700; }
.h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--muted); }
.h2.dark { color: var(--ink); font-size: 16px; }
.h2my { margin: 0; font-size: 19px; line-height: 1.6; font-weight: 700; }

.view { max-width: 560px; margin: 0 auto; padding: 18px 16px 120px; }
.login { min-height: 100vh; display: flex; flex-direction: column; gap: 24px; padding-top: 48px; padding-bottom: 32px; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-logo { width: 220px; height: auto; }
.login-head p { margin: 0; font-weight: 600; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.or span { flex: 1; height: 1px; background: var(--line); }
.foot { margin-top: auto; text-align: center; }
.soon { font-size: 12px; font-weight: 800; background: var(--info-tint); color: var(--info); border-radius: 999px; padding: 3px 10px; margin-left: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=password], input[type=date], input[type=time], input[inputmode=decimal], textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--soft);
  border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 50px; width: 100%;
}
textarea { padding: 12px 14px; font-family: var(--my); font-size: 16px; line-height: 1.7; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
input.pin { font-size: 24px; letter-spacing: 10px; background: var(--surface); }
.error { margin: 0; background: var(--error-tint); color: var(--error); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; }

.btn { font: inherit; font-size: 16px; font-weight: 800; min-height: 52px; border-radius: 999px; border: 2px solid transparent; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--action); color: var(--on-action); }
.btn.primary:disabled { background: var(--line); color: var(--muted); cursor: progress; }
.btn.outline { background: var(--surface); color: var(--action); border-color: var(--action); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:disabled { color: var(--muted); cursor: not-allowed; }
.btn.dashed { background: transparent; border: 1px dashed currentColor; border-radius: 12px; min-height: 44px; font-size: 14px; }
.btn.green { color: var(--green-text); } .btn.orange { color: var(--orange-text); }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn.danger { background: var(--surface); color: var(--error); border: 1px solid var(--error); }
.btn.danger:disabled { opacity: .5; cursor: progress; }
.btn.wide { grid-column: 1 / -1; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-mark { width: 32px; height: auto; }
.topbar-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar-title strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-who { margin: 4px 12px 6px; }
.topbar-nav { display: flex; align-items: center; gap: 6px; position: relative; }
.navlink { min-height: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 800; font-size: 14px; color: var(--action); text-decoration: none; border: 1px solid var(--line); }
.navlink.on { background: var(--action); color: var(--on-action); border-color: var(--action); }
.iconbtn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.menu { position: absolute; right: 0; top: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; min-width: 170px; box-shadow: 0 8px 24px rgba(31, 42, 28, .12); }
.menu button { font: inherit; font-weight: 700; text-align: left; background: none; border: 0; border-radius: 10px; min-height: 44px; padding: 0 12px; cursor: pointer; color: var(--ink); }
.menu button:hover { background: var(--soft); }

.sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.green { background: #6CBD45; } .dot.orange { background: #F68C45; }
.tiers { display: flex; flex-direction: column; }
.tier { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line2); padding: 12px 0; }
.tier:first-child { border-top: 0; }
.tier-top { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
.tier input.tier-name { font-family: var(--my); font-size: 16px; min-height: 46px; }
.tier-calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tier-calc .cell { display: flex; flex-direction: column; gap: 4px; }
.tier-calc label { font-size: 12px; font-weight: 800; color: var(--muted); }
.tier-calc input { text-align: right; font-weight: 800; font-size: 18px; min-height: 46px; padding: 0 10px; background: var(--surface); }
.tier-final { min-height: 46px; display: flex; align-items: center; justify-content: flex-end; padding: 0 10px; border-radius: 12px; background: var(--soft); font-weight: 800; font-size: 20px; }
[data-dir=k2b] .tier-final { color: var(--green-text); } [data-dir=b2k] .tier-final { color: var(--orange-text); }
.tier .per { font-size: 12px; font-weight: 700; margin-top: -2px; }
[data-dir=k2b] .per { color: var(--green-text); } [data-dir=b2k] .per { color: var(--orange-text); }
.rm { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; font-family: var(--sans), var(--my); }
.check input { width: 22px; height: 22px; accent-color: var(--action); }

.preview-canvas, .pv-img { width: 100%; height: auto; border-radius: 14px; display: block; background: #000; }
.sticky-bar { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; text-align: center; }

.badge-ic { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--info-tint); color: var(--info); }
.ok-msg { color: var(--action); } .err-msg { color: var(--error); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.hist { padding: 0; overflow: hidden; }
.hist-top { display: flex; gap: 12px; padding: 16px; }
.hist-top img { width: 64px; height: 80px; border-radius: 8px; object-fit: cover; flex: none; background: #000; }
.hist-top .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-top .t { font-weight: 800; }
.hist-top .r { font-family: var(--my); font-size: 13px; line-height: 1.7; }
.events { list-style: none; margin: 0; padding: 4px 16px 10px; border-top: 1px solid var(--line2); }
.events li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid #F0F4EA; font-size: 14px; }
.events li:last-child { border-bottom: 0; }
.events .when { font-weight: 700; color: var(--muted); font-size: 13px; }
.hist-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 16px 16px; }
.audit-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }

.dialog { border: 0; border-radius: 20px; padding: 20px; width: min(92vw, 420px); }
.dialog::backdrop { background: rgba(31, 42, 28, .45); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 50; max-width: 90vw; text-align: center; }

.menu-link { font-weight: 700; color: var(--ink); text-decoration: none; border-radius: 10px; min-height: 44px; padding: 0 12px; display: flex; align-items: center; }
.menu-link:hover { background: var(--soft); }
select { font: inherit; font-size: 17px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 50px; width: 100%; }
.staff-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line2); }
.staff-row:first-child { border-top: 0; padding-top: 0; }
.staff-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-head strong { font-size: 17px; }
.tag { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: var(--soft); color: var(--muted); }
.tag.admin { background: var(--info-tint); color: var(--info); }
.tag.off { background: var(--error-tint); color: var(--error); }
.staff-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hist-top .sup { font-size: 12px; color: var(--muted); font-weight: 600; }

.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px 44px; gap: 8px; align-items: end; }
.set-row .cell { display: flex; flex-direction: column; gap: 4px; }
.set-row label { font-size: 12px; font-weight: 800; color: var(--muted); }
.set-row input.set-name { font-family: var(--my); font-size: 16px; min-height: 46px; }
.set-row input.set-mar { text-align: right; font-weight: 800; font-size: 18px; min-height: 46px; background: var(--surface); }

.pm-wrap { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px; }
.pm { min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: inherit; font-weight: 800; font-size: 18px; cursor: pointer; padding: 0; }
.pm-wrap input { min-width: 0; }
