:root {
  --ink: #111111;
  --ink-soft: #303030;
  --muted: #686868;
  --line: #d8d8d8;
  --paper: #ffffff;
  --canvas: #f4f4f4;
  --orange: #ff6f31;
  --orange-dark: #d94e17;
  --orange-soft: #fff0e9;
  --success: #17643a;
  --error: #a32626;
  --sidebar-width: 272px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 13px/1.45 Arial, Helvetica, sans-serif;
}
button, input, select { font: inherit; }
button, select, input { border-radius: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  z-index: 10;
}
.brand { border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; grid-template-columns: 1fr 58px; min-height: 78px; }
.brand-mark strong {
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: var(--ink);
  color: var(--paper);
  font-size: 27px;
  letter-spacing: .08em;
}
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  place-content: center;
  gap: 5px;
  background: var(--orange);
}
.brand-grid i { width: 5px; height: 5px; background: var(--paper); }
.brand-caption {
  display: block;
  padding: 14px 22px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
nav { display: grid; margin-top: 24px; }
nav a {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
nav a::before {
  content: attr(data-index);
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
}
nav a::after {
  content: "";
  position: absolute;
  inset: -1px 0 -1px auto;
  width: 6px;
  background: transparent;
}
nav a:hover, nav a:focus-visible {
  color: var(--ink);
  background: #fafafa;
  border-color: var(--line);
}
nav a.active {
  color: var(--ink);
  background: var(--orange-soft);
  border-color: #ffd4c2;
}
nav a.active::before { color: var(--orange-dark); }
nav a.active::after { background: var(--orange); }
.environment {
  margin-top: auto;
  padding: 18px 22px;
  border-top: 3px solid var(--orange);
  color: var(--muted);
  font-size: 13px;
}

main {
  margin-left: var(--sidebar-width);
  padding: 0 38px 60px;
  max-width: 1560px;
}
.page-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  min-height: 166px;
  padding: 38px 0 27px;
  border-bottom: 1px solid var(--ink);
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--orange) 0 27%, var(--ink) 27% 100%);
}
.eyebrow {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 7px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: .98;
  letter-spacing: -.035em;
  margin-bottom: 0;
}
h2 { font-size: 28px; line-height: 1.08; letter-spacing: -.02em; margin-bottom: 0; }
h3 { font-size: 17px; }
.account {
  min-width: 260px;
  padding: 13px 0 2px 18px;
  border-left: 4px solid var(--orange);
  text-align: left;
  display: grid;
  gap: 3px;
}
.account strong { font-size: 16px; }
.account span { color: var(--muted); font-size: 13px; }

.notice {
  margin: 22px 0 0;
  border-left: 5px solid var(--muted);
  padding: 12px 15px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}
.notice[data-tone="success"] { border-left-color: var(--success); color: var(--success); }
.notice[data-tone="error"] { border-left-color: var(--error); color: var(--error); }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 24px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metrics article {
  position: relative;
  min-height: 180px;
  padding: 25px 26px 22px;
  display: grid;
  align-content: end;
  gap: 2px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.metrics article:last-child { border-right: 0; }
.metrics article::before {
  content: attr(data-code);
  position: absolute;
  top: 18px;
  right: 22px;
  color: #b8b8b8;
  font-size: 12px;
  letter-spacing: .14em;
}
.metrics article::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 57px;
  height: 2px;
  background: var(--orange);
  margin-bottom: 7px;
}
.metrics strong {
  color: var(--orange);
  font-size: clamp(48px, 5vw, 70px);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.05em;
  margin-bottom: 19px;
}
.metrics span { color: var(--ink); font-size: 15px; font-weight: 700; }
.metrics small { color: var(--muted); font-size: 12px; }

.workspace {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--ink);
  padding: 27px 28px 30px;
  margin-top: 18px;
}
.workspace:target { border-top-color: var(--orange); }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 21px;
}
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
input, select, button {
  min-height: 46px;
  border: 1px solid #c8c8c8;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(255, 111, 49, .3);
  outline-offset: 2px;
}
button { cursor: pointer; font-size: 15px; font-weight: 700; }
button:hover, button:focus-visible { border-color: var(--orange-dark); }
button:disabled { cursor: wait; opacity: .6; }
.primary {
  min-width: 140px;
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}
.primary:hover, .primary:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.slot-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.slot {
  position: relative;
  display: grid;
  text-align: left;
  gap: 1px;
  min-height: 80px;
  padding: 5px;
  border-top: 4px solid var(--orange);
}
/. .slot::after { content: "→"; position: absolute; right: 15px; bottom: 13px; color: var(--orange-dark); } ./
.slot:hover { background: var(--orange-soft); }
.slot strong { font-size: 15px; }
.slot span { color: var(--muted); font-size: 14px; }
.slot small { color: var(--orange-dark); font-size: 13px; }
.empty { color: var(--muted); margin: 14px 0 0; }

.orders-heading { align-items: end; }
.period { display: flex; gap: 8px; align-items: end; }
.period label { display: grid; grid-template-columns: auto 145px; align-items: center; gap: 7px; }
.period input { min-height: 40px; padding: 7px 8px; }
.period button { min-height: 40px; padding: 7px 13px; }
.order-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.order-columns > section { border-top: 1px solid var(--ink); padding-top: 16px; }
.order-row {
  display: grid;
  grid-template-columns: 1fr auto 120px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.order-row div { display: grid; gap: 2px; }
.order-row div span { color: var(--muted); font-size: 13px; }
.tag { color: var(--orange-dark); font-size: 13px; }
progress { width: 100%; height: 8px; accent-color: var(--orange); }

dialog { width: min(560px, calc(100vw - 28px)); border: 0; border-top: 7px solid var(--orange); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .67); }
dialog form { padding: 29px; display: grid; gap: 21px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.icon-button { min-height: 38px; width: 38px; padding: 0; font-size: 24px; border: 0; }
.selection { margin: 0; display: grid; grid-template-columns: 1fr 1fr; background: var(--canvas); border-left: 4px solid var(--orange); padding: 16px; }
.selection div { display: grid; gap: 2px; }
.selection dt { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.selection dd { margin: 0; font-weight: 700; }
dialog label small { color: var(--muted); font-weight: 400; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1120px) {
  :root { --sidebar-width: 240px; }
  main { padding-inline: 26px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
  .orders-heading { align-items: start; flex-direction: column; }
  .period { flex-wrap: wrap; }
}
@media (max-width: 780px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-mark { grid-template-columns: 1fr 64px; }
  .brand-caption { display: none; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
  .sidebar nav a { grid-template-columns: 28px 1fr; padding: 0 14px; }
  .environment { display: none; }
  main { margin-left: 0; padding: 0 16px 42px; }
  .page-header { min-height: 0; padding: 34px 0 24px; align-items: start; flex-direction: column; }
  .page-header::before { height: 5px; }
  h1 { font-size: clamp(34px, 10vw, 48px); }
  .account { min-width: 0; width: 100%; }
  .metrics, .order-columns { grid-template-columns: 1fr; }
  .metrics article { min-height: 145px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics article:last-child { border-bottom: 0; }
  .period { display: grid; width: 100%; }
  .period label { grid-template-columns: 30px 1fr; }
  .workspace { padding: 24px 18px; }
}
@media (max-width: 520px) {
  .sidebar nav { grid-template-columns: 1fr; }
  .sidebar nav a { min-height: 48px; }
  .filters, .slot-grid, .selection { grid-template-columns: 1fr; }
  .section-heading { align-items: start; }
}
