:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: #0f172a;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f7fb; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; padding: 10px 12px; background: rgba(255,255,255,.94); border-bottom: 1px solid #e2e8f0; backdrop-filter: blur(16px); }
.topbar-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark, .mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg,#16a34a,#15803d); color: #fff; font-weight: 900; box-shadow: 0 8px 22px rgba(22,163,74,.24); }
.brand h1 { margin: 0; font-size: 16px; line-height: 1; }
.brand p { margin: 4px 0 0; color: #64748b; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 12px 32px; }
.row { display: flex; align-items: center; gap: 9px; }
.wrap { flex-wrap: wrap; }

.stats-row { display: grid; grid-template-columns: repeat(4,minmax(118px,1fr)); gap: 10px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 16px 42px rgba(15,23,42,.06); }
.card-pad { padding: 15px; }
.stat { padding: 13px; min-width: 118px; }
.stat strong { display: block; font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.stat span, .eyebrow { color: #64748b; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 16px; border-radius: 20px; color: #fff; background: linear-gradient(135deg,#14532d,#15803d 55%,#0f766e); box-shadow: 0 18px 44px rgba(21,128,61,.24); }
.hero-card h2 { margin: 3px 0 4px; font-size: 22px; letter-spacing: -0.04em; }
.hero-card .muted, .hero-card .eyebrow { color: rgba(255,255,255,.75); }
.panel-title { margin: 0 0 4px; font-size: 16px; font-weight: 900; }
.muted { color: #64748b; font-size: 13px; line-height: 1.55; }
.claim-card { margin-bottom: 12px; }
.claim-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field label { font-size: 12px; font-weight: 800; color: #475569; }
.input, textarea { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 11px 12px; background: #f8fafc; color: #0f172a; outline: none; }
textarea { min-height: 82px; resize: vertical; }
.input:focus, textarea:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.13); background: #fff; }
.btn { min-height: 40px; padding: 0 15px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; color: #fff; background: linear-gradient(135deg,#16a34a,#15803d); box-shadow: 0 8px 20px rgba(22,163,74,.22); text-decoration: none; white-space: nowrap; }
.btn.secondary { background: #fff; color: #0f172a; border: 1.5px solid #e2e8f0; box-shadow: none; }
.btn.warning { background: linear-gradient(135deg,#f59e0b,#d97706); }
.btn.full { width: 100%; }
.notice { padding: 10px 12px; border-radius: 12px; background: #eff6ff; color: #1d4ed8; font-size: 13px; font-weight: 700; border: 1px solid #bfdbfe; }
.toast { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 99; padding: 12px 14px; border-radius: 14px; background: #eff6ff; color: #1d4ed8; font-size: 13px; font-weight: 800; border: 1px solid #bfdbfe; box-shadow: 0 16px 38px rgba(15,23,42,.14); }
.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.preview { margin-top: 12px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.preview div { padding: 10px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.preview span { display: block; font-size: 10px; color: #64748b; font-weight: 900; text-transform: uppercase; }
.preview strong { display: block; margin-top: 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.clients-card { overflow: hidden; }
.client { padding: 14px; border-top: 1px solid #e2e8f0; display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 14px; }
.client:first-child { border-top: 0; }
.client-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.client h3 { margin: 0; font-size: 16px; font-weight: 900; }
.client small { color: #64748b; display: block; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; background: #e0f2fe; color: #0369a1; white-space: nowrap; }
.badge.paid { background: #dcfce7; color: #166534; }
.badge.approved { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#16a34a,#22c55e); }
.money-row { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; color: #475569; font-size: 12px; }
.activity-list { margin-top: 8px; display: grid; gap: 4px; }
.activity-list p { margin: 0; font-size: 12px; color: #64748b; }
.client-actions { min-width: 0; }
.scanner video { width: 100%; border-radius: 14px; background: #0f172a; min-height: 220px; object-fit: cover; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: linear-gradient(145deg,#f0fdf4,#eff6ff 55%,#faf5ff); }
.auth-card { width: min(100%,440px); padding: 22px; }
.auth-card h1 { margin: 14px 0 4px; font-size: 25px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 14px; margin: 18px 0; }
.auth-tabs button { padding: 10px; border-radius: 11px; background: transparent; color: #64748b; font-weight: 900; }
.auth-tabs button.active { background: #fff; color: #0f172a; box-shadow: 0 1px 5px rgba(15,23,42,.08); }

@media (max-width: 780px) {
  .topbar-inner { align-items: center; }
  .top-actions .btn { min-height: 36px; padding: 0 11px; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .claim-row, .client, .preview { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(4, minmax(104px, 1fr)); gap: 8px; }
  .stat { min-width: 104px; padding: 11px; }
  .stat strong { font-size: 21px; }
}

/* v2.0.0 app-like mobile polish */
body{background:linear-gradient(180deg,#eaf7ef 0,#f4f7fb 34%,#eef3f8 100%)}
.topbar{padding-top:calc(10px + env(safe-area-inset-top));box-shadow:0 8px 28px rgba(15,23,42,.08)}
.card{border-color:#dbe4ef;box-shadow:0 18px 46px rgba(15,23,42,.08)}
.btn{border-radius:14px;min-height:43px;box-shadow:0 12px 28px rgba(22,163,74,.24)}
.btn.secondary{box-shadow:0 1px 2px rgba(15,23,42,.05)}
.download-gate{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 15px;margin-bottom:12px;background:linear-gradient(135deg,#0f172a,#14532d);color:#fff;border:0}
.download-gate span{display:block;font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.08em;color:#86efac;margin-bottom:4px}
.download-gate strong{font-size:13px;line-height:1.45}
.client{background:#fff}.client+.client{border-top:1px solid #dbe4ef}
.input,textarea{background:#fff;border-color:#cbd5e1;border-radius:14px}
@media (max-width:780px){.download-gate{grid-template-columns:1fr}.download-gate .btn{width:100%}.top-actions .btn.secondary{display:none}.container{padding-bottom:calc(34px + env(safe-area-inset-bottom))}}
