:root {
  --radius: 12px;
  --shadow: 0 12px 28px rgba(0, 0, 0, .12);
  font-family: "DM Sans", system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}

.button.primary {
  transition: box-shadow .2s ease;
}

.button.primary:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.button.primary:focus-visible {
  outline: 3px solid #78aeda;
  outline-offset: 3px;
}

.count-grid {
  grid-template-columns: repeat(3, 1fr);
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.admin-sidebar nav a,.admin-sidebar-bottom a,.admin-sidebar-bottom button { display: flex; align-items: center; gap: 11px; }
.admin-sidebar nav svg,.admin-sidebar-bottom svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 2; }
.admin-sidebar-bottom form,.admin-sidebar-bottom button { width: 100%; }
.dashboard-heading,.dashboard-section { width: min(100%,1480px); }
.dashboard-heading h1 { margin-top: 0; }
.dashboard-heading p:last-child { margin: 8px 0 0; color: var(--muted); }
.dashboard-section { margin-top: 38px; }
.dashboard-section .section-heading { margin-bottom: 18px; }
.dashboard-section .section-heading h2 { margin: 0; font-size: 22px; }
.section-note { color: var(--muted); font-size: 13px; }
.dashboard-client-grid { display: grid; gap: 38px; }
.dashboard-client-overview + .dashboard-recent-orders-section { margin-top: 42px; }
.dashboard-client-section + .dashboard-client-section { padding-top: 38px; border-top: 1px solid rgba(15,35,65,.12); }
.dashboard-client-section { display: grid; grid-template-columns: minmax(220px,28%) minmax(0,1fr); gap: 14px; align-items: stretch; }
.dashboard-client-identity { display: grid; place-items: center; min-height: 178px; padding: 28px; border: 1px solid rgba(15,35,65,.1); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(15,35,65,.12),0 1px 3px rgba(15,35,65,.06); color: var(--navy); text-align: center; }
.dashboard-client-identity img { display: block; width: min(100%,190px); height: 76px; object-fit: contain; object-position: center; }
.dashboard-client-identity strong { font: 800 23px/1.2 Manrope,system-ui,sans-serif; letter-spacing: -.02em; }
.dashboard-client-details { display: grid; gap: 14px; min-width: 0; }
.dashboard-client-counts,.dashboard-division-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.dashboard-client-counts--compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
.dashboard-client-counts > * { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px; border: 1px solid rgba(15,35,65,.1); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(15,35,65,.12),0 1px 3px rgba(15,35,65,.06); text-decoration: none; }
.dashboard-client-counts a { transition: border-color .18s ease,box-shadow .18s ease; }
.dashboard-client-counts a:hover { border-color: rgba(0,52,115,.28); box-shadow: 0 6px 17px rgba(15,35,65,.15),0 1px 3px rgba(15,35,65,.07); }
.dashboard-client-counts a:focus-visible,.dashboard-division-list a:focus-visible { outline: 3px solid #78aeda; outline-offset: 3px; }
.dashboard-metric-icon,.dashboard-order-icon { display: grid; place-items: center; flex: 0 0 auto; color: var(--navy); background: #e9f2fb; }
.dashboard-metric-icon { width: 38px; height: 38px; border-radius: 9px; }
.dashboard-metric-icon svg { width: 19px; height: 19px; }
.dashboard-metric-copy { display: grid; gap: 3px; min-width: 0; }
.dashboard-client-counts strong { color: var(--navy); font: 800 27px/1 Manrope,system-ui,sans-serif; letter-spacing: -.025em; }
.dashboard-client-counts .dashboard-metric-copy > span { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.3; text-transform: uppercase; letter-spacing: .055em; }
.dashboard-division-list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 19px 16px; border: 1px solid rgba(15,35,65,.1); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(15,35,65,.12),0 1px 3px rgba(15,35,65,.06); color: var(--ink); text-decoration: none; transition: border-color .18s ease,box-shadow .18s ease; }
.dashboard-division-list a:hover { border-color: rgba(0,52,115,.28); box-shadow: 0 6px 17px rgba(15,35,65,.15),0 1px 3px rgba(15,35,65,.07); }
.dashboard-division-list a:hover span { color: var(--navy); }
.dashboard-division-list strong { color: var(--muted); font-size: 13px; white-space: nowrap; }
.dashboard-division-count { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.dashboard-division-count svg { width: 16px; height: 16px; color: #7890a8; }
.dashboard-orders { border-color: rgba(15,35,65,.1); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(15,35,65,.12),0 1px 3px rgba(15,35,65,.06); }
.dashboard-orders table { min-width: 900px; table-layout: fixed; }
.dashboard-orders th { background: #f6f8fb; }
.dashboard-orders th,.dashboard-orders td { padding-top: 16px; padding-bottom: 16px; }
.dashboard-orders th:nth-child(1) { width: 18%; }
.dashboard-orders th:nth-child(2) { width: 17%; }
.dashboard-orders th:nth-child(3) { width: 15%; }
.dashboard-orders th:nth-child(4) { width: 16%; }
.dashboard-orders tbody tr { transition: background .15s ease; }
.dashboard-orders tbody tr:hover { background: #f8fbfe; }
.dashboard-orders tbody tr:last-child td { border-bottom: 0; }
.dashboard-order-icon { width: 34px; height: 34px; border-radius: 8px; }
.dashboard-order-icon svg { width: 17px; height: 17px; }
.dashboard-order-reference { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.dashboard-order-reference a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dashboard-order-reference a:hover { color: var(--orange); }
.order-notification-warning { display: block; margin-top: 3px; color: #a8271b; font-size: 12px; font-weight: 600; line-height: 1.25; }
.order-notification-warning.previewed { color: var(--muted); }
.dashboard-orders td small { display: block; margin-top: 3px; color: var(--muted); }
.dashboard-order-products { display: grid; gap: 4px; min-width: 220px; margin: 0; padding: 0; list-style: none; }
.dashboard-order-products strong { color: var(--navy); white-space: nowrap; }
.dashboard-order-toggle { margin: 6px 0 0; padding: 0; border: 0; background: none; color: var(--navy); font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dashboard-order-toggle:focus-visible { outline: 3px solid #78aeda; outline-offset: 3px; border-radius: 2px; }
.dashboard-empty { color: var(--muted); }

.field-help,
th small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.login-page {
  min-height: 100vh;
  padding: 28px;
  background: var(--surface);
}

.login-card {
  width: min(420px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 7px 0;
  color: var(--navy);
  font: 800 2rem/1.15 Manrope, system-ui, sans-serif;
}

.login-card input {
  padding: 12px;
  border: 1px solid #bdc7c4;
  border-radius: 10px;
}

.login-card .button.primary {
  min-height: 48px;
  border-radius: 12px;
}

.login-back {
  color: var(--muted);
  font-size: 13px;
  text-underline-offset: 3px;
}

.product-image-admin {
  display: grid;
  align-content: start;
  gap: 8px;
}

.upload-warning {
  margin: 0;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.45;
}

.current-image {
  display: grid;
  gap: 8px;
  align-content: start;
}

.current-image-preview {
  width: 100%;
  height: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f3f4;
}

.current-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.current-image-preview {
  transition: opacity .18s ease, filter .18s ease;
}

.current-image.is-removing .current-image-preview {
  opacity: .38;
  filter: grayscale(1);
}

.image-removal-status {
  margin: 0;
  color: #8e2020;
  font-size: 13px;
  font-weight: 700;
}

.image-removal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button.image-remove,
.button.image-undo {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.field-availability {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.field-availability > strong,
.field-availability > small {
  display: block;
}

.field-availability > small {
  margin: 4px 0 10px;
  color: var(--muted);
}

.availability-option {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.availability-option summary {
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.availability-option > label,
.availability-option fieldset {
  margin-top: 12px;
}

.availability-option fieldset {
  border: 0;
  padding: 0;
}

.availability-option fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.availability-option fieldset input {
  width: auto;
}

.duplicate-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.duplicate-zone h2,
.duplicate-zone p {
  margin: 0;
}

.duplicate-zone h2 {
  font-size: 18px;
}

.duplicate-zone p {
  margin-top: 5px;
  color: var(--muted);
}

.button.image-remove {
  border-color: #c86a63;
  color: #9b2c25;
}

.button.image-remove:hover {
  border-color: #b42318;
  background: #fff3f2;
}

.button.image-undo {
  border-color: var(--navy);
  color: var(--navy);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 38px;
  padding: 22px 24px;
  border: 1px solid #e6b9b9;
  border-radius: var(--radius);
  background: #fff;
}

.danger-zone h2,
.danger-zone p {
  margin: 0;
}

.danger-zone h2 {
  color: #8e2020;
  font-size: 18px;
}

.danger-zone p {
  margin-top: 5px;
  color: var(--muted);
}

.danger-zone .button:disabled { border-color: var(--line); color: var(--muted); cursor: not-allowed; opacity: .65; }
.category-divisions { display:flex; gap:20px; border:1px solid var(--line); border-radius:var(--radius); padding:16px; }
.category-divisions label { display:flex; align-items:center; gap:8px; }
.category-divisions input { width:auto; }
.category-thumb-placeholder { background:#e2e5e8; }
.admin-client-card { display:grid; gap:16px; }
.admin-client-summary,.admin-client-title,.admin-client-division-heading,.client-divisions-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.admin-client-title { justify-content:flex-start; }
.admin-client-logo { display:grid; place-items:center; width:64px; height:48px; padding:6px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.admin-client-logo img { width:100%; height:100%; object-fit:contain; }
.admin-client-division-heading h3,.client-divisions-heading h2,.client-divisions-heading p { margin:0; }
.admin-client-division-heading > span { color:var(--muted); font-size:13px; font-weight:700; }
.admin-client-card ul { margin:0; padding:0; list-style:none; }
.admin-client-card .status { flex:0 0 auto; }
.admin-client-actions { display:flex; align-items:center; gap:16px; }
.admin-client-edit,.admin-client-open { font-weight:700; text-underline-offset:3px; }
.admin-client-open { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:13px; }
.admin-client-open svg { width:14px; height:14px; }
.client-divisions-heading { margin-bottom:18px; }
.client-divisions-heading p { margin-top:5px; color:var(--muted); }
.client-division-editor { display:grid; gap:16px; }
.client-division-editor fieldset { margin:0; padding:18px; border:1px solid var(--line); border-radius:var(--radius); }
.client-division-editor legend { padding:0 7px; color:var(--navy); font-weight:800; }
.division-row-actions { display:flex; justify-content:flex-end; margin-top:14px; }

.button.danger {
  border-color: #b42318;
  background: #fff;
  color: #b42318;
}

.button.danger:hover {
  background: #b42318;
  color: #fff;
}

.delete-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.delete-dialog::backdrop {
  background: rgba(12, 29, 40, .52);
}

.delete-dialog-content {
  padding: 28px;
}

.delete-dialog-content h2 {
  margin: 0;
  color: #8e2020;
}

.delete-dialog-content p {
  color: var(--muted);
}

.delete-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.delete-dialog-actions form {
  margin: 0;
}

.delete-dialog--impact { width: min(580px, calc(100% - 32px)); }
.client-delete-impact { margin: 20px 0; padding: 16px 18px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.client-delete-impact ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 24px; margin: 10px 0 0; padding-left: 20px; }
.client-delete-alternative { padding-top: 14px; border-top: 1px solid var(--line); }
.client-delete-confirmation { display: grid; gap: 8px; margin-top: 18px; color: var(--navy); font-size: 13px; font-weight: 600; }
.client-delete-confirmation input { width: 100%; }

@media (max-width: 600px) {
  .count-grid {
    grid-template-columns: 1fr;
  }
  .danger-zone,
  .duplicate-zone,
  .delete-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-client-section { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-client-details,.dashboard-client-counts,.dashboard-division-list { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-client-identity { min-height: 154px; padding: 24px; }
  .dashboard-client-identity img { height: 64px; }
  .dashboard-section .section-heading { align-items: flex-start; flex-direction: column; }
  .admin-client-summary,.client-divisions-heading { align-items:flex-start; flex-direction:column; }
}

@media (min-width: 601px) and (max-width: 1100px) {
  .dashboard-client-section { grid-template-columns: minmax(190px,30%) minmax(0,1fr); gap: 10px; }
  .dashboard-client-details,.dashboard-client-counts,.dashboard-division-list { gap: 10px; }
  .dashboard-client-identity { padding: 22px; }
  .dashboard-client-counts > * { align-items: flex-start; flex-direction: column; padding: 13px; }
}

/* Shared admin foundation */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope/Manrope-VariableFont_wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy: #073b78;
  --orange: #f37121;
  --ink: #172638;
  --muted: #667384;
  --line: #d8dee6;
  --line-strong: #bdc7d3;
  --surface: #f2f4f6;
  --surface-subtle: #f7f8f9;
  --white: #fff;
  --radius: 6px;
  --shadow: 0 10px 28px rgba(15, 35, 65, .08);
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
}

body {
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

a { text-underline-offset: 3px; }

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

.admin-sidebar {
  width: 224px;
  padding: 24px 16px 18px;
  background: #063b78;
}

.admin-brand {
  margin: 0 10px 34px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.admin-brand span {
  margin-top: 2px;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.admin-sidebar nav { gap: 3px; }

.admin-sidebar nav a,
.admin-sidebar-bottom a,
.admin-sidebar-bottom button {
  position: relative;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 4px;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  font-weight: 550;
  transition: background-color .16s ease, color .16s ease;
}

.admin-sidebar nav a:hover,
.admin-sidebar-bottom a:hover,
.admin-sidebar-bottom button:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.admin-sidebar nav a.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
}

.admin-sidebar nav a.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: var(--orange);
  content: "";
}

.admin-sidebar nav svg,
.admin-sidebar-bottom svg {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  stroke-width: 1.8;
}

.admin-sidebar-bottom {
  gap: 2px;
  padding-top: 12px;
  border-color: rgba(255,255,255,.14);
}

.admin-sidebar-user {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0 11px 11px;
  color: rgba(255,255,255,.52);
  font-size: 10px;
  line-height: 1.35;
}

.admin-sidebar-user > svg {
  width: 15px;
  height: 15px;
  color: rgba(255,255,255,.58);
  stroke-width: 1.75;
}

.admin-sidebar-user-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.admin-sidebar-user strong {
  color: rgba(255,255,255,.9);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.admin-sidebar-bottom a,
.admin-sidebar-bottom button {
  color: rgba(255,255,255,.67);
  font-size: 13px;
  font-weight: 500;
}

.admin-main {
  margin-left: 224px;
  padding: 30px 32px 56px;
}

.admin-main > :not(dialog):not(template) {
  width: min(100%, 1480px);
  margin-right: auto;
  margin-left: auto;
}

.page-heading {
  align-items: flex-end;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.16;
}

.section-heading h2,
.panel h2 {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -.015em;
}

.panel h2 { font-size: 19px; }

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.back-link {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover { color: var(--navy); }

.field-help,
th small,
.section-note {
  color: var(--muted);
  font-weight: 450;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  min-height: 44px;
  padding: 9px 12px;
}

select {
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23172638' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}

textarea {
  min-height: 108px;
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: #8b95a3; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(7,59,120,.13);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #eceff2;
  color: #7c8794;
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--navy);
}

.form-grid label,
.field-card label,
.login-card label {
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.form-grid { gap: 18px 20px; }

.button {
  min-height: 42px;
  padding: 9px 14px;
  border-color: var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.button:hover {
  border-color: #8e9bab;
  background: var(--surface-subtle);
}

.button.primary,
.button.primary:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
  box-shadow: none;
}

.button.primary:hover { background: #df6218; }

.button:focus-visible,
.admin-sidebar a:focus-visible,
.admin-sidebar button:focus-visible,
.admin-menu:focus-visible {
  outline: 3px solid #78aeda;
  outline-offset: 2px;
}

.panel,
.client-card,
.table-wrap,
.count-grid a {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
}

.table-wrap {
  background: #fff;
  overflow: auto;
}

table { font-size: 13px; }

th,
td {
  padding: 12px 14px;
  border-color: #e5e9ee;
}

th {
  background: var(--surface-subtle);
  color: #697587;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .075em;
}

tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: #f8fafb; }
tbody tr:last-child td { border-bottom: 0; }
td > a { font-weight: 650; }

.admin-order-heading { align-items: flex-end; }
.admin-order-heading h1 { margin-bottom: 5px; }
.admin-order-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.admin-order-preview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-order-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding: 18px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-order-meta > div { display: grid; align-content: start; justify-items: start; gap: 4px; min-width: 0; }
.admin-order-meta span,.admin-order-information dt,.admin-order-item small,.admin-order-item dl dt { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.admin-order-meta strong:not(.status) { overflow-wrap: anywhere; color: var(--ink); font-size: 15px; }
.admin-order-meta small { color: var(--muted); font-size: 11px; }
.admin-order-grid { display: grid; grid-template-columns: minmax(280px,.78fr) minmax(420px,1.22fr); gap: clamp(38px,5vw,76px); margin-top: 34px; }
.admin-order-information { display: grid; align-content: start; }
.admin-order-information section { padding: 0 0 26px; }
.admin-order-information section + section { padding-top: 26px; border-top: 1px solid var(--line); }
.admin-order-information h2,.admin-order-products h2 { margin: 0 0 17px; color: var(--ink); font-size: 18px; font-weight: 650; }
.admin-order-information dl,.admin-order-item dl { display: grid; gap: 11px; margin: 0; }
.admin-order-information dl div,.admin-order-item dl div { display: grid; grid-template-columns: minmax(110px,.45fr) minmax(0,1fr); gap: 16px; }
.admin-order-information dd,.admin-order-item dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.admin-order-information address,.admin-order-information p { margin: 0; color: var(--ink); font-style: normal; line-height: 1.65; overflow-wrap: anywhere; }
.admin-order-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 17px; border-bottom: 1px solid rgba(23,38,56,.22); }
.admin-order-section-heading h2 { margin-bottom: 0; }
.admin-order-section-heading span { color: var(--muted); font-size: 12px; }
.admin-order-item { display: grid; grid-template-columns: 86px minmax(0,1fr) auto; gap: 16px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.admin-order-thumb { display: grid; place-items: center; width: 86px; aspect-ratio: 1; border-radius: 4px; background: #c4c4c4; color: var(--navy); }
.admin-order-thumb img { width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.admin-order-thumb svg { width: 25px; height: 25px; stroke-width: 1.5; }
.admin-order-item-content { min-width: 0; }
.admin-order-item h3 { margin: 3px 0 12px; color: var(--ink); font-size: 16px; font-weight: 650; }
.admin-order-item dl { gap: 6px; }
.admin-order-item dl div { grid-template-columns: minmax(90px,.4fr) minmax(0,1fr); gap: 12px; }
.admin-order-item p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.admin-order-quantity { white-space: nowrap; color: var(--navy); font-size: 13px; }

.filters {
  gap: 8px;
  margin-bottom: 16px;
}

.filters select {
  width: auto;
  min-width: 156px;
}

.status {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.notice {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
}

.notice.success { border-color: #bddfc9; }

.dashboard-client-identity,
.dashboard-client-counts > *,
.dashboard-division-list a,
.dashboard-orders {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.dashboard-client-counts a:hover,
.dashboard-division-list a:hover {
  border-color: #aeb9c6;
  box-shadow: none;
}

.current-image-preview,
.field-availability,
.assignment-grid fieldset,
.category-divisions,
.client-division-editor fieldset,
.duplicate-zone,
.danger-zone {
  border-radius: var(--radius);
  box-shadow: none;
}

.admin-menu {
  align-items: center;
  gap: 7px;
  min-height: 38px;
  font-weight: 700;
}

.admin-menu svg { width: 17px; height: 17px; }
.admin-sidebar-overlay { display: none; }

@media (max-width: 900px) {
  .admin-order-grid { grid-template-columns: 1fr; gap: 30px; }
  body.admin-nav-open { overflow: hidden; }

  .admin-menu {
    top: 10px;
    left: 14px;
    display: inline-flex;
    padding: 8px 11px;
    border-radius: 4px;
  }

  .admin-sidebar {
    width: min(280px, calc(100vw - 48px));
    box-shadow: 12px 0 36px rgba(8,26,46,.22);
    transition: transform .2s ease;
  }

  .admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: block;
    border: 0;
    background: rgba(11,24,39,.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .admin-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-main {
    margin-left: 0;
    padding: 76px 20px 44px;
  }
}

@media (max-width: 600px) {
  .admin-main { padding-right: 16px; padding-left: 16px; }
  .page-heading { align-items: flex-start; gap: 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading > .button { flex: 0 0 auto; }
  .panel { padding: 18px; }
  .filters select,
  .filters .button { width: 100%; }
}

/* Product editor */
.product-editor-heading,
.product-editor,
.product-editor ~ .duplicate-zone,
.product-editor ~ .danger-zone {
  width: min(100%, 1280px) !important;
}

.product-editor {
  border-bottom: 1px solid rgba(23,38,56,.16);
}

.product-editor .product-editor-section {
  margin: 0;
  padding: 30px 0 34px;
  border: 0;
  border-top: 1px solid rgba(23,38,56,.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.product-editor-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.product-editor-section-heading > span {
  flex: 0 0 24px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
}

.product-editor-section-heading h2,
.product-editor-section-heading p,
.product-media-heading h3,
.product-media-heading p {
  margin: 0;
}

.product-editor-section-heading h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.018em;
}

.product-editor-section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.product-information-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: clamp(36px, 5vw, 72px);
  padding-left: 38px;
}

.product-information-fields {
  display: grid;
  align-content: start;
  gap: 22px;
}

.product-information-fields > label,
.product-media-admin label,
.placement-client label,
.publishing-grid label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.product-information-fields textarea {
  min-height: 154px;
}

.product-media-admin {
  display: grid;
  align-content: start;
  gap: 14px;
}

.product-media-heading h3 {
  font-size: 14px;
  font-weight: 650;
}

.product-media-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.product-media-admin .current-image {
  gap: 10px;
}

.product-upload-stage {
  overflow: hidden;
  border: 1px solid #aeb8c2;
  border-radius: 4px;
  background: rgba(255,255,255,.46);
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.product-upload-stage:hover,
.product-upload-stage.is-dragging {
  border-color: var(--navy);
  background: rgba(255,255,255,.7);
}

.product-upload-stage:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(7,59,120,.13);
}

.product-media-admin .current-image-preview {
  height: 220px;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: #cfd2d5;
}

.product-media-admin .current-image-preview:empty {
  display: none;
}

.product-upload-control {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  cursor: pointer;
}

.product-upload-stage:has(.current-image-preview:empty) .product-upload-control {
  min-height: 220px;
  border-top: 0;
}

.product-upload-control > span {
  display: grid;
  gap: 4px;
  pointer-events: none;
}

.product-upload-control strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 650;
}

.product-upload-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
}

.product-upload-control input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.product-media-admin .image-removal-actions {
  justify-content: flex-start;
}

.placement-client {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  margin: 0 0 24px 38px;
}

.placement-client p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.product-editor .assignment-grid {
  gap: 28px;
  margin-left: 38px;
}

.category-editor .assignment-grid {
  grid-template-columns: minmax(0, 1fr);
}

.category-placement-groups {
  display: grid;
  gap: 0;
  margin-left: 38px;
}

.category-placement-group {
  min-width: 0;
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.category-placement-group:first-child {
  border-top-color: rgba(23,38,56,.22);
}

.category-placement-group legend {
  margin: 0 0 9px;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.category-placement-error {
  display: block;
  margin: 8px 0 0 38px;
}

.client-divisions-section .product-configuration-heading {
  margin-bottom: 4px;
}

.division-form-error {
  margin-left: 38px;
}

.client-editor .client-division-editor {
  display: grid;
  gap: 0;
  margin-left: 38px;
}

.client-editor .client-division-editor fieldset {
  min-width: 0;
  margin: 0;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.client-editor .client-division-editor fieldset:first-child {
  border-top-color: rgba(23,38,56,.22);
}

.client-editor .client-division-editor legend {
  margin: 0 0 2px;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.client-division-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.client-division-header strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.division-delete-action {
  flex: 0 0 auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #9b2c25;
  font: 650 12px "Manrope", system-ui, sans-serif;
  cursor: pointer;
}

.division-delete-action:hover {
  color: #741f1a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.client-division-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(220px, 1fr);
  align-items: start;
  gap: 18px;
}

.client-division-fields label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.division-logo-admin {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  margin-top: 20px;
}

.division-logo-admin .current-image-preview {
  height: 140px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #cfd2d5;
}

.division-logo-admin .current-image-preview:empty {
  display: none;
}

.division-logo-admin .product-upload-stage:has(.current-image-preview:empty) .product-upload-control {
  min-height: 140px;
}

.division-logo-admin .image-removal-actions {
  justify-content: flex-start;
}

.client-editor .publishing-grid {
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.25fr);
}

.product-editor .assignment-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-editor .assignment-grid legend {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

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

.product-editor .assignment-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.product-editor .assignment-options label:hover {
  color: var(--navy);
}

.product-configuration-heading {
  align-items: flex-start;
  margin-bottom: 4px;
}

.product-configuration-heading .product-editor-section-heading {
  margin-bottom: 0;
}

.product-configuration-heading > .button {
  flex: 0 0 auto;
}

.product-editor .field-card {
  display: block;
  margin-left: 38px;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.product-editor .field-card:first-child {
  border-top-color: rgba(23,38,56,.22);
}

.field-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.field-card-identity {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}

.field-card-identity .field-drag {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field-card-identity strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.field-card-identity [data-field-type-summary] {
  color: var(--muted);
  font-size: 12px;
}

.product-editor .field-actions {
  display: flex;
  grid-column: auto;
  gap: 5px;
}

.product-editor .field-actions button {
  min-height: 30px;
  padding: 5px 9px;
  border-color: var(--line-strong);
  border-radius: 3px;
  color: var(--navy);
  font: 650 12px "Manrope", system-ui, sans-serif;
  cursor: pointer;
}

.product-editor .field-actions [data-remove-field] {
  border-color: transparent;
  color: #9b2c25;
}

.product-editor .field-actions button:hover {
  background: #fff;
}

.field-card-body {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) 120px;
  align-items: start;
  gap: 18px;
}

.product-editor .field-card-body .check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  min-height: 44px;
  font-weight: 550;
  cursor: pointer;
}

.product-editor .field-values,
.product-editor .field-availability {
  grid-column: 1 / -1;
}

.product-editor .field-values small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
}

.product-editor .field-values textarea {
  min-height: 116px;
}

.product-editor .field-availability {
  margin-top: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.46);
}

.product-editor .field-availability > strong {
  font-size: 13px;
  font-weight: 650;
}

.product-editor .field-availability > small {
  font-size: 11px;
}

.product-editor .availability-option {
  padding: 10px 0;
}

.product-editor .availability-option summary {
  font-size: 12px;
  font-weight: 650;
}

.add-field-bottom {
  margin: 8px 0 0 38px;
}

.publishing-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(150px, .55fr) minmax(280px, 1.25fr);
  align-items: start;
  gap: 22px;
  padding-left: 38px;
}

.publishing-grid .field-help {
  margin-top: 0;
  line-height: 1.4;
}

.publishing-status select {
  border-color: #8c99a7;
  font-weight: 600;
}

.product-editor-actions {
  justify-content: flex-end;
  padding: 22px 0 28px;
}

.product-editor ~ .duplicate-zone,
.product-editor ~ .danger-zone {
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.product-editor ~ .duplicate-zone {
  margin-top: 18px;
}

.product-editor ~ .danger-zone {
  margin-top: 0;
}

@media (max-width: 900px) {
  .product-information-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
    gap: 32px;
  }

  .assignment-options { grid-template-columns: 1fr; }
  .field-card-body { grid-template-columns: minmax(0, 1fr) minmax(180px, 220px); }
  .product-editor .field-card-body .check { margin-top: 0; }
  .publishing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publishing-grid label:last-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .admin-order-heading { align-items: flex-start; }
  .admin-order-preview-actions { justify-content: flex-start; }
  .admin-order-meta { grid-template-columns: 1fr; gap: 16px; }
  .product-information-layout,
  .placement-client,
  .product-editor .assignment-grid,
  .publishing-grid {
    grid-template-columns: 1fr;
    margin-left: 0;
    padding-left: 0;
  }

  .placement-client { align-items: start; gap: 8px; }
  .placement-client p { margin-bottom: 0; }
  .product-editor .field-card { margin-left: 0; }
  .client-editor .client-division-editor,
  .division-form-error,
  .category-placement-groups,
  .category-placement-error { margin-left: 0; }
  .client-division-fields { grid-template-columns: 1fr; }
  .add-field-bottom { margin-left: 0; }
  .field-card-body { grid-template-columns: 1fr; }
  .product-editor .field-card-body .check { min-height: auto; }
  .publishing-grid label:last-child { grid-column: auto; }
}

@media (max-width: 520px) {
  .admin-order-item { grid-template-columns: 70px minmax(0,1fr); }
  .admin-order-thumb { width: 70px; }
  .admin-order-quantity { grid-column: 2; }
  .admin-order-information dl div,.admin-order-item dl div { grid-template-columns: 1fr; gap: 2px; }
  .product-editor-section-heading { gap: 10px; }
  .product-editor-section-heading > span { flex-basis: 20px; }
  .product-configuration-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .product-configuration-heading > .button { align-self: flex-start; }
  .field-card-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .product-editor .field-actions { justify-content: flex-start; }
  .product-editor-actions { align-items: stretch; flex-direction: column; }
  .product-editor-actions .button { width: 100%; }
}

/* Shared checkbox row for Portal User status, access, and client assignments. */
.product-editor label.portal-user-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 0;
  line-height: 1.4;
  cursor: pointer;
}

.product-editor .portal-user-checkbox input[type="checkbox"] {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 0;
}

/* Exact resting shadow of portal.css's division cards (--shadow-card). */
.client-grid > .client-card,
.dashboard-client-identity,
.dashboard-client-counts > *,
.dashboard-client-counts a:hover,
.dashboard-division-list a,
.dashboard-division-list a:hover,
.dashboard-orders {
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
