/* BD Map admin panel. Its own page and its own styles; the colours match the app. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --raised: #f0f1f5; --ink: #0b0f14; --ink-2: #48505c; --muted: #8a93a1; --line: rgba(11, 15, 20, .08);
  --accent: #0a8f62; --accent-2: #10b3a3; --accent-soft: #e5f5ee; --violet: #6b4de6; --violet-soft: #efebfd;
  --warn: #b25e00; --warn-soft: #fff1dc; --bad: #d92d20; --bad-soft: #fdecea;
  --shadow: 0 1px 2px rgba(11, 15, 20, .04), 0 6px 20px rgba(11, 15, 20, .06); --shadow-2: 0 18px 60px rgba(11, 15, 20, .18);
  --ease: cubic-bezier(.2, .8, .2, 1); --side: 252px;
}
:root[data-theme=dark] { --bg: #000; --surface: #131416; --raised: #1c1d21; --ink: #f5f5f7; --ink-2: #b4b9c2; --muted: #7d8591; --line: rgba(255, 255, 255, .1);
          --accent: #2fd39a; --accent-soft: #0f2a21; --violet: #9d86ff; --violet-soft: #1d1836; --warn: #ffb648; --warn-soft: #2e2110; --bad: #ff6b5e; --bad-soft: #2e1512;
          --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-2: 0 18px 60px rgba(0, 0, 0, .7); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 'Anek Bangla', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }

.logo { width: 60px; height: 60px; border-radius: 19px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 26px rgba(10, 143, 98, .3); }
.logo i { width: 34%; height: 34%; border-radius: 50%; background: #fff; }
.logo.sm { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; }

.gate { height: 100%; display: grid; place-items: center; padding: 24px; }
.gate-card { max-width: 420px; text-align: center; background: var(--surface); padding: 40px 32px; border-radius: 28px; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 6px; animation: rise .5s var(--ease); }
.gate-card h1 { margin: 16px 0 0; font-size: 26px; letter-spacing: -.02em; }
.gate-card p { margin: 0 0 18px; color: var(--ink-2); }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; text-decoration: none; color: var(--ink); }
.brand b { font-size: 18px; font-weight: 700; }
.brand em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .15s, color .15s, transform .15s; }
#nav a:hover { background: var(--raised); color: var(--ink); }
#nav a:active { transform: scale(.98); }
#nav a.on { background: var(--ink); color: var(--bg); font-weight: 600; }
#nav svg, .top svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav span { flex: 1; }
#nav em { font-style: normal; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.me { margin-top: auto; padding: 12px 8px 2px; border-top: 1px solid var(--line); }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 22px 32px 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.top h1 { margin: 0 auto 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.content { padding: 6px 32px 60px; max-width: 1240px; }
.page { animation: rise .4s var(--ease); display: grid; gap: 18px; }

.card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 6px; overflow-x: auto; }
.card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.none { padding: 44px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); }
.card .none { box-shadow: none; padding: 24px 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 2px; transition: transform .2s var(--ease); }
.kpi:hover { transform: translateY(-2px); }
.kpi span { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi b { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi.warn b { color: var(--warn); } .kpi.bad b { color: var(--bad); }
.kpi.live b::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 10px; border-radius: 50%; background: #30d158; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }

.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chart { display: grid; gap: 0; }
.chart span { font-size: 14px; font-weight: 600; color: var(--muted); }
.chart b { font-size: 28px; font-weight: 700; line-height: 1.2; }
.chart small { font-size: 12px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 84px; margin-top: 14px; }
.bars i { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); transition: height .6s var(--ease), opacity .15s; min-height: 4px; }
.bars i.zero { background: var(--raised); }
.bars i:hover { opacity: .7; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }

.av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; font-size: 17px; background: var(--raised); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xl { width: 96px; height: 96px; font-size: 40px; }
.person, .line { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px; border-radius: 14px; }
.person .t, .line .t { flex: 1; min-width: 0; }
.person b, .line b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person span, .line .t span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.click { cursor: pointer; transition: background .15s; }
.click:hover { background: var(--raised); }
.line.pad { padding: 12px 14px; }
.line + .line { border-top: 1px solid var(--line); border-radius: 0; }
.line .k { flex: 1; color: var(--ink-2); font-size: 14px; }
.line code { flex: none; font: 600 13px ui-monospace, Consolas, monospace; background: var(--raised); padding: 3px 8px; border-radius: 8px; }

.chip { display: inline-block; flex: none; padding: 3px 11px; border-radius: 999px; background: var(--raised); color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--accent-soft); color: var(--accent); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.live { background: var(--accent-soft); color: var(--accent); }
.chip.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #30d158; vertical-align: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--raised); justify-self: start; max-width: 100%; overflow-x: auto; }
.tabs button { padding: 7px 15px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
.tbl td { padding: 6px 14px; border-top: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tbl td:first-child { white-space: normal; min-width: 220px; }
.tbl td .person { padding: 4px 0; }
.tbl tr.click:hover td { background: var(--raised); }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.pager span { margin-right: auto; }

.btn { padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; text-decoration: none; display: inline-block; transition: transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.12); } .btn:active { transform: scale(.96); }
.btn.quiet { background: var(--raised); color: var(--ink); }
.btn.bad { background: var(--bad); color: #fff; } .btn.bad.quiet { background: var(--bad-soft); color: var(--bad); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.search, .field select, textarea { border: 0; outline: none; background: var(--surface); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); width: 100%; }
.search { width: min(320px, 46vw); }
.search:focus, textarea:focus, .field select:focus { box-shadow: 0 0 0 2.5px var(--accent); }
textarea { background: var(--raised); box-shadow: none; resize: vertical; display: block; margin-bottom: 10px; }
.field { display: grid; gap: 6px; } .field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field select { background: var(--raised); box-shadow: none; }

.report { display: grid; gap: 10px; }
.rhead { display: flex; align-items: center; gap: 10px; } .rhead .person { flex: 1; padding: 4px; }
.reason { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--raised); white-space: pre-wrap; overflow-wrap: anywhere; }
.report small { color: var(--muted); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; } .acts.col { display: grid; }

.drawer-back { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .36); animation: rise .25s; }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-2);
  transform: translateX(104%); transition: transform .32s var(--ease); }
.drawer.on { transform: none; }
.drawer header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header b { flex: 1; font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { width: 36px; height: 36px; border-radius: 50%; background: var(--raised); font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }
.drawer footer { padding: 14px 20px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.drawer footer textarea { flex: 1 1 100%; margin: 0; }
.utop { display: grid; justify-items: center; text-align: center; gap: 4px; }
.utop b { font-size: 22px; font-weight: 700; margin-top: 10px; } .utop span { color: var(--muted); } .utop p { margin: 6px 0 8px; color: var(--ink-2); max-width: 28em; }
.utop .chips { justify-content: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: var(--raised); border-radius: 16px; padding: 12px 8px; text-align: center; }
.stats b { display: block; font-size: 22px; font-weight: 700; } .stats span { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; }
.thread { display: grid; gap: 10px; }
.tmsg { padding: 12px 14px; border-radius: 18px; background: var(--raised); max-width: 92%; }
.tmsg.staff { justify-self: end; background: var(--accent-soft); }
.tmsg small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tmsg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.snack { position: fixed; z-index: 40; left: 50%; bottom: 26px; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-2);
  transform: translate(-50%, 160%); opacity: 0; transition: transform .4s var(--ease), opacity .25s; max-width: calc(100vw - 32px); }
.snack.on { transform: translate(-50%, 0); opacity: 1; } .snack.bad { background: var(--bad); color: #fff; }

@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .charts, .cols { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: sticky; z-index: 6; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0 6px 0 2px; } .brand b, .brand em, .me { display: none; }
  #nav { display: flex; gap: 4px; } #nav a { padding: 8px 12px; white-space: nowrap; } #nav a span { display: none; } #nav a.on span { display: inline; }
  .top { position: static; padding: 18px 16px 10px; flex-wrap: wrap; } .top h1 { font-size: 26px; }
  .content { padding: 4px 16px 40px; }
  .kpi b { font-size: 28px; } .stats { grid-template-columns: repeat(2, 1fr); }
  .search { width: 100%; }
}

h3.sub { margin: 8px 4px 0; font-size: 17px; font-weight: 700; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pcard { padding: 10px; display: grid; gap: 8px; align-content: start; }
.pcard img, .pcard video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #000; display: block; }
.pcard .cap { margin: 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.pcard small { margin: 0 4px; color: var(--muted); }
.pcard .person { padding: 2px 4px; }

/* ================= The panel as a piece of software: grouped menu, search everywhere, a fuller overview ================= */
.nav-group { margin: 16px 12px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.nav-group:first-child { margin-top: 0; }
#nav { gap: 1px; overflow-y: auto; }
#nav a { padding: 9px 12px; font-size: 15px; }
.side { overflow: hidden; }
.top { flex-wrap: wrap; }
.top h1 { margin-right: auto; }
.gsearch { position: relative; display: flex; align-items: center; gap: 8px; width: min(360px, 100%); height: 42px; padding: 0 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.gsearch:focus-within { box-shadow: 0 0 0 2.5px var(--accent); }
.gsearch > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.gsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; }
.gs { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 70vh; overflow-y: auto; padding: 8px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-2); z-index: 30; animation: rise .2s var(--ease); }
.gs-label { margin: 8px 8px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.gs-none { padding: 18px; text-align: center; color: var(--muted); }
.app-link { padding: 9px 16px; font-size: 14px; }
.hello { display: grid; gap: 2px; }
.hello b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; } .hello span { color: var(--muted); font-size: 14.5px; }
.todo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.task { text-align: left; display: grid; gap: 1px; padding: 16px 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.task b { font-size: 28px; font-weight: 700; line-height: 1.1; } .task span { font-weight: 600; font-size: 14.5px; } .task small { font-size: 12.5px; color: var(--muted); }
.task.warn { border-left-color: var(--warn); } .task.warn b { color: var(--warn); }
.task.bad { border-left-color: var(--bad); } .task.bad b { color: var(--bad); }
.task.violet { border-left-color: var(--violet); } .task.violet b { color: var(--violet); }
.task.done { opacity: .7; } .task.done b { color: var(--accent); }
.kpi { position: relative; }
.kpi .ki { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--ink-2); }
.kpi .ki svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ch-head { display: flex; align-items: center; justify-content: space-between; }
.ch-head em { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--raised); color: var(--muted); }
.ch-head em.up { background: var(--accent-soft); color: var(--accent); } .ch-head em.down { background: var(--bad-soft); color: var(--bad); }
.chart .bars i:not(.zero) { background: linear-gradient(180deg, hsl(var(--h1, 158) 72% 58%), hsl(var(--h1, 158) 80% 40%)); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
h3.gap { margin-top: 18px; }
.switch { flex: none; position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch.on { background: #30d158; } .switch.on i { transform: translateX(20px); }
.sw-row { padding: 12px 4px; } .sw-row .t span { white-space: normal; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.scard { display: grid; gap: 6px; padding: 8px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.scard img, .scard video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #000; display: block; }
.scard .person { padding: 2px; }
.ptext { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; padding: 18px; text-align: center; font-weight: 600; background: linear-gradient(135deg, var(--violet), var(--accent)); color: #fff; overflow: hidden; }
.tbl td .wrap { white-space: normal; display: block; max-width: 420px; }
.card.flat { box-shadow: none; background: var(--raised); }
.card.flat .line { padding: 8px 4px; }
@media (max-width: 1280px) { .todo { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .nav-group { display: none; }
  .todo { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols.three, .charts { grid-template-columns: 1fr; }
  .gsearch { width: 100%; order: 3; } .app-link { display: none; }
}
.person .av, .line .av { display: grid; font-size: 17px; color: #fff; white-space: normal; overflow: hidden; }
.av.xl { font-size: 40px !important; }
