/* Hotel Book (copied from Shop Book): white, soft-structural, one blue accent with a blue-to-teal gradient. */
:root {
  color-scheme: light;
  --page: #f6f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #64748b;
  --hair: rgba(15, 23, 42, 0.06);
  --field: #f3f5f9;
  --field-hover: #eef1f7;
  --accent: #1d4ed8;
  --accent-soft: #e8eefc;
  --grad: linear-gradient(140deg, #0b1f4d 0%, #1d4ed8 55%, #0f766e 110%);
  --grad-soft: linear-gradient(140deg, #eef3ff 0%, #e9f7f4 100%);
  --danger: #c0262d;
  --good: #047857;
  --series-balance: #2a78d6;
  --series-expense: #eb6834;
  --r-shell: 26px;
  --r-core: 20px;
  --r-field: 14px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px -24px rgba(15, 23, 42, 0.18);
  --tabs-space: 96px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.45 "SF Pro Text", "Segoe UI Variable Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.005em;
  padding-bottom: calc(var(--tabs-space) + env(safe-area-inset-bottom));
}
/* Soft colour wash behind everything; fixed so it never repaints on scroll */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 0% -8%, rgba(29, 78, 216, 0.10), transparent 60%),
    radial-gradient(700px 380px at 100% -4%, rgba(15, 118, 110, 0.09), transparent 60%);
}
main { max-width: 620px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 90px; }
/* the floating day bar positions itself with transform, so it must not take the entrance animation */
main > *:not(.daybar) { animation: rise 240ms var(--ease) both; }
main > *:nth-child(2) { animation-delay: 40ms; }
main > *:nth-child(3) { animation-delay: 80ms; }
main > *:nth-child(4) { animation-delay: 120ms; }
main > *:nth-child(n + 5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 650; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- Gradient hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-shell);
  padding: 18px 18px 20px;
  margin-bottom: 16px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 24px 48px -28px rgba(29, 78, 216, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 220px at 85% -20%, rgba(255, 255, 255, 0.22), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.hero-nav .title { text-align: center; }
.hero-nav h1 { font-size: 21px; font-weight: 700; }
.hero-nav .sub { display: block; font-size: 14px; opacity: 0.78; margin-top: 2px; }
.round {
  width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; text-decoration: none;
  color: #fff; font-size: 24px; line-height: 1;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 300ms var(--ease), background 300ms var(--ease);
}
.round:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.22); }
.round.ghost { visibility: hidden; }
/* Chevron drawn from two borders of a rotated square, so it sits on the circle's
   exact centre. A text "‹" sits on the font's baseline and looks off. The 2px
   nudge moves the chevron's visual centre (not its box) to the middle. */
.chev {
  width: 11px; height: 11px;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  border-radius: 1.5px;
  transform: translateX(2px) rotate(45deg);
}
.chev.right { transform: translateX(-2px) rotate(-135deg); }

/* Two equal glass tiles, so the numbers line up with each other and the card edges */
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.stat {
  padding: 12px 14px 13px; border-radius: 16px; min-width: 0;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.stat small { display: block; font-size: 13px; font-weight: 600; opacity: 0.82; }
.stat strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.hero-foot:not(:has(> :not([hidden]))) { display: none; }
.hero-foot .today-link { margin: 0 0 0 auto; }
.hero-big small { font-size: 14px; opacity: 0.8; font-weight: 500; }
.hero-big strong { display: block; font-size: 42px; font-weight: 750; letter-spacing: -0.03em; margin: 2px 0 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.today-link { display: block; text-align: center; color: #fff; font-size: 14px; font-weight: 600; opacity: 0.9; }

/* ---------- Double-bezel cards ---------- */
.shell {
  padding: 5px; margin-bottom: 16px;
  border-radius: var(--r-shell);
  background: rgba(15, 23, 42, 0.025);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.core {
  background: var(--card);
  border-radius: var(--r-core);
  padding: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .unit { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Fields ---------- */
label { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
input:not([type]), input[type="text"], input[type="password"] {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid transparent; border-radius: var(--r-field);
  background: var(--field);
  transition: background 250ms var(--ease), box-shadow 250ms var(--ease), border-color 250ms var(--ease);
}
input::placeholder { color: #8a94a6; }
input:hover { background: var(--field-hover); }
input:focus { outline: none; background: #fff; border-color: rgba(29, 78, 216, 0.55); box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12); }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(29, 78, 216, 0.45); outline-offset: 2px; }
input.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
input[aria-invalid="true"] { background: #fff5f5; border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192, 38, 45, 0.1); }

.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 104px 36px; gap: 8px; align-items: center; }
.line input { padding-left: 12px; padding-right: 12px; }
.line input[data-field="item"] { font-weight: 550; }
.remove {
  width: 36px; height: 40px; border: 0; border-radius: 999px; background: none;
  color: #94a3b8; font-size: 22px; cursor: pointer;
  transition: background 250ms var(--ease), color 250ms var(--ease);
}
.remove:hover, .remove:active { background: #fdecec; color: var(--danger); }

.add-line {
  width: 100%; min-height: 50px; margin-top: 10px;
  border: 1.5px dashed rgba(29, 78, 216, 0.3); border-radius: var(--r-field);
  background: rgba(29, 78, 216, 0.03); color: var(--accent); font-weight: 650; cursor: pointer;
  transition: background 250ms var(--ease), transform 250ms var(--ease);
}
.add-line:active { transform: scale(0.98); background: rgba(29, 78, 216, 0.07); }

.chips-label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 14px 0 6px; border-radius: 999px; cursor: pointer;
  border: 0; background: #fff; font-size: 15px; font-weight: 550;
  box-shadow: 0 0 0 1px var(--hair), 0 4px 12px -6px rgba(15, 23, 42, 0.18);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.chip i {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  font-style: normal; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  transition: transform 300ms var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip:hover i { transform: scale(1.08); }

.sales { display: grid; gap: 10px; }
.sales .row { display: grid; grid-template-columns: 1fr 140px; align-items: center; gap: 12px; }
.hint { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- Floating day bar (appears once the hero scrolls away) ---------- */
.daybar {
  position: fixed; left: 50%; z-index: 20;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: min(588px, calc(100% - 32px));
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center;
  padding: 10px 16px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 0 0 1px var(--hair), 0 16px 36px -18px rgba(15, 23, 42, 0.35);
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform 450ms var(--ease), opacity 300ms var(--ease);
}
.daybar.show { transform: translate(-50%, 0); opacity: 1; }
.daybar small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.daybar strong { font-size: 18px; font-weight: 700; }

.status { font-size: 13px; font-weight: 600; text-align: right; min-width: 70px; white-space: nowrap; }
.status.saved { color: var(--good); }
.status.err { color: var(--danger); }
.hero .status { text-align: left; min-width: 0; color: #fff; }
.hero .status.saved, .hero .status.err { color: #fff; }

/* ---------- Floating tab island ---------- */
.tabs {
  position: fixed; left: 50%; z-index: 30;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  width: min(400px, calc(100% - 32px));
  padding: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -16px rgba(15, 23, 42, 0.35);
}
.tabs a {
  display: grid; place-items: center; min-height: 50px; border-radius: 999px;
  text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: 15px;
  transition: color 300ms var(--ease), background 300ms var(--ease), transform 250ms var(--ease);
}
.tabs a:active { transform: scale(0.97); }
.tabs a[aria-current="page"] { color: #fff; background: var(--grad); box-shadow: 0 8px 18px -10px rgba(29, 78, 216, 0.8); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 8px 0 22px; border: 0; border-radius: 999px;
  font-weight: 650; cursor: pointer; text-decoration: none;
  background: var(--grad); color: #fff;
  box-shadow: 0 14px 28px -16px rgba(29, 78, 216, 0.85);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.btn .ico {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.18); font-size: 17px;
  transition: transform 350ms var(--ease);
}
.btn:hover .ico { transform: translate(2px, 1px) scale(1.05); }
.btn:active { transform: scale(0.98); }
.btn.wide { width: 100%; }
.btn.plain { padding: 0 22px; }
.btn.busy { opacity: 0.7; pointer-events: none; }
.btn.busy .ico { animation: pulse 900ms var(--ease) infinite alternate; }
@keyframes pulse { to { transform: scale(0.85); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .btn.busy .ico { animation: none; } }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border-radius: var(--r-core); padding: 14px 16px;
  box-shadow: 0 0 0 1px var(--hair), var(--shadow);
}
.kpi small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.kpi.wide { grid-column: 1 / -1; background: var(--grad-soft); }
.kpi.wide strong { font-size: 26px; }

.report {
  display: grid; gap: 14px;
  background: var(--grad-soft);
}
.report p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); font-weight: 550; margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { cursor: pointer; outline: none; }
.chart .bar rect, .chart .bar path { transition: opacity 250ms var(--ease); }
.chart-detail { min-height: 44px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.chart-detail b { color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 650; padding: 0 4px 8px; text-transform: none; }
th:first-child, td:first-child { text-align: left; }
td { text-align: right; padding: 11px 4px; border-top: 1px solid #eef1f5; font-variant-numeric: tabular-nums; }
tr.link { cursor: pointer; transition: background 200ms var(--ease); }
tr.link:active { background: #f5f7fb; }
tr.total td { font-weight: 700; border-top: 1px solid #dfe4ec; }
td a { font-weight: 600; text-decoration: none; }

.items { display: grid; gap: 12px; }
.item-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 15px; font-weight: 550; }
.item-row .bar { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-expense); min-width: 3px; }

.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); display: grid; gap: 14px; justify-items: center; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px; border-radius: 16px;
  background: #fff; box-shadow: 0 0 0 1px var(--hair), var(--shadow); font-size: 14px;
}
.banner.warn { background: #fff8eb; box-shadow: 0 0 0 1px #f5d9a8; color: #7a4b00; }
.banner a { font-weight: 650; white-space: nowrap; }

/* ---------- Login ---------- */
.login { min-height: 80dvh; display: grid; align-content: center; gap: 18px; max-width: 380px; margin: 0 auto; }
.login .hero { padding: 26px 22px; }
.login .hero h1 { font-size: 30px; }
.login .hero p { margin: 6px 0 0; opacity: 0.82; }
.login input { font-size: 26px; letter-spacing: 0.4em; text-align: center; margin-top: 8px; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 20px; }

/* ---------- In-app number keypad ---------- */
.keypad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 620px; margin: 0 auto;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: rgba(248, 250, 253, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 -1px 0 var(--hair), 0 -24px 48px -24px rgba(15, 23, 42, 0.35);
  transform: translateY(105%);
  transition: transform 260ms var(--ease);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.keypad.open { transform: translateY(0); }
.kp-stage { margin: 0 0 10px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--hair); overflow: hidden; }
.kp-cur { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: linear-gradient(180deg, rgba(29, 78, 216, 0.07), rgba(29, 78, 216, 0.02)); }
.kp-name { min-width: 0; flex: 1; }
.kp-name small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.kp-name strong { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-val { display: flex; align-items: baseline; gap: 4px; }
.kp-val b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kp-val b.dim { color: #b6bdcc; }
.kp-val em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.kp-nxt { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--hair); color: var(--muted); font-size: 15px; font-weight: 550; }
.kp-nxt small { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; min-width: 34px; }
.kp-nxt-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); opacity: 0.75; }
.kp-nxt-val { font-variant-numeric: tabular-nums; }
.kp-nxt.warn .kp-nxt-name { color: var(--danger); opacity: 1; }
.kp-nxt.end .kp-nxt-name { opacity: 0.55; font-weight: 500; }
.kp-done {
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}
.kp-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 56px; gap: 8px; }
.kp-grid button {
  border: 0; border-radius: 16px; cursor: pointer;
  background: #fff; color: var(--ink);
  font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px var(--hair), 0 2px 0 rgba(15, 23, 42, 0.06);
  transition: transform 90ms ease-out, background 90ms ease-out;
  touch-action: manipulation;
}
.kp-grid button:active { transform: scale(0.95); background: #eef1f7; }
.kp-grid .kp-fn { font-size: 22px; background: #eef1f7; }
.kp-grid .kp-zero { grid-column: span 2; }
.kp-grid .kp-next {
  grid-column: 4; grid-row: 2 / span 3;
  display: grid; place-content: center; gap: 4px;
  background: var(--grad); color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 12px 24px -14px rgba(29, 78, 216, 0.9);
}
.kp-grid .kp-next span { font-size: 22px; }
.kp-grid .kp-next:active { background: var(--grad); filter: brightness(1.08); }
/* the field being typed into */
input.pad-active { background: #fff; border-color: rgba(29, 78, 216, 0.6); box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14); }
/* make room so the last fields can scroll above the pad, and get the bars out of the way */
body.kp-open main { padding-bottom: 420px; }
body.kp-open .tabs, body.kp-open .daybar { opacity: 0; pointer-events: none; transform: translate(-50%, 140%); }

/* ---------- By week ---------- */
.weeks { display: grid; gap: 10px; }
.week {
  padding: 14px; border-radius: 18px;
  background: #fbfcfe; box-shadow: inset 0 0 0 1px #e6eaf1;
}
.week-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.week-name { font-weight: 700; font-size: 16px; }
.week-name span { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 6px; }
.badge {
  font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px #e1e6ee;
}
.split { display: flex; gap: 2px; height: 10px; margin-bottom: 12px; }
.split i { display: block; min-width: 3px; }
.split i:first-child { border-radius: 5px 0 0 5px; }
.split i:last-child { border-radius: 0 5px 5px 0; }
.split .e { background: var(--series-expense); }
.split .b { background: var(--series-balance); }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); }
.figs > div { padding: 0 10px; min-width: 0; }
.figs > div:first-child { padding-left: 0; }
.figs > div + div { border-left: 1px solid #e3e7ee; }
.figs small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
.figs small i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.figs b { display: block; margin-top: 3px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.week.total { background: var(--grad-soft); box-shadow: inset 0 0 0 1px #d9e3f5; }
.week.total .figs b { font-size: 17px; }
th { white-space: nowrap; border-bottom: 1px solid #e3e7ee; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Every day table: colour-coded so it reads at a glance ---------- */
th.c-exp, td.c-exp { color: #c2410c; }
th.c-cash, td.c-cash { color: #1d4ed8; }
td.c-tot { font-weight: 700; color: var(--ink); }
.pc { display: inline-block; min-width: 46px; padding: 3px 8px; border-radius: 999px; text-align: center; font-size: 13.5px; font-weight: 700; }
.pc.lo { background: #dcfce7; color: #15803d; }
.pc.mid { background: #fef3c7; color: #a16207; }
.pc.hi { background: #fee2e2; color: #b91c1c; }
.pc.none { background: transparent; color: var(--muted); }
tr.link td:first-child a { white-space: nowrap; }

/* percentage tiles on the dashboard */
.kpi.pct { position: relative; overflow: hidden; }
.kpi.pct i { position: absolute; left: 0; bottom: 0; height: 5px; border-radius: 0 3px 3px 0; background: currentColor; opacity: 0.85; }
.kpi.pct.lo { color: #15803d; } .kpi.pct.mid { color: #a16207; } .kpi.pct.hi { color: #b91c1c; } .kpi.pct.cash { color: #1d4ed8; }
.kpi.pct small { color: var(--muted); }
.kp-nxt.tap { cursor: pointer; }
.kp-nxt.tap:active { background: #f1f5fd; }

/* ---------- Top bar, connection strip, calendar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 620px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 16px 6px;
  background: rgba(246, 247, 251, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.topbar[hidden] { display: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; display: block; }
.cal-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: var(--accent); box-shadow: 0 0 0 1px var(--hair), 0 6px 16px -10px rgba(15, 23, 42, 0.35);
  transition: transform 160ms var(--ease);
}
.cal-btn:active { transform: scale(0.94); }
main { padding-top: 6px; }

.net {
  position: sticky; top: 62px; z-index: 34; max-width: 588px; margin: 4px 16px 0;
  padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.35;
  background: #eef4ff; color: #1e3a8a; box-shadow: 0 0 0 1px #d5e2fb;
}
@media (min-width: 652px) { .net { margin-left: auto; margin-right: auto; } }
.net.off { background: #fff4e0; color: #7a4b00; box-shadow: 0 0 0 1px #f3d49a; }
.net[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 60;
  max-width: 88vw; padding: 12px 16px; border-radius: 14px; background: #0f172a; color: #fff; font-size: 14.5px; font-weight: 600;
}
.status.wait, .pill.wait { color: #b45309; }
.hero .pill.wait, .hero .pill.status.wait { color: #fde68a; }

.stat strong[data-tone="good"] { color: #86efac; }
.stat strong[data-tone="ok"] { color: #fde68a; }
.stat strong[data-tone="low"] { color: #fca5a5; }

.cal { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; justify-items: center; background: rgba(15, 23, 42, 0.42); animation: fadein 180ms var(--ease) both; }
.cal[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.cal-sheet {
  width: 100%; max-width: 480px; padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -24px 60px -24px rgba(15, 23, 42, 0.5);
  animation: sheetup 280ms var(--ease) both;
}
@keyframes sheetup { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .cal { align-items: center; } .cal-sheet { border-radius: 28px; } }
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head h2 { flex: 1; text-align: center; font-size: 18px; }
.round.sm { width: 40px; height: 40px; background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; box-shadow: none; }
.round.sm .chev { border-color: var(--accent); }
.round.sm:disabled { opacity: 0.35; cursor: default; }
.cal-close { margin-left: 2px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: #f1f4f9; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.cal-note { margin: 12px 2px; font-size: 14.5px; color: var(--muted); text-align: center; min-height: 20px; }
.cal-note b { color: var(--ink); }
.cal-note .warn { color: #b91c1c; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cd {
  aspect-ratio: 1; border: 0; border-radius: 14px; cursor: pointer; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: transform 120ms var(--ease);
}
.cd:active:not(:disabled) { transform: scale(0.92); }
.cd.ok { background: #dcfce7; color: #15803d; }
.cd.none { background: #eceff4; color: #64748b; }
.cd.future { background: transparent; color: #c3cad6; cursor: default; }
.cd.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cd.sel { outline: 3px solid rgba(29, 78, 216, 0.28); outline-offset: 1px; }
.cal-legend { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 5px; background: #dcfce7; box-shadow: inset 0 0 0 1px #86efac; }
.cal-legend i.none { background: #eceff4; box-shadow: inset 0 0 0 1px #cfd6e1; }
body.cal-open { overflow: hidden; }

/* Every day table: same weight for date, expense and cash; the date is plain black */
td.c-exp, td.c-cash { font-weight: 600; }
tr.link td:first-child a { color: var(--ink); font-weight: 600; }

/* Date bubble in the top bar */
.date-bubble {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 0 10px; padding: 9px 15px;
  border: 0; border-radius: 999px; font: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em; white-space: nowrap; cursor: pointer;
  transition: transform 160ms var(--ease);
}
.date-bubble:active { transform: scale(0.97); }
.date-bubble[hidden] { display: none; }
.date-bubble.now { background: #dcfce7; color: #15803d; box-shadow: inset 0 0 0 1px #a7e8bd; }
.date-bubble.month { background: #eef2ff; color: var(--accent); box-shadow: inset 0 0 0 1px #d4defb; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Hotel Book additions ---------- */
.tabs a { font-size: 14px; }
.num.neg, td.neg, b.neg { color: var(--danger); }
.hero .num.neg { color: #fecaca; }
.hero-stats.three { grid-template-columns: 1fr 1fr 1fr; }
.hero-stats.three .stat { padding-left: 10px; padding-right: 10px; }
.hero-stats.three .stat small { white-space: nowrap; font-size: 12px; }
.hero-stats.three .stat strong { font-size: 18px; }
.cash-row { padding-top: 12px; border-top: 1px dashed #e3e7ee; }
.cash-row .lbl { font-weight: 650; display: grid; }
.cash-row strong { font-size: 24px; font-weight: 750; text-align: right; letter-spacing: -0.02em; }
.minus-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fef2f2; color: #991b1b; font-size: 14px; font-weight: 550; }
.banner.soft { background: var(--grad-soft); box-shadow: 0 0 0 1px var(--hair); color: var(--ink-2); }
.line.partner { grid-template-columns: 1fr 36px; }
.partners { display: grid; gap: 8px; }
.report-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-btns .btn { white-space: nowrap; gap: 8px; padding: 0 7px 0 16px; font-size: 15px; }
.report-btns .btn .ico { width: 34px; height: 34px; flex: none; }
.report-btns .btn.plain { background: #fff; color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow); }
.calc { margin: 0; display: grid; gap: 2px; }
.calc div { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid #eef1f5; font-size: 15px; }
.calc div:first-child { border-top: 0; }
.calc dt { color: var(--ink-2); font-weight: 550; }
.calc dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.calc .sum { border-top: 1px solid #dfe4ec; }
.calc .sum dt, .calc .sum dd { font-size: 18px; font-weight: 750; color: var(--ink); }
.shares { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.share { padding: 12px; border-radius: 16px; background: var(--grad-soft); text-align: center; }
.share small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 650; }
.share strong { display: block; margin-top: 4px; font-size: 19px; font-weight: 750; letter-spacing: -0.02em; }
.result .note { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
table.t5 { font-size: 13.5px; }
table.t5 td { padding: 10px 3px; }
