:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #ffffff;
  --ink: #21201d;
  --muted: #6d6860;
  --line: #ded8cf;
  /* Default theme: Backerei */
  --accent: #ca981e;
  --accent-dark: #9d7617;
  --warning: #b45309;
  --success: #15803d;
  --danger: #b91c1c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-brand="swiss"] {
  --accent: #ff0000;
  --accent-dark: #c60000;
}

body[data-brand="admin"],
body[data-brand="producao"] {
  --accent: #244742;
  --accent-dark: #1c3a36;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.login-panel {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(33, 32, 29, 0.08);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.brand-logo {
  display: block;
  height: 26px;
  width: auto;
}

.brand-wordmark {
  margin: 0;
}

body[data-brand="swiss"] .brand-wordmark {
  color: var(--ink);
}

body[data-brand="swiss"] .brand-logo {
  height: 30px;
}

body[data-brand="backerei"] .brand-logo {
  height: 28px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

.login-form,
.toolbar {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 2px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.link-button {
  min-height: auto;
  width: fit-content;
  justify-self: start;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  font-weight: 850;
}

.link-button:hover {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost:hover {
  background: #ebe6dd;
}

.message {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--danger);
}

.app-view {
  max-width: 1100px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee8df;
  padding: 4px;
}

.tab-button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 18px;
}

.tab-button:hover {
  background: #fffaf2;
  color: var(--ink);
}

.tab-button.active {
  background: var(--panel);
  color: var(--accent-dark);
  box-shadow: 0 1px 4px rgba(33, 32, 29, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.summary-card {
  display: grid;
  gap: 4px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px 14px;
}

.summary-button {
  height: auto;
  min-height: 78px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.summary-button:hover {
  background: #fdfbf7;
}

.summary-button.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.summary-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 1.8rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-card.alert strong {
  color: var(--danger);
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #e7f6ee;
  color: var(--success);
  font-weight: 800;
  font-size: 0.86rem;
}

.sync-status.saving {
  background: #fff7ed;
  color: var(--warning);
}

.sync-status.error {
  background: #fef2f2;
  color: var(--danger);
}

.toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.closing-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.closing-panel div {
  display: grid;
  gap: 4px;
}

.closing-panel strong {
  font-size: 1rem;
}

.closing-panel span {
  color: var(--muted);
  font-weight: 700;
}

.closing-panel.complete {
  border-color: rgba(21, 128, 61, 0.35);
  background: #f0fdf4;
}

.closing-panel.warning {
  border-color: rgba(180, 83, 9, 0.35);
  background: #fff7ed;
}

.report-status {
  border-bottom: 1px solid #eee9e1;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 14px;
}

.report-status.complete {
  color: var(--success);
  background: #f0fdf4;
}

.report-status.warning {
  color: var(--warning);
  background: #fff7ed;
}

.product-list {
  display: grid;
  gap: 18px;
}

.supply-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 280px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.catalog-form {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) minmax(180px, 260px) 120px auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.catalog-actions {
  display: flex;
  gap: 8px;
}

.catalog-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.catalog-list {
  display: grid;
}

.user-help {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.user-help strong {
  color: var(--accent-dark);
}

.user-help span {
  color: var(--muted);
  font-weight: 700;
}

.users-list {
  display: grid;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) 150px 180px 160px;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee9e1;
}

.user-row:last-child {
  border-bottom: 0;
}

.user-name {
  font-weight: 850;
}

.user-email {
  color: var(--muted);
  font-weight: 750;
}

.user-row select {
  min-height: 38px;
}

.unit-multi-wrap {
  display: grid;
  gap: 6px;
}

.unit-multi-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.unit-multi-option input {
  width: 16px;
  min-height: 16px;
}

.catalog-row {
  display: grid;
  grid-template-columns: 82px minmax(220px, 1fr) 150px 90px 92px 170px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee9e1;
}

.catalog-row:last-child {
  border-bottom: 0;
}

.catalog-row.inactive {
  opacity: 0.58;
}

.catalog-name {
  font-weight: 850;
}

.catalog-meta {
  color: var(--muted);
  font-weight: 750;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--cat-border, #d8d0c4);
  background: var(--cat-bg, #f3eee6);
  color: var(--cat-ink, var(--ink));
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

.catalog-status {
  font-weight: 900;
  color: var(--success);
}

.catalog-status.inactive {
  color: var(--danger);
}

.catalog-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.admin-toolbar label {
  width: min(240px, 100%);
}

.date-stepper {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.date-stepper-actions {
  display: flex;
  gap: 6px;
}

.admin-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cash-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cash-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.cash-status-panel div:first-child {
  display: grid;
  gap: 4px;
}

.cash-status-panel strong {
  font-size: 1rem;
}

.cash-status-panel span {
  color: var(--muted);
  font-weight: 700;
}

.cash-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.cash-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.cash-register-panel {
  margin-bottom: 18px;
}

.cash-register-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(220px, 0.9fr);
  align-items: end;
  gap: 12px;
  padding: 14px;
}

.cash-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
}

.cash-check input {
  width: 20px;
  min-height: 20px;
}

.cash-critique-field {
  padding: 0 14px 14px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}

.cash-withdrawal-form {
  display: grid;
  grid-template-columns: 160px 180px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #eee9e1;
}

.cash-withdrawals-list {
  display: grid;
}

.cash-withdrawal-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 1fr) minmax(220px, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee9e1;
}

.cash-withdrawal-row:last-child {
  border-bottom: 0;
}

.cash-withdrawal-value {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cash-withdrawal-meta {
  color: var(--muted);
  font-weight: 750;
}

.cash-panel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.cash-denominations,
.cash-payment-list,
.cash-card-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.cash-card-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 14px 0;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
}

.movement-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 14px 14px;
  margin-bottom: 0;
}

.movement-actions {
  justify-content: flex-start;
  padding: 0 14px 14px;
}

.movement-details {
  display: grid;
}

.movement-details > div {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid #eee9e1;
  padding: 10px 14px;
}

.movement-details > div:last-child {
  border-bottom: 0;
}

.movement-details span {
  color: var(--muted);
  font-weight: 850;
}

.movement-details strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.movement-detail-total {
  background: #fbf7ef;
}

.movement-detail-total strong {
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.cash-machine-group {
  border: 1px solid #eee9e1;
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf9;
}

.cash-machine-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid #eee9e1;
  background: #fbf7ef;
  padding: 10px 14px;
}

.cash-machine-heading h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1rem;
}

.cash-machine-heading strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.cash-machine-pix {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 160px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-bottom: 1px solid #eee9e1;
  padding: 10px 14px;
}

.cash-machine-pix span {
  color: var(--muted);
  font-weight: 900;
}

.cash-denomination-row {
  display: grid;
  grid-template-columns: 92px minmax(110px, 1fr) 120px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border-bottom: 1px solid #eee9e1;
  padding: 8px 14px;
}

.cash-denomination-row:last-child {
  border-bottom: 0;
}

.cash-denomination-row span,
.cash-denomination-row strong {
  color: var(--ink);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.cash-denomination-row strong {
  text-align: right;
}

.cash-denomination-row input,
.cash-payment-list input,
.cash-card-row input {
  min-height: 38px;
}

.cash-payment-list {
  gap: 12px;
  padding: 14px;
}

.cash-card-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 160px 160px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid #eee9e1;
  padding: 10px 14px;
}

.cash-card-row:last-child {
  border-bottom: 0;
}

.cash-card-row.header {
  min-height: 42px;
  background: #fbf7ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reports-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-report,
.production-report,
.report-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.report-chart {
  display: block;
  width: 100%;
  height: auto;
  background: #fffdf9;
  border-bottom: 1px solid #eee9e1;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ranking-list {
  display: grid;
}

.shopping-report-list {
  display: grid;
}

.shopping-report-row {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 220px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee9e1;
}

.shopping-report-row:last-child {
  border-bottom: 0;
}

.shopping-report-row.header {
  min-height: 42px;
  background: #fbf7ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.shopping-report-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ranking-row {
  display: grid;
  grid-template-columns: 54px minmax(160px, 1fr) 92px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid #eee9e1;
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-position {
  color: var(--muted);
  font-weight: 900;
}

.ranking-product {
  display: grid;
  gap: 3px;
}

.ranking-product strong {
  font-size: 0.98rem;
}

.ranking-product span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ranking-value {
  font-size: 1.4rem;
  font-weight: 950;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ranking-value.danger {
  color: var(--danger);
}

.admin-product-report,
.production-product-report {
  display: grid;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 92px minmax(190px, 1fr) minmax(140px, 180px) 110px 120px 90px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee9e1;
}

.admin-product-row:last-child {
  border-bottom: 0;
}

.admin-product-row.header {
  min-height: 44px;
  background: #fbf7ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-product-row.header > :nth-child(4),
.admin-product-row.header > :nth-child(5) {
  text-align: right;
}

.admin-product-row.header > :nth-child(6) {
  text-align: center;
}

.sortable-header {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
}

.sortable-header.clickable {
  cursor: pointer;
}

.sortable-header.clickable:hover {
  background: #f4efe6;
  color: var(--ink);
}

.sortable-header.active {
  color: var(--accent-dark);
}

.admin-product-name {
  font-weight: 800;
}

.admin-category,
.production-category {
  display: flex;
  align-items: center;
}

.admin-number {
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-zero {
  color: var(--danger);
  font-weight: 900;
  text-align: center;
}

.production-row {
  display: grid;
  grid-template-columns: 92px minmax(190px, 1fr) minmax(140px, 180px) 110px 120px 90px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee9e1;
}

.production-row:last-child {
  border-bottom: 0;
}

.production-row.header {
  min-height: 44px;
  background: #fbf7ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.production-row.header > :nth-child(4),
.production-row.header > :nth-child(5) {
  text-align: right;
}

.production-row.header > :nth-child(6) {
  text-align: center;
}

.production-product {
  display: grid;
  gap: 3px;
}

.production-product strong {
  font-size: 1rem;
}

.production-product span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.production-number {
  font-size: 1.18rem;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.production-zero {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.section-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#productionReportDate {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--ink);
}

.supply-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fdfbf7;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.supplies-list {
  display: grid;
}

.supply-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 220px) 120px auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee9e1;
}

.supply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.supply-row:last-child {
  border-bottom: 0;
}

.supply-item {
  font-weight: 800;
}

.supply-quantity,
.supply-status {
  color: var(--muted);
  font-weight: 750;
}

.empty-state {
  padding: 22px 14px;
  color: var(--muted);
  font-weight: 700;
}

.category-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.category-section h2 {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fdfbf7;
}

.category-products {
  display: grid;
}

.product-row {
  display: grid;
  grid-template-columns: 78px minmax(180px, 1fr) 132px 132px 92px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 9px 12px;
  border-bottom: 1px solid #eee9e1;
}

.product-row:last-child {
  border-bottom: 0;
}

.product-row.has-saved-count .product-code::after {
  content: "OK";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 18px;
  margin-left: 8px;
  border-radius: 999px;
  background: #e7f6ee;
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 900;
}

.product-row.saved {
  animation: savedPulse 0.5s ease-out;
}

.product-code {
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.product-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-name {
  font-weight: 750;
}

.saved-value {
  min-height: 17px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 800;
}

.return-value {
  min-height: 17px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-field {
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inline-field input {
  min-height: 38px;
}

.quantity-input,
.return-input {
  text-align: right;
  font-size: 1.08rem;
  font-weight: 800;
}

.zero-button {
  background: #7f1d1d;
  padding-inline: 10px;
}

.zero-button:hover {
  background: #991b1b;
}

@keyframes savedPulse {
  0% {
    background: #dcfce7;
  }
  100% {
    background: transparent;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .closing-panel {
    display: grid;
  }

  .tabs,
  .tab-button {
    width: 100%;
  }

  .supply-form {
    grid-template-columns: 1fr;
  }

  .catalog-form {
    grid-template-columns: 1fr;
  }

  .catalog-actions,
  .catalog-row-actions {
    justify-content: stretch;
  }

  .catalog-actions > *,
  .catalog-row-actions > * {
    flex: 1;
  }

  .catalog-row {
    grid-template-columns: 58px minmax(120px, 1fr);
  }

  .catalog-row > *:nth-child(n + 3) {
    grid-column: 2;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    display: grid;
  }

  .admin-toolbar label {
    width: 100%;
  }

  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-summary,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .admin-product-row {
    grid-template-columns: 52px minmax(120px, 1fr) minmax(92px, 140px) 58px 58px 44px;
    gap: 7px;
    padding-inline: 8px;
    font-size: 0.82rem;
  }

  .production-row {
    grid-template-columns: 52px minmax(120px, 1fr) minmax(92px, 140px) 58px 58px 44px;
    gap: 7px;
    padding-inline: 8px;
    font-size: 0.82rem;
  }

  .production-number {
    font-size: 0.95rem;
  }

  .supply-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-row {
    grid-template-columns: 58px minmax(0, 1fr) 82px 82px 72px;
    gap: 8px;
    padding-inline: 8px;
  }

  .product-name {
    font-size: 0.92rem;
  }

  .quantity-input {
    padding-inline: 8px;
  }
}
