@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");
:root {
  --bg: #f5f4ef;
  --surface: #fff;
  --ink: #19201d;
  --muted: #6d746f;
  --line: #e7e5dd;
  --green: #154f3f;
  --green2: #26765f;
  --mint: #dcece4;
  --coral: #ef745b;
  --amber: #eab75d;
  --purple: #6d5dfc;
  --shadow: 0 14px 45px rgba(27, 45, 38, 0.09);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
img {
  max-width: 100%;
}
.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--green2);
}
.splash {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.splash strong {
  font: 800 25px Manrope;
}
.splash span {
  color: var(--muted);
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font: 800 25px Manrope;
  box-shadow: 0 10px 25px rgba(21, 79, 63, 0.25);
  transform: rotate(-3deg);
}
.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 10%, #e4eee6 0, transparent 35%),
    radial-gradient(circle at 90% 80%, #f9e2d8 0, transparent 36%), var(--bg);
}
.login-card {
  width: min(100%, 430px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}
.login-brand h1 {
  font: 800 24px Manrope;
  margin: 0;
}
.login-card h2 {
  font: 800 34px/1.08 Manrope;
  margin: 0 0 10px;
}
.login-card > p {
  margin: 0 0 28px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #4d554f;
}
label small {
  font-weight: 400;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
  transition: 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green2);
  box-shadow: 0 0 0 3px rgba(38, 118, 95, 0.12);
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.18s;
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--green);
  color: #fff;
}
.btn.secondary {
  background: var(--mint);
  color: var(--green);
}
.btn.soft {
  background: #efeee9;
  color: var(--ink);
}
.btn.danger {
  background: #fde5e0;
  color: #a63725;
}
.btn.wide {
  width: 100%;
  padding: 15px;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.text-btn {
  border: 0;
  background: none;
  color: var(--green2);
  font-weight: 800;
  padding: 8px;
}
.app-shell {
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 245px;
  background: #173f35;
  color: #fff;
  padding: 28px 18px;
  display: none;
  z-index: 20;
}
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 32px;
  font: 800 20px Manrope;
}
.sidebar .brand-mark {
  background: #eff7f2;
  color: var(--green);
  width: 40px;
  height: 40px;
  font-size: 20px;
}
.nav-list {
  display: grid;
  gap: 5px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #bad0c8;
  border-radius: 13px;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  display: flex;
  gap: 12px;
  align-items: center;
}
.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}
.nav-item .nav-icon {
  width: 24px;
  text-align: center;
}
.sidebar-footer {
  position: absolute;
  bottom: 24px;
  left: 18px;
  right: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
}
.sidebar-footer small {
  display: block;
  color: #94b3a8;
  margin: 0 10px 10px;
}
.main {
  min-height: 100dvh;
  padding: 18px 16px calc(88px + var(--safe-bottom));
  max-width: 1180px;
  margin: auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.topbar h1 {
  font: 800 25px Manrope;
  margin: 0;
}
.topbar-actions {
  display: flex;
  gap: 8px;
}
.avatar {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #e2dffb;
  color: #4938bd;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom));
  height: 66px;
  background: rgba(23, 63, 53, 0.96);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px;
  box-shadow: 0 14px 35px rgba(16, 49, 40, 0.3);
}
.bottom-nav button {
  border: 0;
  background: transparent;
  color: #a9c4bb;
  border-radius: 15px;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  gap: 1px;
}
.bottom-nav button span {
  font-size: 20px;
}
.bottom-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.welcome h2 {
  font: 800 clamp(28px, 5vw, 42px) / 1.1 Manrope;
  margin: 5px 0;
}
.welcome p {
  margin: 0;
  color: var(--muted);
}
.date-chip {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.quick-card {
  min-height: 132px;
  border: 0;
  border-radius: 20px;
  padding: 17px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: 0.2s;
}
.quick-card:active {
  transform: scale(0.98);
}
.quick-card strong {
  font: 800 20px Manrope;
  display: block;
  margin-top: 25px;
}
.quick-card small {
  opacity: 0.7;
}
.quick-card .qicon {
  font-size: 24px;
}
.quick-card.entry {
  background: var(--green);
  color: #fff;
}
.quick-card.exit {
  background: #ffe3dc;
  color: #7f2f20;
}
.quick-card.receipt {
  background: #eeeafe;
  color: #4b3baa;
}
.quick-card.search {
  background: #f7eacb;
  color: #694c17;
}
.quick-card:after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border: 18px solid currentColor;
  opacity: 0.06;
  border-radius: 50%;
  right: -20px;
  top: -20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 17px;
}
.stat-card .stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.stat-card strong {
  font: 800 25px Manrope;
  display: block;
  margin-top: 10px;
}
.stat-card strong small {
  font-size: 13px;
  color: var(--muted);
}
.stat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green2);
}
.stat-dot.coral {
  background: var(--coral);
}
.stat-dot.amber {
  background: var(--amber);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 13px;
}
.section-head h2,
.section-head h3 {
  font: 800 19px Manrope;
  margin: 0;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
}
.activity-list {
  padding: 4px 16px;
}
.activity {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0eee9;
}
.activity:last-child {
  border: 0;
}
.home-expiry-list {
  padding: 5px 14px;
}
.home-expiry {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #f0eee9;
  background: transparent;
  color: inherit;
  text-align: left;
}
.home-expiry:last-child {
  border: 0;
}
.home-expiry .product-thumb {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}
.home-expiry strong,
.home-expiry small {
  display: block;
}
.home-expiry small,
.home-expiry-empty {
  color: var(--muted);
  font-size: 11px;
}
.home-expiry-empty {
  margin: 0;
  padding: 17px 3px;
}
.activity-icon,
.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #edf2ee;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.activity-icon img,
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.activity strong {
  display: block;
  font-size: 14px;
}
.activity small {
  color: var(--muted);
}
.qty {
  font-weight: 800;
}
.qty.plus {
  color: var(--green2);
}
.qty.minus {
  color: var(--coral);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h2 {
  font: 800 29px Manrope;
  margin: 3px 0;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.searchbar {
  position: relative;
  margin-bottom: 15px;
}
.searchbar input {
  padding-left: 42px;
  background: #fff;
}
.searchbar:before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 9px;
  font-size: 24px;
  color: var(--muted);
  z-index: 1;
}
.filter-row {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 13px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.product-grid {
  display: grid;
  gap: 10px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 13px;
  align-items: center;
  text-align: left;
  width: 100%;
  color: inherit;
}
.product-card .product-thumb {
  width: 54px;
  height: 54px;
}
.product-card h3 {
  font-size: 15px;
  margin: 0 0 4px;
}
.product-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.stock-pill {
  font: 800 16px Manrope;
  text-align: right;
}
.stock-pill small {
  display: block;
  font: 500 10px "DM Sans";
  color: var(--muted);
}
.stock-pill.low {
  color: var(--coral);
}
.scanner-page {
  margin: -18px -16px calc(-88px - var(--safe-bottom));
  min-height: 100dvh;
  background: #0d1e1a;
  color: #fff;
  padding-bottom: 90px;
}
.scanner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px;
}
.scanner-top h2 {
  font: 800 20px Manrope;
  margin: 0;
}
.scanner-top-actions {
  display: flex;
  gap: 7px;
}
.scanner-top-actions .icon-btn.active {
  background: #77efbd;
  color: #103b30;
}
.scanner-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 16px 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 15px;
}
.scanner-mode button {
  border: 0;
  background: transparent;
  color: #b9cac5;
  border-radius: 11px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 800;
}
.scanner-mode button.active {
  background: #fff;
  color: #163f34;
}
.quick-scan-toggle {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  display: grid;
  grid-template-columns: 34px 1fr 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e7e2;
  text-align: left;
}
.quick-scan-toggle span {
  font-size: 23px;
}
.quick-scan-toggle strong,
.quick-scan-toggle small {
  display: block;
}
.quick-scan-toggle small {
  color: #9fb7af;
  margin-top: 2px;
}
.quick-scan-toggle i {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #536a63;
  position: relative;
}
.quick-scan-toggle i:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.quick-scan-toggle.active {
  background: rgba(114, 244, 190, 0.16);
  border-color: rgba(114, 244, 190, 0.55);
}
.quick-scan-toggle.active i {
  background: #64dda9;
}
.quick-scan-toggle.active i:after {
  transform: translateX(16px);
}
.camera-wrap {
  position: relative;
  margin: 0 16px;
  border-radius: 24px;
  overflow: hidden;
  background: #142c26;
  aspect-ratio: 3/4;
  max-height: 62vh;
}
.camera-wrap.scan-success {
  animation: scan-confirm 0.45s ease-out;
}
@keyframes scan-confirm {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(91, 240, 178, 0);
  }
  35% {
    box-shadow: inset 0 0 0 7px rgba(91, 240, 178, 0.95);
  }
}
.camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#html5-reader {
  width: 100%;
  height: 100%;
  border: 0 !important;
  background: #0d1e1a;
}
#html5-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
#html5-reader__scan_region {
  width: 100%;
  height: 100%;
}
#html5-reader__dashboard,
#html5-reader img[alt="Info icon"] {
  display: none !important;
}
.camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
  color: #a9c0b8;
  z-index: 4;
}
.camera-empty span {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}
.scan-frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 37%;
  height: 25%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 3;
}
.scan-line {
  height: 2px;
  background: #72f4be;
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  box-shadow: 0 0 12px #72f4be;
  animation: scan 2s ease-in-out infinite;
}
.scanner-live {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(8, 25, 20, 0.78);
  color: #d9eee6;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}
@keyframes scan {
  0%,
  100% {
    transform: translateY(-45px);
  }
  50% {
    transform: translateY(45px);
  }
}
.scanner-actions {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.scanner-actions input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.scanner-actions input::placeholder {
  color: #9bb1aa;
}
.scanner-result {
  margin: 0 16px;
  background: #fff;
  color: var(--ink);
  border-radius: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
}
.scanner-result-panel {
  margin: 0 16px;
  padding: 12px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
}
.scanner-product-open {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 2px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.scanner-product-open strong,
.scanner-product-open small {
  display: block;
}
.scanner-product-open small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.scan-stepper {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.scan-step {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  font-size: 29px;
  font-weight: 800;
}
.scan-step.minus {
  background: #fde5e0;
  color: #a63725;
}
.scan-step.plus {
  background: var(--green);
  color: #fff;
}
.scan-step:active {
  transform: scale(0.94);
}
.scan-stock {
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 15px;
  background: #f3f2ed;
}
.scan-stock strong {
  font: 800 24px Manrope;
}
.scan-stock small {
  color: var(--muted);
  font-size: 10px;
}
.scanner-help {
  text-align: center;
  color: #9eb4ad;
  font-size: 12px;
  padding: 12px;
}
.shopping-summary {
  background: var(--green);
  color: #fff;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shopping-summary strong {
  font: 800 28px Manrope;
  display: block;
}
.shopping-list {
  padding: 4px 15px;
}
.shopping-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.shopping-item:last-child {
  border: 0;
}
.check {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  border: 2px solid #c9cec9;
  background: white;
}
.check.checked {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.shopping-item.checked .item-name {
  text-decoration: line-through;
  color: var(--muted);
}
.need-pill {
  background: #f2f0eb;
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}
.expiry-group {
  margin-bottom: 18px;
}
.expiry-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 3px 9px;
}
.expiry-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 16px;
  padding: 13px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 45px 1fr auto;
  gap: 11px;
  align-items: center;
}
.expiry-card.urgent {
  border-left-color: var(--coral);
}
.days-badge {
  text-align: right;
  font-weight: 800;
  color: #a96d06;
}
.days-badge.urgent {
  color: var(--coral);
}
.chart-card {
  padding: 18px;
  margin-bottom: 14px;
}
.chart-card h3 {
  font: 800 16px Manrope;
  margin: 0 0 20px;
}
.bars {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.bar-col {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}
.bar {
  background: linear-gradient(var(--green2), var(--green));
  border-radius: 8px 8px 2px 2px;
  min-height: 3px;
  margin-bottom: 6px;
  position: relative;
}
.bar:hover:after {
  content: attr(data-value);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 10px;
}
.rank-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  font-size: 13px;
}
.rank-track {
  height: 8px;
  background: #eee;
  border-radius: 9px;
  overflow: hidden;
}
.rank-track span {
  display: block;
  height: 100%;
  background: var(--purple);
  border-radius: 9px;
}
.assistant-hero {
  background: linear-gradient(135deg, #203e36, #183129);
  color: #fff;
  border-radius: 25px;
  padding: 25px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.assistant-hero:after {
  content: "✦";
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 75px;
  color: rgba(255, 255, 255, 0.08);
}
.assistant-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.assistant-reset {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #d8ece5;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.assistant-reset:active {
  transform: scale(0.97);
}
.assistant-hero h2 {
  font: 800 28px Manrope;
  margin: 8px 0;
}
.assistant-hero p {
  color: #bcd0c9;
  margin: 0;
  max-width: 500px;
}
.suggestions {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 12px 0 16px;
  scrollbar-width: none;
}
.suggestion {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 190px;
  text-align: left;
  font-size: 12px;
  color: var(--ink);
}
.chat-box {
  padding: 16px;
}
.chat-messages {
  min-height: 160px;
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  align-self: flex-end;
  background: var(--green);
  color: white;
  border-bottom-right-radius: 5px;
}
.bubble.ai {
  background: #f0efe9;
  border-bottom-left-radius: 5px;
  color: var(--ink);
  align-self: flex-start;
}
.bubble.ai.pending {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.bubble.ai.error {
  background: #fde7e2;
  color: #8a291a;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green2);
  animation: typing-dot 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-dot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.chat-form input {
  background: #f8f7f3;
}
.settings-grid {
  display: grid;
  gap: 14px;
}
.settings-card {
  padding: 19px;
}
.settings-card h3 {
  font: 800 17px Manrope;
  margin: 0 0 4px;
}
.settings-card > p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 17px;
}
.form-stack {
  display: grid;
  gap: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-section {
  display: grid;
  gap: 13px;
}
.form-section h3 {
  margin: 10px 0 0;
  font: 800 15px Manrope;
}
.location-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.location-tag {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
}
.location-tag:before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tag-color);
  margin-right: 6px;
}
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: rgba(9, 20, 17, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: var(--bg);
  width: 100%;
  max-height: 92dvh;
  overflow: auto;
  border-radius: 28px 28px 0 0;
  padding: 18px 18px calc(25px + var(--safe-bottom));
  animation: up 0.25s ease;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.modal-head h2 {
  font: 800 23px Manrope;
  margin: 3px 0;
}
.modal-close {
  border: 0;
  background: #e9e8e2;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 20px;
}
.product-hero {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 15px;
  align-items: center;
  margin-bottom: 18px;
}
.product-hero .product-thumb {
  width: 85px;
  height: 85px;
  border-radius: 20px;
}
.stock-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 0;
}
.stock-control .btn {
  padding: 15px;
}
.inline-lot-card {
  margin: 18px 0 8px;
  padding: 17px;
  border: 1px solid #badbd0;
  border-radius: 20px;
  background: #edf8f4;
}
.inline-lot-card h3 {
  margin: 3px 0;
  font: 800 18px Manrope;
}
.inline-lot-card p,
.lot-explainer {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -4px;
}
.date-shortcuts button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.detail-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.detail-tabs button {
  border: 0;
  background: #e8e7e1;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}
.lot-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.receipt-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 15px;
  background: #ecebe5;
  margin-bottom: 14px;
}
.receipt-line {
  display: block;
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.receipt-line-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 11px;
}
.receipt-line-head strong {
  font: 800 14px Manrope;
}
.receipt-line-head span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f5ef;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}
.receipt-description {
  margin-bottom: 10px;
}
.receipt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.receipt-fields label:last-child {
  grid-column: 1 / -1;
}
.receipt-product-link {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.receipt-create-toggle {
  padding: 11px 12px;
}
.receipt-create-toggle.active {
  background: #dff4eb;
  color: var(--green);
  border-color: #a9d7c7;
}
.receipt-new-product {
  margin-top: 11px;
  padding: 13px;
  border-radius: 14px;
  background: #f1f0eb;
}
.receipt-new-title {
  margin-bottom: 9px;
  color: var(--green);
  font: 800 13px Manrope;
}
.receipt-new-product p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin: 12px 0;
}
.alert.danger {
  background: #fde7e2;
  color: #8a291a;
}
.alert.success {
  background: #e0f0e7;
  color: #174f3e;
}
.empty {
  text-align: center;
  padding: 42px 20px;
  color: var(--muted);
}
.empty span {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
.spinner {
  width: 25px;
  height: 25px;
  border: 3px solid #ddd;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  transform: translate(-50%, 20px);
  background: #18211e;
  color: #fff;
  border-radius: 13px;
  padding: 11px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: #a43e2c;
}
.installer {
  background: #173f35;
  min-height: 100dvh;
}
.install-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1120px;
  margin: auto;
}
.install-hero {
  padding: 40px 25px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.install-hero .brand-mark {
  background: #fff;
  color: var(--green);
  margin-bottom: 35px;
}
.install-hero h1 {
  font: 800 clamp(39px, 7vw, 66px) / 1.02 Manrope;
  margin: 12px 0;
}
.install-hero h1 em {
  color: #f2c76f;
  font-style: normal;
}
.install-hero > p {
  color: #b9d0c8;
  max-width: 490px;
  font-size: 17px;
}
.install-points {
  display: grid;
  gap: 10px;
  color: #d9e8e3;
  margin-top: 24px;
  font-weight: 600;
}
.install-card {
  background: var(--bg);
  padding: 30px 22px;
}
.install-card h2 {
  font: 800 29px Manrope;
  margin: 8px 0;
}
.install-card > .muted {
  margin-top: 0;
}
.step-pill {
  background: var(--mint);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  border-radius: 8px;
}
.install-form {
  display: grid;
  gap: 20px;
  margin-top: 23px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 22px;
}
@media (min-width: 700px) {
  .main {
    padding: 28px 30px 40px;
  }
  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .product-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modal-backdrop {
    align-items: center;
    padding: 25px;
  }
  .modal {
    max-width: 720px;
    border-radius: 28px;
    padding: 25px;
    max-height: 90vh;
  }
  .receipt-fields {
    grid-template-columns: 0.65fr 1fr 1fr;
  }
  .receipt-fields label:last-child {
    grid-column: auto;
  }
  .receipt-product-link {
    grid-template-columns: 1fr auto;
  }
  .date-chip {
    display: block;
  }
  .scanner-page {
    margin: -28px -30px -40px;
  }
  .camera-wrap {
    aspect-ratio: 16/9;
    max-height: 58vh;
  }
  .install-wrap {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .install-hero {
    padding: 55px;
  }
  .install-card {
    padding: 55px 45px;
    overflow: auto;
  }
  .install-form {
    padding: 26px;
  }
}
@media (min-width: 1020px) {
  .sidebar {
    display: block;
  }
  .main {
    margin-left: 245px;
    padding: 32px 38px;
    max-width: none;
  }
  .bottom-nav {
    display: none;
  }
  .topbar {
    display: none;
  }
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
    gap: 24px;
  }
  .home-layout .right-col .section-head {
    margin-top: 0;
  }
  .scanner-page {
    margin: -32px -38px -40px;
    min-height: 100vh;
    padding: 25px 6vw;
  }
  .camera-wrap {
    aspect-ratio: 16/8;
    max-height: 60vh;
  }
  .settings-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
