:root {
  --nav: #1f3345;
  --nav-2: #2b4b66;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9dee5;
  --soft: #eef3f7;
  --text: #1f2933;
  --muted: #657483;
  --blue: #2563a9;
  --teal: #2a9d8f;
  --green: #24875d;
  --orange: #c7771d;
  --red: #b83a3a;
  --purple: #6750a4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button,
.button {
  min-height: 34px;
  border: 1px solid #aab4be;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

button.teal {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b8c1ca;
  border-radius: 4px;
  background: #fff;
  padding: 8px 9px;
}

input[type="file"] {
  padding: 9px 10px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  background: var(--nav);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 22px;
  color: #fff;
  text-decoration: none;
  font-size: 23px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 2px;
  flex: 0 0 auto;
}

.main-nav {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 58px;
  overflow-x: auto;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 58px;
  padding: 0 13px;
  border-left: 1px solid rgba(255, 255, 255, .09);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.main-nav a.active {
  background: var(--nav-2);
}

.main-nav a b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
}

.nav-loading {
  padding: 0 18px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  white-space: nowrap;
}

.session-context {
  display: grid;
  flex: 0 0 auto;
  min-width: 180px;
  padding: 7px 18px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.session-context b {
  font-size: 13px;
}

.session-context span {
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
}

.session-context button {
  margin-top: 4px;
  padding: 3px 8px;
  border-color: rgba(255, 255, 255, .28);
  background: transparent;
  color: #fff;
  font-size: 11px;
  justify-self: end;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 420px);
  justify-content: center;
  gap: 16px;
  padding-top: 7vh;
}

.login-panel,
.login-help {
  align-self: start;
}

.login-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 900;
}

.login-panel .full-button {
  margin-top: 12px;
}

.app-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 22px 36px;
}

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

.page-head h1 {
  margin: 0;
  font-size: 24px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 5px;
}

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

.grid > * {
  min-width: 0;
}

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

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

.clinic-order-status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.main-grid {
  grid-template-columns: minmax(0, 2fr) minmax(340px, .95fr);
}

.order-layout {
  grid-template-columns: minmax(0, 1fr);
}

.order-calc-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
}

.order-final-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  align-items: stretch;
}

.order-summary-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(240px, .8fr) minmax(220px, .65fr);
}

.product-layout {
  grid-template-columns: 240px minmax(0, 1fr) 280px;
}

.admin-layout {
  grid-template-columns: 210px minmax(0, 1fr);
}

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

.card {
  padding: 14px;
}

.action-card {
  color: inherit;
  text-decoration: none;
}

.action-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(31, 51, 69, 0.08);
}

.panel-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  font-weight: 900;
}

.panel-body {
  padding: 13px;
}

.quick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  color: var(--text);
  text-decoration: none;
}

.quick-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 19px;
}

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

.status-card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-card .num {
  margin-top: 7px;
  font-size: 29px;
  font-weight: 900;
}

button.status-card {
  width: 100%;
  border-color: var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

button.status-card.active,
button.status-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(31, 51, 69, 0.08);
}

.num.wait { color: var(--blue); }
.num.need { color: var(--orange); }
.num.work { color: var(--purple); }
.num.done { color: var(--green); }
.num.cart { color: var(--red); }

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

th,
td {
  border-bottom: 1px solid #e7ebef;
  padding: 9px 8px;
  text-align: center;
  white-space: nowrap;
}

th {
  background: #f2f5f7;
  color: #3d4a57;
  font-size: 13px;
}

td.name,
th.name {
  text-align: left;
}

.badge {
  display: inline-block;
  min-width: 62px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.badge.wait { background: #e8f1fb; color: var(--blue); }
.badge.need { background: #fff0dc; color: var(--orange); }
.badge.work { background: #eee9fb; color: var(--purple); }
.badge.done { background: #e5f5ee; color: var(--green); }
.badge.ok { background: #e5f5ee; color: var(--green); }

.order-history-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.order-history-guide span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  padding: 6px 9px;
}

.order-history-guide b {
  display: inline;
  color: var(--text);
  margin-bottom: 0;
}

.order-history-filter {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.order-history-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 900px;
}

.order-history-filter-row input,
.order-history-filter-row select {
  min-width: 0;
}

.order-history-filter-row select {
  flex: 0 0 120px;
  width: 120px;
}

.order-history-filter-row input[type="date"] {
  flex: 0 0 145px;
  width: 145px;
}

.order-history-filter-row input[data-order-history-query] {
  flex: 0 1 340px;
  width: 340px;
}

.order-history-filter-row .button-row {
  flex: 0 0 auto;
}

.row-actions {
  display: inline-flex;
  gap: 5px;
  white-space: nowrap;
}

.row-actions button {
  min-height: 30px;
  padding: 5px 8px;
}

.order-history-table table {
  font-size: 13px;
}

.order-history-table th,
.order-history-table td {
  padding: 7px 8px;
}

.order-history-table td.name {
  min-width: 190px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-history-table .row-actions {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.order-history-table .row-actions button {
  min-height: 28px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.order-history-table .row-actions button:first-child {
  background: var(--blue);
  color: #fff;
}

.order-history-table .row-actions button:last-child {
  border-right: 0;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f3;
}

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

.list-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 108px 1fr 108px 1fr;
  gap: 8px 10px;
  align-items: center;
}

.form-grid.compact {
  grid-template-columns: 88px 1fr 88px 1fr;
}

.label {
  color: #344250;
  font-weight: 900;
}

.button-row,
.filter-row,
.inline-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.signup-filterbar select {
  min-width: 132px;
}

.signup-filterbar input {
  flex: 1 1 260px;
  min-width: 220px;
}

.inline-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.inline-options input {
  width: auto;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  white-space: nowrap;
}

.checkbox-option input[type="checkbox"],
.checkbox-option input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.prescription-order-types {
  align-items: center;
  gap: 16px;
}

.source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 11px;
}

.source-tabs button {
  min-height: 30px;
  padding: 6px 10px;
  border-color: #c6d1dc;
  background: #f7fafc;
  font-size: 13px;
}

.source-tabs button.active {
  border-color: var(--teal);
  background: #e6f7f4;
  color: #12675f;
}

.member-workflow-panel {
  margin: 12px 0;
}

.member-workflow-tabs button {
  display: grid;
  gap: 2px;
  min-width: 180px;
  text-align: left;
}

.member-workflow-tabs small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-workflow-tabs button.active small {
  color: #128070;
}

.compact-member-note {
  margin-top: 12px;
}

.apply-summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fbff;
}

.apply-summary-line b {
  margin-right: 4px;
  color: var(--text);
  font-size: 13px;
}

.apply-summary-line span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563a8;
  font-size: 12px;
  font-weight: 900;
}

.apply-summary-line.compact {
  margin-top: 6px;
  padding: 7px 8px;
}

.signup-approval-inline {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.signup-approval-inline .panel-head {
  padding-left: 0;
  padding-right: 0;
}

.signup-approval-inline .panel-body {
  padding-left: 0;
  padding-right: 0;
}

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

.signup-approval-grid label {
  padding: 8px;
}

.signup-approval-grid textarea {
  min-height: 54px;
}

.auto-apply-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563a8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.order-herb-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  background: #fff;
}

.order-herb-table {
  min-width: 720px;
}

.order-herb-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafc;
}

.order-herb-table th,
.order-herb-table td {
  padding: 8px 9px;
}

.order-herb-table tbody tr:hover {
  background: #fbfdff;
}

.order-herb-table td.name {
  width: 28%;
  font-weight: 900;
  white-space: normal;
}

.order-herb-dose-input {
  width: 76px;
  min-height: 32px;
  padding: 5px 8px;
  text-align: right;
}

.order-herb-table td:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 132px;
}

.order-herb-table [data-order-herb-delete] {
  min-height: 28px;
  padding: 4px 8px;
  border-color: #cbd5df;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.order-herb-table [data-order-herb-delete]:hover {
  border-color: var(--red);
  color: var(--red);
}

.address-preview {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px dashed #c6d1dc;
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted);
  padding: 7px 9px;
}

.helper-note {
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  border: 1px solid #cfe1d9;
  border-radius: 5px;
  background: #f2fbf7;
  color: #344250;
  padding: 7px 10px;
  line-height: 1.45;
}

.helper-note b {
  color: #12675f;
}

.helper-note span {
  width: 1px;
  height: 16px;
  background: #bdd8ce;
}

.helper-note.stacked {
  display: grid;
  align-items: center;
  gap: 3px;
}

.helper-note.stacked p {
  margin: 0;
}

.compact-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #edf0f3;
}

.full-button {
  display: flex;
  justify-content: center;
  width: 100%;
}

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

.category-list button {
  justify-content: flex-start;
  text-align: left;
}

.readonly-value {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 900;
}

.readonly-value small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

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

.product-photo,
.product-detail-photo {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 170px;
  padding: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 68%, rgba(255, 255, 255, .9) 0 7px, transparent 8px),
    radial-gradient(circle at 38% 62%, rgba(255, 255, 255, .82) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 72%, rgba(255, 255, 255, .78) 0 7px, transparent 8px),
    linear-gradient(135deg, #5d6268, #24282d);
}

.product-photo::before,
.product-detail-photo::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 26px;
  width: 96px;
  height: 76px;
  border-radius: 4px;
  background: linear-gradient(135deg, #191512, #6b261d 58%, #f2d26c);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.product-photo::after,
.product-detail-photo::after {
  content: "";
  position: absolute;
  right: 50px;
  bottom: 18px;
  width: 30px;
  height: 84px;
  border-radius: 2px;
  background: linear-gradient(#fff, #f3efe5);
  box-shadow: -18px 8px 0 -3px #f7f3ea, 18px 8px 0 -3px #f7f3ea;
}

.product-photo span,
.product-detail-photo span {
  position: absolute;
  right: 14px;
  top: 10px;
  z-index: 1;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .26);
}

.product-photo b,
.product-detail-photo b {
  position: relative;
  z-index: 1;
  font-size: 18px;
}

.product-photo.spo,
.product-detail-photo.spo {
  background:
    radial-gradient(circle at 34% 68%, rgba(255, 255, 255, .86) 0 7px, transparent 8px),
    radial-gradient(circle at 44% 73%, rgba(255, 255, 255, .78) 0 7px, transparent 8px),
    linear-gradient(135deg, #7b8079, #3f4b43);
}

.product-photo.p,
.product-detail-photo.p {
  background:
    radial-gradient(circle at 26% 72%, rgba(255, 255, 255, .84) 0 7px, transparent 8px),
    radial-gradient(circle at 36% 68%, rgba(255, 255, 255, .72) 0 7px, transparent 8px),
    linear-gradient(135deg, #65605b, #30343a);
}

.product-photo.wrap,
.product-detail-photo.wrap {
  background: linear-gradient(135deg, #758a90, #314855);
}

.product-card-body {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.product-card dl,
.product-detail-info dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.product-card dl div,
.product-detail-info dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-card dt,
.product-detail-info dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-card dd,
.product-detail-info dd {
  margin: 0;
  text-align: right;
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr);
  gap: 18px;
}

.product-detail-photo {
  min-height: 320px;
  border-radius: 8px;
}

.detail-thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  width: 48px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f6f8;
}

.thumb.active {
  border-color: var(--teal);
}

.product-detail-info,
.option-list {
  display: grid;
  gap: 12px;
}

.purchase-box {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: #f8fbfe;
}

.purchase-box .field input {
  max-width: 120px;
}

.option-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.option-list label span {
  flex: 1;
}

.option-list label:has(input:checked) {
  border-color: var(--teal);
  background: #f1fbf8;
}

.detail-tabs-lite {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-tabs-lite span {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
  border-right: 1px solid var(--line);
}

.detail-tabs-lite span:last-child {
  border-right: 0;
}

.detail-tabs-lite .active {
  color: var(--text);
  background: #fff;
  font-weight: 900;
}

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

.stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.order-summary-grid .option-grid {
  align-items: stretch;
}

.order-summary-grid .option-grid .field {
  display: grid;
  align-content: start;
  min-height: 78px;
  padding: 10px 11px;
  border: 1px solid #e2e8ee;
  border-radius: 9px;
  background: #fbfdff;
}

.order-summary-grid .option-grid .field span {
  margin-bottom: 7px;
  color: #344250;
}

.order-summary-grid .option-grid .field input,
.order-summary-grid .option-grid .field select {
  min-height: 38px;
  background: #fff;
}

.order-summary-grid .option-grid .field small {
  line-height: 1.35;
}

.order-summary-grid .option-grid .inline-options {
  min-height: 38px;
  align-content: center;
  gap: 9px 12px;
}

.order-summary-grid .option-grid .address-preview {
  min-height: 38px;
  border-style: solid;
  background: #fff;
  color: #344250;
  line-height: 1.45;
}

.order-summary-grid .option-grid .field[hidden] {
  display: none !important;
}

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

.calc-line,
.calc-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.calc-line {
  padding-bottom: 7px;
  border-bottom: 1px dashed #d5dce3;
}

.calc-total {
  align-items: center;
  border: 1px solid #d8e8f8;
  border-radius: 6px;
  background: #f7fbff;
  padding: 12px;
  font-size: 18px;
  font-weight: 900;
}

.order-total-panel .panel-head,
.order-submit-panel .panel-head {
  background: #f7fafc;
}

.order-total-body {
  gap: 9px;
}

.order-total-body .calc-line {
  align-items: center;
  padding: 8px 0;
}

.order-total-body .calc-line span {
  color: var(--muted);
  font-weight: 800;
}

.order-total-body .calc-line b {
  font-variant-numeric: tabular-nums;
}

.order-grand-total {
  margin-top: 2px;
  border-color: #b9dfcf;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef8f4, #f8fffc);
  color: #173f2f;
}

.order-grand-total span:last-child {
  color: var(--green);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.order-submit-body {
  display: grid;
  gap: 11px;
}

.order-final-grid .order-submit-body {
  align-content: start;
}

.order-submit-note {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #d7e7f4;
  border-radius: 9px;
  background: #f7fbff;
  color: #344250;
}

.order-submit-check {
  border-radius: 9px;
  padding: 10px 11px;
  font-weight: 900;
  line-height: 1.45;
}

.order-submit-check.ok {
  border: 1px solid #c7e5d5;
  background: #f2fbf7;
  color: #12675f;
}

.order-submit-check.need {
  border: 1px solid #f4cf91;
  background: #fff8ec;
  color: #7a4f00;
}

.order-submit-check.blocked {
  border: 1px solid #f0a8a8;
  background: #fff1f1;
  color: #8c2e2e;
}

.order-submit-panel .full-button {
  min-height: 48px;
  border-radius: 9px;
  font-size: 16px;
  box-shadow: 0 5px 12px rgba(37, 99, 169, .16);
}

.admin-menu {
  min-width: 0;
  min-height: 740px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #eef2f5;
}

.admin-menu a {
  display: block;
  margin-bottom: 4px;
  border-radius: 5px;
  padding: 9px 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.admin-menu a.active {
  background: var(--nav-2);
  color: #fff;
}

.admin-content {
  min-width: 0;
  padding: 14px;
}

.admin-filter-panel {
  overflow: visible;
}

.admin-filterbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(120px, .5fr) minmax(120px, .5fr) minmax(130px, .5fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.admin-filterbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-filterbar label span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-filterbar input,
.admin-filterbar select {
  min-width: 0;
  height: 34px;
}

.admin-filterbar em {
  color: var(--muted);
  font-style: normal;
}

.filter-search {
  min-width: 0;
}

.filter-search select {
  flex: 0 0 92px;
}

.filter-search input {
  flex: 1 1 auto;
}

.filter-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .admin-filterbar {
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(110px, .55fr));
  }

  .admin-filterbar .filter-search {
    grid-column: span 3;
  }

  .admin-filterbar .filter-actions {
    grid-column: span 1;
  }
}

.admin-product-editor {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  margin-top: 12px;
}

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

.group-checks label {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.large-textarea {
  min-height: 170px;
  resize: vertical;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.policy-grid label {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.policy-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.policy-grid label small {
  color: var(--muted);
  font-size: 12px;
}

.policy-grid input {
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 48px;
  font-size: 16px;
  font-weight: 800;
  white-space: normal;
  text-overflow: clip;
}

.policy-grid select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  font-size: 16px;
  font-weight: 800;
}

.wide-policy {
  grid-column: 1 / -1;
}

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

.summary-grid .card {
  display: grid;
  gap: 7px;
}

.summary-grid .card span {
  color: var(--muted);
  font-size: 13px;
}

.summary-grid .card strong {
  color: var(--blue);
}

.price-policy-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  align-items: start;
  margin-top: 12px;
}

.admin-inquiry-grid,
.admin-notice-grid {
  grid-template-columns: minmax(560px, 1.15fr) minmax(380px, .85fr);
  align-items: start;
  margin-top: 12px;
}

.admin-inquiry-grid > .panel,
.admin-notice-grid > .panel {
  min-width: 0;
}

.admin-inquiry-grid table,
.admin-notice-grid table {
  min-width: 680px;
}

.admin-material-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  align-items: start;
  margin-top: 12px;
}

.notice-editor-form {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
}

.notice-editor-form .wide,
.notice-editor-form textarea {
  grid-column: auto;
}

.notice-editor-form .pill-row {
  min-width: 0;
}

.material-editor-form {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
}

.material-editor-form .wide,
.material-editor-form textarea {
  grid-column: auto;
}

.material-editor-form .helper-note {
  white-space: normal;
  line-height: 1.55;
}

.wide-policy-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.wide-panel {
  grid-column: 1 / -1;
}

.admin-note {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
}

.admin-note + .admin-note {
  margin-top: 8px;
}

.admin-note summary {
  cursor: pointer;
  font-weight: 900;
}

.admin-note p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.stacked-control {
  display: grid;
  gap: 8px;
}

.stacked-control small {
  color: var(--muted);
  line-height: 1.45;
}

.admin-note .calc {
  margin-top: 10px;
}

.herb-price-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

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

.flow-card {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.flow-card b {
  color: var(--text);
}

.flow-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.flow-card small {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.guide-layout {
  display: grid;
  gap: 14px;
}

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

.guide-card {
  display: grid;
  gap: 9px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.guide-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(32, 72, 112, 0.08);
}

.guide-card b {
  font-size: 16px;
}

.guide-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.guide-card em {
  align-self: end;
  color: var(--brand);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.guide-hero-panel .panel-body {
  display: grid;
  gap: 12px;
}

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

.guide-summary-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.guide-summary-item b {
  color: var(--brand);
  font-size: 14px;
}

.guide-summary-item span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.guide-quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-compact-links .guide-card {
  min-height: 104px;
}

.guide-short-note {
  margin: 0 14px 10px;
}

.guide-details {
  padding: 14px;
}

.guide-details summary {
  display: grid;
  gap: 3px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.guide-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-details summary::marker {
  color: var(--brand);
}

.guide-compact-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

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

.signup-guide-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.guide-step i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.guide-step b,
.guide-step span {
  display: block;
}

.guide-step span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.signup-consent-panel {
  margin-bottom: 12px;
}

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

.consent-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.consent-check input,
.consent-all input {
  width: auto;
}

.consent-box textarea {
  min-height: 178px;
  color: #374151;
  background: #fff;
  line-height: 1.55;
}

.consent-all {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand);
  font-weight: 900;
}

.signup-guide-compact {
  display: grid;
  gap: 14px;
}

.signup-guide-hero .panel-body {
  display: grid;
  gap: 12px;
}

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

.signup-summary-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.signup-summary-card i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.signup-summary-card b,
.signup-summary-card span {
  display: block;
}

.signup-summary-card b {
  color: var(--brand);
  font-size: 14px;
}

.signup-summary-card span {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.signup-primary-actions {
  margin-top: 0;
}

.signup-accordion-list {
  display: grid;
  gap: 10px;
}

.signup-guide-section {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.signup-guide-section[open] {
  border-color: #bfdbfe;
  background: #fbfdff;
}

.signup-guide-section summary {
  display: grid;
  gap: 3px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.signup-guide-section summary::marker {
  color: var(--brand);
}

.signup-guide-section summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signup-guide-step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.compact-help .guide-compact-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-guide-layout {
  display: grid;
  gap: 14px;
}

.signup-detail-steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.visual-guide-list {
  display: grid;
  gap: 16px;
}

.visual-guide-step {
  display: grid;
  grid-template-columns: 48px minmax(220px, .82fr) minmax(320px, 1.18fr);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.visual-guide-marker {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #6ea84f;
  color: #fff;
  font-weight: 900;
}

.visual-guide-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.visual-guide-copy h2 {
  margin: 0;
  font-size: 20px;
}

.visual-guide-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.visual-guide-shot {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 18px;
  border: 1px dashed #b8c7d7;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 91, 142, .06), rgba(110, 168, 79, .08)),
    #f8fafc;
  text-align: center;
}

.visual-guide-shot b,
.visual-guide-shot span {
  display: block;
}

.visual-guide-shot b {
  color: var(--brand);
}

.visual-guide-shot span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.visual-guide-panel .panel-head {
  background: linear-gradient(90deg, #f6fbf8, #fbfcfd);
}

.compact-visual-guide {
  padding: 12px;
}

.compact-visual-guide .visual-guide-list {
  gap: 10px;
}

.compact-visual-guide .visual-guide-step {
  grid-template-columns: 44px minmax(210px, .9fr) minmax(260px, 1.1fr);
  gap: 10px;
  padding: 11px;
  box-shadow: none;
}

.compact-visual-guide .visual-guide-marker {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.compact-visual-guide .visual-guide-copy h2 {
  font-size: 16px;
}

.compact-visual-guide .visual-guide-copy p {
  font-size: 13px;
  line-height: 1.45;
}

.compact-visual-guide .visual-guide-shot {
  min-height: 86px;
  padding: 12px;
  border-style: solid;
}

.compact-policy-grid {
  margin-top: 10px;
}

.policy-section-label {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.policy-section-label:first-child {
  margin-top: 0;
}

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

.dashboard-links .button {
  text-align: center;
}

.type-card-grid,
.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.type-card,
.document-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.type-card {
  cursor: pointer;
}

.type-card.active {
  border-color: var(--blue);
  background: #eef7ff;
}

.type-card input {
  width: auto;
}

.type-card span,
.document-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.document-item button {
  justify-self: start;
}

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

.compact-document-grid .document-item {
  padding: 10px;
}

.signup-document-item {
  cursor: pointer;
}

.signup-document-item input[type="file"] {
  width: 100%;
  margin-top: 4px;
}

.report-note-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.report-note-row span {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--muted);
  line-height: 1.45;
}

.report-note-row b {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.report-table-wrap {
  border-radius: 0 0 8px 8px;
}

.report-output-table {
  min-width: 720px;
  table-layout: fixed;
}

.report-output-table th:nth-child(1),
.report-output-table td:nth-child(1) {
  width: 56px;
}

.report-output-table th:nth-child(2),
.report-output-table td:nth-child(2) {
  width: 190px;
}

.report-output-table th:nth-child(3),
.report-output-table td:nth-child(3) {
  width: 110px;
}

.report-output-table th:nth-child(4),
.report-output-table td:nth-child(4) {
  width: auto;
  white-space: normal;
  line-height: 1.45;
}

.report-output-table th:nth-child(5),
.report-output-table td:nth-child(5) {
  width: 90px;
}

.report-queue-panel .panel-head .badge {
  margin-left: 6px;
}

.report-stats-grid {
  grid-template-columns: 1fr;
}

.report-stats-head {
  align-items: flex-start;
  gap: 10px;
}

.report-stats-filter {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(140px, 1fr) auto;
  width: min(100%, 560px);
}

.report-stats-filter input,
.report-stats-filter select {
  width: 100%;
}

.report-stats-grid table button {
  min-width: 96px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

.print-document {
  display: grid;
  gap: 18px;
}

.print-document .print-page {
  break-inside: avoid;
}

.print-document .work-sheet-grid {
  margin-bottom: 12px;
}

.policy-grid textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  font-weight: 900;
}

.pill.active {
  border-color: #a8c9e8;
  background: #e7f1fb;
  color: var(--blue);
}

.selected-row {
  background: #fff8dc;
  outline: 2px solid #d5b85a;
  outline-offset: -2px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f4f8fc;
}

.clickable-row.selected-row:hover {
  background: #fff8dc;
}

.detail-tabs {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 10px 10px 0;
  background: #fbfcfd;
}

.detail-tabs button {
  border-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.detail-tabs button.active {
  border-color: var(--nav-2);
  background: var(--nav-2);
  color: #fff;
}

.detail-tab-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 13px 0;
  background: #fbfcfd;
}

.detail-tab-guide span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.detail-tab-guide b {
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 12px;
  padding: 13px;
}

.admin-order-detail {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-order-detail-panel {
  scroll-margin-top: 72px;
}

.admin-order-detail.tabbed {
  grid-template-columns: 1fr;
}

.admin-order-detail .card {
  grid-column: span 2;
}

.admin-order-detail.tabbed .card {
  grid-column: 1 / -1;
}

.admin-order-detail .detail-pane[hidden] {
  display: none;
}

.detail-card-focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(43, 111, 184, .14);
}

.inline-field {
  margin-top: 10px;
}

.input-action {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-action select {
  min-width: 118px;
}

.input-action input {
  min-width: 0;
  flex: 1;
}

.input-action button {
  white-space: nowrap;
}

.tracking-action {
  display: grid;
  grid-template-columns: minmax(112px, .75fr) minmax(190px, 1.25fr) auto auto;
}

.timeline {
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.timeline b {
  color: var(--text);
}

.work-preview-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 12px;
}

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

.work-preview-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.preview-type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.preview-type-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.work-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-type-tabs button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.work-type-tabs .active {
  border-color: var(--nav-2);
  background: var(--nav-2);
  color: #fff;
}

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

.output-rule-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.output-rule-box summary {
  cursor: pointer;
  padding: 11px 13px;
  font-weight: 900;
}

.output-rule-box .work-type-grid {
  margin: 0;
  padding: 0 12px 12px;
}

.output-rule-box .sub {
  padding: 0 13px 13px;
}

.work-type-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.work-type-card h3 {
  margin-top: 0;
}

.work-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
  padding: 13px;
}

.work-preview h3 {
  margin-top: 0;
}

.work-preview table {
  margin-top: 12px;
  background: #fff;
}

.print-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.print-title h3 {
  margin: 0;
  font-size: 20px;
}

.print-title span {
  color: var(--muted);
  font-weight: 900;
}

.work-order-sheet,
.delivery-sheet {
  background: #fff;
}

.work-sheet-grid {
  display: grid;
  grid-template-columns: 84px 1fr 72px 1fr;
  border: 1px solid #9ca3af;
  border-bottom: 0;
}

.work-sheet-grid b,
.work-sheet-grid span {
  min-height: 34px;
  border-bottom: 1px solid #9ca3af;
  padding: 7px 8px;
}

.work-sheet-grid b {
  background: #f1f3f5;
  text-align: center;
}

.work-note {
  display: grid;
  grid-template-columns: 84px 1fr;
  border: 1px solid #9ca3af;
  border-top: 0;
}

.work-note b,
.work-note span {
  min-height: 42px;
  padding: 8px;
}

.work-note b {
  background: #f1f3f5;
  text-align: center;
}

.work-table th,
.work-table td {
  border: 1px solid #9ca3af;
  padding: 8px;
}

.work-table th:first-child,
.work-table td:first-child {
  width: 48px;
  text-align: center;
}

.check-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  font-weight: 900;
}

.check-strip span {
  border: 1px solid #9ca3af;
  padding: 9px;
  text-align: center;
}

.cart-layout {
  display: grid;
  gap: 12px;
}

.cart-bottom-grid {
  grid-template-columns: minmax(240px, .75fr) minmax(360px, 1.25fr) minmax(260px, .8fr);
}

.cart-table th,
.cart-table td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.cart-table .empty-cell {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.kv {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 6px 8px;
  line-height: 1.5;
}

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

.snapshot-detail-panel {
  margin-top: 10px;
}

.snapshot-detail-panel .panel-head {
  min-height: 38px;
  padding: 8px 13px;
}

.snapshot-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
  padding: 10px 12px 12px;
}

.snapshot-detail-grid .card {
  padding: 10px 12px;
  border-radius: 7px;
  box-shadow: none;
}

.snapshot-detail-grid h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.snapshot-detail-grid .kv {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 4px 8px;
  font-size: 13px;
  line-height: 1.38;
}

.snapshot-detail-grid .kv b {
  word-break: keep-all;
}

.snapshot-detail-panel .helper-note {
  margin: 0 12px 12px;
  padding: 8px 10px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px 13px;
}

.card-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.card-action-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.danger-row {
  align-items: center;
}

.inline-output-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.inline-output-control b {
  color: var(--muted);
  font-size: 13px;
}

.compact-output-control {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.output-preview-collapse {
  margin-top: 4px;
}

.output-preview-collapse > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 900;
}

.output-preview-collapse > summary::-webkit-details-marker {
  display: none;
}

.output-preview-collapse > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 7px;
  color: var(--brand);
}

.output-preview-collapse[open] > summary::before {
  content: "▾";
}

.output-preview-inner {
  padding-top: 12px;
}

.grouped-action-bar {
  align-items: stretch;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px;
}

.action-group b {
  color: var(--muted);
  font-size: 12px;
  min-width: 28px;
}

.action-output {
  background: #f8fafc;
}

.action-danger {
  margin-left: auto;
}

.action-danger small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  max-width: 145px;
  line-height: 1.35;
}

.order-overview-panel {
  margin-bottom: 0;
}

.order-type-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.order-type-tabs a {
  display: grid;
  gap: 4px;
  min-height: 64px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.order-type-tabs a:hover {
  border-color: #a8c9e8;
  box-shadow: 0 8px 18px rgba(32, 72, 112, 0.08);
}

.order-type-tabs a.active {
  border-color: #8fc5e8;
  background: #eaf5ff;
  color: var(--blue);
}

.order-type-tabs b {
  font-size: 15px;
}

.order-type-tabs span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.order-overview-card {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.order-overview-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.order-overview-card b {
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

.order-overview-card.wide {
  grid-column: span 2;
}

.order-overview-card.total {
  background: #eef8f4;
  border-color: #c3e6d7;
}

.order-overview-card.need {
  background: #fff8ec;
  border-color: #f4cf91;
}

.order-overview-card.blocked {
  background: #fff1f1;
  border-color: #f0a8a8;
}

.order-final-grid .order-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-final-grid .order-overview-card {
  min-height: 58px;
  padding: 9px 10px;
}

.order-final-grid .order-overview-card.wide {
  grid-column: span 2;
}

.order-final-grid .order-overview-card.total b {
  color: var(--green);
  font-size: 16px;
}

.order-alert-row {
  margin-top: 10px;
  border-radius: 9px;
  background: #fff8ec;
  color: #7a4f00;
  padding: 10px 12px;
  font-weight: 800;
}

.split-action {
  display: inline-flex;
  gap: 0;
}

.split-action select {
  min-width: 168px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.split-action button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.empty-page {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 7px;
  background: #1f3345;
  color: #fff;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
  font-weight: 800;
}

.app-update-notice {
  position: fixed;
  left: auto;
  right: 18px;
  top: 74px;
  bottom: auto;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(460px, calc(100vw - 36px));
  margin: 0;
  border: 1px solid #bfd8f3;
  border-radius: 12px;
  background: #f0f7ff;
  color: var(--text);
  padding: 13px 14px;
  box-shadow: 0 10px 34px rgba(31, 51, 69, .22);
}

.app-update-notice div {
  display: grid;
  gap: 2px;
}

.app-update-notice b {
  font-size: 14px;
}

.app-update-notice span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-update-notice button {
  white-space: nowrap;
}

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 38, .42);
}

.demo-modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

.demo-modal-panel .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.modal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.modal-head-actions + [data-close-demo] {
  margin-left: 6px;
}

.demo-modal-panel:has(.snapshot-detail-panel) .modal-action-row {
  display: none;
}

.demo-modal-panel:has(.snapshot-detail-panel) {
  width: min(920px, 100%);
}

.demo-modal-panel:has(.snapshot-detail-panel) .panel-body {
  padding: 10px 12px 12px;
}

.demo-modal-panel:has(.snapshot-detail-panel) .detail-section-grid {
  gap: 8px;
  margin-top: 8px;
}

.demo-modal-panel:has(.snapshot-detail-panel) .panel-body > .detail-section-grid:first-child {
  margin-top: 0;
}

.demo-modal-panel:has(.snapshot-detail-panel) .detail-section-grid .card {
  padding: 10px 12px;
  box-shadow: none;
}

.demo-modal-panel:has(.snapshot-detail-panel) h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.popup-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 24, 34, .48);
}

.popup-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 6px solid var(--popup-accent, var(--blue));
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .28);
}

.popup-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-height: 28px;
  width: 28px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  font-size: 18px;
}

.popup-image img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.popup-visual {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 34px 28px;
  align-content: center;
  background: linear-gradient(135deg, #e8f3ff, #b7d8ff);
}

.popup-visual span {
  color: var(--popup-accent, var(--blue));
  font-weight: 900;
}

.popup-visual b {
  color: #111827;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.05;
  letter-spacing: -1.5px;
}

.popup-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.popup-body h2 {
  margin: 0;
  font-size: 20px;
}

.popup-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.popup-subtitle {
  color: var(--popup-accent, var(--blue)) !important;
  font-weight: 900;
}

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

@media print {
  body > .app-shell {
    display: none !important;
  }

  .demo-modal {
    position: static;
    display: block;
    padding: 0;
  }

  .demo-modal-backdrop,
  .demo-modal-panel .panel-head button,
  .demo-modal-panel .modal-action-row {
    display: none !important;
  }

  .demo-modal-panel {
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .print-document {
    display: block;
  }

  .print-document .print-page {
    break-after: page;
    margin: 0;
  }

  .print-document .print-page:last-child {
    break-after: auto;
  }
}

.demo-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.demo-list button {
  justify-content: flex-start;
  text-align: left;
}

.prescription-herb-searchbar {
  grid-template-columns: minmax(150px, .45fr) minmax(280px, 1fr) auto;
}

.prescription-herb-search-results {
  max-height: 430px;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.prescription-herb-search-results table {
  margin: 0;
}

[data-prescription-editor] input[readonly] {
  background: #f5f7f9;
  color: var(--text);
}

.preview-box {
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  background: #f8fafc;
  padding: 14px;
  line-height: 1.7;
}

.order-detail-note {
  margin-top: 12px;
}

.modal-action-row {
  justify-content: flex-end;
  margin-top: 12px;
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

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

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

  .order-overview-card.wide {
    grid-column: span 2;
  }

  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .brand,
  .main-nav a {
    min-height: 48px;
  }

  .session-context {
    width: 100%;
    min-width: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    border-left: 0;
    text-align: left;
  }

  .session-context button {
    justify-self: start;
  }

  .login-layout {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .app-main {
    padding: 14px;
  }

  .admin-menu {
    display: flex;
    min-height: 0;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-menu a {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .admin-content {
    padding: 10px 0 0;
  }

  .quick-grid,
  .status-grid,
  .main-grid,
  .order-layout,
  .order-calc-grid,
  .order-final-grid,
  .order-summary-grid,
  .product-layout,
  .product-card-grid,
  .product-detail-layout,
  .detail-section-grid,
  .admin-layout,
  .admin-product-editor,
  .summary-grid,
  .herb-price-flow,
  .price-policy-grid,
  .admin-inquiry-grid,
  .admin-notice-grid,
  .admin-material-grid,
  .wide-policy-grid,
  .type-card-grid,
  .document-grid,
  .guide-summary-grid,
  .guide-card-grid,
  .guide-scope-grid,
  .guide-steps,
  .signup-guide-summary-grid,
  .signup-guide-step-list,
  .consent-grid,
  .visual-guide-step,
  .detail-grid,
  .admin-order-detail,
  .work-preview-grid,
  .work-type-grid,
  .admin-filterbar,
  .order-history-filter-row,
  .report-note-row,
  .cart-bottom-grid {
    grid-template-columns: 1fr;
  }

  .compact-visual-guide .visual-guide-step {
    grid-template-columns: 1fr;
  }

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

  .form-grid textarea,
  .form-grid .wide {
    grid-column: span 1 !important;
  }

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

  .order-summary-grid .option-grid .field {
    grid-column: auto !important;
    min-height: 0;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .visual-guide-step {
    grid-template-columns: 1fr;
  }

  .visual-guide-marker {
    justify-self: start;
  }

  .compact-help .guide-compact-steps {
    grid-template-columns: 1fr;
  }
}
