:root {
  color-scheme: light;
  --ink: #171838;
  --muted: #605971;
  --paper: #fcf7f0;
  --card: #fffdf9;
  --line: #e8ded6;
  --accent: #3f3d81;
  --accent-light: #eeedf8;
  --danger: #962e45;
  --success: #24664f;
  font: 100% 'DM Sans', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: var(--accent); text-underline-offset: .2em; }
h1,h2,h3,p { margin: 0; }
h1 { margin-top: .15em; font-size: clamp(2.05rem,5vw,3.45rem); line-height: 1.05; letter-spacing: -.06em; }
h2 { font-size: 1.5rem; letter-spacing: -.035em; }
h3 { font-size: 1.03rem; }
p { line-height: 1.5; }
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem max(1.2rem, calc((100vw - 1140px) / 2));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header > a:last-child { font-size: .9rem; }
.brand { text-decoration: none; color: var(--ink); letter-spacing: .13em; font-weight: 950; font-size: 1.4rem; }
.brand span { color: #9f5070; }
main { max-width: 1190px; padding: clamp(1.1rem,4vw,2.5rem); margin-inline: auto; }
.page-title,.section-heading,.dataset-tools,.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.page-title { align-items: flex-end; margin-bottom: 1.55rem; }
.section-label { color: var(--accent); font-size: .78rem; font-weight: 850; letter-spacing: .13em; }
#identity { display: flex; flex-wrap: wrap; gap: .35rem 1rem; justify-content: flex-end; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.tabs { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.55rem; border-bottom: 1px solid var(--line); }
button,.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  padding: .5rem .8rem;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 750;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
button:hover:not(:disabled),.button:hover { filter: brightness(.92); }
.tabs button { background: transparent; color: var(--muted); margin-bottom: .45rem; }
.tabs button[aria-pressed="true"],.secondary { background: var(--accent-light); color: var(--accent); }
.danger { background: #fceef0; color: var(--danger); }
:focus-visible { outline: 3px solid #6f65b4; outline-offset: 3px; }
.panel,.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .95rem;
  box-shadow: 0 .4rem 1.6rem #24112e09;
}
.panel { padding: clamp(1rem,3vw,1.5rem); margin: 1rem 0; }
#access { max-width: 36rem; display: grid; justify-items: start; gap: .7rem; }
form.panel { display: grid; gap: .9rem; justify-items: start; }
form.panel > *:not(button) { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem 1.1rem; }
.fields .full { grid-column: 1 / -1; }
label { display: grid; min-width: 0; gap: .35rem; font-weight: 750; font-size: .84rem; }
input,select {
  width: 100%;
  min-width: 0;
  padding: .58rem .62rem;
  background: #fff;
  border: 1px solid #d8cfc8;
  border-radius: .63rem;
  color: var(--ink);
  font: inherit;
  font-weight: 450;
}
.items { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .7rem; padding: .8rem; }
.items legend { font-size: .84rem; padding-inline: .25rem; font-weight: 750; }
.item-row { display: grid; grid-template-columns: minmax(0,1fr) 6rem auto; align-items: end; gap: .6rem; margin-bottom: .7rem; }
.item-row button { min-height: 2.2rem; }
#order-total { font-weight: 800; font-size: 1.05rem; }
.muted,.empty { color: var(--muted); font-size: .86rem; }
.dataset { padding: 0; overflow: hidden; }
.dataset-tools { padding: 1rem 1.2rem; background: var(--card); }
.dataset-tools h3:not(:last-child) { margin-bottom: .55rem; }
.search-fields { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; }
.search-fields input { min-width: min(13rem, 100%); }
.table-scroll { overflow: auto; }
.table-scroll:focus-visible { outline-offset: -4px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
th,td { padding: .78rem 1.2rem; border-top: 1px solid var(--line); }
th { color: var(--muted); background: #f8f0e8; font-size: .79rem; white-space: nowrap; }
td { overflow-wrap: anywhere; }
td small { display: block; color: var(--muted); margin-top: .17rem; }
.status-editor { display: flex; gap: .45rem; align-items: center; min-width: 14rem; }
.status-editor button { min-height: 2.2rem; }
.empty { padding: 1rem 1.2rem; }
.notice { padding: .72rem .9rem; margin-bottom: 1rem; color: var(--success); }
.notice.error { color: var(--danger); border-color: #efc8cc; }
td .positive { color: var(--success); }
td .negative { color: var(--danger); }
@media (max-width: 600px) {
  .page-title { align-items: flex-start; flex-direction: column; gap: .65rem; }
  #identity { justify-content: flex-start; }
  .fields { grid-template-columns: 1fr; }
  .dataset-tools { align-items: end; }
  .item-row { grid-template-columns: minmax(0,1fr) auto; }
  .item-row label:first-child { grid-column: 1 / -1; }
  th,td { padding-inline: .8rem; }
}

.order-details { margin-top: .6rem; color: var(--muted); font-size: .82rem; }
.order-details summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.order-details p,.order-details ul { margin: .35rem 0 0; }
.order-details ul { padding-left: 1.1rem; }
