/* Staff advances: the RPS look (forest, paper, soft cards). */
:root {
  --forest: #1b4d3e; --leaf: #2e7d57; --paper: #f4efe4; --card: #fffdf8; --ink: #1c2b24; --line: #ddd4c4; --muted: #6b726d;
  --sage: #e7f3ec; --sageI: #1f6b45; --mist: #e8eef6; --mistI: #2f5f9e; --sand: #f6f0e4; --sandI: #7a5512; --rose: #fbe7ec; --roseI: #993556;
  --lilac: #efe8f6; --lilacI: #5b3f8f;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { background: var(--forest); }
body { margin: 0; min-height: 100vh; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; color: var(--ink);
  background: var(--paper) radial-gradient(ellipse 90% 40% at 50% 0, #fff8e8 0%, rgba(255, 248, 232, 0) 70%) no-repeat; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.sm { font-size: 0.85rem; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--forest); color: #fff; padding: calc(10px + var(--top)) 16px 10px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(28, 43, 36, 0.18); }
.top h1 { margin: 0; font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.top .back { border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 700; }
.tabs-top { display: none; gap: 4px; margin-left: 24px; }
.tabs-top a { color: #dfeee5; text-decoration: none; font-weight: 700; padding: 8px 16px; border-radius: 999px; }
.tabs-top a.on { background: #fff; color: var(--forest); }
.menu { position: absolute; right: 12px; top: calc(56px + var(--top)); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(28, 43, 36, 0.2); padding: 6px; display: grid; min-width: 190px; }
.menu button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.menu button:hover { background: #eef6f1; }
.menu .red { color: var(--roseI); }

/* layout */
main { width: min(1100px, 100%); margin: 0 auto; padding: 14px 14px calc(110px + var(--bottom)); display: grid; gap: 12px; }
.dock { position: fixed; left: 10px; right: 10px; bottom: calc(8px + var(--bottom)); z-index: 20; height: 62px; border-radius: 31px; background: var(--forest); display: flex; justify-content: space-around; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.dock a { color: #cfe0d6; text-decoration: none; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; gap: 1px; padding: 5px 16px; border-radius: 24px; }
.dock a i { font-style: normal; font-size: 1.15rem; }
.dock a.on { background: #fff; color: var(--forest); }
@media (min-width: 900px) {
  .dock { display: none; }
  .tabs-top { display: flex; }
  main { padding-bottom: 40px; }
}

/* bits */
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 900; font-size: 0.85rem; color: #fff; flex: none; }
.c1 { background: linear-gradient(135deg, #5fae84, #2e7d57); }
.c2 { background: linear-gradient(135deg, #6f9fd6, #2f5f9e); }
.c3 { background: linear-gradient(135deg, #d6a35f, #a9701f); }
.c4 { background: linear-gradient(135deg, #b89ad8, #5b3f8f); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 0.75rem; font-weight: 800; white-space: nowrap; }
.tag i { width: 8px; height: 8px; border-radius: 50%; }
.t1 { background: var(--sage); color: var(--sageI); } .t1 i { background: #2e7d57; }
.t2 { background: var(--mist); color: var(--mistI); } .t2 i { background: #2f5f9e; }
.t3 { background: var(--sand); color: var(--sandI); } .t3 i { background: #b07a24; }
.t4 { background: var(--lilac); color: var(--lilacI); } .t4 i { background: #5b3f8f; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 12px; padding: 8px 16px; font-weight: 800; border: 1px solid var(--line); background: #fff; color: var(--forest); text-decoration: none; }
.btn.leaf { background: var(--leaf); border-color: var(--leaf); color: #fff; box-shadow: 0 6px 16px rgba(46, 125, 87, 0.25); }
.btn.red { color: var(--roseI); border-color: #efcfd8; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.big { min-height: 52px; font-size: 1.02rem; border-radius: 14px; width: 100%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 28px rgba(28, 43, 36, 0.06); }

.month { display: flex; align-items: center; justify-content: center; gap: 12px; }
.month b { font-size: 1.15rem; min-width: 150px; text-align: center; }
.month button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 900; color: var(--forest); }
.big { padding: 16px; border-radius: 20px; background: linear-gradient(160deg, #e7f3ec, #fff); border: 1px solid #cfe5d8; display: grid; gap: 6px; }
.big small { font-weight: 700; color: var(--sageI); }
.big b { font-size: 2rem; font-weight: 900; color: var(--forest); }
.split { display: flex; gap: 6px; flex-wrap: wrap; }

.list { display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-align: left; width: 100%; }
.person .ph { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; color: #fff; }
.person .nm { min-width: 0; }
.person b { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--muted); font-size: 0.8rem; }
.person .amt { font-size: 1.1rem; font-weight: 900; text-align: right; }
.person.zero { opacity: 0.6; }
.p1 { background: linear-gradient(135deg, #bcd7f0, #6f9fd6); } .p2 { background: linear-gradient(135deg, #cfe8d6, #5fae84); }
.p3 { background: linear-gradient(135deg, #efdcf0, #c49ad0); } .p4 { background: linear-gradient(135deg, #f3d9a6, #e9a66b); }
.p0 { background: #eceae6; color: #9a9f9b !important; }
.fab { position: fixed; right: 18px; bottom: calc(84px + var(--bottom)); z-index: 21; height: 56px; padding: 0 22px; border-radius: 28px; border: 0; background: var(--leaf); color: #fff; font-weight: 800; font-size: 1rem; box-shadow: 0 12px 28px rgba(46, 125, 87, 0.35); }
@media (min-width: 900px) { .fab { bottom: 28px; right: max(28px, calc(50% - 530px)); } }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.search { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 14px; }

/* entries */
.entry { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); width: 100%; text-align: left; }
.entry .dt { text-align: center; font-weight: 900; font-size: 1.15rem; color: var(--forest); line-height: 1; }
.entry .dt small { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.entry b { font-size: 1rem; }
.entry .why { color: var(--muted); font-size: 0.8rem; }
.entry.deleted { opacity: 0.55; }
.entry.deleted b { text-decoration: line-through; }
.sum { padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: grid; gap: 8px; }
.sum div { display: flex; justify-content: space-between; align-items: center; }
.sum .tot { border-top: 1px dashed var(--line); padding-top: 8px; font-weight: 900; font-size: 1.05rem; }
.head { display: flex; align-items: center; gap: 12px; }
.head .ph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; color: #fff; font-size: 1.1rem; }
.head h2 { margin: 0; font-size: 1.3rem; }

/* report */
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools .month { margin-right: auto; }
.wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th { background: #eef3f8; color: var(--mistI); text-align: left; padding: 10px 12px; font-size: 0.82rem; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid #ece6da; }
td.n, th.n { text-align: right; }
tr.total td { background: #f3faf6; font-weight: 900; }
tbody tr:nth-child(even) td { background: #fbf8f2; }
tbody tr { cursor: pointer; }

/* sheet (Give money, edit) */
.dim { position: fixed; inset: 0; z-index: 50; background: rgba(28, 43, 36, 0.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 20px - var(--top)); overflow: auto; background: #fffdf8; border-radius: 24px 24px 0 0; padding: 16px 16px calc(16px + var(--bottom)); display: grid; gap: 12px; box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.25); }
@media (min-width: 700px) { .dim { align-items: center; } .sheet { border-radius: 24px; padding-bottom: 18px; } }
.sheet-h { display: flex; align-items: center; gap: 10px; }
.sheet-h b { font-size: 1.2rem; }
.x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1rem; }
.lbl { font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 0.88rem; }
.chips button.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.combo { position: relative; }
.combo input { width: 100%; height: 50px; border-radius: 14px; border: 2px solid var(--line); background: #fff; padding: 0 14px; font-size: 1.05rem; font-weight: 700; }
.combo input:focus { outline: none; border-color: var(--leaf); }
.combo .picked { display: flex; align-items: center; gap: 10px; height: 50px; border-radius: 14px; border: 2px solid var(--leaf); background: #f3faf6; padding: 0 8px 0 14px; font-weight: 800; }
.combo .picked .role { font-weight: 700; }
.combo .picked button { margin-left: auto; border: 0; background: none; color: var(--forest); font-weight: 800; padding: 8px; }
.opts { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.opts button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px solid #efe9de; background: #fff; padding: 11px 14px; text-align: left; }
.opts button:first-child { border-top: 0; }
.opts button:hover, .opts button.hl { background: #e8f4ec; }
.opts small { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 0.78rem; }
.opts .add { color: var(--leaf); font-weight: 800; }
.role { font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #f2f5f1; color: #4a5750; }
.money { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 16px; border: 2px solid var(--leaf); background: #fff; }
.money span { color: var(--muted); font-size: 1.6rem; font-weight: 800; }
.money input { border: 0; outline: none; width: 100%; font-size: 2rem; font-weight: 900; background: none; padding: 4px 0; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick button { padding: 9px 0; border-radius: 12px; border: 0; background: #f2f5f1; font-weight: 800; color: var(--forest); }
.field { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 14px; }
.gave { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--sage); color: var(--sageI); font-weight: 700; font-size: 0.88rem; }
.info { text-align: center; color: var(--muted); font-size: 0.82rem; }
.err { color: var(--roseI); font-weight: 700; font-size: 0.88rem; }
.hist { margin: 0; padding: 10px 12px; border-radius: 12px; background: #f7f5f0; font-size: 0.82rem; color: #4a5750; display: grid; gap: 4px; }

/* login */
.login { width: min(420px, 100%); margin: 0 auto; padding: calc(30px + var(--top)) 22px 40px; display: grid; gap: 14px; }
.logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(150deg, #e7f3ec, #cfe6d8); display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto; }
.login h1 { margin: 0; text-align: center; font-size: 1.5rem; }
.who { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-weight: 800; font-size: 1.05rem; width: 100%; text-align: left; }
.who.on { border: 2px solid var(--leaf); background: #f3faf6; }
.who .ok { margin-left: auto; color: var(--leaf); }
.pin { width: 100%; height: 58px; border-radius: 14px; border: 2px solid var(--line); background: #fff; text-align: center; font-size: 1.7rem; letter-spacing: 0.4em; font-weight: 900; padding-left: 0.4em; }
.pin:focus { outline: none; border-color: var(--leaf); }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--bottom)); transform: translateX(-50%); z-index: 60; background: #1c2b24; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; }

@media print {
  .top, .dock, .fab, .tools .btn, #toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .wrap { border: 0; overflow: visible; }
  table { min-width: 0; }
}

.sum div > :last-child { white-space: nowrap; }
.sum .tot span:first-child { padding-right: 10px; }

/* 1 Dec: approval, users, Give money tab */
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e0546f; color: #fff; font-size: 0.72rem; display: inline-grid; place-items: center; }
.ask-bar { display: block; width: min(1100px, calc(100% - 28px)); margin: 12px auto 0; padding: 12px 14px; border-radius: 14px; background: #fbe7ec; color: #993556; font-weight: 800; text-decoration: none; }
.ask { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }
.ask > div { display: grid; min-width: 0; flex: 1; }
.ask-acts { display: flex; gap: 8px; }
.user { padding: 12px 14px; display: grid; gap: 8px; }
.user.off { opacity: 0.6; }
.user-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: #f7f5f0; font-size: 0.88rem; }
.user-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 0.82rem; border-radius: 10px; }
.fab.round { width: 64px; height: 64px; padding: 0; border-radius: 50%; font-size: 2rem; line-height: 1; }
.code-box { display: grid; gap: 10px; }
.code-box summary { cursor: pointer; font-weight: 700; color: var(--forest); text-align: center; }
.code-box[open] { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.dock a { padding: 5px 10px; }

.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes span { padding: 10px; border-radius: 10px; background: #f7f5f0; text-align: center; font: 800 1.05rem ui-monospace, Consolas, monospace; letter-spacing: 0.05em; }

.big-field { height: 54px; font-size: 1.2rem; font-weight: 700; text-align: center; letter-spacing: 0.05em; }
