/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e4e7ec;
  --text: #101828;
  --muted: #667085;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --success: #067647;
  --success-soft: #e8f5ee;
  --warn: #b54708;
  --warn-soft: #fff4e5;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; margin: 0.4rem 0 0.9rem; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0.3rem 0 0.7rem; }
h3 { font-size: 0.95rem; font-weight: 650; margin: 0.4rem 0; }

.container { max-width: 62rem; margin: 0 auto; padding: 1.1rem 1rem 3rem; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin: 0.9rem 0;
  box-shadow: var(--shadow);
}
.narrow { max-width: 30rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card h2 { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.card h2 .icon { color: var(--primary); width: 20px; height: 20px; }

/* ── Top navigation ────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 62rem; margin: 0 auto; padding: 0.55rem 1rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; margin-right: 0.8rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--primary); color: #fff; border-radius: 9px;
}
.brand-mark .icon { width: 19px; height: 19px; }
.brand-name { font-weight: 750; letter-spacing: -0.01em; color: var(--text); font-size: 1rem; }

.nav-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550; font-size: 0.9rem;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-link .icon { width: 17px; height: 17px; }
.nav-main { display: none; align-items: center; gap: 0.15rem; }
.nav-right { display: none; align-items: center; gap: 0.15rem; margin-left: auto; }

.chev { width: 14px !important; height: 14px !important; opacity: 0.6; }
.avatar {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 8px; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em;
}

/* Dropdowns (desktop) */
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { color: var(--text); background: var(--bg); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 0.35rem; z-index: 50;
}
.dropdown-menu a, .menu-button {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.65rem;
  width: 100%; margin: 0;
  padding: 0.55rem 0.65rem; border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; font-weight: 500;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit;
}
.menu-button:hover { background: var(--bg); color: var(--text); }
.dropdown-menu a:hover, .menu-button:hover { background: var(--bg); text-decoration: none; }
.dropdown-menu .icon { width: 17px; height: 17px; color: var(--muted); }
.dropdown-menu form { margin: 0; }
.dropdown-header {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.55rem 0.65rem 0.65rem; margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

/* Mobile drawer */
.nav-toggle { display: none; }
.nav-burger {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
}
.nav-burger:hover { background: var(--bg); }
.nav-burger .icon { width: 22px; height: 22px; }
.nav-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 1rem 0.9rem;
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.nav-toggle:checked ~ .nav-drawer { display: block; }
.drawer-section { padding: 0.4rem 0; }
.drawer-section + .drawer-section { border-top: 1px solid var(--border); }
.drawer-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); padding: 0.5rem 0.6rem 0.25rem;
}
.drawer-link {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.7rem;
  padding: 0.6rem 0.6rem; margin: 0; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 550; font-size: 0.95rem;
  background: none; border: none; width: 100%; cursor: pointer;
  font-family: inherit; text-align: left;
}
button.drawer-link { color: var(--text); font-size: 0.95rem; font-weight: 550; }
button.drawer-link:hover { background: var(--bg); }
.drawer-link .icon { color: var(--muted); }
.drawer-link:hover { background: var(--bg); text-decoration: none; }
.drawer-link.active { color: var(--primary); background: var(--primary-soft); }
.drawer-link.active .icon { color: var(--primary); }
.nav-drawer form { margin: 0; }

@media (min-width: 940px) {
  .nav-burger { display: none; }
  .nav-drawer { display: none !important; }
  .nav-main { display: flex; }
  .nav-right { display: flex; }
}

/* ── Forms ─────────────────────────────────────────────────────── */
label { display: block; margin: 0.8rem 0; font-weight: 600; font-size: 0.87rem; color: var(--text); }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  padding: 0.55rem 0.7rem; font-size: 0.95rem; font-family: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid #d0d5dd; border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
::placeholder { color: #98a2b3; }

/* ── Buttons ───────────────────────────────────────────────────── */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  margin: 0.5rem 0.35rem 0.2rem 0;
  padding: 0.52rem 1rem; font-size: 0.92rem; font-weight: 600; font-family: inherit;
  color: #fff; background: var(--primary);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: background .12s, box-shadow .12s;
}
button:hover, .button:hover { background: var(--primary-hover); text-decoration: none; }
button:focus-visible, .button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, .3); }
button.ok { background: var(--success); }
button.ok:hover { background: #055c38; }
button.danger { background: #fff; color: var(--danger); border-color: #f4b8b3; }
button.danger:hover { background: var(--danger-soft); }
.button.ghost, button.ghost {
  background: var(--surface); color: var(--text); border-color: #d0d5dd; box-shadow: var(--shadow);
}
.button.ghost:hover, button.ghost:hover { background: var(--bg); }
.small-btn, .inline-form button { padding: 0.32rem 0.7rem; font-size: 0.83rem; margin: 0.15rem 0.25rem 0.15rem 0; }
.inline-form { display: inline; }
.inline-form button { background: var(--surface); color: var(--text); border-color: #d0d5dd; }
.inline-form button:hover { background: var(--bg); }
.inline-form button.danger { color: var(--danger); border-color: #f4b8b3; }
.inline-form button.danger:hover { background: var(--danger-soft); }
.button .icon, button .icon { width: 16px; height: 16px; }

/* ── Flash + badges ────────────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.9rem; border-radius: var(--radius);
  margin: 0.4rem 0 1rem; font-weight: 550; font-size: 0.92rem;
}
.flash .icon { width: 18px; height: 18px; }
.flash-success { background: var(--success-soft); color: var(--success); border: 1px solid #b5e2c8; }
.flash-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f4b8b3; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.13rem 0.6rem; border-radius: 99px;
  font-size: 0.76rem; font-weight: 650; letter-spacing: 0.01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-verified { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }

/* ── Tables ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; padding: 0.4rem 0.6rem; }
table { border-collapse: collapse; width: 100%; min-width: 36rem; }
th, td { text-align: left; padding: 0.62rem 0.65rem; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
th {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.inactive-row { opacity: 0.5; }
.actions { white-space: nowrap; }
.actions form { margin: 0; }

/* ── Page & content patterns ───────────────────────────────────── */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.6rem; margin: 0.4rem 0 0.6rem;
}
.page-head h1 { margin: 0; }
.page-sub { color: var(--muted); margin: -0.5rem 0 1rem; font-size: 0.92rem; }

.muted { color: var(--muted); }
.small { font-size: 0.83rem; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0.4rem 0; }
.plain li { padding: 0.35rem 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.3rem; margin: 0.3rem 0; }
.kv dt { font-weight: 600; color: var(--muted); font-size: 0.88rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 550; }

.notice { padding: 0.65rem 0; border-bottom: 1px solid #f0f2f5; }
.notice:last-of-type { border-bottom: none; }
.notice h3 { display: flex; align-items: center; gap: 0.45rem; }
.notice h3 .icon { width: 15px; height: 15px; color: var(--warn); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; }
.filter-bar label { margin: 0; flex: 1 1 9rem; }
.filter-bar button { margin: 0; }

.payment-review { padding: 1rem 1.15rem; }
.payment-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.review-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.review-form input { flex: 1 1 13rem; margin-top: 0; }
.review-form button { margin: 0; }

.row-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0; }
.file-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 550; }
.file-link .icon { width: 15px; height: 15px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 1.6rem 1rem; color: var(--muted); text-align: center;
}
.empty .icon { width: 28px; height: 28px; opacity: 0.45; }

/* Login screen */
.auth-wrap { min-height: 82vh; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 24.5rem; margin: 1rem auto; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; text-align: center; }
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.auth-brand .brand-mark .icon { width: 28px; height: 28px; }
.auth-card button { width: 100%; margin-top: 0.9rem; padding: 0.62rem; }
