:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #10151b;
  color: #f2f4f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.6;
}
header,
main {
  max-width: 760px;
  margin: auto;
  padding: 1.5rem;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
header > a {
  font-size: 1.5rem;
  font-weight: 700;
}
a {
  color: #9fcaff;
}
h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}
h2 {
  font-size: 1.2rem;
}
fieldset {
  border: 1px solid #617084;
  border-radius: 0.5rem;
  padding: 1.2rem;
}
label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
input,
select,
button {
  font: inherit;
  color: inherit;
  border: 1px solid #7f8fa4;
  border-radius: 0.35rem;
  padding: 0.65rem;
  background: #1c2734;
  min-height: 44px;
  max-width: 100%;
}
input,
select {
  width: 100%;
}
button {
  cursor: pointer;
  margin: 0.2rem;
}
button:hover {
  background: #30465e;
}
button:disabled,
fieldset:disabled {
  opacity: 0.6;
  cursor: default;
}
:focus-visible {
  outline: 3px solid #a6dcff;
  outline-offset: 3px;
}
.consent {
  display: flex;
  align-items: start;
}
.consent input {
  width: 1.3rem;
  flex: 0 0 1.3rem;
  margin-top: 0.2rem;
  min-height: 1.3rem;
}
.detail {
  border-bottom: 1px solid #49576a;
  padding: 0.75rem 0;
  overflow-wrap: anywhere;
}
dt {
  color: #b9c8dc;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#orderData dd {
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}
#orderData dt {
  font-weight: 600;
}
textarea {
  font: inherit;
  width: 100%;
  min-height: 5rem;
  color: inherit;
  background: #1c2734;
  border: 1px solid #7f8fa4;
  border-radius: 0.35rem;
  padding: 0.65rem;
}
.warning {
  color: #ffe49c;
  border: 2px solid #ffe49c;
  padding: 1rem;
}
[hidden] {
  display: none !important;
}
canvas {
  max-width: 100%;
  margin-top: 1rem;
}
#message {
  min-height: 1.6em;
}
.is-active {
  border-color: #b6e1ff;
  background: #30465e;
}

/* Administrator layout: customer checkout keeps its existing compact width. */
.admin-page > header,
.admin-page > main {
  max-width: 1600px;
  padding: 1rem;
}
.admin-page {
  line-height: 1.4;
}
.admin-page h1 {
  font-size: 1.65rem;
  margin: 0 0 0.5rem;
}
.admin-page #message:empty {
  display: none;
}
.admin-page fieldset {
  padding: 0.75rem;
}
.admin-page input,
.admin-page select,
.admin-page button,
.admin-page textarea {
  padding: 0.4rem 0.55rem;
}
.admin-page label {
  gap: 0.2rem;
  margin-bottom: 0.6rem;
}
@media (pointer: fine) {
  .admin-page input,
  .admin-page select,
  .admin-page button {
    min-height: 34px;
  }
}
.field-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.35rem;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #91abc4;
}
.order-status {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border: 1px solid #596470;
  border-radius: 0.35rem;
  background: #252c34;
  color: #c1c7ce;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.025em;
  vertical-align: middle;
}
.order-status[data-status='AWAITING_PAYMENT'] {
  color: #b7e6ff;
  background: #18364b;
  border-color: #497c9e;
}
.order-status[data-status='PAID'] {
  color: #ffe49c;
  background: #3d3319;
  border-color: #8f793a;
}
.order-status[data-status='SHIPPED'] {
  color: #a8efc0;
  background: #163b2a;
  border-color: #3e815b;
}
.order-status[data-status='CANCELLED'] {
  color: #c1c7ce;
  background: #252c34;
  border-color: #596470;
}
.admin-split {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin-top: 0.75rem;
}
.order-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
  padding: 0.75rem;
  background: #151e28;
  border: 1px solid #34465a;
  border-radius: 0.8rem;
}
.order-sidebar,
.order-detail-pane {
  min-width: 0;
}
.queue-heading,
.order-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.queue-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}
.queue-heading > span,
.queue-status,
.order-pagination > span {
  color: #a5b8cf;
  font-size: 0.8rem;
}
.queue-status {
  margin: 0.5rem 0;
}
.order-sidebar #filters fieldset {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
}
.order-sidebar #filters label {
  font-size: 0.8rem;
}
.order-sidebar #filters input,
.order-sidebar #filters select {
  min-width: 0;
}
.order-sidebar #filters label:has([name='searchValue']),
.order-sidebar #filters label:has([type='datetime-local']),
.order-sidebar #filters button {
  grid-column: 1 / -1;
}
.order-pagination {
  border-top: 1px solid #34465a;
  padding-top: 0.75rem;
  flex-shrink: 0;
}
.order-pagination button {
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
}
.detail-placeholder {
  border: 1px dashed #34465a;
  border-radius: 0.8rem;
  padding: 3rem 2rem;
  text-align: center;
  color: #a5b8cf;
}
.detail-placeholder h2 {
  color: #f2f4f7;
}
.admin-page #filters fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.admin-page #filters label {
  margin: 0;
}
.admin-page #filters button {
  align-self: end;
}
.admin-page #orders {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  min-height: 100px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.admin-page #orders button {
  width: 100%;
  margin: 0.25rem 0;
  text-align: left;
  overflow-wrap: anywhere;
  padding: 0.55rem 0.65rem;
  border: 1px solid #34465a;
  background: #101923;
  color: #f2f4f7;
}
.admin-page #orders button:hover {
  background: #1c3041;
}
.admin-page #orders button[aria-current='true'] {
  border-color: #8ac9fc;
  box-shadow: inset 3px 0 #8ac9fc;
  background: #1c3041;
}
.queue-customer {
  display: block;
  margin: 0.15rem 0 0.3rem;
  color: #c7d4e4;
  font-size: 0.9rem;
}
.queue-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #a5b8cf;
}
.admin-page #detail {
  margin: 0;
}
.order-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.order-heading h2 {
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: #9ec4e9;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0;
}
.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.order-card--wide {
  grid-column: 1 / -1;
}
.order-card {
  min-width: 0;
  border: 1px solid #34465a;
  background: #151e28;
  border-radius: 0.8rem;
  overflow: hidden;
}
.order-card h3,
.activity-card h3,
.order-technical > summary {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #34465a;
  background: #1a2633;
  font-weight: 700;
}
.order-fields {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9rem;
}
.order-fields th,
.order-fields td {
  padding: 0.4rem 0.7rem;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #293748;
  overflow-wrap: anywhere;
}
.order-fields th {
  width: 37%;
  color: #b3c3d6;
  font-weight: 500;
}
.order-fields td {
  white-space: pre-wrap;
}
.order-fields tr:last-child > * {
  border-bottom: 0;
}
.order-summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 0.65rem;
  padding: 0.75rem;
  background: #182c3c;
  border: 1px solid #3a617d;
  border-radius: 0.8rem;
}
.order-summary > div {
  min-width: 0;
}
.summary-label {
  display: block;
  color: #b3c3d6;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.summary-value {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  letter-spacing: 0.02em;
}
.order-summary > div:first-child .summary-value {
  font-size: 1.3rem;
  color: #b7e6ff;
  font-variant-numeric: tabular-nums;
}
.order-table-scroll {
  overflow-x: auto;
}
.order-items {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.9rem;
}
.order-items caption {
  text-align: left;
  padding: 0.45rem 0.7rem;
  color: #b3c3d6;
  font-size: 0.8rem;
}
.order-items th,
.order-items td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #34465a;
  vertical-align: top;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-items th:first-child {
  text-align: left;
}
.order-items thead th {
  color: #b3c3d6;
  font-weight: 500;
  font-size: 0.8rem;
  background: #101923;
}
.order-items tbody th {
  font-weight: 500;
  overflow-wrap: anywhere;
  max-width: 350px;
}
.order-items td {
  white-space: nowrap;
}
.item-sku {
  display: block;
  margin-top: 0.25rem;
  color: #a5b8cf;
  font-weight: 400;
}
.order-items tfoot {
  background: #1c3041;
  font-weight: 700;
}
.order-items tfoot th,
.order-items tfoot td {
  border-bottom: 0;
}
.order-technical {
  min-width: 0;
  border: 1px solid #34465a;
  border-radius: 0.8rem;
}
.order-technical > summary {
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  color: inherit;
  min-height: 44px;
  border-radius: 1rem;
}
.order-technical[open] > summary {
  border-radius: 1rem 1rem 0 0;
}
.order-technical .order-card {
  border: 0;
}
.admin-page #payment,
.admin-page #cancel,
.admin-page #shipment,
.admin-page #documents {
  margin: 0.65rem 0;
}
.admin-page #payment fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.65rem;
}
.admin-page #payment label {
  margin-bottom: 0;
}
.admin-page #payment label:has(textarea) {
  grid-column: 1 / -1;
}
.admin-page #payment button {
  justify-self: start;
}
.admin-page #documents {
  border: 1px solid #34465a;
  border-radius: 0.8rem;
  padding: 0.75rem;
  background: #151e28;
}
.admin-page #documents h3 {
  margin-top: 0;
}
.admin-page #notifications,
.admin-page #audit {
  padding-left: 1.25rem;
}
.admin-page #notifications li,
.admin-page #audit li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #293748;
  overflow-wrap: anywhere;
}
@media (max-width: 1000px) {
  .admin-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .order-sidebar {
    position: static;
    max-height: none;
  }
  .admin-page #orders {
    max-height: 24rem;
  }
}
@media (min-width: 1001px) and (max-height: 760px) {
  .order-sidebar {
    position: static;
    max-height: none;
  }
  .admin-page #orders {
    max-height: 24rem;
  }
}
@media (max-width: 700px) {
  .admin-page > main,
  .admin-page > header {
    padding: 1rem;
  }
  .order-grid,
  .admin-page #filters fieldset,
  .admin-page #payment fieldset {
    grid-template-columns: minmax(0, 1fr);
  }
  .order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .order-fields th,
  .order-fields td {
    padding: 0.4rem 0.6rem;
  }
}
.admin-page .session-warning {
  position: sticky;
  top: 0.5rem;
  z-index: 10;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #d6a54b;
  border-radius: 0.75rem;
  background: #30291c;
  color: #fff1cf;
}

/* Filled, elevated surfaces for checkout and administration only. */
:is(.checkout-page, .admin-page) {
  --surface: #1b2532;
  --surface-raised: #233143;
  --surface-input: #2b3a4e;
  --card-shadow: 0 3px 12px #00000026, 0 1px 3px #00000033;
  background: #111923;
}
:is(.checkout-page, .admin-page) :is(input, select, textarea) {
  background: var(--surface-input);
  border: 0;
  border-radius: 0.6rem;
  box-shadow: inset 0 -1px #8ca3bc;
  accent-color: #acd7ff;
}
:is(.checkout-page, .admin-page) :is(input, select, textarea):focus {
  background: #30425a;
  box-shadow: inset 0 -2px #acd7ff;
}
:is(.checkout-page, .admin-page) input[type='checkbox'] {
  box-shadow: none;
}
:is(.checkout-page, .admin-page) button {
  border: 0;
  border-radius: 1.25rem;
  background: #304861;
  color: #deefff;
  font-weight: 600;
  padding-inline: 0.9rem;
}
:is(.checkout-page, .admin-page) button:hover:not(:disabled) {
  background: #3c5874;
}
.checkout-page #submit,
.checkout-page #cancelCheckout,
.admin-page #login,
.admin-page #filters button,
.admin-page #payment button,
.admin-page #shipment button {
  background: #acd7ff;
  color: #102f49;
  box-shadow: 0 2px 6px #00000033;
}
.checkout-page #submit:hover:not(:disabled),
.checkout-page #cancelCheckout:hover:not(:disabled),
.admin-page :is(#login, #filters button, #payment button, #shipment button):hover:not(:disabled) {
  background: #c9e5ff;
}
.admin-page #cancel button {
  background: #56343d;
  color: #ffd9df;
}
.checkout-card,
.admin-page :is(.order-sidebar, .order-card, .order-technical, .detail-placeholder, .activity-card),
.admin-page :is(#payment, #cancel, #shipment) fieldset,
.admin-page #documents {
  border: 0;
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.admin-page .order-card h3,
.admin-page .activity-card h3,
.admin-page .order-technical > summary {
  background: var(--surface-raised);
  border: 0;
}
.admin-page :is(#payment, #cancel).order-action-card fieldset {
  margin: 0;
  min-width: 0;
  padding: 0.75rem;
  border-radius: 0;
  box-shadow: none;
}
.admin-page .order-summary {
  border: 0;
  border-radius: 1rem;
  background: var(--order-surface);
  box-shadow: var(--card-shadow);
}
.admin-page .order-status {
  border: 0;
  border-radius: 0.6rem;
}
.admin-page .order-fields :is(th, td),
.admin-page .order-items :is(th, td) {
  border: 0;
}
.admin-page .order-fields tr:nth-child(even),
.admin-page .order-items tbody tr:nth-child(even) {
  background: #ffffff03;
}
.admin-page .order-items thead th,
.admin-page .order-items tfoot {
  background: var(--surface-raised);
}
.admin-page .order-technical .order-card {
  box-shadow: none;
}
.admin-page #filters fieldset {
  border: 0;
  padding: 0.5rem 0;
}
.admin-page legend {
  color: #c2d9ef;
  font-size: 0.9rem;
  font-weight: 600;
}
.admin-page #orders button {
  background: var(--order-surface);
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px #00000026;
  font-weight: 400;
}
.admin-page #orders button:hover {
  background-image: linear-gradient(var(--order-glow), var(--order-glow));
}
.admin-page #orders button[aria-current='true'] {
  background-color: var(--order-surface);
  background-image: radial-gradient(ellipse at center, var(--order-glow), transparent 100%);
  box-shadow:
    inset 0 0 0 1px var(--order-accent),
    inset 0 0 22px var(--order-glow),
    0 0 10px var(--order-glow);
}
/* Shared status surfaces keep the queue and selected order summary in sync. */
.admin-page :is(#orders button, .order-summary) {
  --order-surface: #303640;
  --order-accent: #a4adb9;
  --order-glow: #a4adb933;
}
.admin-page :is(#orders button, .order-summary)[data-status='AWAITING_PAYMENT'] {
  --order-surface: #203e53;
  --order-accent: #8ac9fc;
  --order-glow: #8ac9fc33;
}
.admin-page :is(#orders button, .order-summary)[data-status='PAID'] {
  --order-surface: #463c23;
  --order-accent: #f0ce70;
  --order-glow: #f0ce7033;
}
.admin-page :is(#orders button, .order-summary)[data-status='SHIPPED'] {
  --order-surface: #234533;
  --order-accent: #82dca3;
  --order-glow: #82dca333;
}
@media (forced-colors: active) {
  .admin-page #orders button[aria-current='true'] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
.admin-page .order-pagination {
  border-color: #ffffff10;
}
.activity-card {
  margin-top: 0.75rem;
  overflow: hidden;
}
.activity-card ul {
  margin: 0.75rem;
}
.activity-card > button {
  margin: 0 0.75rem 0.75rem;
}
.admin-page :is(#notifications, #audit) li {
  border-color: #ffffff0d;
}
.checkout-page h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.75rem;
}
.checkout-page #fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.checkout-card {
  padding: 1.1rem;
  margin-bottom: 0.9rem;
}
.checkout-card h2 {
  margin: -1.1rem -1.1rem 1rem;
  padding: 0.7rem 1.1rem;
  border-radius: 1rem 1rem 0 0;
  background: var(--surface-raised);
  font-size: 1rem;
  color: inherit;
}
.checkout-card label {
  margin: 0;
  font-size: 0.9rem;
  color: #d2e0ee;
}
.checkout-product-grid,
.checkout-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
}
.checkout-product-grid {
  grid-template-columns: minmax(0, 3fr) minmax(5rem, 1fr);
}
.checkout-full-width {
  grid-column: 1 / -1;
}
.checkout-summary {
  background: #253d52;
}
.checkout-summary p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.checkout-summary strong {
  font-size: 1.4rem;
  color: #c5e4ff;
}
.checkout-actions {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.65rem;
}
.checkout-actions button {
  margin: 0;
}
.checkout-actions #cancelCheckout {
  margin-left: auto;
}
@media (max-width: 600px) {
  .checkout-page :is(header, main) {
    padding: 1rem;
  }
  .checkout-contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (forced-colors: active) {
  :is(.checkout-page, .admin-page)
    :is(
      input,
      select,
      textarea,
      button,
      .checkout-card,
      .order-card,
      .order-sidebar,
      .order-status
    ) {
    border: 1px solid ButtonText;
  }
}
