:root {
  color-scheme: dark;
  --ink: #ececec;
  --muted: #ababab;
  --line: #393939;
  --paper: #212121;
  --surface: #2a2a2a;
  --field: #303030;
  --error: #ffb4ab;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #71ffa9;
  outline-offset: 4px;
}
.header {
  min-height: 76px;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; flex-shrink: 0; align-items: center; text-decoration: none; }
.brand img { display: block; width: 130px; height: 39px; }
.account { display: flex; align-items: center; gap: 24px; font-size: 14px; min-width: 0; }
.account > span { overflow-wrap: anywhere; }
.account small { display: block; color: var(--muted); font-size: 13px; }
.account form { margin: 0; }
.shell { max-width: 1120px; margin: 0 auto; padding: 12px 32px 48px; min-height: calc(100svh - 76px); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.7px; margin-bottom: 12px; font-weight: 600; overflow-wrap: anywhere; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 24px; }
h3 { font-size: 16px; font-weight: 550; margin-bottom: 5px; }
.muted, .help { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px 0; }
.page-heading p, .page-heading h1:last-child { margin-bottom: 0; }
.count { margin-left: 8px; font-size: 22px; color: var(--muted); font-weight: 400; }
.button {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 550;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.button:active { transform: scale(.98); }
.primary { background: #ececec; color: #202020; }
.primary:hover { background: #fff; }
.secondary { background: transparent; border-color: #555; color: var(--ink); }
.secondary:hover, .quiet:hover { background: #333; }
.quiet { color: var(--muted); background: transparent; }
.panel { background: transparent; border: 0; }
.filters { padding: 0 0 24px; display: flex; align-items: end; gap: 14px; border-bottom: 1px solid var(--line); }
.field { margin-bottom: 24px; min-width: 0; }
.filters .field { margin: 0; flex: 1; }
.filters .search-field { flex: 2; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 9px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid transparent; border-radius: 12px;
  padding: 12px 14px; background: var(--field); color: var(--ink); min-height: 48px;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #505050; }
.field input::placeholder, .field textarea::placeholder { color: #a5a5a5; opacity: 1; }
.field textarea { resize: vertical; }
.field input:disabled, .field textarea:disabled { background: #262626; color: var(--muted); }
.help { font-size: 14px; margin: 8px 0 0; }
.required { color: var(--muted); }
.reset { font-size: 14px; padding: 12px 0; }
.result-heading { margin: 24px 0 10px; font-size: 14px; }
.order-list { overflow: hidden; }
.order-row {
  display: grid; grid-template-columns: 124px minmax(160px, 1.4fr) minmax(145px, 1fr) minmax(110px, .6fr);
  align-items: center; gap: 20px; padding: 24px 14px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere;
  transition: background-color 180ms ease; border-radius: 12px;
}
.order-row:last-child { border-bottom-color: transparent; }
.order-row:hover { background: var(--surface); }
.order-row p { margin: 0; font-size: 14px; }
.order-customer p { color: var(--muted); }
.order-id strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.row-label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 5px; }
.badge { font-size: 14px; display: inline-flex; color: #c8c8c8; }
.badge.cancelled { color: var(--muted); }
.empty { padding: 90px 16px; text-align: center; }
.empty h2 { font-size: 22px; margin-bottom: 12px; }
.empty p { max-width: 400px; margin: 0 auto 24px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 24px; }
.back { display: inline-block; margin-top: 24px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.editor-columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); gap: 48px; }
.form-section { padding: 24px 0; margin-bottom: 12px; border-top: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-hint { font-size: 14px; color: var(--muted); margin-top: -12px; margin-bottom: 24px; }
.save-bar {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 20px 0; border-top: 1px solid var(--line); background: var(--paper);
}
.save-bar > span { font-size: 14px; color: var(--muted); }
.save-bar > div { display: flex; gap: 12px; }
.notice { margin-top: 24px; padding: 14px 18px; border-radius: 12px; overflow-wrap: anywhere; background: var(--surface); }
.success { border-left: 2px solid #71ffa9; }
.error { background: #382929; border: 1px solid #68423d; color: var(--error); }
.errorlist { list-style: none; padding: 0; margin: 8px 0 16px; color: var(--error); font-size: 14px; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--error); }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; margin: 0; }
.details > div { min-width: 0; }
.details dt { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.wide { grid-column: 1 / -1; }
.single { grid-template-columns: 1fr; }
.inline { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.source-text { overflow-wrap: anywhere; line-height: 1.8; }
.clarify ul { padding-left: 20px; font-size: 14px; margin: 0 0 20px; color: var(--muted); }
.clarify li { margin-bottom: 8px; }
.login-layout { min-height: calc(100svh - 180px); display: grid; place-items: center; padding: 40px 0; }
.login-panel { width: 100%; max-width: 360px; }
.login-panel h1, .login-panel > p { text-align: center; }
.login-panel form { margin-top: 32px; }
.login-panel .small { margin: 24px 0 0; }
.full { width: 100%; margin-top: 4px; }
.demo-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap;
  margin: 0 32px; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: #1f3a2a; color: #d6ffe4;
}
.demo-bar a { color: #71ffa9; }
.demo-start .small { margin: 14px 0 0; text-align: center; }
.demo-login { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
.demo-login summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; }
.demo-login form { margin-top: 20px; }
@media (max-width: 740px) { .demo-bar { margin: 0 20px; } }
.skip { position: absolute; top: -100px; left: 10px; z-index: 5; background: var(--paper); padding: 12px; }
.skip:focus { top: 10px; }
/* Animate once on navigation; text is sharp while reading and editing. */
@keyframes page-enter {
  from { opacity: 0; filter: blur(5px); transform: translateY(6px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .shell { animation: page-enter 360ms cubic-bezier(.2, .65, .3, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 960px) {
  .filters { flex-wrap: wrap; }
  .filters .search-field { flex-basis: 100%; }
  .editor-columns { gap: 28px; }
  .order-row { gap: 14px; grid-template-columns: 100px 1.2fr 1fr 90px; }
}
@media (max-width: 740px) {
  .header { padding: 14px 20px; gap: 12px; flex-wrap: wrap; }
  .brand img { width: 112px; height: 34px; }
  .account { gap: 8px; }
  .account > span { max-width: 140px; }
  .account .button { padding-inline: 12px; }
  .shell { padding: 8px 20px 32px; }
  h1 { font-size: 26px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; padding: 24px 0; gap: 20px; }
  .filters { gap: 12px; }
  .filters .field { flex-basis: calc(50% - 12px); }
  .filters .search-field { flex-basis: 100%; }
  .filters .button { flex: 1; }
  .order-row { grid-template-columns: 1fr 1fr; padding: 20px 0; gap: 16px; border-radius: 0; }
  .order-id { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; }
  .order-id strong { margin: 0; }
  .order-customer { grid-column: 1 / -1; }
  .editor-columns { grid-template-columns: 1fr; gap: 0; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .details { gap: 24px 14px; }
  .save-bar { flex-direction: column; align-items: stretch; }
  .save-bar > div { justify-content: space-between; }
  .empty { padding: 64px 8px; }
}
