:root {
  --ink: #263238;
  --muted: #66757f;
  --line: #dfe6e9;
  --page: #f7f8f5;
  --panel: #ffffff;
  --gold: #d89a21;
  --green: #84bd70;
  --blue: #8ccfd6;
  --lilac: #d6acd0;
  --red: #c74b37;
  --shadow: 0 18px 44px rgba(42, 51, 54, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

.demo-app {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(140, 207, 214, 0.35), transparent 24%),
    radial-gradient(circle at 85% 16%, rgba(132, 189, 112, 0.35), transparent 22%),
    radial-gradient(circle at 82% 88%, rgba(214, 172, 208, 0.34), transparent 28%),
    #fbfbf8;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-logo {
  width: min(330px, 100%);
  height: auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
}

h2 {
  font-size: 24px;
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

.login-form button,
.primary-action,
.link-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.login-form .text-button {
  min-height: auto;
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--gold);
  background: transparent;
  font-weight: 700;
}

#loginStatus {
  min-height: 20px;
  color: var(--red);
  font-size: 14px;
}

.demo-accounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.demo-accounts button,
.ghost-button,
.customer-list button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.ghost-button.compact {
  min-height: 34px;
  padding: 0 10px;
}

.portal-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 24px;
  padding: 24px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.sidebar-logo-button {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.sidebar-logo-button:hover {
  opacity: 0.82;
}

.sidebar-logo-button:focus-visible {
  outline: 3px solid rgba(216, 154, 33, 0.35);
  outline-offset: 4px;
}

.sidebar-logo {
  width: 190px;
  height: auto;
  display: block;
}

.sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.sidebar nav button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.sidebar nav button.active {
  color: var(--ink);
  background: #f1eadc;
}

.workspace {
  padding: 28px;
}

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

.user-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.module-toolbar {
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(160px, 1fr));
  margin-bottom: 18px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

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

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

.product-grid.view-medium {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.catalog-viewbar,
.catalog-pager {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.catalog-viewbar label {
  width: min(210px, 100%);
}

.catalog-viewbar .primary-action {
  margin-left: auto;
  align-self: end;
}

.catalog-pager {
  align-items: center;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.catalog-pager div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.catalog-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.catalog-updated {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.product-grid.view-list {
  grid-template-columns: 1fr;
}

.product-grid.view-list .product-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.product-grid.view-list .product-image-button img {
  height: 100%;
  min-height: 210px;
}

.product-grid.view-medium .product-description,
.product-grid.view-compact .product-description {
  display: none;
}

.product-grid.view-medium .price-breakdown .final strong,
.product-grid.view-compact .price-breakdown .final strong {
  font-size: 17px;
}

.product-grid.view-compact {
  gap: 12px;
}

.product-grid.view-compact .product-card {
  border-radius: 6px;
}

.product-grid.view-compact .product-body {
  gap: 8px;
  padding: 10px;
}

.product-grid.view-compact .product-title-button h2 {
  font-size: 16px;
}

.product-grid.view-compact .product-image-button img {
  min-height: 150px;
}

.product-grid.view-compact .price-breakdown {
  gap: 6px;
}

.product-grid.view-compact .card-actions {
  gap: 8px;
}

.product-card,
.panel,
.cart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
}

.product-image-button {
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
}

.product-card img,
.product-image-button img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf3f3;
}

.product-title-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.product-title-button h2 {
  transition: color 0.15s ease;
}

.product-title-button:hover h2,
.product-image-button:hover + .product-body .product-title-button h2 {
  color: var(--gold);
}

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

.product-body small {
  color: var(--muted);
  font-weight: 700;
}

.product-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-product-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #2f7d37;
  background: #edf8e8;
  font-size: 12px;
  font-weight: 700;
}

.admin-product-meta span.inactive {
  color: var(--red);
  background: #fff0f0;
}

.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.stock-line span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stock-line.available {
  color: #2f7d37;
}

.stock-line.available span {
  background: #2f7d37;
}

.stock-line.low {
  color: var(--gold);
}

.stock-line.low span {
  background: var(--gold);
}

.stock-line.unavailable {
  color: var(--red);
}

.stock-line.unavailable span {
  background: var(--red);
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.price-row strong {
  font-size: 22px;
}

.price-breakdown {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.price-breakdown div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.price-breakdown strong {
  color: var(--ink);
  white-space: nowrap;
}

.price-breakdown .old-price-row strong {
  color: var(--muted);
  text-decoration: line-through;
}

.price-breakdown .final {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
}

.price-breakdown .final strong {
  color: var(--green);
  font-size: 20px;
}

.price-breakdown.price-missing strong {
  color: var(--gold);
  font-size: 16px;
  white-space: normal;
}

.card-actions {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
}

.cart-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.qty-stepper,
.cart-line-actions {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.qty-stepper button,
.cart-line-actions button {
  border: 0;
  background: #f1eadc;
  color: var(--ink);
  font-weight: 700;
}

.qty-stepper input {
  min-height: 0;
  height: 36px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
}

.add-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
}

.add-button:disabled {
  cursor: not-allowed;
  background: #b9c6c8;
}

.ghost-button.full {
  width: 100%;
}

.edit-product-button {
  justify-content: center;
}

.cart-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cart-lines {
  display: grid;
  gap: 10px;
}

.cart-section-title {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.inquiry-line {
  background: #fffaf0;
}

.cart-line small,
.cart-empty {
  color: var(--muted);
}

.cart-line-actions {
  grid-template-columns: 30px 42px 30px;
  height: 34px;
}

.cart-line-actions span {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

.cart-total span {
  color: var(--muted);
  font-weight: 700;
}

.cart-total strong {
  font-size: 24px;
}

.primary-action.full {
  width: 100%;
}

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 50, 56, 0.34);
}

.success-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 50, 56, 0.34);
}

.success-dialog {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(38, 50, 56, 0.24);
}

.success-dialog h2 {
  color: #2f7d37;
}

.mail-preview {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #dbe8d5;
  border-radius: 8px;
  background: #f4fbf0;
}

.mail-preview span {
  color: var(--muted);
  line-height: 1.45;
}

.mail-card {
  display: grid;
  gap: 12px;
}

.mail-card h3 {
  margin: 0;
  color: var(--ink);
}

.mail-card h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mail-card p {
  margin: 0;
}

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

.mail-section-inquiry {
  padding-top: 12px;
  border-top: 2px solid #e1a11a;
}

.mail-section-inquiry h4 {
  color: #a96f00;
}

.mail-section-inquiry p {
  color: var(--muted);
  font-size: 13px;
}

.mail-card table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.mail-card th,
.mail-card td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mail-card th {
  background: #eef5f2;
  color: var(--ink);
  font-size: 12px;
}

.mail-card tfoot td {
  font-weight: 900;
}

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

.mail-footer-grid div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mail-footer-grid strong {
  color: var(--ink);
  font-size: 12px;
}

.review-dialog {
  width: min(720px, 100%);
  max-height: min(760px, 92vh);
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(38, 50, 56, 0.24);
}

.review-lines {
  display: grid;
  gap: 10px;
}

.review-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.review-line small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.review-line span {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

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

.product-edit-form {
  width: min(760px, 100%);
}

.product-detail-dialog {
  width: min(980px, 100%);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px;
}

.detail-gallery {
  display: grid;
  gap: 12px;
}

.detail-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #edf3f3;
}

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

.gallery-actions span {
  color: var(--muted);
  font-weight: 700;
}

.detail-product-info {
  display: grid;
  align-content: start;
  gap: 18px;
}

.detail-product-info p {
  color: var(--muted);
  line-height: 1.55;
}

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

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

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.category-chip-list,
.category-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  border: 1px solid color-mix(in srgb, var(--chip-color), white 45%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip-color), white 78%);
  color: #263238;
  padding: 8px 11px;
  font-weight: 800;
  cursor: pointer;
}

.category-chip.selected {
  background: var(--chip-color);
  color: #fff;
  box-shadow: 0 8px 18px rgba(38, 50, 56, 0.16);
}

.category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

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

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

.category-admin-card.open {
  box-shadow: 0 14px 30px rgba(38, 50, 56, 0.08);
}

.category-admin-row {
  width: 100%;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.category-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--chip-color);
}

.subcategory-panel {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px 36px;
}

.subcategory-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subcategory-pill {
  border-radius: 999px;
  background: #f4f7f4;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

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

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

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.checkbox-line span {
  margin: 0;
}

.image-upload-box {
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 2px dashed #cfd9dd;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  text-align: center;
}

.image-upload-box.dragging,
.image-upload-box:hover {
  border-color: var(--gold);
  background: #fff8e9;
}

.image-upload-box strong {
  color: var(--ink);
}

.image-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.image-preview-list div {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.image-preview-list img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  object-fit: cover;
  background: #edf3f3;
}

.image-preview-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-origin-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

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

.drop-area {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed #cfd9dd;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
}

.drop-area:hover,
.drop-area.dragging {
  border-color: var(--gold);
  background: #fff8e9;
  color: var(--ink);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-head p {
  margin-top: 6px;
}

.compact-filter {
  min-width: 230px;
}

.analytics-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.analytics-filters .ghost-button {
  min-height: 44px;
  padding: 0 14px;
}

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

.analytics-actions .ghost-button {
  min-height: 46px;
  padding: 0 16px;
}

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

.profile-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.profile-card.wide {
  grid-column: 1 / -1;
}

.profile-card dl,
.profile-addresses,
.profile-orders {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-card dl div,
.profile-addresses div,
.profile-orders div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.profile-card dl div {
  grid-template-columns: 110px minmax(0, 1fr);
}

.profile-card dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-card dd {
  margin: 0;
}

.profile-addresses span,
.profile-addresses small,
.profile-orders span {
  color: var(--muted);
}

.profile-orders div {
  grid-template-columns: 90px minmax(0, 1fr) minmax(130px, 0.8fr) auto;
  align-items: center;
}

.profile-orders em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.mini-table,
.customer-list,
.orders-list,
.rank-list {
  display: grid;
  gap: 10px;
}

.mini-table > div,
.customer-list > div,
.orders-list > div {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.orders-list .order-card {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.order-summary {
  width: 100%;
  min-height: 60px;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 120px auto;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.order-summary > span:not(.status-badge) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-summary em {
  text-align: right;
  font-weight: 700;
}

.order-card.expanded .order-summary {
  background: #fff8e9;
}

.status-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1eadc;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.order-detail {
  display: grid;
  gap: 20px;
  overflow-x: auto;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8 0%, #fbfcfb 100%);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(240px, 0.85fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.order-info-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(42, 51, 54, 0.06);
}

.order-info-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.order-info-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.order-info-card dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.order-info-card dt {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.order-info-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-info-card p:not(.eyebrow) {
  color: var(--ink);
  line-height: 1.45;
}

.status-select {
  display: grid;
  gap: 7px;
}

.status-select span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-select select {
  border-color: #d7cbb8;
  background: #fffdf8;
}

.compact-save {
  min-height: 38px;
  width: max-content;
  padding: 0 14px;
}

.status-current {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
}

.order-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-section-head h3 {
  margin: 0;
}

.order-section-head strong {
  font-size: 20px;
}

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

.order-items-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(42, 51, 54, 0.05);
}

.order-items-table th,
.order-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.order-items-table th {
  color: var(--muted);
  background: #f7f2e8;
  font-size: 12px;
  text-transform: uppercase;
}

.order-items-table tr:last-child td {
  border-bottom: 0;
}

.order-items-table td:last-child,
.order-items-table th:last-child {
  text-align: right;
  white-space: nowrap;
}

.order-items-table td:nth-child(n + 3),
.order-items-table th:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.delivered-input {
  width: 96px;
  min-height: 34px;
  margin-left: auto;
  text-align: right;
}

.status-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-history span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f3;
  font-weight: 700;
}

.timestamp-line {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.status-history.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.timeline-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-item strong {
  color: var(--ink);
}

.timeline-item span,
.timeline-item small {
  color: var(--muted);
  font-weight: 700;
}

.mini-table span,
.customer-list span,
.orders-list span,
.orders-list em {
  color: var(--muted);
  font-style: normal;
}

.customer-admin-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
}

.customer-list button {
  min-height: 72px;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.customer-list button.selected {
  border-color: var(--gold);
  background: #fff8e9;
}

.customer-list button span,
.customer-detail span {
  color: var(--muted);
}

.customer-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-head strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
}

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

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

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

.customer-form .primary-action {
  align-self: end;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-section,
.address-list,
.address-card {
  display: grid;
  gap: 10px;
}

.customer-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  cursor: pointer;
  list-style: none;
}

.customer-section summary::-webkit-details-marker {
  display: none;
}

.customer-section summary::before {
  content: "▾";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #eef5f2;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.customer-section:not([open]) summary::before {
  content: "▸";
}

.customer-section summary span {
  margin-right: auto;
  color: var(--ink);
  font-weight: 900;
}

.customer-section summary small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.customer-section > :not(summary) {
  margin-top: 10px;
}

.section-inline-action {
  display: flex;
  justify-content: flex-end;
}

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

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

.address-row {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.35fr) minmax(170px, 0.9fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fbfcfb;
  color: var(--ink);
  text-align: left;
}

.address-row:hover {
  border-color: var(--gold);
  background: #fff8e9;
}

.address-row.static-row:hover {
  border-color: var(--line);
  background: #fbfcfb;
}

.user-edit-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  align-items: end;
}

.user-edit-row label {
  display: grid;
  gap: 5px;
}

.user-edit-row label span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.user-edit-row input {
  width: 100%;
}

.user-edit-row .check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  font-weight: 800;
  color: var(--muted);
}

.user-edit-row .check-row input {
  width: auto;
}

.address-row span,
.address-row small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.address-row small {
  font-weight: 700;
}

.compact-form {
  padding-top: 4px;
}

.compact-customer-form label,
.compact-form label {
  gap: 5px;
}

.compact-customer-form input,
.compact-form input {
  min-height: 38px;
}

.empty-note {
  color: var(--muted);
  font-weight: 700;
}

.address-edit-dialog {
  width: min(620px, 100%);
}

.modal-actions.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions.split > div {
  display: inline-flex;
  gap: 10px;
}

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

.orders-list.compact div {
  grid-template-columns: auto 1fr auto;
}

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

.kpi-grid div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kpi-grid span {
  color: var(--muted);
  font-weight: 700;
}

.kpi-grid strong {
  font-size: 24px;
}

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

.analytics-grid > div {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rank-list div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-list span {
  color: var(--muted);
}

@media (max-width: 1000px) {
  .portal-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    grid-template-rows: auto auto auto;
  }

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

  .cart-panel {
    position: static;
  }

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

  .product-grid.view-medium,
  .product-grid.view-compact,
  .product-grid.view-list {
    grid-template-columns: 1fr;
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
  }

  .customer-admin-layout,
  .analytics-grid,
  .profile-grid,
  .kpi-grid,
  .analytics-filters {
    grid-template-columns: 1fr;
  }

  .order-summary,
  .order-detail-grid,
  .address-row,
  .user-edit-row {
    grid-template-columns: 1fr;
  }

  .order-summary em {
    text-align: left;
  }

  .profile-orders div,
  .profile-card dl div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 18px;
  }

  .workspace-head,
  .module-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .catalog-viewbar,
  .catalog-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-viewbar label {
    width: 100%;
  }

  .catalog-viewbar .primary-action {
    width: 100%;
    margin-left: 0;
  }

  .product-grid.view-list .product-card {
    grid-template-columns: 1fr;
  }

  .review-line,
  .review-actions {
    grid-template-columns: 1fr;
  }

  .review-actions {
    display: grid;
  }
}
