/* নিউ আন নূর গোডাউন স্টক — simple, big, readable. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #0b6e4f;
  --green-dark: #08543c;
  --orange: #f97316;
  --red: #dc2626;
  --ink: #1a1a1a;
  --soft: #f1f5f3;
  --line: #d7e0db;
}

html { font-size: 18px; }

body {
  font-family: 'Noto Sans Bengali', 'Hind Siliguri', sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 1.05rem;
}
input:focus { outline: none; border-color: var(--green); }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
}
.btn-main { background: var(--green); color: #fff; width: 100%; }
.btn-main:active { background: var(--green-dark); }
.btn-big { font-size: 1.15rem; min-height: 60px; }
.btn-ghost { background: #fff; border: 2px solid var(--line); color: var(--ink); }
.btn-photo { background: var(--orange); color: #fff; display: inline-block; text-align: center; }
.msg { min-height: 1.4em; margin-top: 8px; }
.msg.error { color: var(--red); font-weight: 600; }

/* ------------------------------- login ------------------------------- */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--green), var(--green-dark));
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.login-logo { font-size: 3.2rem; }
.login-card h1 { font-size: 1.45rem; margin: 8px 0 2px; }
.shop-name { color: var(--green); font-weight: 700; margin-bottom: 18px; }
.login-hint { font-weight: 600; margin-bottom: 10px; }
.login-card input { margin-bottom: 12px; text-align: center; font-size: 1.2rem; }
.google-btn { display: flex; justify-content: center; margin-bottom: 6px; }
.or-line {
  display: flex; align-items: center; gap: 10px;
  color: #777; margin: 14px 0;
}
.or-line::before, .or-line::after {
  content: ''; flex: 1; border-top: 1px solid var(--line);
}

/* ------------------------------ app shell ----------------------------- */
#appView { max-width: 640px; margin: 0 auto; padding: 0 14px 40px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 2px 10px;
}
.topbar h1 { font-size: 1.5rem; color: var(--green-dark); }
.shop-name-sm { color: #555; font-size: .9rem; }
.topbar .btn { min-height: 44px; padding: 8px 14px; }

.totals { display: flex; gap: 12px; margin: 6px 0 14px; }
.total-box {
  flex: 1; background: var(--green); color: #fff;
  border-radius: 16px; padding: 14px; text-align: center;
}
.total-box:last-child { background: var(--orange); }
.total-num { display: block; font-size: 2rem; font-weight: 800; line-height: 1.15; }
.total-label { font-size: .92rem; font-weight: 600; }

.search-row { margin-bottom: 12px; }
.search-row input { font-size: 1.1rem; padding: 16px; border-radius: 14px; }

#addToggleBtn { margin-bottom: 14px; }

/* ------------------------------- form -------------------------------- */
.form-card {
  background: #fff; border: 2px solid var(--green);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.form-card h2 { font-size: 1.2rem; margin-bottom: 12px; }
.form-card label { display: block; font-weight: 700; margin-bottom: 14px; }
.form-card label input { margin-top: 6px; }
.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.photo-preview {
  width: 96px; height: 96px; flex: none;
  border: 2px dashed var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #888; font-size: .85rem; text-align: center; overflow: hidden;
  background: var(--soft);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; }
.form-btns { display: flex; gap: 10px; }
.form-btns .btn-main { flex: 1; }

/* ------------------------------- items -------------------------------- */
.items { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.item {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px;
}
.item.low { border-color: var(--red); background: #fff7f7; }
.item-main { display: flex; gap: 12px; align-items: center; }
.thumb {
  width: 72px; height: 72px; flex: none; border-radius: 12px;
  object-fit: cover; background: var(--soft);
  border: 1px solid var(--line); cursor: pointer;
}
.thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; cursor: default;
}
.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 1.08rem; overflow-wrap: anywhere; }
.item-qty { font-size: 1rem; color: #444; }
.item-qty b { font-size: 1.35rem; color: var(--green-dark); }
.item.low .item-qty b { color: var(--red); }
.badge-low {
  display: inline-block; background: var(--red); color: #fff;
  font-size: .8rem; font-weight: 700; border-radius: 999px;
  padding: 2px 10px; margin-left: 6px; vertical-align: middle;
}
.item-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-minus, .btn-plus {
  flex: 1; font-size: 1.7rem; font-weight: 800; min-height: 60px;
  border-radius: 14px; color: #fff; border: none; cursor: pointer;
}
.btn-minus { background: var(--red); }
.btn-plus { background: var(--green); }
.btn-minus:active, .btn-plus:active { filter: brightness(.85); }
.item-tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.item-tools .btn { min-height: 44px; padding: 8px 12px; font-size: .92rem; }
.btn-delete { color: var(--red); }
.adjust-row {
  display: none; gap: 8px; margin-top: 10px; align-items: stretch;
}
.adjust-row.open { display: flex; }
.adjust-row input { flex: 1; text-align: center; }
.adjust-row .btn { flex: 1; }
.btn-out { background: #fff; border: 2px solid var(--red); color: var(--red); }
.btn-in { background: #fff; border: 2px solid var(--green); color: var(--green); }

.empty { text-align: center; color: #666; padding: 18px 0; }

/* ------------------------------ activity ------------------------------ */
.activity { margin-top: 26px; }
.activity h2 { font-size: 1.2rem; margin-bottom: 10px; color: var(--green-dark); }
.activity ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.activity li {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: .95rem;
}
.activity .delta-in { color: var(--green); font-weight: 800; }
.activity .delta-out { color: var(--red); font-weight: 800; }
.activity .when { color: #777; font-size: .85rem; display: block; }

/* ------------------------------- modal -------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal img { max-width: 100%; max-height: 75dvh; border-radius: 14px; }
.modal p { color: #fff; font-weight: 700; margin-top: 12px; text-align: center; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: #fff; border: none; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; cursor: pointer;
}
