:root{
  --primary:#0b3d91;
  --primary-dark:#082b66;
  --bg:#f2f5fa;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5eaf2;
  --green:#16a34a;
  --red:#dc2626;
  --amber:#f59e0b;
  --radius:16px;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  font-family:-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);color:var(--text);
  display:flex;justify-content:center;
}
button{font-family:inherit;border:none;background:none;cursor:pointer;color:inherit}
a{text-decoration:none}

.app{
  width:100%;max-width:480px;min-height:100vh;
  background:var(--bg);position:relative;
}

/* Header */
.header{
  background:linear-gradient(160deg,var(--primary) 0%,var(--primary-dark) 100%);
  color:#fff;padding:18px 18px 70px;
  border-radius:0 0 28px 28px;
}
.header-top{display:flex;justify-content:space-between;align-items:center}
.brand{display:flex;align-items:center;gap:12px}
.logo{
  width:42px;height:42px;border-radius:12px;background:#fff;color:var(--primary);
  display:grid;place-items:center;font-weight:800;font-size:16px;letter-spacing:.5px;
}
.brand-name{font-weight:700;font-size:15px}
.brand-sub{font-size:12px;opacity:.75;margin-top:2px}
.icon-btn{
  position:relative;width:42px;height:42px;border-radius:12px;
  background:rgba(255,255,255,.15);display:grid;place-items:center;
}
.icon-btn svg{width:22px;height:22px;fill:#fff}
.badge{
  position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;
  border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:700;
  display:grid;place-items:center;
}
.greeting{margin-top:22px}
.greeting h1{font-size:22px;font-weight:700}
.greeting p{font-size:13px;opacity:.8;margin-top:4px}

/* Content */
.content{padding:0 16px;margin-top:-50px;display:flex;flex-direction:column;gap:18px}

/* Money card */
.money-card{
  background:var(--card);border-radius:var(--radius);padding:16px;
  box-shadow:0 8px 24px rgba(11,61,145,.15);
}
.money-head{
  display:flex;justify-content:space-between;align-items:center;
  font-size:13px;font-weight:600;color:var(--muted);margin-bottom:14px;
}
.seg{display:flex;background:var(--bg);border-radius:10px;padding:3px}
.seg button{font-size:12px;padding:5px 10px;border-radius:8px;color:var(--muted);font-weight:600}
.seg button.active{background:var(--primary);color:#fff}
.money-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.m-label{font-size:12px;color:var(--muted)}
.m-value{font-size:18px;font-weight:800;margin-top:4px;word-break:break-all}
.green{color:var(--green)}
.red{color:var(--red)}

/* Stats */
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.stat{
  background:var(--card);border-radius:var(--radius);padding:14px 16px;
  border-left:5px solid var(--c);
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.stat-num{font-size:28px;font-weight:800;color:var(--c)}
.stat-label{font-size:12.5px;color:var(--muted);margin-top:2px;font-weight:500}

/* Section titles */
.sec-title{font-size:16px;font-weight:700;margin-bottom:10px}
.sec-title.nm{margin-bottom:0}
.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.link{font-size:13px;font-weight:600;color:var(--primary);margin-bottom:10px}
.card{
  background:var(--card);border-radius:var(--radius);padding:16px;
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.pill{
  font-size:12px;font-weight:700;padding:4px 10px;border-radius:20px;
  background:#dcfce7;color:var(--green);
}
.pill.red{background:#fee2e2;color:var(--red)}

/* Quick actions */
.actions{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.action{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  background:var(--card);border-radius:var(--radius);padding:12px 4px;
  font-size:12px;font-weight:600;box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.action:active{transform:scale(.96)}
.ai{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;font-size:21px}

/* Chart */
.chart{
  display:flex;align-items:flex-end;justify-content:space-between;
  height:150px;gap:8px;margin-top:16px;
}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}
.bar-val{font-size:10px;color:var(--muted);margin-bottom:4px;font-weight:600}
.bar{
  width:100%;max-width:30px;border-radius:8px 8px 3px 3px;
  background:linear-gradient(180deg,#3b82f6,var(--primary));
  transition:height .6s ease;height:0;
}
.bar.today{background:linear-gradient(180deg,#34d399,var(--green))}
.bar-day{font-size:11px;color:var(--muted);margin-top:6px;font-weight:600}

/* Trips */
.trip{
  background:var(--card);border-radius:var(--radius);padding:14px;margin-bottom:10px;
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.trip-top{display:flex;justify-content:space-between;align-items:center}
.truck-no{font-weight:800;font-size:15px}
.status{font-size:11px;font-weight:700;padding:3px 9px;border-radius:12px}
.status.run{background:#dcfce7;color:var(--green)}
.status.late{background:#fef3c7;color:#b45309}
.route{display:flex;align-items:center;gap:8px;margin:10px 0 8px;font-size:14px;font-weight:600}
.route .arrow{color:var(--muted)}
.trip-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}
.progress{height:6px;background:var(--bg);border-radius:4px;margin:10px 0 8px;overflow:hidden}
.progress span{display:block;height:100%;background:var(--primary);border-radius:4px}

/* Lists */
.row{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 0;border-bottom:1px solid var(--line);
}
.row:last-child{border-bottom:none;padding-bottom:0}
.row:first-child{padding-top:14px}
.row-title{font-size:14px;font-weight:600}
.row-sub{font-size:12px;color:var(--muted);margin-top:3px}
.row-amt{font-weight:800;font-size:14px;color:var(--red)}
.tag{font-size:11px;font-weight:700;padding:4px 9px;border-radius:12px;white-space:nowrap}
.tag.danger{background:#fee2e2;color:var(--red)}
.tag.warn{background:#fef3c7;color:#b45309}
.tag.ok{background:#dcfce7;color:var(--green)}

.footer-space{height:80px}

/* Bottom nav */
.bottom-nav{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:480px;background:#fff;
  display:flex;justify-content:space-around;
  padding:8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 16px rgba(15,23,42,.08);
  border-radius:20px 20px 0 0;z-index:10;
}
.nav{
  display:flex;flex-direction:column;align-items:center;gap:3px;
  font-size:11px;font-weight:600;color:var(--muted);padding:6px 12px;border-radius:12px;
}
.nav svg{width:22px;height:22px;fill:var(--muted)}
.nav.active{color:var(--primary)}
.nav.active svg{fill:var(--primary)}

/* Toast */
.toast{
  position:fixed;bottom:90px;left:50%;transform:translate(-50%,20px);
  background:#0f172a;color:#fff;padding:10px 18px;border-radius:24px;
  font-size:13px;opacity:0;pointer-events:none;transition:.3s;z-index:20;white-space:nowrap;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ===== Dashboard: tappable cards and empty notes ===== */
.stat[data-go],.trip[data-go]{cursor:pointer}
.stat[data-go]:active,.trip[data-go]:active{transform:scale(.98)}
.empty-note{
  font-size:13px;color:var(--muted);text-align:center;padding:14px 4px;
}
.card .empty-note:first-child{padding-top:18px}
.empty-note.more{padding:12px 0 0;font-weight:600;color:var(--primary)}
.link[hidden]{display:none}

/* ===== Always hide elements marked hidden ===== */
[hidden]{display:none !important}

/* ===== Header buttons (dashboard) ===== */
.hdr-actions{display:flex;gap:10px}

/* commission note under the money summary */
.comm-note{margin-top:12px;padding:8px 10px;border-radius:10px;background:#ecfdf5;color:#047857;font-size:12px;font-weight:600;line-height:1.4}
