/* ===== UDYOG fillable form ===== */
:root {
  --green: #0f3d2e;
  --green2: #1f6f4a;
  --accent: #f5b301;
  --bg: #eef1ef;
  --line: #e1e7e3;
  --muted: #5f6b65;
  --ink: #000;
  --focus: #1a73e8;
  --warn: #d93025;
  --sb-w: 264px;
  --tb-h: 56px;
  --s: 1.5;               /* CSS px per PDF point (zoom) – set by JS */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: "UdyogBangla", "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif;
  color: #1d2421;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; }

/* ---------- SVG icons (no emoji anywhere) ---------- */
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 26px; height: 26px; }
.ic.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- page modes: policy first, then the form ---------- */
html.mode-policy .app, html.mode-policy #drawer, html.mode-policy .print-extras { display: none !important; }
html.mode-form #policyView { display: none; }

/* developer badge */
.dev-badge { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px 4px 10px; text-decoration: none; color: #5b6762; font-size: 11px; line-height: 1; flex: none; }
.dev-badge img { display: block; height: 22px; width: auto; }

/* =====================================================================
   FORM APP LAYOUT: sidebar + slim top bar
   ===================================================================== */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }

/* ---- sidebar ---- */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-right: 1px solid var(--line); padding: 14px 12px 16px;
  display: flex; flex-direction: column; gap: 14px; z-index: 60; scrollbar-width: thin; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-logo { display: block; width: auto; height: 40px; max-width: 100%; object-fit: contain; flex: none; }
.sb-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; line-height: 1.25; }
.sb-brand .brand-logo { height: 56px; }
.sb-brand span { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.sb-close { display: none; border: 0; background: #f2f5f3; color: #33403b; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; place-items: center; }
.sb-card { background: #f5f8f6; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.sb-row { display: flex; align-items: center; justify-content: space-between; }
.sb-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #33403b; }
.sb-card select { width: 100%; font: inherit; font-size: 14px; min-height: 38px; border: 1px solid #cdd7d1; border-radius: 8px; background: #fff; color: #1d2421; padding: 6px 8px; }
.sb-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sb-mini { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #cdd7d1; background: #fff; color: var(--green);
  border-radius: 8px; padding: 6px 8px; font-size: 13.5px; cursor: pointer; }
.sb-mini:hover { background: #eaf5ef; border-color: #b9d9c7; }
.sb-progress { display: grid; gap: 8px; text-align: left; width: 100%; cursor: pointer; border: 1px solid #cfe5d8; border-radius: 12px; padding: 12px;
  background: linear-gradient(180deg, #f2faf5, #e8f4ed); color: #1d2421; }
.sb-progress:hover { border-color: var(--green2); }
.sbp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.sbp-top b { font-size: 16px; color: var(--green); }
.sb-progress .pbar { display: block; width: 100%; height: 8px; border-radius: 4px; background: #d5e6dc; overflow: hidden; }
.sb-progress .pbar i { display: block; height: 100%; width: 0; background: var(--green2); transition: width .3s; }
.sb-progress.done .pbar i { background: #1e9e4a; }
.sbp-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--green2); font-weight: 600; }
.sb-group { display: grid; gap: 2px; }
.sb-title { font-size: 11.5px; font-weight: 700; color: #8a9690; letter-spacing: .04em; padding: 0 8px 4px; }
.sb-item, .sb-nav a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; color: #26332e;
  border-radius: 8px; padding: 8px 10px; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.35; }
.sb-item:hover, .sb-nav a:hover { background: #f0f5f2; }
.sb-item .ic { width: 18px; height: 18px; color: var(--green2); }
.sb-item span { flex: 1; }
.sb-item.danger { color: #b3261e; } .sb-item.danger .ic { color: #b3261e; } .sb-item.danger:hover { background: #fdf1ef; }
.sb-nav { display: grid; gap: 1px; }
.sb-nav a { position: relative; }
.sb-nav .pn { width: 24px; height: 24px; border-radius: 50%; background: #eef2f0; color: #4b5753; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.sb-nav .pt { flex: 1; }
.sb-nav a.active { background: #e6f2eb; color: var(--green); font-weight: 700; }
.sb-nav a.active .pn { background: var(--green); color: #fff; }
.sb-nav a.miss::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e37400; flex: none; }
.sb-switch { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer;
  border-radius: 8px; padding: 8px 10px; font-size: 14px; color: #26332e; user-select: none; }
.sb-switch:hover { background: #f0f5f2; }
.sw-text { flex: 1; display: inline-flex; align-items: center; gap: 10px; }
.sw-text .ic { width: 18px; height: 18px; color: var(--green2); }
.sw-text small { color: #8a9690; font-size: 11.5px; }
.sw-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sw { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #cdd7d1; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.sw-input:checked + .sw, .sw.on { background: var(--green2); }
.sw-input:checked + .sw::after, .sw.on::after { transform: translateX(16px); }
.sw-input:focus-visible + .sw { outline: 2px solid var(--focus); outline-offset: 2px; }
.sb-switch.phon.on { background: #fff8e5; }
.sb-dev { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: #8a9690; font-size: 11.5px;
  border-top: 1px solid var(--line); padding-top: 12px; }
.sb-dev img { height: 26px; width: auto; display: block; }
.sb-overlay { display: none; }
.cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #1d2421; font-size: 12px; line-height: 18px; text-align: center; font-weight: 700; }
.cnt:empty { display: none; }

/* ---- slim top bar ---- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px; min-height: var(--tb-h);
  padding: 8px 16px; background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.tb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tb-title strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status:empty { display: none; }
.grp { display: flex; gap: 4px; align-items: center; }
.topbar button { cursor: pointer; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.1); color: #fff;
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.topbar button:hover { background: rgba(255,255,255,.22); }
.tb-icon { width: 38px; padding: 0; }
.tb-icon .ic { width: 19px; height: 19px; }
.tb-zoom { padding: 0 8px; font-size: 13px; min-width: 52px; }
.tb-btn { padding: 0 14px; font-size: 14.5px; font-weight: 700; }
.tb-btn.secondary { background: #fff; color: var(--green); border-color: #fff; }
.tb-btn.secondary:hover { background: #eaf5ef; }
.tb-btn.primary { background: var(--accent); color: #1d2421; border-color: var(--accent); }
.tb-btn.primary:hover { background: #ffc629; }
.topbar button:disabled { opacity: .6; cursor: wait; }
#menuBtn { display: none; }

/* ---------- pages ---------- */
.pages { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 20px 16px 60px; }
.page {
  position: relative;
  width: calc(var(--s) * 595.32px);
  height: calc(var(--s) * 841.92px);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.14);
  flex: none;
  scroll-margin-top: calc(var(--tb-h) + 14px);
}
.page > img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  user-select: none; pointer-events: none; -webkit-user-drag: none;
}
.layer { position: absolute; inset: 0; }
/* the helper layer covers the whole page: let clicks pass through to the fields, except on its own buttons */
.helpers { pointer-events: none; }
.helpers > button { pointer-events: auto; }
.render { display: none; pointer-events: none; }
.pg-no { position: absolute; top: calc(var(--s) * 6px); right: calc(var(--s) * 8px); font-size: 11px; color: #9aa59f; }

/* ---------- fields ---------- */
.f {
  position: absolute; margin: 0;
  border: 1px dashed transparent; border-radius: 2px;
  background: rgba(26,115,232,.045);
  color: var(--ink);
  font-family: "UdyogBangla", "Nirmala UI", sans-serif;
  font-size: calc(var(--s) * var(--fs, 11) * 1px);
  line-height: calc(var(--s) * var(--lh, 15) * 1px);
  padding: calc(var(--s) * var(--pt, 2) * 1px) calc(var(--s) * 3px) 0;
  outline: none; resize: none; overflow: hidden;
  transition: background .12s, border-color .12s;
}
.f:hover { border-color: rgba(26,115,232,.45); }
.f:focus { background: rgba(255,255,255,.9); border: 1px solid var(--focus); box-shadow: 0 0 0 2px rgba(26,115,232,.2); z-index: 2; }
.f::placeholder { color: #9aa59f; opacity: 1; font-size: .85em; }
textarea.f { white-space: pre-wrap; overflow-wrap: anywhere; }
input.f { padding-top: 0; }
.f.center { text-align: center; }
.f.char { text-align: center; padding: 0; font-size: calc(var(--s) * 12px); text-transform: uppercase; }
.f.upper { text-transform: uppercase; }
.f.invalid { border: 1px solid var(--warn) !important; background: rgba(217,48,37,.07); }
.f.overflow { border: 1px solid #e37400 !important; background: rgba(227,116,0,.08); }
.f.missing { border: 1px dashed var(--warn); background: rgba(217,48,37,.06); }
.f.no-border:not(:focus):not(:hover) { background: rgba(26,115,232,.03); }

/* image boxes */
.imgbox { position: absolute; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px dashed rgba(26,115,232,.45); background: rgba(26,115,232,.04); overflow: hidden; }
.imgbox:hover, .imgbox:focus-within { border-color: var(--focus); background: rgba(26,115,232,.08); }
.imgbox img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgbox.contain img { object-fit: contain; }
.imgbox .ph { font-size: calc(var(--s) * 9px); color: #5f6b65; text-align: center; padding: 4px; line-height: 1.4; }
.imgbox input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.imgbox .rm { position: absolute; top: 2px; right: 2px; z-index: 3; border: 0; border-radius: 50%; width: 22px; height: 22px;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.imgbox .rm .ic { width: 13px; height: 13px; }
.imgbox .rm.ed { right: 28px; }
.imgbox:not(.has) .rm { display: none; }
.imgbox.has { border-color: transparent; background: transparent; }
.imgbox.has:hover { border-color: var(--focus); }
.imgbox.has .ph { display: none; }
.imgbox:not(.has) img { display: none; }

/* helper buttons beside cells (screen only) */
.hbtn { position: absolute; z-index: 3; border: 1px solid #c9d3ce; background: #fff; color: var(--green);
  border-radius: 4px; width: 24px; height: 22px; padding: 0; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12); opacity: .85;
  display: inline-flex; align-items: center; justify-content: center; }
.hbtn .ic { width: 15px; height: 15px; }
.hbtn:hover { opacity: 1; border-color: var(--green2); }
.tool-btn { position: absolute; z-index: 3; border: 1px solid var(--green2); background: #eaf5ef; color: var(--green);
  border-radius: 4px; font-size: calc(var(--s) * 8px); cursor: pointer; white-space: nowrap; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.tool-btn:hover { background: #d4ecdf; }
.badge { position: absolute; z-index: 3; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #eaf5ef; color: var(--green);
  border: 1px solid #b9d9c7; pointer-events: none; }
.badge.over { background: #fdecea; color: var(--warn); border-color: #f3b5ae; }

/* print/preview text layer */
.rf { position: absolute; overflow: visible; }
.rl { position: absolute; left: 0; right: 0; white-space: pre; color: var(--ink); font-family: "UdyogBangla", "Nirmala UI", sans-serif; }
.rimg { position: absolute; object-fit: cover; }
.rimg.contain { object-fit: contain; }
body.preview .fields, body.preview .helpers { display: none; }
body.preview .render { display: block; }

/* focus flash when jumping from the checklist */
.f.flash, .imgbox.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(245,179,1,.85); background: rgba(245,179,1,.18); } 100% { box-shadow: none; } }
body.phonetic-on .f:focus:not(.upper):not([lang=en]) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,179,1,.35); }

/* date picker (hidden, opened programmatically) */
.date-pick { position: fixed; left: -9999px; top: 0; opacity: 0; width: 1px; height: 1px; }

/* ---------- toast + small popover ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 140;
  background: #1d2421; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  display: flex; gap: 8px; align-items: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ic { width: 20px; height: 20px; flex: none; }
.toast.t-ok .ic { color: #6fdc8c; } .toast.t-warn .ic { color: var(--accent); } .toast.t-err .ic { color: #ff8a80; } .toast.t-info .ic { color: #9ecbff; }
.pop { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pop[hidden] { display: none; }
.pop-card { background: #fff; border-radius: 12px; padding: 16px 18px; min-width: 260px; box-shadow: 0 8px 30px rgba(0,0,0,.3); display: grid; gap: 10px; }
.pop-title { font-weight: 700; color: var(--green); font-size: 16px; display: flex; align-items: center; gap: 6px; }
.pop-card label { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.pop-card input { font: inherit; width: 90px; padding: 4px 6px; border: 1px solid #c9d3ce; border-radius: 6px; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pop-actions button { padding: 8px 14px; border-radius: 8px; cursor: pointer; border: 1px solid var(--green); display: inline-flex; align-items: center; gap: 5px; }
.pop-actions .primary { background: var(--green); color: #fff; }
.pop-actions .secondary { background: #fff; color: var(--green); }

/* ---------- right drawer (checklist, attachments, Excel, profiles) ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(440px, 100vw); background: #fff; color: #1d2421;
  box-shadow: -4px 0 20px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7faf8; }
.drawer-head h2 { margin: 0; font-size: 17px; color: var(--green); display: flex; align-items: center; gap: 6px; }
.drawer-head button { border: 0; background: #eef2f0; color: #33403b; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; font-size: 14px; overscroll-behavior: contain; }
@media (min-width: 1280px) { body.drawer-open .pages { padding-right: 456px; } }
.btn { font-size: 13.5px; cursor: pointer; border: 1px solid #b9d9c7; background: #eaf5ef; color: var(--green);
  border-radius: 8px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn:hover { background: #d4ecdf; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.sm { padding: 2px 8px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.dr-note { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.dr-warn { color: var(--warn); font-size: 13px; }
.dr-check { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.dr-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.dr-tools input { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid #c9d3ce; border-radius: 8px; min-width: 0; }
.dr-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.dr-foot p { width: 100%; margin: 0 0 4px; color: var(--muted); font-size: 13px; }

/* checklist */
.cl-head { display: flex; gap: 12px; align-items: center; background: #f3f7f5; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.cl-head small { color: var(--muted); }
.cl-big { font-size: 28px; font-weight: 700; color: var(--green); }
.cl-ok { color: #1e7b3c; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.cl-sec { font-size: 15px; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.cl-sec.miss { color: var(--warn); } .cl-sec.error { color: #b3261e; } .cl-sec.warn { color: #b06000; } .cl-sec.info { color: #17406b; }
.cl-group { font-size: 12.5px; color: var(--muted); margin: 8px 0 3px; font-weight: 700; }
.cl-item { display: block; width: 100%; text-align: left; font-size: 13.5px; border: 1px solid var(--line); background: #fff;
  border-left: 4px solid #e37400; border-radius: 8px; padding: 7px 9px; margin: 3px 0; cursor: pointer; color: inherit; }
.cl-item.miss { border-left-color: var(--warn); } .cl-item.error { border-left-color: #b3261e; } .cl-item.info { border-left-color: #2f6fb3; }
.cl-item:hover { background: #f6f9f7; }

/* profiles */
.prof-list { display: grid; gap: 6px; }
.prof-row { display: flex; gap: 4px; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.prof-row.cur { border-color: var(--green2); background: #f3f9f5; }
.pr-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer; padding: 4px 6px; display: flex; flex-direction: column; color: inherit; }
.pr-open b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-open small { color: var(--muted); font-size: 12px; }
.pr-i { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pr-i:hover { background: #eaf5ef; } .pr-i.danger:hover { background: #fdecea; }

/* attachments */
.att-slot { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 10px 0; }
.att-slot.drag { border-color: var(--green2); background: #eaf5ef; }
.att-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.att-h small { color: var(--muted); font-size: 12px; }
.att-list { display: grid; gap: 4px; margin: 6px 0; }
.att-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.att-item img, .att-pdf { width: 46px; height: 34px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; flex: none; }
.att-pdf { display: inline-flex; align-items: center; justify-content: center; background: #fdecea; color: #b3261e; font-weight: 700; font-size: 11px; }
.att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item button { border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.att-item button .ic { width: 14px; height: 14px; }
.att-item button.danger:hover { background: #fdecea; }
.att-add { cursor: pointer; }
.att-cap { position: absolute; font-size: calc(var(--s) * 10px); color: #333; white-space: nowrap; overflow: hidden; }
.print-extras { display: none; }

/* bulk */
.bulk-steps { padding-left: 20px; margin: 0 0 10px; display: grid; gap: 8px; }
.bulk-steps small { color: var(--muted); }
.bulk-busy { background: #f3f7f5; border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; margin: 8px 0; }
.bulk-busy[hidden] { display: none; }
.bulk-busy .bar { height: 8px; background: #dfe7e2; border-radius: 4px; overflow: hidden; }
.bulk-busy .bar i { display: block; height: 100%; width: 0; background: var(--green2); transition: width .2s; }
.bulk-sum { margin: 10px 0 6px; } .bulk-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ok { color: #1e7b3c; } .bad { color: #b3261e; } .warn { color: #b06000; }
.bulk-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.bulk-tbl th, .bulk-tbl td { border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: left; vertical-align: middle; }
.bulk-tbl th { color: var(--muted); font-weight: 600; }
.bulk-tbl .nid { font-size: 12px; color: var(--muted); }

/* ---------- modals (photo editor, notice, signature) ---------- */
.modal { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.3); display: grid; gap: 12px; max-width: 100%; max-height: 100%; overflow: auto; }
.pe-body { display: flex; gap: 16px; flex-wrap: wrap; }
.pe-frame { display: grid; gap: 4px; justify-items: center; }
.pe-frame canvas { border: 2px solid var(--green); cursor: grab; touch-action: none; background: #fff; max-width: 70vw; height: auto !important; }
.pe-frame canvas:active { cursor: grabbing; }
.pe-hint { font-size: 12px; color: var(--muted); }
.pe-ctrl { display: grid; gap: 10px; align-content: start; min-width: 220px; }
.pe-ctrl label { display: grid; gap: 2px; font-size: 14px; }
.pe-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.notice-card, .sign-card { width: min(600px, 100%); }
.notice-card h2, .sign-card h2 { margin: 0; text-align: center; font-size: 20px; color: var(--green); }
.mc-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: #eaf5ef; color: var(--green); }
.mc-icon .ic { width: 28px; height: 28px; }
.mc-icon.warn { background: #fff3d6; color: #b06000; }
.notice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notice-list li { display: flex; gap: 12px; align-items: flex-start; background: #f5f9f7; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.notice-list li > .ic { width: 20px; height: 20px; color: var(--green2); margin-top: 3px; }
.skip { display: flex; gap: 6px; align-items: center; font-size: 14px; color: #4b5753; cursor: pointer; }
.sign-lead { margin: 0; text-align: center; color: #3b4743; }
.sign-preview { position: relative; width: 360px; max-width: 100%; height: 92px; margin: 0 auto; border: 1px solid #c9d3ce; border-radius: 8px;
  background: #fff url("../assets/pages/p7.png") no-repeat; background-size: 494px auto; background-position: -30px -249px; overflow: hidden; }
.sp-mark { position: absolute; left: 112px; top: 56px; display: inline-flex; gap: 4px; align-items: center; background: rgba(245,179,1,.92);
  color: #1d2421; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 12px; box-shadow: 0 0 0 4px rgba(245,179,1,.3); }
.sign-steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-size: 14px; }

/* ---------- footer (developer credit) ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 16px 16px 20px; position: relative; z-index: 1; }
html.mode-form .site-footer { margin-left: var(--sb-w); }
.sf-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; text-align: left; }
.sf-logo img { display: block; height: 30px; width: auto; }
.sf-text { font-size: 14px; color: #33403b; display: grid; gap: 2px; }
.sf-text a { color: var(--green); text-decoration: none; } .sf-text a:hover { text-decoration: underline; }
.sf-text small { color: #66736e; font-size: 12px; }

/* =====================================================================
   POLICY PAGE – minimal & compact
   ===================================================================== */
.policy-view { --pv-ink: #1b2622; --pv-muted: #5d6a65; --pv-line: #e3e9e5;
  background: #f6f8f7; color: var(--pv-ink); font-size: 15px; line-height: 1.6;
  font-family: "Nirmala UI", "Noto Sans Bengali", "Hind Siliguri", "UdyogBangla", system-ui, sans-serif; }
.pv-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.pv-bar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--pv-line); backdrop-filter: saturate(1.2) blur(6px); }
.pv-bar-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.pv-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; line-height: 1.25; }
.pv-brand .brand-logo { height: 48px; }
.pv-brand-sub { font-size: 12px; font-weight: 600; color: var(--pv-muted); border-left: 1px solid var(--pv-line); padding-left: 12px; white-space: nowrap; }
.pv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14.5px; cursor: pointer;
  border-radius: 9px; padding: 8px 14px; border: 1px solid transparent; text-decoration: none; font-weight: 700; white-space: nowrap; }
.pv-btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.pv-btn.primary:hover { background: #164e3a; }
.pv-btn.block { width: 100%; padding: 11px 14px; font-size: 15.5px; }
.pv-head { padding-top: 22px; padding-bottom: 6px; }
.pv-eyebrow { margin: 0 0 6px; font-size: 12.5px; color: var(--pv-muted); }
.pv-head h1 { margin: 0 0 6px; font-size: clamp(20px, 2.6vw, 25px); line-height: 1.4; color: var(--green); }
.pv-lead { margin: 0 0 12px; color: #3c4944; }
.pv-alert { display: flex; gap: 10px; align-items: flex-start; background: #fff8e6; border: 1px solid #f3dd9b; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.pv-alert .ic { color: #b07800; width: 20px; height: 20px; margin-top: 3px; }
.pv-alert p { margin: 0; font-size: 14px; } .pv-alert span { color: #6b5a2a; }
.pv-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0; background: #fff; border: 1px solid var(--pv-line); border-radius: 12px; overflow: hidden; }
.pv-stats div { padding: 10px 12px; border-right: 1px solid var(--pv-line); }
.pv-stats div:last-child { border-right: 0; }
.pv-stats dt { font-size: 12px; color: var(--pv-muted); }
.pv-stats dd { margin: 0; font-size: 17px; font-weight: 700; color: var(--green); }
.pv-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding-top: 16px; padding-bottom: 28px; align-items: start; }
.pv-col-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.pv-col-head h2 { margin: 0; font-size: 16px; color: #33403b; }
.pv-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--green2); cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.pv-link:hover { background: #eaf3ee; }
.pv-sec { background: #fff; border: 1px solid var(--pv-line); border-radius: 10px; margin-bottom: 6px; overflow: hidden; scroll-margin-top: 70px; }
.pv-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pv-sec > summary::-webkit-details-marker { display: none; }
.pv-sec > summary:hover { background: #f8faf9; }
.pv-sec[open] > summary { border-bottom: 1px solid var(--pv-line); }
.pv-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #e7f1eb; color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.pv-sec[open] .pv-num { background: var(--green); color: #fff; }
.pv-h { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.pv-h b { font-size: 15px; } .pv-h small { color: var(--pv-muted); font-size: 13px; }
.pv-ref { flex: none; font-size: 11.5px; color: var(--pv-muted); }
.pv-chev { color: var(--pv-muted); transition: transform .2s; width: 18px; height: 18px; }
.pv-sec[open] .pv-chev { transform: rotate(180deg); }
.pv-sec > :not(summary) { margin: 10px 14px; }
.pv-list { padding-left: 20px; } .pv-list li { margin: 3px 0; font-size: 14.5px; }
.pv-ticks { list-style: none; padding: 0; display: grid; gap: 4px; }
.pv-ticks li { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.pv-ticks .ic { width: 17px; height: 17px; margin-top: 4px; }
.pv-ticks.good .ic { color: #1e7b3c; } .pv-ticks.bad .ic { color: #b3261e; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-chips span { background: #f0f5f2; color: #2c4a3c; border: 1px solid var(--pv-line); border-radius: 14px; padding: 2px 9px; font-size: 13px; }
.pv-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; border-radius: 8px; padding: 7px 10px; }
.pv-line .ic { width: 17px; height: 17px; margin-top: 3px; }
.pv-line.bad { background: #fdf3f1; color: #7a1d16; } .pv-line.warn { background: #fff8e6; color: #5f4600; }
.pv-mini { font-size: 13.5px; color: #3c4944; background: #f6f8f7; border-radius: 8px; padding: 7px 10px; }
.pv-flow { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; counter-reset: fl; }
.pv-flow li { counter-increment: fl; font-size: 13px; background: #f0f5f2; border: 1px solid var(--pv-line); border-radius: 14px; padding: 2px 10px; }
.pv-flow li::before { content: counter(fl, bengali) ". "; color: var(--green2); font-weight: 700; }
.pv-src { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--pv-muted); margin: 12px 2px 0; }
.pv-src .ic { margin-top: 3px; }
.pv-src a { color: var(--green2); font-weight: 600; }
.pv-side { position: sticky; top: 68px; display: grid; gap: 10px; }
.pv-card { background: #fff; border: 1px solid var(--pv-line); border-radius: 12px; padding: 12px; }
.pv-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f0f4f2; border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.pv-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; border-radius: 7px; padding: 7px 6px;
  font-size: 13.5px; font-weight: 600; color: var(--pv-muted); cursor: pointer; }
.pv-tabs button[aria-selected="true"] { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pv-field { display: grid; gap: 3px; margin-bottom: 9px; font-size: 13.5px; font-weight: 600; color: #33403b; }
.pv-field input { font: inherit; font-weight: 400; font-size: 15px; padding: 7px 10px; border: 1px solid #cdd7d1; border-radius: 8px; background: #fff; min-width: 0; }
.pv-field input:focus { outline: 2px solid var(--green2); outline-offset: 1px; }
.pv-age { font-size: 13.5px; margin: -2px 0 8px; color: var(--green); display: flex; gap: 6px; align-items: center; }
.pv-age:empty { display: none; }
.pv-qs { display: grid; gap: 0; border: 1px solid var(--pv-line); border-radius: 9px; overflow: hidden; }
.pv-qs fieldset { border: 0; border-bottom: 1px solid var(--pv-line); margin: 0; padding: 6px 8px 6px 10px; display: flex; align-items: center; gap: 6px; }
.pv-qs fieldset:last-child { border-bottom: 0; }
.pv-qs legend { float: left; flex: 1; padding: 0; font-size: 13.5px; margin-right: auto; }
.pv-qs label { position: relative; cursor: pointer; }
.pv-qs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pv-qs label span { display: inline-block; min-width: 42px; text-align: center; font-size: 13px; padding: 3px 8px; border: 1px solid #cdd7d1; border-radius: 7px; background: #fff; }
.pv-qs input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.pv-qs input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.pv-result { margin-top: 10px; border-radius: 9px; padding: 8px 10px; font-size: 13.5px; }
.pv-result h3 { margin: 0 0 2px; font-size: 14.5px; display: flex; gap: 6px; align-items: center; }
.pv-result ul { margin: 4px 0 0; padding-left: 18px; } .pv-result p { margin: 3px 0 0; }
.pv-result.good { background: #effaf3; color: #13542a; } .pv-result.bad { background: #fdf1ef; color: #7a1d16; }
.pv-result.wait { background: #f4f7f5; color: var(--pv-muted); display: flex; gap: 6px; align-items: center; }
.pv-calc-grid { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 2px 0 6px; }
.pv-calc-grid div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; background: #f4f7f5; border-radius: 9px; padding: 8px 10px; }
.pv-calc-grid span { font-size: 13px; color: var(--pv-muted); } .pv-calc-grid b { font-size: 17px; color: var(--green); }
.pv-calc-grid small { width: 100%; font-size: 12px; color: var(--pv-muted); }
.pv-calc-grid .loan { background: #eef5fd; } .pv-calc-grid .grant { background: #effaf3; }
.pv-note { display: flex; gap: 8px; align-items: flex-start; border-radius: 9px; padding: 8px 10px; font-size: 13.5px; }
.pv-note .ic { width: 17px; height: 17px; margin-top: 3px; }
.pv-note.warn { background: #fff8e6; color: #5f4600; } .pv-note.bad { background: #fdf3f1; color: #7a1d16; }
.pv-small { font-size: 12.5px; color: var(--pv-muted); margin: 8px 0 0; }
.pv-mcta { display: none; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
/* tablet & phone: sidebar becomes an off-canvas panel */
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  html.mode-form .site-footer { margin-left: 0; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 100;
    transform: translateX(-105%); transition: transform .25s ease; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  body.sb-open .sidebar { transform: none; }
  .sb-overlay { position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.4); }
  body.sb-open .sb-overlay { display: block; }
  body.sb-open { overflow: hidden; }
  .sb-close { display: grid; }
  #menuBtn { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .sw, .sw::after { transition: none; } }

/* policy: one column below 900px, sticky bottom CTA */
@media (max-width: 899px) {
  .pv-body { grid-template-columns: minmax(0, 1fr); }
  .pv-side { position: static; }
  .pv-side > .pv-btn { display: none; }
  .pv-mcta { display: block; position: sticky; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(246,248,247,.95); border-top: 1px solid var(--pv-line); backdrop-filter: blur(6px); }
  .pv-stats { grid-template-columns: repeat(3, 1fr); }
  .pv-stats div:nth-child(3) { border-right: 0; }
  .pv-stats div:nth-child(-n+3) { border-bottom: 1px solid var(--pv-line); }
}

/* phone */
@media (max-width: 599px) {
  :root { --tb-h: 52px; }
  .topbar { padding: 6px 8px; gap: 6px; }
  .topbar .zoom { display: none; }
  .tb-btn { width: 40px; padding: 0; }
  .tb-btn span { display: none; }
  .tb-title strong { font-size: 15px; }
  .pages { padding: 10px 8px 40px; gap: 12px; }
  .drawer { width: 100vw; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { width: 100% !important; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .pop-actions button { flex: 1; justify-content: center; }
  .toast { left: 12px; right: 12px; max-width: none; transform: translateY(20px); }
  .toast.show { transform: none; }
  .pe-frame canvas { max-width: 100%; }
  .pv-bar-in { gap: 8px; padding: 8px 12px; }
  .pv-bar .dev-badge span { display: none; }
  .pv-brand .brand-logo { height: 32px; }
  .pv-brand-sub { display: none; }
  .pv-bar-cta { display: none; }
  .pv-wrap { padding: 0 12px; }
  .pv-head { padding-top: 14px; }
  .pv-stats { grid-template-columns: repeat(2, 1fr); }
  .pv-stats div { border-right: 1px solid var(--pv-line) !important; border-bottom: 1px solid var(--pv-line); }
  .pv-stats div:nth-child(2n) { border-right: 0 !important; }
  .pv-stats div:last-child { grid-column: span 2; border-bottom: 0; border-right: 0 !important; }
  .pv-ref { display: none; }
  .pv-h small { font-size: 12.5px; }
  .sf-inner { flex-direction: column; text-align: center; gap: 8px; }
  .sign-preview { width: 100%; }
}

/* =====================================================================
   PRINT : exact A4, only original page + filled text
   ===================================================================== */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  .topbar, .sidebar, .sb-overlay, .toast, .pop, .fields, .helpers, .pg-no, .date-pick, .drawer, .modal,
  #policyView, .site-footer, #udyog-icons { display: none !important; }
  html.mode-policy .app, html.mode-form .app, .app { display: block !important; }
  .app-main { display: block; }
  .print-extras, html.mode-policy .print-extras { display: block !important; }
  body.drawer-open .pages { padding-right: 0 !important; }
  .pages { display: block !important; padding: 0 !important; gap: 0; }
  .page {
    --s: 1.333333;               /* 1pt = 1.3333 CSS px, so the page is exactly 210 x 297 mm */
    width: 210mm; height: 297mm; box-shadow: none; margin: 0;
    page-break-after: always; break-after: page; overflow: hidden;
  }
  .page:last-child { page-break-after: auto; break-after: auto; }
  .render { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
