:root {
  --primary:       #c32a00;
  --primary-dark:  #911f00;
  --primary-light: #e03000;
  --primary-glow:  rgba(195,42,0,.14);
  --bg:            #ede7e0;
  --surface:       #ffffff;
  --surface-alt:   #faf8f5;
  --border:        #d4ccc4;
  --border-light:  #ece6e0;
  --text:          #1c1917;
  --text-muted:    #78716c;
  --radius-card:   18px;
  --radius-btn:    13px;
  --radius-input:  11px;
  --shadow-card:   0 1px 2px rgba(0,0,0,.04), 0 4px 20px rgba(0,0,0,.08);
  --shadow-float:  0 2px 8px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.10);
  --font-ne: 'Hind','Noto Sans Devanagari','Nirmala UI','Kohinoor Devanagari','Mangal',sans-serif;
}

[lang="ne"] body,
[lang="ne"] button,
[lang="ne"] input,
[lang="ne"] select,
[lang="ne"] label,
[lang="ne"] div,
[lang="ne"] span { font-family: var(--font-ne); }

/* Devanagari needs more vertical space — vowel marks clip at tight line-heights */
[lang="ne"] .txn-title { line-height: 1.65; }
[lang="ne"] .txn-sub   { line-height: 1.65; }
[lang="ne"] .txn-badge { line-height: 1.65; }
[lang="ne"] .txn-item  { padding-top: 14px; padding-bottom: 14px; }

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  padding-bottom: 80px;
  min-height: 100vh;
  color: var(--text);
}

/* ── Header ── */
.app-header {
  background: #c32a00;
  color: white;
  padding: 12px 16px 11px;
  position: sticky;
  top: 0; z-index: 200;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 4px 24px rgba(120,40,0,.28);
}
.app-header .depot-name { font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.app-header .depot-date { font-size: .7rem; color: rgba(255,255,255,.78); letter-spacing: .2px; }

/* Language toggle */
.lang-btn {
  background: rgba(0,0,0,.25);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 20px;
  padding: 4px 11px; font-size: .7rem; font-weight: 700;
  letter-spacing: .4px; cursor: pointer;
  transition: background .18s; white-space: nowrap;
}
.lang-btn:hover { background: rgba(0,0,0,.38); }

/* ── Stock cards ── */
.stock-card {
  border-radius: 18px; border: none; text-align: center;
  padding: 22px 10px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08);
  transition: transform .16s, box-shadow .16s;
}
.stock-card:active { transform: scale(.97); }
@media (hover:hover) {
  .stock-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
}
.stock-card .num { font-size: 3rem; font-weight: 800; line-height: 1; position: relative; }
.stock-card .lbl {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; margin-top: 5px; opacity: .88; position: relative;
}
.low-stock-pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); display: flex;
  box-shadow: 0 -1px 0 var(--border-light), 0 -4px 20px rgba(0,0,0,.06);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav button {
  flex: 1; border: none; background: none;
  padding: 8px 4px 6px; font-size: .63rem; color: #a8a29e;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; transition: color .16s; position: relative;
}
.bottom-nav button i { font-size: 1.35rem; transition: transform .16s; }
.bottom-nav button.active { color: var(--primary); font-weight: 700; }
.bottom-nav button.active i { transform: translateY(-1px); }
.bottom-nav button.active::before {
  content: ''; position: absolute; top: 0; left: 24%; right: 24%;
  height: 3px; background: var(--primary); border-radius: 0 0 4px 4px;
}

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }

/* ── Action buttons ── */
.action-btn {
  border-radius: var(--radius-btn); padding: 14px 18px;
  font-size: .98rem; font-weight: 700; border: none; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s, box-shadow .12s, filter .12s;
  cursor: pointer; letter-spacing: .2px;
}
.action-btn:active { transform: scale(.96); box-shadow: 0 1px 4px rgba(0,0,0,.10); }
@media (hover:hover) {
  .action-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 4px 20px rgba(0,0,0,.18); }
}
.action-btn i { font-size: 1.25rem; }

/* ── Cards ── */
.app-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  overflow: hidden;
}
.app-card .card-body { padding: 18px; }

/* ── Transaction list ── */
.txn-item {
  display: flex; align-items: flex-start; padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.05);
  border-left: 3px solid transparent;
  transition: box-shadow .15s;
}
.txn-item:last-child { margin-bottom: 0; }
@media (hover:hover) { .txn-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 4px 18px rgba(0,0,0,.08); } }
.txn-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; margin-right: 12px; margin-top: 1px;
}
.txn-title { font-weight: 700; font-size: .92rem; color: var(--text); line-height: 1.4; }
.txn-sub { font-size: .77rem; color: var(--text-muted); margin-top: 2px; }
.txn-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.txn-badge {
  font-size: .62rem; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: .2px; white-space: nowrap;
}
.txn-amount { font-size: 1.05rem; font-weight: 800; white-space: nowrap; line-height: 1.2; }
.txn-time { font-size: .68rem; color: #928c87; white-space: nowrap; margin-top: 3px; }

/* Transaction edit button */
.txn-act-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 7px; padding: 3px 7px;
  font-size: .69rem; cursor: pointer; color: #a8a29e;
  transition: all .15s; line-height: 1.5; margin-top: 4px;
}
.txn-act-btn:hover { background: var(--primary-glow); color: var(--primary); border-color: var(--primary); }

/* ── Forms ── */
.form-control, .form-select {
  font-size: .97rem; padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface);
  outline: none;
}
.form-control::placeholder { color: #b8b0a8; }
.form-label { font-weight: 700; color: #44403c; font-size: .86rem; margin-bottom: 6px; }

/* ── Report ── */
.report-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.report-row:last-child { border-bottom: none; }
.report-label { color: #57534e; font-size: .88rem; }
.report-value { font-weight: 700; font-size: .98rem; }
.revenue-box {
  background: #c32a00;
  border-radius: 14px; padding: 18px;
  color: white; margin-top: 14px;
  box-shadow: 0 6px 24px rgba(184,64,0,.28);
}
.revenue-box .report-row { border-bottom-color: rgba(255,255,255,.18); }
.revenue-box .report-label { color: rgba(255,255,255,.78); font-size: .83rem; }
.revenue-box .report-value { color: white; font-size: .9rem; }
.revenue-box .amount { font-size: 2.1rem; font-weight: 800; line-height: 1; margin-top: 10px; }

/* Scrollable item picker */
#item-picker-list::-webkit-scrollbar,
#catalog-list-rows::-webkit-scrollbar,
#restock-list-rows::-webkit-scrollbar { width: 4px; }
#item-picker-list::-webkit-scrollbar-thumb,
#catalog-list-rows::-webkit-scrollbar-thumb,
#restock-list-rows::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Section titles ── */
.section-title {
  font-size: .67rem; text-transform: uppercase; letter-spacing: 1.4px;
  color: #a8a29e; font-weight: 700; margin: 22px 0 10px;
}

/* ── Toast ── */
.toast-wrap {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 9999; width: 92%; max-width: 420px;
}
.my-toast {
  border-radius: 13px; padding: 12px 16px; font-weight: 600;
  font-size: .9rem; color: white;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 10px;
  animation: slideDown .2s ease;
}
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }

/* ── Today's Summary mini cards ── */
.summary-mini {
  border-radius: 13px; padding: 14px 8px; text-align: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
}
.summary-mini .val { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.summary-mini .lbl {
  font-size: .65rem; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; margin-top: 4px;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 28px 20px; color: #c4bdb6; }
.empty-state i { font-size: 2.4rem; opacity: .35; display: block; margin-bottom: 10px; }

/* ── Setup ── */
#setup-screen {
  min-height: 100vh;
  background: #c32a00;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.setup-card {
  background: var(--surface); border-radius: 22px; padding: 30px 24px;
  max-width: 420px; width: 100%; box-shadow: var(--shadow-float);
}

/* ── Pending overview on home ── */
#pending-overview {
  border-left: 4px solid #dc3545;
}

/* Nepali font boost */
[lang="ne"] body, .ne-text { font-size: 1.02em; }
