/* ============================================================
   টালি খাতা — Professional SaaS UI
   Sidebar layout + Hind Siliguri + mobile-first responsive
   ============================================================ */
:root {
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #f0fdfa;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --rose: #e11d48;
  --rose-bg: #ffe4e6;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 6px 18px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.35; }
p { margin: 0 0 12px; }
a { color: var(--teal-dark); }

/* ================= App shell ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.brand .brand-mark {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal);
  border-radius: 11px;
  font-size: 20px;
}
.brand-mark svg { width: 20px; height: 20px; display: block; }

.menu { padding: 4px 0; overflow-y: auto; }
.menu a {
  display: flex; align-items: center; gap: 12px;
  margin: 3px 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.menu a .mi {
  width: 22px; height: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.menu a .mi svg { width: 20px; height: 20px; display: block; }
.menu a:hover { background: var(--sidebar-2); color: #fff; transform: translateX(4px); }
.menu a.on { background: var(--teal); color: #fff; font-weight: 600; }
.menu a.on:hover { transform: none; }

.side-foot {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-goto {
  flex: 1 1 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
  text-decoration: none;
  border: 1px dashed #4c1d95;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 8px;
  padding: 7px 10px;
  transition: background 0.15s, color 0.15s;
}
.admin-goto:hover { background: rgba(124, 58, 237, 0.28); color: #fff; }
.side-foot .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who .nm { color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who .rl { font-size: 12px; color: #94a3b8; }
.side-foot .logout {
  color: #fda4af; text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border: 1px solid #3f3f46; border-radius: 8px; white-space: nowrap;
}
.side-foot .logout:hover { background: #3f1d24; }

.backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: none; }

.content {
  padding: 28px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  flex: 1;
}

/* ================= Page head / cards ================= */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 24px; }
.page-head h2 { margin: 0; font-size: 19px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.cards .card { margin-bottom: 0; }
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 14px; }

.stat { position: relative; overflow: hidden; }
.stat .stat-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
  transition: transform 0.22s ease;
}
.stat .stat-ic svg { width: 22px; height: 22px; display: block; }
.stat:hover .stat-ic { transform: scale(1.07) rotate(-4deg); }
.stat .stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .stat-val { font-size: 24px; font-weight: 700; margin: 2px 0; }

/* Gradient icon chips */
.chip-rose  { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #e11d48; }
.chip-green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.chip-amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.chip-teal  { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; }
.chip-sky   { background: linear-gradient(135deg, #e0f2fe, #bae6fd); color: #0284c7; }

/* Stat grid: desktop-এ এক লাইনে ৪টি, mobile-এ 2×2 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-grid .card { margin-bottom: 0; }

/* Entrance motion (staggered fade-up) + hover lift */
@keyframes tkFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat {
  animation: tkFadeUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cards .stat:nth-child(2), .stat-grid .stat:nth-child(2) { animation-delay: 0.07s; }
.cards .stat:nth-child(3), .stat-grid .stat:nth-child(3) { animation-delay: 0.14s; }
.cards .stat:nth-child(4), .stat-grid .stat:nth-child(4) { animation-delay: 0.21s; }
.stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.13);
}

.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 8px;
}
.two-col .card { margin-bottom: 16px; }

/* ================= Tables ================= */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14.5px; }
thead th {
  text-align: left; padding: 12px 14px;
  background: #f1f5f9; color: #475569; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ================= Forms ================= */
.form label {
  display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px;
}
.form input[type="text"],
.form input[type="tel"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="date"],
.form select,
.form textarea,
.inline-form select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.form input:focus, .form select:focus, .form textarea:focus, .inline-form select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 14px;
}
.span-2 { grid-column: span 2; }
.inline-form select { width: auto; min-width: 190px; margin-top: 0; }
form.inline { display: inline; }

/* ================= Buttons ================= */
.btn {
  display: inline-block;
  background: var(--teal); color: #fff;
  border: none; border-radius: 10px;
  padding: 10px 20px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 13px 30px; font-size: 17px; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn-danger { background: var(--rose); }
.btn-danger:hover { background: #be123c; }
.btn-light { background: #e2e8f0; color: var(--text); }
.btn-light:hover { background: #cbd5e1; }

/* ================= Badges / alerts / misc ================= */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.kind-due { background: var(--rose-bg); color: var(--rose); }
.kind-received { background: var(--green-bg); color: var(--green); }
.kind-purchase { background: var(--amber-bg); color: var(--amber); }
.kind-paid { background: #e0f2fe; color: #0284c7; }
.st-active, .st-verified { background: var(--green-bg); color: var(--green); }
.st-suspended, .st-rejected, .st-cancelled { background: var(--rose-bg); color: var(--rose); }
.st-pending { background: var(--amber-bg); color: var(--amber); }
.st-expired { background: #f1f5f9; color: #475569; }

.alert {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600;
}
.alert.err { background: var(--rose-bg); color: #be123c; border: 1px solid #fecdd3; }
.alert.ok { background: var(--green-bg); color: #15803d; border: 1px solid #bbf7d0; }
.alert.warn { background: var(--amber-bg); color: #92400e; border: 1px solid #fde68a; }
.badge.warn { background: var(--amber-bg); color: #92400e; }

/* ক্রেডিট লিমিট মিনি-ফর্ম */
.limit-form { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; }
.limit-form input[type="number"] {
  width: 110px; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; font-family: inherit;
}
.limit-form input[type="number"]:focus { outline: none; border-color: var(--teal); }

/* ================= ইনভয়েস ================= */
.invoice { max-width: 760px; margin: 0 auto; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.inv-head h1 { margin: 0 0 4px; font-size: 24px; }
.inv-head h2 { margin: 0; font-size: 20px; color: var(--teal-dark); }
.inv-title { text-align: right; }
.inv-meta {
  display: flex; justify-content: space-between; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px;
}
.inv-sign { display: flex; justify-content: space-between; gap: 24px; margin: 44px 0 18px; }
.sign-box { flex: 1; max-width: 240px; border-top: 1.5px solid var(--text); padding-top: 8px; text-align: center; color: var(--muted); font-size: 14px; }
.inv-actions { display: flex; gap: 10px; margin-top: 18px; }
tr.total-row td { background: var(--teal-soft); font-size: 16px; }

/* ================= প্রিন্ট ================= */
@media print {
  .sidebar, .topbar, .hamburger, .backdrop, .foot, .noprint, .inv-actions { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; }
  .card, .table-wrap { box-shadow: none !important; border: 1px solid #ddd !important; }
  .invoice { max-width: none; }
  a { text-decoration: none; color: inherit; }
}

.muted { color: var(--muted); }
.center { text-align: center; }
.ta-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.link { color: var(--teal-dark); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.txt-rose { color: var(--rose); }
.txt-amber { color: var(--amber); }
.txt-green { color: var(--green); }

.empty {
  background: var(--card); border: 1.5px dashed var(--line);
  border-radius: var(--radius); padding: 34px 20px; text-align: center;
  color: var(--muted); margin-bottom: 18px;
}
.empty .btn { margin-top: 10px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button, .tabs a.tab-link {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 22px; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; color: var(--muted); text-decoration: none; display: inline-block;
}
.tabs button.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ভাষা টগল (topbar) */
.lang-toggle {
  font-size: 13px; font-weight: 700; color: var(--teal); text-decoration: none;
  border: 1.5px solid var(--teal); border-radius: 999px; padding: 4px 12px;
  white-space: nowrap;
}
.lang-toggle:hover { background: var(--teal); color: #fff; }

/* ================= Auth pages ================= */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #0f766e 60%, #0d9488 100%);
}
.auth-card {
  width: 100%; max-width: 430px;
  background: var(--card); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 32px 28px;
}
.auth-card .brand-row { text-align: center; margin-bottom: 18px; }
.auth-card .brand-row .brand-mark {
  width: 52px; height: 52px; font-size: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); border-radius: 15px; margin-bottom: 8px;
}
.auth-card h1 { text-align: center; font-size: 22px; }
.auth-card .sub { text-align: center; margin-bottom: 18px; }
.auth-alt { text-align: center; margin-top: 16px; }
.auth-home { text-align: center; margin-top: 10px; font-size: 13px; }

/* ================= Landing (logged-out home) ================= */
.landing { background: #fff; }
.landing-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.landing-nav .inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--text); text-decoration: none; }
.landing-brand .brand-mark {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); border-radius: 10px; font-size: 19px;
}
.landing-nav .nav-btns { display: flex; gap: 10px; align-items: center; }

.hero {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
  color: #fff; text-align: center;
  padding: 84px 20px 72px;
}
.hero .hero-pill {
  display: inline-block; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 18px; border-radius: 999px; font-size: 14px; margin-bottom: 20px;
}
.hero h1 { font-size: 40px; margin-bottom: 14px; }
.hero h1 .hl { color: #5eead4; }
.hero .hero-sub { font-size: 18px; color: #cbd5e1; max-width: 640px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero-stats { display: flex; gap: 26px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .hs { text-align: center; }
.hero-stats .hs b { display: block; font-size: 26px; color: #5eead4; }
.hero-stats .hs span { font-size: 13.5px; color: #94a3b8; }

.section { max-width: 1120px; margin: 0 auto; padding: 64px 20px; }
.section h2 { text-align: center; font-size: 30px; margin-bottom: 8px; }
.section .sec-sub { text-align: center; color: var(--muted); margin-bottom: 36px; font-size: 17px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feat {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feat:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1); }
.feat .fi {
  width: 48px; height: 48px; border-radius: 13px; background: var(--teal-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 12px;
}
.feat h3 { font-size: 17px; margin-bottom: 6px; }
.feat p { color: var(--muted); font-size: 14.5px; margin: 0; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; max-width: 760px; margin: 0 auto; }
.price-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px;
  padding: 30px 26px; text-align: center; position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.price-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1); }
.price-card.popular { border-color: var(--teal); box-shadow: 0 12px 40px rgba(13, 148, 136, 0.18); }
.price-card .pop {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 4px 16px; border-radius: 999px;
}
.price-card h3 { font-size: 20px; }
.price-card .amount { font-size: 38px; font-weight: 700; margin: 8px 0; }
.price-card .amount small { font-size: 15px; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; }
.price-card ul li { padding: 7px 0; border-bottom: 1px dashed #f1f5f9; font-size: 14.5px; }
.price-card ul li:last-child { border-bottom: none; }
.price-card ul li::before { content: '✓ '; color: var(--teal); font-weight: 700; }

.cta-band {
  background: var(--sidebar); color: #fff; text-align: center; padding: 60px 20px;
}
.cta-band h2 { font-size: 28px; margin-bottom: 10px; }
.cta-band p { color: #94a3b8; margin-bottom: 24px; }

.landing-footer {
  background: #0b1220; color: #94a3b8; padding: 30px 20px; text-align: center; font-size: 14px;
}
.landing-footer .fl { display: flex; gap: 18px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.landing-footer a { color: #cbd5e1; text-decoration: none; }
.landing-footer a:hover { color: #fff; }

/* ================= 404 ================= */
.notfound { text-align: center; padding: 70px 20px; }
.notfound .big { font-size: 72px; font-weight: 700; color: var(--teal); }
.notfound p { color: var(--muted); margin-bottom: 20px; }

/* ================= Motion preferences ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= Responsive ================= */
.hamburger {
  display: none;
  background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text);
  padding: 4px 8px;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    height: 100dvh; width: 272px;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .backdrop {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(15, 23, 42, 0.55);
  }
  body.nav-open .backdrop { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    position: sticky; top: 0; z-index: 40;
  }
  .topbar .hamburger { display: block; }
  .topbar .tt { font-weight: 700; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tb-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--text); }
  .topbar .tb-brand .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
  .content { padding: 16px 14px 30px; }
  .page-head h1 { font-size: 21px; }
  .two-col { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .hero h1 { font-size: 30px; }
  .hero { padding: 60px 18px 52px; }
  .section { padding: 44px 16px; }
  .stat .stat-val { font-size: 21px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid .card.stat { padding: 14px; }
  .stat-grid .stat-val { font-size: 19px; }
  .stat-grid .stat-ic { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 8px; }
  .stat-grid .stat-ic svg { width: 20px; height: 20px; }
  .stat-grid .hint { font-size: 11.5px; }
  .auth-card { padding: 26px 20px; }
}

/* ================= Analytics charts ================= */
.chart-box { position: relative; height: 300px; }
@media (max-width: 640px) { .chart-box { height: 240px; } }

/* ================= Premium entry modal ================= */
.entry-cta { margin: 2px 0 18px; }
.btn-premium {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff; border: none; border-radius: 14px;
  padding: 13px 22px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(13, 148, 136, .35);
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease;
  font-family: inherit;
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(13, 148, 136, .45); }
.btn-premium:active { transform: translateY(0); }
.btn-premium.btn-block { width: 100%; justify-content: center; margin-top: 4px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; z-index: 201; left: 50%; top: 50%;
  width: min(480px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 22px; padding: 24px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .35);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -46%) scale(.96);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.15), opacity .22s ease;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-x {
  background: #f1f5f9; border: none; width: 34px; height: 34px; border-radius: 50%;
  font-size: 14px; cursor: pointer; color: var(--muted); transition: background .15s, color .15s;
}
.modal-x:hover { background: #e2e8f0; color: var(--text); }
.modal-form { display: flex; flex-direction: column; gap: 12px; }

.ptype-pills { display: flex; background: #f1f5f9; border-radius: 14px; padding: 4px; gap: 4px; }
.pill {
  flex: 1; border: none; background: transparent; padding: 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all .18s ease; font-family: inherit;
}
.pill.active { background: #fff; color: var(--teal-dark); box-shadow: 0 2px 8px rgba(2, 6, 23, .12); }

/* Mobile: bottom-sheet style */
@media (max-width: 640px) {
  .entry-cta .btn-premium { width: 100%; justify-content: center; }
  .modal {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh;
    border-radius: 22px 22px 0 0; opacity: 1;
    transform: translateY(105%);
  }
  .modal.open { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-backdrop, .btn-premium { transition: none; }
}

/* ============================================================
   Mobile polish (360–640px) — ডেস্কটপ ডিজাইন একদম অপরিবর্তিত,
   শুধু এই media query ব্লকের ভেতরের নিয়ম মোবাইলে প্রযোজ্য।
   ============================================================ */
@media (max-width: 640px) {
  /* Touch target: কমপক্ষে 40px */
  .btn-small { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .tabs button, .tabs a.tab-link { min-height: 44px; }
  .modal-x { width: 40px; height: 40px; }
  .hamburger { padding: 8px 12px; }
  .lang-toggle { padding: 8px 14px; }
  .pill { min-height: 44px; }

  .tabs { flex-wrap: wrap; }

  /* Page head: business selector full-width */
  .page-head .inline-form { width: 100%; }
  .page-head .inline-form select { width: 100%; min-width: 0; }

  /* Tables: tighter cells = less horizontal scroll */
  .table-wrap th, .table-wrap td { padding: 10px; }

  /* Stat cards: compact */
  .stat-grid .stat-label { font-size: 12px; }

  /* Invoice: stack meta blocks */
  .inv-head h1 { font-size: 20px; }
  .inv-meta { flex-direction: column; gap: 8px; }

  /* Landing */
  .landing-nav .inner { padding: 10px 12px; }
  .hero h1 { font-size: 26px; }
  .hero .hero-sub { font-size: 16px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-stats { gap: 18px; }
  .section h2 { font-size: 24px; }
  .section .sec-sub { font-size: 15.5px; }
  .cta-band { padding: 44px 18px; }
  .cta-band h2 { font-size: 23px; }
}
@media (max-width: 480px) {
  /* Tiny screens: landing brand icon-only */
  .landing-brand { font-size: 0; }
  .topbar { padding: 10px 12px; gap: 8px; }
}

/* ================= PWA: bottom nav + install banner ================= */
.bottom-nav { display: none; }
.pwa-banner { display: none; }
@media (max-width: 768px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(2, 6, 23, .08);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px; min-height: 54px;
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
    background: none; border: none; font-family: inherit; cursor: pointer;
  }
  .bottom-nav svg { width: 23px; height: 23px; }
  .bottom-nav a.on { color: var(--teal-dark); }
  .bottom-nav a.on svg { stroke: var(--teal-dark); }
  .main .content { padding-bottom: 92px; }
  .pwa-banner {
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 160;
    background: #0f172a; color: #fff; border-radius: 16px; padding: 12px 14px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, .35);
  }
  .pwa-banner[hidden] { display: none; }
  .pwa-ic { font-size: 22px; }
  .pwa-tx { flex: 1; font-size: 13px; font-weight: 600; }
  .pwa-btn {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
    border: none; border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; white-space: nowrap;
  }
  .pwa-later {
    background: transparent; color: #94a3b8; border: none;
    font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap; padding: 9px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav, .pwa-banner { transition: none; }
}

/* ============================================================
   PREMIUM UPGRADE v2 — modal / dashboard / menubar
   (ডেস্কটপ লেআউট অপরিবর্তিত; শুধু ভিজ্যুয়াল পলিশ)
   ============================================================ */

/* ---------- ১. Entry modal: compact + gorgeous ---------- */
.modal {
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(13, 148, 136, .18);
}
/* top accent bar */
.modal::before {
  content: ''; position: absolute; top: 0; left: 26px; right: 26px; height: 4px; z-index: 6;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--teal), #5eead4 50%, var(--teal));
  box-shadow: 0 2px 10px rgba(13, 148, 136, .5);
}
.modal-head {
  position: relative; z-index: 5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; margin: 0;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 14px 18px 8px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot {
  position: relative; z-index: 5; flex-shrink: 0;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--card) 72%, rgba(255, 255, 255, 0));
  border-radius: 0 0 22px 22px;
}
.modal-form { gap: 10px; }
/* focus ring glow */
.modal .form input:focus, .modal .form select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .16), 0 0 14px rgba(13, 148, 136, .22);
  outline: none;
}
/* gradient pill active */
.pill.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, .45);
}
/* stronger backdrop blur */
.modal-backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
/* shine sweep on submit */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: tkShine 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tkShine { 0% { left: -60%; } 55%, 100% { left: 135%; } }

/* ---------- ২. Dashboard: animation + effect ---------- */
.stat { position: relative; overflow: hidden; animation-duration: .65s; }
.stat::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(13, 148, 136, .07), transparent 55%);
}
.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(13, 148, 136, .20), 0 4px 12px rgba(15, 23, 42, .08);
}
.stat .stat-ic {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 14px rgba(2, 6, 23, .10);
}
/* hero CTA banner */
.dash-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(120deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  border-radius: 20px; padding: 20px 22px; margin-bottom: 20px; color: #fff;
  box-shadow: 0 14px 32px rgba(13, 148, 136, .35);
  animation: tkFadeUp .55s cubic-bezier(.22, .61, .36, 1) backwards;
}
.dash-hero::before, .dash-hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .09); pointer-events: none;
}
.dash-hero::before { width: 190px; height: 190px; right: -55px; top: -75px; }
.dash-hero::after { width: 110px; height: 110px; right: 95px; bottom: -60px; }
.dash-hero-tx { position: relative; z-index: 1; min-width: 0; }
.dash-hero-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .72; }
.dash-hero-title { font-size: 21px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-hero {
  position: relative; z-index: 1; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--teal-dark); font-weight: 700; font-size: 15px;
  padding: 12px 20px; border-radius: 14px; text-decoration: none;
  box-shadow: 0 6px 16px rgba(2, 6, 23, .25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-hero:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 24px rgba(2, 6, 23, .32); }
.btn-hero:active { transform: translateY(0) scale(1); }

/* ---------- ৩. Menubar premium ---------- */
/* sidebar: gradient active + hover slide glow + divider */
.menu a.on {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(13, 148, 136, .35);
}
.menu a:hover {
  background: var(--sidebar-2); color: #fff; transform: translateX(4px);
  box-shadow: inset 3px 0 0 var(--teal), 0 4px 14px rgba(13, 148, 136, .18);
}
.menu a.on:hover { transform: none; box-shadow: 0 6px 16px rgba(13, 148, 136, .35); }
.menu-div {
  height: 1px; margin: 10px 24px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .35), transparent);
}
/* bottom nav: floating pill */
@media (max-width: 768px) {
  .bottom-nav {
    left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 26px; padding: 8px; gap: 2px;
    box-shadow: 0 14px 34px rgba(2, 6, 23, .20);
  }
  .bottom-nav a, .bottom-nav button {
    border-radius: 18px;
    transition: background .22s ease, color .22s ease, box-shadow .22s ease, transform .22s ease;
  }
  .bottom-nav a.on {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    box-shadow: 0 6px 14px rgba(13, 148, 136, .42);
  }
  .bottom-nav a.on svg { stroke: #fff; animation: tkPop .35s ease; }
  .main .content { padding-bottom: 104px; }
  @keyframes tkPop {
    0% { transform: scale(.6); }
    60% { transform: scale(1.18); }
    100% { transform: scale(1); }
  }
  /* modal compact on small phones */
  .modal-head { padding: 13px 16px 10px; }
  .modal-body { padding: 12px 16px 6px; }
  .modal-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot { border-radius: 0; }
  .dash-hero { padding: 16px 18px; border-radius: 18px; }
  .dash-hero-title { font-size: 18px; }
  .btn-hero { padding: 11px 16px; font-size: 14px; }
}

/* reduced motion: new animations off */
@media (prefers-reduced-motion: reduce) {
  .btn-shine::after { display: none; }
  .stat, .dash-hero { animation: none; }
  .bottom-nav a.on svg { animation: none; }
  .stat:hover, .btn-hero:hover { transform: none; }
}

/* ================= Filter panel ================= */
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--text);
  cursor: pointer; transition: all .18s ease; font-family: inherit; min-height: 40px;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal-dark); box-shadow: 0 4px 12px rgba(13, 148, 136, .15); }
.filter-btn.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); }
.filter-badge {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.filter-panel { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .32s ease, opacity .25s ease, margin .3s ease; }
.filter-panel.open { max-height: 700px; opacity: 1; margin-bottom: 16px; }
.filter-panel-inner {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: 0 10px 28px rgba(2, 6, 23, .08);
}
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--teal-soft); color: var(--teal-dark);
  border-radius: 20px; padding: 6px 8px 6px 12px; font-size: 13px; font-weight: 600;
  transition: box-shadow .15s ease;
}
.chip:hover { box-shadow: 0 3px 10px rgba(13, 148, 136, .25); }
.chip-x {
  background: rgba(13, 148, 136, .15); border-radius: 50%; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .filter-panel, .filter-btn, .chip { transition: none; }
}
