:root {
  --primary: #2f6fe4;
  --primary-dark: #235bc0;
  --primary-soft: #eaf1ff;
  --topbar: #1d5fbf;
  --topbar-dark: #174e9f;
  --success: #1d8b5f;
  --success-soft: #e8f6f0;
  --warning: #b66c08;
  --warning-soft: #fff5df;
  --danger: #c83c3c;
  --danger-soft: #ffeded;
  --purple: #7255b8;
  --purple-soft: #f1edfb;
  --text: #1d2939;
  --text-secondary: #667085;
  --text-light: #98a2b3;
  --border: #dfe4ec;
  --border-strong: #cbd3df;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --page: #eef1f5;
  --table-head: #edf2fb;
  --sidebar-width: 232px;
  --topbar-height: 60px;
  --radius: 6px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  background: var(--page);
}

body {
  overflow: hidden;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(47, 111, 228, 0.35);
  outline-offset: 1px;
}

.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;
}

.app-shell {
  min-height: 100%;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(280px, 1fr) auto;
  align-items: center;
  height: var(--topbar-height);
  color: #fff;
  background: var(--topbar);
  box-shadow: 0 1px 4px rgba(16, 42, 78, 0.2);
}

.brand-area,
.top-actions,
.user-control,
.top-nav {
  display: flex;
  align-items: center;
}

.brand-area {
  gap: 10px;
  min-width: 0;
  height: 100%;
  padding-left: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.brand-title {
  overflow: hidden;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.icon-button svg,
.menu-parent svg,
.menu-item svg,
.standalone-menu svg,
.sidebar-footer svg,
.button svg,
.inline-action svg,
.field-icon svg,
.summary-icon svg,
.empty-state svg,
.drawer-close svg,
.modal-close svg,
.filter-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.menu-toggle {
  display: none;
}

.top-nav {
  height: 100%;
  min-width: 0;
  padding-left: 20px;
  overflow: hidden;
}

.top-nav-item {
  position: relative;
  height: 100%;
  padding: 0 18px;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.top-nav-item:hover,
.top-nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.top-nav-item.active::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  background: #fff;
  content: "";
}

.top-actions {
  gap: 3px;
  min-width: 0;
  height: 100%;
  padding-right: 14px;
}

.demo-label {
  margin-right: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  white-space: nowrap;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 3px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--topbar);
  border-radius: 9px;
  color: #fff;
  background: #e5484d;
  font-size: 10px;
  line-height: 1;
}

.user-control {
  gap: 8px;
  min-width: 0;
  margin-left: 5px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  color: var(--topbar-dark);
  background: #dceaff;
  font-weight: 500;
}

.role-switch {
  max-width: 166px;
  height: 32px;
  padding: 0 24px 0 4px;
  border: 0;
  color: #fff;
  background-color: transparent;
  cursor: pointer;
}

.role-switch option {
  color: var(--text);
  background: #fff;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-scroll {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.menu-caption {
  padding: 3px 10px 9px;
  color: var(--text-light);
  font-size: 12px;
}

.secondary-caption {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.menu-parent,
.menu-item,
.standalone-menu {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-parent {
  grid-template-columns: 22px 1fr 18px;
  gap: 6px;
  padding: 0 10px;
  color: #344054;
  font-weight: 500;
}

.menu-parent:hover,
.standalone-menu:hover {
  background: var(--surface-alt);
}

.menu-chevron {
  transition: transform 160ms ease;
}

.menu-group:not(.open) .menu-chevron {
  transform: rotate(-90deg);
}

.menu-group:not(.open) .menu-children {
  display: none;
}

.menu-children {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.menu-item {
  position: relative;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  padding: 0 8px 0 26px;
  color: #475467;
}

.menu-item:hover {
  color: var(--primary);
  background: #f4f7fd;
}

.menu-item.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 500;
}

.menu-item.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
  content: "";
}

.standalone-menu {
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  padding: 0 10px;
  color: #475467;
}

.menu-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 7px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

.sidebar-footer .version {
  margin-left: auto;
  color: var(--text-light);
}

.main-content {
  position: fixed;
  inset: var(--topbar-height) 0 0 var(--sidebar-width);
  overflow: auto;
  background: var(--page);
}

#pageRoot {
  min-height: 100%;
  padding: 18px 20px 28px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
}

.page-title {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.4;
}

.page-subtitle {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  border-color: #9eb6dc;
  color: var(--primary-dark);
  background: #f8fbff;
}

.button.primary {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.button.primary:hover {
  border-color: var(--primary-dark);
  color: #fff;
  background: var(--primary-dark);
}

.button.success {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.button.danger-text {
  color: var(--danger);
}

.button:disabled,
.inline-action:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 102px;
  gap: 12px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-label {
  color: var(--text-secondary);
  font-size: 13px;
}

.summary-value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.summary-note {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 12px;
}

.summary-note strong {
  margin-right: 3px;
  color: var(--success);
  font-weight: 500;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
}

.summary-icon.success {
  color: var(--success);
  background: var(--success-soft);
}

.summary-icon.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.summary-icon.purple {
  color: var(--purple);
  background: var(--purple-soft);
}

.content-band {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
}

.filter-field,
.form-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.filter-label,
.form-label {
  color: #475467;
  font-size: 12px;
}

.required::before {
  margin-right: 3px;
  color: var(--danger);
  content: "*";
}

.text-input,
.select-input,
.textarea-input,
.number-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text);
  background: #fff;
}

.textarea-input {
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
}

.text-input:hover,
.select-input:hover,
.textarea-input:hover,
.number-input:hover {
  border-color: #9db3d4;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus,
.number-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.1);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .text-input {
  padding-left: 34px;
}

.field-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  display: grid;
  place-items: center;
  color: var(--text-light);
  pointer-events: none;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.toolbar-left,
.toolbar-right,
.selection-info,
.pagination,
.page-size-control {
  display: flex;
  align-items: center;
}

.toolbar-left,
.toolbar-right {
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-title {
  font-weight: 500;
}

.toolbar-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.selection-info {
  gap: 5px;
  color: var(--primary-dark);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table.compact {
  min-width: 860px;
}

.data-table th,
.data-table td {
  height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid #e7eaf0;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  height: 42px;
  color: #475467;
  background: var(--table-head);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .checkbox-cell {
  width: 42px;
  padding-right: 4px;
  text-align: center;
}

.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.numeric {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.cell-main {
  overflow: hidden;
  color: #344054;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cell-sub {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-light);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.link-button,
.inline-action {
  padding: 0;
  border: 0;
  color: var(--primary-dark);
  background: transparent;
  cursor: pointer;
}

.link-button:hover,
.inline-action:hover {
  color: #143f8d;
  text-decoration: underline;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 3px;
  color: #475467;
  background: #f0f2f5;
  font-size: 12px;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #98a2b3;
  content: "";
}

.status.approved {
  color: #15704c;
  background: var(--success-soft);
}

.status.approved::before {
  background: var(--success);
}

.status.processing {
  color: #8a5808;
  background: var(--warning-soft);
}

.status.processing::before {
  background: #db8e18;
}

.status.draft {
  color: #475467;
  background: #f0f2f5;
}

.status.returned {
  color: #9d2929;
  background: var(--danger-soft);
}

.status.returned::before {
  background: var(--danger);
}

.status.pending {
  color: #4f3b92;
  background: var(--purple-soft);
}

.status.pending::before {
  background: var(--purple);
}

.progress-line {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edf3;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.progress-bar.success {
  background: var(--success);
}

.progress-value {
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

.pagination {
  gap: 4px;
}

.page-button {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #475467;
  background: #fff;
  cursor: pointer;
}

.page-button.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.page-button:disabled {
  color: #b4bbc5;
  background: #f7f8fa;
  cursor: not-allowed;
}

.page-button svg {
  width: 15px;
  height: 15px;
}

.page-size-control {
  gap: 7px;
}

.page-size-control select {
  height: 30px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #475467;
  background: #fff;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  color: var(--text-light);
}

.empty-title {
  margin-bottom: 5px;
  color: #475467;
  font-weight: 500;
}

.empty-note {
  color: var(--text-light);
  font-size: 12px;
}

.drawer-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 32, 50, 0.35);
}

.drawer-overlay {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  display: flex;
  width: min(720px, 92vw);
  height: 100%;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -10px 0 30px rgba(26, 46, 73, 0.15);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-header,
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-title,
.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.drawer-subtitle,
.modal-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.drawer-close,
.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}

.drawer-close:hover,
.modal-close:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.drawer-body,
.modal-body {
  flex: 1;
  padding: 18px;
  overflow: auto;
}

.drawer-footer,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 58px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}

.detail-section + .detail-section {
  margin-top: 22px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.detail-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  min-height: 43px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.detail-label,
.detail-value {
  display: flex;
  align-items: center;
  padding: 8px 10px;
}

.detail-label {
  color: var(--text-secondary);
  background: #f7f9fc;
  font-size: 12px;
}

.detail-value {
  min-width: 0;
  color: #344054;
  word-break: break-word;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  min-height: 64px;
}

.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 3px solid #dce3ed;
  border-radius: 50%;
  background: #fff;
}

.timeline-item.done .timeline-dot {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 3px #fff;
}

.timeline-item.current .timeline-dot {
  border-color: var(--primary);
  background: #fff;
}

.timeline-title {
  color: #344054;
  font-weight: 500;
}

.timeline-meta {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 12px;
}

.timeline-comment {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.modal-overlay {
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal {
  display: flex;
  width: min(940px, 96vw);
  max-height: min(840px, 94vh);
  flex-direction: column;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(20, 35, 55, 0.22);
  animation: modal-in 160ms ease-out;
}

.modal.medium {
  width: min(760px, 96vw);
}

.modal.small {
  width: min(520px, 96vw);
}

@keyframes modal-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-hint {
  color: var(--text-light);
  font-size: 12px;
}

.form-section {
  padding-bottom: 18px;
}

.form-section + .form-section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.editable-table {
  width: 100%;
  border-collapse: collapse;
}

.editable-table th,
.editable-table td {
  padding: 7px 8px;
  border: 1px solid var(--border);
  text-align: left;
}

.editable-table th {
  color: #475467;
  background: var(--table-head);
  font-size: 12px;
  font-weight: 500;
}

.editable-table .text-input,
.editable-table .number-input,
.editable-table .select-input {
  height: 31px;
}

.remove-row {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  cursor: pointer;
}

.remove-row svg {
  width: 16px;
  height: 16px;
}

.validation-error {
  display: none;
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
}

.validation-error.visible {
  display: block;
}

.allocation-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-secondary);
}

.allocation-total strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
}

.step-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
}

.step-item:not(:last-child)::after {
  position: absolute;
  top: 11px;
  left: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  background: var(--border);
  content: "";
}

.step-index {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-secondary);
  background: #fff;
  font-size: 12px;
}

.step-item.done,
.step-item.active {
  color: var(--primary-dark);
}

.step-item.done .step-index {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.step-item.active .step-index {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.step-item.done::after {
  background: var(--success);
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 14px;
  margin-bottom: 14px;
}

.chart-band,
.rank-band {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.chart-subtitle {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 12px;
}

.bar-chart {
  display: grid;
  min-height: 225px;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  align-items: end;
  gap: 15px;
  padding: 22px 8px 0;
  border-bottom: 1px solid var(--border-strong);
  background-image: linear-gradient(to bottom, transparent calc(25% - 1px), #eef1f5 25%, transparent calc(25% + 1px)),
    linear-gradient(to bottom, transparent calc(50% - 1px), #eef1f5 50%, transparent calc(50% + 1px)),
    linear-gradient(to bottom, transparent calc(75% - 1px), #eef1f5 75%, transparent calc(75% + 1px));
}

.bar-group {
  display: grid;
  height: 100%;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 5px;
}

.bar {
  position: relative;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

.bar.released {
  background: var(--success);
}

.bar:hover::after {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 6px);
  left: 50%;
  padding: 4px 6px;
  border-radius: 3px;
  color: #fff;
  background: #243348;
  font-size: 11px;
  white-space: nowrap;
  content: attr(data-value);
  transform: translateX(-50%);
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 15px;
  padding: 8px 8px 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--primary);
}

.legend-swatch.success {
  background: var(--success);
}

.rank-list {
  display: grid;
  gap: 14px;
}

.rank-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.rank-index {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-secondary);
  background: #f0f2f5;
  font-size: 11px;
}

.rank-item:nth-child(-n+3) .rank-index {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.rank-name {
  min-width: 0;
}

.rank-name-main {
  overflow: hidden;
  color: #344054;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-track {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf0f4;
}

.rank-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.rank-value {
  color: #344054;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tree-toggle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 3px;
  padding: 0;
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
}

.tree-toggle svg {
  width: 15px;
  height: 15px;
}

.tree-level-1 .tree-cell {
  padding-left: 32px;
}

.tree-level-2 .tree-cell {
  padding-left: 60px;
}

.tree-level-1 {
  background: #fbfcfe;
}

.tree-level-2 {
  background: #fff;
}

.tree-level-1.hidden,
.tree-level-2.hidden {
  display: none;
}

.mini-donut {
  --p: 50;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 55%, transparent 57%), conic-gradient(var(--success) calc(var(--p) * 1%), #e8ecf2 0);
  color: #475467;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  color: #3d5577;
  background: #eef5ff;
  font-size: 12px;
}

.notice-strip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  position: relative;
  align-self: stretch;
  padding: 0 2px;
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}

.tab-button.active {
  color: var(--primary-dark);
  font-weight: 500;
}

.tab-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--primary);
  content: "";
}

.summary-sheet {
  padding: 16px;
}

.summary-sheet-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}

.summary-sheet-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.approval-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #cfe0fa;
  border-radius: var(--radius);
  background: #f3f7fe;
}

.approval-banner-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
}

.approval-banner-icon svg {
  width: 18px;
  height: 18px;
}

.approval-banner-title {
  color: #2d4770;
  font-weight: 500;
}

.approval-banner-note {
  margin-top: 3px;
  color: #7083a0;
  font-size: 12px;
}

.toast-region {
  position: fixed;
  z-index: 120;
  top: 74px;
  right: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid #cfd8e5;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 44, 70, 0.14);
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-color: #b9dfcf;
}

.toast.warning {
  border-color: #ead3a6;
}

.toast-icon {
  color: var(--primary);
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast-title {
  color: #344054;
  font-weight: 500;
}

.toast-message {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  color: var(--text-light);
  background: transparent;
  cursor: pointer;
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

@keyframes toast-in {
  from { transform: translateY(-5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: minmax(250px, auto) 1fr auto;
  }

  .top-nav-item {
    padding: 0 11px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(235px, 1fr) auto;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .brand-title {
    font-size: 18px;
  }

  .top-nav,
  .demo-label {
    display: none;
  }

  .sidebar {
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    z-index: 60;
    background: rgba(20, 32, 50, 0.3);
  }

  .app-shell.sidebar-open + .sidebar-backdrop {
    display: block;
  }

  .main-content {
    left: 0;
  }

  .stats-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-mark,
  .top-actions > .icon-button:first-of-type {
    display: none;
  }

  .brand-area {
    gap: 5px;
    padding-left: 6px;
  }

  .brand-title {
    font-size: 16px;
  }

  .top-actions {
    padding-right: 6px;
  }

  .role-switch {
    width: 100px;
    font-size: 12px;
  }

  #pageRoot {
    padding: 14px 10px 22px;
  }

  .page-heading {
    display: grid;
  }

  .heading-actions {
    justify-content: flex-start;
  }

  .page-title {
    font-size: 19px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 94px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .table-toolbar,
  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    align-self: stretch;
    justify-content: space-between;
  }

  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field.full {
    grid-column: auto;
  }

  .detail-item {
    grid-template-columns: 100px 1fr;
  }

  .modal-overlay {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 28px);
    border-radius: 7px 7px 0 0;
  }

  .drawer {
    width: 100%;
  }

  .editable-table {
    min-width: 680px;
  }

  .editable-table-wrap {
    overflow-x: auto;
  }

  .approval-banner {
    grid-template-columns: auto 1fr;
  }

  .approval-banner .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .bar-chart,
  .bar-labels {
    gap: 7px;
  }
}

@media (max-width: 430px) {
  .avatar {
    display: none;
  }

  .user-control {
    margin-left: 0;
    padding-left: 4px;
    border-left: 0;
  }

  .brand-title {
    max-width: 150px;
  }

  .heading-actions .button {
    flex: 1 1 auto;
  }

  .filter-actions .button {
    flex: 1;
  }

  .summary-value {
    font-size: 22px;
  }

  .stepper {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 0;
  }

  .step-item:nth-child(2)::after {
    display: none;
  }
}

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