/* PSC Books — phone app. Thumb-first: big targets, one job per screen, the dark bar at the bottom. */
:root {
  --bg: #eef0f3; --panel: #fff; --ink: #1d2128; --dim: #5f6875; --faint: #8b93a0;
  --line: #dde1e7; --line2: #eceff3; --gold: #c9962b; --gold-tint: #faf1dc; --dark: #20242b;
  --good: #11804a; --bad: #c0352b; --focus: #2f6fdf;
  --c-customer: #0f7b6c; --c-distributor: #3b4cc0; --c-show: #9b3d8f; --c-online: #c2410c; --c-retail: #4d7c0f; --c-other: #6b7280;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.4 "Archivo", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
.hidden { display: none !important; }
.muted { color: var(--dim); } .faint { color: var(--faint); }
.good { color: var(--good); } .bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--panel); border-radius: 14px; padding: 26px; }
.login-box img { border-radius: 14px; }
.login-box h1 { font-size: 26px; margin: 12px 0 4px; }
.login-box label { display: block; margin-top: 14px; font-weight: 600; font-size: 14px; }
.msg { color: var(--bad); min-height: 20px; margin-top: 10px; font-size: 14px; }

/* top bar */
.bar { background: var(--dark); color: #fff; padding: calc(var(--st) + 12px) 16px 14px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; }
.bar h1 { font-size: 21px; flex: 1; }
.bar .mo { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border-radius: 9px; }
.bar .mo button { background: none; border: 0; color: #fff; padding: 7px 10px; font-weight: 700; cursor: pointer; }
.bar .mo span { font-weight: 700; font-size: 14px; min-width: 74px; text-align: center; color: #f3d38d; }
.view { padding: 14px 14px calc(96px + var(--sb)); max-width: 640px; margin: 0 auto; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--dark); display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--sb)); }
.tab { background: none; border: 0; color: #9aa3af; font-size: 11.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; cursor: pointer; }
.tab .ti { font-size: 21px; line-height: 1.1; }
.tab.on { color: #f3d38d; }
.tab.add { position: relative; }
.tab.add span { width: 58px; height: 58px; margin-top: -22px; border-radius: 50%; background: var(--gold); color: #1f1504; font-size: 34px; font-weight: 500;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); border: 4px solid var(--dark); }

/* controls */
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47,111,223,.15); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1f1504; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .5; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* the month at a glance: one dark card, not a grid of tiles */
.glance { background: var(--dark); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.glance .lbl { color: #aab2bd; font-size: 13px; }
.glance .big { font-size: 38px; font-weight: 800; font-variation-settings: "wdth" 86; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.glance .row { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.glance .row div { flex: 1; } .glance .row b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.glance .row small { color: #aab2bd; font-size: 12px; }
.glance .vs { margin-top: 10px; font-size: 14px; color: #d7dce3; }
.glance .vs b { color: #7ee0a6; } .glance .vs b.down { color: #ff9b91; }
.stackbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.1); margin-top: 12px; }
.stackbar i { display: block; height: 100%; background: var(--c); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.action { display: flex; flex-direction: column; gap: 3px; background: var(--panel); border-radius: 14px; padding: 14px; cursor: pointer; border: 0; text-align: left; }
.action b { font-size: 16px; } .action small { color: var(--dim); font-size: 13px; }
.action.gold { background: var(--gold-tint); }

.sec { font-size: 15px; font-weight: 800; margin: 18px 2px 8px; font-variation-settings: "wdth" 112; }
.list { background: var(--panel); border-radius: 14px; overflow: hidden; }
.item { display: grid; grid-template-columns: 5px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .stripe { align-self: stretch; background: var(--c); border-radius: 0 3px 3px 0; }
.item b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { display: block; color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amt { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.item .amt small { font-weight: 500; }
.empty { padding: 26px 16px; text-align: center; color: var(--dim); background: var(--panel); border-radius: 14px; }
.c-customer { --c: var(--c-customer); } .c-distributor { --c: var(--c-distributor); } .c-show { --c: var(--c-show); }
.c-online { --c: var(--c-online); } .c-retail { --c: var(--c-retail); } .c-other { --c: var(--c-other); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: 0; }

.bars { background: var(--panel); border-radius: 14px; padding: 6px 14px; }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 15px; }
.brow:last-child { border-bottom: 0; }
.brow .track { grid-column: 1 / -1; height: 7px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.brow .fill { height: 100%; background: var(--c, var(--gold)); border-radius: 4px; }

/* sheets (full-screen steps) */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(20,24,31,.5); display: flex; align-items: flex-end; }
.sheet-box { background: var(--bg); width: 100%; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--sb)); }
.sheet-box h2 { font-size: 22px; margin-bottom: 4px; }
.sheet-box .lead { color: var(--dim); margin: 0 0 14px; font-size: 14.5px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.x { background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; font-size: 20px; cursor: pointer; flex: none; }
.menu { display: grid; gap: 10px; }
.menu label, .menu button { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 0; border-radius: 14px; padding: 16px; cursor: pointer; text-align: left; }
.menu .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--gold-tint); flex: none; }
.menu b { display: block; font-size: 16.5px; } .menu small { color: var(--dim); font-size: 13.5px; }

/* channel picker — the graded-slab label tiles, as on the website */
.slabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.slab { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; text-align: left; cursor: pointer; }
.slab .l { display: block; background: color-mix(in srgb, var(--c) 82%, #fff); color: #fff; font-weight: 800; padding: 8px 11px; font-size: 15px; font-variation-settings: "wdth" 118; }
.slab .s { display: block; color: var(--dim); font-size: 12.5px; padding: 7px 11px 10px; line-height: 1.3; }
.slab.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.slab.on .l { background: var(--c); }
.slab.wide { grid-column: 1 / -1; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14.5px; font-weight: 600; color: var(--dim); cursor: pointer; }
.chip.on { background: var(--dark); border-color: var(--dark); color: #fff; }

.money-in { position: relative; }
.money-in::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 800; color: var(--faint); }
.money-in input { font-size: 30px; font-weight: 800; padding: 12px 12px 12px 36px; font-variant-numeric: tabular-nums; }
.photo { width: 100%; max-height: 34vh; object-fit: contain; border-radius: 12px; background: #fff; display: block; margin-bottom: 12px; }
.pdfcard { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; font-weight: 600; }
.callout { background: var(--gold-tint); border-radius: 12px; padding: 11px 13px; font-size: 14px; margin-bottom: 12px; }
.lines .ln { display: grid; grid-template-columns: 1fr 64px 96px 32px; gap: 6px; margin-bottom: 6px; }
.lines .ln input { padding: 10px; font-size: 15px; }
.lines .ln button { background: none; border: 0; color: var(--faint); font-size: 22px; cursor: pointer; }
.totline { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; padding: 10px 2px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 15px; }
.kv span:first-child { color: var(--dim); }
.card { background: var(--panel); border-radius: 14px; padding: 4px 14px; margin-bottom: 12px; }
.pics { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.pics a { flex: none; } .pics img { width: 92px; height: 120px; object-fit: cover; border-radius: 8px; background: #fff; display: block; }
.pics .pdf { width: 92px; height: 120px; border-radius: 8px; background: #fff; display: grid; place-items: center; font-weight: 800; color: var(--dim); text-decoration: none; }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--sb)); transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .toast { transition: none; } }
@media (min-width: 700px) { .sheet { align-items: center; justify-content: center; } .sheet-box { max-width: 560px; border-radius: 18px; } }

/* on the forms the photo is a reminder, not the main thing */
.sheet-box .chips + .field, .sheet-box .photo + .chips { margin-top: 0; }
#fSrc, #eTot { scroll-margin-top: 20px; }
