/* ব্যবসা হিসাব — ওয়েব ভার্সন (অ্যাপের রং ও ফন্টের সাথে মিল রেখে) */
@font-face { font-family: 'HisabBangla'; font-weight: 400; font-display: swap; src: url('fonts/HindSiliguri-Regular.ttf') format('truetype'); }
@font-face { font-family: 'HisabBangla'; font-weight: 700; font-display: swap; src: url('fonts/HindSiliguri-Bold.ttf') format('truetype'); }

:root {
  --bg: #F5F2EA;
  --surface: #FFFFFF;
  --ink: #22301F;
  --ink-soft: #5B6155;
  --primary: #1F5C42;
  --primary-dark: #143A29;
  --accent: #A9762F;
  --line: #DCD3BE;
  --danger: #9B3B2E;
  --good-bg: #E9F0E5;
  --warn-row: #F3DFA0;
  --danger-row: #F0C7BC;
  --delivered-row: #D7ECCF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'HisabBangla', 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }

.page { max-width: 1100px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
.page.narrow { max-width: 520px; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.topbar h1 { flex: 1; font-size: 19px; margin: 0; font-weight: 700; line-height: 1.3; }
.back { background: var(--surface); border: 0; border-radius: 999px; padding: 6px 16px; font-size: 18px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 999px; padding: 9px 20px; cursor: pointer; font-weight: 700; background: var(--primary); color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.accent { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.dark { background: var(--primary-dark); }
.btn.light { background: var(--surface); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--danger); font-size: 20px; padding: 4px 10px; }
.btn.small { padding: 5px 14px; font-size: 13px; }
.btn.faded { opacity: .45; }
/* বাটন পুরো স্ক্রিন জুড়ে নয় — লেখার মাপে, নিজের জায়গায় */
.btn.block { display: inline-block; width: auto; margin: 0 8px 8px 0; }
.btn-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.btn-stack .btn.block { margin: 0; }
.btn-center { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0; }
.btn-center .btn.block { margin: 0; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- date bar ---------- */
.datebar { display: flex; align-items: center; gap: 10px; background: var(--primary); color: #fff; border-radius: 16px; padding: 6px 8px 6px 14px; margin-bottom: 12px; }
.datebar .d { flex: 1; font-weight: 700; font-size: 15px; }
.datebar input[type=date] { border: 0; border-radius: 999px; padding: 4px 6px; font-size: 13px; }

/* ---------- stat boxes ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.stat { background: var(--surface); padding: 10px 12px; border-radius: 14px; min-width: 0; }
.stat.good { background: var(--good-bg); }
.stat .l { font-size: 12px; color: var(--ink-soft); }
.stat .v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.stat input { width: 100%; border: 0; background: transparent; font-size: 18px; font-weight: 700; padding: 0; outline: none; }
.stat input:focus { border-bottom: 2px solid var(--primary); }
.pos { color: var(--primary); }
.neg { color: var(--danger); }
.soft { color: var(--ink-soft); }
.note { color: var(--ink-soft); font-size: 13px; margin: 4px 0 10px; }
.note.link { cursor: pointer; text-decoration: underline dotted; }

/* ---------- tiles / cards ---------- */
.tile { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); border-radius: 16px; padding: 16px; margin-bottom: 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tile b { display: block; font-size: 17px; }
.tile span { color: var(--ink-soft); font-size: 13px; }
.tile.good { background: var(--good-bg); }
.tile.accent { background: var(--accent); color: #fff; display: flex; align-items: center; }
.tile.accent b { flex: 1; font-size: 16px; }
.tile.accent span { color: #fff; font-weight: 700; }
.tile.notice { background: var(--primary); color: #fff; display: flex; align-items: center; }
.tile.notice b { font-size: 16px; }
.tile.notice span { color: #E9F0E5; }
.tile.notice > span { color: #fff; font-weight: 700; }
textarea.notice-input { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; background: #fff; }
.notice-text { white-space: pre-wrap; font-size: 15px; overflow-wrap: anywhere; }
.card { background: var(--surface); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.card.good { background: var(--good-bg); }
.card.click { cursor: pointer; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card .sub { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 8px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.mini-stats .l { font-size: 11px; color: var(--ink-soft); }
.mini-stats .v { font-weight: 700; }
.boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.boxes > div { background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.boxes > div.good { background: var(--good-bg); }
.boxes .l { font-size: 11px; color: var(--ink-soft); }
.boxes .v { font-weight: 700; font-size: 15px; }
h2.section { font-size: 15px; margin: 18px 0 8px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: var(--surface); border-radius: 8px; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; min-width: 100%; }
table.grid th { background: var(--bg); text-align: left; font-size: 13px; padding: 8px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.grid td { padding: 3px 4px; border-bottom: 1px solid #efe9da; vertical-align: middle; }
table.grid td.ro { padding: 6px 8px; font-size: 14px; }
table.grid input, table.grid select {
  width: 100%; min-width: 110px; border: 1px solid transparent; background: transparent; padding: 6px 6px; border-radius: 6px; outline: none;
}
table.grid input:hover { border-color: var(--line); }
table.grid input:focus, table.grid select:focus { border-color: var(--primary); background: #fff; }
table.grid input:disabled { color: var(--ink-soft); }
table.grid input.cr { color: var(--primary); font-weight: 700; }
table.grid input.bad { color: var(--danger); border-color: var(--danger); }
table.grid tr.locked td { background: var(--good-bg); }
table.grid tr.archived td { background: var(--bg); }
table.grid tr.pending td { color: var(--ink-soft); }
table.grid tr.row-danger td { background: var(--danger-row); }
table.grid tr.row-warn td { background: var(--warn-row); }
table.grid tr.row-delivered td { background: var(--delivered-row); }
table.grid tfoot td { font-weight: 700; background: var(--good-bg); padding: 8px; }
.cellflex { display: flex; align-items: center; gap: 4px; }
.cellflex input { min-width: 100px; }
.warn { color: var(--danger); font-size: 11px; padding: 0 6px 2px; }
.tag { font-size: 12px; color: var(--primary); white-space: nowrap; padding: 0 6px; }
.num { text-align: right; }
select.status { font-weight: 700; min-width: 120px; }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.status-text { color: var(--danger); min-height: 22px; margin-top: 8px; font-size: 14px; }
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 28px; margin: 0; color: var(--primary); }
/* M.B.D.T.C লোগো */
.hero-logo { display: block; width: 110px; height: 110px; margin: 0 auto 14px; border-radius: 50%; box-shadow: 0 6px 18px rgba(14,31,84,.22); }
.topbar-logo { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.hero p { color: var(--ink-soft); margin: 6px 0 0; }

/* ---------- report view ---------- */
iframe.report { width: 100%; height: calc(100vh - 170px); min-height: 400px; border: 0; background: #fff; border-radius: 8px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 12px; color: var(--ink-soft); white-space: pre-line; }
.modal input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #22301F; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: .95; }

.notif { cursor: pointer; }
.notif.unread { background: var(--good-bg); }
.notif .t { font-weight: 700; }
.notif .time { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

@media (max-width: 480px) {
  .page { padding: 12px; }
  .stat .v, .stat input { font-size: 16px; }
  .topbar h1 { font-size: 17px; }
}
@media print {
  .noprint { display: none !important; }
}

a.btn { text-decoration: none; display: inline-block; }
