.customer-number-editor {
  display: grid;
  grid-template-columns: minmax(150px, 230px) auto minmax(120px, 1fr);
  gap: 8px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  background: #f6f1e8;
  border-left: 3px solid #c38b31;
}

.customer-number-editor label span {
  margin-bottom: 5px;
}

.customer-number-editor input {
  min-height: 44px;
}

.customer-number-editor .message {
  align-self: center;
  min-height: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr);
  gap: 28px;
  align-items: start;
}

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

.field-help {
  margin: -5px 0 0;
  color: #70655c;
  font-size: 13px;
  line-height: 1.6;
}

.video-preview iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #211b17;
}

.order-folders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.address-book-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #d9cdbd;
  background: #f7f1e8;
}

.address-book-toolbar strong,
.address-book-toolbar span {
  display: block;
}

.address-book-toolbar strong {
  color: #31503a;
  font-size: 14px;
}

.address-book-toolbar span {
  margin-top: 4px;
  color: #70655c;
  font-size: 12px;
  line-height: 1.5;
}

.invoice-pricing {
  margin: 14px 0;
  border-top: 1px solid #d9cdbd;
  border-bottom: 1px solid #d9cdbd;
}

.invoice-pricing div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.invoice-pricing div + div {
  border-top: 1px dashed #d9cdbd;
}

.invoice-pricing .invoice-total {
  color: #812d22;
  font-size: 18px;
  font-weight: 900;
}

.adjustment-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, .45fr) auto minmax(100px, .7fr);
  gap: 8px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border-left: 3px solid #812d22;
  background: #f6f1e8;
}

.adjustment-editor input {
  min-height: 44px;
}

.adjustment-editor .message {
  align-self: center;
  min-height: 0;
}

.order-folders button {
  position: relative;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid #d9cdbd;
  border-top: 5px solid #cbbba8;
  background: #f7f1e8;
  color: #211b17;
  text-align: left;
  cursor: pointer;
}

.order-folders button.active {
  border-color: #812d22;
  border-top-color: #812d22;
  background: #fff;
  box-shadow: 0 8px 20px rgba(74, 48, 35, .1);
}

.order-folders span,
.order-folders strong,
.order-folders small {
  display: block;
}

.order-folders span {
  font-size: 13px;
  font-weight: 900;
}

.order-folders strong {
  margin-top: 5px;
  color: #812d22;
  font-size: 24px;
}

.order-folders small {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: #70655c;
  font-size: 11px;
}

.order-view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #31503a;
}

.order-view-heading h3,
.order-view-heading p {
  margin: 0;
}

.order-view-heading h3 {
  font-family: serif;
  font-size: 24px;
}

.order-view-heading p {
  margin-top: 5px;
  color: #70655c;
  font-size: 13px;
}

.trash-retention {
  margin: 10px 0 0;
  padding: 9px 11px;
  background: #fff3dd;
  color: #7a4d16;
  font-size: 12px;
  font-weight: 800;
}

.status.preparing {
  background: #fff0c7;
  color: #7b5000;
}

.invoice-jpg-sheet {
  position: fixed;
  z-index: 999999;
  top: 0;
  left: -10000px;
  width: 794px;
  min-height: 1123px;
  padding: 48px;
  background: #fff;
  color: #1f2b23;
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.invoice-jpg-sheet .ij-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 4px solid #28613f;
}

.invoice-jpg-sheet .ij-head p,
.invoice-jpg-sheet .ij-head h1 {
  margin: 0;
}

.invoice-jpg-sheet .ij-head p {
  color: #58665d;
  font-weight: 800;
}

.invoice-jpg-sheet .ij-head h1 {
  margin-top: 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.invoice-jpg-sheet .ij-head > div:last-child {
  text-align: right;
  line-height: 1.8;
}

.invoice-jpg-sheet .ij-customer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0;
}

.invoice-jpg-sheet .ij-customer div {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #d5ded7;
}

.invoice-jpg-sheet .ij-customer .wide {
  grid-column: 1 / -1;
}

.invoice-jpg-sheet .ij-customer span,
.invoice-jpg-sheet .ij-customer strong,
.invoice-jpg-sheet .ij-items small {
  display: block;
}

.invoice-jpg-sheet .ij-customer span,
.invoice-jpg-sheet .ij-items small {
  color: #667269;
  font-size: 12px;
}

.invoice-jpg-sheet .ij-customer strong {
  margin-top: 6px;
  font-size: 16px;
}

.invoice-jpg-sheet .ij-items,
.invoice-jpg-sheet .ij-summary table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-jpg-sheet .ij-items th,
.invoice-jpg-sheet .ij-items td {
  padding: 11px 8px;
  border-bottom: 1px solid #d5ded7;
  text-align: right;
}

.invoice-jpg-sheet .ij-items th:first-child,
.invoice-jpg-sheet .ij-items td:first-child {
  text-align: left;
}

.invoice-jpg-sheet .ij-items th {
  color: #1d4f31;
}

.invoice-jpg-sheet .ij-items small {
  margin-top: 4px;
}

.invoice-jpg-sheet .ij-summary {
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid #cddacd;
  background: #f7faf7;
}

.invoice-jpg-sheet .ij-summary td {
  padding: 8px 0;
  border-bottom: 1px solid #dce5dc;
}

.invoice-jpg-sheet .ij-summary td:last-child {
  text-align: right;
  font-weight: 800;
}

.invoice-jpg-sheet .ij-summary .total td {
  padding-top: 14px;
  border-bottom: 0;
  color: #166039;
  font-size: 22px;
  font-weight: 900;
}

.invoice-jpg-sheet .ij-memo,
.invoice-jpg-sheet .ij-notice {
  margin-top: 16px;
  padding: 13px 16px;
}

.invoice-jpg-sheet .ij-memo {
  background: #f2f5f1;
}

.invoice-jpg-sheet .ij-notice {
  background: #fff3d5;
  color: #6b4917;
  font-weight: 700;
}

.invoice-jpg-sheet .ij-qr {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #d5ded7;
  text-align: center;
}

.invoice-jpg-sheet .ij-qr h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.invoice-jpg-sheet .ij-qr img {
  display: block;
  width: 270px;
  height: auto;
  margin: 0 auto;
}

.invoice-jpg-sheet footer {
  margin-top: 24px;
  color: #758078;
  font-size: 12px;
  text-align: center;
}

.delivered-sales {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #cbd8ce;
  background: #f5f8f5;
}

.sales-period-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  border: 1px solid #b9c8bc;
}

.sales-period-tabs button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  background: #fff;
  color: #31503a;
  font-weight: 800;
  cursor: pointer;
}

.sales-period-tabs button + button {
  border-left: 1px solid #b9c8bc;
}

.sales-period-tabs button.active {
  background: #31503a;
  color: #fff;
}

.sales-quick-range,
.custom-sales-range {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.sales-quick-range label span,
.custom-sales-range label span {
  display: block;
  margin-bottom: 5px;
  color: #58665d;
  font-size: 12px;
  font-weight: 800;
}

.sales-quick-range input,
.custom-sales-range input {
  min-height: 42px;
}

.delivered-sales-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.delivered-sales-summary div {
  padding: 15px 16px;
  border-top: 2px solid #31503a;
  background: #fff;
}

.delivered-sales-summary span,
.delivered-sales-summary strong {
  display: block;
}

.profit-section {
  padding: 26px 0;
  border-top: 1px solid #d9cdbd;
}

.profit-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

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

.subpanel-head h3,
.subpanel-head p {
  margin: 0;
}

.subpanel-head h3 {
  font-family: serif;
  font-size: 24px;
}

.subpanel-head p {
  margin-top: 5px;
  color: #70655c;
  font-size: 13px;
}

.profit-range,
.procurement-meta {
  display: grid;
  gap: 10px;
  align-items: end;
}

.profit-range {
  grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
}

.profit-range label span,
.procurement-form label span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
}

.profit-range input,
.procurement-form input {
  min-height: 42px;
}

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

.profit-metrics > div {
  min-height: 104px;
  padding: 15px;
  border-top: 4px solid #31503a;
  background: #f5f8f5;
}

.profit-metrics span,
.profit-metrics strong,
.profit-metrics small {
  display: block;
}

.profit-metrics span,
.profit-metrics small {
  color: #667269;
  font-size: 12px;
}

.profit-metrics strong {
  margin: 8px 0 4px;
  color: #1f5534;
  font-size: 22px;
}

.negative {
  color: #b1372b !important;
}

.profit-warning {
  margin: 12px 0;
  padding: 11px 13px;
  background: #fff3d5;
  color: #6b4917;
  font-size: 13px;
  font-weight: 800;
}

.profit-order-list {
  margin-top: 16px;
}

.profit-order-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, .7fr));
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #e2dbd1;
}

.profit-order-row > div > span,
.profit-order-row > div > strong {
  display: block;
}

.profit-order-row > div > span {
  margin-bottom: 3px;
  color: #70655c;
  font-size: 11px;
}

.procurement-form {
  display: grid;
  gap: 16px;
}

.procurement-actions,
.shipment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.product-form .form-actions {
  flex-wrap: wrap;
}

.product-form .form-actions button {
  min-width: 130px;
}

.procurement-meta {
  grid-template-columns: 1.2fr repeat(3, minmax(140px, .7fr));
}

.procurement-items-head,
.procurement-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(110px, .55fr) minmax(150px, .75fr) minmax(200px, 1fr);
  gap: 10px;
  align-items: center;
}

.procurement-items-head {
  padding: 8px 12px;
  background: #31503a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.procurement-item-row {
  padding: 10px 12px;
  border-bottom: 1px solid #e2dbd1;
}

.procurement-item-row.inactive {
  background: #f5f1ea;
}

.procurement-hidden-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  background: #e7dfd4;
  color: #6f6257;
  font-size: 10px;
  font-style: normal;
  vertical-align: middle;
}

.procurement-item-row small,
.procurement-item-row [data-procurement-cost] span,
.procurement-item-row [data-procurement-cost] strong {
  display: block;
}

.procurement-item-row small,
.procurement-item-row [data-procurement-cost] span {
  color: #70655c;
  font-size: 11px;
}

.procurement-total {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px 16px;
  background: #f5f8f5;
}

.inventory-head,
.inventory-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, .7fr));
  gap: 12px;
  align-items: center;
}

.inventory-head {
  padding: 10px 12px;
  background: #31503a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.inventory-row {
  padding: 13px 12px;
  border-bottom: 1px solid #e2dbd1;
}

.inventory-row small {
  display: block;
  color: #70655c;
}

.shipment-row {
  border-bottom: 1px solid #d9cdbd;
}

.shipment-row summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 8px;
  cursor: pointer;
}

.shipment-row summary span,
.shipment-row summary strong,
.shipment-row summary small {
  display: block;
}

.shipment-row summary small {
  margin-top: 4px;
  color: #70655c;
}

.shipment-row summary > span:last-child {
  text-align: right;
}

.shipment-actions {
  justify-content: flex-end;
  padding: 0 0 14px;
}

.shipment-row.draft {
  background: #fff9e8;
  border-left: 4px solid #c38b31;
  padding-left: 12px;
}

.shipment-status {
  display: inline-flex !important;
  margin-left: 8px;
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
  vertical-align: middle;
}

.shipment-status.draft {
  background: #f6df9d;
  color: #674509;
}

.shipment-status.confirmed {
  background: #e6efe8;
  color: #31503a;
}

.shipment-items {
  padding: 0 8px 12px 28px;
}

.shipment-items > div {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed #d9cdbd;
  font-size: 12px;
}

.order-profit {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  padding: 10px 12px;
  background: #eaf2eb;
  color: #1f5534;
}

.order-profit.unavailable {
  background: #fff3d5;
  color: #6b4917;
}

.delivered-sales-summary span {
  color: #667269;
  font-size: 12px;
}

.delivered-sales-summary strong {
  margin-top: 6px;
  color: #1f5534;
  font-size: 24px;
}

@media (max-width: 820px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .customer-number-editor {
    grid-template-columns: 1fr auto;
  }

  .customer-number-editor .message {
    grid-column: 1 / -1;
  }

  .order-folders {
    grid-template-columns: 1fr;
  }

  .address-book-toolbar,
  .adjustment-editor {
    grid-template-columns: 1fr;
  }

  .sales-period-tabs,
  .delivered-sales-summary {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .sales-period-tabs button + button {
    border-top: 1px solid #b9c8bc;
    border-left: 0;
  }

  .sales-quick-range,
  .custom-sales-range {
    align-items: stretch;
    flex-direction: column;
  }

  .subpanel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .profit-range,
  .profit-metrics,
  .procurement-meta {
    grid-template-columns: 1fr;
  }

  .procurement-items-head {
    display: none;
  }

  .procurement-item-row,
  .profit-order-row,
  .inventory-head,
  .inventory-row,
  .shipment-items > div {
    grid-template-columns: 1fr;
  }

  .inventory-head {
    display: none;
  }

  .shipment-row summary {
    flex-direction: column;
  }

  .shipment-row summary > span:last-child {
    text-align: left;
  }
}
