/* ============================================================
   CNC ওয়ার্কশপ ম্যানেজমেন্ট — মূল স্টাইলশিট
   ============================================================ */

:root {
  /* ক্রিম-সোনালি ধারা — পালাজো হাউজের নকশার সঙ্গে মিলিয়ে */
  --bg:        #fdfaf6;
  --surface:   #ffffff;
  --surface-2: #f8f2ea;
  --border:    #ebe0d2;
  --text:      #45362c;
  --text-dim:  #8f7f70;
  --brand:     #a5813c;
  --brand-2:   #c8a45d;
  --brand-soft:#f3e9dd;
  --green:     #4b8b6f;
  --green-soft:#e2efe8;
  --red:       #c4635c;
  --red-soft:  #f8e7e5;
  --blue:      #4a7fa5;
  --blue-soft: #e5eff6;
  --teal:      #55917f;
  --teal-soft: #e3f0ec;
  --purple:      #8a6ea8;
  --purple-soft: #efe9f5;
  --gold-lt:   #ebd08a;
  --shadow:    0 1px 3px rgba(102,78,56,.08), 0 1px 2px rgba(102,78,56,.05);
  --shadow-lg: 0 10px 30px rgba(102,78,56,.14);
  --radius:    14px;
  --sidebar-w: 246px;
  /* শুধু সংখ্যার জন্য আলাদা ফন্ট — Hind Siliguri-র ১ ও ৫ ছোট আকারে প্রায় একরকম দেখায়,
     Noto Sans Bengali-র অঙ্কগুলো বড় ও খোলা, তাই আলাদা করে চেনা যায় */
  --num-font: 'Noto Sans Bengali', 'Hind Siliguri', 'Segoe UI', system-ui, sans-serif;
  /* সারি আলাদা করে চেনার হালকা রঙ — ল্যাপটপে এক সারি অন্তর, ফোনে কার্ডে ঘুরিয়ে-ফিরিয়ে */
  --row-alt:  rgba(165,129,60,.075);
  --row-c1:   rgba(165,129,60,.10);
  --row-c2:   rgba(75,139,111,.10);
  --row-c3:   rgba(74,127,165,.10);
}

html[data-theme="dark"] {
  --bg:        #17120c;
  --surface:   #221b13;
  --surface-2: #2c231a;
  --border:    #3d3226;
  --text:      #f2e9dd;
  --text-dim:  #b3a390;
  --brand:     #d9b571;
  --brand-2:   #ebd08a;
  --brand-soft:#3a2e1a;
  --green:     #6faa8e;
  --green-soft:#1b2f26;
  --red:       #d98a83;
  --red-soft:  #34211f;
  --blue:      #7aa8c8;
  --blue-soft: #1c2a34;
  --teal:      #74ac99;
  --teal-soft: #1b2c27;
  --purple:      #ad91c9;
  --purple-soft: #26203a;
  --gold-lt:   #ebd08a;
  --shadow:    0 1px 3px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.55);
  /* অন্ধকার থিমে সাদা আলোর হালকা ছোঁয়া — নইলে রঙগুলো চোখেই পড়ে না */
  --row-alt:  rgba(255,255,255,.045);
  --row-c1:   rgba(217,181,113,.09);
  --row-c2:   rgba(111,170,142,.09);
  --row-c3:   rgba(122,168,200,.09);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Hind Siliguri', 'Segoe UI', system-ui, -apple-system, sans-serif;
  /* হালকা রঙিন আভা — উপরের জিনিসগুলো তখন ভেসে থাকার মতো লাগে */
  background:
    radial-gradient(900px 480px at 12% -8%,  rgba(200,164,93,.18),  transparent 62%),
    radial-gradient(820px 440px at 92% 2%,   rgba(235,208,138,.16), transparent 58%),
    radial-gradient(760px 520px at 55% 110%, rgba(243,233,221,.55), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 480px at 12% -8%,  rgba(217,181,113,.12), transparent 62%),
    radial-gradient(820px 440px at 92% 2%,   rgba(235,208,138,.10), transparent 58%),
    radial-gradient(760px 520px at 55% 110%, rgba(120,95,60,.16),  transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- লেআউট ---------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #ffffff;
  border-inline-end: 1px solid var(--border);
  color: var(--text);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  height: 100dvh;               /* মোবাইলে ঠিকানা-বার লুকালেও উচ্চতা ঠিক থাকে */
  overflow-y: auto;
  overscroll-behavior: contain; /* মেনু স্ক্রল করলে পেছনের পাতা নড়বে না */
  -webkit-overflow-scrolling: touch;
  z-index: 60;
  transition: transform .22s ease;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: #ffffff;
  z-index: 2;
  text-decoration: none;
  transition: background .15s;
}
.brand:hover { background: var(--surface-2); text-decoration: none; }
.brand:hover .brand-logo { transform: scale(1.05); }
.brand-logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--gold-lt));
  display: grid; place-items: center;
  color: #fff; font-size: 20px; font-weight: 700; line-height: 1;
  transition: transform .15s;
  box-shadow: 0 4px 12px -3px rgba(165,129,60,.45);
}
/* লোগো ছবি হলে গ্রেডিয়েন্ট পটভূমির দরকার নেই */
img.brand-logo { background: none; object-fit: contain; display: block; }
.brand-txt { min-width: 0; }
.brand-txt b { color: var(--text); font-size: 15px; display: block; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt span { font-size: 11px; color: var(--text-dim); }

/* নিচে বাড়তি জায়গা — ফোনের নেভিগেশন বারের নিচে যেন শেষ আইটেম ঢাকা না পড়ে */
.nav { padding: 10px 10px calc(48px + env(safe-area-inset-bottom, 0px)); }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); padding: 14px 10px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: #6b5749; font-size: 14.5px; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px -4px rgba(165,129,60,.55); }
.nav a .ic { width: 20px; text-align: center; font-size: 15px; flex: 0 0 20px; }
.nav a .cnt { margin-inline-start: auto; background: var(--red); color: #fff;
  font-family: var(--num-font); font-size: 12px; padding: 1px 7px;
  border-radius: 999px; font-weight: 700; letter-spacing: .3px; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  cursor: pointer; font-size: 16px; position: relative; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--border); }
.icon-btn .dot { position: absolute; top: 5px; inset-inline-end: 5px; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; border: 2px solid var(--surface); }

#menuBtn { display: none; }

.content { padding: 18px; flex: 1; }

.userchip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.userchip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.userchip small { color: var(--text-dim); display: block; font-size: 11px; line-height: 1; }
.userchip b { font-size: 13px; line-height: 1.3; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); min-width: 230px; padding: 6px; display: none; z-index: 80;
  max-height: 70vh; overflow-y: auto;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; gap: 9px; align-items: flex-start; width: 100%; text-align: start;
  padding: 9px 11px; border-radius: 8px; color: var(--text); font-size: 14px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* ---------------- কার্ড ---------------- */

.card {
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 2px 6px rgba(102,78,56,.05),
    0 14px 32px -10px rgba(102,78,56,.16),
    0 34px 70px -24px rgba(102,78,56,.14);
}
html[data-theme="dark"] .card {
  background: rgba(34,27,19,.78);
  border-color: rgba(255,255,255,.09);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 14px 34px -10px rgba(0,0,0,.6),
    0 36px 72px -26px rgba(0,0,0,.55);
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.card-head .spacer { margin-inline-start: auto; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* ---------------- স্ট্যাট ---------------- */

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.stat {
  background: rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 18px;
  padding: 15px 16px; position: relative; overflow: hidden;
  display: block; color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 2px 5px rgba(102,78,56,.05),
    0 12px 26px -8px rgba(102,78,56,.16),
    0 28px 56px -20px rgba(102,78,56,.14);
  transition: box-shadow .28s ease, transform .28s ease;
}
a.stat:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 4px 8px rgba(102,78,56,.06),
    0 22px 40px -10px rgba(102,78,56,.24),
    0 44px 80px -26px rgba(102,78,56,.2);
}
html[data-theme="dark"] .stat {
  background: rgba(34,27,19,.8);
  border-color: rgba(255,255,255,.09);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 12px 28px -8px rgba(0,0,0,.6),
    0 30px 60px -22px rgba(0,0,0,.55);
}
html[data-theme="dark"] a.stat:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 22px 44px -10px rgba(0,0,0,.7),
    0 46px 84px -28px rgba(0,0,0,.6);
}
.stat:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); transition: .15s; }
.stat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; margin-bottom: 10px; }
.stat .lbl { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.stat .val { font-family: var(--num-font);
  font-size: 24px; font-weight: 700; line-height: 1.3; margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.stat .sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.bg-amber { background: var(--brand-soft); color: var(--brand); }
.bg-green { background: var(--green-soft); color: var(--green); }
.bg-red   { background: var(--red-soft);   color: var(--red); }
.bg-blue  { background: var(--blue-soft);  color: var(--blue); }
.bg-teal  { background: var(--teal-soft);  color: var(--teal); }
.bg-purple{ background: var(--purple-soft); color: var(--purple); }
.bg-gray  { background: var(--surface-2);  color: var(--text-dim); }

.txt-green { color: var(--green); }
.txt-red   { color: var(--red); }
.txt-dim   { color: var(--text-dim); }
.txt-brand { color: var(--brand); }

/* ---------------- টেবিল ---------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.tbl th {
  background: var(--surface-2); text-align: start; padding: 10px 12px;
  font-weight: 600; font-size: 12.5px; color: var(--text-dim);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* সংখ্যার কলামে হেডারও ডানে থাকবে, না হলে হেডার আর সংখ্যা আলাদা পাশে পড়ে তেরছা দেখায় */
table.tbl th.num, table.tbl td.num, table.tbl tfoot td.num { text-align: end; }
/* বাংলা অঙ্ক ছোট আকারে ঝাপসা লাগে — আলাদা ফন্টে, বড় ও মোটা করে, সমান চওড়ায় বসাই */
table.tbl td.num {
  font-family: var(--num-font);
  font-size: 16px; font-weight: 700; letter-spacing: .4px;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum';
}
table.tbl td.num b { font-weight: 700; }
/* এক সারি অন্তর হালকা রঙ — লম্বা তালিকায় চোখ পাশের সারিতে চলে যায় না */
table.tbl tbody tr:nth-child(even) { background: var(--row-alt); }
table.tbl tbody tr:hover,
table.tbl tbody tr:nth-child(even):hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---- লম্বা তালিকা: উপরের শিরোনাম ও নিচের মোট আটকে থাকে, শুধু সারিগুলো গড়ায় ---- */
.table-wrap.stick {
  overflow-y: auto;
  max-height: calc(100vh - 340px);
}
/* স্বচ্ছ রঙ চলবে না — নইলে গড়ানো সারিগুলো শিরোনামের ভেতর দিয়ে দেখা যায় */
.table-wrap.stick table.tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface-2);
  box-shadow: 0 1px 0 var(--border);
}
.table-wrap.stick table.tbl tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--surface-2);
  box-shadow: 0 -1px 0 var(--border);
}
html[data-theme="dark"] .table-wrap.stick table.tbl thead th,
html[data-theme="dark"] .table-wrap.stick table.tbl tfoot td { background: #2c231a; }

/* ছাপার সময় আটকানোর দরকার নেই — পুরো তালিকা ছাপা হোক */
@media print {
  .table-wrap.stick { max-height: none; overflow: visible; }
  .table-wrap.stick table.tbl thead th,
  .table-wrap.stick table.tbl tfoot td { position: static; }
}

.empty { padding: 40px 16px; text-align: center; color: var(--text-dim); }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; opacity: .6; }

/* ---------------- ব্যাজ ---------------- */

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-gray  { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-blue  { background: var(--blue-soft);  color: var(--blue); }
.badge-amber { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red   { background: var(--red-soft);   color: var(--red); }
.badge-teal  { background: var(--teal-soft);  color: var(--teal); }
.badge-purple{ background: var(--purple-soft); color: var(--purple); }

/* ---- তালিকা থেকেই অবস্থা বদলানো: দেখতে ব্যাজের মতো, কাজ করে ড্রপডাউনের মতো ---- */
.st-form { display: inline-block; margin: 0; }
.st-pick {
  appearance: none; -webkit-appearance: none;
  padding: 3px 26px 3px 11px; border-radius: 999px;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; cursor: pointer; max-width: 100%;
  border: 1px solid transparent;
  /* ডান পাশে ছোট্ট তীর, যাতে বোঝা যায় এটি বদলানো যায় */
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px 11px;
  transition: box-shadow .15s, transform .15s;
}
[dir="rtl"] .st-pick { padding: 3px 11px 3px 26px; background-position: left 8px center; }
.st-pick:hover  { box-shadow: 0 2px 8px rgba(102,78,56,.18); transform: translateY(-1px); }
.st-pick:focus  { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.st-pick option { background: var(--surface); color: var(--text); font-weight: 500; }
/* ছাপার সময় তীর বা ফোকাস-রিং দরকার নেই */
@media print { .st-pick { background-image: none; padding: 2px 10px; border: 0; } }

/* ---------------- ফর্ম ---------------- */

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field small.hint { color: var(--text-dim); font-size: 12px; line-height: 1.5; }

/* hidden অ্যাট্রিবিউট যেন সব সময় কাজ করে —
   .field/.stat ইত্যাদিতে display দেওয়া থাকায় নইলে ব্রাউজারের ডিফল্ট হেরে যায় */
[hidden] { display: none !important; }

/* ---- নিরীক্ষা পর্যবেক্ষণ ---- */
.audit-item {
  border: 1px solid var(--border); border-inline-start-width: 4px;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2);
}
.audit-item:last-child { margin-bottom: 0; }
.audit-high { border-inline-start-color: var(--red);     background: var(--red-soft); }
.audit-mid  { border-inline-start-color: var(--brand-2); background: var(--brand-soft); }
.audit-low  { border-inline-start-color: var(--blue);    background: var(--blue-soft); }
.ai-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.ai-head b { font-size: 14.5px; }
.ai-detail { margin: 0 0 9px; font-size: 13.5px; color: var(--text-dim); line-height: 1.7; }
.audit-item table.tbl { background: var(--surface); border-radius: 8px; overflow: hidden; }

/* ---- এক পেমেন্ট একাধিক মাধ্যমে ---- */

.pay-head { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; margin-bottom: 10px; }
.pay-head span { font-weight: 400; color: var(--text-dim); }

/* মূল পেমেন্ট — ভরাট, গাঢ় সীমানা */
.pay-main {
  border: 2px solid var(--green);
  background: var(--green-soft);
  border-radius: 12px; padding: 12px 13px; gap: 0;
}
.pay-main .pay-head { color: var(--green); }
.pay-main input, .pay-main select { background: var(--surface); }

/* বাড়তি মাধ্যম — কাটা-দাগের সীমানা, হালকা রং */
.pay-extra {
  border: 1px dashed var(--blue);
  background: var(--blue-soft);
  border-radius: 12px; padding: 12px 13px; gap: 8px;
}
.pay-extra .pay-head { color: var(--blue); }

.pay-row {
  display: grid; grid-template-columns: 26px 1fr 1fr 34px;
  gap: 9px; align-items: end; margin-bottom: 9px;
}
.pay-row .field { min-width: 0; }
.pay-row input, .pay-row select { background: var(--surface); }
.pay-n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; margin-bottom: 7px;
}
.pay-x {
  width: 34px; height: 38px; border: 1px solid var(--border); background: var(--surface);
  color: var(--red); border-radius: 9px; cursor: pointer; font-size: 15px; margin-bottom: 0;
}
.pay-x:hover { background: var(--red-soft); }

.pay-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pay-total { margin-inline-start: auto; font-size: 13px; color: var(--text-dim); }
.pay-total b { font-family: var(--num-font); font-size: 15px; color: var(--text); letter-spacing: .3px; }

@media (max-width: 560px) {
  .pay-row { grid-template-columns: 26px 1fr 34px; }
  .pay-row .field:nth-of-type(2) { grid-column: 2 / 4; }
}

/* ---- মডালের ভেতরে “নতুন কিছু যোগ করুন” ঘর ---- */
.field.inline-new {
  border: 1px dashed var(--brand-2);
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 12px 13px;
  gap: 8px;
}
.field.inline-new > label { font-weight: 700; }
.field.inline-new .form-grid { gap: 9px; }

/* ---- ইউজার-প্রতি পারমিশন বাছাই ---- */
.perm-mode { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 4px; }
.perm-mode label { display: flex; align-items: center; gap: 7px; font-size: 13.5px;
                   font-weight: 400; cursor: pointer; margin: 0; }
.perm-mode input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

.perm-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
            background: var(--bg); margin-top: 8px; }
.perm-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.perm-grp + .perm-grp { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.perm-grp-h { font-size: 12px; font-weight: 700; color: var(--text-dim);
              letter-spacing: .4px; margin-bottom: 7px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 7px 14px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px;
             cursor: pointer; padding: 3px 0; margin: 0; font-weight: 400; }
.perm-item input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
@media (max-width: 640px) { .perm-list { grid-template-columns: 1fr 1fr; } }

/* পাতা-প্রতি অনুমতির স্তর */
.perm-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.perm-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
             font-size: 13.5px; font-weight: 400; margin: 0; cursor: pointer; }
.perm-name input.perm-chk { width: 17px; height: 17px; flex: none; accent-color: var(--brand); cursor: pointer; }
.perm-row.off .perm-name span { color: var(--text-dim); }
.perm-row.off select { opacity: .55; }
.perm-row select { width: auto; flex: 0 0 178px; padding: 6px 34px 6px 10px;
                   font-size: 13px; border-radius: 9px; background-size: 11px, 30px 100%, 100% 100%;
                   background-position: right 10px center, right 0 center, 0 0; }
@media (max-width: 520px) {
  .perm-row { flex-wrap: wrap; gap: 4px; }
  .perm-name { flex: 1 1 100%; font-weight: 600; }
  .perm-row select { flex: 1 1 100%; }
}
label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
label .req { color: var(--red); }

input[type=text], input[type=number], input[type=date], input[type=time], input[type=month],
input[type=password], input[type=search], input[type=tel], input[type=email], input[type=file],
select, textarea {
  width: 100%; padding: 9px 11px; font-size: 14.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
/* ---- ঘরগুলো যেন জলের উপর ভাসছে ---- */
input[type=text], input[type=number], input[type=date], input[type=time], input[type=month],
input[type=password], input[type=search], input[type=tel], input[type=email], input[type=file],
select, textarea {
  border-radius: 13px;
  border: 1.5px solid #dccdb8;                       /* স্পষ্ট সীমানা */
  /* হালকা রঙের মিশেল — নীলাভ থেকে সাদা হয়ে সোনালি */
  background-image: linear-gradient(135deg,
    rgba(243,233,221,.75) 0%,
    rgba(255,255,255,.94) 44%,
    rgba(235,208,138,.42) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.95),          /* উপরে আলোর ঝিলিক */
    inset 0 -1px 2px rgba(148,163,184,.10),
    0 1px 2px rgba(102,78,56,.04),
    0 8px 18px -6px rgba(102,78,56,.16),             /* ভেসে থাকার ছায়া */
    0 20px 42px -14px rgba(102,78,56,.14);           /* নিচে ছড়ানো প্রতিফলন */
  transition: box-shadow .25s ease, transform .25s ease, border-color .2s, background-image .2s;
}
input:hover, select:hover, textarea:hover {
  transform: translateY(-1px);
  border-color: #c9b393;
  background-image: linear-gradient(135deg,
    rgba(240,227,209,.9) 0%,
    rgba(255,255,255,.96) 44%,
    rgba(235,208,138,.6) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.95),
    0 2px 4px rgba(102,78,56,.05),
    0 14px 26px -8px rgba(102,78,56,.22),
    0 28px 55px -18px rgba(102,78,56,.18);
}
input:focus, select:focus, textarea:focus {
  outline: 0; transform: translateY(-1px);
  border-color: #c8a45d;
  background-image: linear-gradient(135deg,
    rgba(243,233,221,.95) 0%,
    rgba(255,255,255,.98) 46%,
    rgba(235,208,138,.8) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.95),
    0 0 0 4px rgba(200,164,93,.22),
    0 14px 28px -8px rgba(165,129,60,.28),
    0 30px 58px -20px rgba(165,129,60,.2);
}
input:active, select:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 5px rgba(102,78,56,.1), 0 3px 8px -3px rgba(102,78,56,.14);
}

html[data-theme="dark"] input[type=text], html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input[type=date], html[data-theme="dark"] input[type=time],
html[data-theme="dark"] input[type=month], html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=search], html[data-theme="dark"] input[type=tel],
html[data-theme="dark"] input[type=email], html[data-theme="dark"] input[type=file],
html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  border-color: #4a3c2b;
  background-image: linear-gradient(135deg,
    rgba(217,181,113,.16) 0%, rgba(34,27,19,.95) 46%, rgba(235,208,138,.14) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.08),
    0 8px 20px -6px rgba(0,0,0,.6),
    0 22px 46px -16px rgba(0,0,0,.5);
}
html[data-theme="dark"] input:hover, html[data-theme="dark"] select:hover,
html[data-theme="dark"] textarea:hover {
  border-color: #63513a;
  background-image: linear-gradient(135deg,
    rgba(217,181,113,.26) 0%, rgba(40,32,23,.95) 46%, rgba(235,208,138,.2) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.1),
    0 14px 30px -8px rgba(0,0,0,.7),
    0 30px 60px -20px rgba(0,0,0,.6);
}
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { border-color: #c8a45d; }
textarea { min-height: 78px; resize: vertical; }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--text-dim); }

/* ---- ড্রপডাউন — ব্রাউজারের সাদামাটা তীরের বদলে নিজেদের চৌকো ঘর ---- */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-inline-end: 46px;
  cursor: pointer;
  background-image:
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f7f70' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(248,242,234,.95) 0%, rgba(235,224,210,.95) 100%),
    linear-gradient(135deg, rgba(243,233,221,.75) 0%, rgba(255,255,255,.94) 44%, rgba(235,208,138,.42) 100%);
  background-repeat: no-repeat;
  background-position: right 13px center, right 0 center, 0 0;
  background-size: 13px, 38px 100%, 100% 100%;
}
select:hover  { background-image:
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5813c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(243,233,221,.98) 0%, rgba(235,208,138,.85) 100%),
    linear-gradient(135deg, rgba(240,227,209,.9) 0%, rgba(255,255,255,.96) 44%, rgba(235,208,138,.6) 100%); }
select:focus  { background-image:
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5813c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(243,233,221,1) 0%, rgba(235,208,138,.95) 100%),
    linear-gradient(135deg, rgba(243,233,221,.95) 0%, rgba(255,255,255,.98) 46%, rgba(235,208,138,.8) 100%); }
select:disabled { background-image: none; cursor: default; }

html[data-theme="dark"] select { background-image:
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3a390' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(60,48,34,.95) 0%, rgba(44,35,26,.95) 100%),
    linear-gradient(135deg, rgba(37,99,235,.2) 0%, rgba(34,27,19,.95) 46%, rgba(235,208,138,.14) 100%); }

/* ফায়ারফক্সে ভেতরের তালিকার রং ঠিক রাখা */
select option { background: var(--surface); color: var(--text); }

/* তারিখের ঘরের ক্যালেন্ডার আইকনটাও একই রকম চৌকো ঘরে */
input[type=date], input[type=month], input[type=time] { position: relative; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  position: absolute; inset-inline-end: 0; top: 0; bottom: 0;
  width: 38px; margin: 0; padding: 0 12px;
  border-inline-start: 1px solid var(--border);
  background-color: var(--surface-2);
  cursor: pointer; opacity: .85;
}
input[type=date]:hover::-webkit-calendar-picker-indicator,
input[type=month]:hover::-webkit-calendar-picker-indicator,
input[type=time]:hover::-webkit-calendar-picker-indicator {
  background-color: var(--brand-soft); opacity: 1;
}
html[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type=month]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 14.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn-sm  { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn-lg  { padding: 12px 22px; font-size: 16px; }
.btn {
  border-radius: 12px;
  background-image: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(0,0,0,.06) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 2px 4px rgba(102,78,56,.08),
    0 10px 20px -6px rgba(102,78,56,.3),
    0 22px 40px -18px rgba(102,78,56,.28);
  transition: box-shadow .25s ease, transform .25s ease, filter .15s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 4px 8px rgba(102,78,56,.1),
    0 18px 32px -8px rgba(102,78,56,.38),
    0 36px 60px -24px rgba(102,78,56,.34);
}
.btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.2), 0 3px 8px -3px rgba(102,78,56,.2);
}
.btn-light { color: var(--text); border-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  background-image: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,242,234,.85));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95),
              0 1px 3px rgba(102,78,56,.05),
              0 8px 18px -6px rgba(102,78,56,.16),
              0 20px 40px -16px rgba(102,78,56,.14); }
.btn-light:hover { color: var(--text); border-color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95),
              0 2px 5px rgba(102,78,56,.06),
              0 14px 28px -8px rgba(102,78,56,.22),
              0 30px 56px -20px rgba(102,78,56,.18); }

html[data-theme="dark"] .btn-light {
  background: rgba(44,35,26,.85); border-color: rgba(255,255,255,.1);
  background-image: linear-gradient(180deg, rgba(50,40,28,.92), rgba(28,22,15,.92));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.07),
              0 10px 24px -8px rgba(0,0,0,.6),
              0 26px 50px -20px rgba(0,0,0,.5); }
.btn-green { background: var(--green); }
.btn-red   { background: var(--red); }
.btn-blue  { background: var(--blue); }
.btn-teal  { background: var(--teal); }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: end; }
.toolbar .field { flex: 1 1 150px; }

/* ---- কাজের বোর্ড: কোন কাজ কত সময় ধরে এই ধাপে ---- */
.stage-time {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 7px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border);
}
/* ৩ দিনের বেশি — একটু নজরে আসুক */
.stage-time.stage-warm { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
/* ৭ দিনের বেশি — আটকে আছে */
.stage-time.stage-hot  { background: var(--red-soft);   color: var(--red);   border-color: transparent; }

/* ---- তারিখের ঘরের নিচে দিন/মাস/বছর ---- */
.date-bn {
  font-size: 11.5px; line-height: 1.6; margin-top: 3px;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.date-bn:empty { display: none; }
@media print { .date-bn { display: none; } }

/* ---- সার্চ ঘরের ভেতরের “খুঁজুন” বোতাম ---- */
.search-wrap { position: relative; display: block; min-width: 0; }
/* লেখা যেন বোতামের নিচে ঢুকে না যায় */
.search-wrap input[type="search"] { width: 100%; padding-inline-end: 108px; }
/* ব্রাউজারের নিজস্ব × বোতামটি সরাই — নইলে দুটো বোতাম একটার ঘাড়ে আরেকটা বসে */
.search-wrap input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-go {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; gap: 5px;
  padding: 5px 13px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff;
  font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  cursor: pointer; box-shadow: 0 2px 7px rgba(102,78,56,.22);
}
.search-go.show { display: inline-flex; animation: searchGo .16s ease-out; }
.search-go:hover { filter: brightness(1.07); }
.search-go:active { transform: translateY(-50%) scale(.96); }
@keyframes searchGo {
  from { opacity: 0; transform: translateY(-50%) scale(.9); }
  to   { opacity: 1; transform: translateY(-50%) scale(1); }
}
/* ছোট পর্দায় শুধু চিহ্নটুকু — নইলে লেখার জায়গা থাকে না */
@media (max-width: 560px) {
  .search-go .sg-txt { display: none; }
  .search-wrap input[type="search"] { padding-inline-end: 46px; }
}
/* ছাপার সময় বোতামের দরকার নেই */
@media print { .search-go { display: none !important; } }

/* ---------------- অ্যালার্ট ---------------- */

.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: 14px;
  border: 1px solid transparent; display: flex; gap: 9px; align-items: flex-start; }
/* বার্তার ভেতরের লিংক যেন সাধারণ লেখার মধ্যে হারিয়ে না যায় */
.alert a:not(.btn) { color: inherit; text-decoration: underline; font-weight: 700; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.alert-danger  { background: var(--red-soft);   color: var(--red);   border-color: var(--red); }
.alert-warning { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); }
.alert-info    { background: var(--blue-soft);  color: var(--blue);  border-color: var(--blue); }

/* ---------------- পেজিনেশন ---------------- */

.pagination { display: flex; gap: 5px; padding: 12px 16px; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: grid; place-items: center; font-size: 13.5px;
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination a.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }

/* ---------------- মডাল ---------------- */

.modal-bd {
  position: fixed; inset: 0; background: rgba(102,78,56,.55); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 24px 14px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-bd.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); margin: auto;
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { margin-inline-start: auto; background: none; border: 0; font-size: 22px;
  cursor: pointer; color: var(--text-dim); line-height: 1; }

/* ---- বাংলা / ইংরেজি লেখার বোতাম — উপরের বারে ও প্রতিটি পপ-আপের মাথায় ---- */
.bn-toggle { font-weight: 700; }
.icon-btn.bn-toggle.bn-on,
.icon-btn.bn-toggle.bn-on:hover { background: var(--brand-soft); color: var(--brand); }
.bn-mini {
  margin-inline-start: auto;              /* × এর ঠিক পাশে, ডানদিকে */
  min-width: 34px; height: 30px; padding: 0 9px; border-radius: 8px;
  display: inline-grid; place-items: center;
  font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.bn-mini.bn-on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.bn-mini:hover { filter: brightness(.96); }
.bn-mini + .x { margin-inline-start: 10px; }

/* ---- অর্ডার ফর্ম: আরেকটি ডিজাইন যোগের বোতাম, টেবিলের নিচে ---- */
.add-design {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px dashed var(--border);
}
.add-design .btn { border-style: dashed; border-width: 1.5px; }
.add-design small { flex: 1 1 260px; line-height: 1.6; }

/* ---- খুঁজে বাছাইয়ের তালিকা (ডিজাইনের নাম, কাঠ, একক …) ---- */
.ac-box {
  position: absolute; z-index: 400;
  max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.ac-item {
  padding: 9px 12px; border-radius: 7px; cursor: pointer;
  font-size: 14.5px; line-height: 1.4; white-space: nowrap;
}
.ac-item:hover, .ac-item.on { background: var(--brand-soft); color: var(--brand); }
/* মোবাইলে আঙুলে চাপার মতো বড় */
@media (max-width: 560px) { .ac-item { padding: 12px 14px; font-size: 15.5px; } }
@media print { .ac-box { display: none !important; } }
@media print { .bn-mini { display: none; } }
.modal-body { padding: 18px; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------------- বিবিধ ---------------- */

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.82); font-size: 13px; color: var(--text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95),
              0 4px 10px -3px rgba(102,78,56,.14),
              0 12px 24px -10px rgba(102,78,56,.12);
  transition: box-shadow .25s ease, transform .25s ease, background .2s;
}
.chip:hover { transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95),
              0 8px 18px -5px rgba(102,78,56,.2),
              0 20px 36px -14px rgba(102,78,56,.16); }
.chip.active { background: var(--brand); border-color: rgba(255,255,255,.35); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25),
              0 8px 18px -5px rgba(165,129,60,.5),
              0 20px 38px -14px rgba(165,129,60,.42); }
html[data-theme="dark"] .chip { background: rgba(44,35,26,.82); border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.07), 0 8px 20px -6px rgba(0,0,0,.55); }
.chip:hover { text-decoration: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 14px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; font-weight: 600; }

.thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 36px; }

.progress { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand-2); }

.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.section-title { font-size: 13px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt-0 { margin-top: 0 } .mb-0 { margin-bottom: 0 }
.text-center { text-align: center }

.fab {
  position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 55;
  width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff;
  display: none; place-items: center; font-size: 26px; box-shadow: var(--shadow-lg); border: 0;
}

.backdrop { position: fixed; inset: 0; background: rgba(102,78,56,.5); z-index: 55; display: none; }

/* সাইডবার খোলা থাকলে পেছনের পাতা স্ক্রল বন্ধ */
body.nav-open { overflow: hidden; }

/* টুলটিপ একটু দ্রুত ও স্পষ্ট দেখানোর জন্য কার্সর ইঙ্গিত */
[title] { cursor: pointer; }
input[title], textarea[title], select[title] { cursor: auto; }
.backdrop.open { display: block; }

/* ---------------- মোবাইল ---------------- */

@media (max-width: 980px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-inline-start: 0; }
  #menuBtn { display: grid; }
  .content { padding: 13px; }
  .topbar { padding: 9px 12px; }
  .topbar h1 { font-size: 16px; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .val { font-size: 19px; }
  .stat .ic { width: 34px; height: 34px; font-size: 16px; margin-bottom: 7px; }
  .fab { display: grid; }
  .userchip .info { display: none; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  body { font-size: 14.5px; }
}

/* ---------------- প্রিন্ট ---------------- */

@media print {
  .sidebar, .topbar, .no-print, .fab, .backdrop, .pagination { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12px; }
  .card { box-shadow: none !important; border: 0 !important; margin: 0 !important; }
  table.tbl { min-width: 0 !important; }
  table.tbl th, table.tbl td { border: 1px solid #999 !important; padding: 5px 7px !important; }
  a { color: #000 !important; text-decoration: none !important; }
  @page { margin: 12mm; }
}

/* ---- ভাসমান ভাব: টেবিল ও ভেতরের অংশ স্বচ্ছ থাকুক ---- */
html[data-theme="dark"] table.tbl th { background: rgba(44,35,26,.75); }
.card-head { border-bottom-color: rgba(102,78,56,.07); }
html[data-theme="dark"] .card-head { border-bottom-color: rgba(255,255,255,.07); }
.topbar {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: rgba(255,255,255,.7);
  box-shadow: 0 4px 18px -6px rgba(102,78,56,.12);
}
html[data-theme="dark"] .topbar {
  background: rgba(34,27,19,.78); border-bottom-color: rgba(255,255,255,.07);
  box-shadow: 0 4px 20px -6px rgba(0,0,0,.6);
}
.modal {
  border-radius: 20px;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
              0 30px 70px -18px rgba(102,78,56,.4),
              0 60px 120px -40px rgba(102,78,56,.3);
}
html[data-theme="dark"] .modal { background: rgba(34,27,19,.94); }

/* যেসব ডিভাইসে ঝাপসা করার সুবিধা নেই, সেখানে ঘোলাটে না দেখিয়ে ঘন রং */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .stat, .chip, .btn-light, .topbar, .modal { background: var(--surface); }
}
table.tbl th { background: rgba(248,250,252,.72); }
html[data-theme="dark"] table.tbl th { background: rgba(44,35,26,.76); }
.icon-btn {
  background: rgba(255,255,255,.8); border-color: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 4px 10px -3px rgba(102,78,56,.14);
  transition: transform .2s, box-shadow .2s;
}
.icon-btn:hover { background: #fff; transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 8px 18px -5px rgba(102,78,56,.2); }
html[data-theme="dark"] .icon-btn { background: rgba(44,35,26,.85); border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.07), 0 4px 12px -3px rgba(0,0,0,.5); }
html[data-theme="dark"] .icon-btn:hover { background: rgba(58,47,34,.9); }
.userchip { background: rgba(255,255,255,.8); border-color: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 4px 12px -3px rgba(102,78,56,.14); }
html[data-theme="dark"] .userchip { background: rgba(44,35,26,.85); border-color: rgba(255,255,255,.1); }
.dropdown-menu {
  background: rgba(255,255,255,.92); border-color: rgba(255,255,255,.85); border-radius: 16px;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
              0 20px 44px -12px rgba(102,78,56,.28), 0 40px 80px -30px rgba(102,78,56,.22);
}
html[data-theme="dark"] .dropdown-menu { background: rgba(34,27,19,.95); border-color: rgba(255,255,255,.09); }
.alert { border-radius: 14px; box-shadow: 0 6px 16px -6px rgba(102,78,56,.14); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dropdown-menu, .icon-btn, .userchip { background: var(--surface); }
}
/* ---- অনুমতির স্তর অনুযায়ী বোতাম লুকানো ----
   সার্ভারেও পাহারা আছে; এটা শুধু যেন অকেজো বোতাম চোখে না পড়ে */
body.perm-view .content .fab,
body.perm-view .content form[method="post"] button[type="submit"],
body.perm-view .content form[method="post"] .btn[type="submit"],
body.perm-view .content a[data-confirm],
body.perm-view .content button[data-confirm],
body.perm-view .content [data-perm-edit] {
  display: none !important;
}
body.perm-nodel .content a[href*="act=del"],
body.perm-nodel .content .btn-red[data-confirm],
body.perm-nodel .content [data-perm-del] {
  display: none !important;
}
/* “দেখা ও যোগ” স্তর — নতুন দিতে পারবে, কিন্তু সম্পাদনার ✏️ বোতামগুলো নয়।
   যেসব বোতাম নতুন কিছু বানায় (🛒 নতুন অর্ডার, 💵 পেমেন্ট) সেগুলোয়
   data-perm-add থাকে — এই স্তরে ওগুলো থেকে যাবে, শুধু শুধু-দেখায় লুকাবে। */
body.perm-noedit .content [data-perm-edit] {
  display: none !important;
}
body.perm-view .content [data-perm-add] {
  display: none !important;
}
/* কাস্টমারের আইডি — তালিকায়, বিস্তারিত পাতায় ও বোর্ডের কার্ডে একই চেহারা */
.cust-id {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px; opacity: .8;
  white-space: nowrap;
}

/* ---- ড্যাশবোর্ডের উপরের অংশ: বাঁয়ে ঘরগুলো, ডানে পাওনার হিসাব ----
   চওড়া পর্দায় ডান পাশের ফাঁকা জায়গাটা কাজে লাগে; ১২৮০px-এর নিচে
   আগের মতোই একটার নিচে আরেকটা বসে। */
@media (min-width: 1800px) {
  .dash-top  { display: grid; grid-template-columns: minmax(0, 1fr) minmax(520px, 34%);
               gap: 16px; align-items: start; }
  .dash-main { min-width: 0; }
  .dash-side { min-width: 0; }
  .dash-side .card { margin-bottom: 16px; }
  /* বাঁ পাশে ঘরগুলো সবসময় চারটি করে — নইলে সারি ভেঙে এলোমেলো দেখায় */
  .dash-main .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- বিলের চেয়ে বেশি টাকা বসে গেছে — সারিটি লালচে, বাঁয়ে দাগ ---- */
tr.row-over { background: var(--red-soft) !important; }
tr.row-over td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ---- কাজের নোট: সব পাতার মাথায় মনে করিয়ে দেওয়ার পট্টি ----
   পট্টিটা চিকন রাখা হয়েছে — রোজ সব পাতায় থাকে, জায়গা খেলে চলবে না */
.note-bar { align-items: flex-start; flex-wrap: wrap; padding: 7px 12px; gap: 7px; margin-bottom: 11px; }
.note-bar .note-head { font-size: 13px; }
.note-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 3px 0; border-top: 1px dashed var(--border);
  margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.5;
}
.note-line:first-of-type { border-top: 0; margin-top: 2px; }
.note-line .note-txt { flex: 1 1 200px; min-width: 0; font-weight: 600; }
.note-line.done .note-txt { font-weight: 400; text-decoration: line-through; }
.note-line .note-act { display: inline; margin: 0; }
.note-line .note-who { font-size: 11px; opacity: .85; white-space: nowrap; }
.note-list { max-height: 46vh; overflow-y: auto; }

/* পট্টির ভেতরের বোতাম-ব্যাজগুলো ছোট, যাতে সারি একটানেই শেষ হয় */
.note-bar .btn-sm { min-height: 0; padding: 2px 9px; font-size: 11.5px; border-radius: 7px; }
.note-bar .badge  { padding: 1px 8px; font-size: 11px; }

/* ---- বাকিতে ডেলিভারি: মাল গেছে, টাকা আসেনি — বাঁয়ে লাল দাগ ---- */
tr.row-credit td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ---- কেন দেরি হচ্ছে: অর্ডারের সারিতে ছোট্ট টুকে রাখা কথা ---- */
.delay-note {
  margin-top: 3px; font-size: 11.5px; font-weight: 400; line-height: 1.45;
  color: var(--brand); background: var(--brand-soft);
  border-radius: 7px; padding: 2px 7px; max-width: 220px;
  white-space: normal; word-break: break-word;
}

/* ---- দেরি হয়ে যাওয়া অর্ডার: তালিকায় সারিটাই লালচে, বাঁয়ে লাল দাগ ---- */
tr.row-late { background: var(--red-soft) !important; }
tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.row-late:hover { background: var(--red-soft) !important; filter: brightness(.98); }

/* ---- সংযুক্ত সারি: পেমেন্ট/ছাড় আর তার অর্ডার একসঙ্গে জ্বলে ওঠে ---- */
tr.row-linked { background: var(--brand-soft) !important; }
tr.row-linked td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
@keyframes rowFlash {
  0%, 100% { background: transparent; }
  20%, 70% { background: var(--brand-soft); }
}
tr.row-flash { animation: rowFlash 1.4s ease-in-out; }
tr[data-ord] { cursor: default; }

/* ---- ছকের ভেতরের ক্লিকযোগ্য ঘর — চাপলে বিস্তারিত ---- */
.cell-link {
  color: inherit; text-decoration: none; cursor: pointer;
  border-bottom: 1px dotted var(--border); padding-bottom: 1px;
}
.cell-link:hover { color: var(--brand); border-bottom-color: currentColor; }

/* ---- পাশের ছোট "কপি" বোতাম (assets/js/app.js কাজটা করে) ---- */
.copy-chip {
  display: inline-block; vertical-align: middle; margin-inline-start: 5px;
  padding: 1px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  font-family: inherit; font-size: 11.5px; font-weight: 500; line-height: 1.65;
}
.copy-chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.copy-chip.ok    { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.copy-chip.bad   { background: var(--red-soft);   border-color: var(--red);   color: var(--red); }

/* ফোনে আঙুলের মাপে — আর কার্ডের সারিতে যেন নিচে নেমে না যায় */
@media (max-width: 560px) {
  .copy-chip { padding: 3px 11px; font-size: 12px; }
}

/* ---- কাজের বোর্ডের কার্ড — পরপর তিনটি নরম রঙ, যাতে আলাদা করে চোখে পড়ে ---- */
.job-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 10px 11px;
  background: var(--surface-2);
}
.job-card:nth-child(3n+1) { background: var(--row-c1); }
.job-card:nth-child(3n+2) { background: var(--row-c2); }
.job-card:nth-child(3n+3) { background: var(--row-c3); }

/* ---- কাজের বোর্ডের কার্ড: কার কাজ ও কত টাকা, এক নজরে ---- */
.card-cust {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px;
}
.card-cust > a {
  font-size: 13.5px; font-weight: 700; text-decoration: none;
  color: var(--brand); background: var(--brand-soft);
  border-radius: 7px; padding: 2px 8px;
}
.card-amt {
  margin-top: 4px; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   ফোনে কাজ করা সহজ করা — নতুন কাস্টমার, অর্ডার, পেমেন্ট
   ----------------------------------------------------------------
   পুরো অংশটি ৫৬০px-এর ছোট পর্দার জন্য। ল্যাপটপ/ডেস্কটপে এই নিয়মগুলো
   চালুই হয় না, তাই ওখানে চেহারা বা আচরণ কিছুই বদলায় না।
   ================================================================ */
@media (max-width: 560px) {

  /* ---- পপ-আপ পুরো পর্দা জুড়ে ----
     আগে পপ-আপ মাঝখানে ভাসত, কিবোর্ড উঠলে সেভ বোতাম ঢাকা পড়ত। */
  .modal-bd { padding: 0; align-items: stretch; }
  .modal {
    max-width: none; width: 100%; margin: 0;
    border-radius: 0; min-height: 100%;
    display: flex; flex-direction: column;
    background: var(--surface);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

  /* মাথা ও পায়ের পাতা আটকে থাকবে — স্ক্রল করলেও সেভ বোতাম চোখের সামনে */
  .modal-head {
    position: sticky; top: 0; z-index: 3;
    background: var(--surface); padding: 13px 14px;
  }
  .modal-body { flex: 1 1 auto; padding: 14px; }
  .modal-foot {
    position: sticky; bottom: 0; z-index: 3;
    background: var(--surface); padding: 10px 14px;
    box-shadow: 0 -6px 16px -9px rgba(102,78,56,.45);
    justify-content: stretch;
  }
  .modal-foot .btn { flex: 1 1 130px; justify-content: center; }

  /* ---- ঘরের লেখা ১৬px ----
     ১৬-এর নিচে হলে আইফোন নিজে থেকে জুম করে ফেলে, পর্দা লাফায়। */
  input[type=text], input[type=number], input[type=date], input[type=time], input[type=month],
  input[type=password], input[type=search], input[type=tel], input[type=email], input[type=file],
  select, textarea { font-size: 16px; padding: 11px 12px; }
  select { padding-inline-end: 46px; }

  /* ---- আঙুলের মাপে বোতাম ---- */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; padding: 7px 12px; font-size: 13.5px; }
  .pay-x { height: 46px; }
}

/* ================================================================
   “কে লগইন করা আছে” — শুধু ছোট পর্দার জন্য
   ----------------------------------------------------------------
   বড় পর্দায় নামটা উপরের বারেই দেখা যায়, তাই সেখানে এই অংশটি
   display:none — অর্থাৎ ল্যাপটপে জিনিসটা থাকেই না।
   ================================================================ */
.whoami { display: none; }

@media (max-width: 860px) {
  .whoami {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 18px; border-bottom: 1px solid var(--border);
    background: var(--surface-2);
  }
  .whoami .av {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: grid; place-items: center; font-size: 15px; font-weight: 700;
  }
  .whoami .t { min-width: 0; }
  .whoami .t b {
    display: block; font-size: 14px; line-height: 1.25; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .whoami .t small {
    display: block; font-size: 11.5px; color: var(--text-dim); line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* মেনুর ভেতরেরটি একদম উপরে, ধারে ধার মিলিয়ে */
  .dropdown-menu .whoami {
    margin: -6px -6px 6px; border-radius: 12px 12px 0 0;
  }
}

/* ================================================================
   ফোনে সঞ্চয় অ্যাপের মতো সাজানো — ড্যাশবোর্ড, কাস্টমার ও অর্ডার তালিকা
   ----------------------------------------------------------------
   বড় পর্দায় এর কিছুই চালু হয় না: নতুন অংশগুলো display:none, আর
   টেবিল থেকে কার্ডে বদল শুধু নিচের @media-র ভেতরে।
   ================================================================ */
.m-hero, .m-quick, .m-search { display: none; }

@media (max-width: 560px) {

  /* ---- ড্যাশবোর্ড: বড় রঙিন কার্ডে মোট পাওনা ---- */
  .m-hero {
    display: block; margin-bottom: 12px; padding: 16px 18px; border-radius: 18px;
    background: linear-gradient(135deg, var(--brand) 0%, #6f5020 100%);
    color: #fff; text-decoration: none;
    box-shadow: 0 12px 26px -10px rgba(102,78,56,.55);
  }
  .m-hero:hover { color: #fff; text-decoration: none; }
  .m-hero-lbl { display: block; font-size: 13px; opacity: .92; }
  .m-hero-val {
    display: block; margin-top: 4px;
    font-family: var(--num-font); font-size: 30px; font-weight: 700;
    line-height: 1.3; letter-spacing: .5px; font-variant-numeric: tabular-nums;
  }
  .m-hero-sub { display: block; font-size: 12px; opacity: .8; margin-top: 2px; }

  /* ছোট কার্ড পাশাপাশি দুটো করে; উপরে বড় কার্ডে যা আছে তা নিচে আর দেখাই না */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .stats .m-hide { display: none; }

  .m-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .m-quick .btn { width: 100%; justify-content: center; font-size: 15px; padding: 12px 10px; }
  .m-search { display: block; margin-bottom: 14px; }

  /* ---- টেবিল থেকে কার্ড ----
     চওড়া টেবিল ফোনে ডানে-বাঁয়ে টানতে হতো; এখন প্রতিটি সারি একটি কার্ড। */
  .table-wrap.stick { max-height: none; overflow: visible; }
  .table-wrap.stick table.tbl tfoot td { position: static; box-shadow: none; }

  /* !important — কোনো কোনো টেবিলে inline style-এ min-width দেওয়া আছে */
  table.m-cards { min-width: 0 !important; }
  table.m-cards thead { display: none; }
  table.m-cards, table.m-cards tfoot { display: block; }
  table.m-cards tbody { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  table.m-cards tbody tr,
  table.m-cards tfoot tr {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 8px;
    padding: 12px 13px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); box-shadow: 0 2px 8px -4px rgba(102,78,56,.18);
  }
  table.m-cards tfoot tr { margin: 0 10px 10px; background: var(--surface-2); }
  /* ফোনে প্রতিটি কার্ড আলাদা করে চেনা যাক — পরপর তিনটি নরম রঙ ঘুরেফিরে আসে */
  table.m-cards tbody tr:nth-child(3n+1) { background: var(--row-c1); }
  table.m-cards tbody tr:nth-child(3n+2) { background: var(--row-c2); }
  table.m-cards tbody tr:nth-child(3n+3) { background: var(--row-c3); }
  /* বাকিতে ডেলিভারি — ফোনে গোটা কার্ডটাই লালচে, দূর থেকেই চোখে পড়ে */
  table.m-cards tbody tr.row-credit,
  table.m-auto  tbody tr.row-credit { background: var(--red-soft); border-color: var(--red); }
  table.m-cards td,
  table.m-cards tfoot td { display: block; padding: 0; border: 0; min-width: 0; background: none; }
  table.m-cards td.num { text-align: start; font-size: 14.5px; }

  /* সংখ্যার ওপরে ছোট করে তার নাম — টেবিলের শিরোনাম তো আর নেই */
  table.m-cards td[data-lbl]::before {
    content: attr(data-lbl); display: block;
    font-family: inherit; font-size: 11px; font-weight: 500; letter-spacing: 0;
    color: var(--text-dim);
  }

  /* বোতামের পাশে লেখা — ফোনে কার্সর রাখার উপায় নেই, তাই আগেই লিখে দেওয়া */
  table.m-cards .btn[data-lbl]::after { content: attr(data-lbl); font-size: 12.5px; font-weight: 600; }
  /* সমান মাপে তিনটি করে — নইলে শেষ বোতামটা (প্রায়ই লাল "মুছুন") পুরো চওড়া হয়ে যেত */
  table.m-cards td.c-act,
  table.m-cards td.o-act {
    grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    margin-top: 4px; padding-top: 9px; border-top: 1px dashed var(--border);
    white-space: normal;
  }
  table.m-cards td.c-act .btn,
  table.m-cards td.o-act .btn { width: 100%; min-width: 0; padding: 7px 4px; gap: 4px; font-size: 12.5px; }
  table.m-cards tfoot td.c-act,
  table.m-cards tfoot td.o-act,
  table.m-cards tfoot td.o-st { display: none; }

  /* কাস্টমার কার্ড: বাঁয়ে নাম-মোবাইল, ডানে বাকি বড় করে */
  table.m-cust tbody .c-name { grid-column: 1 / 5; grid-row: 1; }
  table.m-cust tbody .c-due  { grid-column: 5 / 7; grid-row: 1 / 3; align-self: center;
                               text-align: end; font-size: 18px; }
  table.m-cust tbody .c-mob  { grid-column: 1 / 5; grid-row: 2; padding-inline-start: 45px; }
  table.m-cust tbody .c-id   { grid-column: 1 / 3; grid-row: 3; }
  table.m-cust tbody .c-biz  { grid-column: 3 / 7; grid-row: 3; text-align: end;
                               font-size: 12.5px; color: var(--text-dim);
                               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.m-cust tbody .c-ord  { grid-column: 1 / 3; grid-row: 4; }
  table.m-cust tbody .c-bill { grid-column: 3 / 5; grid-row: 4; }
  table.m-cust tbody .c-paid { grid-column: 5 / 7; grid-row: 4; }
  table.m-cust tbody .c-act  { grid-row: 5; }
  table.m-cust tfoot tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  table.m-cust tfoot .c-totlbl { grid-column: 1 / -1; }

  /* অর্ডার কার্ড: উপরে নম্বর ও অবস্থা, নিচে ডেলিভারি-মোট-বাকি */
  table.m-ord tbody .o-no   { grid-column: 1 / 4; grid-row: 1; }
  table.m-ord tbody .o-st   { grid-column: 4 / 7; grid-row: 1; text-align: end; }
  table.m-ord tbody .o-cust { grid-column: 1 / -1; grid-row: 2; }
  table.m-ord tbody .o-des  { grid-column: 1 / -1; grid-row: 3; font-size: 13px; color: var(--text-dim); }
  table.m-ord tbody .o-dlv  { grid-column: 1 / 3; grid-row: 4; font-size: 13px; white-space: normal; }
  table.m-ord tbody .o-tot  { grid-column: 3 / 5; grid-row: 4; }
  table.m-ord tbody .o-due  { grid-column: 5 / 7; grid-row: 4; text-align: end; }
  /* নিচের মোটের সারি — উপরে লেখা, নিচে দুই ঘরে মোট ও বাকি */
  table.m-ord tfoot tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.m-ord tfoot .o-totlbl { grid-column: 1 / -1; }
  table.m-ord tbody .o-act  { grid-row: 5; }
  table.m-ord .o-st .st-pick { width: auto; max-width: 100%; }

  /* শুধু-আইকনের বোতামে পাশে লেখা — সব পাতায় (app.js-এর labelIconButtons() data-lbl বসায়) */
  .content .btn[data-lbl]::after { content: attr(data-lbl); font-size: 12.5px; font-weight: 600; }

  /* ড্যাশবোর্ডের আয়-ব্যয় সারসংক্ষেপ: উপরে সময় ও রিপোর্ট, নিচে আয়-ব্যয়-নিট পাশাপাশি */
  table.m-sum tbody .s-per { grid-column: 1 / 5; grid-row: 1; }
  table.m-sum tbody .s-rep { grid-column: 5 / 7; grid-row: 1; text-align: end; align-self: center; }
  table.m-sum tbody .s-in  { grid-column: 1 / 3; grid-row: 2; }
  table.m-sum tbody .s-out { grid-column: 3 / 5; grid-row: 2; }
  table.m-sum tbody .s-net { grid-column: 5 / 7; grid-row: 2; text-align: end; }
  table.m-sum tbody .s-net b { font-size: 14.5px !important; }

  /* ---- বাকি সব টেবিল: সারি একটি কার্ড, প্রতিটি লাইনে "শিরোনাম ····· মান" ----
     শিরোনামগুলো app.js-এর autoCardTables() টেবিলের মাথা থেকে data-lbl-এ বসায়,
     তাই প্রতিটি পাতার কোড আলাদা করে বদলাতে হয়নি। */
  table.m-auto { min-width: 0 !important; }
  table.m-auto thead { display: none; }
  table.m-auto, table.m-auto tfoot { display: block; }
  table.m-auto tbody { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
  table.m-auto tr {
    display: block; padding: 4px 12px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  }
  /* প্রতিটি কার্ড আলাদা করে চেনা যাক — পরপর তিনটি নরম রঙ ঘুরেফিরে আসে */
  table.m-auto tbody tr:nth-child(3n+1) { background: var(--row-c1); }
  table.m-auto tbody tr:nth-child(3n+2) { background: var(--row-c2); }
  table.m-auto tbody tr:nth-child(3n+3) { background: var(--row-c3); }
  table.m-auto tfoot tr { margin: 0 8px 8px; background: var(--surface-2); }
  table.m-auto td,
  table.m-auto tfoot td {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px;
    padding: 7px 0; border: 0; border-bottom: 1px dashed var(--border);
    text-align: end; white-space: normal; background: none; position: static; box-shadow: none;
  }
  table.m-auto td:last-child { border-bottom: 0; }
  table.m-auto td:empty { display: none; }
  /* শিরোনাম বাঁয়ে, আর ঘরের সব মান (একাধিক হলেও) ডানে একসঙ্গে; না আঁটলে নিচে নামে */
  table.m-auto td[data-lbl]::before {
    content: attr(data-lbl); flex: 0 0 auto; max-width: 45%; text-align: start; margin-inline-end: auto;
    font-family: inherit; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-dim);
  }
  table.m-auto td:not([data-lbl]) { justify-content: flex-start; text-align: start; }
  /* বোতামের ঘর: শিরোনাম উপরের লাইনে, বোতামগুলো বাঁ থেকে পাশাপাশি সাজানো */
  table.m-auto td:has(> .btn) { justify-content: flex-start; gap: 6px; }
  table.m-auto td:has(> .btn)::before { flex: 0 0 100%; max-width: 100%; margin: 0 0 2px; }

  /* ---- পাতা যেন পর্দার চেয়ে চওড়া না হয় ----
     দুই/তিন কলামের ঘরের ভেতরে চওড়া টেবিল (min-width 520px) থাকলে ঘরটা
     ছোট হতে পারত না — গোটা পাতা ৫৩৫px হয়ে ডানে ফাঁকা জায়গা তৈরি হতো।
     min-width:0 দিলে টেবিল নিজের ঘরের ভেতরেই ডানে-বাঁয়ে সরে। */
  .grid-2 > *, .grid-3 > * { min-width: 0; }
  /* বোতামের সারি নিজের ঘরের চেয়ে চওড়া হবে না — না আঁটলে নিচের লাইনে নামবে
     (কিছু জায়গায় inline style-এ flex:0 0 auto দেওয়া, তাই max-width দিয়েই আটকাই) */
  .btn-group { max-width: 100%; }
  .toolbar .field { max-width: 100%; }
  /* স্ক্রল-খোলস (.table-wrap) ছাড়া বসানো টেবিল — ৫২০px-এর নিয়ম ফোনে বাদ */
  :not(.table-wrap) > table.tbl { min-width: 0; }

  /* ---- উপরের বার: শেষ আইকন (নিজের ছবি) যেন পর্দার বাইরে না যায় ---- */
  .topbar { gap: 8px; padding: 8px 10px; }
  .topbar > .icon-btn { width: 34px; height: 34px; }
  .top-actions { gap: 4px; }
  .top-actions .icon-btn { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
  .top-actions .userchip { padding: 3px; }
  .top-actions .userchip .av { width: 26px; height: 26px; font-size: 12px; }
  /* সাহায্য ☰ মেনুতেও আছে — ফোনের সরু বারে জায়গা বাঁচাতে এখানে দেখাই না */
  .top-actions a[href="index.php?page=help"] { display: none; }
}

/* ---- ফোনে ডেস্কটপ ভিউ / মোবাইল ভিউ বদল ----
   বড় পর্দায় (ল্যাপটপ) এর কোনোটাই দেখা যায় না। */
.view-to-desktop, .view-to-mobile, .back-mobile { display: none !important; }
@media (max-width: 860px) {
  html:not(.force-desktop) .view-to-desktop { display: flex !important; }
}
html.force-desktop .view-to-mobile { display: flex !important; }
/* ডেস্কটপ ভিউতে ফোন পাতাটা ছোট করে দেখায়, তাই ফেরার বোতাম ইচ্ছে করেই বড় —
   শুধু টাচ-স্ক্রিনে (ফোন/ট্যাব) দেখাবে */
@media (hover: none) and (pointer: coarse) {
  html.force-desktop .back-mobile {
    display: flex !important; position: fixed; right: 26px; bottom: 26px; z-index: 300;
    align-items: center; gap: 10px; padding: 20px 36px; border: 0; border-radius: 999px;
    background: var(--brand); color: #fff; font-family: inherit; font-size: 38px; font-weight: 700;
    box-shadow: 0 16px 36px -10px rgba(0,0,0,.45); cursor: pointer;
  }
}

/* খুব সরু ফোন (৩২০–৩৮০px, যেমন পুরনো iPhone SE) — ← বোতাম থাকা পাতাতেও যেন
   শেষ আইকন (নিজের ছবি) পর্দার ভেতরে থাকে */
@media (max-width: 380px) {
  .topbar > .icon-btn { width: 30px; height: 30px; }
  .top-actions { gap: 3px; }
  .top-actions .icon-btn { width: 30px; height: 30px; font-size: 14px; }
}
/* উপরের সতর্ক-বার্তা ও আপডেটের পটির বোতাম সবসময় থাকবে */
body.perm-view .content .no-ro,
body.perm-view .content .no-ro button,
body.perm-view .content .alert button,
body.perm-view .content .alert a { display: inline-flex !important; }
body.perm-view .content .alert { display: flex !important; }
/* কারও চোখে দেখার পট্টির “✏️ কাজ করার মোড” বোতামটি ফর্মের ভেতরের জমা-বোতাম —
   উপরের form[method=post] button[type=submit] নিয়মটা বেশি জোরালো বলে ওটাকেও লুকিয়ে ফেলত।
   পট্টির বোতাম সবসময় দেখা যাবে। */
body.perm-view .content .no-ro form[method="post"] button[type="submit"],
body.perm-view .content .no-ro button[data-confirm] { display: inline-flex !important; }
/* ---- কে এখন অনলাইন ---- */
.pres { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.pres i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.pres-on  { color: var(--green); }
.pres-on i  { background: var(--green); box-shadow: 0 0 0 3px rgba(75,139,111,.22); animation: presPulse 2s infinite; }
.pres-off { color: var(--text-dim); }
.pres-off i { background: #c3b6a5; }
@keyframes presPulse {
  0%   { box-shadow: 0 0 0 0   rgba(75,139,111,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(75,139,111,0); }
  100% { box-shadow: 0 0 0 0   rgba(75,139,111,0); }
}
@media (prefers-reduced-motion: reduce) { .pres-on i { animation: none; } }
/* লাইভ অনুসরণ চালু আছে — শুধু জানানোর চিহ্ন, চাপার জিনিস নয় */
.live-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid var(--red); font-size: 12.5px; font-weight: 700;
  white-space: nowrap; animation: followPulse 1.8s infinite;
}
@keyframes followPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,99,92,.5); }
  60%      { box-shadow: 0 0 0 8px rgba(196,99,92,0); }
}
@media (prefers-reduced-motion: reduce) { .live-tag { animation: none; } }