/* ============================================================================
   Super Admin Panel — একটিমাত্র স্টাইলশিট
   বাইরের কোনো CSS framework টানা হয় না, তাই ইন্টারনেট ছাড়াও পুরো প্যানেল
   ঠিক যেমন দেখতে তেমনই থাকে, আর পাতা খোলে সাথে সাথে।
   ========================================================================== */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #fafbff;
  --border:    #e4e8f2;
  --border-2:  #eef1f8;

  --text:      #101828;
  --text-dim:  #667085;
  --text-mute: #98a2b3;

  --brand:     #4f46e5;
  --brand-2:   #6366f1;
  --brand-soft:#eef2ff;

  --ok:        #059669;
  --ok-soft:   #ecfdf5;
  --warn:      #d97706;
  --warn-soft: #fffbeb;
  --bad:       #dc2626;
  --bad-soft:  #fef2f2;
  --info:      #0284c7;
  --info-soft: #f0f9ff;

  --side:      #101a33;
  --side-2:    #16213f;
  --side-text: #b9c2d9;

  --r:   14px;
  --r-s: 10px;
  --shadow:   0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.14);
  --shadow-l: 0 4px 12px rgba(16,24,40,.07), 0 24px 48px -20px rgba(16,24,40,.22);

  --sidebar-w: 258px;
}

* { box-sizing: border-box; }

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

body {
  font: 15px/1.65 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16.5px; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.ic { flex: none; vertical-align: -.18em; }

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

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

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(178deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar .brand .mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand-2), #a78bfa);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(99,102,241,.42);
}
.sidebar .brand b { display: block; font-size: 15.5px; line-height: 1.25; }
.sidebar .brand small { display: block; font-size: 11.5px; color: #8896b8; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: #64749b; margin: 16px 10px 7px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; margin-bottom: 2px;
  border-radius: var(--r-s);
  color: var(--side-text); font-size: 14.4px; font-weight: 500;
  transition: background .13s, color .13s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on {
  background: linear-gradient(90deg, rgba(99,102,241,.24), rgba(99,102,241,.08));
  color: #fff;
  box-shadow: inset 2.5px 0 0 var(--brand-2);
}
.nav a .count {
  margin-left: auto; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 20px;
}

.side-foot {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px; color: #64749b;
}
.side-foot .me { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.side-foot .av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.side-foot .me b { display: block; color: #e6ebf7; font-size: 13.5px; }
.side-foot .me span { display: block; font-size: 11.5px; }

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

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 26px;
  display: flex; align-items: center; gap: 14px;
}
.topbar h1 { font-size: 19.5px; margin: 0; }
.topbar .sub { font-size: 12.5px; color: var(--text-dim); }
.topbar .spacer { flex: 1; }

.burger {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--r-s); padding: 7px; cursor: pointer; color: var(--text);
}

.page { padding: 24px 26px 60px; flex: 1; }
.page > .wrap { max-width: 1360px; margin: 0 auto; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card > .head {
  padding: 15px 18px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 10px;
}
.card > .head h3 { margin: 0; }
.card > .head .spacer { flex: 1; }
.card > .body { padding: 18px; }
.card > .body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

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

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 13px;
}
.stat .ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.stat .n { font-size: 25px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat .t { font-size: 12.8px; color: var(--text-dim); }
.stat.ok   .ico { background: var(--ok-soft);   color: var(--ok); }
.stat.warn .ico { background: var(--warn-soft); color: var(--warn); }
.stat.info .ico { background: var(--info-soft); color: var(--info); }
.stat.bad  .ico { background: var(--bad-soft);  color: var(--bad); }

/* ------------------------------------------------------- সফটওয়্যারের কার্ড */

.app-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 17px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
.app-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent, var(--brand)); opacity: .85;
}
.app-card:hover { box-shadow: var(--shadow-l); transform: translateY(-2px); border-color: #d7ddee; }
.app-card.off { opacity: .68; }
.app-card.off::before { background: #cbd5e1; }

.app-card .top { display: flex; gap: 13px; align-items: flex-start; }
.app-badge {
  border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--badge, #4f46e5) 14%, #fff);
  color: var(--badge, #4f46e5);
  font-weight: 700; line-height: 1;
  border: 1px solid color-mix(in srgb, var(--badge, #4f46e5) 22%, #fff);
}
.app-badge.has-img { background: #fff; padding: 5px; }
.app-badge img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

.app-card h3 { margin: 0 0 2px; font-size: 16px; }
.app-card .meta { font-size: 12.3px; color: var(--text-mute); }
.app-card .desc {
  font-size: 13.4px; color: var(--text-dim); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em;
}
.app-card .foot { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.app-card .foot form { display: contents; }
.app-card .lastseen {
  font-size: 11.8px; color: var(--text-mute);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* কার্ডের ভেতরের ছোট সংখ্যাগুলো — "কতজনকে দেওয়া", "কত সমস্যা" */
.count-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  border-top: 1px solid var(--border-2); padding-top: 12px; margin-top: auto;
}
.count-row .cnt { text-align: center; }
.count-row .cnt b {
  display: block; font-size: 19px; font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; color: var(--text);
}
.count-row .cnt span { display: block; font-size: 10.8px; color: var(--text-mute); line-height: 1.35; }
.count-row .cnt.ok   b { color: var(--ok); }
.count-row .cnt.warn b { color: var(--warn); }
.count-row .cnt.bad  b { color: var(--bad); }

/* পুরো কার্ডটাই যখন একটা লিংক (ড্যাশবোর্ডের পণ্যের কার্ড) */
a.link-card { color: inherit; text-decoration: none; }
a.link-card:hover { text-decoration: none; }
a.link-card h3 { color: var(--text); }

.nav a .count.bad { background: rgba(239,68,68,.28); color: #fecaca; }

.issue-feed li { align-items: flex-start; }

/* জায়গা কতটা ভরেছে — ডেটাবেজ/সাবডোমেইনের সীমা */
.meter { height: 7px; border-radius: 10px; background: var(--border-2); overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; border-radius: 10px; background: var(--ok); }
.meter span.warn { background: var(--warn); }
.meter span.bad  { background: var(--bad); }

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

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.6px; font-weight: 600; padding: 2.5px 9px; border-radius: 20px;
  background: #f1f3f9; color: var(--text-dim); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok);   border-color: #b9f0d8; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde9b8; }
.badge.bad  { background: var(--bad-soft);  color: var(--bad);  border-color: #fbd0d0; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #c2e6fb; }
.badge.brand{ background: var(--brand-soft);color: var(--brand);border-color: #d7dbfb; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot.pulse { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; opacity: 1 } 70% { box-shadow: 0 0 0 6px transparent; opacity: .6 } 100% { opacity: 1 } }

/* ----------------------------------------------------------------- বোতাম */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8.5px 14px; border-radius: var(--r-s);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .13s, border-color .13s, box-shadow .13s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #d3dae9; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(79,70,229,.55);
}
.btn-primary:hover { background: linear-gradient(180deg, #6f6bf0, #4a41e0); color: #fff; }

.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: #f1f3f9; color: var(--text); }

.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

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

.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13.4px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12.3px; color: var(--text-dim); margin-top: 5px; }

/* ⚠ input:not([type]) জরুরি — type না লেখা ঘরও ব্রাউজারের কাছে "text", কিন্তু
   [type=text] নির্বাচক সেগুলো ধরে না। বাদ দিলে নাম/ক্যাটাগরির মতো ঘরগুলো ছোট,
   সাজানো-ছাড়া বাক্স হয়ে যেত (আগে ঠিক এটাই হচ্ছিল)। */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 9.5px 12px;
  border: 1px solid var(--border); border-radius: var(--r-s);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14.3px;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3.5px rgba(99,102,241,.14);
}
input[type=color] { width: 54px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-s); background: #fff; }
textarea { min-height: 92px; resize: vertical; }
input[readonly] { background: #f7f8fc; color: var(--text-dim); }

.row { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.check span small { display: block; font-size: 12.2px; color: var(--text-dim); font-weight: 400; }

.switch-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.switch-list .check {
  border: 1px solid var(--border); border-radius: var(--r-s);
  padding: 10px 12px; background: var(--surface-2);
}
.switch-list .check:hover { border-color: #cfd6ea; }

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

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.tbl th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); font-weight: 700; background: var(--surface-2);
  position: sticky; top: 0; white-space: nowrap;
}
table.tbl tbody tr:hover { background: #fafbff; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.actions { text-align: right; white-space: nowrap; }
table.tbl td.actions form { display: inline; }

/* --------------------------------------------------------------- বার্তা */

.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--r-s); margin-bottom: 15px;
  border: 1px solid; font-size: 14px;
}
.alert.ok    { background: var(--ok-soft);   border-color: #a7f0cd; color: #065f46; }
.alert.error { background: var(--bad-soft);  border-color: #fbc9c9; color: #991b1b; }
.alert.warn  { background: var(--warn-soft); border-color: #fbe1a8; color: #92400e; }
.alert.info  { background: var(--info-soft); border-color: #bae2fb; color: #075985; }
.alert b { display: block; }

.empty { text-align: center; padding: 46px 20px; color: var(--text-dim); }
.empty .ic { color: var(--text-mute); margin-bottom: 10px; }
.empty h3 { color: var(--text); }

/* ------------------------------------------------------------- লগ / ফিড */

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border-2); font-size: 13.8px; }
.feed li:last-child { border-bottom: none; }
.feed .fi {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: #f1f3f9; color: var(--text-dim);
}
.feed .fi.ok   { background: var(--ok-soft);   color: var(--ok); }
.feed .fi.warn { background: var(--warn-soft); color: var(--warn); }
.feed .fi.bad  { background: var(--bad-soft);  color: var(--bad); }
.feed .fi.info { background: var(--info-soft); color: var(--info); }
.feed .txt { min-width: 0; }
.feed .txt b { font-weight: 600; }
.feed .txt small { display: block; color: var(--text-mute); font-size: 12.1px; }

/* --------------------------------------------------------------- টুকিটাকি */

.muted { color: var(--text-dim); }
.small { font-size: 12.8px; }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.8px; }
.mb0 { margin-bottom: 0 } .mb1 { margin-bottom: 8px } .mb2 { margin-bottom: 16px } .mb3 { margin-bottom: 24px }
.mt2 { margin-top: 16px } .mt3 { margin-top: 24px }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copybox {
  display: flex; gap: 8px; align-items: stretch;
}
.copybox input { font-family: ui-monospace, Consolas, monospace; font-size: 12.6px; }

pre.code {
  background: #0f172a; color: #e2e8f0; padding: 15px 17px; border-radius: var(--r-s);
  overflow-x: auto; font: 12.7px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 0 0 14px;
}
pre.code .c { color: #7d8bab; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li {
  counter-increment: s; position: relative; padding: 0 0 20px 42px; margin: 0;
  border-left: 2px solid var(--border); margin-left: 14px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: -15px; top: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.steps > li h4 { margin: 3px 0 6px; font-size: 15px; }

.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 13.5px; background: var(--surface); color: var(--text-dim);
}
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--text-dim);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------- লগইন পাতা */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(99,102,241,.22), transparent 62%),
    radial-gradient(760px 460px at 92% 108%, rgba(168,85,247,.18), transparent 60%),
    linear-gradient(160deg, #0d1428 0%, #131d3a 55%, #1a2547 100%);
}
.login-card {
  width: 100%; max-width: 405px;
  background: var(--surface); border-radius: 20px; padding: 32px 30px;
  box-shadow: 0 30px 70px -18px rgba(6,10,25,.6);
}
.login-card .mark {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--brand-2), #a78bfa);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 24px -6px rgba(99,102,241,.6);
}
.login-card h1 { text-align: center; font-size: 21px; margin-bottom: 3px; }
.login-card .tag { text-align: center; color: var(--text-dim); font-size: 13.4px; margin-bottom: 22px; }
.login-foot { text-align: center; color: var(--text-mute); font-size: 12px; margin-top: 20px; }

/* -------------------------------------------------------- SSO যাওয়ার পাতা */

.launch {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center;
  background: linear-gradient(160deg, #0d1428, #1a2547);
  color: #dbe2f2;
}
.launch .box { max-width: 380px; }
.launch .ring {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.16); border-top-color: #a5b4fc;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.launch h2 { color: #fff; }
.launch .small { color: #93a0c0; }

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

.scrim { display: none; }

@media (max-width: 940px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 50px rgba(0,0,0,.4);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 0; background: rgba(9,14,30,.5); z-index: 35;
  }
  .burger { display: inline-flex; }
  .page { padding: 18px 15px 50px; }
  .topbar { padding: 11px 15px; }
  .topbar h1 { font-size: 17.5px; }
  .g-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .stat { padding: 13px; }
  .stat .n { font-size: 21px; }
}

/* ছোট পর্দায় দুই কলামের পাতাগুলো এক কলামে।
   ⚠ বিস্তারিত ও ফর্মের পাতাগুলোতে কলামের মাপ HTML-এর ভেতরেই লেখা
   (style="grid-template-columns:minmax(0,2fr) minmax(290px,1fr)")। ইনলাইন
   স্টাইল সাধারণ CSS-কে হারিয়ে দেয়, তাই এখানে !important ছাড়া উপায় নেই।
   না করলে ফোনে ডান কলামের ২৯০px জোর করে জায়গা নেয় — বাঁ পাশের লেখা
   এক-শব্দ-এক-লাইন হয়ে যায় আর নিচে ডানে-বাঁয়ে টানার স্ক্রলবার আসে। */
@media (max-width: 860px) {
  .grid[style] { grid-template-columns: 1fr !important; }
}

/* ছোট পর্দায় টেবিল — প্রতিটি সারি একেকটি ছোট কার্ড।
   ⚠ ফোনে টেবিল ডানে-বাঁয়ে টেনে দেখা সবচেয়ে বিরক্তিকর জিনিস। তাই এখানে
   টেবিলটিকে ভেঙে ফেলা হয়: শিরোনামের সারি লুকিয়ে যায়, আর প্রতিটি ঘরের বাঁয়ে
   তার নিজের শিরোনাম বসে (data-label, assets/js/app.js বসিয়ে দেয়)। */
@media (max-width: 720px) {
  .table-wrap { overflow-x: visible; }

  table.tbl.stack,
  table.tbl.stack tbody,
  table.tbl.stack tr,
  table.tbl.stack td { display: block; width: 100%; }

  table.tbl.stack thead { display: none; }

  table.tbl.stack tbody tr {
    border: 1px solid var(--border); border-radius: var(--r-s);
    padding: 12px 14px; margin: 0 0 10px; background: var(--surface);
  }
  table.tbl.stack tbody tr:last-child { margin-bottom: 0; }
  table.tbl.stack tbody tr:hover { background: var(--surface); }

  table.tbl.stack td {
    display: flex; align-items: center; justify-content: space-between; gap: 6px 12px;
    border: none; padding: 6px 0; text-align: right; white-space: normal;
    /* ঘরের ভেতরে একাধিক অংশ থাকলে (যেমন IP আর ব্রাউজারের নাম) যেন
       চেপে না গিয়ে পরের লাইনে নামে */
    flex-wrap: wrap;
  }
  table.tbl.stack td > br { display: none; }
  table.tbl.stack td::before {
    content: attr(data-label); flex: none; max-width: 45%;
    font-size: 12.3px; font-weight: 600; color: var(--text-dim); text-align: left;
  }

  /* প্রথম ঘরটি কার্ডের শিরোনাম — নাম, ছবি, সব একসাথে */
  table.tbl.stack td:first-child {
    display: block; text-align: left; padding: 0 0 10px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border-2);
  }
  table.tbl.stack td:first-child::before { display: none; }

  /* খালি ঘর দেখিয়ে জায়গা নষ্ট করার মানে নেই */
  table.tbl.stack td[data-empty] { display: none; }

  table.tbl.stack td.actions {
    justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 10px;
  }
  table.tbl.stack td.actions::before { display: none; }
  table.tbl.stack td.actions form { display: inline-flex; }

  /* "কিছু পাওয়া যায়নি" ধরনের এক-ঘরের সারি */
  table.tbl.stack td[colspan] { display: block; text-align: center; }
  table.tbl.stack td[colspan]::before { display: none; }

  /* কার্ডের ভেতরে জায়গা কম নয় — তাই লেখা কাটার দরকার নেই */
  table.tbl.stack .trunc { white-space: normal; overflow: visible; text-overflow: clip; }
  table.tbl.stack .nowrap { white-space: normal; }

  /* লম্বা ঠিকানা/আইডি যেন কার্ডের বাইরে বেরিয়ে না যায় */
  table.tbl td .mono, table.tbl td.mono, .card .mono { word-break: break-all; }
  table.tbl td[style*="max-width"] { max-width: none !important; }

  /* তথ্যের টেবিলে (thead নেই) বাঁয়ের শিরোনামটা যেন চওড়া না হয়ে যায় */
  table.tbl:not(.stack) th { width: 38%; }
}

@media (max-width: 560px) {
  .g-3 { grid-template-columns: 1fr; }
  .card > .body { padding: 15px; }
  .btn { padding: 8px 12px; }
  .hide-xs { display: none !important; }

  /* উপরের বারের বোতামগুলো যেন পাশাপাশি চেপে না বসে */
  .card > .head { flex-wrap: wrap; }
  .btn-row { width: 100%; }
  .filters .field { min-width: 100%; }
}

/* ---------- ক্লায়েন্ট কোন অংশগুলো পাবেন (মডিউলের টিক) ---------- */
.mod-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mod-item {
  display: flex; align-items: baseline; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card2, transparent); cursor: pointer; line-height: 1.5;
}
.mod-item:hover { border-color: var(--brand, #4f46e5); }
.mod-item input { margin: 0; flex: none; }
.mod-item b { font-weight: 600; }
.mod-item .small { margin-left: 2px; }
/* শুধু দেখার তালিকায় (ইনস্টলেশনের পাতা) — যেটি বন্ধ, সেটি ম্লান */
.mod-item.off { opacity: .5; }
.mod-item.off b { text-decoration: line-through; }
.mod-item svg { flex: none; }

@media print {
  .sidebar, .topbar, .btn, .filters { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}
