* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --blue: #1447c8; --blue-dark: #0e35a0; --ink: #17233b; --muted: #68738a;
  --bg: #f2f5fb; --card: #ffffff; --line: #dde4f0; --green: #12805c; --red: #c0392b;
  --amber: #b7791f; --radius: 14px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45;
  padding-bottom: 76px;
}
header.appbar {
  position: sticky; top: 0; z-index: 20; background: var(--blue); color: #fff;
  padding: 14px 16px; box-shadow: 0 2px 8px rgba(10,30,80,.25);
}
header.appbar .biz { font-size: 19px; font-weight: 700; }
header.appbar .sub { font-size: 13px; opacity: .85; }
main { padding: 14px 14px 8px; max-width: 640px; margin: 0 auto; }
h2.title { font-size: 20px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 16px 0 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 22px; font-weight: 800; color: var(--blue-dark); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.green .v { color: var(--green); } .stat.red .v { color: var(--red); }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 18px; font-weight: 700; }
.money { font-weight: 700; white-space: nowrap; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.b-BOOKED { background: #e3ebff; color: var(--blue-dark); }
.b-DISPATCHED { background: #fdeeda; color: var(--amber); }
.b-PARTIAL { background: #fdf3d8; color: var(--amber); }
.b-RETURNED { background: #dcf5ea; color: var(--green); }
.b-CANCELLED { background: #f6dede; color: var(--red); }

button, .btn {
  display: inline-block; border: none; cursor: pointer; text-align: center;
  background: var(--blue); color: #fff; font-size: 16px; font-weight: 700;
  padding: 13px 18px; border-radius: 12px; min-height: 50px; text-decoration: none;
}
button:active, .btn:active { background: var(--blue-dark); }
button.block, .btn.block { display: block; width: 100%; margin: 10px 0; }
button.ghost, .btn.ghost { background: #e8edf7; color: var(--ink); }
button.danger { background: var(--red); }
button.small { min-height: 40px; padding: 8px 13px; font-size: 14px; border-radius: 10px; }
button:disabled { opacity: .45; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 5px; color: var(--ink); }
input, select, textarea {
  width: 100%; font-size: 16px; padding: 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); min-height: 50px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-weight: 600; }
.check input { width: 24px; height: 24px; min-height: 0; }

.listcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px; cursor: pointer; }
.listcard:active { background: #eef3fd; }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty .emoji { font-size: 34px; display: block; margin-bottom: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; }
.chip { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; background: #e8edf7; font-weight: 700; font-size: 14px; border: none; min-height: 40px; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; }

.calcbox { background: #eef4ff; border: 1.5px solid #c4d5fa; border-radius: var(--radius); padding: 13px 14px; margin-top: 14px; font-size: 15px; }
.calcbox .total { font-size: 20px; font-weight: 800; color: var(--blue-dark); }
.warn { background: #fdecea; border: 1.5px solid #f2b8b0; color: var(--red); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-weight: 600; display: none; }
.okmsg { background: #dcf5ea; border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-weight: 600; color: var(--green); display: none; }

nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff;
  border-top: 1.5px solid var(--line); display: flex; box-shadow: 0 -2px 10px rgba(10,30,80,.08);
}
nav.tabs button {
  flex: 1; background: none; color: var(--muted); border-radius: 0; min-height: 64px;
  font-size: 12.5px; font-weight: 700; padding: 6px 2px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
nav.tabs button .ic { font-size: 22px; line-height: 1; }
nav.tabs button.on { color: var(--blue); background: #eef3fd; }
nav.tabs button:active { background: #e8edf7; }

.menuitem { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; margin-bottom: 10px; font-size: 17px; font-weight: 700; cursor: pointer; width: 100%; color: var(--ink); text-align: left; }
.menuitem .ic { font-size: 24px; }
.menuitem .arr { margin-inline-start: auto; color: var(--muted); }
.payrow { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.payrow:last-child { border-bottom: none; }
.delpay { background: #f6dede; color: var(--red); min-height: 36px; padding: 5px 11px; font-size: 14px; border-radius: 8px; }
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar input { padding-inline-end: 54px; font-size: 17px; min-height: 54px; border-radius: 12px; }
.searchbar .clearbtn {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 999px;
  background: #e8edf7; color: var(--ink); font-size: 15px;
}
.searchbar .clearbtn:active { background: var(--line); }

.credits { text-align: center; }
.credits .cname { font-size: 19px; font-weight: 800; color: var(--blue-dark); margin: 2px 0; }
.credits .cbiz { font-weight: 700; margin-bottom: 5px; }
.credits div { margin: 1px 0; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600;
  display: none; max-width: 92%; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ---- Urdu mode: Jameel Noori Nastaleeq (bundled, offline) + RTL ---- */
@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: url('fonts/jameel-noori-nastaleeq.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
html[dir="rtl"] body {
  font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
  line-height: 2;
}
html[dir="rtl"] button, html[dir="rtl"] input,
html[dir="rtl"] select, html[dir="rtl"] textarea {
  font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
}
html[dir="rtl"] .menuitem { text-align: right; }
html[dir="rtl"] .stat .v, html[dir="rtl"] .money, html[dir="rtl"] .big { line-height: 1.6; }
