/* Google Fonts non-blocking — loaded in HTML head */

/* ================================
   ROOT VARIABLES
================================ */
:root {
  --color-primary:         #2E7D32;
  --color-primary-light:   #43A047;
  --color-primary-dark:    #1B5E20;
  --color-primary-pale:    #F1F8E9;
  --color-primary-border:  rgba(139, 195, 74, 0.28);

  --color-sidebar-bg:      rgba(10, 28, 10, 0.98);
  --color-sidebar-hover:   rgba(46, 125, 50, 0.40);
  --color-sidebar-active:  rgba(46, 125, 50, 0.70);

  --glass-bg:              rgba(255, 255, 255, 0.06);
  --glass-bg-strong:       rgba(255, 255, 255, 0.11);
  --glass-border:          rgba(255, 255, 255, 0.12);

  --color-text-light:      #FFFFFF;
  --color-text-muted:      rgba(255, 255, 255, 0.50);

  --color-success:         #4CAF50;
  --color-warning:         #FF9800;
  --color-danger:          #F44336;

  /* New accent colors for unique feel */
  --accent-gold:           #C8A84B;
  --accent-gold-dim:       rgba(200, 168, 75, 0.18);
  --accent-green-bright:   #A5D6A7;

  --sidebar-width:         248px;
  --radius-lg:             16px;
  --radius-md:             10px;
  --radius-sm:             7px;
}


/* ================================
   LANGUAGE SWITCH (top-right corner)
   shared across login.html + index.html
================================ */
.lang-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 76px;
  height: 32px;
  border-radius: 999px;
  background: rgba(4, 50, 27, .45);
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 3px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4);
}

.lang-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 36px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #02692E, #7DBD1B);
  transition: transform .25s cubic-bezier(.22, .61, .36, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.lang-switch.lang-en .lang-switch__thumb {
  transform: translateX(36px);
}

.lang-switch__opt {
  position: relative;
  z-index: 1;
  width: 36px;
  text-align: center;
  font: 700 11px 'IBM Plex Mono', monospace;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .55);
  pointer-events: none;
  transition: color .25s cubic-bezier(.22, .61, .36, 1);
}

.lang-switch:not(.lang-en) .lang-switch__opt--bn,
.lang-switch.lang-en .lang-switch__opt--en {
  color: #fff;
}

@media (max-width: 480px) {
  .lang-switch { top: 12px; right: 12px; }
}

/* ================================
   LANGUAGE MENU (index.html) — icon button that opens a dropdown
================================ */
.lang-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-menu__trigger {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(4, 50, 27, .6);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4);
  transition: border-color .2s ease;
}

.lang-menu__trigger svg {
  width: 17px;
  height: 17px;
  stroke: #A5D6A7;
  transition: stroke .2s ease, transform .3s cubic-bezier(.22, .61, .36, 1);
}

.lang-menu.open .lang-menu__trigger {
  border-color: rgba(200, 168, 75, .6);
}

.lang-menu.open .lang-menu__trigger svg {
  stroke: #C8A84B;
  transform: rotate(20deg);
}

.lang-menu__panel {
  position: absolute;
  top: 42px;
  right: 0;
  min-width: 132px;
  background: rgba(6, 34, 15, .96);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 10px;
  padding: 5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  transform: scale(.92) translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s cubic-bezier(.22, .61, .36, 1), opacity .16s ease;
}

.lang-menu.open .lang-menu__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.lang-menu__item {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .7);
  font: 600 12.5px 'IBM Plex Mono', monospace;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.lang-menu__item:hover {
  background: rgba(255, 255, 255, .06);
}

.lang-menu__item.active {
  background: rgba(46, 125, 50, .55);
  color: #fff;
}

@media (max-width: 480px) {
  .lang-menu { top: 12px; right: 12px; }
}

/* ================================
   RESET & BODY
================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  /* Firefox scrollbar — thin, green thumb, transparent track */
  scrollbar-width: thin;
  scrollbar-color: #2E7D32 transparent;
}

/* ================================
   SCROLLBAR (Chrome/Edge/Safari) — পাতলা, প্রায় ghost, সবুজ gradient thumb
================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: #2E7D32 transparent;
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a7c4a, #2E7D32);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #4a7c4a;
}


body {
  font-family: 'Segoe UI', 'Hind Siliguri', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  height: 100vh;
  height: 100dvh; /* FIX: পুরনো/বাজেট Android (Oppo A12s ইত্যাদি) এ address bar
     show/hide হওয়ার সময় স্থির 100vh এর সাথে actual visible viewport মিলত না —
     ফলে scroll করলে body-র নিচের অংশ কাটা পড়ত বা layout jump করত।
     dvh সাপোর্ট না থাকলে উপরের 100vh fallback হিসেবে থেকে যাবে। */
  display: flex;
  background-color: #111d11;
  overflow: hidden;
  overscroll-behavior: none; /* FIX: body নিজে scroll করে না, .main-wrap করে —
     এটা না থাকলে জোর করে scroll/overscroll করলে browser-এর নিজস্ব bounce/
     pull-to-refresh gesture নেস্টেড scroll area-র সাথে conflict করে পুরো
     layout ভেঙে ফেলত পুরনো Android WebView-তে। */
  width: 100%;
}


/* ================================
   BACKGROUND
================================ */
.bg-image {
  position: fixed;
  inset: 0;
 background-image: url('../Assets/Images/dashboard-background.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg,
    rgba(6, 20, 6, 0.82) 0%,
    rgba(14, 44, 14, 0.62) 50%,
    rgba(8, 28, 8, 0.78) 100%);
  z-index: 1;
  pointer-events: none;
}


/* ================================
   SIDEBAR
================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(165, 214, 167, 0.10);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.sidebar-top-bar {
  height: 3px;
  background: linear-gradient(90deg, #1B5E20, #43A047 55%, #A5D6A7 100%);
  flex-shrink: 0;
}

.sidebar-brand {
  flex-shrink: 0;
}

.sidebar-brand-hero {
  height: 88px;
  background: radial-gradient(circle at 30% 30%, #2E7D32, #0d260d 75%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}

.sidebar-brand-caption {
  padding: 9px 18px;
  border-bottom: 1px solid rgba(165, 214, 167, 0.10);
  font-size: 12.5px;
  font-weight: 500;
  color: #F1F8E9;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(165, 214, 167, 0.35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.nav-item:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-text-light);
}

.nav-item.active {
  background: var(--color-sidebar-active);
  color: var(--color-text-light);
  font-weight: 600;
  box-shadow: inset 3px 0 0 #A5D6A7;
}

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(165, 214, 167, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
}

.sidebar-footer span,
.sidebar-footer div { font-size: 10px; color: rgba(165,214,167,0.35); }

.logout-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}

.logout-btn:hover { background: rgba(255,255,255,0.14); color: white; }


/* ================================
   MAIN WRAP
================================ */
.main-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* FIX: body-র মতো একই কারণে — mobile address bar এর সাথে
     মিলিয়ে actual scrollable height ঠিক রাখে */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* FIX: এই div-এর ভিতরে scroll শেষ হয়ে গেলে
     সেটা bubble করে body/window-এ চলে যাওয়া বন্ধ করে — জোর করে scroll করলে
     যে "sidebar/header জায়গা থেকে সরে যাওয়া বা content ভেঙে যাওয়া" হচ্ছিল
     এটা মূলত এই bubbling আর body-র overflow:hidden-এর মধ্যে conflict থেকে হত */
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}


/* ================================
   HOME PAGE — DASHBOARD
================================ */
.home-page {
  flex: 1;
  flex-shrink: 0; /* FIX: mobile এ এটা না থাকলে .main-wrap এর ফিক্সড 100vh height এর সাথে
     flexbox জোর করে .home-page কে screen এ "fit" করানোর চেষ্টা করত — ফলে KPI
     card/chart এর জন্য দরকারি জায়গা না দিয়ে সব চেপে/সংকুচিত করে ফেলত (dashboard
     প্রায় দেখাই যেত না)। এখন content যত লম্বা হবে page ততটাই বড় হবে, আর
     .main-wrap (overflow-y:auto) সেটা normally scroll করবে। */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 32px 36px 48px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  overflow-x: hidden;
}

.home-page::after {
  content: '';
  position: fixed; /* FIX: আগে position:absolute ছিল, যেটা .home-page এর নিজের
     (dynamic, content-নির্ভর) height অনুযায়ী stretch করতো। Low-stock/Recent
     Invoices/Top-selling list expand করলে .home-page অনেক লম্বা হয়ে যায়, আর
     percentage-based gradient stop (0%/50%/100%) সেই নতুন height জুড়ে ছড়িয়ে
     যেত — ফলে নিচের অংশে dark tint পাতলা হয়ে পেছনের background image বেশি
     উন্মুক্ত হয়ে যেত (box shadow "ভেঙে যাওয়া" এর কারণ এটাই)। position:fixed
     করে দেওয়ায় এই overlay এখন সবসময় ঠিক viewport এর সাথে মিলে থাকবে —
     content যত লম্বাই হোক, gradient এর appearance অপরিবর্তিত থাকবে। */
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg,
    rgba(6, 20, 6, 0.72) 0%,
    rgba(14, 46, 14, 0.52) 50%,
    rgba(8, 28, 8, 0.68) 100%);
}

.home-page > * {
  position: relative;
  z-index: 1;
}

/* --- DASH HERO (header + KPIs + chart) --- */
.dash-hero {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* --- DASH HEADER --- */
.dash-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 14px;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  padding-right: 50px; /* fixed lang-menu icon (top-right)-এর জন্য reserved space, যাতে Reset Dashboard বাটন এর নিচে/পাশে চাপা না পড়ে */
  border-bottom: 1px solid rgba(165, 214, 167, 0.10);
}

/* Reset button lives inside the header now, pinned to the right */
.dash-header .dash-reset-btn {
  margin-left: auto;
}

.dash-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(46, 125, 50, 0.40);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.dash-company-name {
  font-family: 'Cormorant Garamond', 'Segoe UI', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--color-text-light);
}

.dash-system-label {
  font-size: 10px;
  color: rgba(165, 214, 167, 0.60);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-top: 3px;
}

/* --- KPI CARDS --- */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.dash-kpi-card {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(165, 214, 167, 0.14);
  border-top: 1.5px solid rgba(165, 214, 167, 0.28);
  border-radius: 14px;
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
  backdrop-filter: blur(10px);
}

/* Shine line on each card */
.dash-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165,214,167,0.55), transparent);
}

.dash-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  border-color: rgba(165, 214, 167, 0.28);
}

/* Special card: warning (Low stock) */
.dash-kpi-card:nth-child(4) {
  border-top-color: rgba(255, 152, 0, 0.45);
}
.dash-kpi-card:nth-child(4)::before {
  background: linear-gradient(90deg, transparent, rgba(255, 165, 0, 0.50), transparent);
}

/* Special card: Due */
.dash-kpi-card:nth-child(5) {
  border-top-color: rgba(239, 154, 154, 0.45);
}
.dash-kpi-card:nth-child(5)::before {
  background: linear-gradient(90deg, transparent, rgba(239, 154, 154, 0.50), transparent);
}

.dash-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(165, 214, 167, 0.60);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-light);
  line-height: 1;
  letter-spacing: -0.02em;
}

.dash-kpi-warning { color: #FFB74D; }
.dash-kpi-due     { color: #EF9A9A; }

/* --- RESET BUTTON (now lives in the header) --- */
.dash-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  background: transparent;
  color: rgba(239, 154, 154, 0.70);
  border: 1px solid rgba(239, 154, 154, 0.22);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.dash-reset-btn:hover {
  background: rgba(239,154,154,0.10);
  color: #EF9A9A;
  border-color: rgba(239,154,154,0.45);
}

/* --- SECTION TITLE --- */
.dash-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(165, 214, 167, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 11px;
  background: linear-gradient(180deg, #A5D6A7, rgba(165,214,167,0.20));
  border-radius: 2px;
  flex-shrink: 0;
}

/* --- COLLAPSIBLE SECTIONS (Low-stock alert / সাম্প্রতিক Invoice / Top-selling) ---
   Native <details>/<summary> ব্যবহার করা হয়েছে — browser এর নিজের default
   disclosure triangle (▶/▼), কোনো JS লাগে না। <details> এ 'open' attribute
   না থাকায় page load/refresh এ সবসময় collapsed (hidden) অবস্থা থেকে শুরু হয়। */
.dash-collapsible-title {
  cursor: pointer;
  display: list-item; /* .dash-section-title এর display:flex এইখানে override করে দিলাম,
     কারণ flex/grid দিলে Chrome এর native disclosure triangle (marker) হারিয়ে
     যায় — marker শুধু list-item box এই render হয়। */
}

.dash-collapsible-title::before {
  margin-right: 8px;
  vertical-align: middle;
}

.dash-collapsible-title::marker {
  color: rgba(165, 214, 167, 0.55);
}

/* --- CHART --- */
.dash-chart-wrap {
  position: relative;
  width: 100%;
  height: 230px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 18px 20px 14px;
  box-sizing: border-box;
  margin-bottom: 30px;
  box-shadow: inset 0 1px 0 rgba(165,214,167,0.08);
  overflow: hidden;
}

/* --- BOTTOM 3-COL LISTS --- */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.dash-list {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.dash-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.12s;
  gap: 10px;
}

.dash-list-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.dash-list-row > span:last-child {
  flex-shrink: 0;
  font-weight: 600;
  color: #A5D6A7;
  font-size: 12px;
}

.dash-list-row:hover { background: rgba(255,255,255,0.04); }
.dash-list-row:last-child { border-bottom: none; }

.dash-list-empty {
  padding: 28px 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
}

/* Landing home page elements (existing, unchanged) */
.home-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
  animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px); }
  50%        { transform: translateY(-8px); }
}

.home-company-name {
  font-size: 26px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.home-company-name span { color: #A5D6A7; }

.home-system-label {
  font-size: 12px;
  color: rgba(165,214,167,0.75);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.home-divider-line { width: 70px; height: 1px; background: linear-gradient(90deg, transparent, rgba(165,214,167,0.55)); }
.home-divider-line.right { background: linear-gradient(90deg, rgba(165,214,167,0.55), transparent); }
.home-divider-dot { width: 5px; height: 5px; border-radius: 50%; background: #A5D6A7; }
.home-divider-diamond { width: 7px; height: 7px; background: #8BC34A; transform: rotate(45deg); }

.home-info-row {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-info-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
}

.home-info-card svg { color: #A5D6A7; flex-shrink: 0; }

.home-enter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 44px;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(46,125,50,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}

.home-enter-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(46,125,50,0.55); }
.home-enter-btn:active { transform: translateY(0); }

.home-credit {
  position: fixed;
  bottom: 14px;
  right: 20px;
  font-size: 10px;
  color: rgba(165,214,167,0.30);
  z-index: 3;
}


/* ================================
   INNER PAGES
================================ */
.inner-page {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  flex-shrink: 0; /* FIX: .home-page তে যে bug আগে ধরা পড়েছিল ঠিক সেটাই এখানেও ছিল।
     .main-wrap এর height:100vh fixed, আর flex item এর default flex-shrink হলো 1 —
     তাই min-height:100vh দেওয়া সত্ত্বেও, content সেটার চেয়ে লম্বা হলে flexbox এই
     page টাকে জোর করে ঠিক 100vh এ চেপে ধরত। তখন page-এর নিজের inline
     overflow-y:auto একটা আলাদা নেস্টেড scroll area বানিয়ে ফেলত যেটা mobile এ
     ঠিকমতো scroll হয় না — ফলে Reports (chart + list) এর মতো লম্বা page এর উপরের
     অংশ (header/filter/KPI) দেখা যেত কিন্তু নিচের অংশ কাটা/হারানো মনে হতো।
     flex-shrink:0 দেওয়ায় page এখন content যতটুকু লম্বা দরকার ততটাই হবে, এবং
     scrolling শুধু .main-wrap-ই handle করবে (.home-page এর মতোই একমাত্র scroll
     owner)। */
}

.inner-page.visible { display: flex; }

/* NO-ACCESS SCREEN — role-এর জন্য dashboard এবং কোনো menu section-ই visible
   না থাকলে এখানে দেখানো হয়, যাতে toast মিলিয়ে যাওয়ার পরও পেজ ভাঙা মনে না হয় */
#page-no-access {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(8, 24, 8, 0.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(165, 214, 167, 0.10);
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 0.01em;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.70);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.back-btn:hover { background: rgba(255,255,255,0.14); color: white; }

.page-content {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
}


/* ================================
   GLASS PANEL
================================ */
.glass-panel {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

.glass-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(46, 125, 50, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.glass-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.search-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 300px;
  margin: 0 16px;
}

.search-bar-wrap svg {
  position: absolute;
  left: 11px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: rgba(255,255,255,0.28); }

.search-input:focus {
  border-color: rgba(165, 214, 167, 0.45);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(165, 214, 167, 0.10);
}

@media (max-width: 768px) {
  .search-bar-wrap { max-width: none; margin: 10px 0 0; flex-basis: 100%; order: 3; }
}

.glass-panel-title svg { color: #A5D6A7; }

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 3px 10px rgba(46,125,50,0.30);
}

.add-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(46,125,50,0.40);
}


/* ================================
   TABLE
================================ */
.glass-table { width: 100%; border-collapse: collapse; }

.glass-table thead tr {
  background: rgba(46, 125, 50, 0.16);
}

.glass-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: rgba(165, 214, 167, 0.80);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

.glass-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.84);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.glass-table tbody tr { transition: background 0.12s; }
.glass-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.glass-table tbody tr:last-child td { border-bottom: none; }

/* Sortable column headers */
.glass-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}
.glass-table th.sortable:hover {
  color: rgba(165, 214, 167, 1);
}
.glass-table th.sortable .sort-arrow {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
  width: 9px;
  height: 9px;
  opacity: 0;
  color: var(--accent-gold);
}
.glass-table th.sortable .sort-arrow.active {
  opacity: 1;
}
.glass-table th.sortable:hover .sort-arrow:not(.active) {
  opacity: 0.35;
}

/* Table pagination bar (Products / Customers / Suppliers lists) */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.pagination-info {
  color: rgba(255,255,255,0.45);
}
.pagination-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-current {
  color: rgba(255,255,255,0.75);
  font-weight: 600;
  min-width: 52px;
  text-align: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.page-btn:hover:not(:disabled) {
  background: rgba(46, 125, 50, 0.35);
  border-color: rgba(165, 214, 167, 0.4);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.mob-card-list + .table-pagination {
  border-top: none;
  margin-top: 4px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.stock-good  { background: rgba(76,175,80,0.18);  color: #A5D6A7; border: 1px solid rgba(76,175,80,0.28); }
.stock-low   { background: rgba(255,152,0,0.18);  color: #FFCC80; border: 1px solid rgba(255,152,0,0.28); }
.stock-empty { background: rgba(244,67,54,0.18);  color: #EF9A9A; border: 1px solid rgba(244,67,54,0.28); }

.action-btns { display: flex; gap: 6px; }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  font-family: inherit;
}

.icon-btn:hover { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.25); }
.icon-btn.delete:hover { background: rgba(244,67,54,0.28); border-color: rgba(244,67,54,0.40); color: #EF9A9A; }

.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: rgba(255,255,255,0.32);
  font-size: 13px;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  color: rgba(165,214,167,0.40);
  margin-bottom: 14px;
}

.empty-state-icon.success { color: rgba(102,187,106,0.7); background: rgba(102,187,106,0.10); }
.empty-state-msg { font-size: 13.5px; color: rgba(255,255,255,0.45); }


/* ================================
   MODAL
================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 2, 0.80);
  backdrop-filter: blur(10px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto; /* FIX: এই overlay এর নিজের overflow না থাকায়, backdrop
     এর (modal box এর বাইরের padding অংশ) উপর touch scroll শুরু করলে browser
     এটাকে scrollable মনে না করে পিছনের .main-wrap এ scroll পাঠিয়ে দিত —
     এজন্যই popup খোলার পর প্রথম মুহূর্তে পিছনের dashboard এক মুহূর্তের
     জন্য scroll হয়ে যেত, তারপর popup এর নিজের content scroll শুরু হতো।
     এখন overlay নিজেই scrollable, তাই gesture শুরু যেখান থেকেই হোক এটাই
     ধরে ফেলে, পিছনে bubble করে না। */
  overscroll-behavior: contain; /* overlay এর scroll শেষ হয়ে গেলেও যেন
     bounce করে পিছনের page এ চলে না যায় */
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.visible { display: flex; }

@media (prefers-reduced-motion: no-preference) {
  .modal-overlay.visible .modal {
    animation: modal-pop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal {
  background: linear-gradient(160deg, rgba(18, 46, 18, 0.97) 0%, rgba(10, 28, 10, 0.98) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(165, 214, 167, 0.16);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.50), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

/* Wider variant (used by the "Invoice Generated / stock updated" popup —
   it has a small table inside so needs more room than the default 460px).
   NOTE: this used to be an inline style="max-width:520px" on the element,
   which always beats the mobile ".modal { max-width:100% }" rule below no
   matter what (inline styles outrank any class selector) — that's why the
   popup was overflowing/cut off on mobile screens. Using a class here lets
   the mobile rule win properly at small widths. */
.modal-wide {
  max-width: 520px;
}

/* Stock-update popup's title reuses the plain UI font instead of the
   decorative serif font used for the big invoice/company headings. */
#stockPopup .modal-title {
  font-family: 'Segoe UI', 'Hind Siliguri', system-ui, -apple-system, sans-serif;
}

/* This popup's table isn't inside a .glass-panel (which is what normally
   gives tables horizontal scroll room on mobile via overflow-x:auto) — it
   sits directly in the modal, which clips overflow. The mobile rule that
   forces .glass-table to a 520px min-width (meant for the bigger
   Products/Customers list tables) was cutting off the last 2 columns here.
   This table only has 4 short columns, so it doesn't need that min-width —
   letting it size naturally keeps all columns visible on small screens. */
#stockPopup .glass-table {
  min-width: 0;
}

/* With 5+ products the popup used to just grow taller than the screen —
   since .modal-overlay centers it with no scrolling of its own, everything
   past a certain height was pushed off-screen with no way to reach it.
   Capping the modal's height and scrolling only the product list (not the
   title or the "ঠিক আছে" button) fixes that while keeping those always
   visible. A wrapper div handles the actual scrolling since a <table>
   doesn't respect flex/overflow directly. */
#stockPopup .modal {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

#stockPopup .modal-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#stockPopup .modal-title,
#stockPopup .modal-inner > p,
#stockPopup .modal-actions {
  flex-shrink: 0;
}

#stockPopupListWrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}

.modal-top-bar {
  height: 3px;
  background: linear-gradient(90deg, #1B5E20, #43A047 55%, #A5D6A7 100%);
}

.modal-inner { padding: 28px 26px; }

.modal-title {
  font-family: 'Cormorant Garamond', 'Segoe UI', serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-field { margin-bottom: 14px; }

.modal-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: rgba(165, 214, 167, 0.70);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  padding: 10px 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: rgba(255,255,255,0.92);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.modal-input::placeholder { color: rgba(255,255,255,0.25); }
.modal-input:focus {
  border-color: rgba(165, 214, 167, 0.50);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(165, 214, 167, 0.10);
}

.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }

.modal-save-btn {
  flex: 1;
  padding: 11px;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.modal-save-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46,125,50,0.38);
}
.modal-save-btn:active { transform: translateY(0); }

.modal-cancel-btn {
  padding: 11px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.60);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.modal-cancel-btn:hover { background: rgba(255,255,255,0.11); color: white; }

.modal-error {
  display: none;
  font-size: 12px;
  color: #EF9A9A;
  margin-top: 8px;
  text-align: center;
}

.modal-error.visible { display: block; }


/* ================================
   TOAST
================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(160deg, rgba(20, 50, 20, 0.97) 0%, rgba(12, 32, 12, 0.98) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.09);
  border-left: 3px solid var(--color-primary-light);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(30px);
  animation: toast-in 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
}

.toast.toast-leaving {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in  { to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

.toast.toast-error { border-left-color: #EF9A9A; }
.toast.toast-info  { border-left-color: #A5D6A7; }

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast.toast-success .toast-icon { color: var(--color-primary-light); }
.toast.toast-error  .toast-icon  { color: #EF9A9A; }
.toast.toast-info   .toast-icon  { color: #A5D6A7; }

.toast-text  { flex: 1; line-height: 1.45; white-space: pre-line; }
.toast-close {

/* ===== GRADIENT ICON BADGES (green→light-green bg, white icon) ===== */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(27, 94, 32, 0.35);
}
.icon-badge svg { display: block; }
.icon-badge.round { border-radius: 50%; }
.icon-badge.badge-xxs { width: 18px; height: 18px; border-radius: 6px; }
.icon-badge.badge-xs  { width: 22px; height: 22px; border-radius: 6px; }
.icon-badge.badge-sm  { width: 28px; height: 28px; }
.icon-badge.badge-md  { width: 34px; height: 34px; }
.icon-badge.badge-lg  { width: 48px; height: 48px; }
.icon-badge.badge-danger {
  background: linear-gradient(135deg, #B71C1C, var(--color-danger));
  box-shadow: 0 2px 6px rgba(183, 28, 28, 0.35);
}
.icon-badge.badge-flat {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
  box-shadow: none;
}

  all: unset;
  cursor: pointer;
  color: rgba(255,255,255,0.32);
  flex-shrink: 0;
  padding: 2px;
  display: inline-flex;
  align-items: center;
}
.toast-close:hover { color: rgba(255,255,255,0.65); }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; opacity: 1; transform: none; }
}


/* ================================
   CONFIRM MODAL
================================ */
.confirm-modal-message {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  white-space: pre-line;
  margin-bottom: 4px;
}

.modal-save-btn.danger {
  background: linear-gradient(135deg, #b33a3a, #8f2c2c);
}
.modal-save-btn.danger:hover {
  box-shadow: 0 6px 16px rgba(179,58,58,0.35);
}


/* ================================
   SKELETON LOADER
================================ */
.skeleton-wrap {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.skeleton-block {
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block { animation: none; background: rgba(255,255,255,0.07); }
}

@media (max-width: 480px) {
  .toast-container {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
  }
}


/* ================================
   INVOICE FORM
================================ */
.invoice-form { display: flex; flex-direction: column; gap: 16px; }

.form-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-section {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(165,214,167,0.80);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.form-section-title-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-field { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(165,214,167,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  padding: 9px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: rgba(255,255,255,0.90);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.form-input::placeholder { color: rgba(255,255,255,0.20); }
.form-input:focus { border-color: rgba(165,214,167,0.45); background: rgba(255,255,255,0.11); }
.form-input.readonly { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.48); cursor: default; }

select.form-input option { background: #1a4a1a; color: white; }

/* Customer search */
.search-wrap { position: relative; }

.customer-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: rgba(12, 36, 12, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(165,214,167,0.22);
  border-radius: var(--radius-sm);
  z-index: 50;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.40);
  max-height: 200px;
  overflow-y: auto;
}

.customer-dropdown-item {
  padding: 9px 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.12s;
}

.customer-dropdown-item:last-child { border-bottom: none; }
.customer-dropdown-item:hover { background: rgba(46,125,50,0.30); }
.dropdown-code { font-size: 10px; font-weight: 700; color: #A5D6A7; margin-bottom: 1px; }
.dropdown-name { font-size: 12px; color: rgba(255,255,255,0.78); }

/* Invoice product table */
.invoice-table { width: 100%; border-collapse: collapse; }

.invoice-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: rgba(165,214,167,0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: rgba(46,125,50,0.16);
}

.invoice-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.invoice-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.invoice-table tbody tr:last-child td { border-bottom: none; }

.table-input {
  width: 100%;
  padding: 6px 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  outline: none;
  transition: border-color 0.2s;
}

.table-input:focus { border-color: rgba(165,214,167,0.40); background: rgba(255,255,255,0.11); }
.table-input.readonly { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.48); cursor: default; }

.table-select {
  width: 100%;
  padding: 6px 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  outline: none;
  cursor: pointer;
}

.table-select option { background: #1a4a1a; color: white; }
.table-select:focus { border-color: rgba(165,214,167,0.40); }

.net-price-cell { font-size: 13px; font-weight: 600; color: #A5D6A7; text-align: right; padding-right: 4px; }

.stock-warning-text { font-size: 10px; color: #FFCC80; margin-top: 2px; }
.stock-empty-text   { font-size: 10px; color: #EF9A9A; margin-top: 2px; }

.remove-row-btn {
  width: 24px; height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(244,67,54,0.25);
  background: rgba(244,67,54,0.10);
  color: rgba(239,154,154,0.70);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  font-family: inherit;
  margin: 0 auto;
}

.remove-row-btn:hover { background: rgba(244,67,54,0.28); color: #EF9A9A; }

.add-row-btn {
  padding: 5px 12px;
  background: rgba(46,125,50,0.24);
  border: 1px solid rgba(165,214,167,0.30);
  border-radius: var(--radius-sm);
  color: #A5D6A7;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
}

.add-row-btn:hover { background: rgba(46,125,50,0.42); }

.unit-toggle-group { display: flex; gap: 4px; margin-bottom: 4px; }

.unit-toggle-btn {
  flex: 1;
  padding: 4px 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  color: rgba(255,255,255,0.60);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}

.unit-toggle-btn.active { background: rgba(46,125,50,0.35); border-color: rgba(165,214,167,0.40); color: #A5D6A7; }

/* Footer calc */
.form-footer {
  display: flex;
  justify-content: flex-end;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
}

.form-footer-calc { display: flex; flex-direction: column; gap: 9px; min-width: 300px; }

.calc-row { display: flex; align-items: center; gap: 10px; }

.calc-label { font-size: 12px; color: rgba(255,255,255,0.58); min-width: 100px; }

.calc-input {
  width: 65px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  outline: none;
  text-align: center;
}

.calc-input:focus { border-color: rgba(165,214,167,0.40); }

.calc-input-wide { width: 110px; text-align: right; }

.calc-value { margin-left: auto; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.80); min-width: 90px; text-align: right; }

.total-row  { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 10px; margin-top: 2px; }
.total-value { font-size: 17px; font-weight: 700; color: #A5D6A7; }

/* Generate Button */
.generate-btn-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.generate-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #1B5E20, #43A047);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(46,125,50,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.02em;
}

.generate-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(46,125,50,0.55); }
.generate-btn:active { transform: translateY(0); }

/* ================================
   HIDDEN UTILITY
================================ */
.hidden { display: none; }

/* ================================
   INVOICE PRINT LAYOUT
================================ */
.invoice-print-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  padding: 60px 24px 90px;
  overflow-y: auto;
  overflow-x: hidden;
}

.invoice-print-overlay.visible {
  display: block;
  text-align: center;
}

/* ================================================
   PDF GENERATING OVERLAY
   PDF capture/resize চলাকালীন পুরো স্ক্রিন ঢেকে রাখে,
   যাতে ব্যাকগ্রাউন্ডে (mobile-এ) desktop-সাইজে resize হওয়ার
   flash/jitter কখনো দেখা না যায়।
   ================================================ */
.pdf-generating-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0F2818 0%, #17402A 60%, #0F2818 100%);
}

.pdf-generating-overlay.visible {
  display: flex;
}

.pdf-generating-card {
  text-align: center;
  padding: 40px;
}

.pdf-generating-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 4px solid rgba(165,214,167,0.20);
  border-top-color: #66BB6A;
  animation: pdf-gen-spin 0.8s linear infinite;
}

@keyframes pdf-gen-spin {
  to { transform: rotate(360deg); }
}

.pdf-generating-title {
  font-family: 'Cormorant Garamond', 'Segoe UI', serif;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.pdf-generating-sub {
  font-size: 12.5px;
  color: rgba(165,214,167,0.65);
  letter-spacing: 0.02em;
}

/* ================================================
   AUTH CHECK OVERLAY
   পেজ লোড হওয়ার সাথে সাথেই সবকিছু ঢেকে রাখে, যতক্ষণ না Firebase
   Auth নিশ্চিত করে user login করা আছে — dashboard flash আটকাতে।
   ================================================ */
/* FIX: overlay দেখানো অবস্থায় html/body এর scroll পুরোপুরি বন্ধ — এটাই
   scroll করলে overlay "উঠে যাওয়া"/পিছনের content দেখা যাওয়ার bug fix করে। */
html.auth-locking,
html.auth-locking body {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none;
}

.auth-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(160deg, #0F2818 0%, #163823 55%, #0F2818 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
  overscroll-behavior: none;
}

.auth-check-overlay.auth-hidden {
  opacity: 0;
  pointer-events: none;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.auth-check-logo-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.auth-check-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Logo আলতো করে ভাসতে থাকে — smooth, single-wave motion, কোনো glow/lighting নেই */
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}

/* Logo যত উপরে ওঠে, নিচের ছায়া তত ছোট/হালকা হয় — floating-এর depth illusion তৈরি করে, premium/elegant ফিল দেয় */
@keyframes logo-shadow {
  0%, 100% { transform: scaleX(1); opacity: 0.32; }
  50%      { transform: scaleX(0.55); opacity: 0.12; }
}

.auth-check-logo {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.35));
  animation: logo-float 3.5s cubic-bezier(0.45,0,0.55,1) infinite;
}

.auth-check-logo-wrap::after {
  content: '';
  width: 64px;
  height: 12px;
  margin-top: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  filter: blur(6px);
  animation: logo-shadow 3.5s cubic-bezier(0.45,0,0.55,1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .auth-check-logo { animation-duration: 6s; }
  .auth-check-logo-wrap::after { animation-duration: 6s; }
}

@media (max-width: 480px) {
  .auth-check-logo { width: 108px; height: 108px; }
}


.invoice-print-wrap {
  background: #ffffff;
  width: 210mm;
  max-width: 100%;
  height: 297mm;
  min-height: 297mm;
  padding: 10mm 12mm;
  border: 1px solid #ccc;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  position: relative;
  color: #000;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 11.5px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

/* ================================================
   PDF CAPTURE MODE
   যখন html2canvas দিয়ে PDF বানানো হয়, তখন এই class সাময়িকভাবে
   .invoice-print-wrap এ বসানো হয় (JS থেকে) — এটা mobile-এর সব
   responsive override কে জোর করে desktop/A4 layout এ ফিরিয়ে দেয়,
   viewport যাই হোক না কেন। Capture শেষে class সরিয়ে দিলে আবার
   normal mobile-friendly preview ফিরে আসে।
   ================================================ */
.pdf-capture-mode.invoice-print-wrap {
  width: 210mm !important;
  max-width: none !important;
  height: 297mm !important;
  min-height: 297mm !important;
  padding: 10mm 12mm !important;
  font-size: 11.5px !important;
}

.pdf-capture-mode .inv-company-name { font-size: 32px !important; }

.pdf-capture-mode .inv-logo {
  width: 100px !important;
  height: 100px !important;
}

.pdf-capture-mode .inv-title {
  font-size: 18px !important;
  padding: 5px 18px !important;
}

.pdf-capture-mode .inv-header {
  flex-direction: row !important;
  gap: 0 !important;
  align-items: flex-start !important;
}

.pdf-capture-mode .inv-header-right {
  text-align: right !important;
}

.pdf-capture-mode .inv-cash-label {
  margin-bottom: 18mm !important;
}

.pdf-capture-mode .inv-info-grid {
  grid-template-columns: 1fr 1fr !important;
}

.pdf-capture-mode .inv-info-grid > .inv-info-box:first-child .inv-info-row {
  border-right: 1px solid #000 !important;
}

.pdf-capture-mode .inv-signature {
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 4mm !important;
}

.pdf-capture-mode .inv-calc {
  justify-content: flex-end !important;
}

.pdf-capture-mode .inv-calc-table {
  width: 170px !important;
}

.pdf-capture-mode .inv-outstanding {
  justify-content: flex-end !important;
}

.pdf-capture-mode .inv-outstanding-table {
  width: 170px !important;
  margin-top: 0 !important;
}


.invoice-print-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  background-image: url('../Assets/Images/watermark.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
 .invoice-print-wrap > * {
  position: relative;
  z-index: 1;
}

/* Print header */
.inv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: -10mm -12mm 4mm -12mm;
  padding: 6mm 12mm 5mm 12mm;
  border-bottom: none;
  background: linear-gradient(135deg, #EAF6EC 0%, #F5FAF3 55%, #FFFFFF 100%);
  border-bottom: 2.5px solid #1B5E20;
}

.inv-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.inv-company-name {
  font-family: 'Cormorant Garamond', 'Segoe UI', serif;
  font-size: 32px;
  font-weight: 800;
  color: #1B5E20;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.inv-company-info {
  font-size: 11px;
  color: #000;
  margin-top: 3px;
  line-height: 1.32;
}

.inv-company-info .inv-info-icon {
  color: #1B5E20;
  margin-right: 4px;
  display: inline-flex;
  vertical-align: -1px;
}

.inv-header-right {
  text-align: right;
  padding-top: 2px;
}

.inv-cash-label {
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  color: #000;
  margin-bottom: 18mm;
  display: block;
}

.inv-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  border: none;
  padding: 5px 18px;
  border-radius: 3px;
  display: inline-block;
}

.inv-group {
  font-size: 10px;
  color: #888;
  margin-top: 3px;
}

/* Info grid - single bordered table, two columns, like the reference invoice */
.inv-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid #000;
  margin-bottom: 3mm;
}

.inv-info-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: none;
}

.inv-info-box-title {
  display: none;
}

.inv-info-row {
  display: flex;
  align-items: stretch;
  padding: 0;
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
  font-size: 11px;
  min-height: 22px;
}

.inv-info-grid > .inv-info-box:last-child .inv-info-row {
  border-right: none;
}

.inv-info-row:last-child {
  flex: 1;
  border-bottom: none;
}

.inv-info-label {
  color: #1B5E20;
  min-width: 92px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 4px 8px;
  border-right: 1px solid #000;
  display: flex;
  align-items: center;
  background: #F1F8E9;
}

.inv-info-value {
  color: #000;
  font-weight: 600;
  flex: 1;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

/* Product table — solid black, matching the info grid table above it.
   NOTE: this deliberately does NOT use the `border` property on <td>/<th>.
   html2canvas (used for PDF export) paints native table-cell borders through
   a different, heavier code path than div borders — no matter how thin the
   border-width value was set (tried 1px, then 0.5px), the exported PDF still
   rendered the table's internal grid lines roughly 2-3x thicker than the
   .inv-info-row div-based lines above it. Using inset box-shadow instead
   draws each internal line as a plain filled rectangle, which html2canvas
   renders exactly like a div border — so the internal grid still matches
   the info-grid table exactly in both the on-screen preview and the PDF.

   The OUTER perimeter, however, uses a real `border` on this .inv-table-wrap
   div instead of box-shadow. Two reasons: (1) box-shadow placed directly on
   a <table> element is unreliable — tables get an extra anonymous "table
   wrapper box" the shadow can attach to instead of the visible grid box, so
   right/left/bottom silently didn't paint. (2) even moved to a div,
   *inset* box-shadow specifically has patchy support in html2canvas (unlike
   the plain `border` property, which it handles natively and reliably) — so
   a genuine border here, on a plain div with nothing else sharing its edges,
   is the safe choice: it can't double up the way <td> borders did, since
   there's only ever one element drawing it. */
.inv-table-wrap {
  /* Integer 1px, not 0.5px: fractional border-widths get anti-aliased by
     Chrome into a lighter gray hairline instead of solid black, which is
     why this outer edge looked like a different shade than the internal
     grid lines (those are drawn with box-shadow, which doesn't have this
     anti-aliasing quirk). 1px keeps it crisp and matches #000 exactly. */
  border: 1px solid #000;
  box-sizing: border-box;
  margin-bottom: 3mm;
}

.inv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.inv-table th {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inv-table td {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  height: 20px;
  max-height: 20px;
  padding: 2px 5px;
  font-size: 11px;
  border: none;
  box-shadow: inset -0.5px -0.5px 0 0 #000;
  color: #000;
}

.inv-table tbody tr {
  height: 20px;
  max-height: 20px;
}

.inv-table th {
  background: #1B5E20;
  color: #fff;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  border: none;
  box-shadow: inset -0.5px -0.5px 0 0 #000;
}

.inv-table th:last-child,
.inv-table td:last-child {
  box-shadow: inset 0 -0.5px 0 0 #000;
}

.inv-table tbody tr:last-child td {
  box-shadow: inset -0.5px 0 0 0 #000;
}

.inv-table tbody tr:last-child td:last-child {
  box-shadow: none;
}

.inv-table td {
  padding: 5px 8px;
  font-size: 11px;
  background: #fff;
  color: #000;
}

.inv-table tbody tr:nth-child(even) {
  background: transparent;
}

.inv-table tfoot tr {
  background: transparent;
}

.inv-table tfoot td {
  font-weight: 700;
  border-top: 1.5px solid #000;
}

/* Calculation */
.inv-calc {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 3mm;
  margin-top: 6mm;
}

.inv-calc-table {
  width: 170px;
  border: none;
  margin-top: 14px;
}

.inv-calc-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 11px;
  border-bottom: none;
  font-weight: 700;
}

.inv-calc-row span:first-child {
  min-width: 90px;
}

.inv-calc-row:last-child {
  border-top: 1.5px solid #1B5E20;
  border-bottom: none;
  background: #F1F8E9;
  color: #1B5E20;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 4px;
  margin-top: 2px;
  border-radius: 2px;
}

/* Amount in words */
.inv-words {
  font-size: 11.5px;
  font-weight: 700;
  color: #1B5E20;
  margin-top: 8mm;
  margin-bottom: 3mm;
}

/* Outstanding (Previous Due) — Net Payable-এর মতোই compact box style, table না */
/* Outstanding (customer এর আগের বকেয়া বিবরণ) — Net Payable এর .inv-calc-table এর
   মতোই একই width/position, একই সরল label:value row style (বড় বর্ডার টেবিল না) */
.inv-outstanding {
  display: flex;
  justify-content: flex-end;
  margin-top: 6mm;
  margin-bottom: 4mm;
}

.inv-outstanding-table {
  width: 170px;
}

.inv-outstanding-title {
  font-size: 10px;
  font-weight: 800;
  color: #B71C1C;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 4px;
  margin-bottom: 1px;
}

.inv-outstanding-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
}

.inv-outstanding-more {
  font-size: 9.5px;
  font-style: italic;
  font-weight: 600;
  color: #888;
  text-align: center;
  padding: 2px 4px;
}

.inv-outstanding-row.inv-outstanding-total {
  border-top: 1.5px solid #B71C1C;
  background: #FDECEA;
  color: #B71C1C;
  font-size: 12px;
  font-weight: 800;
  padding: 4px;
  margin-top: 2px;
  border-radius: 2px;
}

/* ================================
   DUES PAGE — customer-wise accordion group
================================ */
.due-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.due-group {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.due-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.due-group-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.due-group-info {
  min-width: 0;
}

.due-group-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.due-group-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.due-group-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.due-group-amount {
  font-size: 15px;
  font-weight: 700;
  color: #EF9A9A;
}

.due-group-chevron {
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.due-group.open .due-group-chevron {
  transform: rotate(180deg);
}

.due-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.due-group.open .due-group-body {
  max-height: 2000px;
}

.due-invoice-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.due-invoice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.due-invoice-main {
  min-width: 0;
}

.due-invoice-no {
  font-size: 13px;
  font-weight: 600;
  color: #A5D6A7;
}

.due-invoice-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
}

.due-invoice-due {
  color: #EF9A9A;
  font-weight: 700;
}

.due-invoice-pay-btn {
  background: rgba(46, 125, 50, 0.75);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.due-invoice-pay-btn:hover {
  background: rgba(46, 125, 50, 0.95);
}

.due-paid-badge {
  background: rgba(165, 214, 167, 0.16);
  color: #A5D6A7;
  border: 1px solid rgba(165, 214, 167, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Per-invoice payment history sub-section — shown under each invoice in
   both the Due tab (partial payments so far) and the Payment History tab
   (full history of a fully-settled invoice). */
.due-invoice-history {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 12px;
}

.due-invoice-history-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.due-invoice-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.due-history-reset-btn {
  background: none;
  border: 1px solid rgba(239, 154, 154, 0.35);
  color: #EF9A9A;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.due-history-reset-btn:hover {
  background: rgba(239, 154, 154, 0.12);
}

.due-invoice-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  padding: 3px 0;
}

.due-invoice-history-row span:last-child {
  color: #A5D6A7;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.due-history-del-btn {
  background: none;
  border: none;
  color: rgba(239, 154, 154, 0.6);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  font-weight: 700;
  transition: color 0.15s ease;
}

.due-history-del-btn:hover {
  color: #EF9A9A;
}

@media (max-width: 480px) {
  .due-group-header {
    padding: 12px 14px;
  }

  .due-invoice-row {
    padding: 10px 14px;
  }

  .due-group-amount {
    font-size: 13px;
  }
}

/* Terms */
.inv-terms {
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 140px;
  margin-bottom: 3mm;
  font-size: 10px;
  color: #000;
  line-height: 1.6;
}

.inv-terms-title {
  font-weight: 700;
  color: #000;
  margin-bottom: 3px;
  font-size: 10.5px;
}

.inv-terms .inv-term-label {
  color: #c62828;
  font-weight: 700;
}

.inv-terms .inv-term-text {
  color: #1565C0;
}

/* Signature */
.inv-signature {
  /* .invoice-print-wrap is display:flex; flex-direction:column, and this is
     one of its direct children — margin-top:auto pushes it to consume all
     remaining space and sit at the very bottom of the fixed A4 page. Since
     it's still a normal flex item inside a container with overflow:hidden,
     it can never be pushed past the page edge / disappear off-page — if
     content above fills the page, this margin just collapses toward 0 and
     signature sits right after it, still fully on the page. */
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4mm;
  padding-top: 5mm;
}

.inv-sig-box {
  position: relative;
  top: 5px;
  text-align: center;
  padding-bottom: 4px;
}

.inv-sig-name {
  font-size: 10px;
  font-weight: 700;
  color: #000;
  margin-bottom: 1mm;
}

.inv-sig-line {
  border-top: 1px solid #000;
  margin-bottom: 4px;
}

.inv-sig-label {
  font-size: 9.5px;
  color: #000;
  margin-top: 2px;
}

/* Print action buttons */
.inv-top-actions {
  position: fixed;
  top: 16px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 202;
}

.inv-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.30);
  transition: transform 0.2s, opacity 0.2s;
}

.inv-icon-btn:hover {
  transform: scale(1.08);
  opacity: 0.90;
}

.inv-btn-share-icon {
  background: #25D366;
  color: white;
}

.inv-btn-close-icon {
  background: rgba(255,255,255,0.20);
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
}

.inv-bottom-action {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 202;
}

.inv-btn-download {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  background: #1B5E20;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(27,94,32,0.50);
  transition: transform 0.2s, box-shadow 0.2s;
}

.inv-btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(27,94,32,0.60);
}

    /* ================================
       HIDDEN UTILITY
    ================================ */
    .hidden { display: none; }



/* ================================================================
   MOBILE RESPONSIVE — সব ছোট screen এর জন্য
   Breakpoints:
     ≤768px  → tablet / large phone (landscape)
     ≤480px  → phone (portrait)
================================================================ */

/* --------------------------------
   HAMBURGER TOGGLE BUTTON
   (HTML এ এই button add করতে হবে — নিচে নির্দেশনা দেওয়া আছে)
-------------------------------- */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  width: 40px;
  height: 40px;
  background: rgba(15,40,15,0.90);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backdrop-filter: blur(10px);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(165,214,167,0.85);
  border-radius: 2px;
  transition: all 0.3s;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9;
  backdrop-filter: blur(2px);
}

/* --------------------------------
   TABLET  (≤768px)
-------------------------------- */
@media (max-width: 768px) {

  /* Hamburger দেখাও */
  .hamburger { display: flex; }
  .sidebar-overlay.visible { display: block; }

  /* Sidebar — default এ বাম দিকে লুকানো */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    width: 240px;
  }

  /* Sidebar খোলা অবস্থা */
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main wrap পুরো width নাও */
  .main-wrap {
    margin-left: 0;
  }

  /* Home page — normal top-to-bottom flow; scrolling is owned by .main-wrap */
  .home-page {
    padding: 0 20px 40px;
    gap: 0;
  }

  /* Hero (logo + header + KPIs + chart) = EXACTLY one screen, no scroll needed
     to see it. Uses a fixed height (not min-height) so it can never grow past
     the screen, plus overflow:hidden as a safety clip for extreme edge cases.
     Header/logo/KPI sizes are fluid (clamp, based on svh) so they always fit
     comfortably on short phones (iPhone SE ≈667px tall) up to tall ones
     (≈930px+) without ever needing internal scroll. The chart uses flex:1 to
     soak up whatever vertical space is left over, so the total always adds up
     to exactly 100svh. Everything else (low-stock/invoice/top-selling lists)
     sits right below .dash-hero and only shows once the user scrolls. */
  .dash-hero {
    height: 100vh;  /* fallback */
    height: 100svh; /* fixed, not min — this section never scrolls itself */
    height: 100dvh; /* FIX: dvh browser-এ address bar show/hide হওয়ার সাথে সাথে
                        real-time viewport height অনুযায়ী মানিয়ে নেয় — svh শুধু
                        "সবচেয়ে ছোট" height ধরে রাখে, ফলে address bar লুকালে হিরোর
                        নিচে খালি ফাঁকা জায়গা দেখাতে পারতো। এতে design (exactly
                        one screen, no internal scroll) অপরিবর্তিত থাকছে। */
    overflow: hidden; /* safety net, not the primary mechanism */
    justify-content: flex-start;
    gap: clamp(10px, 2.2svh, 24px);
    padding-top: clamp(56px, 10svh, 90px); /* clears the fixed hamburger button */
    padding-bottom: clamp(10px, 2svh, 20px);
  }

  .dash-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(10px, 2svh, 20px);
    margin-bottom: 0;
    padding-bottom: 0;
    padding-right: 0; /* mobile-এ column/centered layout, corner reservation লাগবে না */
    border-bottom: none;
    flex-shrink: 0;
  }

  .dash-logo-wrap {
    width: clamp(44px, 8.5svh, 64px);
    height: clamp(44px, 8.5svh, 64px);
    border-radius: 14px;
  }

  .dash-logo {
    width: 55%;
    height: 55%;
  }

  .dash-company-name { font-size: clamp(17px, 3.2svh, 22px); }
  .dash-system-label { font-size: 9px; letter-spacing: 0.10em; }

  .dash-kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.6svh, 14px);
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .dash-kpi-card {
    padding: clamp(10px, 1.8svh, 18px) clamp(12px, 4vw, 20px) clamp(8px, 1.6svh, 16px);
  }
  .dash-kpi-label { margin-bottom: clamp(4px, 1svh, 10px); }
  .dash-kpi-value { font-size: clamp(18px, 3.6svh, 26px); }

  .dash-section-title { flex-shrink: 0; margin-bottom: clamp(4px, 1svh, 12px); }

  /* This is the flexible element: fills whatever height is left after the
     header + KPI row take their space, so the fold always totals 100svh.
     FIX: selector আগে ছিল শুধু `.dash-chart-wrap` — সেটা Reports page এর দুইটা
     chart-wrap (যাদের নিজেদের inline height:220px আছে) কেও ধরে ফেলতো, আর
     max-height:210px সেগুলোর নিচের ~10px জোর করে কেটে দিতো। এই rule আসলে শুধু
     home dashboard hero এর "exactly one screen" layout এর জন্য, তাই `.dash-hero`
     এর ভেতরে scope করে দেওয়া হলো যাতে Reports page এর chart এ আর প্রভাব না ফেলে। */
  .dash-hero .dash-chart-wrap {
    flex: 1 1 auto;
    min-height: 90px;
    max-height: 210px;
    margin-bottom: 0;
  }

  .dash-two-col { grid-template-columns: 1fr; margin-top: 40px; }
  .dash-header .dash-reset-btn {
    margin-left: 0;
    margin-top: 6px;
    width: 100%;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Logo — বড় ও উপরে */
  .home-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 22px;
    margin-top: -20px; /* একটু উপরে তোলা */
  }

  /* Company name — বড় */
  .home-company-name {
    font-size: 32px;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
  }

  .home-system-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    margin-bottom: 26px;
  }

  .home-divider {
    margin-bottom: 26px;
  }

  .home-divider-line { width: 55px; }

  /* Contact info + button — mobile এ সব লুকাও */
  .home-info-row,
  .home-enter-btn {
    display: none;
  }

  /* Page header */
  .page-header {
    padding: 12px 16px;
    padding-left: 60px; /* hamburger এর জায়গা */
  }

  .page-content {
    padding: 14px 12px;
  }

  /* Glass panel header */
  .glass-panel-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  /* Tables — horizontal scroll */
  .glass-panel {
    overflow-x: auto;
  }

  .glass-table {
    min-width: 520px;
  }

  /* Invoice form — 2-column → 1-column */
  .form-top-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Invoice table */
  .form-section {
    padding: 14px 12px;
    overflow-x: auto;
  }

  /* Invoice/Purchase table — মোবাইলে পাশে scroll করা লাগবে না,
     প্রতিটা row এখন label-সহ একটা কার্ড হিসেবে উপর-নিচে সাজানো দেখাবে */
  .invoice-table,
  .invoice-table thead,
  .invoice-table tbody,
  .invoice-table th,
  .invoice-table td,
  .invoice-table tr {
    display: block;
    width: 100%;
  }

  .invoice-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .invoice-table tbody tr {
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
  }

  .invoice-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .invoice-table td {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .invoice-table td:last-child {
    border-bottom: none;
    text-align: right;
  }

  .invoice-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(165,214,167,0.75);
    margin-bottom: 4px;
  }

  /* Footer calc */
  .form-footer {
    justify-content: stretch;
    padding: 14px 12px;
  }

  .form-footer-calc {
    min-width: unset;
    width: 100%;
  }

  .calc-value {
    min-width: 70px;
  }

  /* Generate button */
  .generate-btn-wrap {
    justify-content: center;
  }

  .generate-btn {
    padding: 13px 28px;
    font-size: 14px;
  }

  /* Modal */
  .modal-overlay {
    padding: 16px;
    align-items: flex-end; /* নিচ থেকে উঠে আসে */
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0;
  }

  .modal-row {
    grid-template-columns: 1fr;
  }

  /* Invoice print overlay */
  .invoice-print-overlay {
    padding: 12px;
  }

  .invoice-print-wrap {
    width: 100%;
    min-height: auto;
    padding: 8mm 6mm;
  }

  /* Invoice print top action buttons */
  .inv-top-actions {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .inv-bottom-action {
    bottom: 12px;
  }

  .inv-btn-download {
    padding: 12px 28px;
    font-size: 13px;
  }
}


/* --------------------------------
   PHONE  (≤480px)
-------------------------------- */
@media (max-width: 480px) {

  /* Home page — ছোট phone */
  .home-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 18px;
    margin-top: -10px;
  }

  .home-company-name {
    font-size: 26px;
    letter-spacing: 0.03em;
  }

  .home-system-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    margin-bottom: 22px;
  }

  .home-divider {
    margin-bottom: 22px;
  }

  .home-divider-line { width: 38px; }

  .home-info-card {
    padding: 12px 16px;
    font-size: 12px;
  }

  /* contact info + button — লুকানো */
  .home-info-row,
  .home-enter-btn {
    display: none;
  }

  /* Page header আরও ছোট */
  .page-header {
    padding: 10px 12px 10px 56px;
  }

  .page-header-title {
    font-size: 13px;
  }

  .back-btn {
    font-size: 11px;
    padding: 5px 9px;
  }

  .page-content {
    padding: 10px 8px;
  }

  /* Glass panel */
  .glass-panel-title {
    font-size: 12px;
  }

  .add-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Invoice print — ছোট screen এ scale down */
  .invoice-print-wrap {
    padding: 6mm 4mm;
    font-size: 10px;
  }

  .inv-company-name {
    font-size: 18px;
  }

  .inv-logo {
    width: 80px;
    height: 80px;
  }

  .inv-title {
    font-size: 13px;
    padding: 2px 10px;
  }

  .inv-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .inv-header-right {
    text-align: left;
  }

  .inv-cash-label {
    margin-bottom: 6px;
  }

  .inv-info-grid {
    grid-template-columns: 1fr;
  }

  .inv-info-grid > .inv-info-box:first-child .inv-info-row {
    border-right: none;
  }

  .inv-signature {
    grid-template-columns: 1fr;
    gap: 6mm;
  }

  .inv-calc {
    margin-right: 0;
    justify-content: flex-start;
  }

  .inv-calc-table {
    width: 100%;
  }

  .inv-outstanding {
    margin-right: 0;
    justify-content: flex-start;
  }

  .inv-outstanding-table {
    margin-top: 40px;
    width: 100%;
    margin-right: 0;
  }

  /* Form footer */
  .calc-label {
    font-size: 11px;
    min-width: 80px;
  }

  .total-value {
    font-size: 15px;
  }

  /* Modal padding কমাও */
  .modal-inner {
    padding: 20px 16px;
  }

  .modal-title {
    font-size: 17px;
  }

  /* Generate button full width */
  .generate-btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
  }

  .generate-btn-wrap {
    justify-content: stretch;
  }
}


/* ================================
   MOBILE CARD LAYOUT
   Products, Customers, History
================================ */
.mob-card-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: background 0.15s;
}

.mob-card:active { background: rgba(255,255,255,0.11); }

.mob-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mob-card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin-bottom: 3px;
}

.mob-card-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.mob-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}

.mob-card-label {
  font-size: 11px;
  color: rgba(165,214,167,0.55);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mob-card-value {
  color: rgba(255,255,255,0.80);
  text-align: right;
  max-width: 60%;
}


/* ================================
   ADMIN PANEL
================================ */
.admin-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(165,214,167,0.15);
  padding-bottom: 0;
}

.admin-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.50);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 18px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.02em;
}

.admin-tab:hover {
  color: rgba(255,255,255,0.80);
}

.admin-tab.active {
  color: #A5D6A7;
  border-bottom-color: #A5D6A7;
}

.admin-tab-content {
  animation: fadeIn 0.2s ease;
}

/* STOCK ADJUST TOGGLE (Restock modal — Add / Remove) */
.stock-adjust-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.stock-adjust-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stock-adjust-btn:hover {
  color: rgba(255,255,255,0.85);
}

.stock-adjust-btn.add.active {
  background: rgba(165,214,167,0.16);
  border-color: #A5D6A7;
  color: #A5D6A7;
}

.stock-adjust-btn.remove.active {
  background: rgba(239,154,154,0.16);
  border-color: #EF9A9A;
  color: #EF9A9A;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Permission Toggle Row */
.perm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}

.perm-toggle-row:last-child {
  border-bottom: none;
}

.perm-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #A5D6A7;
  padding: 4px 0 6px;
}

.perm-toggle-label {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 22px;
  transition: background 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #43A047;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Admin mobile responsive */
@media (max-width: 768px) {
  #page-admin {
    padding: 14px 14px;
  }

  #page-admin > div:first-child {
    padding-left: 56px;
  }

  #page-admin .glass-panel > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  #admin-tab-permissions > div {
    grid-template-columns: 1fr !important;
  }
}

/* ================================
   REPORTS PAGE
================================ */
/* KPI row-এর ৫ম কার্ড (Sales − Purchase) — এটা "due" নয়, তাই লাল বর্ডারের
   বদলে সবুজ শেড ব্যবহার করা হয়েছে, বাকি ৪টা কার্ডের style অপরিবর্তিত */
#page-reports .dash-kpi-card:nth-child(5) {
  border-top-color: rgba(165, 214, 167, 0.35);
}
#page-reports .dash-kpi-card:nth-child(5)::before {
  background: linear-gradient(90deg, transparent, rgba(165, 214, 167, 0.55), transparent);
}

#reportsFilterPanel {
  /* FIX: block-formatting-context height collapse bug — এই glass-panel এর
     child row-এ native <input type="date"> থাকায় কিছু browser parent-এর
     auto-height ভুল হিসাব করে (content height ~12px দেখাতো, ভেতরের
     140px height এর row কে ধরতোই না — ফলে overflow:hidden এ পুরো
     filter bar clip হয়ে "খালি" দেখাতো)। glass-panel কে নিজেই flex
     container বানিয়ে দেওয়ায় height হিসাব spec অনুযায়ী নির্ভরযোগ্য হয়। */
  display: flex;
  flex-direction: column;
  /* HARD SAFETY NET: উপরের flex fix-টা কিছু browser-এ এখনো auto-height
     ভুল দিচ্ছিল বলে একটা guaranteed minimum height জোর করে বসিয়ে দেওয়া
     হলো — content এর real height (~90-140px, date range filter বেশি
     বাটন থাকলে wrap করে বড়ও হতে পারে) এর চেয়ে ছোট নয়, তাই clip হবে না। */
  min-height: 110px;
  overflow: visible; /* এই panel এ কিছু clip হওয়া চলবে না, height যাই হিসাব হোক */
}

#reportsPresetNav.admin-tab-nav {
  gap: 8px;
}
#reportsPresetNav .admin-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.62);
  padding: 7px 16px;
  font-size: 12.5px;
  margin-bottom: 0;
}
#reportsPresetNav .admin-tab:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.90);
}
#reportsPresetNav .admin-tab.active {
  background: rgba(76, 175, 80, 0.24);
  border-color: rgba(165, 214, 167, 0.55);
  color: #C8E6C9;
}
#page-reports input.form-input[type="date"] {
  color-scheme: dark;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

@media (max-width: 768px) {
  #page-reports {
    padding: 14px 14px;
  }
  #page-reports > div:first-child {
    padding-left: 56px;
  }
}


/* ================================================================
   LOW-POWER / BUDGET MOBILE GPU FIX
   ================================================================
   কারণ: এই পুরো UI-তে ২০+ জায়গায় backdrop-filter: blur() ব্যবহার হয়েছে
   (glass/frosted look এর জন্য) — এর মধ্যে কিছু element scroll content-এর
   সাথে নিজেও scroll হয় (KPI card, info card, glass-panel, form-section,
   due-group), আবার কিছু element (sidebar, header) scroll content-এর উপর
   ভাসমান অবস্থায় fixed/sticky থেকে প্রতি frame-এ নিচের content-এর blur
   recalculate করে।

   ভালো GPU (আধুনিক ফোন/PC) তে এটা smooth থাকে, কিন্তু Oppo A12s এর মতো
   বাজেট ফোনের দুর্বল GPU (MediaTek Helio P35 জাতীয়) প্রতি scroll frame-এ
   এত blur recomposite করতে পারে না — ফলে scroll করলে element গুলো
   ভেঙে/মিলিয়ে/জমাট বেঁধে দেখায়, আর জোর করে দ্রুত scroll করলে GPU আরও
   পিছিয়ে পড়ে সমস্যা আরও বাড়ে। এটাই আসল কারণ, "আলাদা mobile design" নয়।

   Fix: ছোট screen এ (touch device সাধারণত এই width) ভারী blur বন্ধ করে
   তার বদলে একটু বেশি opaque solid/near-solid background বসানো হয়েছে,
   যাতে দেখতে প্রায় একই রকম লাগে কিন্তু GPU cost অনেক কমে যায়।
================================================================ */
@media (max-width: 900px) {
  .dash-kpi-card,
  .home-info-card,
  .glass-panel,
  .form-section,
  .due-group,
  .customer-dropdown {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(15, 35, 15, 0.92);
  }

  .page-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 18, 6, 0.94);
  }

  .sidebar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 26, 10, 0.98);
  }

  .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .toast,
  .invoice-print-overlay,
  .hamburger,
  .sidebar-overlay,
  .lang-switch,
  .lang-menu__trigger,
  .lang-menu__panel,
  .inv-btn-close-icon {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
