@font-face {
  font-family: Manrope;
  src: url('../assets/manrope.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #202b24;
  --muted: #55635a;
  --green: #215a3d;
  --green-dark: #173c2b;
  --paper: #f6f6ef;
  --card: #fffefa;
  --line: #e6e8dc;
  --lime: #e3f2a6;
  --radius: 22px;
  --page-gutter: clamp(15px, 5vw, 24px);
  --focus: #44774b;
  font-family: Manrope, system-ui, sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--paper);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { flex: none; vertical-align: middle; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }

.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 12px; background: var(--card); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.no-script { padding: var(--page-gutter); }
.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  padding-top: env(safe-area-inset-top);
  background: #fffefa;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 69px;
  padding-inline: var(--page-gutter);
}
.brand { display: inline-flex; min-height: 48px; align-items: center; gap: 9px; }
.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 13px;
  background: var(--green-dark);
  color: var(--lime);
}
.brand-text { display: grid; line-height: 1.22; white-space: nowrap; }
.brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: -.045em; }
.brand-text small { margin-top: 3px; font-size: 10px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 3px; }
.topbar-date { display: none; }
.demo-trigger {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  color: #3e562e;
  padding-inline: 8px;
  border-radius: 14px;
  background: #f1f5e7;
  font-size: 10px;
  font-weight: 800;
}
.demo-trigger span { width: 6px; height: 6px; border-radius: 50%; background: #64863e; }
.header-bell { position: relative; }
.bell-dot { position: absolute; top: 11px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #ba5b36; border: 2px solid var(--card); }
.sidebar { display: none; }

#conteudo {
  width: min(100%, 780px);
  margin-inline: auto;
  padding: 24px var(--page-gutter) calc(93px + env(safe-area-inset-bottom));
}
.tabbar {
  position: fixed;
  z-index: 6;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px #26372a08;
}
.tabbar .nav-link {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  border-radius: 12px;
  font-size: clamp(9px, 2.55vw, 11px);
  font-weight: 750;
}
.nav-icon { display: grid; place-items: center; flex: none; }
.tabbar .nav-icon { width: 38px; height: 29px; border-radius: 10px; }
.tabbar .is-current { color: var(--green-dark); }
.tabbar .is-current .nav-icon { background: #e8efdc; }
.tabbar .nav-create .nav-icon { width: 37px; height: 34px; color: white; background: var(--green); }
.tabbar .nav-create.is-current .nav-icon { color: var(--green-dark); background: var(--lime); }

.page-title {
  color: var(--ink);
  font-size: clamp(30px, 8.6vw, 46px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.058em;
  overflow-wrap: anywhere;
}
.page-intro { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.section-heading { color: var(--ink); font-weight: 800; letter-spacing: -.035em; }
.empty-state { padding: 27px 16px; text-align: center; color: var(--muted); }
.icon-btn, .btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 13px; }
.icon-btn { width: 48px; min-height: 48px; padding: 0; flex: none; color: var(--green-dark); background: transparent; border: 1px solid transparent; }
.btn {
  gap: 8px;
  min-height: 48px;
  padding: 9px 15px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.btn-primary { color: #fff; background: var(--green); }
.btn-secondary { color: var(--green-dark); background: var(--card); border-color: #dfe4d8; }
.btn:active, .icon-btn:active { filter: brightness(.94); }

.dashboard { display: grid; gap: 20px; }
.dash-intro, .dash-overview, .dash-analysis { display: grid; gap: 14px; min-width: 0; }
.shop-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dash-actions { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); gap: 8px; }
.dash-actions .btn { padding-inline: 6px; }
.stock-hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: stretch;
  min-height: 182px;
  border-radius: var(--radius);
  background: linear-gradient(106deg, #163b2a 3%, #214a33 65%, #28533a);
  color: #fffefa;
}
.hero-copy { z-index: 1; display: grid; align-content: center; justify-self: start; min-width: 0; padding: 17px 12px 17px 17px; }
.hero-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; color: var(--lime); background: #f4ffd51a; margin-bottom: 11px; }
.hero-label { color: #dbe9d8; font-weight: 800; font-size: clamp(8px, 2.6vw, 10px); letter-spacing: .075em; text-transform: uppercase; }
.hero-copy strong { font-size: clamp(42px, 13.25vw, 63px); font-weight: 800; line-height: 1.05; letter-spacing: -.075em; }
.hero-note { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--lime); font-weight: 750; font-size: clamp(10px, 3vw, 12px); }
.hero-decoration { pointer-events: none; position: absolute; z-index: -1; inset: 0 0 0 42%; }
.hero-orbit {
  position: absolute;
  width: clamp(126px, 40vw, 180px);
  aspect-ratio: 1;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid #f1f9b341;
  background: radial-gradient(circle, #b5d37272 0%, #6f9b5463 72%);
  box-shadow: 0 0 0 13px #d9f0a411, 0 0 0 26px #d9f0a40b;
}
.hero-image { position: absolute; width: 100%; max-width: none; height: auto; top: 51%; right: 1%; transform: translateY(-47%) rotate(-6deg); filter: drop-shadow(0 8px 8px #0d211a66); }
.hero-spark { position: absolute; top: 12%; right: 12%; font-size: 16px; color: #dbe991; }
.hero-spark--small { top: auto; right: 91%; bottom: 22%; font-size: 12px; }

.metric-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { min-width: 0; display: grid; gap: 6px; padding: 10px; border-radius: 16px; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; }
.metric-icon--in { color: #245c3b; background: #e6f0d9; }
.metric-icon--out { color: #654688; background: #eee6f6; }
.metric-icon--alert { color: #8b5421; background: #f9ecd3; }
.metric-data { display: grid; }
.metric-data strong { font-size: clamp(20px, 6.6vw, 27px); line-height: 1.1; font-weight: 800; letter-spacing: -.06em; overflow-wrap: anywhere; }
.metric-data span { margin-top: 4px; font-size: 11px; font-weight: 800; }
.metric small { color: var(--muted); font-size: 9px; }
.metric-arrow { display: none; }

.chart-card, .alerts-card { padding: 16px; min-width: 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title h2 { font-size: clamp(16px, 4.7vw, 20px); font-weight: 800; line-height: 1.25; letter-spacing: -.045em; }
.card-title p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.card-title .icon-btn { border-color: var(--line); }
.week-chart { display: grid; grid-template-columns: 21px minmax(0, 1fr); margin-top: 17px; row-gap: 7px; }
.week-scale { display: flex; height: 117px; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 10px; line-height: 1; transform: translateY(-5px); }
.week-plot { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; height: 115px; }
.week-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.week-grid span { border-top: 1px dashed #e5e8de; }
.week-group { display: flex; gap: 3px; align-items: flex-end; justify-content: center; height: 100%; position: relative; }
.week-bar { width: min(27%, 19px); height: var(--amount); border-radius: 4px 4px 0 0; }
.week-bar--in, .week-legend span:first-child i { background: #54845b; }
.week-bar--out, .week-legend span:last-child i { background: #b09cc9; }
.week-labels { grid-column: 2; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.week-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.week-legend span { display: flex; align-items: center; gap: 5px; }
.week-legend i { width: 8px; height: 8px; border-radius: 2px; }
.alert-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 13px; color: #805a2e; background: #faedd5; }
.alert-preview { margin-top: 11px; }
.preview-alert { display: flex; align-items: center; gap: 7px; min-height: 56px; border-bottom: 1px solid var(--line); }
.product-thumb { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: #eeeee3; color: var(--green); font-size: 20px; }
.product-thumb--milk, .product-thumb--cheese, .product-thumb--lettuce,
.product-thumb--tomato, .product-thumb--rice, .product-thumb--coffee,
.product-thumb--juice, .product-thumb--soap, .product-thumb--detergent {
  background-image: url('../assets/produtos.webp');
  background-size: 300% 300%;
  background-repeat: no-repeat;
}
.product-thumb--milk { background-position: 0 0; }
.product-thumb--cheese { background-position: 50% 0; }
.product-thumb--lettuce { background-position: 100% 0; }
.product-thumb--tomato { background-position: 0 50%; }
.product-thumb--rice { background-position: 50% 50%; }
.product-thumb--coffee { background-position: 100% 50%; }
.product-thumb--juice { background-position: 0 100%; }
.product-thumb--soap { background-position: 50% 100%; }
.product-thumb--detergent { background-position: 100% 100%; }
.preview-name { display: grid; flex: 1; min-width: 0; gap: 2px; padding-block: 6px; }
.preview-name strong { font-size: 11px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.preview-name small { color: var(--muted); font-size: 10px; }
.preview-status { padding: 5px 6px; color: #795418; background: #f8eecf; border-radius: 7px; font-size: 9px; text-align: center; font-weight: 800; }
.preview-status--expired { color: #973c36; background: #fae5e0; }
.preview-status--urgent { color: #8d4a27; background: #fce8d7; }
.preview-alert > svg { color: #637167; }
.preview-empty { padding: 23px 0; color: var(--muted); font-size: 13px; }
.all-alerts { min-height: 48px; display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 800; }

.toast {
  pointer-events: none;
  position: fixed;
  z-index: 9;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  border-radius: 13px;
  padding: 11px 16px;
  background: var(--green-dark);
  color: #fffefa;
  box-shadow: 0 6px 22px #202b2422;
  font-size: 13px;
  opacity: 0;
}
.toast.is-visible { opacity: 1; }
.sheet {
  width: min(100%, 470px);
  max-width: 100%;
  max-height: min(90dvh, 730px);
  overscroll-behavior: contain;
  padding: 20px 17px calc(19px + env(safe-area-inset-bottom));
  margin: auto auto 0;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 18px 80px #11271950;
}
.sheet::backdrop { background: #11271bb3; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-header > div { display: flex; align-items: center; gap: 9px; }
.sheet-header h2 { font-size: 20px; font-weight: 800; letter-spacing: -.045em; }
.sheet-symbol { display: grid; place-items: center; flex: none; width: 41px; height: 41px; border-radius: 13px; background: #e8efdc; color: var(--green-dark); }
.sheet-text { margin-top: 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.scanner-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.scanner-choices .btn { padding-inline: 6px; }
.scanner-example { width: 100%; margin-top: 8px; }
.scanner-manual { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.scanner-manual label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.scanner-manual-row { display: flex; align-items: stretch; gap: 8px; }
.scanner-manual-row input { width: 100%; min-width: 0; padding: 9px 11px; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
.scanner-stage { position: relative; margin-top: 12px; overflow: hidden; border-radius: 13px; aspect-ratio: 16 / 9; background: #163326; }
.scanner-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.scanner-stage::after { content: ''; position: absolute; inset: 26% 16%; border: 2px solid #e3f2a6; border-radius: 10px; pointer-events: none; }
.scanner-feedback { margin-top: 9px; color: var(--green); font-size: 12px; overflow-wrap: anywhere; }
.scanner-feedback:empty { display: none; }
.scanner-feedback.is-error { color: #932e29; }

@media (min-width: 410px) {
  .topbar-actions { gap: 8px; }
  .demo-trigger { padding-inline: 11px; }
  .metric { padding: 13px; }
  .preview-alert { gap: 8px; }
  .preview-name strong { font-size: 12px; }
  .preview-status { font-size: 10px; }
}
@media (min-width: 570px) {
  .sheet { margin: auto; max-width: calc(100% - 40px); padding: 21px; border-radius: 24px; }
  .dash-actions { display: flex; }
  .dash-actions .btn { padding-inline: 14px; }
  .hero-decoration { inset-inline-start: 50%; }
  .hero-image { max-width: 315px; right: 7%; }
  .hero-orbit { width: 180px; right: 15%; }
  .stock-hero { min-height: 207px; }
  .hero-copy { padding-inline: 23px; }
  .metric { grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 13px; }
  .metric-icon { width: 40px; height: 40px; }
}
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 208px minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; }
  .topbar-inner { min-height: 72px; padding-inline: 24px 31px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand { gap: 11px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 11px; }
  .topbar-actions { gap: 10px; }
  .topbar-date { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; padding-inline: 8px; }
  .demo-trigger { min-height: 45px; font-size: 11px; }
  .header-bell, .header-bell:focus-visible { border-color: var(--line); }
  .sidebar {
    position: sticky;
    top: 73px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100vh - 73px);
    max-height: calc(100dvh - 73px);
    overflow: auto;
    padding: 25px 12px 20px;
    background: var(--card);
    border-right: 1px solid var(--line);
  }
  .side-links { display: grid; gap: 4px; }
  .side-links .nav-link { display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 8px 11px; border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 750; }
  .side-links .is-current { color: var(--green-dark); background: #eaf0df; font-weight: 800; }
  .sidebar-demo { display: flex; align-items: center; gap: 7px; min-height: 55px; margin-top: 15px; padding: 7px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #f5f6ec; color: var(--green-dark); }
  .sidebar-demo-icon { width: 30px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #e9efdb; }
  .sidebar-demo strong, .sidebar-demo small { display: block; }
  .sidebar-demo strong { font-size: 10px; font-weight: 800; }
  .sidebar-demo small { margin-top: 2px; font-size: 9px; color: var(--muted); }
  .sidebar-demo > svg { margin-left: auto; }
  .tabbar { display: none; }
  #conteudo { width: min(100%, 1280px); padding: 29px 25px 38px; }
  .dashboard { gap: 20px; }
  .dash-intro { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .dash-intro .page-title { font-size: clamp(35px, 4.15vw, 49px); }
  .dash-intro .page-intro { font-size: 14px; }
  .dash-actions { align-self: end; }
  .dash-overview { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 14px; }
  .stock-hero { min-height: 218px; }
  .hero-decoration { inset-inline-start: 43%; }
  .hero-copy { padding-inline: 23px 12px; }
  .hero-icon { margin-bottom: 13px; }
  .hero-image { max-width: 345px; right: 0; }
  .hero-orbit { right: 9%; width: min(80%, 207px); }
  .metric-list { grid-template-columns: 1fr; }
  .metric { grid-template-columns: auto 1fr auto; gap: 9px; min-height: 63px; padding: 8px 9px; }
  .metric-data { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; }
  .metric-data strong { font-size: 22px; letter-spacing: -.05em; }
  .metric-data span { margin-top: 0; }
  .metric small { display: none; }
  .metric-arrow { display: grid; color: var(--muted); }
  .dash-analysis { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 14px; }
  .chart-card, .alerts-card { padding: 17px 16px 12px; }
  .week-plot { height: 132px; }
  .week-scale { height: 133px; }
  .toast { left: auto; right: 23px; bottom: 22px; transform: none; }
}
@media (min-width: 1160px) {
  body { grid-template-columns: 228px minmax(0, 1fr); }
  .sidebar { padding-inline: 16px; }
  #conteudo { padding-inline: clamp(28px, 3.2vw, 53px); }
  .dash-overview, .dash-analysis { gap: 17px; }
  .hero-copy { padding-inline: 27px; }
  .metric { grid-template-columns: auto 1fr auto auto; gap: 11px; padding-inline: 13px; }
  .metric-data strong { font-size: 25px; }
  .metric-data span { font-size: 12px; }
  .metric small { display: block; color: var(--muted); font-size: 10px; text-align: right; }
  .chart-card, .alerts-card { padding-inline: 20px; }
}
@media (hover: hover) {
  .btn-secondary:hover, .icon-btn:hover, .side-links .nav-link:hover, .tabbar .nav-link:hover { background-color: #eef2e7; }
  .btn-primary:hover { background-color: #17482e; }
  .metric:hover, .preview-alert:hover { background-color: #f4f7ed; }
  .all-alerts:hover { text-decoration: underline; }
}
