:root {
  --bg: #eff1f0;
  --paper: #fbf8f2;
  --card: rgba(251, 249, 245, .92);
  --text: #211d18;
  --muted: #615846;
  --line: rgba(58, 48, 34, .18);
  --brand: #238aa0;
  --brand-dark: #176476;
  --accent: #e8892d;
  --green: #6f8f45;
  --soft: #eef3f6;
  --warn: #fff2c9;
  --danger: #a84332;
  --shadow: 0 12px 28px rgba(42, 37, 29, .075);
  font-family: "Segoe UI Variable Text", Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg) url("assets/seeds-background.webp") center / cover fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.file-btn {
  border: 0;
  border-radius: 6px;
  background: rgba(255, 251, 242, .94);
  color: var(--text);
  padding: 10px 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .58) inset,
    0 7px 14px rgba(72, 60, 38, .08);
  transform: translateY(0) scale(1);
  transition:
    background .14s ease,
    box-shadow .14s ease,
    transform .12s ease,
    filter .14s ease;
}

button:hover,
.file-btn:hover {
  background: rgba(255, 253, 247, .94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .68) inset,
    0 10px 18px rgba(72, 60, 38, .11);
  filter: saturate(1.04);
  transform: translateY(-1px);
}

button:active,
.file-btn:active {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .42) inset,
    0 3px 8px rgba(72, 60, 38, .08);
  transform: translateY(1px) scale(.985);
}

button:focus-visible,
.file-btn:focus-visible {
  outline: 2px solid rgba(35, 138, 160, .34);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(.1);
  opacity: .62;
  transform: none;
}

.primary {
  color: white;
  background: var(--brand);
}

.primary:hover {
  background: #247f87;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  background: rgba(255, 250, 240, .88);
  backdrop-filter: blur(10px);
}

header > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}

.brand-logo {
  display: block;
  width: 180px;
  max-width: 36vw;
  max-height: 86px;
  object-fit: contain;
}

header h1 {
  color: var(--brand-dark);
  font-size: 22px;
  font-family: "Segoe UI Variable Display", Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
}

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

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: 0;
  font-family: "Segoe UI Variable Display", Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tab.active {
  background: var(--brand-dark);
  color: white;
}

main {
  width: min(1200px, calc(100vw - 32px));
  margin: 28px auto 60px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: manso-view-in .22s ease-out backwards;
}

@keyframes manso-view-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes manso-soft-land {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.992);
  }

  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.002);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.view.active > .title-row,
.view.active .card,
.view.active .kpi,
.view.active .row,
.view.active .form-notice,
.view.active .backup-preview,
.view.active details[open] > :not(summary) {
  animation: manso-soft-land .34s cubic-bezier(.2, .9, .24, 1.16) backwards;
}

.home-grid .home-card:nth-child(2),
.setup-list .setup-item:nth-child(2),
#mpsRows .row:nth-child(2) {
  animation-delay: .035s;
}

.home-grid .home-card:nth-child(3),
.setup-list .setup-item:nth-child(3),
#mpsRows .row:nth-child(3) {
  animation-delay: .07s;
}

.home-grid .home-card:nth-child(4),
.setup-list .setup-item:nth-child(4),
#mpsRows .row:nth-child(4) {
  animation-delay: .105s;
}

.setup-list .setup-item:nth-child(n+5),
#mpsRows .row:nth-child(n+5) {
  animation-delay: .13s;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.title-row.compact {
  margin-bottom: 10px;
}

.title-row > div:first-child {
  width: fit-content;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(255, 250, 240, .78);
  box-shadow: 0 12px 28px rgba(45, 35, 20, .10);
  backdrop-filter: blur(8px);
}

.title-row h2 {
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title-actions select {
  min-width: 180px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 254, 248, .94);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .78) inset, 0 8px 18px rgba(75, 70, 128, .045);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(35, 138, 160, .16);
  background: rgba(255, 255, 255, .92);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi,
.card {
  border: 1px solid rgba(73, 61, 43, .10);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, .97), rgba(239, 242, 239, .86));
  box-shadow: var(--shadow);
}

.kpi {
  padding: 18px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 34px);
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.home-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.home-card h3 {
  margin: 0;
  font-size: 22px;
}

.home-card button,
.setup-item button {
  justify-self: start;
  padding: 8px 11px;
  font-size: 13px;
}

.home-card-strong {
  background:
    linear-gradient(145deg, rgba(231, 248, 252, .95), rgba(255, 248, 235, .82));
}

.home-action-card {
  border-left: 4px solid var(--accent);
}

.home-suggested-list {
  display: grid;
  gap: 7px;
}

.home-suggested-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid rgba(56, 48, 38, .1);
}

.home-suggested-main {
  display: grid;
  gap: 2px;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
}

.home-suggested-main:hover {
  background: transparent;
  box-shadow: none;
  color: var(--brand-dark);
}

.home-suggested-main span {
  color: var(--muted);
  font-size: 12px;
}

.home-suggested-item .icon-button {
  min-width: 36px;
  padding: 8px;
  font-size: 16px;
}

.home-finance-card {
  border-left: 4px solid #277d78;
}

.finance-cycle-bars {
  display: grid;
  gap: 7px;
}

.finance-cycle-bars > div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.finance-cycle-bars span {
  color: var(--muted);
  font-size: 12px;
}

.finance-cycle-bars i {
  height: 9px;
  overflow: hidden;
  background: rgba(88, 74, 56, .12);
}

.finance-cycle-bars b {
  display: block;
  height: 100%;
}

.finance-bar-income {
  background: #3b918a;
}

.finance-bar-expense {
  background: #d28154;
}

.finance-bar-cash {
  background: #798f45;
}

.mps-history-card {
  margin-bottom: 16px;
}

.mps-monthly-chart {
  display: grid;
  gap: 9px;
}

.mps-month-row {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .46);
}

.mps-month-row.warn {
  background: rgba(255, 243, 215, .64);
}

.mps-month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mps-month-head span,
.mps-month-row small,
.mps-bar-label {
  color: var(--muted);
  font-size: 12px;
}

.mps-month-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.mps-month-metrics span {
  display: grid;
  gap: 1px;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .48);
  color: var(--muted);
  font-size: 11px;
}

.mps-month-metrics b {
  color: var(--text);
  font-size: 14px;
}

.mps-bars {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 5px 9px;
  align-items: center;
}

.mps-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
}

.mps-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.mps-bar-collected {
  background: rgba(35, 138, 160, .68);
}

.mps-bar-profit {
  background: rgba(111, 143, 69, .74);
}

.mps-monthly-form-wrap {
  margin-top: 12px;
}

.setup-task-form {
  margin-bottom: 12px;
}

.completed-tasks {
  margin-top: 12px;
}

.completed-tasks summary,
.mps-monthly-form-wrap summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 750;
}

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

.home-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .52);
  color: var(--muted);
  font-size: 12px;
}

.home-metrics strong {
  color: var(--text);
  font-size: 17px;
}

.section-entry-card,
.public-sales-card {
  margin-bottom: 16px;
}

#finances .section-entry-card {
  border-left: 4px solid var(--brand);
  background: linear-gradient(145deg, rgba(231, 247, 249, .98), rgba(255, 249, 238, .92));
}

#finances .grid.two .card {
  background: rgba(255, 253, 247, .96);
}

.back-link {
  color: var(--brand-dark);
  background: rgba(232, 244, 246, .96);
  box-shadow: 0 0 0 1px rgba(23, 100, 118, .14) inset;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.section-nav.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-nav button {
  min-height: 48px;
  text-align: center;
}

.public-sales-chart {
  display: grid;
  gap: 9px;
}

.work-hours-chart {
  display: grid;
  gap: 9px;
}

.work-hour-row {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .48);
}

.work-hour-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.work-hour-head span {
  color: var(--muted);
  font-size: 12px;
}

.work-hour-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(35, 138, 160, .68);
}

.public-sale-row {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .48);
}

.public-sale-today {
  border-left: 4px solid var(--accent);
  background: rgba(255, 248, 235, .82);
}

.public-sale-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.public-sale-head span,
.public-sale-row small {
  color: var(--muted);
  font-size: 12px;
}

.public-sale-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(232, 137, 45, .72);
}

.compact-list {
  gap: 7px;
}

.compact-list .row {
  padding: 8px 0;
  background: transparent;
  box-shadow: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
}

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

.setup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .48);
}

.setup-item.done {
  opacity: .68;
  background: rgba(225, 238, 220, .55);
}

.setup-task-main {
  justify-self: stretch !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-align: left;
}

.setup-task-main:hover {
  background: transparent;
  box-shadow: none;
  color: var(--brand-dark);
}

.setup-task-check {
  min-width: 34px;
  padding: 7px !important;
  font-size: 15px !important;
}

.setup-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.setup-check input {
  width: auto;
}

.setup-item strong,
.setup-item small {
  display: block;
}

.setup-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.setup-item.done {
  opacity: .72;
}

.setup-item.done strong {
  text-decoration: line-through;
}

.mps-active-header {
  margin-bottom: 10px;
}

.mps-active-header > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(255, 250, 240, .72);
  box-shadow: 0 10px 22px rgba(45, 35, 20, .08);
  backdrop-filter: blur(8px);
}

.mps-active-header h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 22px;
}

.mps-active-header span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.three {
  grid-template-columns: 2fr 1fr 1fr;
}

.card {
  padding: 18px;
}

.wide {
  min-width: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 247, .72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .54) inset;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.row:hover,
.row:focus-within {
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 22px rgba(75, 70, 128, .07);
}

.row.warn {
  background: rgba(255, 240, 194, .82);
}

.row strong,
.row span {
  display: block;
}

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

.row-actions button {
  padding: 7px 9px;
  font-size: 13px;
}

.row span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.bad {
  color: var(--danger);
  background: #ffe6e4;
}

.pill.warn {
  color: #8a5b00;
  background: var(--warn);
}

.pill.good {
  color: #3c6c27;
  background: #e6f4dd;
}

.table-wrap {
  overflow: auto;
}

.product-state-card {
  margin-bottom: 16px;
  border-left: 4px solid var(--brand);
}

.product-state-table {
  min-width: 960px;
}

.sale-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: .7rem;
  margin-bottom: .8rem;
}

.sale-filter-summary,
.daily-close-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: .55rem;
  margin-bottom: .9rem;
}

.sale-filter-summary div,
.daily-close-metrics div {
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.sale-filter-summary span,
.daily-close-metrics span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.sale-filter-summary strong,
.daily-close-metrics strong {
  display: block;
  margin-top: .2rem;
}

.cash-ledger-card {
  margin-bottom: 16px;
  border-left: 4px solid #6e8a56;
}

.cash-ledger-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.cash-ledger-summary,
.finance-separated-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.cash-ledger-summary div,
.finance-separated-summary div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.cash-ledger-summary span,
.finance-separated-summary span,
.finance-block-title span,
.finance-separated-summary small {
  color: var(--muted);
  font-size: 12px;
}

.cash-ledger-wrap table {
  min-width: 1120px;
}

.cash-ledger-wrap td strong,
.cash-ledger-wrap td small {
  display: block;
  margin-top: 4px;
}

.cash-ledger-wrap td small {
  max-width: 320px;
  color: var(--muted);
}

.cash-ledger-wrap td:last-child {
  min-width: 145px;
}

.cash-ledger-wrap td:last-child button,
.cash-origin-link {
  display: block;
  margin-top: 6px;
  padding: 5px 7px;
  font-size: 11px;
}

.cash-entry {
  color: #3c6c27;
  font-weight: 800;
}

.cash-exit {
  color: var(--danger);
  font-weight: 800;
}

.finance-block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sale-card.sale-voided {
  opacity: .78;
  border-style: dashed;
}

.sale-card-actions button.danger-secondary {
  border: 1px solid rgba(168, 67, 50, .42);
  background: transparent;
  color: var(--danger);
}

.sale-card-actions button.danger-secondary:hover {
  background: rgba(168, 67, 50, .08);
}

.confirm-refund-options {
  display: grid;
  gap: .65rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.sale-correction-overlay {
  align-items: flex-start;
  overflow-y: auto;
  padding-block: 24px;
}

.confirm-card.sale-correction-card {
  width: min(980px, calc(100vw - 28px));
  max-width: 980px;
  max-height: none;
}

.sale-correction-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sale-correction-items {
  display: grid;
  gap: 8px;
}

.sale-correction-item {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(100px, .7fr) minmax(130px, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.sale-correction-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sale-correction-preview div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.sale-correction-preview span,
.sale-correction-preview strong {
  display: block;
}

.sale-correction-preview span,
.sale-not-correctable {
  font-size: .78rem;
}

.single-price-edit {
  min-width: 170px;
}

.single-price-edit label {
  display: grid;
  gap: .2rem;
  margin-top: .4rem;
  font-size: .78rem;
}

.price-include {
  margin-bottom: .35rem;
  font-size: .75rem;
}

.muted-row {
  opacity: .58;
}

@media (max-width: 760px) {
  .sale-filters,
  .cash-ledger-filters,
  .cash-ledger-summary,
  .finance-separated-summary,
  .sale-filter-summary,
  .daily-close-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .sale-correction-item,
  .sale-correction-preview {
    grid-template-columns: 1fr;
  }
}

.product-state-table th,
.product-state-table td {
  padding: 7px 9px;
  vertical-align: middle;
}

.product-state-table tbody tr {
  border-bottom: 1px solid rgba(65, 55, 44, .09);
}

.product-state-table td:first-child span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

.product-state-table td:last-child {
  white-space: nowrap;
}

.product-state-table .stock-number {
  min-width: 76px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.product-review-button {
  margin-left: 7px;
  padding: 5px 8px;
  font-size: 11px;
}

.diagnostic-focus-row td {
  background: rgba(217, 164, 65, .14);
  box-shadow: inset 3px 0 0 rgba(166, 104, 30, .55);
}

.diagnostic-focus-flash,
.diagnostic-focus-row {
  animation: diagnostic-focus-pulse 1.1s ease-in-out 2;
}

@keyframes diagnostic-focus-pulse {
  50% {
    outline: 3px solid rgba(193, 139, 47, .38);
    outline-offset: 2px;
  }
}

.stock-support-grid {
  align-items: start;
}

.stock-supply-group + .stock-supply-group {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(56, 48, 38, .12);
}

.stock-supply-group h4 {
  margin: 0 0 7px;
  color: var(--brand-dark);
  font-size: 14px;
}

.row.stock-compact-row {
  min-height: 0;
  padding: 6px 0;
}

.row.stock-compact-row span {
  line-height: 1.2;
}

.stock-adjustment-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(56, 48, 38, .1);
}

.stock-adjustment-date,
.stock-adjustment-detail {
  display: grid;
  gap: 3px;
}

.stock-adjustment-date span,
.stock-adjustment-detail span {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  background: rgba(235, 235, 246, .7);
}

.form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.mini-form {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 650;
}

.span {
  grid-column: 1 / -1;
}

.form-actions,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions strong {
  font-size: 24px;
}

.form-notice {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(230, 239, 240, .82);
  color: var(--brand-dark);
}

.form-notice[hidden] {
  display: none;
}

.storage-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #b85a45;
  border-radius: 10px;
  background: #fff0eb;
  color: #7f2f20;
  font-weight: 700;
}

.storage-notice[hidden] {
  display: none;
}

.form-notice span {
  color: var(--muted);
  font-size: 13px;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 34, 26, .42);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-card {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid rgba(82, 58, 34, .18);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(37, 29, 20, .22);
}

.confirm-card h3,
.confirm-card p {
  margin: 0;
}

#confirmMessage {
  white-space: pre-line;
}

.confirm-card .danger,
button.danger {
  border-color: rgba(138, 53, 43, .38);
  background: #8a352b;
  color: #fff;
}

.quick-time {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-time button {
  padding: 7px 9px;
  font-size: 12px;
}

.data-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.data-status div,
.backup-preview {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(255, 253, 247, .66);
}

.data-status span,
.backup-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.data-status strong {
  font-size: 18px;
  color: var(--brand-dark);
}

.data-diagnostic-card {
  margin-bottom: 16px;
  border-left: 4px solid var(--brand);
}

.month-prep-card {
  margin-bottom: 16px;
  border-left: 4px solid #6e8a56;
}

.diagnostic-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.diagnostic-filter-bar button {
  padding: 7px 10px;
  border-color: rgba(101, 86, 60, .18);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.diagnostic-filter-bar button.active {
  border-color: rgba(83, 68, 42, .45);
  background: #f1e1ba;
  color: var(--brand-dark);
}

.diagnostic-kpis,
.diagnostic-money-grid,
.monthly-finance-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.diagnostic-kpis div,
.diagnostic-money-grid div,
.monthly-finance-metrics div {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(101, 86, 60, .10);
  border-radius: 6px;
  background: rgba(255, 253, 247, .72);
}

.diagnostic-kpis div.bad {
  border-left: 3px solid #a94b3f;
}

.diagnostic-kpis div.warn {
  border-left: 3px solid #c18b2f;
}

.diagnostic-kpis div.good {
  border-left: 3px solid #6e8a56;
}

.diagnostic-kpis span,
.diagnostic-money-grid span,
.monthly-finance-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.diagnostic-kpis strong,
.diagnostic-money-grid strong,
.monthly-finance-metrics strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.diagnostic-kpis small {
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-grid {
  margin: 12px 0;
}

.diagnostic-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(101, 86, 60, .10);
  border-radius: 6px;
  background: rgba(250, 247, 238, .62);
}

.diagnostic-panel h4 {
  margin: 0;
}

.diagnostic-filter-help {
  margin: -3px 0 0;
  font-size: 12px;
}

.diagnostic-collapsible > summary,
.month-prep-card > summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.diagnostic-collapsible > summary {
  font-size: 15px;
}

.month-prep-card > summary {
  font-size: 18px;
}

.month-prep-card[open] > summary {
  margin-bottom: 10px;
}

.monthly-finance-card {
  margin-bottom: 16px;
  border-left: 4px solid var(--brand);
}

.monthly-finance-metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthly-finance-bars {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.monthly-finance-bars div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.monthly-finance-bars i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(101, 86, 60, .12);
}

.monthly-finance-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.finance-bar-pending {
  background: #d9a441;
}

.diagnostic-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mps-audit-list {
  display: grid;
  gap: 9px;
}

.mps-audit-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(101, 86, 60, .12);
  border-left: 3px solid rgba(101, 86, 60, .26);
  background: rgba(255, 253, 247, .78);
}

.mps-audit-card.warn {
  border-left-color: #c18b2f;
}

.mps-audit-card.bad {
  border-left-color: #a94b3f;
}

.mps-audit-card header,
.mps-audit-card header div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mps-audit-card header {
  justify-content: space-between;
}

.mps-audit-card header span:not(.pill) {
  color: var(--muted);
  font-size: 12px;
}

.mps-audit-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mps-audit-metrics span {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  background: rgba(244, 239, 226, .65);
  color: var(--muted);
  font-size: 11px;
}

.mps-audit-metrics strong {
  color: var(--text);
  font-size: 13px;
}

.mps-audit-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 12px;
  margin: 7px 0;
}

.mps-audit-detail p:last-child {
  grid-column: 1 / -1;
}

.diagnostic-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px dashed rgba(101, 86, 60, .22);
  color: var(--muted);
}

.diagnostic-empty strong {
  color: var(--brand-dark);
}

.diagnostic-group {
  padding: 8px 0;
  border-top: 1px solid rgba(101, 86, 60, .10);
}

.diagnostic-group summary {
  cursor: pointer;
  font-weight: 800;
}

.diagnostic-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(101, 86, 60, .08);
}

.diagnostic-alert.muted-alert,
.diagnostic-product-row.muted-alert {
  opacity: .62;
}

.diagnostic-alert p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.diagnostic-alert p strong,
.diagnostic-alert p span {
  display: block;
}

.diagnostic-alert p span {
  color: var(--muted);
}

.diagnostic-alert p small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.diagnostic-alert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.diagnostic-alert button,
.diagnostic-alert-actions button {
  padding: 6px 8px;
  font-size: 12px;
}

.diagnostic-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid rgba(101, 86, 60, .08);
}

.diagnostic-product-row strong,
.diagnostic-product-row span,
.diagnostic-product-row small {
  display: block;
}

.diagnostic-product-row span,
.diagnostic-product-row small {
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-row-detail {
  min-width: 150px;
}

.diagnostic-row-detail summary {
  cursor: pointer;
  font-weight: 800;
}

.diagnostic-row-detail p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-row-detail button {
  padding: 6px 8px;
  font-size: 12px;
}

.diagnostic-month-head {
  display: grid;
  gap: 2px;
}

.backup-preview {
  margin-top: 12px;
  margin-bottom: 12px;
}

details.card summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-dark);
}

.danger-zone {
  background: linear-gradient(145deg, rgba(255, 247, 236, .92), rgba(255, 233, 228, .72));
}

.danger-zone summary {
  color: var(--danger) !important;
}

.purchase-cycle-field {
  display: none;
}

.purchase-supplier-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.purchase-supplier-field button {
  margin-bottom: 0;
  white-space: nowrap;
}

.inline-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 253, 247, .66);
}

.inline-create[hidden] {
  display: none;
}

.purchase-calculator {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(245, 250, 248, .72);
}

.purchase-calculator[hidden] {
  display: none;
}

.purchase-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 253, 247, .72);
  color: var(--muted);
}

.purchase-preview strong {
  color: var(--brand-dark);
}

.purchase-total-box {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-total-box strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.sale-margin-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 34px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(245, 250, 248, .72);
  color: var(--muted);
}

.sale-margin-preview strong {
  color: var(--brand-dark);
}

.sale-margin-preview small {
  width: 100%;
  color: #958a76;
  font-size: 12px;
}

#purchaseItems .row span,
#purchaseRows .row span,
#supplierSuggestion .row span {
  color: #958a76;
  opacity: .82;
}

#purchaseItems .row:hover span,
#purchaseItems .row:focus-within span,
#purchaseRows .row:hover span,
#purchaseRows .row:focus-within span,
#supplierSuggestion .row:hover span,
#supplierSuggestion .row:focus-within span {
  color: var(--muted);
  opacity: 1;
}

.mps-packing,
.mps-pending-labeling,
.mps-paste,
.mps-manual {
  margin-top: 16px;
  padding: 0;
  background: rgba(251, 249, 245, .72);
}

.mps-packing summary,
.mps-pending-labeling summary,
.mps-paste summary,
.mps-manual summary,
.mps-manual-options summary {
  padding: 16px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.mps-packing .form,
.mps-pending-labeling .form,
.mps-paste .form,
.mps-manual .form {
  padding: 0 16px 16px;
}

.mps-packing .list,
.mps-pending-labeling .list {
  padding: 0 16px 16px;
}

.mps-work-subsection {
  padding: 4px 16px 8px;
}

.mps-work-subsection h3 {
  margin: 8px 0 4px;
  font-size: 15px;
}

.mps-work-subsection .muted {
  margin: 0;
}

.mps-pending-labeling .form[hidden] {
  display: none;
}

.mps-workbench {
  margin-top: 16px;
}

.mps-section-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 247, .88);
}

.mps-section-nav button {
  flex: 1 1 0;
  min-height: 42px;
  background: transparent;
}

.mps-section-nav button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mps-section-panel {
  display: grid;
  gap: 12px;
}

.mps-section-heading,
.mps-section-notice,
.mps-operation-empty {
  margin: 0;
}

.mps-section-heading h3,
.mps-section-notice h3,
.mps-operation-empty h3 {
  margin: 0 0 5px;
}

.mps-section-heading p:last-child,
.mps-section-notice p,
.mps-operation-empty p {
  margin: 0;
}

.mps-operation-empty button {
  margin-top: 10px;
}

.mps-load-form {
  display: grid;
  gap: 14px;
}

.mps-load-form .section-head h3 {
  margin: 0;
}

.mps-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(35, 138, 160, .22);
  border-radius: 10px;
  background: rgba(226, 242, 240, .78);
}

.mps-draft-bar > div {
  display: grid;
  gap: 2px;
}

.mps-draft-bar span {
  color: var(--muted);
  font-size: 13px;
}

.mps-draft-bar button {
  flex: 0 0 auto;
}

.mps-load-fields {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 1.4fr;
  gap: 12px;
}

.mps-load-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mps-load-mode legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mps-load-mode label {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
}

.mps-load-mode label:has(input:checked) {
  outline: 2px solid rgba(27, 112, 128, .42);
  background: rgba(224, 245, 247, .82);
}

.mps-load-mode input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.mps-load-mode span {
  display: grid;
  gap: 3px;
}

.mps-load-mode small {
  color: var(--muted);
}

.mps-load-help {
  margin: -2px 0 0;
}

#mpsLoadCatalogReview {
  display: grid;
  gap: 4px;
}

.mps-load-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mps-load-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 13px;
}

.mps-load-table th,
.mps-load-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.mps-load-table th {
  color: var(--muted);
  background: rgba(241, 234, 216, .65);
  font-size: 11px;
  text-transform: uppercase;
}

.mps-load-table tr:last-child td {
  border-bottom: 0;
}

.mps-load-table input {
  width: 110px;
  padding: 7px 8px;
}

.mps-load-row.empty {
  opacity: .58;
}

.mps-load-row:focus-within,
.mps-load-row.loaded {
  opacity: 1;
}

.mps-load-row.difference td {
  background: rgba(255, 244, 219, .5);
}

.mps-load-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mps-load-summary div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .62);
}

.mps-load-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.mps-load-summary strong {
  font-size: 18px;
}

.mps-load-approval {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 244, 219, .72);
}

.mps-workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mps-workbench-head h3 {
  margin: 0;
}

.mps-workbench-head button {
  padding: 7px 10px;
  font-size: 13px;
  background: rgba(255, 253, 247, .82);
}

.mps-advanced-tools {
  margin-top: 12px;
  background: rgba(251, 249, 245, .48);
  box-shadow: none;
}

.mps-advanced-tools > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.mps-advanced-tools .mps-paste,
.mps-advanced-tools .mps-manual {
  margin-top: 10px;
  box-shadow: none;
}

.mps-shortages {
  margin-top: 16px;
  background: rgba(255, 252, 246, .58);
  box-shadow: none;
}

.mps-purchase-suggestion {
  margin-top: 12px;
  background: rgba(246, 250, 252, .54);
  box-shadow: none;
}

.mps-close-box,
.mps-closed-history {
  margin-top: 12px;
  background: rgba(255, 250, 241, .58);
  box-shadow: none;
}

.mps-closed-row {
  align-items: flex-start;
}

.mps-history-order {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
}

.mps-history-order header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mps-history-order header div {
  display: grid;
  gap: 3px;
}

.mps-history-order header span:not(.pill) {
  color: var(--muted);
  font-size: 13px;
}

.mps-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.mps-history-actions > details {
  flex: 1 1 100%;
}

.mps-history-actions summary {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, .85);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.mps-history-detail-body,
.mps-history-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .55);
}

.mps-history-items-wrap {
  overflow-x: auto;
}

.mps-history-items {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.mps-history-items th,
.mps-history-items td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mps-history-items th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.mps-history-items input {
  width: 120px;
  padding: 7px 8px;
}

.mps-history-edit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mps-history-edit-fields .wide {
  grid-column: 1 / -1;
}

.mps-history-totals,
.mps-history-edit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
}

.mps-history-totals strong,
.mps-history-edit-summary strong {
  color: var(--text);
}

.mps-history-blocked {
  flex: 1 1 100%;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.mps-force-delete {
  display: grid;
  flex: 1 1 100%;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(138, 53, 43, .25);
  border-radius: 9px;
  background: rgba(255, 241, 238, .68);
}

.mps-force-delete summary {
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
}

.mps-force-delete p {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.mps-force-delete button {
  width: fit-content;
}

.mps-history-actions button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mps-closed-edit {
  margin-top: 7px;
}

.mps-closed-edit summary {
  width: fit-content;
  cursor: pointer;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.mps-closed-edit .mini-form {
  margin-top: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, .46);
  border-radius: 8px;
}

.mps-shortages summary,
.mps-purchase-suggestion summary,
.mps-close-box summary {
  cursor: pointer;
  list-style: none;
}

.mps-shortages summary::-webkit-details-marker,
.mps-purchase-suggestion summary::-webkit-details-marker,
.mps-close-box summary::-webkit-details-marker {
  display: none;
}

.mps-shortages-head,
.mps-purchase-head,
.mps-close-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mps-shortages:not([open]) .mps-shortages-head,
.mps-purchase-suggestion:not([open]) .mps-purchase-head,
.mps-close-box:not([open]) .mps-close-head {
  margin-bottom: 0;
}

.mps-shortages-head h3,
.mps-purchase-head h3,
.mps-close-head h3 {
  margin: 2px 0 0;
}

.mps-shortages-body,
.mps-purchase-body {
  padding-top: 2px;
}

.mps-close-form {
  padding-top: 4px;
}

.mps-close-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .5);
  color: var(--muted);
  font-size: 13px;
}

.mps-close-preview strong {
  color: var(--text);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
}

.mps-shortage-section {
  margin-top: 12px;
}

.mps-shortage-section h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.mps-shortage-list {
  display: grid;
  gap: 7px;
}

.mps-shortage-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(84px, auto));
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .52);
}

.mps-shortage-row strong {
  color: var(--text);
}

.mps-shortage-row span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.mps-shortage-row b {
  color: var(--text);
  font-size: 16px;
}

.mps-shortage-value,
.mps-shortage-value b {
  color: var(--danger) !important;
  font-weight: 800;
}

.mps-shortages-ok {
  margin: 0;
  color: var(--green);
  font-weight: 750;
}

.mps-purchase-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mps-purchase-section {
  margin-top: 12px;
}

.mps-purchase-section h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.mps-purchase-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .46);
}

.mps-purchase-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.mps-purchase-table th,
.mps-purchase-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(101, 86, 60, .08);
  vertical-align: top;
  font-size: 13px;
}

.mps-purchase-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .42);
}

.mps-purchase-table tr:last-child td {
  border-bottom: 0;
}

.mps-purchase-table strong {
  color: var(--text);
}

.mps-purchase-qty {
  color: var(--text);
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.mps-purchase-table span {
  color: var(--muted);
}

.mps-purchase-table small {
  display: block;
  margin-top: 2px;
  color: #8f846f;
  font-size: 12px;
  line-height: 1.35;
}

.price-adjustment-table-wrap {
  max-height: none;
  overflow: visible;
}

#prices > article {
  margin-bottom: 20px;
}

.price-adjustment-table {
  min-width: 1060px;
}

.price-adjustment-table th,
.price-adjustment-table td {
  padding: 5px 7px;
  vertical-align: middle;
}

.price-adjustment-table th {
  background: rgba(245, 241, 232, .96);
}

.price-adjustment-table small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.price-adjustment-table input {
  width: 80px;
  padding: 5px 7px;
  text-align: right;
}

.price-input-metrics {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.price-input-metrics .pill,
.price-input-metrics .price-change {
  min-width: 0;
  padding: 3px 5px;
  font-size: 11px;
}

.price-adjustment-table td:nth-child(2),
.price-adjustment-table td:nth-child(3),
.price-adjustment-table td:nth-child(4),
.price-adjustment-table td:nth-child(5),
.price-adjustment-table td:nth-child(6),
.price-adjustment-table td:nth-child(7),
.price-adjustment-table td:nth-child(8),
.price-adjustment-table td:nth-child(9),
.price-adjustment-table td:nth-child(10) {
  font-variant-numeric: tabular-nums;
}

.price-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-change.up {
  color: #5a6f37;
  background: rgba(205, 224, 169, .62);
}

.price-change.down {
  color: #906153;
  background: rgba(237, 197, 181, .62);
}

.price-change.flat {
  color: #7a725f;
  background: rgba(233, 226, 210, .68);
}

.price-adjustment-table tr.warn td {
  background: rgba(255, 244, 219, .38);
}

.price-review-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(65, 55, 44, .14);
  border-radius: 10px;
  background: rgba(250, 247, 238, .72);
}

.price-review-panel.has-review {
  border-color: rgba(187, 139, 46, .34);
  background: rgba(255, 248, 226, .72);
}

.price-review-panel.has-urgent {
  border-color: rgba(158, 67, 55, .3);
  background: rgba(255, 244, 239, .78);
}

.price-review-panel h3,
.price-review-panel p {
  margin: 0;
}

.manual-cost-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(250, 247, 238, .76);
}

.manual-cost-panel > summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.manual-cost-panel > .muted {
  margin: 8px 0 12px;
}

.manual-cost-history {
  margin-top: 14px;
}

.manual-cost-row span {
  color: var(--muted);
}

.price-review-list {
  display: grid;
  gap: 7px;
}

.price-review-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.price-review-ok {
  margin: 0;
  color: #3c6c27;
  font-weight: 750;
}

.price-review-group {
  display: grid;
  gap: 5px;
}

.price-review-group h4 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
}

.price-review-info {
  padding-top: 8px;
  border-top: 1px solid rgba(65, 55, 44, .1);
}

.price-review-info > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.price-review-info[open] > summary {
  margin-bottom: 8px;
}

.price-review-row.urgent {
  border-left: 3px solid var(--danger);
  padding-left: 9px;
}

.price-review-row.review {
  border-left: 3px solid #c18b2f;
  padding-left: 9px;
}

.price-review-row.info {
  opacity: .82;
}

.price-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(65, 55, 44, .1);
}

.price-review-row div {
  display: grid;
  gap: 2px;
}

.price-review-row span {
  color: var(--muted);
  font-size: 12px;
}

.price-review-row small {
  max-width: 680px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price-review-actions {
  display: flex !important;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px !important;
}

.price-review-actions button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.price-zero-row td,
.price-zero {
  background: rgba(255, 231, 224, .62) !important;
}

.work-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.mps-prep-product small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mps-row {
  align-items: stretch;
  border-left: 5px solid rgba(118, 107, 88, .12);
}

.mps-workbench {
  padding: 12px;
}

#mpsRows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mps-product-info {
  min-width: 220px;
  flex: 1 1 320px;
}

.mps-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mps-row-head strong {
  font-size: 16px;
}

.mps-qty-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.mps-qty-grid span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .58);
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
}

.mps-qty-grid b {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.mps-prep-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) repeat(3, minmax(56px, .45fr)) auto;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
}

.mps-prep-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
}

.mps-prep-summary b {
  color: var(--text);
}

.mps-shortage {
  color: var(--danger);
  font-weight: 750;
}

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

.mps-prep-product strong {
  font-size: 13px;
  line-height: 1.15;
}

.mps-prep-product .pill {
  padding: 3px 6px;
  font-size: 10px;
}

.mps-prep-product .pill {
  width: fit-content;
}

.mps-prep-number,
.mps-prep-balance {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .56);
}

.mps-prep-number span,
.mps-prep-balance span,
.mps-prep-balance small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.mps-prep-number strong,
.mps-prep-balance strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}

.mps-prep-balance.mps-shortage strong,
.mps-prep-balance.mps-shortage span {
  color: var(--danger);
}

.mps-reason {
  width: fit-content;
  margin-bottom: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #ffe6e4;
  color: var(--danger);
  font-weight: 750;
}

.mps-status-falta,
.mps-stock-alert {
  border-left-color: rgba(168, 67, 50, .68);
  background: rgba(255, 226, 220, .92);
}

.mps-status-pronto {
  border-left-color: rgba(65, 151, 178, .66);
  background: rgba(215, 242, 249, .92);
}

.mps-status-por_empaquetar {
  border-left-color: rgba(232, 137, 45, .50);
  background: rgba(255, 248, 226, .82);
}

.mps-status-en_stock {
  border-left-color: rgba(111, 143, 69, .62);
  background: rgba(228, 246, 218, .90);
}

.mps-row-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  width: auto;
}

.mps-ready-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mps-ready-toggle input {
  width: 15px;
  height: 15px;
  box-shadow: none;
}

.mps-row-controls input,
.mps-row-controls select {
  padding: 8px 9px;
}

.mps-manual-options {
  background: rgba(255, 255, 255, .35);
  border-radius: 8px;
}

.mps-manual-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 12px 12px;
}

pre {
  white-space: pre-wrap;
  min-height: 260px;
  padding: 14px;
  border-radius: 8px;
  background: #f1ead8;
  color: #463b2a;
  line-height: 1.45;
}

.file-btn input {
  display: none;
}

.work-monthly-chart {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}

#work > .card,
#work > details {
  margin-bottom: 20px;
}

.work-summary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.work-summary-kpis > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 4px solid #277d78;
  background: rgba(236, 247, 245, .9);
}

.work-summary-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.work-summary-kpis strong {
  font-size: 17px;
  text-transform: capitalize;
}

.work-history-details > summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 750;
}

.work-history-details[open] > summary {
  margin-bottom: 12px;
}

.packing-history-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.work-recent-row {
  border-left: 3px solid rgba(127, 143, 88, .55);
}

.work-chart-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) auto;
}

.work-chart-row span,
.work-chart-row strong {
  font-size: .9rem;
}

.work-chart-track {
  background: #ddd7ce;
  border-radius: 4px;
  height: 9px;
  overflow: hidden;
}

.work-chart-track i {
  background: #71813e;
  display: block;
  height: 100%;
}

.work-cat-label .work-chart-track i,
.work-cat-label .work-task-pill {
  background: #81bbc2;
}

.work-cat-cut .work-chart-track i,
.work-cat-cut .work-task-pill {
  background: #dfb650;
}

.work-cat-clean .work-chart-track i,
.work-cat-clean .work-task-pill {
  background: #9abd89;
}

.work-cat-logistics .work-chart-track i,
.work-cat-logistics .work-task-pill {
  background: #b79ac4;
}

.work-cat-office .work-chart-track i,
.work-cat-office .work-task-pill {
  background: #96a9cf;
}

.work-task-pill {
  background: #eef0df;
  border: 1px solid rgba(56, 48, 38, .12);
  border-radius: 4px;
  display: inline-flex;
  gap: 6px;
  padding: 3px 7px;
}

.work-row td:first-child {
  border-left: 3px solid rgba(127, 143, 88, .55);
}

.sale-delivery-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sale-delivery-fields[hidden] {
  display: none;
}

.sale-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sale-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(56, 48, 38, .14);
  border-left: 4px solid var(--brand);
  background: rgba(255, 253, 247, .92);
}

.sale-card-head,
.sale-card-summary,
.sale-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sale-card-head {
  justify-content: space-between;
}

.sale-card-head h4 {
  margin: 0 0 3px;
  font-size: 18px;
}

.sale-card-head > div > span,
.sale-card-summary span {
  color: var(--muted);
  font-size: 12px;
}

.sale-card-status,
.sale-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sale-card-items {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid rgba(56, 48, 38, .1);
  border-bottom: 1px solid rgba(56, 48, 38, .1);
  list-style: none;
}

.sale-card-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sale-review-detail {
  padding: 9px 0;
  border-top: 1px solid rgba(56, 48, 38, .10);
}

.sale-review-detail summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.sale-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0;
}

.sale-review-grid span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(250, 247, 238, .72);
  color: var(--muted);
  font-size: 12px;
}

.sale-review-grid strong {
  color: var(--text);
}

.sale-review-detail p {
  margin: 5px 0;
}

.sale-review-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.sale-review-detail button:disabled {
  cursor: not-allowed;
  opacity: .68;
}

.sale-card-summary {
  flex-wrap: wrap;
  justify-content: space-between;
}

.sale-card-summary strong {
  margin-left: auto;
  font-size: 18px;
}

.sale-card-actions {
  justify-content: flex-start;
}

.sale-card-actions button {
  padding: 7px 9px;
  font-size: 12px;
}

@media (max-width: 900px) {
  header,
  .title-row {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .kpi-grid,
  .home-grid,
  .setup-list,
  .grid.two,
  .grid.three,
  .form,
  .mini-form,
  .section-nav,
  .section-nav.compact,
  .mps-row-controls {
    grid-template-columns: 1fr;
  }

  .mps-row {
    align-items: stretch;
    flex-direction: column;
  }

  .mps-load-fields,
  .mps-load-summary,
  .mps-load-mode {
    grid-template-columns: 1fr;
  }

  .mps-section-nav {
    flex-direction: column;
  }

  .mps-history-edit-fields {
    grid-template-columns: 1fr;
  }

  #mpsRows {
    grid-template-columns: 1fr;
  }

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

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

  .mps-shortage-row span {
    text-align: left;
  }

  .mps-bars {
    grid-template-columns: 1fr;
  }

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

  .mps-row-controls {
    justify-content: flex-start;
  }

  .work-summary-kpis,
  .diagnostic-kpis,
  .diagnostic-money-grid,
  .monthly-finance-metrics,
  .monthly-finance-metrics.compact,
  .sale-card-list {
    grid-template-columns: 1fr;
  }

  .diagnostic-alert {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .sale-card-head,
  .sale-card-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .sale-card-status {
    justify-content: flex-start;
  }

  .monthly-finance-bars div,
  .sale-review-grid,
  .mps-audit-metrics,
  .mps-audit-detail {
    grid-template-columns: 1fr;
  }

  .mps-audit-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .sale-card-summary strong {
    margin-left: 0;
  }

  .stock-adjustment-row {
    grid-template-columns: 1fr auto;
  }

  .stock-adjustment-detail {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .work-filters,
  .price-review-row {
    grid-template-columns: 1fr;
  }

  .price-review-row {
    align-items: stretch;
    display: grid;
  }

  .price-review-actions {
    justify-content: flex-start;
  }

  .sale-delivery-fields {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }

  button,
  .file-btn {
    transition: background .01s linear, box-shadow .01s linear, filter .01s linear;
    transform: none !important;
  }

  .row {
    transition: background .01s linear, box-shadow .01s linear;
  }
}

/* Sistema visual 2026: una capa coherente sobre los estilos historicos. */
:root {
  --bg: #f1eee7;
  --paper: #fffdf8;
  --surface: #fffdf8;
  --card: #fffdf8;
  --text: #2d2923;
  --muted: #6c655b;
  --line: rgba(61, 54, 44, .14);
  --brand: #277d80;
  --brand-dark: #185d61;
  --accent: #9d5a22;
  --green: #70834a;
  --soft: #edf3f1;
  --warn: #fff1c9;
  --danger: #9e4337;
  --radius-control: 8px;
  --radius-card: 14px;
  --shadow-sm: 0 1px 2px rgba(40, 34, 25, .05);
  --shadow: 0 8px 24px rgba(50, 43, 33, .075);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(244, 241, 234, .91), rgba(241, 238, 231, .97)),
    url("assets/seeds-background.webp") center / cover scroll;
  line-height: 1.45;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(245, 242, 234, .94), rgba(225, 237, 233, .97)),
    url("assets/seeds-background.webp") center / cover;
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(320px, 1fr);
  width: min(820px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(48, 42, 31, .14);
}

.auth-card .brand-logo {
  width: 180px;
  max-height: 120px;
  margin-bottom: 22px;
}

.auth-card h1 {
  max-width: 360px;
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
}

.auth-card .form {
  margin-top: 18px;
}

.auth-intro,
.auth-access {
  padding: clamp(28px, 5vw, 52px);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #24484a;
  background: linear-gradient(150deg, #e1eee9, #f3eadb);
}

.auth-intro > p:last-child {
  max-width: 330px;
  margin-bottom: 0;
  color: #486163;
  font-size: 17px;
}

.auth-access {
  align-self: center;
}

.auth-access h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

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

.auth-access .primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

body.auth-locked > header,
body.auth-locked > main {
  visibility: hidden;
}

body > header {
  min-height: 76px;
  padding: 9px max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 4px 18px rgba(52, 45, 34, .055);
  backdrop-filter: none;
}

body > header > div {
  gap: 11px;
  min-width: 0;
}

.brand-logo {
  width: 104px;
  max-width: none;
  max-height: 70px;
}

body > header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
}

body > header .eyebrow {
  margin-left: 4px;
  font-size: 10px;
}

body > header nav {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(61, 54, 44, .08);
  border-radius: 11px;
  background: rgba(240, 237, 229, .7);
}

body > header nav button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 14px;
}

body > header nav button:hover {
  background: rgba(255, 253, 248, .86);
  box-shadow: none;
  color: var(--text);
  transform: none;
}

body > header nav .tab.active {
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(44, 38, 29, .10), inset 0 -2px 0 var(--brand);
  color: var(--brand-dark);
}

main {
  width: min(1180px, calc(100vw - 36px));
  margin: 24px auto 64px;
}

.title-row {
  align-items: center;
  margin-bottom: 16px;
}

.title-row > div:first-child {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.title-row h2 {
  color: var(--text);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.08;
  text-shadow: none;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
}

h3 {
  line-height: 1.2;
}

.card,
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 18px;
}

.card:hover {
  border-color: rgba(61, 54, 44, .19);
}

button,
.file-btn {
  min-height: 40px;
  border: 1px solid rgba(61, 54, 44, .14);
  border-radius: var(--radius-control);
  background: #fffdf8;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

button:hover,
.file-btn:hover {
  border-color: rgba(39, 125, 128, .28);
  background: #fff;
  box-shadow: 0 4px 12px rgba(45, 39, 30, .08);
}

.primary,
button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary:hover,
button.primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

button.danger,
.confirm-card .danger {
  border-color: var(--danger);
  background: var(--danger);
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid rgba(61, 54, 44, .16);
  border-radius: var(--radius-control);
  background: #fffefa;
  box-shadow: inset 0 1px 2px rgba(45, 39, 30, .035);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(39, 125, 128, .28);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(39, 125, 128, .12);
  background: #fff;
}

label {
  gap: 5px;
  color: #5d574e;
  font-size: 13px;
  font-weight: 700;
}

.form,
.mini-form {
  gap: 12px;
}

.form-notice {
  border: 1px solid rgba(39, 125, 128, .14);
  border-radius: 10px;
  background: #eaf4f2;
}

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

.section-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-head h3,
.card > h3 {
  margin-bottom: 8px;
}

.pill {
  border: 1px solid rgba(61, 54, 44, .09);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
}

.home-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.home-card {
  grid-column: span 6;
  gap: 8px;
  padding: 18px;
}

.home-card h3 {
  font-size: 24px;
}

.home-action-card {
  order: 1;
  border-left: 3px solid var(--accent);
}

.home-month-finance-card {
  order: 2;
}

.home-mps-card {
  order: 3;
}

.home-cycle-finance-card {
  order: 4;
}

.public-sales-card {
  order: 5;
}

.work-hours-card {
  order: 6;
}

.data-safety-home-card {
  order: 7;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-left: 3px solid #818b76;
}

.data-safety-home-card .eyebrow,
.data-safety-home-card h3,
.data-safety-home-card p {
  grid-column: 1;
}

.data-safety-home-card button {
  grid-column: 2;
  grid-row: 1 / 4;
}

.home-metrics span {
  border: 1px solid rgba(61, 54, 44, .08);
  border-radius: 9px;
  background: rgba(244, 241, 234, .62);
}

.home-suggested-item {
  padding: 8px 0;
}

.setup-card {
  margin-top: 12px;
}

.section-entry-card {
  border-left: 3px solid var(--brand);
}

.operation-hub {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.operation-hub button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  min-height: 76px;
  padding: 12px;
  text-align: left;
}

.operation-hub button span {
  font-size: 16px;
}

.operation-hub button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.operation-hub button.primary small {
  color: rgba(255, 255, 255, .78);
}

.monthly-finance-card {
  border-left: 3px solid var(--brand);
}

.monthly-finance-metrics {
  gap: 8px;
}

.monthly-finance-metrics div {
  min-height: 72px;
  border: 0;
  border-radius: 9px;
  background: #f4f1ea;
}

.monthly-finance-metrics div:nth-child(6) {
  background: #e4f0ee;
  box-shadow: inset 0 0 0 1px rgba(39, 125, 128, .16);
}

.monthly-finance-metrics div:nth-child(6) strong {
  color: var(--brand-dark);
  font-size: 22px;
}

.monthly-finance-bars i,
.finance-cycle-bars i {
  background: #e6e1d8;
}

.table-wrap,
.mps-load-table-wrap,
.mps-purchase-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, .82);
  scrollbar-color: rgba(39, 125, 128, .35) transparent;
}

table {
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #eeebe4;
  color: #5f594f;
  font-size: 11px;
  letter-spacing: .04em;
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(61, 54, 44, .07);
}

tbody tr:nth-child(even) td {
  background: rgba(244, 241, 234, .36);
}

tbody tr:hover td {
  background: rgba(226, 239, 237, .58);
}

.product-state-card {
  border-left: 3px solid var(--brand);
}

.product-state-table th:first-child,
.product-state-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  background: #fffdf8;
  box-shadow: 1px 0 0 var(--line);
}

.product-state-table th:first-child {
  z-index: 3;
  background: #eeebe4;
}

.product-state-table .stock-number {
  font-weight: 750;
}

.product-state-table td {
  padding-block: 7px;
}

.product-state-table td:nth-child(4) .stock-number {
  color: var(--brand-dark);
}

.mps-section-nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, .9);
}

.mps-section-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
}

.mps-section-nav button::before {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: rgba(39, 125, 128, .12);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}

.mps-section-nav button:nth-child(1)::before { content: "1"; }
.mps-section-nav button:nth-child(2)::before { content: "2"; }
.mps-section-nav button:nth-child(3)::before { content: "3"; }

.mps-section-nav button.active::before {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.mps-load-table input,
.price-adjustment-table input {
  min-height: 36px;
  padding: 7px 8px;
}

.manual-cost-panel {
  margin: 0 0 14px;
  border: 1px solid rgba(39, 125, 128, .16);
  border-radius: 11px;
  background: #f3f7f5;
}

.manual-cost-panel > summary {
  padding: 2px 0;
}

.manual-cost-panel .form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

#priceList {
  min-height: 180px;
  max-height: 280px;
  overflow: auto;
}

.price-review-panel,
.price-review-row {
  border-radius: 10px;
}

.price-adjustment-table tr.warn td {
  background: rgba(255, 241, 201, .38);
}

.sale-card-list {
  gap: 14px;
}

.sale-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-left-width: 1px;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: var(--shadow-sm);
}

.sale-card-actions {
  padding-top: 4px;
}

.sale-card-actions button {
  min-height: 34px;
}

.sale-card-actions button[data-copy-order] {
  border-color: rgba(39, 125, 128, .22);
  color: var(--brand-dark);
}

.work-summary-card {
  border-top: 3px solid var(--green);
}

.work-summary-kpis > div {
  border: 0;
  border-radius: 9px;
  background: #eef3e8;
}

.diagnostic-panel {
  border-radius: 10px;
  background: rgba(247, 244, 237, .72);
}

.diagnostic-panel > summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 2px 0;
  list-style-position: outside;
}

.diagnostic-panel[open] > summary {
  margin-bottom: 10px;
}

.diagnostic-panel + .diagnostic-panel {
  margin-top: 10px;
}

.diagnostic-grid .diagnostic-panel + .diagnostic-panel {
  margin-top: 0;
}

.diagnostic-kpis div {
  border: 0;
  border-radius: 9px;
  background: #f1eee7;
}

.danger-zone {
  border: 1px solid rgba(158, 67, 55, .16);
  background: #fff8f5;
  box-shadow: none;
}

.row,
.setup-item {
  transition: background .15s ease, border-color .15s ease;
}

.row:hover,
.setup-item:hover {
  background: rgba(231, 241, 239, .46);
}

@media (max-width: 900px) {
  body > header {
    gap: 8px;
    padding: 8px 16px;
  }

  body > header nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body > header nav::-webkit-scrollbar {
    display: none;
  }

  body > header nav button {
    flex: 0 0 auto;
  }

  main {
    width: min(100% - 24px, 1180px);
    margin-top: 18px;
  }

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

  .home-card,
  .data-safety-home-card {
    grid-column: 1;
  }

  .operation-hub,
  .manual-cost-panel .form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .mps-section-nav {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    overflow-x: auto;
  }

  .monthly-finance-metrics,
  .diagnostic-kpis,
  .work-summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body {
    background: #f1eee7;
  }

  body > header {
    min-height: 0;
  }

  .brand-logo {
    width: 58px;
    height: 46px;
  }

  body > header .eyebrow {
    display: none;
  }

  body > header h1 {
    font-size: 17px;
  }

  body > header nav button {
    min-width: 0;
    min-height: 38px;
    padding: 7px 3px;
    font-size: 11px;
    white-space: nowrap;
  }

  body > header nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }

  .title-row {
    gap: 10px;
  }

  .title-row h2 {
    font-size: 28px;
  }

  .card,
  .home-card {
    padding: 14px;
  }

  .operation-hub,
  .manual-cost-panel .form,
  .form,
  .monthly-finance-metrics,
  .diagnostic-kpis,
  .work-summary-kpis {
    grid-template-columns: 1fr;
  }

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

  .monthly-finance-metrics,
  .diagnostic-kpis,
  .work-summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operation-hub button {
    min-height: 68px;
  }

  .data-safety-home-card {
    grid-template-columns: 1fr;
  }

  .data-safety-home-card button {
    grid-column: 1;
    grid-row: auto;
  }

  .mps-section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-inline: -2px;
    overflow: visible;
  }

  .mps-section-nav button {
    min-width: 0;
    min-height: 62px;
    flex-direction: column;
    gap: 4px;
    padding: 7px 4px;
    font-size: 11px;
    line-height: 1.15;
  }

  .mps-section-nav button::before {
    width: 20px;
    height: 20px;
  }

  .mps-draft-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .product-state-table th:first-child,
  .product-state-table td:first-child {
    min-width: 155px;
    width: 155px;
  }

  .product-state-table td:first-child {
    font-size: 13px;
    line-height: 1.25;
  }

  #priceList {
    min-height: 150px;
    max-height: 220px;
  }

  .form-actions,
  .actions {
    align-items: stretch;
  }

  .form-actions button,
  .actions button,
  .actions .file-btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .sale-card-actions button {
    flex: 1 1 calc(50% - 8px);
  }

  .auth-gate {
    align-items: start;
    padding: 12px;
  }

  .auth-card {
    grid-template-columns: 1fr;
    margin: 12px 0;
    border-radius: 16px;
  }

  .auth-intro,
  .auth-access {
    padding: 24px;
  }

  .auth-intro {
    padding-bottom: 22px;
  }

  .auth-card .brand-logo {
    width: 84px;
    height: auto;
    margin-bottom: 14px;
  }

  .auth-card h1 {
    font-size: 30px;
  }

  .auth-intro > p:last-child {
    font-size: 15px;
  }
}
