.admin-frame {
  width: min(1080px, calc(100% - 48px));
  margin-inline: auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 14px;
}

.admin-header-actions,
.listing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.drawing-manager { width: min(880px, calc(100% - 24px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--white); overflow: auto; padding: 17px; }
.drawing-manager::backdrop { background: #20332a77; }
.drawing-manager-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 13px; }
.drawing-manager-head p, .drawing-upload > p, .drawing-exhibit-control p { font-size: 12px; color: var(--muted); }
.drawing-upload { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(80px, .45fr) auto; gap: 7px; align-items: end; border: 1px solid var(--line); background: var(--page); padding: 9px; border-radius: var(--radius); }
.drawing-upload label { font-size: 12px; display: grid; gap: 4px; }
.drawing-upload input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--white); padding: 5px; min-height: 36px; }
.drawing-package-pick { grid-column: 1 / -1; }
.drawing-package-pick select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--white); padding: 6px; }
.drawing-upload > p { grid-column: 1 / -1; }
.drawing-exhibit-control { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-block: 12px; }
.drawing-exhibit-control label { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.drawing-manager-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 214px), 1fr)); gap: 8px; }
.drawing-manager-card { display: grid; min-width: 0; gap: 5px; padding: 8px; border-radius: 5px; border: 1px solid var(--line); }
.drawing-manager-card img { display: block; width: 100%; height: 125px; object-fit: contain; border: 1px solid var(--line); background: white; border-radius: 4px; }
.drawing-manager-card p { overflow-wrap: anywhere; }
.drawing-manager-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.drawing-manager-actions .button { font-size: 12px; padding-inline: 6px; min-height: 31px; }
.drawing-manager-card small { color: var(--muted); }
.listing-row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 590px) { .drawing-upload { grid-template-columns: minmax(0, 1fr); } .drawing-manager { padding: 11px; } }

.admin-entry {
  width: min(430px, 100%);
  margin: clamp(36px, 9vw, 108px) auto;
  padding: 28px;
}

.admin-entry h1,
.admin-heading h1 {
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -.03em;
  line-height: 1.2;
}

#admin-retry { margin-top: 12px; }

.admin-auth-form {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.admin-auth-form label { font-weight: 650; }

.admin-auth-form input,
.listing-actions select {
  width: 100%;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid #abb8ae;
  border-radius: 7px;
  background: #fbfcf7;
}

.admin-auth-form input { margin-bottom: 6px; }
.admin-auth-form .primary { justify-self: start; margin-top: 6px; min-width: 106px; }

#admin-main { padding-bottom: 48px; }

.admin-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 19px;
}

.admin-heading p { color: var(--muted); overflow-wrap: anywhere; }

.import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 25px;
  border-color: #244739;
  color: #f5fbf3;
  background: #18382c;
}

.import-panel h2,
.listing-heading h2 { font-size: 20px; line-height: 1.3; }

.import-panel p { margin-top: 3px; color: #c9ded2; }

.import-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.import-form input {
  width: min(250px, 100%);
  border: 1px solid #69877a;
  border-radius: 7px;
  padding: 4px 6px 4px 4px;
  color: #e0eee4;
  background: #112d23;
}

.import-form input::file-selector-button {
  min-height: 32px;
  margin-right: 8px;
  padding: 4px 9px;
  border: 0;
  border-radius: 4px;
  color: #142c23;
  background: #e8f1e7;
  cursor: pointer;
}

.import-form a.button { border: 1px solid #8baa9b; }
.import-form a.button:hover { background: #244c3c; }
.import-form :is(input, button, a):focus-visible { outline-color: #ffb592; }

.admin-message {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #aac4a7;
  border-radius: 7px;
  color: #224634;
  background: #ecf4e8;
  overflow-wrap: anywhere;
}

.admin-message[data-kind="error"] {
  border-color: #e0b49f;
  color: #762909;
  background: #fbede6;
}

.catalog-panel { margin-top: 17px; overflow: hidden; }

.listing-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 24px;
}

.listing-heading p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.listing-actions select { width: auto; }

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

.listing-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.listing-table-wrap th,
.listing-table-wrap td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.listing-table-wrap :is(th, td):first-child { padding-left: 24px; }
.listing-table-wrap :is(th, td):last-child { padding-right: 24px; }
.listing-table-wrap th { color: #3e5c4c; background: #eef3eb; font-size: 13px; white-space: nowrap; }
.listing-table-wrap tbody tr:hover { background: #f7f9f1; }
.listing-table-wrap td:first-child { width: 36%; min-width: 155px; }
.listing-table-wrap td:nth-child(2) { min-width: 65px; }
.listing-table-wrap td:nth-child(3) { max-width: 160px; }
.listing-table-wrap td:nth-child(4) { white-space: nowrap; }
.listing-table-wrap td:last-child { white-space: nowrap; }
.listing-table-wrap td { overflow-wrap: anywhere; }
.listing-table-wrap td .button { min-height: 36px; }
.listing-table-wrap td small { display: block; margin-top: 2px; color: var(--muted); }

.listing-empty {
  padding: 30px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.listing-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  color: #455850;
  background: #e9eeea;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.listing-status[data-status="draft"] { color: #783714; background: #fde9da; }
.listing-status[data-status="published"] { color: #244d32; background: #e3f0de; }

@media (max-width: 720px) {
  .admin-frame { width: calc(100% - 32px); }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .import-panel { align-items: flex-start; flex-direction: column; padding: 18px; }
  .listing-heading { padding-inline: 18px; }
  .listing-table-wrap :is(th, td) { padding-inline: 11px; }
  .listing-table-wrap :is(th, td):first-child { padding-left: 18px; }
  .listing-table-wrap :is(th, td):last-child { padding-right: 18px; }
}

@media (max-width: 430px) {
  .admin-header .brand { gap: 5px; font-size: 17px; }
  .admin-header-actions .button { min-height: 38px; padding-inline: 9px; font-size: 13px; }
  .import-form input { width: 100%; }
  .listing-heading { align-items: flex-start; flex-direction: column; }
}
.admin-refunds { margin-bottom: 12px; padding: 12px 16px; }
.admin-refunds > summary { cursor: pointer; font-size: 16px; font-weight: 700; }
.admin-refund-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.admin-refund-toolbar select { margin-inline-start: 6px; padding: 4px; }
.admin-refunds .order-card { display: grid; gap: 4px; }
.admin-section-nav { display: flex; gap: 5px 18px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.admin-section-nav a { color: var(--pine); font-weight: 650; padding: 5px 1px; }
.admin-section-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.import-panel a.button.secondary { color: #174536; border-color: #b9ccc1; background: #f7fbf8; }
.listing-actions input[type="search"] { min-width: 0; width: 155px; padding: 7px 10px; border: 1px solid #a9bfb3; border-radius: var(--radius); background: #fff; }
.listing-batch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 11px; padding: 8px 24px 11px; border-top: 1px solid var(--line); }
.listing-batch label { display: flex; align-items: center; gap: 4px; }
.listing-batch span { color: var(--muted); }
.listing-batch .button { min-height: 35px; }
#listing-table :is(th, td):first-child { width: 67px; min-width: 0; }
#listing-table th:nth-child(2), #listing-table td:nth-child(2) { width: 28%; min-width: 155px; }
#listing-table td:last-child { min-width: 130px; }
.listing-status[data-status="offline"] { color: #554562; background: #eee8f2; }
.review-badge[data-review="blocked"] { color: #8e3123; border-color: #cf9b91; background: #fff4ef; }
.review-badge[data-review="warning"] { color: #795123; border-color: #d6ba8f; background: #fff9ef; }
.delivery-review-details { display: grid; gap: 11px; overflow-wrap: anywhere; margin-top: 10px; }
.delivery-review-details ul { margin: 0; padding-inline-start: 19px; }
.review-issue { padding: 8px 11px; background: #f8f1e7; border-left: 3px solid #c69450; }
.review-issue[data-level="blocked"] { background: #fbeee9; border-left-color: #bc6552; }
.operations-panel { margin-block: 16px; scroll-margin-top: 10px; overflow: hidden; }
.operations-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 24px; margin-bottom: 12px; }
.operations-summary div { min-width: 0; padding: 10px 13px; background: #eaf2eb; border: 1px solid #dce8dd; border-radius: var(--radius); }
.operations-summary dt { color: var(--muted); font-size: 12px; }
.operations-summary dd { color: var(--pine-deep); font-size: clamp(20px, 3vw, 29px); font-weight: 700; overflow-wrap: anywhere; }
.operations-controls, .operations-footnote { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 8px 24px; color: var(--muted); font-size: 13px; }
.operations-controls select { padding: 5px 7px; }
#operations-table { min-width: 615px; }
#operations-table th[scope="row"] { text-align: start; background: transparent; color: var(--ink); width: 30%; min-width: 155px; }
#operations-table th small { display: block; color: var(--muted); font-weight: 400; }
#operations-table td { font-variant-numeric: tabular-nums; }
@media (max-width: 650px) {
  .listing-batch, .operations-summary, .operations-controls, .operations-footnote { padding-inline: 11px; }
  .operations-summary div { padding-inline: 7px; }
  #operations-table, #operations-table tbody, #listing-table, #listing-table tbody { display: block; min-width: 0; }
  #operations-table thead, #listing-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  #operations-table tr, #listing-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 10px; border-top: 1px solid var(--line); gap: 4px; }
  #operations-table tr :is(th, td), #listing-table tr td { padding: 4px 5px; min-width: 0; border: 0; }
  #operations-table th[scope="row"] { width: auto; grid-column: 1 / -1; }
  #operations-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  #operations-table td { font-weight: 650; }
  #listing-table td:first-child { width: auto; grid-column: 1; }
  #listing-table td:nth-child(2) { width: auto; grid-column: 2 / -1; min-width: 0; }
  #listing-table td:last-child { grid-column: 2 / -1; }
}
