/* Galla.exe — styles
   Colours, then layout, then each screen. */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1f2030;
  --ink-2: #3a3c52;
  --muted: #6a6e80;
  --line: #e2e4ea;
  --bg: #f1f2f5;
  --card: #ffffff;

  --go: #16803a;          /* free rooms, main buttons */
  --go-soft: #e6f4ea;
  --sold: #d9dce3;        /* occupied rooms */
  --sold-ink: #626778;

  --upi: #4a42c4;
  --upi-soft: #ecebfa;
  --cash: #a85a05;
  --cash-soft: #fbefdb;

  --danger: #bf2f38;
  --danger-soft: #fbe9ea;

  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  overscroll-behavior: contain;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #7aa8ff;
  outline-offset: 2px;
}
[hidden] { display: none !important; }
h2 { font-size: 15px; font-weight: 700; margin: 22px 0 10px; }
p { margin: 0; }

/* ---------- Frame ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  background: var(--bg);
  position: relative;
}
@media (min-width: 520px) {
  body { background: #d7d9e0; }
  .app { box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 20px 60px rgba(31,32,48,.18); }
}

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  background: var(--ink);
  color: #fff;
}
.brand { min-width: 0; }
.brand .gh { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .app-name { font-size: 12px; color: #a9adc4; letter-spacing: .02em; }
.today-pill {
  flex: none;
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 6px 12px; border-radius: 12px;
  background: #2b2d42;
  border: 1px solid #3d4060;
  color: #fff; text-align: right;
}
.today-pill span { font-size: 11px; color: #a9adc4; line-height: 1.1; }
.today-pill b { font-size: 18px; line-height: 1.2; font-weight: 700; color: #7be09a; }

#banner:empty { display: none; }
.banner { padding: 8px 16px; font-size: 13px; background: #fff4d6; color: #6b4a00; border-bottom: 1px solid #f0dca0; }
.banner.warn { background: var(--danger-soft); color: #7a1d23; border-color: #f2c4c7; }

.screen {
  padding: 14px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
  outline: none;
}

.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  z-index: 10;
}
.nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--go); }

/* ---------- Rooms ---------- */
.legend { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; margin-right: 5px; }
.legend .sw.free { border: 2px solid var(--go); background: #fff; }
.legend .sw.busy { background: var(--sold); }
.legend .sw.sel { background: var(--go); }
.legend .count { margin-left: auto; color: var(--muted); }

.floor { margin-top: 18px; }
.floor-name { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.room {
  aspect-ratio: 1 / 1.05;
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .08s ease;
}
.room:active { transform: scale(.96); }
.room .no { font-size: 20px; font-weight: 800; }
.room .sub { font-size: 12px; font-weight: 600; }
.room.free { background: #fff; border: 2px solid var(--go); color: var(--go); }
.room.free .sub { color: var(--go); opacity: .8; }
.room.busy { background: var(--sold); border: 2px solid var(--sold); color: var(--sold-ink); }
.room.busy:disabled { cursor: default; }
.room.busy:disabled:active { transform: none; }
.room.sel { background: var(--go); border: 2px solid var(--go); color: #fff; }
.room.sel .sub { color: #fff; opacity: .95; }

.btn.slim { height: 44px; font-size: 15px; margin-top: 12px; }
.selrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pill { height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; flex: none; }

/* bar at the bottom while rooms are selected */
.selbar { position: fixed; left: 50%; transform: translateX(-50%); width: min(100%, 480px); bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 9; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(31,32,48,.08); }
.selbar-in { padding: 10px 16px 12px; animation: rise .16s ease-out; }
.selinfo { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.clear { flex: none; font-weight: 700; color: var(--muted); padding: 6px 4px; }
.selhint { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.selbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.selbtns .btn, .selbtns .btn + .btn { height: 48px; font-size: 15px; margin-top: 0; }
.screen.has-selbar { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 120px); }

/* ---------- Today ---------- */
.hero { background: var(--card); border-radius: var(--radius); padding: 18px 18px 16px; border: 1px solid var(--line); }
.hero .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.hero .big { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 12px; }
.split-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); margin-bottom: 12px; }
.split-bar i { display: block; height: 100%; }
.split-bar .u { background: var(--upi); }
.split-bar .c { background: #e08a1e; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.chip span { font-size: 12px; font-weight: 700; }
.chip b { font-size: 20px; font-weight: 800; }
.chip.upi { background: var(--upi-soft); color: var(--upi); }
.chip.cash { background: var(--cash-soft); color: var(--cash); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.people-head, .person { display: grid; grid-template-columns: 1fr 86px 86px; gap: 8px; padding: 10px 14px; align-items: center; }
.people-head { font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.people-head span:not(:first-child), .person span:not(:first-child) { text-align: right; }
.person + .person { border-top: 1px solid var(--line); }
.person .nm { font-weight: 700; }
.person .cashv { color: var(--cash); font-weight: 700; }
.person .upiv { color: var(--upi); font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.prow { width: 100%; display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; text-align: left; }
.prow .time { font-size: 13px; color: var(--muted); font-weight: 600; }
.prow .room-l { font-weight: 700; }
.prow .meta { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.prow .amt { font-size: 17px; font-weight: 800; }
.prow.void .amt { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.prow.void .room-l { color: var(--muted); }
.tag { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; }
.tag.upi { background: var(--upi-soft); color: var(--upi); }
.tag.cash { background: var(--cash-soft); color: var(--cash); }
.tag.edited { background: var(--line); color: var(--ink-2); }
.tag.cancelled { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }

/* ---------- History ---------- */
.legend2 { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 6px 14px 4px; }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.month-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 2px; }
.month-head > div { text-align: center; }
.month-head h2 { margin: 0; }
.month-head small { color: var(--muted); font-size: 12px; font-weight: 600; }
.arrow { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 24px; font-weight: 800; line-height: 1; }
.arrow:disabled { opacity: .35; }
.month-total { text-align: center; font-size: 34px; font-weight: 800; margin: 2px 0 12px; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 6px 8px; }
.cal-names, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-names span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 6px; }
.cal-day { height: 52px; display: flex; align-items: center; justify-content: center; position: relative; padding: 0; background: none; }
.bub { display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bub.has { background: var(--upi); color: #fff; }
.cal-day.sel .bub { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.cal-day.today .bub { font-weight: 900; }
.cal-day.future .bub { color: #b4b7c4; }
.cal-day.blank { pointer-events: none; }
.wrow { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.wrow:last-child { border-bottom: 0; }
.wrow span { color: var(--muted); font-weight: 600; font-size: 14px; }
.wrow b { font-size: 17px; font-weight: 800; }
.dgroup { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 2px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dgroup b { color: var(--ink); font-size: 14px; }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---------- Settings ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.input {
  width: 100%; height: 48px; padding: 0 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
.input:focus { border-color: var(--go); outline: none; box-shadow: 0 0 0 3px var(--go-soft); }
.btn {
  width: 100%; height: 52px; border-radius: 14px; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.go { background: var(--go); color: #fff; }
.btn.line { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-line { background: #fff; border: 1.5px solid #e9b6ba; color: var(--danger); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn + .btn { margin-top: 10px; }
.stack-gap > * + * { margin-top: 10px; }

.ro { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; font-size: 14px; }
.ro + .ro { border-top: 1px solid var(--line); }
.ro span { color: var(--muted); flex: none; }
.ro b { text-align: right; word-break: break-word; }
.unset { font-style: normal; font-weight: 600; color: var(--danger); }

/* ---------- Layers ---------- */
.layer { position: fixed; inset: 0; z-index: 30; }

.pay-layer { background: var(--bg); overflow-y: auto; }
.pay { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: calc(8px + var(--safe-t)) 16px calc(16px + var(--safe-b)); animation: rise .18s ease-out; }
.pay-top { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.pay-top .t { font-size: 20px; font-weight: 800; line-height: 1.2; }
.pay-top .s { font-size: 13px; color: var(--muted); }
.amount { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px 0 14px; font-size: 56px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.amount .cur { color: var(--muted); font-weight: 600; margin-right: 6px; }
.amount.empty-amt .num { color: #b9bcc8; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.key { height: 62px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 26px; font-weight: 700; display: grid; place-items: center; }
.key:active { background: var(--go-soft); }
.key svg { width: 26px; height: 26px; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.method { height: 60px; border-radius: 14px; font-size: 18px; font-weight: 800; color: #fff; }
.method.cash { background: #b9650a; }
.method.upi { background: var(--upi); }
.method:disabled { opacity: .35; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; width: 100%; text-align: center; }
.qr-card .qr { width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; }
.qr-card .qr svg { width: 100%; height: 100%; display: block; }
.qr-card .qamt { font-size: 40px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; }
.qr-card .qwho { color: var(--muted); font-size: 14px; }
.qr-missing { padding: 28px 10px; color: var(--danger); font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; text-align: center; }

.sheet-layer { background: rgba(20,21,34,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(100%, 480px); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + var(--safe-b));
  animation: rise .18s ease-out;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0; font-size: 20px; font-weight: 800; }
.sheet .sub { color: var(--muted); font-size: 13px; margin: 2px 0 14px; }
.sheet .kv { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sheet .kv span:first-child { color: var(--muted); }
.sheet .kv b { text-align: right; }
.sheet .paid { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; background: var(--go-soft); border-radius: 12px; margin-bottom: 8px; }
.sheet .paid b { font-size: 22px; color: var(--go); }
.sheet .card { margin: 8px 0 14px; }
.log { margin: 12px 0 4px; font-size: 13px; color: var(--ink-2); }
.log li { padding: 6px 0; border-top: 1px solid var(--line); list-style: none; }
.log ul { padding: 0; margin: 0; }
.log .who { font-weight: 700; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 800; background: #fff; }
.seg button[aria-pressed="true"].cash { border-color: var(--cash); background: var(--cash-soft); color: var(--cash); }
.seg button[aria-pressed="true"].upi { border-color: var(--upi); background: var(--upi-soft); color: var(--upi); }
.err { color: var(--danger); font-size: 13px; font-weight: 700; margin-top: 6px; }

.welcome-layer { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.welcome { width: min(100%, 420px); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; }
.welcome .logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 14px; }
.welcome h1 { font-size: 26px; margin: 0 0 4px; font-weight: 800; letter-spacing: -.01em; }
.welcome p { color: var(--muted); margin-bottom: 18px; }

.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px);
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  padding: 11px 16px; border-radius: 12px; max-width: min(92vw, 440px); text-align: center;
  transition: opacity .18s ease, transform .18s ease; z-index: 60;
  box-shadow: 0 6px 20px rgba(31,32,48,.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Pick your name (first launch) ---------- */
.who { display: grid; gap: 8px; }
.whobtn { height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 16px; }
.whobtn[aria-pressed="true"] { border-color: var(--go); background: var(--go-soft); color: var(--go); }

.brand .app-name { user-select: none; -webkit-user-select: none; }
