@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+KR:wght@400;500;600;700&family=Oswald:wght@400;500;600&display=swap");

:root {
  --paper: #f9fbfd;
  --paper-deep: #f2f6fa;
  --paper-soft: #ffffff;
  --query-paper: #ffffff;
  --query-paper-deep: #f4f7fb;
  --ink: #161411;
  --muted: rgba(22, 20, 17, 0.58);
  --accent: #f18f01;
  --accent-deep: #f18f01;
  --line: rgba(89, 73, 55, 0.22);
  --line-strong: rgba(89, 73, 55, 0.32);
  --shadow: 0 16px 28px rgba(82, 60, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(180deg, #c2c2c2 0%, #b6b6b6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 100%);
  background-size: 110px 110px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.app-main {
  position: relative;
  padding: 14px;
  display: grid;
  gap: 10px;
  width: min(1840px, calc(100vw - 8px));
  margin: 0 auto;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 0;
  padding: 24px 16px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-soft), var(--paper));
  box-shadow: var(--shadow);
}

.topbar::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(241, 143, 1, 0.34);
}

.topbar-copy {
  position: relative;
  z-index: 1;
  padding-top: 4px;
}

.topbar-kicker {
  margin: 0 0 4px;
  color: rgba(241, 143, 1, 0.76);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-copy h1 {
  margin: 0;
  color: var(--accent);
  font-family: "IBM Plex Sans KR", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.home-link,
.tab-button,
.primary-button,
button {
  appearance: none;
  border: 1px solid rgba(241, 143, 1, 0.32);
  border-radius: 0;
  background: rgba(255, 255, 254, 0.98);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.home-link:hover,
.tab-button:hover,
.primary-button:hover,
button:hover {
  background: var(--accent);
  color: var(--paper-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.primary-button {
  background: var(--paper);
  color: var(--accent);
}

.tab-button.is-active,
.tab-button.is-active:hover {
  background: rgba(241, 143, 1, 0.08);
  color: rgba(217, 126, 0, 0.72);
  border-color: rgba(241, 143, 1, 0.2);
  cursor: default;
  transform: none;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.hero-panel,
.history-panel,
.category-panel,
.product-banner,
.lookup-status,
.history-summary,
.modal-card,
.manual-selected-product {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, var(--paper-soft), var(--paper));
  box-shadow: var(--shadow);
}

.hero-panel::before,
.history-panel::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(241, 143, 1, 0.24);
}

.hero-panel,
.history-panel {
  padding: 14px;
}

.control-grid,
.history-grid {
  display: grid;
  gap: 12px;
}

#tab-classify .hero-panel {
  background: linear-gradient(180deg, var(--paper-soft), var(--paper));
  border-color: rgba(89, 73, 55, 0.2);
}

#tab-classify .hero-panel::before {
  content: none;
}

#tab-classify .hero-panel,
#tab-history .hero-panel,
.history-panel,
.panel-columns > .panel-column > * {
  width: 100%;
}

.control-grid {
  --lookup-main-width: min(980px, 64vw);
}

.control-row-main,
.suggestions {
  width: var(--lookup-main-width);
  max-width: 100%;
}

.control-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 8px;
  align-items: center;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 12px;
  align-items: start;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: rgba(22, 20, 17, 0.58);
}

.pharmacy-field > label {
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(22, 20, 17, 0.78);
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-field label {
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.inline-field > :not(label) {
  flex: 1 1 auto;
  min-width: 0;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.46);
  box-shadow: 0 0 0 3px rgba(241, 143, 1, 0.08);
}

.pharmacy-field,
.pharmacy-picker,
.barcode-panel,
.barcode-row {
  min-width: 0;
}

.pharmacy-picker,
.barcode-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pharmacy-picker {
  flex: 1 1 auto;
}

.pharmacy-picker input,
.barcode-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.date-field input {
  width: 100%;
  flex: 1 1 auto;
  min-width: 176px;
}

.date-field label {
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent-deep);
}

.pharmacy-picker button,
.barcode-row button {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 54px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 14px;
}

.barcode-row input {
  min-height: 54px;
  padding: 14px 14px;
  font-size: 20px;
  font-weight: 700;
  border-color: rgba(89, 73, 55, 0.1);
}

.barcode-row input::placeholder {
  color: rgba(79, 71, 64, 0.38);
  font-size: 15px;
  font-weight: 500;
}

.lookup-status {
  margin-top: 6px;
  min-height: 32px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid rgba(89, 73, 55, 0.1);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  box-shadow: none;
}

#tab-classify .pharmacy-picker input,
#tab-classify .date-field input,
#tab-classify .barcode-row input {
  background: rgba(255, 255, 255, 0.66);
}

#tab-classify .pharmacy-picker,
#tab-classify .barcode-panel,
#tab-classify .product-banner,
#tab-classify .lookup-status {
  background: #f18f01;
  border-color: rgba(186, 101, 6, 0.48);
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion-item {
  border: 1px solid rgba(95, 86, 80, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 254, 0.98);
  color: #4f4740;
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 8px 14px rgba(82, 60, 46, 0.12);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.suggestion-item.is-active,
.suggestion-item:hover,
.suggestion-item:focus-visible {
  border-color: rgba(149, 74, 5, 0.58);
  background: #f18f01;
  color: #fffdf8;
  outline: none;
  box-shadow: 0 10px 18px rgba(149, 74, 5, 0.18);
}

.suggestion-item .query-suggestion-meta {
  color: rgba(79, 71, 64, 0.72);
}

.suggestion-item.is-active .query-suggestion-meta,
.suggestion-item:hover .query-suggestion-meta,
.suggestion-item:focus-visible .query-suggestion-meta {
  color: rgba(255, 250, 241, 0.86);
}

.suggestion-item strong {
  display: block;
  font-size: 14px;
  color: inherit;
}

/* 2026-04-23 classify top controls tone reset */
#tab-classify .pharmacy-field > label {
  color: #4f4740 !important;
}

#tab-classify .pharmacy-picker,
#tab-classify .barcode-panel,
#tab-classify .product-banner,
#tab-classify .lookup-status {
  background: linear-gradient(180deg, var(--paper-soft), var(--paper)) !important;
  border-color: rgba(89, 73, 55, 0.18) !important;
  color: #4f4740 !important;
  box-shadow: none !important;
}

#tab-classify .pharmacy-picker input,
#tab-classify .date-field input,
#tab-classify .barcode-row input {
  background: rgba(255, 255, 254, 0.98) !important;
  border-color: rgba(89, 73, 55, 0.16) !important;
  color: #4f4740 !important;
  box-shadow: none !important;
}

#tab-classify .pharmacy-picker input:focus,
#tab-classify .date-field input:focus,
#tab-classify .barcode-row input:focus {
  border-color: rgba(89, 73, 55, 0.28) !important;
  box-shadow: 0 0 0 2px rgba(89, 73, 55, 0.06) !important;
}

#tab-classify .barcode-row input::placeholder,
#tab-classify .pharmacy-picker input::placeholder {
  color: rgba(79, 71, 64, 0.46) !important;
}

#tab-classify .lookup-status {
  color: rgba(79, 71, 64, 0.78) !important;
  border-top: 1px solid rgba(89, 73, 55, 0.1) !important;
}

#tab-classify .product-banner,
#tab-classify .product-banner.empty {
  color: #4f4740 !important;
}

#tab-classify #clear-pharmacy {
  background: rgba(255, 255, 254, 0.98) !important;
  color: #f18f01 !important;
  border-color: rgba(241, 143, 1, 0.28) !important;
}

#tab-classify #clear-pharmacy:hover {
  background: #ffffff !important;
  color: #f18f01 !important;
  border-color: rgba(241, 143, 1, 0.42) !important;
}

#tab-classify #lookup-button {
  background: #f18f01 !important;
  color: #fffaf1 !important;
  border-color: #f18f01 !important;
}

#tab-classify #lookup-button:hover {
  background: #f18f01 !important;
  color: #fffdf8 !important;
  border-color: #f18f01 !important;
}

.product-banner {
  padding: 12px 14px;
  min-height: 92px;
  font-size: 20px;
}

.product-banner.empty {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.product-banner-table,
.category-table,
.manual-results-table,
#history-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.42);
}

.product-banner-table th,
.category-table th,
.manual-results-table th,
#history-table th {
  background: rgba(241, 143, 1, 0.07);
  color: rgba(22, 20, 17, 0.62);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.product-banner-table th,
.product-banner-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(116, 81, 63, 0.12);
  text-align: left;
  font-size: 20px;
  line-height: 1.5;
  white-space: nowrap;
}

.product-banner-table th {
  font-size: 17px;
}

.banner-serial-cell {
  white-space: normal !important;
}

.serial-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.panel-columns {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.panel-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.category-panel {
  padding: 12px;
  border-top: 1px solid var(--line) !important;
  min-width: 0;
  overflow: hidden;
}

.category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 10px;
}

.category-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.category-title-row {
  display: flex;
  align-items: flex-end;
  gap: 6px 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.category-title-wrap h2 {
  margin: 0;
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(22, 20, 17, 0.78);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.category-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(22, 20, 17, 0.06);
  color: rgba(22, 20, 17, 0.62);
  font-size: 11px;
  font-weight: 700;
}

.category-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
}

.category-table {
  min-width: 640px;
}

.category-table th,
.category-table td,
#history-table th,
#history-table td,
.manual-results-table th,
.manual-results-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(116, 81, 63, 0.12);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.45;
}

.category-table tbody tr:hover,
.manual-results-table tbody tr:hover,
#history-table tbody tr:hover {
  background: rgba(241, 143, 1, 0.04);
}

.category-table th {
  font-size: 12px;
}

.category-table td {
  font-size: 14px;
  line-height: 1.45;
}

.quantity-cell {
  white-space: nowrap;
  font-weight: 600;
}

.quantity-cell.is-editable {
  cursor: pointer;
  text-decoration: underline dotted rgba(241, 143, 1, 0.55);
  text-underline-offset: 0.18em;
}

.quantity-cell.is-editable:hover {
  color: var(--accent);
}

.category-table tbody tr.is-selected,
.manual-results-table tbody tr.is-selected {
  background: rgba(241, 143, 1, 0.08);
}

.manual-results-table tbody tr {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.manual-results-table tbody tr.is-selected td {
  color: var(--accent-deep);
  font-weight: 600;
}

.manual-select-col {
  width: 62px;
  white-space: nowrap;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
}

.category-table tbody tr.is-latest-row td {
  background: #f18f01;
  color: #fff7ef;
  font-weight: 700;
}

.category-table tbody tr.is-latest-row .serial-cell,
.category-table tbody tr.is-latest-row .purchase-col,
.category-table tbody tr.is-latest-row .product-col {
  color: #fff7ef !important;
}

.category-table tbody tr.is-latest-row .quantity-cell.is-editable {
  color: #fff7ef;
  text-decoration-color: rgba(255, 247, 239, 0.9);
}

.category-table tbody tr.is-latest-row input[type="checkbox"] {
  accent-color: #fff7ef;
}

.group-sub-row td {
  background: rgba(255, 255, 254, 0.84);
  color: #6f5b50;
}

.group-sub-row.is-latest-row td {
  background: rgba(241, 143, 1, 0.88);
  color: #ffe7d7;
}

.group-sub-row td:not(.serial-cell) {
  color: transparent;
}

.group-sub-row td:not(.serial-cell)::selection {
  color: transparent;
}

.serial-cell {
  color: var(--ink) !important;
  font-size: 15px;
}

.purchase-col {
  min-width: 82px;
}

.product-col {
  min-width: 180px;
}

.product-name-text {
  vertical-align: middle;
}

.trace-stickers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.trace-sticker {
  display: inline-block;
  max-width: 130px;
  padding: 1px 5px;
  overflow: hidden;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-sticker.is-sale-type {
  border-color: #f97316;
  background: #fff7ed;
  color: #9a3412;
}

.loose-return-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #22a06b;
  border-radius: 999px;
  background: #e9f8ef;
  color: #136a43;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

.serial-col {
  min-width: 144px;
}

.check-col {
  width: 34px;
  text-align: center;
}

.check-col input {
  width: 16px;
  height: 16px;
}

.empty-panel {
  padding: 14px 12px;
  background: rgba(255, 255, 254, 0.95);
  color: #8a766a;
  text-align: center;
}

.history-grid {
  display: block;
}

.history-filter-stack {
  width: min(980px, 100%);
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.history-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.compact-field label {
  margin: 0;
  white-space: nowrap;
  font-size: 15px;
  color: var(--accent-deep);
  align-self: start;
  padding-top: 11px;
  line-height: 1.2;
}

.compact-field input,
.compact-field select {
  max-width: 100%;
  min-width: 0;
  font-size: 16px;
  min-height: 42px;
}

.compact-field > input,
.compact-field > select,
.compact-field > .query-picker {
  width: 100%;
  min-width: 0;
}

.history-picker-field label {
  padding-top: 10px;
}

.query-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.query-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 254, 0.97);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  min-height: 42px;
  font-size: 16px;
}

.query-search-input:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.46);
  box-shadow: 0 0 0 3px rgba(241, 143, 1, 0.08);
}

.query-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.query-chip-list.is-empty {
  display: none;
}

.query-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(241, 143, 1, 0.18);
  background: rgba(241, 143, 1, 0.08);
  color: var(--accent-deep);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
}

.query-chip button {
  min-width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1;
  transform: none !important;
}

.query-suggestions {
  display: grid;
  gap: 6px;
  max-height: 228px;
  overflow-y: auto;
  padding-right: 2px;
}

.query-suggestion {
  display: grid;
  gap: 2px;
}

.query-suggestion-meta {
  font-size: 12px;
  color: var(--muted);
}

.query-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 2px;
}

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

.history-summary {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  flex: 1 1 auto;
  font-size: 18px;
}

#history-table {
  min-width: 1220px;
}

#history-table th {
  font-size: 14px;
}

#history-table td {
  font-size: 16px;
}

.history-note-cell {
  min-width: 190px;
}

.history-note-editor {
  display: grid;
  gap: 6px;
}

.history-note-select {
  width: 100%;
  min-width: 136px;
  appearance: none;
  border: 1px solid rgba(241, 143, 1, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 240, 228, 0.9)),
    linear-gradient(45deg, transparent 50%, rgba(241, 143, 1, 0.72) 50%),
    linear-gradient(135deg, rgba(241, 143, 1, 0.72) 50%, transparent 50%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: auto, 8px 8px, 8px 8px;
  background-position: center, calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  color: var(--ink);
  padding: 7px 34px 7px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 6px 14px rgba(82, 60, 46, 0.05);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.history-note-select:hover {
  border-color: rgba(241, 143, 1, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(245, 240, 228, 0.92)),
    linear-gradient(45deg, transparent 50%, rgba(241, 143, 1, 0.74) 50%),
    linear-gradient(135deg, rgba(241, 143, 1, 0.74) 50%, transparent 50%);
}

.history-note-select:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.42);
  box-shadow:
    0 0 0 3px rgba(241, 143, 1, 0.10),
    0 10px 22px rgba(82, 60, 46, 0.08);
}

.history-note-custom-input {
  width: 100%;
  min-width: 150px;
  border: 1px solid rgba(241, 143, 1, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.history-note-custom-input:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.42);
  box-shadow: 0 0 0 3px rgba(241, 143, 1, 0.1);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(53, 36, 28, 0.35);
}

.modal-card {
  width: min(1120px, 100%);
  padding: 14px;
}

.choice-modal-card {
  width: min(560px, 100%);
}

.return-slip-copy-modal-card {
  width: min(640px, 100%);
}

.quantity-modal-card {
  width: min(460px, 100%);
}

.direct-wholesale-modal-card {
  width: min(520px, 100%);
}

.geopharm-reason-modal-card {
  width: min(840px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

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

.modal-card.is-draggable .modal-head {
  cursor: move;
  user-select: none;
  touch-action: none;
}

.modal-card.is-dragging {
  transition: none;
}

.modal-head h2 {
  margin: 0;
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}

.modal-close {
  min-width: auto;
}

.choice-modal-message {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  font-size: 18px;
  line-height: 1.5;
}

.quantity-edit-product {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

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

.quantity-edit-list + .quantity-edit-grid {
  display: none;
}

.quantity-edit-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.quantity-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.85fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.quantity-edit-row-label {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.quantity-edit-row-label strong,
.quantity-edit-row-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-edit-row-label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.quantity-edit-inputs label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quantity-edit-inputs em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.quantity-edit-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  text-align: center;
}

@media (max-width: 640px) {
  .quantity-edit-row {
    grid-template-columns: 1fr;
  }
}

.quantity-edit-grid .field {
  display: grid;
  gap: 6px;
}

.quantity-edit-grid label {
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.quantity-edit-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.quantity-edit-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.direct-wholesale-section {
  margin-bottom: 14px;
}

.direct-wholesale-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.direct-wholesale-section select,
.direct-wholesale-section input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.direct-wholesale-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.geopharm-reason-section {
  display: grid;
  min-height: 0;
  gap: 10px;
  margin-bottom: 14px;
}

.geopharm-reason-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.geopharm-reason-list {
  display: grid;
  gap: 8px;
  max-height: min(56vh, 500px);
  overflow: auto;
  padding-right: 2px;
}

.geopharm-reason-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.9fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.geopharm-reason-product {
  min-width: 0;
  color: var(--ink);
  line-height: 1.4;
}

.geopharm-reason-product strong,
.geopharm-reason-product span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geopharm-reason-product strong {
  font-size: 15px;
}

.geopharm-reason-product span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.geopharm-reason-editor {
  display: grid;
  gap: 7px;
}

.geopharm-reason-editor select,
.geopharm-reason-editor input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.geopharm-reason-editor select:focus,
.geopharm-reason-editor input:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.42);
  box-shadow: 0 0 0 3px rgba(241, 143, 1, 0.1);
}

.purchase-return-plan-editor {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr);
  gap: 8px;
}

.purchase-return-plan-editor label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.purchase-return-plan-editor label span em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.purchase-return-plan-editor input,
.purchase-return-plan-editor select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.purchase-return-plan-editor input:focus,
.purchase-return-plan-editor select:focus {
  outline: none;
  border-color: rgba(241, 143, 1, 0.42);
  box-shadow: 0 0 0 3px rgba(241, 143, 1, 0.1);
}

.geopharm-reason-message {
  min-height: 20px;
  color: #b4432d;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .geopharm-reason-row {
    grid-template-columns: 1fr;
  }

  .purchase-return-plan-editor {
    grid-template-columns: 1fr;
  }
}

.choice-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-option-button {
  display: grid;
  justify-items: start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
}

.choice-option-button strong {
  font-size: 21px;
  font-weight: 700;
}

.choice-option-button span {
  font-size: 14px;
  color: inherit;
  opacity: 0.86;
}

.return-slip-copy-summary {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.return-slip-copy-guide {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.return-slip-copy-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.return-slip-copy-options .choice-option-button {
  min-height: 104px;
}

@media (max-width: 560px) {
  .return-slip-copy-options {
    grid-template-columns: 1fr;
  }
}

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 12px;
}

.modal-section {
  display: grid;
  gap: 8px;
}

.modal-section label {
  font-family: "Oswald", "IBM Plex Sans KR", sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.modal-section input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.manual-results-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.manual-selected-product {
  padding: 10px 12px;
  min-height: 60px;
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--ink);
}

.manual-selected-product.empty {
  color: var(--muted);
}

.manual-selected-product strong {
  font-size: 17px;
  color: var(--accent-deep);
}

.manual-selected-product span {
  color: var(--ink);
}

.manual-selected-list {
  display: grid;
  gap: 4px;
}

.manual-selected-item {
  font-size: 14px;
  color: var(--muted);
}

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

.manual-add-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 1280px) {
  .control-row-main,
  .suggestions {
    width: 100%;
  }
}

@media (max-width: 1080px) {
  .lookup-row,
  .panel-columns,
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-main {
    padding: 10px;
  }

  .hero-panel,
  .history-panel,
  .category-panel,
  .modal-card {
    padding: 10px;
  }

  .control-row-main,
  .inline-field,
  .pharmacy-picker,
  .barcode-row,
  .query-actions,
  .modal-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .category-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .category-actions button {
    width: 100%;
  }

  .pharmacy-picker button,
  .barcode-row button,
  .home-link,
  .tab-button,
  .primary-button,
  button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .barcode-row input {
    min-height: 48px;
    font-size: 18px;
  }

  .manual-field-grid {
    grid-template-columns: 1fr;
  }

  .history-date-row,
  .history-summary-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}

.todo-return-lookup-warning {
  margin: 0 0 10px;
  padding: 11px 13px;
  border: 1px solid #e6a675;
  border-radius: 10px;
  background: #fff4e8;
  color: #8f3f0b;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .topbar-actions .home-link {
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Final portal frame alignment: same top spacing/background, wider data workspace. */
body {
  background: linear-gradient(180deg, #f4f7fb 0%, #e9eef5 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.34) 0 18%, transparent 18% 100%),
    linear-gradient(-16deg, rgba(255, 255, 255, 0.2) 0 16%, transparent 16% 100%);
}

.app-main {
  width: min(1840px, calc(100vw - 8px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 42px 36px 36px !important;
  gap: 18px !important;
}

@media (max-width: 980px) {
  .app-main {
    width: auto !important;
    padding: 20px 18px 18px !important;
  }
}

@media (max-width: 720px) {
  .app-main {
    width: min(100vw - 24px, 100%) !important;
    gap: 14px !important;
  }
}

/* Return purchase/sales pending management */
.topbar-actions .tab-button {
  white-space: nowrap;
}

.pending-tab-button {
  position: relative;
  margin-top: 0;
  overflow: visible;
}

.pending-tab-badges {
  position: absolute;
  top: -13px;
  right: 5px;
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.pending-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 1px 3px rgba(154, 52, 18, 0.16);
}

.pending-tab-badge.is-sales {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.pending-tab-badge strong {
  font-size: 11px;
}

.pending-hero-panel {
  padding: 22px 24px;
}

.pending-heading-row,
.pending-toolbar,
.pending-db-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pending-heading-row h2 {
  margin: 2px 0 6px;
  color: #182637;
  font-size: 24px;
}

.pending-kicker {
  margin: 0;
  color: #1e6fe8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.pending-guide,
.pending-matching-note {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.pending-db-status {
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #526276;
  font-size: 12px;
}

.pending-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.pending-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid #d8e1eb;
  border-radius: 16px;
  background: #fff;
  color: #526276;
  text-align: left;
  box-shadow: 0 6px 18px rgba(31, 50, 74, 0.05);
}

.pending-summary-card strong {
  color: #d05242;
  font-size: 28px;
}

.pending-summary-card.is-complete strong {
  color: #23845b;
}

.pending-summary-card.is-active {
  border-color: #1e6fe8;
  background: #eef5ff;
  color: #174f9e;
  box-shadow: 0 8px 22px rgba(30, 111, 232, 0.13);
}

.pending-management-panel {
  padding: 18px;
}

.pending-toolbar {
  margin-bottom: 10px;
}

.pending-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #526276;
  font-size: 12px;
  font-weight: 800;
}

.pending-search-field input {
  width: 220px;
  min-height: 38px;
}

.pending-filter-button.is-active {
  border-color: #1e6fe8;
  background: #eef5ff;
  color: #174f9e;
}

.pending-matching-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8fb;
}

#pending-table {
  min-width: 1380px;
}

#pending-table th,
#pending-table td {
  padding: 11px 10px;
  vertical-align: top;
  font-size: 12px;
}

#pending-table tbody tr.is-complete {
  background: #f4faf7;
  color: #5e7067;
}

#pending-table td > small,
.pending-evidence small,
.pending-match-warning {
  display: block;
  margin-top: 5px;
  color: #77869a;
  font-size: 11px;
  line-height: 1.4;
}

.pending-match-warning {
  color: #b45309;
}

.pending-quantity-cell {
  color: #1e293b;
  font-size: 15px !important;
  font-weight: 900;
  text-align: center;
}

.pending-evidence {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 5px 8px;
}

.pending-evidence small {
  grid-column: 1 / -1;
  margin: 0;
}

.pending-evidence-qty {
  color: #475569;
  font-weight: 800;
}

.pending-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1ef;
  color: #b64234;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.pending-status-badge.is-complete {
  background: #e7f7ef;
  color: #18764e;
}

.pending-status-badge.is-partial,
.pending-status-badge.is-skyz-pending {
  background: #fff6d8;
  color: #946200;
}

.pending-status-badge.is-warning {
  background: #f4ecff;
  color: #7650a8;
}

.pending-actions-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #b64234;
  font-weight: 900;
}

.pending-actions-cell.is-complete {
  color: #18764e;
}

.plaza-external-panel {
  border-left: 3px solid #be8a33;
}

.plaza-print-picker {
  width: min(460px, calc(100vw - 32px));
  max-height: min(700px, calc(100vh - 32px));
  padding: 22px;
  border: 1px solid #d8cbb8;
  border-radius: 12px;
  background: #fff;
  color: #17212f;
  box-shadow: 0 18px 48px #17212f33;
}

.plaza-print-picker::backdrop {
  background: #17212f80;
}

.plaza-print-picker h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.plaza-print-picker p {
  margin: 0 0 16px;
  color: #655f56;
  font-size: 13px;
}

.plaza-print-selection-actions,
.plaza-print-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.plaza-print-suppliers {
  display: grid;
  gap: 4px;
  max-height: min(400px, 50vh);
  margin: 12px 0 18px;
  overflow: auto;
}

.plaza-print-suppliers label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #e3ddd3;
  border-radius: 6px;
  cursor: pointer;
}

.plaza-print-suppliers label span {
  flex: 1;
  overflow-wrap: anywhere;
}

.plaza-print-suppliers label small {
  color: #655f56;
  white-space: nowrap;
}

.plaza-print-picker-actions [data-plaza-print-selected] {
  background: #8b651f;
  color: #fff;
}

.plaza-guide,
.plaza-file-status,
.plaza-upload-message {
  margin: 7px 0;
  color: #6b635b;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.plaza-file-status {
  padding: 8px 10px;
  background: #f5f1e9;
}

.plaza-file-status.is-error,
.plaza-upload-message {
  color: #8b4c22;
}

.plaza-pending-count {
  color: #8b651f;
  font-size: 11px;
}

.plaza-table {
  width: 100%;
  min-width: 680px;
  table-layout: fixed;
}

.plaza-table td,
.plaza-table th {
  font-size: 12px;
  vertical-align: top;
  padding: 5px 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.plaza-table td > small {
  display: block;
  margin-top: 2px;
  color: #777168;
  font-size: 11px;
  line-height: 1.4;
}

.plaza-table th {
  font-size: 11px;
  white-space: nowrap;
}

.plaza-product-cell {
  overflow-wrap: anywhere;
}

.plaza-history-cell {
  font-variant-numeric: tabular-nums;
}

.plaza-serial-cell {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.plaza-quantity-cell {
  font-weight: 700;
  text-align: center !important;
}

.plaza-quantity-cell input {
  width: 100%;
  min-width: 34px;
  padding: 3px 1px;
  border: 1px solid #aeb9c7;
  border-radius: 3px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
}

.plaza-quantity-cell input::-webkit-inner-spin-button,
.plaza-quantity-cell input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.plaza-evidence-cell {
  overflow-wrap: anywhere;
}

.plaza-evidence {
  display: inline-block;
  padding: 3px 4px;
  background: #eeeae4;
  color: #655f56;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.plaza-evidence.is-confirmed {
  color: #226047;
  background: #e6f2e9;
}

.plaza-evidence.is-partial,
.plaza-evidence.is-pending {
  color: #886014;
  background: #fff3d5;
}

.plaza-evidence.is-error {
  color: #a3442f;
  background: #f9e9e3;
}

.plaza-result-row.is-first td {
  border-top: 1px solid #d8cbb8;
}

.plaza-message-row td {
  background: #faf7f1;
  color: #806649;
  font-size: 11px;
  line-height: 1.6;
}

.plaza-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  white-space: nowrap;
}

.plaza-row-actions button {
  padding: 3px 2px;
  font-size: 11px;
  white-space: normal;
}

.plaza-lookup-summary > td {
  background: #faf7f1;
  color: #806649;
  padding: 6px 8px;
}

.plaza-lookup-summary > td > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
}

.plaza-history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #d8cbb8;
  background: #fff;
  color: #65523b;
  font-size: 12px;
}

.plaza-expand-icon {
  width: 12px;
  font-size: 15px;
  line-height: 1;
}

.plaza-history-empty {
  color: #777168;
}

.plaza-excel-details[hidden] {
  display: none !important;
}

.plaza-excel-details > td {
  padding: 8px;
  background: #faf7f1;
}

.plaza-excel-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.plaza-excel-table th,
.plaza-excel-table td {
  border-bottom: 1px solid #e7e0d5;
  text-align: left;
  padding: 6px;
}

.plaza-excel-table th {
  background: #f0ebe3;
  color: #655f56;
}

.pending-manage-buttons {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.pending-manage-buttons button {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.pending-manage-buttons button.is-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.pending-manage-buttons button.is-print {
  border-color: #f5c77a;
  color: #9a5b00;
}

.pending-manage-buttons button.is-complete { color: #17653e; border-color: #8ac6a6; background: #effaf3; }
.pending-complete-dialog { width: min(480px, calc(100vw - 28px)); box-sizing: border-box; border: 1px solid #ccd5d0; border-radius: 12px; padding: 22px; color: #25332c; }
.pending-complete-dialog::backdrop { background: #0006; }
.pending-complete-dialog form { display: grid; gap: 14px; }
.pending-complete-dialog h2, .pending-complete-dialog p { margin: 0; }
.pending-complete-dialog p { font-size: 13px; line-height: 1.6; }
.pending-complete-dialog label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.pending-complete-dialog textarea { width: 100%; box-sizing: border-box; padding: 10px; font: inherit; border: 1px solid #b7c7bf; border-radius: 6px; resize: vertical; }
.pending-complete-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pending-complete-actions button { padding: 9px 16px; cursor: pointer; }
.pending-complete-actions button[type="submit"] { background: #17653e; color: white; border: 1px solid #17653e; border-radius: 6px; }
.pending-complete-status { color: #a33232; font-size: 13px; }
.pending-completion-history { display: block; color: #17653e; white-space: normal; overflow-wrap: anywhere; margin-top: 4px; }
.pending-complete-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #ffffff60; border-top-color: white; border-radius: 50%; animation: pending-complete-spin .8s linear infinite; vertical-align: middle; margin-right: 5px; }
@keyframes pending-complete-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pending-complete-spinner { animation: none; } }

@media (max-width: 1100px) {
  .pending-summary-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .pending-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .pending-search-field {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .pending-heading-row,
  .pending-db-status {
    align-items: stretch;
    flex-direction: column;
  }

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

  .pending-search-field,
  .pending-search-field input {
    width: 100%;
  }
}
