/* ===================== Niqesh Sales — style.css ===================== */
:root {
  --header: #444444;
  --body-bg: #FFFFFF;
  --text: #222222;
  --muted: #777777;
  --btn: #4EB86E;
  --btn-hover: #444444;
  --card-bg: #F7F7F7;
  --border: #E3E3E3;
  --red: #D64545;
  --green: #4EB86E;
  --font-en: 'Syne', sans-serif;
  --font-body: 'Hind Siliguri', sans-serif;
}
body.theme-dark {
  --body-bg: #17181A;
  --text: #F0F0F0;
  --muted: #9A9A9A;
  --card-bg: #232426;
  --border: #333436;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body), var(--font-en);
  background: var(--body-bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
body.lang-bn, body.lang-bn input, body.lang-bn select { font-family: 'Hind Siliguri', sans-serif; }

a { color: var(--btn); text-decoration: none; }

/* ---------------- Header ---------------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--header); padding: 10px 14px; position: sticky; top: 0; z-index: 20;
}
.header-side { width: 44px; display: flex; align-items: center; }
.header-side.right { justify-content: flex-end; }
.header-center { flex: 1; display: flex; flex-direction: column; align-items: center; }
.logo { height: 30px; object-fit: contain; }
.header-subtitle { color: #fff; font-size: 13px; margin-top: 2px; font-weight: 500; }
.business-name-tag { color: #ddd; font-size: 11px; margin-top: 2px; }
.back-btn { background: none; border: none; padding: 6px; cursor: pointer; }

.theme-switch { background: none; border: none; cursor: pointer; padding: 6px; }

.lang-switcher select {
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px; padding: 4px 6px; font-size: 12px;
}

/* ---------------- Layout ---------------- */
.screen-body { padding: 16px; max-width: 720px; margin: 0 auto 40px; }
.pin-screen-wrap { display: flex; flex-direction: column; padding: 40px 24px; max-width: 360px; margin: 0 auto; }

.section-title { font-family: var(--font-en); font-weight: 700; font-size: 15px; margin: 22px 0 10px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.bold { font-weight: 600; }
.italic { font-style: italic; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: var(--btn); color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 600; margin-bottom: 12px; cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn.outline { background: transparent; color: var(--btn); border: 1.5px solid var(--btn); }
.btn.outline:hover { background: var(--btn); color: #fff; }
.btn.small { padding: 8px; font-size: 13px; }
.btn.disabled { background: #C9C9C9; color: #888; cursor: not-allowed; }
.btn.disabled:hover { background: #C9C9C9; }
.btn.whatsapp { background: #25D366; }
.btn.whatsapp:hover { background: #128C4A; }
.btn.danger { background: var(--red); }

.icon-btn { background: none; border: none; cursor: pointer; padding: 6px; }
.icon-btn.danger svg, .icon-btn.danger i { color: var(--red); }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); font-size: 14.5px; font-family: inherit;
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.pin-input { text-align: center; letter-spacing: 8px; font-size: 22px; padding: 12px; }

.gender-switch { display: flex; gap: 8px; }
.gender-switch button {
  flex: 1; padding: 10px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); cursor: pointer;
}
.gender-switch button.active { background: var(--btn); color: #fff; border-color: var(--btn); }

/* ---------------- Messages ---------------- */
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.msg.error { background: #FCE7E7; color: #A32828; }
.msg.success { background: #E4F6EA; color: #1C7A3F; }

/* ---------------- Cards / stats ---------------- */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.stat-row { display: flex; gap: 10px; margin-bottom: 6px; }
.stat-card { flex: 1; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.stat-label { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-family: var(--font-en); font-weight: 700; font-size: 17px; }
.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }
.shimmer { height: 17px; border-radius: 4px; background: linear-gradient(90deg,var(--border) 25%,#f2f2f2 37%,var(--border) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%{background-position:100% 50%} 100%{background-position:0 50%} }

.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entry-info { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.entry-desc { font-size: 13.5px; }
.entry-amount { font-weight: 600; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; width: fit-content; color: #fff; background: var(--muted); }
.badge.sale { background: var(--green); }
.badge.expense { background: var(--red); }
.badge.due { background: #C99B2E; }

/* ---------------- List rows (HR / reps / clients) ---------------- */
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row-main { display: flex; flex-direction: column; }
.list-row-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.list-row-id { font-family: var(--font-en); font-weight: 700; font-size: 15px; }

/* ---------------- Offline / ribbons / banners ---------------- */
.offline-banner, .ios-banner {
  display: flex; align-items: center; gap: 8px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px;
}
.ios-banner { background: var(--header); color: #fff; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; }
.close-x { margin-left: auto; background: none; border: none; cursor: pointer; }

/* ---------------- Footer ---------------- */
.footer-credit { text-align: center; padding: 18px 10px 30px; font-size: 11.5px; color: var(--muted); }
.brand-niqesh { color: var(--btn); font-weight: 700; }
.brand-digi { color: var(--header); font-weight: 700; }
.brand-wizr { color: var(--btn); font-weight: 700; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 20px;
}
.modal-box { background: var(--body-bg); border-radius: 12px; padding: 20px; width: 100%; max-width: 380px; }
.modal-box h3 { margin-top: 0; }
.recovery-pin-display { font-family: var(--font-en); font-size: 26px; letter-spacing: 6px; text-align: center; padding: 14px; background: var(--card-bg); border-radius: 8px; margin-bottom: 10px; }

/* ---------------- Loading ---------------- */
.loading-wrap { display: flex; justify-content: center; padding: 30px 0; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Filters ---------------- */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row input[type=text] { flex: 2; min-width: 140px; }
.filter-row select { flex: 1; min-width: 100px; }
.filter-row input, .filter-row select {
  padding: 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
}

/* ---------------- Receipt / print ---------------- */
.receipt-print-area, .receipt-capture-area { display: none; }
body.printing-receipt > *:not(.receipt-print-area) { display: none !important; }
body.printing-receipt .receipt-print-area { display: block !important; }
.receipt { font-family: 'Courier New', monospace; width: 100%; }
.receipt-business { text-align: center; font-weight: 700; font-size: 15px; }
.receipt-sub { text-align: center; font-size: 11px; }
.receipt-hr { border: none; border-top: 1px dashed #333; margin: 6px 0; }
.receipt-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.receipt-table th { text-align: left; border-bottom: 1px solid #333; padding: 3px 0; }
.receipt-table td { padding: 3px 0; }
.receipt-line { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.receipt-total { font-weight: 700; font-size: 13px; }
.receipt-footer { text-align: center; font-size: 10px; margin-top: 4px; }

.money-receipt { font-family: var(--font-body), sans-serif; width: 100%; color: #111; }
.mr-header { text-align: center; margin-bottom: 6px; }
.mr-logo { height: 40px; margin-bottom: 4px; }
.mr-title { font-weight: 700; font-size: 15px; }
.mr-sub { font-size: 11px; color: #444; }
.mr-doctitle { text-align: center; font-weight: 700; text-decoration: underline; margin: 14px 0 10px; letter-spacing: 1px; }
.mr-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 8px; }
.mr-line { border-bottom: 1px solid #999; flex: 1; margin-left: 6px; }
.mr-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.5px; }
.mr-table th, .mr-table td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
.mr-table td.amt, .mr-table th.amt { text-align: right; width: 90px; }
.mr-sign { margin-top: 40px; text-align: right; font-size: 12px; }
.mr-sign .line { border-top: 1px solid #333; width: 200px; margin-left: auto; padding-top: 4px; }

@media print {
  .app-header, .footer-credit, .ios-banner { display: none !important; }
}

/* ---------------- Benefits (kept for future subscription-adjacent screens) ---------------- */
.benefit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
