:root {
  --bg: #FFFFFF;
  --card: #F0F0F2;
  --band: #E4E8F2;
  --text: #030306;
  --muted: #5E6377;
  --accent: #212124;
  --secondary: #E4E4E9;
  --nav: #2A4BE0;
  --blue: #3193FC;
  --red: #FE5E48;
  --green: #0CC44D;
  --line: #DCE1EC;
  --input: #C8CEE0;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--nav); }
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(env(safe-area-inset-top) + 16px) 20px 14px; box-shadow: 0 2px 8px rgba(26, 28, 36, .06); display: flex; align-items: center; gap: 8px; }
.header h1 { margin: 0; font-size: 19px; font-weight: 600; }
.header .sub { font-size: 13px; color: var(--muted); }
.header .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.back { width: 44px; height: 44px; margin-left: -12px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 16px 120px; display: flex; flex-direction: column; gap: 12px; }
.section-title { margin: 8px 4px 0; font-size: 17px; font-weight: 600; }
.card { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card h2, .card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sum { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; color: #FFFFFF; white-space: nowrap; }
.pill.new { background: var(--blue); }
.pill.overdue { background: var(--red); }
.pill.paid { background: var(--green); }
.pill.waiting { background: var(--secondary); color: var(--text); }
.btn { height: 48px; border: 0; border-radius: 10px; background: var(--accent); color: #FFFFFF; font-size: 15px; font-weight: 600; padding: 0 16px; cursor: pointer; }
.btn.secondary { background: var(--secondary); color: var(--text); }
.btn.small { height: 40px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; }
.btns > * { flex: 1 1 0; }
.filelink { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 10px; background: #FFFFFF; color: var(--text); text-decoration: none; font-size: 14px; }
.filelink span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #FFFFFF; font-size: 13px; line-height: 1.4; }
.band { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--band); font-size: 14px; font-weight: 600; }
.band .grow { flex: 1; }
.icon-box { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.meter-head { display: flex; align-items: center; gap: 10px; }
.field { display: flex; gap: 8px; }
.input { flex: 1; min-width: 0; height: 52px; border-radius: 10px; border: 1px solid var(--input); background: #FFFFFF; padding: 0 14px; display: flex; align-items: center; gap: 8px; }
.input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; font-variant-numeric: tabular-nums; }
.square { width: 52px; height: 52px; flex-shrink: 0; border: 0; border-radius: 10px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; }
select.select, input.text { height: 44px; border-radius: 10px; border: 1px solid var(--input); background: #FFFFFF; padding: 0 12px; font-size: 15px; width: 100%; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 40px; }
.select-wrap svg { position: absolute; right: 14px; top: 13px; pointer-events: none; }
label.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom)); padding: 16px; background: linear-gradient(rgba(255,255,255,0), #FFFFFF 45%); display: flex; justify-content: center; }
.sticky-cta .btn { width: 100%; max-width: 560px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #FFFFFF; box-shadow: 0 -1px 0 #E4E7F0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
.nav button { height: 72px; border: 0; background: transparent; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; position: relative; }
.nav button.on { color: var(--nav); font-weight: 600; box-shadow: inset 0 2px 0 var(--nav); }
.nav .dot { position: absolute; top: 10px; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #FFF; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(26, 28, 36, .5); }
.sheet-bg { flex: 1; background: transparent; border: 0; }
.sheet { position: relative; background: #FFFFFF; border-radius: 22px 22px 0 0; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; max-width: 600px; width: 100%; margin: 0 auto; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 700; text-align: center; }
.sheet .center { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.4; }
.sheet .close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.upload { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 16px; border-radius: 14px; background: var(--card); cursor: pointer; }
.upload input { display: none; }
.toast { position: fixed; left: 16px; right: 16px; max-width: 560px; margin: 0 auto; bottom: calc(160px + env(safe-area-inset-bottom)); background: var(--accent); color: #FFF; padding: 14px 18px; border-radius: 10px; font-size: 15px; line-height: 1.35; text-align: center; z-index: 30; box-shadow: 0 6px 20px rgba(26, 28, 36, .18); }
.main.with-cta { padding-bottom: 190px; }
.acc { border-radius: 14px; overflow: hidden; background: var(--card); }
.acc > button { width: 100%; height: 56px; border: 0; padding: 0 16px; background: var(--band); display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 600; cursor: pointer; }
.acc .body { padding: 6px 16px 10px; }
.kv { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; font-size: 14px; }
.kv .grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.copy { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; vertical-align: middle; }
.copy:hover { background: var(--secondary); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid #D3D9E6; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--accent); color: #FFF; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .wide { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi b { font-size: 24px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.setup { max-width: 520px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 16px; }
.link-box { word-break: break-all; background: #FFF; border-radius: 10px; padding: 12px; font-size: 13px; }
@media (min-width: 900px) {
  .main { padding-bottom: 120px; }
}
