:root {
  --bg: #0d1c14;
  --card: #173224;
  --line: rgba(126, 201, 122, 0.18);
  --green: #7ec97a;
  --leaf: #c8e8a8;
  --text: #f3f7ef;
  --muted: #9bb19a;
  --danger: #e25a5a;
  --gold: #e3c46a;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: radial-gradient(900px 500px at 0% 0%, #214832 0%, var(--bg) 50%);
  color: var(--text);
  font-family: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 8px; }
.eyebrow { color: var(--green); font-size: 12px; margin-bottom: 3px; }
h1 { font-size: 21px; font-weight: 800; }
main { padding: 8px 16px 20px; }
.card, .hero, .empty, .invoice-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero { padding: 18px; margin-bottom: 12px; background: linear-gradient(135deg, rgba(126,201,122,.16), var(--card)); }
.hero p, .muted { color: var(--muted); font-size: 13px; line-height: 1.8; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; color: var(--leaf); font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }
.btn, .tab, .chip, button { font-family: inherit; cursor: pointer; border: 0; }
.btn { min-height: 46px; border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.btn-green { background: linear-gradient(180deg, #b6e39a, #5aa85a); color: #10210f; }
.btn-dark { background: #10261a; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(226,90,90,.16); color: #ffb4b4; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product, .person, .order, .customer {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.product h3, .person h3, .order h3, .customer h3 { font-size: 14px; margin-bottom: 4px; }
.price { color: var(--gold); font-weight: 700; font-size: 13px; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty button { width: 30px; height: 30px; border-radius: 10px; background: #10261a; color: var(--text); }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
input, textarea, select {
  width: 100%; background: #10261a; border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 11px; font-family: inherit; font-size: 14px; margin-bottom: 10px;
}
textarea { min-height: 78px; resize: vertical; }
.form { display: grid; }
#map { height: 320px; border-radius: 18px; border: 1px solid var(--line); margin-bottom: 10px; overflow: hidden; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 48vh; overflow: auto; padding-bottom: 8px; }
.bubble { background: #10261a; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.bubble.me { background: rgba(126,201,122,.16); }
.bubble b { display: block; font-size: 12px; color: var(--leaf); }
.bubble span { font-size: 11px; color: var(--muted); }
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 10px;
  width: min(560px, calc(100% - 16px)); display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(13,28,20,.94); border: 1px solid var(--line); border-radius: 22px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 20;
}
.tab { background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 15px; }
.tab small { font-size: 10px; font-weight: 600; }
.tab.active { color: var(--leaf); }
.empty { padding: 24px 14px; text-align: center; color: var(--muted); }
.chip { display: inline-block; padding: 3px 8px; border-radius: 999px; background: rgba(126,201,122,.14); color: var(--leaf); font-size: 11px; }
.online { color: #7ec97a; }
.offline { color: #9bb19a; }
.login { min-height: 100vh; padding: 48px 20px; }
.login .hero { margin-top: 20px; }
.demo { font-size: 12px; color: var(--muted); line-height: 1.9; margin-top: 10px; }
.modal-root { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal-root.hidden, .hidden { display: none; }
.sheet { width: min(560px, 100%); background: #173224; border-radius: 22px 22px 0 0; padding: 16px; max-height: 92vh; overflow: auto; }
.invoice-box { padding: 14px; white-space: pre-wrap; line-height: 2; font-size: 13px; background: #10261a; }
.toast { position: fixed; left: 50%; bottom: 108px; transform: translateX(-50%); background: #234833; padding: 10px 14px; border-radius: 999px; z-index: 50; font-size: 13px; border: 1px solid var(--line); }
.list { display: grid; gap: 8px; }
.leaflet-container { font-family: inherit; }
