@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --ink: #172032;
    --muted: #697386;
    --brand: #0f766e;
    --brand-dark: #0b4f4a;
    --gold: #d99a24;
    --surface: #ffffff;
    --line: #dbe3ec;
    --page: #eef5f3;
}

* { letter-spacing: 0; }
body { margin: 0; font-family: Inter, "Noto Sans Bengali", system-ui, sans-serif; color: var(--ink); background: radial-gradient(circle at top left, #f9fbfa, var(--page)); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { background: #10231f; color: #dce8e3; padding: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; box-shadow: 10px 0 30px rgba(15, 35, 31, .16); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font-size: 1.05rem; }
.brand span { display: block; font-size: .78rem; color: #b9cac4; font-family: "Noto Sans Bengali", sans-serif; }
.nav-group { margin: 22px 0 8px; font-size: .72rem; text-transform: uppercase; color: #93aaa3; font-weight: 700; }
.sidebar .nav-link { color: #dce8e3; border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 3px; transition: .2s ease; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(255,255,255,.1); transform: translateX(3px); }
.main { min-width: 0; padding: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: clamp(1.35rem, 2vw, 2.1rem); font-weight: 800; }
.topbar p { margin: 2px 0 0; color: var(--muted); }
.user-pill { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 24px rgba(23,32,50,.06); }
.content-card { background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: 0 20px 50px rgba(23,32,50,.08); }
.fade-in { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.form-control, .form-select, .btn { border-radius: 8px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--line); padding: 18px; border-radius: 8px; background: linear-gradient(180deg, white, #f6faf8); }
.stat i { font-size: 1.4rem; color: var(--brand); }
.stat span { display: block; color: var(--muted); margin-top: 8px; }
.stat strong { font-size: 1.5rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dashboard-chart { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 18px; }
.dashboard-chart canvas { width: 100%; max-height: 320px; display: none; }
.dashboard-chart.chart-ready canvas { display: block; }
.dashboard-chart.chart-ready .cashflow-bars { display: none; }
.cashflow-bars { min-height: 240px; display: flex; align-items: end; gap: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; padding: 20px 14px 12px; background: #fbfdfc; }
.cashflow-month { min-width: 74px; text-align: center; display: grid; gap: 8px; }
.cashflow-stick { height: 180px; display: flex; justify-content: center; align-items: end; gap: 6px; border-bottom: 1px solid #cbd6df; }
.cashflow-stick .bar { width: 18px; min-height: 4px; border-radius: 5px 5px 0 0; display: inline-block; }
.cashflow-stick .in { background: #0f766e; }
.cashflow-stick .out { background: #d99a24; }
.cashflow-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.cashflow-summary span { background: #f4f8f6; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.daybook-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.daybook-summary span { background: #f4f8f6; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.permission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.permission-grid label { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; }
.ledger-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.ledger-table th, .ledger-table td { white-space: nowrap; }
.ledger-table td:nth-child(3) { white-space: normal; min-width: 260px; }
.report-heading { text-align: center; margin: 10px 0 20px; }
.report-heading h4 { margin: 0; font-weight: 800; }
.report-heading p { margin: 4px 0 0; color: var(--muted); }
.report-table tfoot th { background: #f4f8f6; }
.report-total { margin-top: 18px; padding: 16px; border-radius: 8px; font-size: 1.15rem; font-weight: 800; text-align: right; }
.report-total.profit { background: #e8f7ef; color: #0f6b3d; }
.report-total.loss { background: #fff0ed; color: #a33a25; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f332d, #e7f2ee); }
.login-box { width: min(420px, calc(100vw - 32px)); background: white; padding: 28px; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.table { vertical-align: middle; }
@media (max-width: 992px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 10; transform: translateX(-100%); transition: .25s ease; width: 280px; }
    .sidebar.open { transform: none; }
    .stats-grid, .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
    .main { padding: 14px; }
    .content-card { padding: 16px; }
    .stats-grid, .permission-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
    .user-pill { display: none; }
}
