@font-face {
  font-family: 'SolaimanLipi';
  src: url('../fonts/SolaimanLipi.woff') format('woff'),
       url('../fonts/SolaimanLipi.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html, body, input, textarea, select, button, table, th, td, h1, h2, h3, h4, h5, h6, p, a, span, div, li, label, strong, small {
  font-family: 'SolaimanLipi', 'Noto Serif Bengali', sans-serif !important;
}

input, textarea, select, .uc-select-wrap, .uc-select-trigger, .uc-select-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box !important;
}
input[type="checkbox"], input[type="radio"] {
  width: auto !important;
}
.admin-content, .member-content, .card, .form-card, .grid > * {
  min-width: 0;
  max-width: 100%;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

:root {
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --ink-muted: #64748b;
  --line: #e2e8f0;
  --app-grad: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #115e59 100%);
  --app-grad-admin: linear-gradient(135deg, #0f172a 0%, #134e4a 60%, #0f766e 100%);
}

html[data-theme="dark"] {
  --bg: #0b1120;
  --white: #111827;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f8fafc;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --ink-muted: #94a3b8;
  --border: #1e293b;
  --line: #1e293b;
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .site-header { background: rgba(17, 24, 39, .95); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .wallet-box,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .process-card,
html[data-theme="dark"] .policy-card,
html[data-theme="dark"] .gallery .item,
html[data-theme="dark"] .table { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .table th { background: #134e4a; color: #ecfdf5; }
html[data-theme="dark"] .table td { border-color: var(--border); }
html[data-theme="dark"] .admin-content,
html[data-theme="dark"] .member-content { background: var(--bg); color: var(--text); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select { background: #0f172a; color: #f8fafc; border-color: #334155; }
html[data-theme="dark"] label { color: #5eead4; }
html[data-theme="dark"] .notice { background: #1e293b; color: #fde68a; }
html[data-theme="dark"] .nav-menu { background: #111827; }
html[data-theme="dark"] .soft-section { background: #0f172a; }
html[data-theme="dark"] .highlight-card { background: linear-gradient(135deg, #111827, #134e4a); }
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .wallet-box strong { color: #5eead4; }

.toolbar-pills { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 700; cursor: pointer;
  transition: all .15s ease;
}
.pill-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Native Mobile App Hero Balance & Quick Actions ===== */
.app-hero-card {
  background: var(--app-grad);
  color: #fff;
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 14px 32px rgba(15, 118, 110, .25);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.app-hero-card.admin-hero { background: var(--app-grad-admin); box-shadow: 0 14px 32px rgba(15, 23, 42, .25); }
.app-hero-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none;
}
.app-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-hero-label { font-size: .88rem; opacity: .88; display: block; margin-bottom: 4px; }
.app-hero-amount { font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.app-hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  font-size: .84rem; opacity: .95;
}
.app-hero-chip {
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: 999px; font-weight: 700;
}

.app-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.app-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); font-size: .84rem; font-weight: 700; text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
  transition: transform .15s ease, border-color .15s ease;
}
.app-action-btn:hover { transform: translateY(-2px); border-color: var(--primary); }
.app-action-ico {
  width: 40px; height: 40px; border-radius: 14px;
  background: rgba(15, 118, 110, .12); color: var(--primary);
  display: grid; place-items: center; font-size: 1.2rem;
}

/* Smart KPI Grid */
.wallet-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.wallet-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}
.wallet-box .kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wallet-box .kpi-ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(15, 118, 110, .1); font-size: 1rem;
}
.wallet-box span { font-size: .84rem; font-weight: 700; color: var(--ink-muted); }
.wallet-box strong { font-size: 1.35rem; line-height: 1.2; display: block; color: var(--ink); }

/* Mobile Feed Cards (for tables on small screens) */
.mobile-feed-list { display: none; }
.mobile-feed-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.mobile-feed-item:last-child { border-bottom: none; }

/* Mobile-Native App Shell */
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 980px) {
  .admin-layout, .member-layout { display: block !important; width: 100% !important; max-width: 100vw !important; overflow-x: hidden !important; padding-bottom: 92px; }
  .grid, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .admin-sidebar, .member-sidebar {
    position: fixed; top: 0; left: -300px; bottom: 0; width: 280px; z-index: 2000;
    overflow-y: auto; transition: left .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 10px 0 36px rgba(0,0,0,.38); border-radius: 0 22px 22px 0;
  }
  .admin-sidebar.open, .member-sidebar.open { left: 0; }
  .drawer-backdrop.open {
    display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); z-index: 1999;
  }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 1500;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 10px 14px;
  }
  html[data-theme="dark"] .mobile-topbar { background: rgba(17,24,39,.96); }
  .dots-btn {
    width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--ink); font-size: 1.25rem; font-weight: 900;
    display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  }
  .admin-top { display: none; }
  .admin-content, .member-content { padding: 14px 12px 96px; }
  .card { padding: 16px; border-radius: 20px; box-shadow: 0 4px 18px rgba(15, 23, 42, .05); }
  .mobile-bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
    background: var(--surface);
    border-top: 1px solid var(--border); border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .12);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  }
  html[data-theme="dark"] .mobile-bottom-nav { background: #111827; }
  .mobile-bottom-nav a, .mobile-bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: .74rem; font-weight: 700; color: var(--ink-muted);
    background: none; border: none; padding: 5px 2px; cursor: pointer; border-radius: 12px;
  }
  .mobile-bottom-nav a.active { color: var(--primary); background: rgba(15,118,110,.11); }
  .mobile-bottom-nav .nav-ico { font-size: 1.18rem; line-height: 1; }
}

@media (max-width: 768px) {
  .wallet-summary-grid,
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .app-hero-amount { font-size: 1.65rem; }
  .app-quick-actions { gap: 8px; }
  .app-action-btn { padding: 10px 4px; font-size: .78rem; border-radius: 16px; }
  .app-action-ico { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 11px; }
  .wallet-box, .stat { padding: 13px 12px !important; border-radius: 16px !important; }
  .wallet-box strong, .stat strong { font-size: 1.14rem !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .process-card { padding: 14px !important; border-radius: 16px !important; }
  .desktop-table-only { display: none; }
  .mobile-feed-list { display: block; }
}

.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  border-radius: 999px; background: #dc2626; color: #fff; font-size: .72rem;
  display: grid; place-items: center; padding: 0 4px; font-weight: 800;
}

/* ===== Searchable Select Dropdown ===== */
.uc-select-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}
.uc-select-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}
.uc-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.uc-select-trigger:hover,
.uc-select-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.uc-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-select-arrow { font-size: .85rem; opacity: .7; flex-shrink: 0; }
.uc-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 2500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  padding: 8px;
}
.uc-select-search {
  width: 100%;
  padding: 8px 10px !important;
  margin-bottom: 6px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  font-size: .9rem !important;
}
.uc-select-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.uc-select-option {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: .92rem;
  cursor: pointer;
}
.uc-select-option:hover {
  background: rgba(15, 118, 110, .1);
  color: var(--primary);
}
.uc-select-option.active {
  background: rgba(15, 118, 110, .16);
  color: var(--primary);
  font-weight: 700;
}
.uc-select-empty {
  padding: 12px;
  text-align: center;
  font-size: .88rem;
  color: var(--ink-muted);
}
