/* ডিজিটাল নোটবুক — ডার্ক/লাইট থিম */
:root, [data-bs-theme="dark"] {
  --bg: #232333; --panel: #2b2c40; --panel-2: #323249; --line: #3d3e57;
  --ink: #e4e6f4; --muted: #a3a4cc; --accent: #696cff; --accent-2: #8f91ff;
  --side: 260px; --radius: 10px; --shadow: 0 2px 10px rgba(0,0,0,.25);
  --bs-body-bg: #232333; --bs-body-color: #e4e6f4; --bs-border-color: #3d3e57;
  --bs-secondary-bg: #2b2c40; --bs-tertiary-bg: #323249;
}
[data-bs-theme="light"] {
  --bg: #f5f5f9; --panel: #ffffff; --panel-2: #f3f4fa; --line: #e3e5ef;
  --ink: #384551; --muted: #8592a3; --shadow: 0 2px 8px rgba(67,89,113,.08);
  --bs-body-bg: #f5f5f9; --bs-body-color: #384551;
}
* { font-family: 'Hind Siliguri', system-ui, sans-serif; }
body { background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--accent-2); }
[data-bs-theme="light"] a { color: var(--accent); }
.btn-xs { padding: .15rem .4rem; font-size: .75rem; border-radius: .3rem; }
.btn-teal, .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-teal:hover, .btn-primary:hover { background: #5f61e6; border-color: #5f61e6; color: #fff; }
.btn-bkash { background: #e2136e; color: #fff; border: 0; } .btn-bkash:hover { background: #c40f5f; color: #fff; }

/* সাইডবার */
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); background: var(--panel); z-index: 1030; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: width .2s, transform .2s; }
.side-head { display: flex; align-items: center; padding: 16px 14px 12px 18px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink) !important; min-width: 0; }
.brand-logo { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; background: linear-gradient(135deg, #696cff, #03c3ec); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text b { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-toggle { position: absolute; right: -13px; top: 22px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--bg); background: var(--accent); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 24px; }
.nav-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; margin: 2px 0; border: 0; border-radius: 8px; background: none; color: var(--ink); text-decoration: none; text-align: left; font-size: .93rem; }
.nav-row > i:first-child { width: 18px; text-align: center; color: var(--muted); font-size: .92rem; }
.nav-row span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-row .chev { font-size: .65rem; color: var(--muted); transition: transform .2s; }
.nav-row.group:not(.collapsed) .chev { transform: rotate(90deg); }
.nav-row:hover { background: var(--panel-2); color: var(--ink); }
.nav-row.active { background: linear-gradient(72deg, #696cff, #8f91ff); color: #fff; box-shadow: 0 2px 6px rgba(105,108,255,.45); }
.nav-row.active > i { color: #fff; }
.nav-row.group:not(.collapsed) { background: var(--panel-2); }
.nav-row.logout, .nav-row.logout i { color: #ff6b6b; }
.sub { padding: 2px 0 4px 0; }
.sub-row { display: block; position: relative; padding: 6px 12px 6px 44px; margin: 1px 0; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .87rem; }
.sub-row::before { content: ""; position: absolute; left: 20px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; border: 1px solid var(--muted); }
.sub-row:hover { color: var(--ink); background: var(--panel-2); }
.sub-row.active { color: var(--ink); background: rgba(105,108,255,.16); font-weight: 600; }
.sub-row.active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(105,108,255,.25); }

/* মেনু ছোট মোড (ডেস্কটপ) */
@media (min-width: 992px) {
  .mini .sidebar { width: 78px; }
  .mini .brand-text, .mini .nav-row span, .mini .nav-row .chev, .mini .sub { display: none !important; }
  .mini .nav-row { justify-content: center; }
  .mini .mini-toggle i { transform: rotate(180deg); }
  .mini .content { margin-left: 78px; }
}

/* কন্টেন্ট ও টপবার */
.content { margin-left: var(--side); padding: 14px 22px 18px; transition: margin .2s; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 18px; box-shadow: var(--shadow); position: sticky; top: 10px; z-index: 1020; backdrop-filter: blur(6px); }
.crumb { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb i { color: var(--accent); margin-right: 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); }
.avatar-btn { position: relative; display: inline-block; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #71dd37, #03c3ec); }
.online { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #71dd37; border: 2px solid var(--panel); }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 28px; }

/* কার্ড/প্যানেল */
.panel, .box, .card { background: var(--panel); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); }
.panel { padding: 18px; }
.box .card-header { display: flex; justify-content: space-between; align-items: center; background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink); padding: 12px 18px; }
.box .card-header i { color: var(--accent-2); }
.box .card-body { padding: 18px; }
.form-label { font-size: .85rem; margin-bottom: 3px; font-weight: 500; color: var(--muted); }
.form-control, .form-select { background-color: var(--bg); border-color: var(--line); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(105,108,255,.2); background-color: var(--bg); color: var(--ink); }
.form-control[readonly], .bg-light { background-color: var(--panel-2) !important; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); font-size: .87rem; }
.table th { white-space: nowrap; }
.table > thead:not([class]) th, .table tfoot td { background: var(--panel-2) !important; color: var(--ink); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(105,108,255,.07); }
.text-end { text-align: right; }
.alert { border: 0; border-radius: var(--radius); }
.dropdown-menu { background: var(--panel); border-color: var(--line); box-shadow: 0 6px 22px rgba(0,0,0,.3); }
.dropdown-item { color: var(--ink); } .dropdown-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-pills .nav-link.active { background: var(--accent); }

/* ড্যাশবোর্ড */
.welcome .w-logo { width: 92px; height: 92px; border-radius: 14px; background: #fff; color: var(--accent); display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; }
.welcome .w-info { line-height: 1.75; font-size: .93rem; }
.welcome .w-info span { color: #38bdf8; }
.welcome .w-hello { font-size: 1.15rem; color: #38bdf8; }
.welcome .w-hello b { color: #38bdf8; font-weight: 600; }
.clock { background: #1e293b; border: 2px solid #38bdf8; border-radius: 12px; padding: 12px 28px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.clock .c-time { font-size: 2.3rem; color: #38bdf8; font-weight: 600; letter-spacing: 1px; line-height: 1.1; }
.clock .c-date { color: #cbd5e1; font-size: .9rem; letter-spacing: .5px; }
[data-bs-theme="light"] .clock { background: #0f172a; }
.stat-card { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; height: 100%; box-shadow: var(--shadow); }
.stat-card .s-ico { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.stat-card .eye { border: 0; background: none; color: var(--muted); padding: 2px; }
.stat-card .s-label { color: var(--muted); font-size: .86rem; margin-top: 10px; }
.stat-card .s-val { font-size: 1.12rem; font-weight: 700; margin-top: 2px; letter-spacing: .5px; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 74px; margin-top: 10px; }
.mb-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.mb-bar { width: 100%; max-width: 22px; border-radius: 4px; background: linear-gradient(180deg, #8f91ff, #696cff); }
.mb-col small { font-size: .62rem; color: var(--muted); }
.dash-sec { height: 100%; }
.sec-title { text-align: center; font-size: 1.12rem; font-weight: 600; padding: 12px; border-bottom: 1px solid var(--line); }
.border-split { border-right: 1px solid var(--line); }
@media (max-width: 767px) { .border-split { border-right: 0; border-bottom: 1px solid var(--line); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; padding: 14px 10px 16px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px; border-radius: 10px; text-decoration: none; color: var(--ink) !important; text-align: center; font-size: .84rem; transition: .15s; }
.tile:hover { background: var(--panel-2); transform: translateY(-2px); }
.tile .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; color: var(--c); background: var(--bg); box-shadow: 0 3px 8px rgba(0,0,0,.25), inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
[data-bs-theme="light"] .tile .ico { background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: none; }
.tile .tl { line-height: 1.25; }
.stat { background: var(--panel); border-radius: 10px; padding: 12px; display: flex; gap: 12px; align-items: center; border-left: 4px solid var(--c); box-shadow: var(--shadow); height: 100%; }
.stat > i { font-size: 1.6rem; color: var(--c); } .stat .v { font-size: 1.15rem; font-weight: 700; } .stat .l { font-size: .78rem; color: var(--muted); }
.mini { background: var(--panel-2); border-radius: 8px; padding: 8px; text-align: center; } .mini .l { font-size: .78rem; color: var(--muted); } .mini .v { font-weight: 700; font-size: 1.05rem; }
.plan .price { font-size: 2rem; font-weight: 700; color: #e2136e; }
.result .card { background: var(--panel-2); }

/* লগইন */
body.auth { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #3b3d6b, #232333 60%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--panel); border-radius: 16px; padding: 28px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.auth-card .logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 8px; background: linear-gradient(135deg, #696cff, #03c3ec); color: #fff; display: grid; place-items: center; font-size: 1.9rem; }
.auth-card .bg-light { background: var(--panel-2) !important; border-color: var(--line) !important; }
.auth-card .text-muted { color: var(--muted) !important; }

/* রশিদ */
.receipt-page { background: #eee; } .receipt { max-width: 720px; margin: 20px auto; background: #fff; color: #222; padding: 24px; border: 1px dashed #999; }
.receipt .table { --bs-table-color: #222; }
.print-head { display: none; text-align: center; margin-bottom: 10px; }
.application { max-width: 800px; }

/* মোবাইল */
.backdrop { display: none; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  body.side-open .sidebar { transform: none; }
  body.side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1025; }
  .mini-toggle { display: none; }
  .content { margin-left: 0; padding: 10px 12px; }
  .clock { width: 100%; }
}
@media (min-width: 992px) { .sidebar-toggle { display: none; } }
@media (max-width: 575px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile { font-size: .76rem; }
  .welcome .w-logo { width: 64px; height: 64px; font-size: 1.8rem; }
  .clock .c-time { font-size: 1.8rem; }
}

@media print {
  .no-print, .sidebar, .topbar, .btn, form.no-print { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; font-size: 12px; }
  .content { margin: 0; padding: 0; }
  .box, .panel { box-shadow: none; background: #fff; color: #000; }
  .box .card-header { display: none; }
  .table { --bs-table-color: #000; font-size: 11px; }
  .print-head { display: block; }
  a { color: #000; text-decoration: none; }
}
.welcome .w-logo { border: 1px solid var(--line); }
