* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: 'Noto Sans Bengali', 'Segoe UI', Tahoma, sans-serif;
  background: #E8E8E8;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

/* Fixed width, height scroll */
.app {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  background: #F5F5F5;
  padding: 16px;
  padding-bottom: 32px;
  overflow-y: auto;
}

/* Desktop e app er duipashe halka shadow */
@media (min-width: 480px) {
  body {
    padding: 16px;
  }
  .app {
    min-height: calc(100dvh - 32px);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  }
}

button, input, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.page { display: none; }
.page.active { display: block; }

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.search-bar .icon { font-size: 18px; margin-right: 10px; }
.search-bar input {
  border: none; outline: none; font-size: 16px; width: 100%;
  background: transparent; color: #1A1A1A; font-family: inherit;
}
.search-bar input::placeholder { color: #999; }

/* Cards */
.card-list {
  display: flex; flex-direction: column; gap: 16px;
}

.card {
  background: #FFFFFF; border-radius: 12px; padding: 28px 20px;
  text-align: center; font-size: 18px; font-weight: 600;
  color: #1A1A1A; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.card:active { transform: scale(0.98); }

/* Page header */
.page-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.back-btn {
  background: #FFFFFF; border: none; border-radius: 10px;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.back-btn:active { transform: scale(0.95); }
.page-title { font-size: 20px; font-weight: 700; color: #1A1A1A; }

.shop-card {
  background: #FFFFFF; border-radius: 12px; padding: 20px;
  text-align: left; font-size: 17px; font-weight: 600;
  color: #1A1A1A; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.shop-card:active { transform: scale(0.98); }

/* বাতিল করা দোকান: লাল ব্যাকগ্রাউন্ড, সাদা লেখা */
.shop-card.cancelled {
  background: #E53935;
  color: #FFFFFF;
}

/* ===== Detail page ===== */
.info-card {
  background: #FFFFFF; border-radius: 12px; padding: 6px 20px;
  margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 17px; font-weight: 600; color: #1A1A1A;
}

.info-row {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #F0F0F0;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  color: #666; font-size: 15px; font-weight: 600;
  min-width: 96px; flex-shrink: 0;
}
.info-value {
  color: #1A1A1A; font-size: 16px; font-weight: 600;
  flex: 1; word-break: break-word; line-height: 1.6;
}

.field-card {
  background: #FFFFFF; border-radius: 12px; padding: 16px 20px;
  margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.field-card label {
  display: block; font-size: 14px; font-weight: 600;
  color: #666; margin-bottom: 8px;
}
.field-card input,
.field-card select {
  width: 100%; border: 1px solid #E5E5E5; border-radius: 8px;
  padding: 12px 14px; font-size: 16px; font-family: inherit;
  color: #1A1A1A; outline: none; background: #FAFAFA;
}
.field-card input:focus,
.field-card select:focus {
  border-color: #1A1A1A; background: #FFFFFF;
}
.field-card input.error {
  border-color: #E53935; background: #FFF5F5;
}

/* Number field row */
.number-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.number-row input { flex: 1; }
.number-row .plus-btn {
  background: #1A1A1A; color: #FFFFFF; border: none;
  border-radius: 8px; width: 44px; height: 44px;
  font-size: 22px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease; flex-shrink: 0;
}
.number-row .plus-btn:active { transform: scale(0.92); }
.number-row .remove-btn {
  background: #FFFFFF; color: #E53935; border: 1px solid #E5E5E5;
  border-radius: 8px; width: 44px; height: 44px;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease; flex-shrink: 0;
}
.number-row .remove-btn:active { transform: scale(0.92); }

/* Hidden fields */
.hidden { display: none; }

/* Buttons */
.btn-row {
  display: flex; gap: 12px; margin-top: 8px;
}
.btn {
  flex: 1; border: none; border-radius: 12px; padding: 16px;
  font-size: 17px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: transform 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-save { background: #1A1A1A; color: #FFFFFF; }
.btn-print { background: #FFFFFF; color: #1A1A1A; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.btn-outline { background: #FFFFFF; color: #1A1A1A; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.btn-danger { background: #E53935; color: #FFFFFF; }

/* বাতিল করা দোকান: তথ্য পরিবর্তন কার্ড নিষ্ক্রিয় দেখাবে */
.card.disabled { opacity: .5; }

/* forgot password এর ছোট লিংক বাটন */
.link-row { text-align: center; margin: 4px 0 14px; }
.link-btn {
  background: none;
  border: none;
  color: #1E6FD9;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  padding: 8px 6px;
  cursor: pointer;
}
.field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #7A7A7A;
  line-height: 1.5;
}

/* forgot password পাতায় মালিককে কল করার বাক্স */
.call-box {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 16px;
  margin: 6px 0 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.call-hint {
  font-size: 14px;
  color: #4A4A4A;
  line-height: 1.6;
  margin-bottom: 12px;
}
.call-btn {
  display: block;
  background: #1E6FD9;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: inherit;
}
.call-btn:active { transform: scale(0.97); }

/* বাতিল করা দোকানে কেনাকাটার ইনপুট/বাটন নিষ্ক্রিয় */
.readonly-mode input:disabled,
.readonly-mode select:disabled {
  background: #F1F1F1;
  color: #8A8A8A;
  cursor: not-allowed;
}
.readonly-mode .plus-btn:disabled,
.readonly-mode .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ===== Home top bar ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.top-mobile {
  font-size: 15px;
  font-weight: 600;
  color: #666;
}
.logout-btn {
  background: #FFFFFF;
  color: #E53935;
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
}
.logout-btn:active { transform: scale(0.95); }

/* ===== Login page ===== */
.login-header {
  padding: 24px 4px 20px;
}
.login-title {
  font-size: 26px;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 15px;
  color: #666;
}

.delete-note {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  padding: 0 4px 16px;
}

/* Empty state */
.empty-text {
  text-align: center; color: #999; font-size: 15px;
  padding: 40px 20px;
}

/* ===== Detail page text summary ===== */
.summary-text {
  font-size: 17px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 8px;
  padding: 0 4px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 16px 4px 8px;
}

/* Jinis row: 3 inputs + button */
.jinis-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.jinis-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  padding: 12px 10px;
  font-size: 15px;
  font-family: inherit;
  color: #1A1A1A;
  outline: none;
  background: #FAFAFA;
}
.jinis-row input:focus {
  border-color: #1A1A1A;
  background: #FFFFFF;
}
.jinis-row .plus-btn,
.jinis-row .remove-btn {
  flex-shrink: 0;
}

/* ===== Ledger page ===== */
.ledger-table-wrap {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 760px;
}

.ledger-table thead th {
  background: #1A1A1A;
  color: #FFFFFF;
  font-weight: 700;
  text-align: left;
  padding: 10px 8px;
  white-space: nowrap;
}

.ledger-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #F0F0F0;
  color: #1A1A1A;
  vertical-align: top;
  white-space: nowrap;
}

.ledger-table tbody tr:last-child td {
  border-bottom: none;
}

.ledger-table .jinis-cell {
  white-space: normal;
  min-width: 160px;
}

.ledger-table .jinis-cell div {
  line-height: 1.6;
}

.ledger-table .empty-text {
  text-align: center;
  padding: 20px;
  color: #999;
  white-space: normal;
}