@font-face {
  font-family: "Open Sans";
  src: url("open-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("open-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --red: #c40018;
  --red-dark: #900012;
  --ink: #191919;
  --muted: #6c6c70;
  --line: #dedee2;
  --surface: #ffffff;
  --canvas: #f3f3f4;
  --green: #1e9b60;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(24, 24, 28, 0.09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Open Sans", Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
input[type="hidden"] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  min-height: 74px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: #111;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.topbar nav { display: flex; align-self: stretch; }
.topbar nav a {
  display: flex;
  align-items: center;
  padding: 0 17px;
  color: #c9c9cd;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--red);
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 64px;
}
.hero {
  max-width: 840px;
  padding: 38px 0 54px;
}
.hero h1,
.page-heading h1 {
  margin: 8px 0 14px;
  font-size: 3.4rem;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.hero p:last-child,
.page-heading p:last-child {
  max-width: 750px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.dashboard-card {
  min-height: 285px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.dashboard-card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(24,24,28,.14); }
.dashboard-card h2 { margin: 34px 0 10px; font-size: 1.5rem; }
.dashboard-card p { margin: 0 0 24px; color: var(--muted); }
.dashboard-card .step { color: var(--red); font-weight: 700; }
.dashboard-card .card-link { margin-top: auto; font-weight: 700; }
.dashboard-card.card-dark { color: #fff; background: #191919; border-color: #191919; }
.dashboard-card.card-dark p { color: #bfc0c5; }

.panel {
  margin-bottom: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-heading,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.section-heading h2 { margin: 4px 0 0; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: 2.7rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  padding: 10px 15px;
  color: var(--ink);
  background: #f2f2f3;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.chip:hover { color: #fff; background: var(--red); }
.dev-links { display: flex; gap: 18px; flex-wrap: wrap; padding: 24px 3px; color: var(--muted); font-size: .85rem; }
.dev-links a { color: var(--ink); }

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 700;
}
.notice-success { color: #0d633d; background: #dff5e9; border: 1px solid #aadfc1; }
.notice-error { color: #7e101c; background: #fde6e9; border: 1px solid #f4b4bc; }
.error-panel { border-left: 5px solid var(--red); }
.error-panel h1 { margin: 5px 0; font-size: 1.7rem; }
.error-panel code { padding: 2px 6px; background: #eee; border-radius: 4px; }

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(160px, 260px) 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.toolbar label { font-weight: 700; }
.toolbar-note { color: var(--muted); font-size: .86rem; }
input, select {
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bfc0c5;
  border-radius: 8px;
}
input:focus, select:focus { outline: 3px solid rgba(196,0,24,.16); border-color: var(--red); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.action-cell { text-align: right; }
.button {
  min-height: 42px;
  padding: 9px 18px;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 6px 15px rgba(196,0,24,.2);
}
.button:hover { background: var(--red-dark); }
.button-secondary { color: #fff; background: #27272a; box-shadow: none; }
.button-secondary:hover { background: #000; }
.button-quiet { color: var(--ink); background: #ebebed; box-shadow: none; }
.button-quiet:hover { color: #fff; background: #55555b; }
.empty-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}
.empty-state strong { font-size: 1.25rem; }
.empty-state span, .empty-copy { color: var(--muted); }
.count-badge { padding: 7px 12px; background: #dedee2; border-radius: 999px; font-weight: 700; white-space: nowrap; }

.invoice-stack { display: grid; gap: 20px; }
.invoice-panel { margin: 0; }
.invoice-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.invoice-panel h2 { margin: 4px 0 0; font-size: 1.6rem; }
.invoice-panel h2 small { color: var(--muted); font-size: .8em; font-weight: 400; }
.invoice-meta { display: flex; gap: 28px; margin: 0; }
.invoice-meta div { display: grid; gap: 3px; }
.invoice-meta dt, .field-label { color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.invoice-meta dd { margin: 0; font-weight: 700; }
.invoice-header-tools { display: grid; justify-items: end; gap: 16px; }
.invoice-actions { min-width: 0; display: flex; align-items: flex-start; justify-content: flex-end; gap: 10px; }
.delivery-menu { position: relative; }
.delivery-toggle[aria-expanded="true"] { background: var(--red-dark); }
.delivery-options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 210px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 35px rgba(24, 24, 28, .18);
}
.delivery-options button {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 700;
  text-align: left;
}
.delivery-options button:hover,
.delivery-options button:focus { color: #fff; background: var(--red); outline: 0; }
.position-list { display: grid; }
.position-row {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(260px, 1.3fr);
  align-items: end;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.position-row:last-child { padding-bottom: 0; border-bottom: 0; }
.position-row > div, .position-row label { display: grid; gap: 4px; }
.auto-save-note { min-height: 1.2em; color: var(--muted); font-size: .76rem; }
.position-row[aria-busy="true"] { opacity: .68; }
.compact-heading { align-items: center; }
.table-section { margin-top: 20px; }

.display-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #f8f8fa;
  background: #101012;
}
.display-header,
.display-footer {
  padding: 24px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: #18181b;
  border-bottom: 1px solid #313136;
}
.display-brand { display: flex; align-items: center; gap: 26px; }
.display-brand .brand-mark { min-width: auto; font-size: 2.4rem; }
.display-brand h1 { margin: 2px 0 0; font-size: 1.7rem; }
.display-kicker { color: #a6a6ad; font-size: .7rem; font-weight: 700; letter-spacing: .16em; }
.display-status { display: flex; align-items: center; gap: 22px; }
.display-picker select { min-height: 38px; color: #fff; background: #29292d; border-color: #44444a; }
.connection { color: #b9bac0; font-weight: 700; }
.connection i { width: 10px; height: 10px; display: inline-block; margin-right: 6px; background: #35d07f; border-radius: 50%; box-shadow: 0 0 12px #35d07f; }
.connection.is-offline i { background: #efb33b; box-shadow: none; }
#clock { min-width: 120px; font-size: 1.8rem; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.display-main { padding: 3.2vw 4vw; }
.display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(390px, 100%), 1fr));
  gap: clamp(18px, 2vw, 34px);
}
.progress-card {
  min-height: 265px;
  padding: clamp(24px, 2.4vw, 42px);
  display: flex;
  flex-direction: column;
  background: #232327;
  border: 2px solid #3b3b41;
  border-left: 10px solid var(--red);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.progress-card.is-complete { opacity: .7; border-left-color: var(--green); }
.progress-card-top,
.progress-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.invoice-label { color: #a7a7ae; font-size: .77rem; font-weight: 700; letter-spacing: .12em; }
.state-label { padding: 6px 10px; color: #ffd9de; background: rgba(196,0,24,.22); border-radius: 999px; font-size: .76rem; font-weight: 700; }
.is-complete .state-label { color: #c9f6dc; background: rgba(30,155,96,.22); }
.invoice-id { margin: auto 0; font-size: 6rem; line-height: 1; letter-spacing: -.06em; }
.progress-summary { margin-bottom: 10px; color: #b8b8bf; }
.progress-summary strong { color: #fff; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.progress-track { height: 13px; overflow: hidden; background: #3a3a40; border-radius: 999px; }
.progress-track span { height: 100%; display: block; background: var(--red); border-radius: inherit; transition: width .4s ease; }
.is-complete .progress-track span { background: var(--green); }
.display-empty { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8e8e95; text-align: center; }
.display-empty strong { color: #f5f5f7; font-size: 3rem; }
.display-empty span { margin-top: 8px; font-size: 1.2rem; }
.display-footer { padding-top: 14px; padding-bottom: 14px; color: #a6a6ad; border-top: 1px solid #313136; border-bottom: 0; font-size: .84rem; }

@media (max-width: 850px) {
  .hero h1 { font-size: 2.5rem; }
  .page-heading h1 { font-size: 2.3rem; }
  .topbar { padding: 14px 20px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar nav { width: 100%; overflow-x: auto; }
  .topbar nav a { min-height: 46px; padding: 0 12px; white-space: nowrap; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 230px; }
  .toolbar { grid-template-columns: 1fr; }
  .position-row { grid-template-columns: 1fr; align-items: stretch; }
  .invoice-panel > header, .page-heading { align-items: flex-start; flex-direction: column; }
  .invoice-header-tools { width: 100%; justify-items: start; }
  .invoice-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .delivery-options { right: auto; left: 0; }
  .invoice-meta { flex-wrap: wrap; }
  .display-header { align-items: flex-start; }
  .display-status { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .connection { display: none; }
  .invoice-id { font-size: 4.2rem; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 25px; }
  .panel { padding: 18px; }
  .brand > span:last-child { display: none; }
  .display-header { padding: 18px; }
  .display-brand { gap: 12px; }
  .display-kicker { display: none; }
  .display-picker { display: none; }
  #clock { min-width: 90px; }
  .hero h1 { font-size: 2rem; }
  .page-heading h1 { font-size: 2rem; }
  .compact-heading { align-items: flex-start; flex-direction: column; }
  .invoice-meta { width: 100%; justify-content: space-between; gap: 16px; }
  .invoice-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-actions > .button,
  .delivery-menu,
  .delivery-toggle { width: 100%; }
  .delivery-options { width: min(260px, calc(100vw - 48px)); min-width: 0; }
  .position-row label,
  .position-row select { width: 100%; min-width: 0; }
  .invoice-id { font-size: 3.5rem; }
  .display-main { padding: 18px; }
  .display-footer { padding: 12px 18px; }
  .display-footer span:first-child { display: none; }
}
