/* Collectrix Field: phone-first view. Self-hosted, no inline CSS (CSP). */
:root { --ink:#0f172a; --text:#1e293b; --muted:#5b6b80; --line:#e4e8ef; --canvas:#f3f5f9; --brand:#0a6460; --dark:#032e2c; --gold:#d79624; --red:#dc2626; --green:#059669; --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; overscroll-behavior-y: contain; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: 13px; } .red { color: var(--red); }
button, input, select { font: inherit; }
input { width: 100%; padding: 12px 13px; border: 1px solid #cdd5e0; border-radius: 12px; background: #fff; color: var(--text); font-size: 16px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #f3c25b; outline-offset: 2px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 5px; }
.btn { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 800; background: #fff; color: var(--ink); border: 1.5px solid #c3ced9; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.block { width: 100%; margin-top: 16px; }

.login { max-width: 380px; margin: 0 auto; padding: 48px 24px; text-align: center; }
.login img { border-radius: 16px; } .login h1 { margin: 12px 0 2px; color: var(--ink); }
.login form { text-align: left; margin-top: 18px; }
.error { color: #991b1b; background: #fee2e2; border-radius: 10px; padding: 9px 12px; font-size: 14px; }

.bar { background: var(--dark); color: #fff; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.who { font-weight: 800; font-size: 18px; } .co { font-size: 12.5px; color: #a9c9c6; }
.bar-actions { position: relative; display: flex; gap: 4px; }
.icon { background: none; border: 0; color: #fff; width: 44px; height: 44px; font-size: 18px; border-radius: 12px; cursor: pointer; }
.pop { position: absolute; right: 0; top: 48px; background: #fff; color: var(--text); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); min-width: 190px; overflow: hidden; z-index: 20; }
.pop a, .pop button { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; background: #fff; color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); cursor: pointer; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 14px 4px; }
.summary div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.summary small { display: block; color: var(--muted); font-size: 11.5px; } .summary b { font-size: 17px; color: var(--ink); }
.offline { margin: 8px 14px 0; background: #fef3c7; color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.tools { padding: 10px 14px 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; }
.chips button { border: 1.5px solid #c3ced9; background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--muted); cursor: pointer; }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.list { list-style: none; margin: 0; padding: 6px 14px calc(90px + var(--safe-b)); }
.card { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin: 8px 0; cursor: pointer; color: inherit; }
.card:active { background: #f4f8f8; }
.card .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card b.name { color: var(--ink); font-size: 16px; overflow-wrap: anywhere; }
.card .due { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .sub { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 13px; color: var(--muted); align-items: center; }
.tag { font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.tag.red { background: #fee2e2; color: #991b1b; } .tag.amber { background: #fef3c7; color: #92400e; } .tag.green { background: #d1fae5; color: #065f46; } .tag.grey { background: #eef2f6; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 24px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: #fff; z-index: 31; border-radius: 20px 20px 0 0; padding: 20px 18px calc(24px + var(--safe-b)); box-shadow: 0 -12px 40px rgba(0,0,0,.25); }
.sheet h2 { margin: 0 40px 2px 0; color: var(--ink); font-size: 20px; overflow-wrap: anywhere; } .sheet h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.amount { font-size: 30px; font-weight: 800; color: var(--ink); margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 14px; background: #eef6f5; color: var(--brand); text-decoration: none; font-weight: 700; font-size: 13px; border: 0; cursor: pointer; }
.act i { font-size: 20px; }
.act[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.bills .b { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.bills .b span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.ptp { padding-bottom: 6px; }

.toast { position: fixed; left: 14px; right: 14px; bottom: calc(18px + var(--safe-b)); z-index: 60; background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 12px; text-align: center; font-weight: 600; }
.toast.bad { background: #991b1b; } .toast.good { background: #065f46; }
@media (min-width: 700px) { #app { max-width: 560px; margin: 0 auto; background: var(--canvas); min-height: 100vh; box-shadow: 0 0 0 1px var(--line); } .sheet { max-width: 560px; margin: 0 auto; } }
