/* ERP Bangla - থিম: গভীর পাইন-সবুজ + উষ্ণ পাথুরে ধূসর + একটি অ্যাকসেন্ট (পোড়া কমলা) */
:root {
  --brand-deep: #0a3d34;
  --brand-deep-2: #0f5347;
  --brand: #0d6b5c;
  --brand-dark: #0a5348;
  --brand-soft: #e2f1ed;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-soft: #fbe4d5;
  --gray-50: #f7f6f3;
  --gray-100: #efede8;
  --gray-200: #e2dfd8;
  --gray-300: #cdc9bf;
  --gray-500: #6b665c;
  --gray-700: #3f3b34;
  --gray-900: #211f1b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 61, 52, 0.06), 0 2px 8px rgba(10, 61, 52, 0.05);

  --bs-font-sans-serif: 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-color: var(--gray-900);
  --bs-body-bg: var(--gray-50);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 13, 107, 92;
  --bs-secondary-color: var(--gray-500);
  --bs-border-color: var(--gray-200);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
  --bs-border-radius: 10px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 1rem;
  line-height: 1.7;
}
.text-muted, .form-text { color: var(--gray-500) !important; }
a { text-underline-offset: 2px; }

/* ---------- লেআউট ---------- */
.app-main { max-width: 1240px; margin: 0 auto; padding-top: 1.25rem !important; padding-bottom: 2rem !important; }
.page-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--brand-deep); margin: 0; line-height: 1.4; }
.page-title i { color: var(--brand); margin-right: 0.35rem; }
.page-subtitle { color: var(--gray-500); font-size: 0.9rem; margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- সাইডবার + টপবার ---------- */
:root { --sidebar-w: 264px; --sidebar-w-collapsed: 72px; --topbar-h: 60px; }
.app-shell { min-height: 100vh; }
.app-body { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.app-body > .app-main { flex: 1 1 auto; width: 100%; }

.app-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(var(--sidebar-w), 86vw); z-index: 1045;
  display: flex; flex-direction: column; background: var(--brand-deep); color: #d5e5e0;
  transform: translateX(-100%); transition: transform 0.25s ease, width 0.2s ease; overflow: hidden;
}
body.drawer-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); }
body.drawer-open { overflow: hidden; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(10, 30, 26, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.2s; }
body.drawer-open .sidebar-backdrop { opacity: 1; visibility: visible; }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; height: var(--topbar-h); padding: 0 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand-mark { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.sidebar-close { background: none; border: 0; color: #fff; font-size: 1.1rem; padding: 0.5rem; border-radius: 8px; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 0.75rem 0.75rem 1rem; }
.sidebar-group { padding: 1rem 0.75rem 0.4rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(213, 229, 224, 0.55); white-space: nowrap; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.65rem 0.75rem; margin-bottom: 2px; border: 0; border-radius: 10px; background: none;
  color: #d5e5e0; text-decoration: none; font-weight: 500; white-space: nowrap; text-align: left; font-size: 0.97rem; cursor: pointer;
}
.sidebar-link > i { flex-shrink: 0; width: 1.4rem; text-align: center; font-size: 1.15rem; }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-link.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #f0925c; }
.sidebar-link.is-soon { opacity: 0.6; cursor: default; }
.sidebar-link.is-soon:hover { background: none; color: #d5e5e0; }
.sidebar-details { margin-bottom: 2px; }
.sidebar-details > summary { list-style: none; }
.sidebar-details > summary::-webkit-details-marker { display: none; }
.sidebar-chevron { margin-left: auto; font-size: 0.75rem; opacity: 0.7; transition: transform 0.15s; }
.sidebar-details[open] > summary .sidebar-chevron { transform: rotate(180deg); }
.sidebar-sublink { padding-left: 2.15rem; font-size: 0.92rem; }
.sidebar-sublink > i { font-size: 1rem; }
.soon-badge { margin-left: auto; font-size: 0.68rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.sidebar-foot { padding: 0.6rem 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.collapse-icon { transition: transform 0.2s; }

.app-topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1rem; background: #fff; border-bottom: 1px solid var(--gray-200); box-shadow: 0 1px 3px rgba(10, 61, 52, 0.06);
}
.topbar-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border: 1px solid var(--gray-200); border-radius: 10px; background: #fff; color: var(--brand-deep); font-size: 1.4rem; flex-shrink: 0; }
.topbar-btn:hover { background: var(--gray-100); }
.topbar-biz { font-weight: 700; color: var(--brand-deep); text-decoration: none; max-width: 30vw; min-width: 0; }
@media (min-width: 992px) { .topbar-biz { display: none; } }
.topbar-links { align-items: center; gap: 0.25rem; }
.topbar-links a { padding: 0.4rem 0.8rem; border-radius: 8px; color: var(--gray-700); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.topbar-links a:hover { background: var(--gray-100); }
.topbar-links a.active { color: var(--brand); background: var(--brand-soft); }
.topbar-search { position: relative; align-items: center; flex: 0 1 280px; margin-left: 0.25rem; }
.topbar-search i { position: absolute; left: 0.85rem; color: var(--gray-500); pointer-events: none; }
.topbar-search input { width: 100%; height: 2.5rem; padding: 0 0.9rem 0 2.4rem; border: 1px solid var(--gray-200); border-radius: 999px; background: var(--gray-50); font-size: 0.93rem; }
.topbar-search input:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 0.2rem rgba(13, 107, 92, 0.2); }
.topbar-right { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; min-width: 0; }
.topbar-newsale { white-space: nowrap; }
.topbar-user { display: inline-flex; align-items: center; gap: 0.5rem; border: 0; background: none; padding: 0.15rem 0.3rem; border-radius: 999px; color: var(--gray-900); font-weight: 600; max-width: 12rem; }
.topbar-user:hover { background: var(--gray-100); }
.topbar-user .user-name { max-width: 7rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.party-photo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.party-photo-lg { width: 72px; height: 72px; }
.party-photo-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
button.is-loading { opacity: 0.75; }
.product-section { gap: 0.35rem; }
.product-section .nav-link { white-space: nowrap; color: var(--brand-deep); background: #fff; border: 1px solid var(--gray-200); }
.product-section .nav-link.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dropdown-menu { border-radius: 12px; border-color: var(--gray-200); box-shadow: 0 8px 24px rgba(10, 61, 52, 0.15); }
.dropdown-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1rem; }
.dropdown-item:active { background: var(--brand); }

@media (min-width: 992px) {
  .app-sidebar { transform: none; width: var(--sidebar-w); }
  .app-body { margin-left: var(--sidebar-w); transition: margin-left 0.2s ease; }
  .sidebar-backdrop { display: none; }
  .app-topbar { padding: 0 1.5rem; }
  html.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
  html.sidebar-collapsed .app-body { margin-left: var(--sidebar-w-collapsed); }
  html.sidebar-collapsed .sidebar-label { display: none; }
  html.sidebar-collapsed .sidebar-head { justify-content: center; padding: 0; }
  html.sidebar-collapsed .sidebar-group { padding: 0.6rem 0; margin: 0 0.5rem; height: 1px; font-size: 0; background: rgba(255, 255, 255, 0.1); margin-top: 0.8rem; margin-bottom: 0.5rem; }
  html.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.7rem 0; }
  html.sidebar-collapsed .sidebar-sublink { padding-left: 0; }
  html.sidebar-collapsed .sidebar-chevron { display: none; }
  html.sidebar-collapsed .collapse-icon { transform: rotate(180deg); }
  .summary-card { top: calc(var(--topbar-h) + 1rem); }
}
@media (max-width: 575.98px) {
  .app-topbar { padding: 0 0.6rem; gap: 0.5rem; }
  .topbar-right { gap: 0.4rem; }
  .lang-switch a { padding: 0.25rem 0.55rem; font-size: 0.82rem; }
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; align-items: stretch; background: #fff; border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 10px rgba(10, 61, 52, 0.08);
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
}
.bottom-nav a { flex: 1; text-align: center; padding: 0.35rem 0.1rem; color: var(--gray-500); text-decoration: none; font-size: 0.72rem; line-height: 1.25; min-width: 0; border-radius: 10px; }
.bottom-nav a i { display: block; font-size: 1.3rem; }
.bottom-nav a span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.bottom-nav .bottom-nav-main { color: #fff; background: var(--accent); font-weight: 700; margin: 0 0.2rem; flex: 1.15; }
.bottom-nav .bottom-nav-main.active { color: #fff; background: var(--accent-dark); }
body.has-bottom-nav { padding-bottom: 5rem; }
@media (min-width: 992px) { body.has-bottom-nav { padding-bottom: 0; } }

/* ---------- ভাষা পরিবর্তন ---------- */
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 3px; }
.lang-switch a { color: rgba(255, 255, 255, 0.9); text-decoration: none; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600; line-height: 1.5; }
.lang-switch a.active { background: #fff; color: var(--brand-deep); }
.lang-switch.on-light { background: var(--gray-100); }
.lang-switch.on-light a { color: var(--gray-700); }
.lang-switch.on-light a.active { background: var(--brand); color: #fff; }

/* ---------- বাটন ---------- */
.btn { font-weight: 600; border-radius: 10px; min-height: 2.75rem; padding: 0.5rem 1.1rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
.btn-lg { min-height: 3.25rem; font-size: 1.05rem; }
.btn-sm { min-height: 2.25rem; padding: 0.25rem 0.75rem; font-size: 0.9rem; }
.btn-group > .btn, .input-group > .btn { display: inline-flex; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-accent {
  --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-focus-shadow-rgb: 194, 65, 12;
}
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.btn-outline-secondary { --bs-btn-color: var(--gray-700); --bs-btn-border-color: var(--gray-300); --bs-btn-hover-bg: var(--gray-100); --bs-btn-hover-color: var(--brand-deep); --bs-btn-hover-border-color: var(--gray-300); --bs-btn-active-bg: var(--gray-200); --bs-btn-active-color: var(--brand-deep); background: #fff; }
.bg-primary { background-color: var(--brand) !important; }
.badge { font-weight: 600; padding: 0.4em 0.7em; border-radius: 999px; }
.badge.bg-secondary { background: var(--gray-500) !important; }
.badge.bg-warning { background: var(--accent-soft) !important; color: var(--accent-dark) !important; }
.badge.bg-success { background: #dcf3e6 !important; color: #14653a !important; }
.badge.bg-danger { background: #fde0e0 !important; color: #a11d1d !important; }

/* ---------- কার্ড ও টেবিল ---------- */
.card { border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.card-header { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 0.9rem 1.1rem; font-weight: 700; color: var(--brand-deep); border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 1.15rem; }
.list-group-item { padding: 0.9rem 1.1rem; border-color: var(--gray-200); }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 0.85rem 1rem; }
.table thead th { background: var(--gray-100) !important; color: var(--gray-700); font-size: 0.85rem; font-weight: 700; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--brand-soft); }
.card > .table-responsive:first-child .table thead th:first-child { border-top-left-radius: var(--radius); }
.card > .table-responsive:first-child .table thead th:last-child { border-top-right-radius: var(--radius); }
a.card:hover { border-color: var(--brand); }
.mobile-card { border-radius: var(--radius); }

.alert { border-radius: var(--radius); border-width: 1px; padding: 0.9rem 1.1rem; }
.alert-danger { background: #fdecec; border-color: #f5c2c2; color: #8a1c1c; }
.alert-warning { background: #fff3e8; border-color: #f2c9a8; color: #7c2d0a; }
.alert-success { background: #e6f6ee; border-color: #b8e2cb; color: #14653a; }

/* ---------- ফর্ম ---------- */
.form-label { font-weight: 600; color: var(--gray-700); margin-bottom: 0.4rem; font-size: 0.95rem; }
.form-control, .form-select {
  min-height: 2.9rem; border-color: var(--gray-300); border-radius: 10px; font-size: 1rem; padding: 0.55rem 0.85rem;
}
.form-control-lg, .form-select-lg { min-height: 3.4rem; }
.form-control::placeholder { color: #9aa5b5; }
.form-control:focus, .form-select:focus, .btn:focus-visible, .btn-check:focus-visible + .btn {
  border-color: var(--brand); box-shadow: 0 0 0 0.22rem rgba(13, 107, 92, 0.25);
}
.form-control:user-invalid, .form-select:user-invalid { border-color: #dc3545; background-image: none; }
.form-text { font-size: 0.83rem; margin-top: 0.3rem; }
.req { color: #dc3545; font-weight: 700; }
.form-card { padding: 1.35rem; }
.form-section-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--gray-500); text-transform: uppercase; margin: 0.5rem 0 0.9rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--gray-200); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.btn-check:checked + .btn-outline-success { background: #14653a; border-color: #14653a; color: #fff; }
.btn-check:checked + .btn-outline-danger { background: #b02a37; border-color: #b02a37; color: #fff; }
.btn-check:checked + .btn-outline-secondary { background: var(--gray-700); border-color: var(--gray-700); color: #fff; }
@media (max-width: 575.98px) {
  .form-actions .btn { flex: 1 1 auto; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
}

/* ---------- ফাঁকা অবস্থা ---------- */
.empty-state { text-align: center; padding: 2.75rem 1.25rem; }
.empty-state .empty-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.empty-state h2 { font-size: 1.15rem; font-weight: 700; color: var(--brand-deep); margin-bottom: 0.35rem; }
.empty-state p { color: var(--gray-500); max-width: 30rem; margin: 0 auto 1.1rem; }

/* ---------- ড্যাশবোর্ড ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card .card-body { padding: 1rem 1.1rem; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 0.5rem; }
.stat-icon.is-accent { background: var(--accent-soft); color: var(--accent-dark); }
.stat-icon.is-danger { background: #fde0e0; color: #a11d1d; }
.stat-label { font-size: 0.88rem; color: var(--gray-500); font-weight: 600; }
.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.35; color: var(--brand-deep); }
.stat-card.is-alert { border-color: #f1b4b4; background: #fffafa; }
.stat-card.is-alert .stat-value { color: #a11d1d; }

.week-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 190px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.week-bar { width: 100%; max-width: 46px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; opacity: 0.85; }
.week-col:last-child .week-bar { background: var(--accent); opacity: 1; }
.week-amount { font-size: 0.7rem; color: var(--gray-500); white-space: nowrap; }
.week-day { font-size: 0.8rem; margin-top: 4px; color: var(--gray-700); }

/* ---------- লগইন ---------- */
body.auth-page { background: linear-gradient(160deg, var(--brand-deep) 0%, var(--brand-deep-2) 60%, #17685a 100%); min-height: 100vh; }
.login-wrap { min-height: 85vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 430px; border: 0; border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28); }
.login-logo { width: 68px; height: 68px; margin: 0 auto; border-radius: 18px; background: var(--brand-deep); color: #f2b48f; display: flex; align-items: center; justify-content: center; font-size: 2.1rem; }
body.auth-page .app-main { padding-top: 1.5rem !important; }

/* ---------- নতুন সেলস ইনভয়েস ফর্ম ---------- */
.invoice-form .adv-col, .invoice-form .adv-only { display: none; }
.invoice-form.is-advanced .adv-col { display: block; }
.invoice-form.is-advanced .adv-only { display: block; }
.invoice-form.is-advanced .sum-row.adv-only { display: flex; }

.item-head { display: none; }
.item-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.75rem; padding: 0.9rem;
  margin-bottom: 0.75rem; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--gray-50); position: relative;
}
.item-row .cell-item { grid-column: 1 / -1; padding-right: 2.75rem; }
.item-row .cell-remove { position: absolute; top: 0.6rem; right: 0.6rem; }
.item-row .cell-total { grid-column: 1 / -1; }
.cell-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--gray-500); margin-bottom: 0.2rem; }
.cell-readonly { background: var(--gray-100); color: var(--gray-700); font-weight: 600; }
.stock-note { margin-top: 0.25rem; }
.btn-icon { width: 2.25rem; padding: 0; }
@media (min-width: 576px) { .item-row { grid-template-columns: repeat(3, 1fr); } .item-row .cell-total { grid-column: auto; } }
@media (min-width: 992px) {
  .item-head, .item-row { display: grid; align-items: center; gap: 0.6rem; grid-template-columns: minmax(0, 3fr) 90px 80px 120px 130px 40px; }
  .invoice-form.is-advanced .item-head, .invoice-form.is-advanced .item-row { grid-template-columns: minmax(0, 3fr) 90px 80px 110px 100px 100px 130px 40px; }
  .item-head { padding: 0 0.9rem 0.5rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--gray-500); }
  .item-head > :nth-child(7) { text-align: right; }
  .item-row { padding: 0.55rem 0.9rem; margin-bottom: 0.5rem; background: #fff; align-items: start; }
  .item-row .cell-item { grid-column: auto; padding-right: 0; }
  .item-row .cell-remove { position: static; }
  .item-row .cell-total { grid-column: auto; }
  .cell-label { display: none; }
}

.doc-type-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.form-lock { display: block; width: 100%; min-inline-size: 0; border: 0; padding: 0; margin: 0; }
.info-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 400px) { .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .info-customer, .info-add { grid-column: 1 / -1; } }
@media (min-width: 768px) { .info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .info-customer { grid-column: span 3; } .info-add { grid-column: span 1; align-self: end; } }
.prev-due-field { background: var(--gray-100); font-weight: 600; color: var(--gray-700); }
.prev-due-field.has-due { background: var(--accent-soft); color: var(--accent-dark); border-color: #f2c9a8; }
.combo { position: relative; }
.combo-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--gray-500); pointer-events: none; }
.combo-input { padding-left: 2.4rem; padding-right: 2.4rem; }
.combo-clear { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--gray-500); padding: 0.35rem 0.5rem; border-radius: 8px; }
.combo-clear:hover { background: var(--gray-100); color: var(--gray-900); }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; margin: 0.25rem 0 0; padding: 0.3rem; list-style: none; max-height: 16rem; overflow-y: auto; background: #fff; border: 1px solid var(--gray-300); border-radius: 12px; box-shadow: 0 10px 28px rgba(10, 61, 52, 0.18); }
.combo-option, .combo-empty { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0.7rem; border-radius: 8px; cursor: pointer; }
.combo-option small { color: var(--gray-500); }
.combo-option:hover, .combo-option.is-active { background: var(--brand-soft); }
.combo-option.is-selected { font-weight: 700; color: var(--brand-dark); }
.combo-empty { color: var(--gray-500); cursor: default; }
.due-chip { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0.8rem; border-radius: 10px; background: var(--gray-100); color: var(--gray-700); font-size: 0.9rem; }
.due-chip.has-due { background: var(--accent-soft); color: var(--accent-dark); }
.due-chip strong { font-weight: 700; }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-align: center; padding: 1.5rem 1rem; border: 2px dashed var(--gray-300); border-radius: var(--radius); background: var(--gray-50); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.dropzone > i { font-size: 2rem; color: var(--brand); }
.dropzone .dz-title { font-weight: 600; color: var(--gray-700); }
.dropzone .dz-hint { font-size: 0.82rem; color: var(--gray-500); }
.dropzone .dz-files { font-size: 0.85rem; color: var(--brand-dark); word-break: break-word; margin-top: 0.25rem; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.summary-card { top: calc(var(--topbar-h) + 1rem); }
.sum-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; color: var(--gray-700); }
.sum-row span:last-child { font-weight: 600; color: var(--gray-900); white-space: nowrap; }
.sum-total { margin-top: 0.4rem; padding: 0.55rem 0.75rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark) !important; font-weight: 700; }
.sum-total span:last-child { color: var(--brand-dark); }
.sum-prev { margin-top: 0.4rem; padding: 0.5rem 0.75rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sum-prev span:last-child { color: var(--accent-dark); }
.sum-payable { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 0.4rem; padding: 0.85rem 0.9rem; border-radius: 10px; background: var(--brand-deep); color: #fff; font-weight: 700; font-size: 1.15rem; }
.sum-due { display: flex; justify-content: space-between; margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px dashed var(--gray-300); font-weight: 700; font-size: 1.1rem; color: var(--accent); }

.invoice-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; padding: 0.85rem 0;
}
.invoice-actions .btn { flex: 0 0 auto; }
@media (max-width: 991.98px) {
  .invoice-actions {
    position: sticky; bottom: 4.6rem; z-index: 6; background: rgba(247, 246, 243, 0.96); border-top: 1px solid var(--gray-200);
    margin-left: -0.85rem; margin-right: -0.85rem; padding: 0.7rem 0.85rem; flex-wrap: nowrap; justify-content: stretch;
  }
  .invoice-actions .btn { flex: 1 1 0; padding-left: 0.4rem; padding-right: 0.4rem; font-size: 0.9rem; min-width: 0; }
}

/* ---------- ইনভয়েস ---------- */
.invoice { max-width: 800px; border-radius: var(--radius); overflow: hidden; }
.invoice-head { background: var(--brand-deep); color: #fff; padding: 1.4rem 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.invoice-head h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.2rem; }
.invoice-head .small { color: rgba(255, 255, 255, 0.8); }
.invoice-badge { display: inline-block; padding: 0.15rem 0.85rem; border-radius: 999px; font-weight: 700; font-size: 0.85rem; }
.invoice-badge.is-paid { background: #dcf3e6; color: #14653a; }
.invoice-badge.is-due { background: var(--accent-soft); color: var(--accent-dark); }
.invoice-title { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.invoice-meta { display: grid; grid-template-columns: 1fr; gap: 0.75rem; padding: 1.15rem 1.5rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
@media (min-width: 576px) { .invoice-meta { grid-template-columns: 1fr 1fr; } }
.invoice-meta dt { font-size: 0.78rem; font-weight: 600; color: var(--gray-500); margin: 0; }
.invoice-meta dd { margin: 0; font-weight: 600; color: var(--gray-900); }
.invoice-body { padding: 1.25rem 1.5rem 1.5rem; }
.invoice-table thead th { background: var(--gray-100) !important; }
.invoice-table td, .invoice-table th { padding: 0.65rem 0.75rem !important; }
.invoice-totals td { padding: 0.4rem 0.75rem; border: 0; }
.invoice-totals .grand td { border-top: 2px solid var(--brand-deep); font-size: 1.15rem; font-weight: 700; color: var(--brand-deep); padding-top: 0.6rem; }
.invoice-totals .due-row td { color: #a11d1d; font-weight: 700; }
.invoice-notes { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 10px; padding: 0.75rem 1rem; white-space: pre-line; }
.invoice-badge.is-draft { background: var(--gray-200); color: var(--gray-700); }
.invoice-totals .prev-row td { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.invoice-totals .payable-row td { font-weight: 700; color: var(--brand-deep); }
.invoice-footer { border-top: 1px dashed var(--gray-300); padding-top: 1rem; color: var(--gray-500); }
@media (max-width: 575.98px) {
  .invoice-head, .invoice-body, .invoice-meta { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 991.98px) {
  .app-main { padding-left: 0.85rem; padding-right: 0.85rem; }
}
@media (max-width: 575.98px) {
  .page-title { font-size: 1.2rem; }
  .card-body { padding: 1rem; }
}

/* প্রিন্ট: Simple Information হেডার ≈ পাতার ১৫% উচ্চতা, তারপরই পণ্যের টেবিল। */
.print-simple-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; }
@media (min-width: 576px) {
  .print-simple-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media print {
  @page { margin: 8mm; size: A4; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; padding: 0 !important; }
  .no-print, .navbar, .bottom-nav, .app-sidebar, .app-topbar, .sidebar-backdrop, .page-header { display: none !important; }
  .app-body { margin-left: 0 !important; }
  .app-main { padding: 0 !important; max-width: none; }
  .sale-sheet, .invoice { border: 0 !important; box-shadow: none !important; max-width: none; border-radius: 0; overflow: visible; }
  .print-simple {
    height: 15vh;
    max-height: 15vh;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1px;
    line-height: 1.1;
  }
  .print-simple-top, .invoice-head {
    background: #fff !important;
    color: #000 !important;
    border-bottom: 0;
    padding: 0 !important;
    margin: 0;
    gap: 4px;
    flex: 0 0 auto;
  }
  .print-simple h2 { font-size: 11pt; line-height: 1.1; margin: 0; }
  .print-simple .small, .print-simple .invoice-title, .print-simple .doc-no { color: #222 !important; font-size: 8pt; line-height: 1.1; margin: 0; }
  .print-simple .fs-5 { font-size: 10pt !important; line-height: 1.1; }
  .print-simple .invoice-badge { display: none; }
  .print-simple-grid, .invoice-meta {
    background: #fff !important;
    border: 0;
    padding: 1px 0 0 !important;
    margin: 0;
    gap: 0 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 auto;
    min-height: 0;
  }
  .print-simple-grid dt, .invoice-meta dt { font-size: 7pt; line-height: 1.05; margin: 0; }
  .print-simple-grid dd, .invoice-meta dd { font-size: 8pt; line-height: 1.1; margin: 0; font-weight: 600; }
  .invoice-body { padding: 0 !important; margin: 0; }
  .sale-lines { width: 100%; margin: 0; border-collapse: collapse; }
  .sale-lines thead { display: table-header-group; }
  .sale-lines tfoot { display: table-footer-group; }
  .sale-lines tr, .sale-lines th, .sale-lines td { break-inside: avoid; page-break-inside: avoid; }
  .sale-lines th, .sale-lines td, .invoice-table td, .invoice-table th {
    padding: 1px 3px !important;
    font-size: 8pt;
    line-height: 1.1;
  }
  .print-totals { margin-top: 2px; }
  .invoice-totals td { padding: 0 3px !important; font-size: 8pt; line-height: 1.15; }
  .invoice-notes, .invoice-footer, .chain-refs { font-size: 8pt; margin-top: 2px !important; }
  .hide-prev-due-print .prev-due-print { display: none !important; }
  .challan-sheet .challan-money { display: none !important; }
}
