*{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#f8fafc;--surface:#fff;--border:#e2e8f0;--text:#0f172a;--muted:#64748b;
  --accent:#0d9488;--accent-hover:#0f766e;--danger:#dc2626;--radius:12px;
  --nav-h:56px;
}
html,body{height:100%}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px;line-height:1.5;color:var(--text);background:var(--bg);
  -webkit-font-smoothing:antialiased;overscroll-behavior-y:none;
}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit}
.app-header{position:sticky;top:0;z-index:20;background:var(--surface);
  border-bottom:1px solid var(--border);padding-top:env(safe-area-inset-top,0px)}
.app-header-inner{display:flex;align-items:center;height:56px;padding:0 8px;gap:4px}
.app-header h1{font-size:17px;font-weight:600;flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px}
.container{max-width:720px;margin:0 auto;padding:16px 12px 96px}
.container.no-nav{padding-bottom:32px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.list-item{display:flex;align-items:center;gap:12px;padding:14px;
  border-bottom:1px solid var(--border);cursor:pointer;width:100%;text-align:left;
  background:transparent;border-left:none;border-right:none;border-top:none;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation}
.list-item:last-child{border-bottom:none}
.list-item:active{background:#f1f5f9}
.avatar{width:40px;height:40px;border-radius:50%;background:#ccfbf1;color:#0f766e;
  display:flex;align-items:center;justify-content:center;font-weight:600;
  font-size:13px;flex-shrink:0}
.list-item-content{flex:1;min-width:0}
.list-item-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-item-sub{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-item-amount{font-family:ui-monospace,SFMono-Regular,monospace;font-weight:600;
  text-align:right;flex-shrink:0}
.empty{padding:48px 24px;text-align:center;color:var(--muted)}
.empty-icon{width:56px;height:56px;border-radius:50%;background:#f1f5f9;
  display:flex;align-items:center;justify-content:center;margin:0 auto 12px;color:#94a3b8}
.form-group{margin-bottom:14px}
.form-label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px;font-weight:500}
.input,textarea.input,select.input{
  width:100%;padding:12px 14px;font:inherit;font-size:16px;
  border:1px solid var(--border);border-radius:var(--radius);
  background:var(--surface);color:var(--text);-webkit-appearance:none}
textarea.input{resize:vertical;min-height:80px;line-height:1.5}
.input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.input:disabled{background:#f8fafc;color:var(--muted)}
.mono{font-family:ui-monospace,SFMono-Regular,monospace}
.text-right{text-align:right}
.text-muted{color:var(--muted)}
.text-sm{font-size:13px}
.text-xs{font-size:12px}
.row{display:flex;align-items:center;gap:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:13px 16px;border-radius:var(--radius);border:1px solid var(--border);
  font-weight:500;cursor:pointer;background:var(--surface);
  transition:background .12s,transform .06s;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation}
.btn:active{transform:scale(.985);background:#f1f5f9}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn-primary:active{background:var(--accent-hover)}
.btn-secondary{background:#0f172a;color:#fff;border-color:#0f172a}
.btn-secondary:active{background:#1e293b}
.btn-danger{color:var(--danger);border-color:#fecaca}
.btn-block{width:100%}
.icon-btn{width:40px;height:40px;border-radius:50%;border:none;background:transparent;
  color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;flex-shrink:0;font-size:20px}
.icon-btn:active{background:#f1f5f9}
.fab{position:fixed;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 72px);
  width:56px;height:56px;border-radius:16px;background:var(--accent);color:#fff;
  border:none;display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 16px rgba(13,148,136,.35);cursor:pointer;z-index:25;
  -webkit-tap-highlight-color:transparent;transition:transform .06s}
.fab:active{transform:scale(.95);background:var(--accent-hover)}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:50;
  display:flex;align-items:flex-end;justify-content:center;animation:fade .15s ease;
  overscroll-behavior:contain}
.modal{background:var(--surface);border-radius:20px 20px 0 0;width:100%;max-width:500px;
  max-height:90vh;overflow-y:auto;padding:20px;
  padding-bottom:calc(env(safe-area-inset-bottom,0px) + 20px);
  animation:slideUp .22s cubic-bezier(.32,.72,0,1)}
@media(min-width:640px){.modal-backdrop{align-items:center;padding:16px}.modal{border-radius:20px}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{transform:translateY(24px);opacity:0}to{transform:translateY(0);opacity:1}}
.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.stat-card{background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:14px}
.stat-label{font-size:12px;color:var(--muted);font-weight:500}
.stat-value{font-size:20px;font-weight:600;font-family:ui-monospace,SFMono-Regular,monospace;
  margin-top:4px;overflow:hidden;text-overflow:ellipsis}
.hero-card{grid-column:1/-1;background:linear-gradient(135deg,#0d9488,#0f766e);
  color:#fff;border:none}
.hero-card .stat-label{color:rgba(255,255,255,.85)}
.hero-card .stat-value{color:#fff;font-size:26px}
.quick-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.quick-action{display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 8px;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);font-size:12px;font-weight:500;color:var(--text);
  cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
  transition:background .12s,transform .06s;text-align:center}
.quick-action:active{transform:scale(.97);background:#f1f5f9}
.quick-action-icon{width:36px;height:36px;border-radius:10px;background:#f0fdfa;
  color:var(--accent);display:flex;align-items:center;justify-content:center}
.section-title{font-size:12px;font-weight:600;color:var(--muted);
  text-transform:uppercase;letter-spacing:.6px;margin:20px 4px 8px}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:30;
  background:var(--surface);border-top:1px solid var(--border);
  padding-bottom:env(safe-area-inset-bottom,0px);
  display:grid;grid-template-columns:repeat(3,1fr);height:var(--nav-h)}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;color:var(--muted);font-size:10px;font-weight:500;
  -webkit-tap-highlight-color:transparent;position:relative}
.bottom-nav a.active{color:var(--accent)}
.bottom-nav a.active::before{content:"";position:absolute;top:0;left:50%;
  transform:translateX(-50%);width:28px;height:2px;background:var(--accent);
  border-bottom-left-radius:2px;border-bottom-right-radius:2px}
.bill-row{display:grid;grid-template-columns:1fr 64px 88px 32px;gap:8px;
  align-items:center;padding:12px;border-bottom:1px solid var(--border)}
.bill-row:last-child{border-bottom:none}
.bill-row-info{min-width:0}
.bill-row-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bill-row-rate{font-size:12px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,monospace}
.bill-row-qty{width:100%;padding:8px 6px;font-size:15px;text-align:center;
  font-family:ui-monospace,SFMono-Regular,monospace;
  border:1px solid var(--border);border-radius:8px;background:var(--surface);-webkit-appearance:none}
.bill-row-qty:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px rgba(13,148,136,.12)}
.bill-row-amount{text-align:right;font-family:ui-monospace,SFMono-Regular,monospace;
  font-weight:600;font-size:14px}
.bill-row-del{width:32px;height:32px;color:var(--muted)}
.bill-row-del:active{background:#fee2e2;color:var(--danger)}
@media(max-width:480px){
  .bill-row{grid-template-columns:1fr 56px 32px;grid-template-areas:"name qty del" "rate amt del"}
  .bill-row-info{display:contents}
  .bill-row-name{grid-area:name}
  .bill-row-rate{grid-area:rate;align-self:start}
  .bill-row-qty{grid-area:qty}
  .bill-row-amount{grid-area:amt;text-align:left;font-weight:500;font-size:13px;color:var(--muted)}
  .bill-row-del{grid-area:del;align-self:center}
}
.summary-row{display:flex;justify-content:space-between;padding:6px 0;font-size:15px}
.summary-row.total{border-top:1px solid var(--border);padding-top:12px;margin-top:8px;
  font-weight:600;font-size:17px}
.bill-preview{background:#0f172a;color:#e2e8f0;padding:16px;border-radius:var(--radius);
  font-family:ui-monospace,SFMono-Regular,monospace;font-size:12px;line-height:1.55;
  white-space:pre;overflow-x:auto;-webkit-overflow-scrolling:touch}
.toast{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 76px);
  transform:translateX(-50%);background:#0f172a;color:#fff;padding:10px 20px;
  border-radius:999px;font-size:14px;z-index:100;animation:fadeUp .2s ease;
  max-width:calc(100vw - 32px);text-align:center;pointer-events:none}
@keyframes fadeUp{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
.picker-item{display:flex;align-items:center;gap:12px;padding:12px 14px;
  border-bottom:1px solid var(--border);cursor:pointer;width:100%;text-align:left;
  background:transparent;border-left:none;border-right:none;border-top:none;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation}
.picker-item:last-child{border-bottom:none}
.picker-item:active{background:#f1f5f9}
.picker-item-add{width:36px;height:36px;border-radius:50%;background:#f0fdfa;
  color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.picker-item-added{background:var(--accent);color:#fff}