/* ধারখাতা - নিজস্ব স্টাইল (সব ফাইল লোকাল, ইন্টারনেট লাগে না) */

:root {
    /* বাংলা ফন্ট: ইনস্টল থাকলে Noto Sans Bengali, না থাকলে Windows/Android/iOS এর বাংলা ফন্ট */
    --bs-body-font-family: 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda', 'Shonar Bangla', 'Kalpurush', 'Mukta', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    --bs-body-bg: #f1f5f9;
    --bs-body-color: #1e293b;
    --bs-border-radius: .6rem;

    --dk-brand: #0f766e;
    --dk-brand-dark: #0b5f59;
    --dk-ink: #0f172a;
    --dk-ink-2: #1e293b;

    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: #0b5f59;
    --bs-link-hover-color-rgb: 11, 95, 89;
    --bs-success: #15803d;
    --bs-success-rgb: 21, 128, 61;
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--bs-body-font-family); background: var(--bs-body-bg); color: var(--bs-body-color); line-height: 1.6; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--bs-body-font-family); font-weight: 700; color: var(--dk-ink); }

/* ---------- বাটন ---------- */
.btn { font-family: var(--bs-body-font-family); font-weight: 500; text-shadow: none; border-radius: .6rem; }
.btn-primary {
    --bs-btn-bg: #0f766e; --bs-btn-border-color: #0f766e; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #0b5f59; --bs-btn-hover-border-color: #0b5f59; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #0b5f59; --bs-btn-active-border-color: #0b5f59;
    --bs-btn-disabled-bg: #0f766e; --bs-btn-disabled-border-color: #0f766e;
}
.btn-outline-primary {
    --bs-btn-color: #0f766e; --bs-btn-border-color: #0f766e;
    --bs-btn-hover-bg: #0f766e; --bs-btn-hover-border-color: #0f766e; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #0f766e; --bs-btn-active-border-color: #0f766e; --bs-btn-active-color: #fff;
}
.btn-success {
    --bs-btn-bg: #15803d; --bs-btn-border-color: #15803d; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #116a33; --bs-btn-hover-border-color: #116a33; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #116a33; --bs-btn-active-border-color: #116a33;
    --bs-btn-disabled-bg: #15803d; --bs-btn-disabled-border-color: #15803d;
}
.btn-outline-success {
    --bs-btn-color: #15803d; --bs-btn-border-color: #15803d;
    --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #15803d; --bs-btn-active-border-color: #15803d;
}
.btn-warning {
    --bs-btn-bg: #d97706; --bs-btn-border-color: #d97706; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #b45f05; --bs-btn-hover-border-color: #b45f05; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #b45f05; --bs-btn-active-border-color: #b45f05;
    --bs-btn-disabled-bg: #d97706; --bs-btn-disabled-border-color: #d97706;
}
.btn i, .nav-link i { width: 1.25em; text-align: center; }

/* ---------- ফর্ম ---------- */
.form-control, .form-select { min-height: 42px; border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: #0f766e; box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .18); }
.form-check-input:checked { background-color: #0f766e; border-color: #0f766e; }
.form-check-input:focus { border-color: #0f766e; box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .18); }
.form-label { font-weight: 500; }

/* ---------- কার্ড ও টেবিল ---------- */
.stat-card, .table-card { border: 0; border-radius: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); background: #fff; }
.table-card .card-header, .table-card .card-footer { border-color: #e2e8f0; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead > tr > th { font-size: .82rem; font-weight: 600; color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.table > tbody > tr > td { border-color: #eef2f7; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f8fafc; }
.table tfoot td { border-top: 2px solid #e2e8f0; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagination { --bs-pagination-active-bg: #0f766e; --bs-pagination-active-border-color: #0f766e; --bs-pagination-color: #0f766e; margin-bottom: 0; }
.alert { border: 0; border-radius: 12px; }
.badge { font-weight: 500; }

/* ---------- মূল লেআউট (সাইডবার + টপবার) ---------- */
.sidebar { background: linear-gradient(180deg, #0f172a 0%, #111c33 100%); }
.sidebar-inner { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #5eead4; font-weight: 700; letter-spacing: .2px; }
.sidebar .nav-link { color: #cbd5e1; border-radius: 10px; padding: .55rem .8rem; }
.sidebar .nav-link:hover { background: #1e293b; color: #fff; }
.sidebar .nav-link.active { background: #0f766e; color: #fff; }
.sidebar .nav-link.disabled { color: #64748b; }
.sidebar .nav-heading { color: #64748b; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .8rem .25rem; }
.offcanvas.sidebar { width: 280px; }

.topbar { position: sticky; top: 0; z-index: 1020; }
.page-pad { padding: 1rem; }
@media (min-width: 768px) { .page-pad { padding: 1.5rem; } }

/* ---------- লগইন/নিবন্ধন ---------- */
.auth-card { max-width: 440px; border: 0; border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); background: #fff; }
.brand { color: #0f766e; font-weight: 700; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: #0f766e; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* ---------- প্রিন্ট পেজ (স্টেটমেন্ট/রসিদ) ---------- */
.sheet { background: #fff; max-width: 900px; margin: 1rem auto; padding: 1.5rem; border-radius: 12px; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }

/* ---------- মোবাইল ---------- */
@media (max-width: 575.98px) {
    .table { font-size: .9rem; }
    .stat-card .fs-2 { font-size: 1.6rem !important; }
    .btn-sm { padding: .4rem .7rem; }
}

/* ---------- প্রিন্ট ---------- */
@page { size: A4; margin: 12mm; }
@media print {
    body { background: #fff; }
    .sidebar, .topbar, .no-print, .offcanvas { display: none !important; }
    main { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
    .page-pad { padding: 0 !important; }
    .stat-card, .table-card, .sheet { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
    .sheet { margin: 0; padding: 0; max-width: none; border: 0 !important; border-radius: 0; }
    a { text-decoration: none; color: inherit; }
    thead { display: table-header-group; }
    tr { page-break-inside: avoid; }
}

/* ---------- Part 6: লোডিং বার, toast, নিচের ট্যাব-বার, চার্ট ---------- */
.top-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #0f766e, #5eead4); z-index: 2000; opacity: 0; pointer-events: none; }
html.is-loading .top-loader { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1, .7, .3, 1), opacity .2s; }

#toastArea { position: fixed; top: 4rem; right: 0; z-index: 1100; max-width: 100%; }
#toastArea .toast { min-width: 260px; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); border-radius: 12px; }
@media (max-width: 575.98px) { #toastArea { left: 0; top: 3.75rem; } #toastArea .toast { width: 100%; } }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid #e2e8f0;
    display: flex; align-items: stretch; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
.bottom-nav .bn-item { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: .45rem .25rem; min-height: 58px; font-size: .72rem; color: #64748b; text-decoration: none; background: none; border: 0; }
.bottom-nav .bn-item i { font-size: 1.15rem; }
.bottom-nav .bn-item.active { color: #0f766e; font-weight: 600; }
.bottom-nav .bn-fab-wrap { flex: 1 1 0; display: flex; align-items: center; justify-content: center; }
.bottom-nav .bn-fab { width: 54px; height: 54px; margin-top: -22px; border-radius: 50%; border: 0; background: #0f766e; color: #fff; font-size: 1.3rem;
    box-shadow: 0 6px 16px rgba(15, 118, 110, .4); }
.bottom-nav .bn-fab:active { transform: scale(.96); }
@media (max-width: 991.98px) { .page-pad { padding-bottom: 92px; } }
.quick-sheet.offcanvas-bottom { height: auto; max-height: 85vh; border-radius: 18px 18px 0 0; }
#quickResults .list-group-item { border-left: 0; border-right: 0; }

.chart-card svg { display: block; width: 100%; height: auto; }
.chart-card .chart-text { fill: #64748b; font-size: 11px; font-family: inherit; }
.chart-card .chart-grid { stroke: #e2e8f0; stroke-width: 1; }
.chart-card .bar-credit { fill: #d97706; }
.chart-card .bar-payment { fill: #15803d; }
.chart-card .bar-credit:hover, .chart-card .bar-payment:hover { opacity: .8; }
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

@media (prefers-reduced-motion: reduce) {
    html.is-loading .top-loader { transition: none; }
    .bottom-nav .bn-fab:active { transform: none; }
}
@media print { .bottom-nav, #toastArea, .top-loader { display: none !important; } }
