.admin-body { min-height: 100vh; background: var(--cream); }
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(20px,5vw,70px); border-bottom: 1px solid var(--line); background: var(--paper); }
.back-link { font-weight: 600; text-underline-offset: 4px; }
.admin-main { width: min(1280px,calc(100% - 40px)); margin: 0 auto; padding: clamp(50px,7vw,90px) 0 100px; }
.login-panel { width: min(100%,520px); margin: 7vh auto; padding: clamp(28px,5vw,52px); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 25px 70px rgba(40,35,31,.1); }
.login-panel h1, .dashboard-heading h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.4rem,5vw,4.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.login-panel > p:not(.eyebrow) { margin: 22px 0; }
.login-panel form { display: grid; gap: 9px; }
.login-panel label, .admin-form > label { margin-top: 5px; font-size: .84rem; font-weight: 600; }
.login-panel input, .admin-form input, .admin-form textarea, .admin-form select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; }
.login-panel .button { justify-self: start; margin-top: 8px; }
.dashboard-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.outline-button { padding: 10px 16px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 600; }
.security-note { margin: 22px 0 0; padding: 14px 18px; border-left: 3px solid var(--mustard); background: rgba(217,169,40,.1); }
.global-message { min-height: 28px; padding: 8px 0; color: #37613f; font-weight: 600; }
.admin-section { padding: clamp(65px,8vw,100px) 0; border-bottom: 1px solid var(--line); }
.admin-section-heading { display: grid; grid-template-columns: 1fr .7fr; gap: 40px; align-items: end; margin-bottom: 38px; }
.admin-section-heading > div { display: flex; gap: 12px; align-items: baseline; }
.admin-section-heading span { color: var(--terracotta); font-size: .75rem; font-weight: 600; letter-spacing: .1em; }
.admin-section-heading h2 { font-size: clamp(2.3rem,4vw,4rem); }
.admin-section-heading p { max-width: 440px; justify-self: end; margin: 0; }
.admin-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); gap: clamp(35px,6vw,85px); align-items: start; }
.admin-form { display: grid; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.admin-form h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 1.55rem; font-weight: 500; }
.admin-form textarea { resize: vertical; }
.admin-form .button { justify-self: start; }
.order-status-form { max-width: 760px; }
.order-status-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 8px; }
.order-status-heading h3 { margin-bottom: 2px; }
.order-status-heading p { margin: 0; color: rgba(40,35,31,.68); font-size: .8rem; }
.order-status-toggle { display: inline-flex; flex: 0 0 auto; gap: 9px; align-items: center; cursor: pointer; }
.order-status-toggle input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.order-status-toggle span { position: relative; width: 48px; height: 27px; border: 1px solid rgba(40,35,31,.28); border-radius: 999px; background: #d5cec3; transition: background .2s; }
.order-status-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(40,35,31,.22); transition: transform .2s; }
.order-status-toggle input:checked + span { background: #58775d; }
.order-status-toggle input:checked + span::after { transform: translateX(21px); }
.order-status-toggle input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 3px; }
.order-status-toggle strong { min-width: 50px; font-size: .8rem; }
.order-status-form.is-paused { border-color: rgba(201,103,76,.65); }
.order-status-form textarea:disabled { background: rgba(255,255,255,.45); color: rgba(40,35,31,.45); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 7px; }
.cancel-edit, .edit-button { padding: 8px 12px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font-size: .78rem; font-weight: 600; }
.field-hint { margin: -4px 0 2px; color: rgba(40,35,31,.62); font-size: .74rem; }
.preview-fields { display: grid; gap: 8px; margin: 14px -8px 4px; padding: 16px; border: 1px solid rgba(85,124,133,.3); border-radius: 7px; background: rgba(85,124,133,.07); }
.preview-fields h4 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.preview-fields h4 span { font-family: var(--sans); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.preview-fields > p { margin: 0 0 3px; color: rgba(40,35,31,.68); font-size: .76rem; }
.field-help { margin: -7px 0 4px; color: rgba(40,35,31,.68); font-size: .76rem; }
.preview-fields > label, .position-fields label { font-size: .78rem; font-weight: 600; }
.position-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.position-fields label { display: grid; gap: 3px; }
.inline-check { display: flex !important; gap: 8px; align-items: center; }
.inline-check input { width: 17px; min-height: 17px; }
.admin-form fieldset { margin: 8px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.admin-form legend { padding: 0 5px; font-size: .83rem; font-weight: 600; }
.compatibility-options { display: grid; gap: 6px; }
.compatibility-options label { display: flex; gap: 8px; align-items: center; font-size: .84rem; }
.compatibility-options input { width: 17px; min-height: 17px; }
.compatibility-options label.is-disabled, .availability-checkboxes label.is-disabled { opacity: .42; }
.admin-message { min-height: 22px; margin: 2px 0 0; color: #9b3e2c; font-size: .8rem; }
.orders-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: -12px 0 18px; }
.orders-toolbar p { margin: 0; color: rgba(40,35,31,.65); font-size: .82rem; }
.orders-toolbar p.is-warning { color: #8a3526; font-weight: 600; }
.order-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.order-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.order-card-heading { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.order-card-heading h3 { margin: 4px 0 2px; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.order-card-heading time { display: block; color: rgba(40,35,31,.6); font-size: .75rem; }
.paid-badge { display: inline-block; padding: 3px 7px; border-radius: 999px; background: rgba(55,97,63,.12); color: #37613f; font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.test-badge { background: rgba(217,169,40,.14); color: #755a12; }
.order-total { white-space: nowrap; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.order-details { margin: 0; }
.order-details div { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 14px; padding: 9px 0; }
.order-details div + div { border-top: 1px solid var(--line); }
.order-details dt { color: rgba(40,35,31,.62); font-size: .76rem; }
.order-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; font-size: .8rem; font-weight: 600; }
.retry-alert-button { margin-top: 14px; }
.admin-list { display: grid; gap: 12px; }
.admin-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin-item.no-image { grid-template-columns: 1fr auto; }
.admin-item > img { display: block; width: 72px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: #e9e0d2; }
.admin-item h3 { margin: 2px 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; line-height: 1.2; }
.admin-item p { margin: 3px 0 0; color: rgba(40,35,31,.68); font-size: .8rem; }
.item-price { color: var(--ink) !important; font-weight: 600; }
.admin-swatch { display: inline-block; width: 24px; height: 24px; margin: 0 8px 0 0; border: 1px solid var(--line); border-radius: 50%; vertical-align: middle; }
.delete-button { padding: 7px 11px; border: 1px solid #a54532; border-radius: 999px; background: transparent; color: #8a3526; cursor: pointer; font-size: .76rem; font-weight: 600; }
.item-actions { display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
.availability-editor { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
.availability-editor summary { cursor: pointer; font-size: .8rem; font-weight: 600; }
.availability-form { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 12px; }
.availability-checkboxes { display: flex; flex: 1 1 320px; flex-wrap: wrap; gap: 8px 16px; }
.availability-form label { display: flex; gap: 6px; align-items: center; font-size: .8rem; }
.availability-form button { padding: 6px 10px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; cursor: pointer; font-size: .75rem; font-weight: 600; }
.empty-admin-list { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: rgba(40,35,31,.65); }

@media (max-width: 850px) {
  .admin-section-heading, .admin-layout { grid-template-columns: 1fr; }
  .admin-section-heading p { justify-self: start; }
  .order-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .admin-main { width: min(100% - 28px,1280px); }
  .dashboard-heading { flex-direction: column; }
  .order-status-heading { align-items: flex-start; flex-direction: column; }
  .orders-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-item, .admin-item.no-image { grid-template-columns: 58px 1fr; }
  .admin-item.no-image > div:first-child { grid-column: 1 / -1; }
  .admin-item > img { width: 58px; }
  .item-actions { grid-column: 2; justify-self: start; flex-direction: row; }
}
