/* =====================================================================
   FILE: style.css
   কাজ: পুরো অ্যাপের ডিজাইন (রঙ, ফন্ট, লে-আউট, বাটন, কার্ড ইত্যাদি)।
   রঙ বদলাতে চাইলে উপরের :root { } এর ভেরিয়েবলগুলো বদলান।
   ===================================================================== */

:root {
  --green: #17a866;
  --green-dark: #0f8a53;
  --green-bg: #e6f7ee;
  --red: #e03b3b;
  --red-bg: #fdecec;
  --blue: #2f7fe0;
  --blue-bg: #e8f1fd;
  --gray-bg: #f2f3f5;
  --text: #16181c;
  --muted: #767b85;
  --border: #e6e8ec;
  --bg: #f7f8fa;
  --card: #ffffff;
  --radius: 14px;
  --maxw: 520px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Bengali", "Hind Siliguri", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; }

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 70px;
  box-shadow: 0 0 30px rgba(0,0,0,0.06);
}

/* বড় স্ক্রিনে (ডেস্কটপ/ব্রাউজার) অ্যাপটাকে মোবাইল ফ্রেমের মতো দেখানো হয় */
@media (min-width: 640px) {
  body { background: #e9ebee; }
  #app { margin-top: 20px; margin-bottom: 20px; border-radius: 20px; overflow: hidden; min-height: calc(100vh - 40px); }
  .bottomnav { max-width: var(--maxw); left: 50%; transform: translateX(-50%); border-radius: 0 0 20px 20px; }
}

/* ---------------- টপবার ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px; gap: 8px;
}
.pagetitle { font-size: 19px; font-weight: 700; }
.biz { display: flex; align-items: center; gap: 10px; }
.bizname { font-weight: 700; font-size: 17px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--green-bg);
  color: var(--green-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.icon-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
}
.icon-btn:active { background: var(--gray-bg); }

/* ---------------- পেজ কন্টেইনার ---------------- */
.page { padding: 0 16px 20px; }
.section-title { font-size: 15px; font-weight: 700; margin: 18px 0 10px; }
.muted { color: var(--muted); }
.empty {
  text-align: center; color: var(--muted); padding: 30px 10px;
  background: var(--card); border-radius: var(--radius); border: 1px dashed var(--border);
}

/* ---------------- ড্যাশবোর্ড কার্ড ---------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  cursor: pointer; border: 1px solid var(--border);
}
.card-value { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.card-label { font-size: 13px; color: var(--muted); }
.card-green { background: var(--green-bg); border-color: transparent; }
.card-green .card-value { color: var(--green-dark); }
.card-red { background: var(--red-bg); border-color: transparent; }
.card-red .card-value { color: var(--red); }

/* ---------------- শর্টকাট গ্রিড ---------------- */
.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.shortcut {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text); cursor: pointer;
}
.shortcut span { font-size: 20px; }
@media (max-width: 380px) { .shortcuts { grid-template-columns: repeat(3, 1fr); } }

/* ---------------- লিস্ট ও রো ---------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.row-title { font-weight: 600; font-size: 14.5px; }
.row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-amount { font-weight: 700; font-size: 14.5px; }
.amt-green { color: var(--green-dark); }
.amt-red { color: var(--red); }
.amt-gray { color: var(--muted); }

.thumb-sq {
  width: 42px; height: 42px; border-radius: 10px; background: var(--gray-bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted);
  flex-shrink: 0;
}

.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 600; display: inline-block;
}
.badge-green { background: var(--green-bg); color: var(--green-dark); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--muted); }

/* ---------------- সার্চ / চিপ ---------------- */
.searchrow { display: flex; gap: 8px; margin: 10px 0; }
.chiprow { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.chip {
  background: var(--gray-bg); border: none; border-radius: 20px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.chip-active { background: var(--green); color: #fff; }
.chip-select {
  background: var(--gray-bg); border: none; border-radius: 20px; padding: 7px 14px; font-size: 13px;
}

/* ---------------- ফর্ম উপাদান ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 12px;
  font-size: 15px; background: var(--card); color: var(--text); width: 100%;
}
.input:focus { outline: none; border-color: var(--green); }
textarea.input { resize: vertical; }
.row-between { flex-direction: row; align-items: center; justify-content: space-between; }

.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add .input { flex: 1; }
.btn-mini {
  background: var(--green); color: #fff; border: none; border-radius: 10px;
  padding: 12px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}

.segment { display: flex; gap: 10px; }
.segment label {
  flex: 1; text-align: center; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; cursor: pointer; font-size: 14px;
}
.segment input { margin-right: 6px; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .2s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: .2s; border-radius: 50%;
}
.switch input:checked + .slider { background-color: var(--green); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.addrow { display: flex; gap: 8px; margin: 12px 0; }
.addrow .input { flex: 1; }

/* ---------------- বাটন ---------------- */
.btn-primary, .btn-outline {
  border-radius: 12px; padding: 13px; font-size: 14.5px; font-weight: 700; cursor: pointer; border: none;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--green-dark); border: 1px solid var(--green); }
.full { width: 100%; margin-bottom: 12px; }
.btnrow { display: flex; gap: 10px; margin: 10px 0 16px; }
.btnrow > * { flex: 1; }

.fab {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(calc(-50% + 0px));
  max-width: var(--maxw); margin: 0 auto;
  right: 0;
  width: calc(100% - 32px); max-width: calc(var(--maxw) - 32px);
  background: var(--green); color: #fff; border: none; border-radius: 30px;
  padding: 14px; font-size: 15px; font-weight: 700; box-shadow: 0 6px 16px rgba(23,168,102,.35);
  cursor: pointer; z-index: 20;
}
.fab-full {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  background: var(--green); color: #fff; border: none;
  padding: 16px; font-size: 15.5px; font-weight: 700; cursor: pointer; z-index: 30;
}
.fab-full:disabled { background: #b6bcc4; }
.fab-group {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: calc(var(--maxw) - 32px);
  display: flex; gap: 10px; z-index: 20;
}
.fab-small {
  flex: 1; border: none; border-radius: 26px; padding: 13px; font-weight: 700;
  background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.15); cursor: pointer;
}
.fab-blue { background: var(--blue); }

/* ---------------- নিচের নেভিগেশন ---------------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.navbtn {
  flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 9px 0 8px; font-size: 11px; color: var(--muted); cursor: pointer;
}
.navicon { font-size: 19px; }
.navbtn.active { color: var(--green-dark); font-weight: 700; }

/* ---------------- সামারি / টোটাল বক্স ---------------- */
.summary {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin: 14px 0;
}
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }

.detailhead { margin-bottom: 12px; }
.notebox {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 14px;
}

/* ---------------- ছবি প্রিভিউ ---------------- */
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border: none;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1; cursor: pointer;
}

/* ---------------- মডাল (পপ-আপ) ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: #fff; width: 100%; max-width: var(--maxw); border-radius: 18px 18px 0 0;
  padding: 20px 16px 24px; max-height: 88vh; overflow-y: auto;
}
.modal-sheet h3 { margin: 0 0 14px; font-size: 17px; }

/* ---------------- প্রোফাইল কার্ড (আরো পেজ) ---------------- */
.profilecard {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 10px 0 18px; cursor: pointer;
}
.menu-list { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 15px 16px; font-size: 14.5px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item b { margin-left: auto; color: var(--muted); font-weight: 400; }

/* ---------------- টোস্ট (ছোট বার্তা) ---------------- */
#toastBox {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #222; color: #fff; padding: 10px 18px; border-radius: 30px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 80%; text-align: center;
}
#toastBox.show { opacity: 1; transform: translateX(-50%) translateY(0); }
