/* Self-hosted fonts (replaces Google Fonts). font-display:swap = text shows instantly with fallback font. */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400 800; font-display:swap;
  src:url('../fonts/inter-latin-var.woff2?v=1') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Hind Siliguri'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/hind-siliguri-bengali-400.woff2?v=1') format('woff2');
  unicode-range:U+0964-0965,U+0980-09FF,U+200C-200D,U+20B9,U+25CC; }
@font-face { font-family:'Hind Siliguri'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../fonts/hind-siliguri-bengali-600.woff2?v=1') format('woff2');
  unicode-range:U+0964-0965,U+0980-09FF,U+200C-200D,U+20B9,U+25CC; }
@font-face { font-family:'Hind Siliguri'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/hind-siliguri-bengali-700.woff2?v=1') format('woff2');
  unicode-range:U+0964-0965,U+0980-09FF,U+200C-200D,U+20B9,U+25CC; }

:root { --bp-blue: #0066ff; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.tabular-nums, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Top bar icon buttons */
.bp-icon-btn {
  width: 40px; height: 40px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e2e8f0; color: #475569;
}
.bp-icon-btn:hover { background: #f1f5f9; }

/* Desktop nav active */
.bp-desk-link.active { background: #eff6ff; color: var(--bp-blue); }

/* Search pill (icon kokhono placeholder-er upor jabe na) */
.search-pill-container { position: relative; width: 100%; }
.search-pill-container .search-icon {
  position: absolute; left: 1.15rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #94a3b8; pointer-events: none;
}
.search-pill-container input {
  width: 100%; height: 48px;
  padding-left: 3.25rem !important; padding-right: 1rem;
  border-radius: 9999px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 14px; outline: none;
}
.search-pill-container input:focus { border-color: var(--bp-blue); box-shadow: 0 0 0 3px rgba(0,102,255,.12); }

/* Filter capsules */
.filter-pill {
  flex: 0 0 auto; height: 38px; padding: 0 14px; border-radius: 9999px;
  border: 1px solid #e2e8f0; background: #fff; font-size: 13px; font-weight: 500;
  color: #334155; display: inline-flex; align-items: center; gap: 6px;
}
.filter-pill.active { background: var(--bp-blue); border-color: var(--bp-blue); color: #fff; }

/* Bottom nav */
.bp-nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: #94a3b8; text-decoration: none; height: 100%;
}
.bp-nav-label { font-size: 10px; font-weight: 600; }
.bp-nav-link.active { color: var(--bp-blue); }
.bp-nav-link .bp-nav-dot { width: 20px; height: 3px; background: var(--bp-blue); border-radius: 9999px; margin-top: 2px; }
.bp-bottom-nav { bottom: 12px; }

/* Modal */
.bp-modal {
  position: fixed; inset: 0; z-index: 99999999 !important;
  display: none; align-items: flex-end; justify-content: center;
}
.bp-modal.open { display: flex !important; }
.bp-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bp-modal-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 24px 24px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  animation: bpSlideUp .22s ease-out;
}
@media (min-width: 768px) {
  .bp-modal { align-items: center; }
  .bp-modal-panel { border-radius: 24px; padding: 24px; }
}
@keyframes bpSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Modal khola thakle bottom nav shob somoy lukano */
body.modal-open .bp-bottom-nav,
body.modal-open nav.fixed,
body.modal-open .bottom-nav,
body.modal-open #bottomNav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Bangla typography */
html[lang="bn"] body { font-family: 'Hind Siliguri','Inter','Noto Sans Bengali',system-ui,sans-serif; line-height: 1.55; }

/* Print (reports) */
@media print {
  header, nav, .no-print, #bpRefresh { display: none !important; }
  body { background: #fff !important; }
  main { padding: 0 !important; margin: 0 !important; }
  .rounded-2xl, .rounded-3xl { box-shadow: none !important; }
  table { font-size: 11px; }
}

/* ===== Phase 7: mobile fixes ===== */

/* 1) html/body same background, home-screen app-er niche strip jabe */
html, body { background-color:#f8fafc !important; }
html { min-height:100%; -webkit-text-size-adjust:100%; touch-action:manipulation; }
body {
  min-height:100vh;
  min-height:100dvh;
  overscroll-behavior-y:none;
}

/* 2) topbar safe-area: keeps header below status bar / notch / Dynamic Island */
.bp-topbar {
  padding-top: env(safe-area-inset-top, 0px) !important;
}

/* bottom nav: anchored neatly near bottom with uniform 12px margins */
.bottom-nav, #bottomNav, #bottom-nav, nav.fixed, .bp-bottom-nav {
  bottom: 12px !important;
}
main, .page-wrap {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

/* 3) grid/flex child overflow bondho (date box baire jaoa) */
.grid > * { min-width:0; }

/* 4) date/time input: iPhone fix */
input[type="date"],
input[type="month"],
input[type="time"],
input[type="datetime-local"] {
  -webkit-appearance:none;
  appearance:none;
  display:flex;
  align-items:center;
  width:100%;
  min-width:0 !important;
  max-width:100%;
  box-sizing:border-box;
  min-height:3.25rem;
  text-align:left;
  line-height:1.25;
  background-color:#fff;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align:left;
  min-height:1.25em;
  margin:0;
}
input[type="date"]::-webkit-datetime-edit { padding:0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity:.55; }

/* empty date-e placeholder (touch device) */
@media (pointer:coarse) {
  input[type="date"]:not(.has-value):not(:focus)::-webkit-datetime-edit { opacity:0; }
  input[type="date"]:not(.has-value):not(:focus)::before {
    content:attr(data-ph);
    color:#94a3b8;
  }
}

/* 5) iPhone focus-zoom bondho: input font 16px */
@media (max-width:768px) {
  input, select, textarea { font-size:16px !important; }
}

/* ===== Speed / app-feel additions ===== */
/* Refresh button spinner */
.bp-spin svg { animation: bpSpin .7s linear infinite; }
@keyframes bpSpin { to { transform: rotate(360deg); } }

/* Top progress bar (bp-fast.js) */
#bpBar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--bp-blue);
  z-index: 100000000; opacity: 0; transition: width .6s ease-out, opacity .2s; pointer-events: none; }
#bpBar.on { width: 85%; opacity: 1; }

/* Smooth page-to-page transition (Chrome 126+, Safari 18.2+; ignored elsewhere).
   Top bar and bottom nav stay still while only the page content cross-fades. */
@view-transition { navigation: auto; }
.bp-topbar { view-transition-name: bp-topbar; }
.bp-bottom-nav { view-transition-name: bp-bottom-nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
