:root {
  --blue: #333a49;
  --slate: #3a4455;
  --cream: #f4e7d7;
  --wine: #7d262a;
  --ink: #222b36;
  --muted: #5d6771;
  --line: #d9dce0;
  --paper: #faf9f6;
  --white: #fff;
  color: var(--ink);
  font:
    16px/1.46 "Stage Grotesk",
    Arial,
    Helvetica,
    sans-serif;
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #a66c68;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #66748b;
  outline-offset: 1px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--blue);
  line-height: 1.12;
  letter-spacing: -0.04em;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
}
h2 {
  font-size: 1.38rem;
}
h3 {
  font-size: 1.03rem;
}
button {
  border: 0;
  background: none;
}
a {
  color: inherit;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 0.8rem;
}
.hidden,
[hidden] {
  display: none !important;
}
.logo {
  width: 78px;
  display: block;
  height: auto;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 18px;
}
.wordmark span {
  border-left: 1px solid #c9cbcc;
  padding-left: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate);
}
.kicker {
  font-size: 0.67rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}
.btn {
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  min-height: 44px;
  font-weight: 650;
  font-size: 0.92rem;
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
}
.btn:hover {
  background: #252e3d;
}
.btn.secondary {
  background: #fff;
  color: var(--slate);
  border-color: var(--line);
}
.btn.secondary:hover {
  background: #f0f0eb;
}
.btn.wine {
  background: var(--wine);
}
.textbtn {
  color: var(--slate);
  font-size: 0.88rem;
  padding: 8px 3px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.iconbtn {
  border-radius: 6px;
  min-width: 38px;
  min-height: 38px;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}
.iconbtn:hover {
  background: #eeeae4;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span,
.field > label,
label.title {
  font-weight: 650;
  font-size: 0.85rem;
}
.field input,
.field select,
.field textarea,
.control {
  min-width: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #cbd0d5;
  border-radius: 7px;
  padding: 11px 12px;
  min-height: 44px;
}
.field select:disabled {
  background: #f2f3f4;
  color: var(--slate);
  opacity: 1;
  cursor: default;
}
.field textarea {
  resize: vertical;
}
.message {
  color: var(--wine);
  font-size: 0.88rem;
  font-weight: 600;
}
.message:not(:empty) {
  background: #f9eeee;
  border: 1px solid #ebd2d2;
  border-radius: 7px;
  padding: 11px 13px;
  margin: 12px 0;
}
.message:empty {
  display: none;
}
.login-shell {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 100svh;
  background: #fff;
}
.login-scene {
  position: relative;
  min-height: 100%;
  background: var(--blue) url("/assets/gradiente.webp") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--cream);
  padding: clamp(36px, 6vw, 92px);
  overflow: hidden;
}
.scene-logo {
  width: 116px;
}
.login-scene h1 {
  color: var(--cream);
  font-size: clamp(3.4rem, 6.3vw, 7rem);
  font-weight: 500;
  max-width: 9ch;
  line-height: 0.96;
}
.scene-line {
  display: block;
  width: 45px;
  height: 3px;
  background: #d6ad9c;
  margin-bottom: 24px;
}
.login-scene small {
  color: var(--cream);
  font-weight: 600;
}
.login-main {
  display: grid;
  align-content: center;
  justify-content: center;
  padding: 44px 30px;
}
.login-card {
  width: min(370px, calc(100vw - 52px));
}
.login-card h2 {
  font-size: 2.4rem;
  margin: 10px 0;
}
.login-card p {
  margin: 0 0 28px;
}
.login-card .field {
  margin: 16px 0;
}
.login-card .btn {
  width: 100%;
  margin-top: 10px;
  justify-content: space-between;
}
.passwrap {
  position: relative;
}
.passwrap input {
  padding-right: 50px;
}
.passwrap button {
  position: absolute;
  right: 4px;
  top: 3px;
}
.login-badge {
  color: var(--wine);
}
.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-inner,
.page {
  max-width: 1180px;
  margin: auto;
}
.top-inner {
  min-height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 14px;
}
.userbar {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.83rem;
}
.avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--slate);
  font-weight: bold;
}
.userbar .iconbtn {
  border-left: 1px solid var(--line);
  border-radius: 0;
  margin-left: 5px;
  padding-left: 14px;
}
.page {
  padding: 32px;
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  border-radius: 14px;
  background: var(--blue) url("/assets/gradiente.webp") center 58% / cover;
  color: var(--cream);
  padding: 34px 38px 36px;
}
.hero .kicker {
  color: #e9d2c1;
}
.hero h1 {
  color: var(--cream);
  margin: 12px 0 5px;
}
.hero p {
  font-size: 0.9rem;
  color: #f5ece7;
}
.hero .btn {
  background: var(--cream);
  color: var(--ink);
}
.counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 30px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.metric span {
  font-size: 0.88rem;
  color: var(--muted);
}
.metric strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.filters {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.tab {
  padding: 5px 9px;
  font-size: 0.78rem;
  color: var(--muted);
  border-radius: 5px;
}
.tab[aria-pressed="true"] {
  background: #eeeae5;
  color: var(--blue);
  font-weight: bold;
}
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 48px 20px;
  gap: 12px;
}
.empty-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #f2ebe2;
  color: var(--slate);
}
.empty p {
  font-size: 0.88rem;
}
.orderrow {
  display: grid;
  width: 100%;
  grid-template-columns: 90px 1fr 110px 120px 20px;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 15px 24px;
  border-bottom: 1px solid #ebebea;
}
.orderrow:last-child {
  border-bottom: 0;
}
.orderrow:hover {
  background: var(--paper);
}
.tag {
  display: inline-block;
  color: #493d2e;
  background: #f5ecda;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: bold;
  padding: 5px 9px;
  white-space: nowrap;
}
.tag.done {
  background: #e8eee9;
  color: #365443;
}
.rowname {
  overflow-wrap: anywhere;
}
.rowname small {
  display: block;
}
.num {
  font-variant-numeric: tabular-nums;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--muted);
  padding: 0;
  margin-bottom: 18px;
}
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.editor-head h1 {
  font-size: 2.3rem;
  margin: 4px 0;
}
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  gap: 18px;
  align-items: start;
}
.sections {
  display: grid;
  gap: 16px;
}
.formpanel,
.summary {
  padding: 22px 24px;
}
.formpanel h2,
.summary h2 {
  margin-bottom: 18px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid2 .wide {
  grid-column: 1/-1;
}
.summary {
  position: sticky;
  top: 16px;
}
.pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  margin: 10px 0;
}
.pair span {
  color: var(--muted);
}
.pair strong {
  text-align: right;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.total {
  font-size: 1.35rem;
}
.summary .btn {
  width: 100%;
  margin-top: 9px;
}
.footnote {
  display: block;
  margin-top: 14px;
  line-height: 1.45;
}
.lookup {
  position: relative;
}
.searchbox {
  position: relative;
}
.searchbox > .icon {
  position: absolute;
  left: 12px;
  top: 13px;
  color: var(--muted);
}
.searchbox input {
  padding-left: 40px;
}
.results {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 235px;
  overflow: auto;
  background: #fff;
}
.results:empty {
  display: none;
}
.result {
  width: 100%;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.result:hover {
  background: var(--paper);
}
.result small {
  display: block;
}
.results > small {
  display: block;
  padding: 10px;
}
.chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f3ee;
  padding: 9px 12px;
  border-radius: 7px;
  gap: 8px;
  overflow-wrap: anywhere;
}
.chosen small {
  display: block;
}
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 96px 36px;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child {
  border: 0;
}
.item strong,
.item b {
  font-size: 0.91rem;
}
.item small {
  display: block;
}
.item input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.item-price {
  text-align: right;
}
.qtylabel {
  display: block;
  font-size: 0.69rem;
  color: var(--muted);
}
.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
}
.detail-list dt {
  font-size: 0.79rem;
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.prewrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.flash {
  padding: 12px 16px;
  background: #e8eee9;
  border: 1px solid #cddccf;
  color: #365443;
  border-radius: 8px;
  margin-bottom: 15px;
}
.loader {
  padding: 60px 25px;
  text-align: center;
}
@media (max-width: 800px) {
  .top-inner {
    padding: 0 18px;
  }
  .page {
    padding: 20px 16px;
  }
  .editor {
    grid-template-columns: 1fr;
  }
  .summary {
    position: static;
  }
  .hero {
    padding: 26px;
  }
  .metric {
    padding: 13px;
  }
  .counts {
    gap: 8px;
  }
  .orderrow {
    grid-template-columns: 75px 1fr 92px 88px 12px;
    padding: 14px;
  }
  .login-shell {
    grid-template-columns: 0.9fr 1fr;
  }
  .login-scene {
    padding: 34px;
  }
}
@media (max-width: 600px) {
  .login-shell {
    display: flex;
    flex-direction: column;
  }
  .login-scene {
    min-height: 182px;
    padding: 24px;
    gap: 20px;
  }
  .scene-logo {
    width: 66px;
  }
  .login-scene h1 {
    font-size: 2.7rem;
    max-width: none;
  }
  .scene-line,
  .login-scene > small {
    display: none;
  }
  .login-main {
    padding: 34px 24px;
    align-self: center;
  }
  .login-card {
    width: min(420px, calc(100vw - 48px));
  }
  .login-card h2 {
    font-size: 2rem;
  }
  .logo {
    width: 58px;
  }
  .wordmark {
    gap: 10px;
  }
  .wordmark span {
    padding-left: 10px;
    font-size: 0.78rem;
  }
  .userbar {
    gap: 6px;
  }
  .userbar .avatar {
    display: none;
  }
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero .btn {
    margin-top: 8px;
  }
  .metric {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0;
  }
  .metric span {
    font-size: 0.75rem;
  }
  .counts {
    margin: 14px 0 20px;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }
  .orderrow {
    grid-template-columns: 1fr auto;
    gap: 5px;
  }
  .rowname {
    grid-row: 2;
    grid-column: 1;
  }
  .rowcurrency {
    grid-row: 2;
    grid-column: 2;
  }
  .orderrow > .icon {
    display: none;
  }
  .orderrow .tag {
    justify-self: end;
  }
  .editor-head {
    align-items: flex-start;
  }
  .editor-head h1 {
    font-size: 1.9rem;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .formpanel,
  .summary {
    padding: 18px;
  }
  .item {
    grid-template-columns: 1fr 70px 32px;
  }
  .item .item-price {
    grid-row: 2;
    grid-column: 1/3;
    text-align: left;
  }
  .item .iconbtn {
    grid-column: 3;
    grid-row: 1;
  }
  .detail-list {
    gap: 12px;
  }
  .userbar .iconbtn {
    margin: 0;
    padding: 4px;
  }
  .top-inner {
    min-height: 58px;
  }
}

.network-state {
  padding: 10px 16px;
  text-align: center;
  background: var(--cream);
  color: var(--blue);
  font-size: .9rem;
}
#pwa-settings {
  width: min(440px, calc(100% - 32px));
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
#pwa-settings::backdrop { background: rgb(26 33 43 / 48%); }
.pwa-heading, .pwa-actions { display: flex; align-items: center; gap: 10px; }
.pwa-heading { justify-content: space-between; }
.pwa-heading .iconbtn { font-size: 1.6rem; }
.pwa-actions { flex-wrap: wrap; }
#pwa-settings section { padding: 20px 0 4px; }
#pwa-settings section + section { margin-top: 14px; border-top: 1px solid var(--line); }
#pwa-settings p { color: var(--muted); font-size: .92rem; margin: 8px 0 12px; }
#push-feedback:empty { display: none; }
.login-install { margin-top: 10px; }
@media (display-mode: standalone) { .login-install { display: none; } }
.offline-page { padding: 24px; min-height: 100svh; display: grid; place-items: center; }
.offline-card { width: min(100%, 430px); padding: 30px; display: grid; justify-items: start; gap: 20px; }
.offline-card h1 { font-size: 2rem; }
