/* Timely Product ERP — design system V1.1 (premium corporate). DM Sans + Noto Sans Bengali (Bangla help text only), brand palette as CSS
   variables. White-label colours are overridden by /assets/brand.css (generated from Settings). No inline styles (CSP).
   Every class name of V1.0 is kept, so existing pages keep working; new components are documented in UI_CHANGES.md. */

@font-face { font-family: "DM Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/dm-sans/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/dm-sans/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/dm-sans/dm-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/dm-sans/dm-sans-latin-700-normal.woff2") format("woff2"); }
/* Bangla: downloaded only when Bengali characters are on the page (unicode-range) */
@font-face { font-family: "Noto Sans Bengali"; font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
  src: url("../fonts/noto-sans-bengali/noto-sans-bengali-bengali-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Bengali"; font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
  src: url("../fonts/noto-sans-bengali/noto-sans-bengali-bengali-600-normal.woff2") format("woff2"); }

:root {
  --tp-primary: #00A651;        /* Primary Green */
  --tp-primary-rgb: 0, 166, 81;
  --tp-secondary: #006B43;      /* Dark Green */
  --tp-accent: #F15A24;         /* Accent Orange */
  --tp-light: #EAF5F0;          /* Light Green */
  --tp-bg: #F6F8F7;             /* Application Background */
  --tp-card: #FFFFFF;
  --tp-surface: #F9FBFA;        /* table heads, inset panels */
  --tp-text: #142536;           /* Primary Text */
  --tp-muted: #64748B;          /* Secondary Text */
  --tp-border: #DCE5E1;         /* Border */
  --tp-border-soft: #E9EFEC;
  /* financial meaning (always paired with text / icon, never colour alone) */
  --tp-success: #15803D;        /* profit, success */
  --tp-danger: #DC2626;         /* loss, error */
  --tp-warning: #B45309;        /* due, warning (amber, readable on white) */
  --tp-warning-bg: #FEF3C7;
  --tp-pending: #C2410C;        /* pending (orange) */
  --tp-info: #1D4ED8;           /* information (blue) */
  --tp-neutral: #475569;
  --tp-sidebar-w: 248px;
  --tp-sidebar-w-collapsed: 72px;
  --tp-topbar-h: 60px;
  --tp-radius: 12px;
  --tp-radius-sm: 8px;
  --tp-shadow: 0 1px 2px rgba(20, 37, 54, .04), 0 1px 1px rgba(20, 37, 54, .03);
  --tp-shadow-lg: 0 10px 30px rgba(20, 37, 54, .10);
  --tp-font: "DM Sans", "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Vrinda", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bs-body-font-family: var(--tp-font);
  --bs-body-bg: var(--tp-bg);
  --bs-body-color: var(--tp-text);
  --bs-secondary-color: var(--tp-muted);
  --bs-border-color: var(--tp-border);
  --bs-primary: var(--tp-primary);
  --bs-primary-rgb: var(--tp-primary-rgb);
  --bs-link-color: var(--tp-secondary);
  --bs-link-color-rgb: 0, 107, 67;
  --bs-link-hover-color: var(--tp-primary);
  --bs-success-rgb: 21, 128, 61;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger-rgb: 220, 38, 38;
  --bs-border-radius: 8px;
  --bs-focus-ring-color: rgba(0, 166, 81, .3);
}

/* ── Base & typography ─────────────────────────────────────────────── */
html { font-size: 15px; }
body { font-family: var(--tp-font); font-size: 1rem; line-height: 1.55; background: var(--tp-bg); color: var(--tp-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, .h1 { font-size: 1.6rem; letter-spacing: -.01em; } h2, .h2 { font-size: 1.3rem; } h3, .h3 { font-size: 1.12rem; } h4, .h4 { font-size: 1.04rem; } h5, .h5 { font-size: 1rem; }
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--tp-text); }
h3, h4, h5 { font-weight: 600; }
.small, small { font-size: .875em; }
.text-muted, .text-secondary { color: var(--tp-muted) !important; }
.text-profit { color: var(--tp-success) !important; }
.text-loss { color: var(--tp-danger) !important; }
.text-due { color: var(--tp-warning) !important; }
.text-info-strong { color: var(--tp-info) !important; }
.bn, [lang="bn"] { font-family: "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Vrinda", var(--tp-font); line-height: 1.7; }
.lucide-icon, svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; vertical-align: -3px; }
.icon-lg { width: 22px !important; height: 22px !important; }
.icon-sm, .btn-sm svg.lucide { width: 16px; height: 16px; }
a { text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--tp-primary) !important; outline-offset: 2px; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); border-color: var(--tp-primary); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--tp-card); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn { font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .95rem; border-radius: 8px; padding: .45rem .9rem; }
.btn-sm { font-size: .86rem; padding: .3rem .65rem; border-radius: 7px; }
.btn-lg { font-size: 1.02rem; padding: .6rem 1.15rem; }
.btn-primary { --bs-btn-bg: var(--tp-primary); --bs-btn-border-color: var(--tp-primary); --bs-btn-hover-bg: var(--tp-secondary); --bs-btn-hover-border-color: var(--tp-secondary);
  --bs-btn-active-bg: var(--tp-secondary); --bs-btn-active-border-color: var(--tp-secondary); --bs-btn-disabled-bg: var(--tp-primary); --bs-btn-disabled-border-color: var(--tp-primary); }
.btn-outline-primary { --bs-btn-color: var(--tp-secondary); --bs-btn-border-color: var(--tp-primary); --bs-btn-hover-bg: var(--tp-primary); --bs-btn-hover-border-color: var(--tp-primary); --bs-btn-active-bg: var(--tp-secondary); }
.btn-accent { --bs-btn-bg: var(--tp-accent); --bs-btn-border-color: var(--tp-accent); --bs-btn-color: #fff; --bs-btn-hover-bg: #d94a17; --bs-btn-hover-border-color: #d94a17; --bs-btn-hover-color: #fff; }
.btn-light { --bs-btn-bg: var(--tp-card); --bs-btn-border-color: var(--tp-border); --bs-btn-color: var(--tp-text); --bs-btn-hover-bg: var(--tp-light); --bs-btn-hover-border-color: #c6d8cf; --bs-btn-active-bg: var(--tp-light); }
.btn-link { font-weight: 500; }
.btn-icon { padding: .4rem; justify-content: center; }
.btn:disabled, .btn.disabled { cursor: not-allowed; }

/* ── App shell: sidebar ────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--tp-sidebar-w); background: var(--tp-secondary); color: #fff; position: fixed; inset: 0 auto 0 0; z-index: 1030; display: flex; flex-direction: column; transition: width .2s ease, transform .2s ease; }
.sidebar-brand { min-height: var(--tp-topbar-h); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; flex-shrink: 0; }
.sidebar-brand .brand-logo { background: #fff; border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; max-width: 100%; }
.sidebar-brand .brand-logo img { max-height: 38px; max-width: 196px; width: auto; height: auto; object-fit: contain; }
.sidebar-brand .brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--tp-primary); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.sidebar-brand .brand-name { font-weight: 700; line-height: 1.15; }
.sidebar-brand .brand-sub { font-size: .76rem; opacity: .75; }
/* the <nav> between the flex sidebar and the list must shrink too, or the list never scrolls on short screens */
.sidebar > nav { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sidebar-nav { overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px 16px; flex: 1 1 auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; list-style: none; margin: 0; }
.sidebar-nav .nav-section { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .55); padding: 14px 12px 6px; }
.sidebar-nav .nav-section:first-child { padding-top: 6px; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin-bottom: 1px; border-radius: 8px; color: rgba(255, 255, 255, .9); text-decoration: none; font-weight: 500; font-size: .95rem; border-left: 3px solid transparent; transition: background .12s; }
.sidebar-nav a svg { color: rgba(255, 255, 255, .8); }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; border-left-color: var(--tp-accent); }
.sidebar-nav a.active svg { color: #fff; }
.sidebar-foot { flex-shrink: 0; border-top: 1px solid rgba(255, 255, 255, .1); padding: 10px 16px; font-size: .76rem; color: rgba(255, 255, 255, .6); display: flex; justify-content: space-between; gap: 8px; }
.main { flex: 1; margin-left: var(--tp-sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin-left .2s ease; }

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar { min-height: var(--tp-topbar-h); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--tp-border); display: flex; align-items: center; gap: 12px; padding: 8px 24px; position: sticky; top: 0; z-index: 1020; }
.topbar .page-title { font-weight: 600; font-size: 1.02rem; margin: 0; line-height: 1.2; }
/* the page's own heading already names the page: show only the breadcrumb on wide screens */
@media (min-width: 992px) { .main:has(.content .page-header h1) .topbar .page-title { display: none; } }
.topbar .breadcrumb { margin: 0; font-size: .85rem; --bs-breadcrumb-divider-color: #94A3B8; --bs-breadcrumb-item-active-color: var(--tp-text); }
.topbar .breadcrumb a { color: var(--tp-muted); text-decoration: none; }
.topbar .breadcrumb a:hover { color: var(--tp-secondary); text-decoration: underline; }
.topbar .breadcrumb .breadcrumb-item.active { font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--tp-accent); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; border: 2px solid #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tp-light); color: var(--tp-secondary); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.dropdown-menu { border-color: var(--tp-border); border-radius: 10px; box-shadow: var(--tp-shadow-lg); padding: 6px; font-size: .95rem; }
.dropdown-item { border-radius: 6px; display: flex; align-items: center; gap: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--tp-light); color: var(--tp-text); }
.dropdown-header { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ── Content ───────────────────────────────────────────────────────── */
.content { padding: 22px 28px 40px; flex: 1; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.page-header h1 { margin: 0; line-height: 1.25; }
.page-header > * { min-width: 0; max-width: 100%; }
.section-title .st-meta { text-transform: none; letter-spacing: 0; font-weight: 500; }
.page-header h1 + .text-muted, .page-header .page-desc { margin-top: 2px; }
.page-desc { color: var(--tp-muted); font-size: .95rem; max-width: 72ch; }
.footer { padding: 14px 28px; color: var(--tp-muted); font-size: .84rem; border-top: 1px solid var(--tp-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }

body.sidebar-collapsed .sidebar { width: var(--tp-sidebar-w-collapsed); }
body.sidebar-collapsed .main { margin-left: var(--tp-sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .nav-label, body.sidebar-collapsed .sidebar .brand-text, body.sidebar-collapsed .sidebar .brand-logo,
body.sidebar-collapsed .sidebar .nav-section, body.sidebar-collapsed .sidebar-foot { display: none !important; }
body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 10px; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: min(var(--tp-sidebar-w), 84vw); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .main, body.sidebar-collapsed .main { margin-left: 0; }
  body.sidebar-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1025; }
  body.sidebar-collapsed .sidebar .nav-label, body.sidebar-collapsed .sidebar .brand-text, body.sidebar-collapsed .sidebar .nav-section, body.sidebar-collapsed .sidebar-foot { display: revert !important; }
  .topbar { padding: 8px 12px; }
  .content { padding: 16px 14px 32px; }
}

/* ── Cards, KPI, financial panels ──────────────────────────────────── */
.card { background: var(--tp-card); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); --bs-card-bg: var(--tp-card); --bs-card-inner-border-radius: calc(var(--tp-radius) - 1px); }
.card-header { background: transparent; border-bottom: 1px solid var(--tp-border-soft); font-weight: 600; padding: 13px 18px; }
.card-header .card-sub { display: block; font-weight: 400; font-size: .84rem; color: var(--tp-muted); }
.card-footer { background: var(--tp-surface); border-top: 1px solid var(--tp-border-soft); }
.card-body { padding: 18px; }
/* x-stat (kept): compact metric */
.stat-card { display: flex; flex-direction: column; gap: 4px; height: 100%; }
.stat-card .stat-label { color: var(--tp-muted); font-size: .88rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-card .stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-card .stat-hint { font-size: .8rem; color: var(--tp-muted); }
.stat-card a.text-reset:hover { color: var(--tp-secondary) !important; text-decoration: underline !important; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--tp-light); color: var(--tp-secondary); flex-shrink: 0; }
.stat-icon svg.lucide { width: 16px; height: 16px; }
.stat-icon.orange { background: #FDEBE3; color: var(--tp-accent); }
.stat-icon.red { background: #FDECEC; color: var(--tp-danger); }
.stat-icon.amber { background: var(--tp-warning-bg); color: var(--tp-warning); }
.stat-icon.blue { background: #E8EFFD; color: var(--tp-info); }
.section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tp-muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--tp-border); }

/* x-kpi: hero metric — label, big amount, context line; tone = profit | loss | due | info */
.kpi { position: relative; height: 100%; padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tp-primary); opacity: .9; }
.kpi.tone-loss::before { background: var(--tp-danger); } .kpi.tone-due::before { background: #F59E0B; } .kpi.tone-info::before { background: var(--tp-info); } .kpi.tone-neutral::before { background: #94A3B8; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--tp-muted); font-weight: 600; font-size: .86rem; }
.kpi-value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value a { color: inherit; text-decoration: none; }
.kpi-value a:hover { text-decoration: underline; }
.kpi-foot { font-size: .82rem; color: var(--tp-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.kpi-foot .chip-val { font-weight: 600; color: var(--tp-text); font-variant-numeric: tabular-nums; }
.trend-up, .trend-down { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.trend-up { color: var(--tp-success); } .trend-down { color: var(--tp-danger); }

/* x-panel + x-row: grouped financial key/value lists (dense, scannable, right-aligned amounts) */
.fin-list { list-style: none; margin: 0; padding: 4px 0; }
.fin-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--tp-border-soft); }
.fin-list li:last-child { border-bottom: 0; }
.fin-list .fl-label { color: var(--tp-text); display: flex; flex-direction: column; min-width: 0; }
.fin-list .fl-label small { color: var(--tp-muted); font-size: .78rem; line-height: 1.35; }
.fin-list .fl-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.fin-list .fl-value a { color: inherit; text-decoration: none; }
.fin-list .fl-value a:hover { color: var(--tp-secondary); text-decoration: underline; }
.fin-list li.fl-total { background: var(--tp-surface); }
.fin-list li.fl-total .fl-label, .fin-list li.fl-total .fl-value { font-weight: 700; }
.fin-list li.fl-sub .fl-label { padding-left: 14px; color: var(--tp-muted); }
.fin-list li.fl-head { background: var(--tp-surface); padding-top: 6px; padding-bottom: 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tp-muted); }
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title .stat-icon { width: 28px; height: 28px; }

/* statement (P&L, gross profit): sections with subtotals */
.statement { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.statement td { padding: 8px 18px; border-bottom: 1px solid var(--tp-border-soft); }
.statement td.amt { text-align: right; white-space: nowrap; width: 1%; }
.statement tr.st-head td { padding-top: 14px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--tp-secondary); background: transparent; border-bottom: 1px solid var(--tp-border); }
.statement tr.st-sub td { font-weight: 700; background: var(--tp-surface); }
.statement tr.st-grand td { font-weight: 700; font-size: 1.08rem; background: var(--tp-light); border-top: 2px solid var(--tp-primary); border-bottom: 0; }
.statement tr.st-indent td:first-child { padding-left: 34px; color: var(--tp-text); }

/* mini bars (percent share), used in breakdown lists — width set by .w-* classes generated in Blade as data attribute → JS */
.bar-track { height: 6px; background: var(--tp-border-soft); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--tp-primary); border-radius: 4px; width: 0; transition: width .4s ease; }
.bar-fill.orange { background: var(--tp-accent); } .bar-fill.red { background: var(--tp-danger); } .bar-fill.dark { background: var(--tp-secondary); }

/* ── Tables ────────────────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; --bs-table-color: var(--tp-text); --bs-table-border-color: var(--tp-border-soft); margin-bottom: 0; font-size: .94rem; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tp-muted); font-weight: 700; background: var(--tp-surface); white-space: nowrap; border-bottom: 1px solid var(--tp-border) !important; }
.table > thead th a { color: inherit; text-decoration: none; }
.table > thead th a:hover { color: var(--tp-secondary); }
.table > :not(caption) > * > * { padding: .58rem .85rem; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .45rem .75rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F2F8F5; }
.table tfoot td, .table tfoot th { font-weight: 700; border-top: 2px solid var(--tp-border); background: var(--tp-surface); }
.table td a:not(.btn) { font-weight: 500; }
.table .table-light > * { --bs-table-bg: var(--tp-surface); }
/* tables with many rows scroll inside their card and keep their header visible */
.table-scroll { max-height: min(70vh, 900px); overflow: auto; }
.table-scroll > .table > thead th, .table-sticky > thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--tp-border); }
.table-scroll > .table > tfoot td { position: sticky; bottom: 0; z-index: 2; box-shadow: inset 0 1px 0 var(--tp-border); }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--tp-border-soft); }
.table-toolbar .search { max-width: 300px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagination { --bs-pagination-active-bg: var(--tp-primary); --bs-pagination-active-border-color: var(--tp-primary); --bs-pagination-color: var(--tp-text); --bs-pagination-border-color: var(--tp-border); --bs-pagination-hover-bg: var(--tp-light); margin: 0; }
.card > .table-responsive:last-child, .card > .table:last-child { border-bottom-left-radius: var(--tp-radius); border-bottom-right-radius: var(--tp-radius); }

/* ── Status badges (text + dot; colour is never the only signal) ───── */
.badge { font-weight: 600; font-size: .76rem; padding: .32em .62em; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; line-height: 1.2; }
.badge[class*="badge-soft-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-soft-success { background: rgba(21, 128, 61, .1); color: #15803D; }
.badge-soft-warning { background: var(--tp-warning-bg); color: var(--tp-warning); }
.badge-soft-danger { background: rgba(220, 38, 38, .1); color: #B91C1C; }
.badge-soft-secondary { background: rgba(100, 116, 139, .12); color: #475569; }
.badge-soft-primary { background: var(--tp-light); color: var(--tp-secondary); }
.badge-soft-info { background: #E8EFFD; color: var(--tp-info); }
.badge-soft-orange { background: #FDEBE3; color: var(--tp-pending); }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: #24384B; }
.form-control, .form-select { border-color: #CFDAD5; font-size: .97rem; border-radius: 8px; }
.form-control::placeholder { color: #94A3B8; }
.form-control[readonly], .form-control:disabled, .form-select:disabled { background-color: var(--tp-surface); }
.form-text { color: var(--tp-muted); font-size: .82rem; }
.required::after { content: " *"; color: var(--tp-danger); }
.optional-tag { font-weight: 400; color: var(--tp-muted); font-size: .8rem; margin-left: 4px; }
.form-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--tp-secondary); margin: 12px 0 12px; display: flex; align-items: center; gap: 8px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--tp-border-soft); }
.invalid-feedback { font-weight: 500; }
.line-table td { vertical-align: top; }
.line-table .form-control, .line-table .form-select { min-width: 5.5rem; }
.line-table .col-product { min-width: 16rem; }
.line-table tbody tr:nth-child(even) > td { background: #FBFCFC; }
.totals-box { background: var(--tp-light); border: 1px solid #CFE6DA; border-radius: 10px; padding: 14px 18px; }
.totals-box .row-line { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals-box .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid #C2DDCF; margin-top: 6px; padding-top: 8px; }
.totals-box .due-line { color: var(--tp-warning); font-weight: 600; }
@media (min-width: 992px) { .sticky-summary { position: sticky; top: calc(var(--tp-topbar-h) + 16px); } }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.form-check-input:checked { background-color: var(--tp-primary); border-color: var(--tp-primary); }

/* ── Tabs inside modules ───────────────────────────────────────────── */
.module-tabs { border-bottom: 1px solid var(--tp-border); margin-bottom: 18px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; gap: 2px; }
.module-tabs .nav-link { color: var(--tp-muted); font-weight: 600; white-space: nowrap; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: .6rem .9rem; font-size: .94rem; }
.module-tabs .nav-link:hover { color: var(--tp-secondary); }
.module-tabs .nav-link.active { color: var(--tp-secondary); border-bottom-color: var(--tp-accent); background: transparent; }

/* ── Period filter (chips) ─────────────────────────────────────────── */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.range-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--tp-card); border: 1px solid var(--tp-border); border-radius: 10px; padding: 3px; }
.range-chips .btn-check + label { border: 0; border-radius: 7px; padding: .28rem .65rem; font-size: .85rem; font-weight: 600; color: var(--tp-muted); background: transparent; cursor: pointer; white-space: nowrap; }
.range-chips .btn-check + label:hover { color: var(--tp-secondary); background: var(--tp-light); }
.range-chips .btn-check:checked + label { background: var(--tp-secondary); color: #fff; }
.range-chips .btn-check:focus-visible + label { outline: 2px solid var(--tp-primary); outline-offset: 1px; }
.period-custom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.period-custom .form-control { width: auto; }
.period-label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--tp-muted); }
.period-label strong { color: var(--tp-text); font-weight: 600; }
.mode-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: #E8EFFD; color: var(--tp-info); }
.mode-pill.asof { background: #F1EAFE; color: #6D28D9; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; }
.filter-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--tp-light); color: var(--tp-secondary); border-radius: 999px; padding: 2px 10px; font-weight: 600; }

/* ── Glossary help (English + Bangla), x-term ──────────────────────── */
.term { display: inline-flex; align-items: center; gap: 4px; }
.term-help { border: 0; background: none; padding: 0; color: #94A3B8; line-height: 1; cursor: help; display: inline-flex; }
.term-help:hover, .term-help:focus-visible { color: var(--tp-secondary); }
.term-help svg.lucide { width: 14px; height: 14px; }
.tooltip { --bs-tooltip-max-width: 300px; --bs-tooltip-bg: #142536; --bs-tooltip-font-size: .84rem; font-family: var(--tp-font); }
.tooltip-inner { text-align: left; padding: 8px 11px; line-height: 1.5; }
.tooltip-inner .bn { display: block; margin-top: 4px; opacity: .92; }
.help-note { display: flex; gap: 10px; align-items: flex-start; background: var(--tp-surface); border: 1px dashed var(--tp-border); border-radius: 10px; padding: 10px 14px; font-size: .88rem; color: var(--tp-neutral); }
.help-note svg.lucide { color: var(--tp-secondary); margin-top: 2px; }
.help-note .bn { color: var(--tp-muted); }

/* ── Empty, loading, alerts, toasts ────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 16px; color: var(--tp-muted); }
.empty-state svg { width: 40px; height: 40px; color: #A3B3C2; margin-bottom: 10px; }
.empty-state h3 { color: var(--tp-text); font-size: 1.04rem; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--tp-muted); font-size: .9rem; text-align: center; }
.loading-overlay { position: fixed; inset: 0; background: rgba(246, 248, 247, .6); display: none; place-items: center; z-index: 3000; }
body.is-loading .loading-overlay { display: grid; }
.skeleton { background: linear-gradient(90deg, #EEF2F0 25%, #F6F8F7 50%, #EEF2F0 75%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .bar-fill { transition: none; } }
.alert { border-radius: 10px; border-width: 1px; display: block; }
.alert-info { --bs-alert-bg: #EEF4FF; --bs-alert-border-color: #C9D9FB; --bs-alert-color: #1E3A8A; }
.alert-warning { --bs-alert-bg: #FFF8E6; --bs-alert-border-color: #F6DFA3; --bs-alert-color: #7C4A03; }
.alert-danger { --bs-alert-bg: #FEF2F2; --bs-alert-border-color: #F8CACA; --bs-alert-color: #8F1D1D; }
.alert-success { --bs-alert-bg: #EDF8F1; --bs-alert-border-color: #BFE3CD; --bs-alert-color: #14532D; }
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 3100; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.tp-toast { background: var(--tp-card); border: 1px solid var(--tp-border); border-left: 4px solid var(--tp-primary); border-radius: 10px; box-shadow: var(--tp-shadow-lg); padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; }
.tp-toast.toast-error { border-left-color: var(--tp-danger); }
.tp-toast.toast-warning { border-left-color: #F59E0B; }
.modal-content { border: 0; border-radius: 14px; box-shadow: var(--tp-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--tp-border-soft); }

/* ── Auth & installer ──────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, var(--tp-light), var(--tp-bg)); }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { max-height: 72px; max-width: 260px; width: auto; height: auto; }
.auth-logo .brand-name { font-weight: 700; font-size: 1.3rem; color: var(--tp-secondary); }
.install-wrap { max-width: 900px; margin: 28px auto; padding: 0 16px; }
.check-ok { color: var(--tp-success); } .check-fail { color: var(--tp-danger); } .check-warn { color: #B45309; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.logo-preview { max-height: 72px; max-width: 220px; border: 1px solid var(--tp-border); border-radius: 6px; padding: 4px; background: #fff; }
.chart-box { position: relative; height: 290px; }
.chart-box.chart-sm { height: 230px; }
.chart-box.chart-lg { height: 330px; }
.doc-meta dt { font-weight: 600; color: var(--tp-muted); font-size: .84rem; }
.doc-meta dd { margin-bottom: .55rem; }
.text-pre-wrap { white-space: pre-wrap; }
.mw-480 { max-width: 480px; } .mw-720 { max-width: 720px; } .mw-960 { max-width: 960px; }
.w-120 { width: 120px; } .w-160 { width: 160px; }
.picker { position: relative; }
.picker-results { position: absolute; z-index: 1060; left: 0; right: 0; top: 100%; max-height: 18rem; overflow-y: auto; background: #fff; border: 1px solid var(--tp-border); border-radius: .6rem; box-shadow: var(--tp-shadow-lg); }
.picker-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .8rem; }
.picker-item:hover, .picker-item:focus { background: var(--tp-light); }
.ledger-tree .depth-1 { padding-left: 1.5rem !important; } .ledger-tree .depth-2 { padding-left: 3rem !important; } .ledger-tree .depth-3 { padding-left: 4.5rem !important; }

/* Password show / hide */
.pw-field { position: relative; display: block; }
.pw-field > .form-control { padding-right: 2.9rem; }
.pw-field > .form-control.is-invalid { padding-right: calc(1.5em + .75rem + 2.4rem); background-position: right calc(.375em + .1875rem + 2.4rem) center; }
.pw-toggle { position: absolute; top: 50%; right: .3rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: .4rem; background: transparent; color: var(--tp-muted); cursor: pointer; }
.pw-toggle:hover { color: var(--tp-text); background: rgba(127, 127, 127, .12); }
.pw-toggle .pw-hide, .pw-toggle.is-shown .pw-show { display: none; }
.pw-toggle.is-shown .pw-hide { display: inline-block; }
.pw-field:has(.is-invalid) ~ .invalid-feedback { display: block; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }

/* ── Report center ─────────────────────────────────────────────────── */
.report-search { max-width: 420px; }
.report-card { transition: box-shadow .15s, border-color .15s; position: relative; }
.report-card:hover, .report-card:focus-within { border-color: var(--tp-primary); box-shadow: 0 4px 14px rgba(0, 107, 67, .1); }
.report-card .rc-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.report-card .rc-link:focus-visible { outline-offset: -2px; }
.report-card .rc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--tp-light); color: var(--tp-secondary); flex-shrink: 0; }
.report-card .rc-icon.g-inventory { background: #E8EFFD; color: var(--tp-info); }
.report-card .rc-icon.g-financial { background: #FDEBE3; color: var(--tp-accent); }
.report-card .rc-icon.g-partners { background: #F1EAFE; color: #6D28D9; }
.report-card .rc-title { font-weight: 700; color: var(--tp-text); }
.report-card .rc-desc { font-size: .87rem; color: var(--tp-muted); }
.report-card .rc-mode { font-size: .72rem; font-weight: 700; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .05em; }
.report-card .rc-fav { position: relative; z-index: 2; border: 0; background: none; color: #A3B3C2; padding: 2px; border-radius: 6px; line-height: 1; }
.report-card .rc-fav:hover { color: var(--tp-accent); }
.report-card .rc-fav.is-fav { color: #F59E0B; }
.report-card .rc-fav.is-fav svg { fill: currentColor; }
.report-nav .list-group-item { border: 0; border-radius: 8px !important; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--tp-text); padding: .5rem .75rem; }
.report-nav .list-group-item.active { background: var(--tp-light); color: var(--tp-secondary); }
.report-nav .list-group-item:hover { background: var(--tp-surface); }
.count-pill { font-size: .74rem; font-weight: 700; background: var(--tp-surface); border: 1px solid var(--tp-border); color: var(--tp-muted); border-radius: 999px; padding: 0 8px; }
.quick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--tp-border); background: var(--tp-card); color: var(--tp-text); font-weight: 600; font-size: .86rem; text-decoration: none; }
.quick-chip:hover { border-color: var(--tp-primary); color: var(--tp-secondary); }
.guide-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; }
.guide-box dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tp-muted); }
.guide-box dd { margin: 2px 0 0; font-size: .9rem; }

/* ── Responsive ────────────────────────────────────────────────────── */
img, svg, canvas { max-width: 100%; }
.card, .card-body { min-width: 0; }
.table-responsive { -webkit-overflow-scrolling: touch; }
@media (max-width: 767.98px) {
  html { font-size: 15px; }
  h1, .h1 { font-size: 1.32rem; }
  .content { padding: 14px 10px 28px; }
  .card-body { padding: 14px; }
  .kpi { padding: 13px 14px 12px; }
  .kpi-value { font-size: 1.3rem; }
  .fin-list li { padding: 8px 14px; }
  .statement td { padding: 7px 12px; }
  .statement tr.st-indent td:first-child { padding-left: 22px; }
  .table-toolbar .search, .table-toolbar .form-control, .table-toolbar .form-select { max-width: 100%; flex: 1 1 100%; }
  .table-responsive > .table > :not(caption) > * > * { white-space: nowrap; }
  .stat-card .stat-value { font-size: 1.18rem; }
  .chart-box, .chart-box.chart-lg { height: 230px; }
  .toast-stack { left: 10px; right: 10px; max-width: none; }
  .topbar .breadcrumb { display: none; }
  .page-header .btn { flex: 1 1 auto; justify-content: center; }
  .page-header > .d-flex { flex-wrap: wrap; width: 100%; }
  .range-chips { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .period-bar { width: 100%; }
  .footer { padding: 12px 14px; }
}
@media print {
  .sidebar, .topbar, .footer, .btn, .table-toolbar, .no-print, .module-tabs, .range-chips, .term-help { display: none !important; }
  .main { margin-left: 0 !important; }
  body { background: #fff; }
  .card { border: 0 !important; box-shadow: none !important; }
  .table-scroll { max-height: none; overflow: visible; }
}
.mh-cat { max-height: 520px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; } .quick-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.mw-900 { max-width: 900px; } .logo-preview img { max-height: 64px; max-width: 210px; } .logo-preview { display: inline-block; }
.w-140 { width: 140px; }
fieldset.contents { display: contents; }
.coa-depth-1 { padding-left: 1.2rem !important; } .coa-depth-2 { padding-left: 2.2rem !important; } .coa-depth-3 { padding-left: 3.2rem !important; } .coa-depth-4 { padding-left: 4.2rem !important; }
.install-card { max-width: 640px; width: 100%; }
.install-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; counter-reset: s; font-size: .78rem; }
.install-steps li { flex: 1; text-align: center; padding: 6px 4px; border-radius: 6px; background: #eef2f0; color: var(--tp-muted); counter-increment: s; }
.install-steps li::before { content: counter(s) ". "; }
.install-steps li.active { background: var(--tp-primary); color: #fff; font-weight: 600; }
.install-steps li.done { background: #d8f0e3; color: var(--tp-secondary); }
@media (min-width: 768px) { .border-start-md { border-left: 1px solid var(--tp-border-soft); padding-left: 20px; } }
.table-scroll .table > :not(caption) > * > * { white-space: nowrap; }

/* rows stay one line high: numbers, dates and names never break; long free text (notes, descriptions) still wraps */
.table > tbody > tr > td, .table > tfoot > tr > td { white-space: nowrap; }
.table > tbody > tr > td.small, .table > tbody > tr > td.wrap, .table td.text-pre-wrap, .table > tbody > tr > td.text-wrap { white-space: normal; min-width: 12rem; }
.line-table > tbody > tr > td { white-space: normal; }

/* form summary dock (sale / purchase / refill) */
.form-dock { position: fixed; left: var(--tp-sidebar-w); right: 0; bottom: 0; z-index: 1015; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--tp-border); box-shadow: 0 -6px 20px rgba(20, 37, 54, .08);
  padding: 8px 28px; display: none; align-items: center; gap: 8px 22px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.form-dock.show { display: flex; }
.form-dock .fd-item { display: flex; flex-direction: column; line-height: 1.2; }
.form-dock .fd-item small { color: var(--tp-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.form-dock .fd-item strong { font-size: 1.05rem; }
.form-dock .fd-grand strong { font-size: 1.2rem; color: var(--tp-secondary); }
body.sidebar-collapsed .form-dock { left: var(--tp-sidebar-w-collapsed); }
@media (max-width: 991.98px) { .form-dock { left: 0; padding: 8px 14px; } }
.totals-box .ts-title { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--tp-secondary); margin-bottom: 6px; display: flex; justify-content: space-between; }
.totals-box .row-line.muted { color: var(--tp-muted); font-size: .92rem; }
/* line editors: compact inputs so 100-line documents stay manageable */
.line-table .form-control, .line-table .form-select { padding: .32rem .6rem; font-size: .93rem; }
.line-table > :not(caption) > * > * { padding: .4rem .6rem; }
.line-table .form-text, .line-table small { font-size: .76rem; }
.line-table tbody tr + tr > td { border-top: 1px solid var(--tp-border-soft); }
/* sidebar density: all 14 modules + section labels fit without scrolling from 720 px screen height up (1280×720, 1366×768);
   shorter screens scroll inside the sidebar (mouse wheel / touch) down to Settings and User Role */
.sidebar-nav { padding-top: 4px; padding-bottom: 8px; }
.sidebar-nav .nav-section { padding: 9px 12px 3px; font-size: .66rem; }
.sidebar-nav .nav-section:first-child { padding-top: 4px; }
.sidebar-nav a { padding: 6px 12px; font-size: .93rem; line-height: 1.45; }
.sidebar-brand { min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.sidebar-foot { padding: 7px 16px; }
@media (max-height: 700px) { .sidebar-nav .nav-section { display: none; } }
