:root {
  color-scheme: light;
  --navy: #111c32;
  --canvas: #eef3f8;
  --white: #fff;
  --ink: #16243c;
  --muted: #52647c;
  --line: #dce5ef;
  --soft: #f6f9fc;
  --blue: #1a56db;
  --blue-dark: #1647b6;
  --blue-soft: #eaf1ff;
  --teal: #0a6256;
  --teal-soft: #e5f6f0;
  --amber: #864a05;
  --amber-soft: #fff2db;
  --red: #a4263a;
  --red-soft: #fcecef;
  --radius: 12px;
  font-family: Inter, Geist, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 300px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2d6be8; outline-offset: 3px; }
a { color: var(--blue-dark); text-underline-offset: .2em; }
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  gap: 28px;
  padding: 25px 15px 18px;
  background: var(--navy);
  color: #eef5ff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0 8px;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #79a7ff;
  border-radius: 9px;
  background: #235fd7;
  color: var(--white);
  font-size: 17px;
  font-weight: 800;
}

.brand-icon svg, .nav-button svg { width: 18px; height: 18px; flex-shrink: 0; }
.brand-name { display: block; font-size: 16px; font-weight: 750; letter-spacing: .015em; }
.brand-sub { display: block; color: #a7bad8; font-size: 11px; line-height: 1.4; }

.side-nav { display: grid; align-content: start; gap: 5px; }

.nav-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c6d5eb;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.nav-button:hover { background: #1e2c46; color: #fff; }
.nav-button[aria-current="page"], .nav-button[aria-selected="true"] {
  border-color: #334b75;
  background: #263c60;
  color: #fff;
  font-weight: 700;
}
.nav-button:focus-visible, .brand:focus-visible { outline-color: #b5d1ff; }

.side-footer {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid #34435d;
  color: #a7bad8;
  font-size: 12px;
}

.workspace { min-width: 0; }

.topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(20px, 3.8vw, 46px);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.topbar-title { font-size: 14px; font-weight: 750; }
.topbar-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid #c8d8f3;
  border-radius: 100px;
  background: #f2f6ff;
  color: #22498c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.demo-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.main {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 32px clamp(20px, 3.8vw, 46px) 48px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 20px;
}

.page-heading p { margin: 5px 0 0; }
.eyebrow { color: var(--blue-dark); font-size: 12px; font-weight: 700; }
.page-title {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.muted, .hint { color: var(--muted); }
.hint { margin: 0; font-size: 12px; }

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid #cbd8e7;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.btn:not(:disabled):hover { border-color: #9db2ca; background: var(--soft); }
.btn.primary { border-color: var(--blue); background: var(--blue); color: var(--white); }
.btn.primary:not(:disabled):hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.btn.subtle { border-color: #c8d7ef; background: #f2f6ff; color: #1a4aac; }
.btn.subtle:not(:disabled):hover { border-color: #adc3e8; background: var(--blue-soft); }
.btn.danger { border-color: #e8bbc2; background: #fff8f8; color: var(--red); }
.btn.danger:not(:disabled):hover { border-color: #d69ba5; background: var(--red-soft); }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-heading > .button-row { flex: 0 0 auto; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 11px;
  margin: 0 0 20px;
}

.metric {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.metric-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-value {
  color: var(--ink);
  font-size: clamp(22px, 2.5vw, 28px);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 2px 4px #132d5010;
}

.panel-head {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 9px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title, .section-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 750; }
.panel-body { padding: 16px; }

.order-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 2.25fr);
  gap: 15px;
}

.order-list, .order-detail { min-width: 0; }
.order-list > .order-item { width: calc(100% - 16px); margin: 4px 8px; }
.order-list > .order-item:last-child { margin-bottom: 8px; }
.order-detail .panel-head > div { flex: 1 1 0; min-width: 0; }
.order-detail .panel-body > .button-row { margin-top: 12px; }

.order-item {
  display: grid;
  width: 100%;
  min-height: 64px;
  align-content: center;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.order-item:hover { background: var(--soft); }
.order-item[aria-pressed="true"] { border-color: #bed0f1; background: #eef4ff; }
.order-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-weight: 750; overflow-wrap: anywhere; }
.order-meta, .order-id { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.order-id { font-variant-numeric: tabular-nums; }
.empty { margin: 0; padding: 25px 14px; color: var(--muted); text-align: center; }
.empty p { margin: 0; }
.empty .btn { margin-top: 11px; }

.pill {
  display: inline-flex;
  min-height: 25px;
  width: max-content;
  max-width: 100%;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: #edf1f5;
  color: #526174;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.pill.open { background: var(--blue-soft); color: #204d9f; }
.pill.assigned { background: #eaefff; color: #3d4c9b; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.settled, .pill.paid { background: var(--teal-soft); color: var(--teal); }
.pill.refunded, .pill.rejected { background: var(--red-soft); color: var(--red); }

.steps {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  counter-reset: dispatch-step;
  margin: 0;
  padding: 11px 0 15px;
  list-style: none;
}

.step {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  counter-increment: dispatch-step;
  padding: 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.step::before {
  z-index: 1;
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid #d0dbe8;
  border-radius: 50%;
  background: var(--soft);
  color: #4b617d;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  content: counter(dispatch-step);
}

.step + .step::after {
  position: absolute;
  top: 12px;
  right: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 1px;
  background: #d6e1ed;
  content: "";
}

.step.complete { color: var(--teal); }
.step.complete::before { border-color: #a4d7c9; background: var(--teal-soft); color: var(--teal); }
.step.complete::after, .step.current::after { background: #8eaee4; }
.step.current { color: var(--blue-dark); font-weight: 750; }
.step.current::before {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.detail {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: var(--soft);
}

.detail-label { display: block; margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.detail-value { display: block; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.section { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-title { margin-bottom: 9px; }
.section > p { margin: 0 0 9px; }
.section > .button-row { margin-top: 8px; }

.auditions { display: grid; gap: 6px; }

.audition {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audition-name { flex: 1 1 75px; font-weight: 700; }
.audition audio { width: min(215px, 100%); height: 33px; }

.money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(105px, 100%), 1fr));
  gap: 7px;
}

.money-item {
  min-width: 0;
  padding: 8px 10px;
  border-left: 2px solid #a1baf0;
  border-radius: 0 7px 7px 0;
  background: #f2f6ff;
  color: var(--muted);
  font-size: 12px;
}

.money-item strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
td { color: var(--ink); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

.dialog, dialog {
  width: min(580px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 54px #15294840;
  overflow-y: auto;
}

dialog::backdrop { background: #101d36a6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 18px; }
dialog form { padding: 16px 18px; }
dialog form > .dialog-head { margin: -16px -18px 14px; }
dialog form > .button-row { justify-content: flex-end; margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field { display: grid; align-content: start; gap: 4px; color: var(--ink); font-weight: 650; }
.form-field .hint { font-weight: 400; }
.form-field[hidden] { display: none; }
.form-grid[hidden] { display: none; }
.full { grid-column: 1 / -1; }

input, select, textarea {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid #c6d3e4;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-weight: 400;
}

textarea { min-height: 70px; resize: vertical; }
.form-error { margin: 8px 0 0; color: var(--red); font-weight: 650; }
.form-error:empty { display: none; }

.demo-auditions { margin-top: 9px; }
.demo-auditions summary { color: var(--blue-dark); cursor: pointer; }
.demo-auditions .button-row { margin-top: 8px; }
.share-links { display: grid; gap: 12px; }
.share-links p { margin: 0; }
.nav-link { text-decoration: none; }
.nav-button[hidden] { display: none; }
.team-pick { display: inline-flex; align-items: center; gap: 5px; }
.team-pick input { min-height: 0; }
.team-split { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.portal-feedback-form + .portal-feedback-form, .auditions + .portal-feedback-form { margin-top: 14px; }
.portal-feedback-form textarea { min-height: 55px; }
.staff-login { width: min(100%, 460px); margin-inline: auto; }
.staff-audit { margin-top: 14px; }
.share-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.share-link a { text-decoration: none; }
.share-link .btn { min-height: 40px; }
@media (max-width: 440px) {
  .share-link { grid-template-columns: minmax(0, 1fr); }
  .share-link + .share-link { padding-top: 10px; border-top: 1px solid var(--line); }
}

.notice {
  position: fixed;
  z-index: 5;
  right: clamp(12px, 3vw, 30px);
  bottom: clamp(12px, 3vw, 26px);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 15px;
  border: 1px solid #324867;
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 18px #15294840;
  overflow-wrap: anywhere;
}

.notice:empty { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 178px minmax(0, 1fr); }
  .order-layout { grid-template-columns: minmax(178px, .85fr) minmax(0, 2fr); }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: 0; gap: 10px; padding: 11px 13px; }
  .brand { padding: 0; }
  .brand-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .nav-button { min-height: 39px; padding: 6px 10px; }
  .side-footer { display: none; }
  .topbar { min-height: 49px; padding-inline: 14px; }
  .main { padding: 20px 14px 36px; }
}

@media (max-width: 600px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 10px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading > .button-row { flex-basis: auto; }
  .panel-head { flex-wrap: wrap; padding: 10px 12px; }
  .panel-body { padding: 12px; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { gap: 8px; }
  .form-field:has(input[type="datetime-local"]) { grid-column: 1 / -1; }
  .btn { min-height: 42px; }
  .btn.small { min-height: 39px; }
}

@media (max-width: 360px) {
  .topbar-meta { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
