:root { --navy:#1f4e79; --gold:#b8860b; --bg:#f4f2ec; --card:#fff; --text:#1f2328; --muted:#6b7280; --line:#e6e2d6; --red:#c62828; --green:#2e7d32; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--navy); }
h1 { font-size: 22px; margin: 6px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 12px 14px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .r { text-align: right; } .c { text-align: center; }
.neg { color: var(--red) !important; } .pos { color: var(--green); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { width: 38px; height: 38px; background: #fff; border-radius: 50%; padding: 2px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: #e8d9a8; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 700; }
.menu-pop { position: absolute; right: 0; top: 44px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 230px; padding: 6px 0; }
.menu-pop a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; }
.menu-pop a:hover { background: #f5f5f5; }
.menu-who { padding: 10px 16px; font-weight: 700; border-bottom: 1px solid var(--line); color: var(--navy); }

/* bottom nav */
.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: 11.5px; }
.bottom a svg { width: 24px; height: 24px; }
.bottom a.on { color: var(--navy); font-weight: 700; }
.foot { text-align: center; padding: 18px 0 8px; } .foot img { width: 44px; opacity: .8; }

/* cards & stats */
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card.warn { background: #fff7e0; border: 1px solid #f1d58a; }
.hello { font-size: 18px; font-weight: 700; margin: 4px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat { background: #fff; border-radius: 14px; padding: 12px; border-top: 4px solid var(--c); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card .stat { box-shadow: none; background: #faf9f5; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 24px; margin-top: 2px; word-break: break-all; }
.stat small { color: var(--green); font-size: 12px; }
.grid2 { display: grid; gap: 12px; } @media (min-width: 800px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; } .quick .ghost { grid-column: span 2; }
@media (min-width: 720px) { .quick { grid-template-columns: repeat(3, 1fr); } .quick .ghost { grid-column: auto; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: 11px 16px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; }
.btn.alt { background: var(--green); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); width: 100%; margin-top: 4px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
form.inline { display: inline; }

/* forms */
.form label, .filters label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0; }
input, select { width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 1.5px solid #d6d1c2; border-radius: 10px; background: #fff; color: var(--text); margin-top: 4px; }
input:focus, select:focus { outline: none; border-color: var(--navy); }
input[type=checkbox] { width: 22px; height: 22px; margin: 0 8px 0 0; vertical-align: middle; }
label.check { display: flex; align-items: center; color: var(--text); }
.amount input { font-size: 30px; font-weight: 700; padding: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 4px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.label { font-size: 14px; color: var(--muted); margin: 10px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { display: none; }
.chip span { display: inline-block; padding: 9px 13px; border-radius: 20px; border: 1.5px solid #d6d1c2; background: #fff; font-size: 14.5px; cursor: pointer; }
.chip input:checked + span { background: var(--c, var(--navy)); border-color: var(--c, var(--navy)); color: #fff; font-weight: 600; }
.chips.small .chip span { padding: 7px 12px; }
.filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 10px; align-items: end; }
.filters label { margin: 4px 0; } .filters .btn { margin-top: 6px; }
.filters > * { min-width: 0; } .filters .btn { width: 100%; }
@media (min-width: 800px) { .filters { grid-template-columns: repeat(4, minmax(0,1fr)) auto auto; } .filters .btn { width: auto; } }
input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; min-height: 50px; }
.srows { display: grid; gap: 10px; }
.srow { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fcfbf8; }
.srow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.srow-head small { display: block; color: var(--muted); }
.srow .net { text-align: right; font-size: 12px; color: var(--muted); } .srow .net b { display: block; font-size: 22px; color: var(--navy); }
.sgrid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 10px; }
.sgrid label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.sgrid label.check { display: flex; grid-column: span 2; color: var(--text); margin-top: 12px; }
@media (min-width: 800px) { .sgrid { grid-template-columns: repeat(5, minmax(0,1fr)); } .sgrid label.check { grid-column: auto; } }
.srow.tot { display: flex; justify-content: space-between; background: #ffd54f; border: 0; font-size: 16px; }

/* tabs & lists */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { flex: none; padding: 9px 14px; border-radius: 20px; background: #fff; text-decoration: none; color: var(--text); font-size: 14px; border: 1px solid var(--line); }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f0ede4; }
.lines li:last-child { border-bottom: 0; }
.lines .grow, .grow { flex: 1; min-width: 0; }
.lines small, .grow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.lines small.by { font-size: 12px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 6px 6px 0 0; flex: none; }
.more { display: block; margin-top: 8px; font-weight: 600; text-decoration: none; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.day-head small { display: block; color: var(--muted); }
.sigs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; }
.sig { display: inline-block; font-size: 11.5px; padding: 2px 7px; border-radius: 10px; background: #eee; color: #888; }
.sig.on { background: #e3f2e5; color: var(--green); font-weight: 700; }
.btn-sign { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 10px; border: 1.5px solid var(--gold); background: #fff; color: var(--gold); font-weight: 700; cursor: pointer; }
.flash { padding: 11px 13px; border-radius: 10px; margin-bottom: 12px; background: #e3f2e5; color: #1b5e20; }
.flash.err { background: #fdecea; color: #b71c1c; }
.month-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; font-size: 18px; }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl td, .tbl th { padding: 8px 6px; border-bottom: 1px solid #f0ede4; }
.tbl th { background: var(--navy); color: #fff; font-size: 13px; } .tbl th a { color: #fff; }
.tbl tr.tot td { background: #ffd54f; font-weight: 700; }
.tbl.grid { font-size: 13px; min-width: 900px; } .tbl.grid td:first-child { white-space: nowrap; }
.sheet { border-collapse: collapse; min-width: 900px; width: 100%; font-size: 14px; }
.sheet th { background: var(--navy); color: #fff; padding: 8px 6px; font-size: 13px; text-align: left; }
.sheet td { padding: 6px; border-bottom: 1px solid #f0ede4; vertical-align: middle; }
.sheet td small { display: block; color: var(--muted); }
.sheet input, .sheet select { font-size: 15px; padding: 8px; margin: 0; } .sheet input.n { width: 100px; }
.sheet tr.tot td { background: #ffd54f; font-weight: 700; }
.signoff { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.so { border: 1.5px dashed #d6d1c2; border-radius: 12px; padding: 12px; } .so.on { border: 1.5px solid var(--green); background: #f3faf3; }
.so small { display: block; color: var(--muted); margin: 4px 0 8px; }

/* scan */
.photo-btn { display: block; margin: 8px 0; color: inherit !important; }
.preview { width: 100%; max-height: 360px; object-fit: contain; border-radius: 10px; margin-top: 10px; background: #eee; }
.status { margin-top: 12px; font-weight: 600; color: var(--navy); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 3px solid #c9d6e6; border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-item { display: flex; gap: 12px; } .scan-item img { width: 84px; height: 110px; object-fit: cover; border-radius: 8px; background: #eee; }

/* login & setup */
.login { text-align: center; padding-top: 24px; } .login .card { text-align: left; max-width: 420px; margin: 16px auto; }
.login-logo { width: 130px; } .login h1 { margin: 8px 0 0; color: var(--navy); }
.code { background: #1f2328; color: #e8d9a8; padding: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.checks { list-style: none; padding: 0; } .checks .ok { color: var(--green); } .checks .bad { color: var(--red); font-weight: 700; }

@media print {
  .top, .bottom, .btn, .tabs, .month-nav a, form { display: none !important; }
  body { background: #fff; padding: 0; } .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
.sgrid input[type=date], .filters input[type=date] { font-size: 15px; padding: 12px 6px; }
.day-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.daydl { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.daydl label { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); margin: 0; }
.daydl .btn { padding: 13px 14px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.langbtn { color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 16px; padding: 5px 11px; white-space: nowrap; }
.login-lang { text-align: right; } .login-lang .langbtn { color: var(--navy); border-color: var(--navy); display: inline-block; }
html[lang=bn] body { font-size: 16.5px; }
