:root { --g: #33363A; --gold: #AB8F45; --sand: #F3EEE2; --line: #ddd6c4; --ok: #2e7d32; --bad: #b3261e; --mut: #6b6e72; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--sand); color: var(--g); font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Nastaliq Urdu", Arial, sans-serif; font-size: 16px; }
html[lang="ur"] body { line-height: 1.9; }
button, input, select, textarea { font: inherit; color: inherit; }
header { position: sticky; top: 0; z-index: 5; background: var(--g); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; gap: 8px; }
header .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
header select { background: #4a4d52; color: #fff; border: 0; border-radius: 8px; padding: 6px 8px; max-width: 46vw; }
header .acts { display: flex; align-items: center; gap: 6px; }
header button { background: #4a4d52; color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; min-width: 40px; }
.badge { background: var(--gold); color: #fff; border-radius: 12px; padding: 3px 9px; font-size: 13px; white-space: nowrap; }
main { padding: 12px 12px 92px; max-width: 640px; margin: 0 auto; }
nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; background: none; border: 0; padding: 8px 2px 10px; font-size: 13px; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav button span { font-size: 22px; }
nav button.on { color: var(--g); font-weight: 700; box-shadow: inset 0 3px 0 var(--gold); }
h2 { font-size: 16px; margin: 16px 2px 8px; }
h3 { margin: 0 0 10px; font-size: 17px; }
label { display: block; margin: 12px 2px 6px; font-weight: 700; font-size: 14px; }
input, textarea, select { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
.btn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--g); border-color: var(--g); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.danger.big { background: var(--bad); color: #fff; }
.btn.sm { padding: 8px 10px; font-size: 14px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.big { padding: 20px 8px; font-size: 16px; }
.link { background: none; border: 0; color: var(--gold); font-weight: 700; padding: 14px; width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row.two > * { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 22px; padding: 9px 14px; font-weight: 600; }
.chip.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 18px 8px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tile span { font-size: 30px; }
.card { background: #fff; border: 1px solid var(--line); border-inline-start: 5px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.card.sent { border-inline-start-color: var(--gold); }
.card.ack { border-inline-start-color: #1976d2; }
.card.done { border-inline-start-color: var(--ok); }
.card.late { background: #fff6f5; }
.card .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.tag { background: var(--sand); border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: flex-start; }
.tag.okt { background: #e3f1e4; color: var(--ok); }
.txt { margin: 8px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; }
.txt.orig { color: var(--mut); font-size: 14px; border-top: 1px dashed var(--line); padding-top: 6px; }
.sub { color: var(--mut); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--mut); padding: 40px 0; }
.formhead { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.photo { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.photo img { max-height: 70px; max-width: 110px; border-radius: 8px; }
.photo img:not([src]), .photo img[src=""] { display: none; }
.bals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bal { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.bal b { font-size: 22px; }
.bal span { display: block; color: var(--mut); font-size: 13px; margin-top: 2px; }
.line { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.line span { color: var(--mut); font-size: 13px; }
.line i { color: var(--bad); font-style: normal; font-size: 13px; }
.line.pend { border-style: dashed; background: #fffaf0; }
.line.out { border-inline-start: 4px solid var(--bad); }
.line.in { border-inline-start: 4px solid var(--ok); }
.line .btn, .line .tag { align-self: flex-start; margin-top: 4px; }
.bar { display: block; width: 100%; background: #fff; border: 1.5px dashed var(--gold); border-radius: 10px; padding: 10px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.bar.warn { border-color: var(--bad); color: var(--bad); font-weight: 600; font-size: 13px; }
.sheet { display: none; position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .45); align-items: flex-end; }
.sheet.open { display: flex; }
.sheet .box { background: var(--sand); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 16px 16px 0 0; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.toast { position: fixed; bottom: 96px; inset-inline: 16px; z-index: 20; background: var(--g); color: #fff; border-radius: 10px; padding: 12px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); }
.login { max-width: 420px; margin: 0 auto; padding: 40px 18px; }
.login .logo { font-size: 30px; font-weight: 800; text-align: center; color: var(--g); border-bottom: 3px solid var(--gold); padding-bottom: 12px; margin-bottom: 18px; }
.login input { font-size: 22px; letter-spacing: 6px; text-align: center; }
.login .btn { width: 100%; margin-top: 18px; padding: 14px; }
