:root {
  --brand: #ea5404;
  --brand-soft: #fff1e8;
  --line: #d8dde6;
  --line-soft: #edf1f5;
  --text: #263238;
  --muted: #657080;
  --bg: #f4f6f9;
  --link: #1d6fb8;
  --ok: #148a47;
  --warn: #ad6a00;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 1180px;
  min-height: 100%;
  background: #fff;
  color: var(--text);
  font: 12px/1.45 Arial, "Microsoft YaHei", sans-serif;
}

html:has(body.page-body),
html:has(body.tab-page) {
  min-width: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  height: 48px;
  border-bottom: 1px solid #cfd5df;
  background: #fff;
}

.brand {
  width: 160px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-size: 20px;
  font-weight: 700;
}

.primary-nav {
  display: flex;
  height: 48px;
  flex: 1;
  overflow: hidden;
}

.primary-nav a {
  min-width: 82px;
  padding: 15px 16px 0;
  color: #3c4856;
  text-align: center;
  text-decoration: none;
  border-right: 1px solid #edf0f4;
}

.primary-nav a.active {
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
  background: #fff7f2;
  font-weight: 700;
}

.user-meta {
  width: 150px;
  color: var(--muted);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: 180px minmax(1000px, 1fr);
  min-height: calc(100vh - 48px);
  transition: grid-template-columns 180ms ease;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 36px minmax(1000px, 1fr);
}

.sidebar {
  position: relative;
  width: 100%;
  min-width: 0;
  border-right: 1px solid #cfd5df;
  background: #f8f9fb;
  transition: width 180ms ease;
}

.sidebar-toggle {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: -12px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  color: #56616f;
  border: 1px solid #cfd5df;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  color: var(--brand);
  border-color: var(--brand);
  outline: none;
}

.sidebar-toggle-icon {
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.workspace:not(.sidebar-collapsed) .sidebar-toggle-icon {
  transform: rotate(180deg) translateY(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;
}

.sidebar-title {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.side-menu {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.side-menu a {
  position: relative;
  height: 32px;
  padding: 7px 18px 0 28px;
  color: #3e4854;
  text-decoration: none;
}

.side-menu a:hover {
  background: #edf1f6;
}

.side-menu a.current {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}

.side-menu a.current::before,
.product-card-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .side-menu {
  display: none;
}

.content {
  padding: 14px 16px 18px;
  background: #fff;
}

.shell-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: calc(100vh - 48px);
  height: calc(100vh - 48px);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 8px;
}

.page-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-search-toggle {
  height: 28px;
  padding: 0 4px;
  white-space: nowrap;
}

.view-switch {
  display: inline-flex;
}

.view-switch button {
  min-width: 76px;
  height: 28px;
  border: 1px solid #cbd2dc;
  border-right: 0;
  color: #35404c;
  background: #fff;
}

.view-switch button:last-child {
  border-right: 1px solid #cbd2dc;
}

.view-switch button.selected {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.mode-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.page-body {
  min-width: 0;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.search-panel,
.result-pane,
.product-detail,
.list-panel,
.table-section,
.side-card {
  border: 1px solid var(--line);
  background: #fff;
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.link-button,
.plain-link {
  border: 0;
  color: var(--brand);
  background: transparent;
  text-decoration: none;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(185px, 1fr));
  gap: 10px 14px;
  padding: 12px;
}

.search-grid-full {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.search-grid-full label {
  grid-template-columns: 92px minmax(0, 1fr);
}

.compact-search-form {
  padding: 8px 10px;
}

.shared-search {
  margin-bottom: 8px;
}

.shared-search.collapsed {
  height: 0;
  margin-bottom: 0;
  overflow: hidden;
  border: 0;
}

.shared-search-content[hidden] {
  display: none;
}

.shared-search .selected-conditions {
  margin: 0 10px 8px;
}

.primary-search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px 10px;
}

.primary-search-grid label {
  display: block;
  min-width: 0;
  min-height: 0;
}

.primary-search-grid label > span {
  display: block;
  height: 18px;
  overflow: hidden;
  color: #586473;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.primary-search-grid input,
.primary-search-grid select {
  height: 26px;
}

.compact-date-range > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
}

.compact-date-range i {
  color: var(--muted);
  font-style: normal;
  text-align: center;
}

.compact-date-range input {
  min-width: 0;
  padding-right: 2px;
  padding-left: 4px;
  font-size: 10px;
}

.compact-query-action {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.compact-query-action button {
  width: 76px;
  height: 26px;
  color: #fff;
  border: 1px solid var(--brand);
  background: var(--brand);
}

.search-actions-end {
  grid-column: 4;
}

.search-panel.collapsed .search-grid {
  display: none;
}

.search-panel.collapsed .section-bar {
  border-bottom: 0;
}

label {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  height: 28px;
  padding: 3px 8px;
  color: var(--text);
  border: 1px solid #cbd2dc;
  background: #fff;
}

input:focus,
select:focus {
  outline: 1px solid var(--brand);
  border-color: var(--brand);
}

.date-range {
  grid-column: span 2;
  grid-template-columns: 84px 1fr 20px 1fr;
}

.date-range i {
  color: var(--muted);
  font-style: normal;
  text-align: center;
}

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

.search-actions button {
  min-width: 62px;
  height: 28px;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.search-actions .primary {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.selected-conditions {
  display: flex;
  align-items: center;
  height: 30px;
  margin: 8px 0;
  padding: 0 10px;
  color: #45515f;
  border: 1px solid var(--line);
  background: #f8f9fb;
}

.selected-label {
  flex: 0 0 auto;
}

.condition-tags {
  display: flex;
  flex: 1;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.condition-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: 240px;
  height: 22px;
  padding: 0 5px 0 7px;
  overflow: hidden;
  color: #4d5966;
  border: 1px solid #d8dde6;
  background: #eef1f4;
  white-space: nowrap;
}

.condition-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.condition-tag button {
  flex: 0 0 auto;
  margin-left: 4px;
  padding: 0;
  color: #78828e;
  border: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}

.condition-empty {
  color: var(--muted);
}

.selected-conditions > .plain-link {
  flex: 0 0 auto;
  margin-left: 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 10px;
  height: calc(100vh - 151px);
  min-height: 510px;
}

.detail-layout-full {
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

.result-pane {
  display: grid;
  grid-template-rows: 36px 42px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.pane-title {
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  font-weight: 700;
}

.quick-search {
  position: relative;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.quick-search input {
  padding-right: 28px;
}

.quick-search span {
  position: absolute;
  top: 13px;
  right: 19px;
  color: var(--muted);
  font-size: 15px;
}

.product-list {
  min-height: 0;
  overflow: auto;
}

.product-card-row {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.product-card-row .separator {
  color: #c7ccd4;
  overflow: visible;
}

.product-card-row strong {
  color: var(--brand);
  font-weight: 700;
}

.product-card-row span,
.product-card-row strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-card-row:hover {
  background: #f4f6f9;
}

.product-card-row.selected {
  background: var(--brand-soft);
}

.status-tag {
  display: inline-block;
  padding: 1px 6px;
  color: var(--ok);
  border: 1px solid #9bd3b1;
  background: #eefaf2;
  font-style: normal;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

.status-tag.ended {
  color: #737d88;
  border-color: #cbd2dc;
  background: #f2f4f6;
}

.status-tag.clearing {
  color: var(--warn);
  border-color: #e6c27c;
  background: #fff6e4;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.pager button {
  min-width: 24px;
  height: 24px;
  border: 1px solid #ccd3dc;
  background: #fff;
}

.pager .active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.product-detail {
  display: grid;
  grid-template-rows: 44px 38px 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* 产品360详情：单值属性使用紧凑详情，多值对象使用业务表格。 */
.detail-information-page,
.stakeholder-page,
.account-page {
  padding-bottom: 22px;
}

.detail-section {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-section h2 {
  height: 30px;
  margin: 0;
  padding: 6px 9px 0;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  font-size: 13px;
}

.detail-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-information-page .detail-section {
  border: 0;
  border-bottom: 1px solid var(--line);
}

.detail-information-page .detail-section h2 {
  height: auto;
  min-height: 25px;
  margin: 0 0 4px;
  padding: 3px 0 3px 8px;
  color: var(--text);
  border: 0;
  border-left: 3px solid var(--brand);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 19px;
}

.detail-information-page .detail-field-grid {
  padding: 4px 0 7px;
}

.detail-information-page .detail-field {
  min-height: 42px;
  padding: 5px 14px 4px 0;
  border: 0;
}

.detail-information-page .detail-field span {
  margin-bottom: 2px;
  color: #78828e;
}

.detail-information-page .detail-field strong {
  color: #2f3944;
}

.detail-information-page .detail-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 5px;
}

.detail-information-page .detail-field span {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.detail-information-page .detail-field span::after {
  content: "：";
}

.detail-information-page .detail-field strong {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.detail-field {
  min-height: 50px;
  padding: 7px 10px 6px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.detail-field:nth-child(4n) {
  border-right: 0;
}

.detail-field.span-2 {
  grid-column: span 2;
}

.detail-field.span-3 {
  grid-column: span 3;
}

.detail-field span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
}

.detail-field strong {
  display: block;
  min-height: 18px;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.detail-field.numeric strong,
.number-col {
  text-align: right;
}

.value-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
}

.value-tags i {
  padding: 1px 6px;
  color: #4d5966;
  border: 1px solid #d6dce5;
  background: #f5f7f9;
  font-style: normal;
}

.single-line-fields {
  border-bottom: 1px solid var(--line);
}

.embedded-table-title,
.nested-title {
  min-height: 30px;
  padding: 7px 9px 0;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
  font-weight: 700;
}

.embedded-table-title:not(:first-of-type) {
  border-top: 1px solid var(--line);
}

.detail-information-page .embedded-table-title {
  height: 28px;
  min-height: 28px;
  padding: 5px 8px 0;
  background: #f8f9fb;
}

.risk-table-scroll {
  overflow-x: hidden;
}

.risk-line-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.risk-line-table .risk-name-col { width: 24%; }
.risk-line-table .risk-basis-col { width: 23%; }
.risk-line-table .risk-value-col { width: 15%; }
.risk-line-table .risk-note-col { width: 38%; }

.risk-line-table th,
.risk-line-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.section-note {
  min-height: 30px;
  padding: 6px 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.anchor-nav {
  position: sticky;
  top: -10px;
  z-index: 15;
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
}

.anchor-nav span {
  margin-right: 4px;
  color: var(--muted);
}

.anchor-nav a {
  height: 32px;
  padding: 8px 11px 0;
  color: #3f4955;
  text-decoration: none;
}

.anchor-nav a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.anchor-section {
  scroll-margin-top: 34px;
}

.stakeholder-page .anchor-section {
  border: 0;
  background: transparent;
}

.stakeholder-page .anchor-section > h2 {
  height: auto;
  min-height: 25px;
  margin: 0 0 6px;
  padding: 3px 0 3px 8px;
  color: var(--text);
  border: 0;
  border-left: 3px solid var(--brand);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 19px;
}

.stakeholder-page .anchor-section > .table-scroll,
.stakeholder-page .anchor-section > .detail-field-grid {
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.stakeholder-page .anchor-section > .table-scroll th {
  border-top: 0;
}

.stakeholder-page .anchor-section > .table-scroll th:first-child,
.stakeholder-page .anchor-section > .table-scroll td:first-child {
  border-left: 0;
}

.stakeholder-page .anchor-section > .table-scroll th:last-child,
.stakeholder-page .anchor-section > .table-scroll td:last-child {
  border-right: 0;
}

.stakeholder-page .anchor-section > .table-scroll tbody tr:last-child td {
  border-bottom: 0;
}

.stakeholder-page .anchor-section > .table-scroll + .section-note {
  border: 1px solid var(--line);
  border-top: 0;
  background: #fafbfc;
}

.stakeholder-page .anchor-section > .detail-field-grid .detail-field {
  background: #fff;
}

.stakeholder-page .anchor-section > .detail-field-grid .detail-field:last-child {
  border-right: 0;
}

.stakeholder-page .team-grid .detail-field {
  border-bottom: 0;
}

.stakeholder-page .team-grid .detail-field:not(:last-child) {
  border-right: 1px solid var(--line-soft);
}

.nested-block {
  margin: 8px;
  border: 1px solid var(--line);
}

.nested-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 0;
}

.nested-title span {
  color: var(--muted);
  font-weight: 400;
}

.mom-table {
  min-width: 1050px;
}

.mom-table th:nth-child(1) { width: 48px; }
.mom-table th:nth-child(2) { width: 170px; }
.mom-table th:nth-child(3) { width: 105px; }
.mom-table th:nth-child(4) { width: 115px; }
.mom-table th:nth-child(5) { width: 150px; }
.mom-table th:nth-child(6),
.mom-table th:nth-child(7) { width: 100px; }
.mom-table th:nth-child(8) { width: 86px; }

.advisor-mom-table {
  min-width: 990px;
}

.advisor-mom-table th:nth-child(1) { width: 210px; }
.advisor-mom-table th:nth-child(2),
.advisor-mom-table th:nth-child(3) { width: 105px; }
.advisor-mom-table th:nth-child(4) { width: 180px; }
.advisor-mom-table th:nth-child(5) { width: 90px; }
.advisor-mom-table th:nth-child(6) { width: 125px; }
.advisor-mom-table th:nth-child(7) { width: 105px; }

.client-stakeholder-table {
  min-width: 1240px;
}

.client-stakeholder-table th:nth-child(1) { width: 190px; }
.client-stakeholder-table th:nth-child(4) { width: 140px; }
.client-stakeholder-table th:nth-child(5) { width: 170px; }
.client-stakeholder-table th:nth-child(7) { width: 230px; }
.client-stakeholder-table th:nth-child(8) { width: 120px; }
.client-stakeholder-table th:nth-child(10) { width: 112px; }

.distributor-stakeholder-table {
  min-width: 1180px;
}

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

.team-grid .detail-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 38px;
  padding: 9px 8px 6px;
}

.team-grid .detail-field span {
  flex: 0 0 auto;
  margin: 0;
}

.team-grid .detail-field span::after {
  content: "：";
}

.team-grid .detail-field strong {
  min-width: 0;
}

.account-toolbar {
  justify-content: flex-start;
  gap: 16px;
}

.category-chips {
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-chips button {
  min-width: 50px;
  height: 24px;
  padding: 0 10px;
  color: #4c5865;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.category-chips button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.account-table {
  min-width: 1258px;
}

.fee-table {
  min-width: 1500px;
}

.small-m-account-table {
  min-width: 1308px;
}

.small-m-account-table th:nth-child(1) { width: 118px; }
.small-m-account-table th:nth-child(2) { width: 88px; }
.small-m-account-table th:nth-child(3) { width: 210px; }
.small-m-account-table th:nth-child(4) { width: 82px; }
.small-m-account-table th:nth-child(5) { width: 170px; }
.small-m-account-table th:nth-child(6) { width: 130px; }
.small-m-account-table th:nth-child(7) { width: 190px; }
.small-m-account-table th:nth-child(8) { width: 76px; }
.small-m-account-table th:nth-child(9) { width: 96px; }
.small-m-account-table th:nth-child(10) { width: 112px; }

.account-table th:nth-child(3),
.account-table td:nth-child(3),
.account-table th:nth-child(5),
.account-table td:nth-child(5) {
  width: 190px;
}

.account-table th:nth-child(1) { width: 76px; }
.account-table th:nth-child(2) { width: 104px; }
.account-table th:nth-child(4) { width: 145px; }
.account-table th:nth-child(6) { width: 76px; }
.account-table th:nth-child(7),
.account-table th:nth-child(8) { width: 96px; }
.account-table th:nth-child(9),
.account-table th:nth-child(10),
.account-table th:nth-child(11) { width: 116px; }

.account-table th:nth-child(11),
.account-table td:nth-child(11) {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.account-table th:nth-child(11),
.account-table td:nth-child(11) {
  right: 0;
  box-shadow: -1px 0 0 var(--line);
}

.account-table thead th:nth-child(11) {
  z-index: 3;
  background: #f3f5f8;
}

.fee-table th:nth-child(1) { width: 88px; }
.fee-table th:nth-child(2) { width: 70px; }
.fee-table th:nth-child(3),
.fee-table th:nth-child(4),
.fee-table th:nth-child(10),
.fee-table th:nth-child(13) { width: 82px; }
.fee-table th:nth-child(5) { width: 190px; }
.fee-table th:nth-child(6) { width: 170px; }
.fee-table th:nth-child(7),
.fee-table th:nth-child(8) { width: 145px; }
.fee-table th:nth-child(9) { width: 140px; }
.fee-table th:nth-child(11),
.fee-table th:nth-child(12) { width: 98px; }
.fee-table th:nth-child(14) { width: 150px; }

.account-empty {
  padding: 28px;
  text-align: center;
}

.account-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: min(680px, 72vw);
  height: 100vh;
  border-left: 1px solid #cbd2dc;
  background: #fff;
  box-shadow: -6px 0 18px rgb(0 0 0 / 16%);
}

.account-drawer[hidden] {
  display: none;
}

.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.drawer-head button {
  border: 0;
  background: transparent;
  font-size: 20px;
}

.drawer-body {
  height: calc(100vh - 88px);
  padding: 10px;
  overflow: auto;
}

.drawer-foot {
  justify-content: flex-end;
  height: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

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

.drawer-field-grid .detail-field:nth-child(4n) {
  border-right: 1px solid var(--line-soft);
}

.drawer-field-grid .detail-field:nth-child(2n) {
  border-right: 0;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(105px, 1fr));
}

.calendar-strip > div {
  min-height: 62px;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.calendar-strip > div:last-child {
  border-right: 0;
}

.calendar-strip span,
.calendar-strip strong {
  display: block;
}

.calendar-strip span {
  margin-bottom: 7px;
  color: var(--muted);
}

.calendar-strip strong {
  color: #7b8490;
  font-weight: 400;
}

.calendar-strip .calendar-open {
  color: var(--ok);
}

.section-caption {
  color: var(--muted);
}

.calendar-heading {
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.calendar-heading h2 {
  flex: 0 0 auto;
}

.calendar-range-control {
  position: relative;
  flex: 0 0 auto;
}

.month-picker {
  position: absolute;
  top: 30px;
  left: 0;
  z-index: 30;
  width: 264px;
  padding: 8px;
  border: 1px solid #cbd2dc;
  background: #fff;
  box-shadow: 0 5px 16px rgb(0 0 0 / 16%);
}

.month-picker-head {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  height: 30px;
  margin-bottom: 6px;
}

.month-picker-head strong {
  text-align: center;
}

.month-picker-head button,
.month-picker-current {
  height: 26px;
  color: #4a5663;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.month-picker-grid button {
  height: 28px;
  color: #3f4955;
  border: 1px solid transparent;
  background: #f5f7f9;
}

.month-picker-grid button:hover,
.month-picker-grid button.current {
  color: var(--brand);
  border-color: #f6b38d;
  background: var(--brand-soft);
}

.month-picker-grid button.selected {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.month-picker-current {
  width: 100%;
  margin-top: 7px;
  color: var(--brand);
}

.calendar-empty {
  min-height: 180px;
  padding-top: 72px;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-week[hidden],
.month-calendar[hidden] {
  display: none;
}

.calendar-week button {
  min-height: 82px;
  padding: 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.calendar-week button:last-child {
  border-right: 0;
}

.calendar-week button:hover,
.month-days button:hover {
  background: #fff8f3;
}

.calendar-week button.today,
.month-days button.today {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-week span,
.calendar-week strong,
.calendar-week small {
  display: block;
}

.calendar-week span {
  margin-bottom: 7px;
  color: #4d5966;
}

.calendar-week strong {
  margin-bottom: 4px;
  font-weight: 700;
}

.calendar-week small {
  color: var(--muted);
}

.open-both {
  color: var(--ok) !important;
}

.open-subscribe {
  color: var(--brand) !important;
}

.open-redeem {
  color: var(--link) !important;
}

.calendar-week .closed,
.month-days .closed {
  background: #fafbfc;
}

.calendar-week .closed strong,
.month-days button:not(:has(.open-both, .open-subscribe, .open-redeem)) span {
  color: #8b949f;
  font-weight: 400;
}

.month-weekdays,
.month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekdays span {
  height: 28px;
  padding-top: 6px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  text-align: center;
}

.month-days > button,
.month-days > i {
  min-height: 60px;
  padding: 6px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.month-days > i {
  background: #fafbfc;
}

.month-days b,
.month-days span {
  display: block;
}

.month-days b {
  margin-bottom: 5px;
  color: #4d5966;
}

.month-days span {
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

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

.calendar-legend i {
  width: 8px;
  height: 8px;
}

.legend-both { background: var(--ok); }
.legend-subscribe { background: var(--brand); }
.legend-redeem { background: var(--link); }
.legend-closed { background: #a6adb6; }

.fee-rule-list {
  min-width: 988px;
}

.fee-rule-list th:nth-child(1) { width: 90px; }
.fee-rule-list th:nth-child(2) { width: 76px; }
.fee-rule-list th:nth-child(3) { width: 90px; }
.fee-rule-list th:nth-child(4) { width: 150px; }
.fee-rule-list th:nth-child(5) { width: 90px; }
.fee-rule-list th:nth-child(6),
.fee-rule-list th:nth-child(7) { width: 100px; }
.fee-rule-list th:nth-child(8) { width: 86px; }
.fee-rule-list th:nth-child(9) { width: 170px; }

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.product-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.summary-line .status-tag {
  font-size: 12px;
}

.view-selector {
  position: relative;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 400;
}

.view-selector-trigger {
  height: 28px;
  padding: 0 8px;
  color: #46515e;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.view-selector-trigger:hover,
.view-selector-trigger[aria-expanded="true"] {
  color: var(--brand);
  border-color: var(--brand);
}

.view-selector-trigger strong {
  margin-right: 6px;
}

.view-selector-menu {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 30;
  width: 190px;
  padding: 4px 0;
  border: 1px solid #cbd2dc;
  background: #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / 14%);
}

.view-selector-menu[hidden] {
  display: none;
}

.view-selector-menu button {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: #fff;
  text-align: left;
}

.view-selector-menu button.current {
  color: var(--brand);
  background: var(--brand-soft);
}

.view-selector-menu button.planned {
  color: #9aa2ac;
}

.view-selector-menu button:hover {
  background: #f4f6f9;
}

.overview-dashboard {
  border: 1px solid var(--line);
  background: #fff;
}

.overview-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.overview-status-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
}

.overview-status-strip > div:last-child {
  border-right: 0;
}

.overview-status-strip span,
.summary-metrics span {
  color: var(--muted);
}

.maintenance-state {
  color: var(--warn);
}

.overview-groups {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  padding: 10px;
}

.overview-summary-group {
  border: 1px solid var(--line);
  background: #fff;
}

.overview-summary-group h2 {
  height: 30px;
  margin: 0;
  padding: 6px 9px 0;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  font-size: 13px;
}

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

.overview-summary-group:nth-child(n+2) .summary-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px;
  border-right: 1px solid var(--line-soft);
}

.summary-metrics > div:last-child {
  border-right: 0;
}

.summary-metrics strong {
  color: var(--brand);
  font-size: 18px;
}

.overview-note {
  padding: 7px 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.tabs-bar {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.tab-newtab-btn {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  margin-right: 10px;
  height: 26px;
  padding: 0 12px;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 4px;
  background: #fff;
  white-space: nowrap;
}

.tab-newtab-btn:hover,
.tab-newtab-btn:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.tabs button {
  min-width: 76px;
  padding: 0 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #3f4955;
  background: transparent;
}

.tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

.tab-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.tab-page {
  min-width: 0;
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
}

.stakeholder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 10px;
}

.table-section {
  margin-bottom: 10px;
}

.table-section h2 {
  margin: 0;
  height: 30px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 31px;
  padding: 5px 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  text-align: left;
}

.table-section table th:first-child,
.table-section table td:first-child {
  border-left: 0;
}

.table-section table th:last-child,
.table-section table td:last-child {
  border-right: 0;
}

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

th {
  color: #4d5966;
  background: #f3f5f8;
  font-weight: 700;
}

td a,
.subject-link {
  color: var(--link);
  text-decoration: none;
}

td a:hover,
.subject-link:hover {
  text-decoration: underline;
}

.side-card {
  margin-bottom: 10px;
}

.side-card h3 {
  margin: 0;
  height: 30px;
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  font-size: 13px;
}

.side-card dl {
  display: grid;
  grid-template-columns: 1fr 42px;
  row-gap: 7px;
  margin: 0;
  padding: 10px;
}

.side-card dt {
  color: var(--muted);
}

.side-card dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.side-card p {
  margin: 0;
  padding: 10px;
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-cell {
  min-height: 38px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-cell:nth-child(3n) {
  border-right: 0;
}

.info-cell b {
  display: inline-block;
  min-width: 78px;
  color: var(--muted);
  font-weight: 400;
}

.list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 40px;
  height: 100vh;
  min-height: 0;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.list-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.list-footer .pager {
  height: 100%;
  border-top: 0;
  background: transparent;
}

.list-result-count {
  position: absolute;
  left: 10px;
  color: var(--muted);
}

.list-titlebar > div,
.toolbar-actions,
.category-chips,
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grace-btn {
  height: 26px;
  min-width: 62px;
  padding: 0 12px;
  color: #35404c;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.grace-btn-primary {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.list-table-wrap {
  overflow: auto;
  padding: 0 10px 10px;
}

.list-table {
  min-width: 3160px;
  table-layout: fixed;
}

.list-table th,
.list-table td {
  width: 118px;
  height: 30px;
}

.list-table th:first-child,
.list-table td:first-child {
  width: 240px;
}

.list-table th:nth-child(2),
.list-table td:nth-child(2) {
  width: 100px;
}

.list-table th:nth-child(6),
.list-table td:nth-child(6),
.list-table th:nth-child(7),
.list-table td:nth-child(7) {
  width: 210px;
}

.list-table th:nth-child(n+10):nth-child(-n+15),
.list-table td:nth-child(n+10):nth-child(-n+15) {
  width: 118px;
}

.list-table th:nth-child(16),
.list-table td:nth-child(16) {
  width: 300px;
}

.list-table th:nth-child(18),
.list-table td:nth-child(18) {
  width: 140px;
}

.list-table th:nth-child(n+19):nth-child(-n+22),
.list-table td:nth-child(n+19):nth-child(-n+22) {
  width: 90px;
}

.frozen-table thead {
  position: sticky;
  top: 0;
  z-index: 8;
}

.frozen-col {
  position: sticky;
  z-index: 4;
  background: #fff;
}

thead .frozen-col {
  z-index: 10;
  background: #f3f5f8;
}

.frozen-col-1 {
  left: 0;
}

.frozen-col-2 {
  left: 240px;
  box-shadow: 2px 0 3px rgb(40 50 60 / 10%);
}

.filter-row th {
  height: 58px;
  padding: 4px;
  background: #fafbfc;
}

.filter-row input,
.filter-row select {
  height: 26px;
  padding: 2px 5px;
  font-size: 11px;
}

.mini-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

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

.number {
  text-align: right;
}

.status-tag.created {
  color: var(--brand);
  border-color: #f6b38d;
  background: var(--brand-soft);
}

.empty-row,
.empty-inline {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fafbfc;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: none;
  min-width: 210px;
  padding: 10px 14px;
  color: #fff;
  background: #3d4855;
  box-shadow: 0 3px 12px rgb(0 0 0 / 18%);
}

.toast.show {
  display: block;
}

.parameter-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 280px;
}

.parameter-nav {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fafbfc;
}

.parameter-nav button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
}

.parameter-nav button.active {
  color: var(--brand);
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
}

.document-layout {
  min-height: 360px;
}

.document-filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  white-space: nowrap;
}

.document-filter-bar button {
  flex: 0 0 auto;
}

.document-filter-bar button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.document-content {
  min-width: 0;
}

.document-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.document-titlebar span {
  color: var(--muted);
  font-weight: 400;
}

.document-table {
  min-width: 760px;
}

.document-table th:nth-child(1),
.document-table td:nth-child(1) {
  width: 140px;
}

.document-table th:nth-child(2),
.document-table td:nth-child(2) {
  width: 300px;
}

.document-table th:nth-child(3),
.document-table td:nth-child(3) {
  width: 90px;
}

.document-table th:nth-child(4),
.document-table td:nth-child(4) {
  width: 150px;
}

.document-table th:nth-child(5),
.document-table td:nth-child(5) {
  width: 80px;
}

.document-table th:nth-child(6),
.document-table td:nth-child(6) {
  width: 100px;
}

.subsection-title {
  height: 34px;
  padding: 8px 10px;
  font-weight: 700;
}

.section-heading {
  justify-content: space-between;
  min-height: 36px;
  padding-right: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
}

.section-heading h2 {
  border-bottom: 0;
}

.category-chips button {
  height: 24px;
  color: #4a5663;
  border: 1px solid #cbd2dc;
  background: #fff;
}

.category-chips button.active {
  color: var(--brand);
  border-color: var(--brand);
}

.document-filter-bar.category-chips button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.section-heading.account-toolbar {
  justify-content: flex-start;
  gap: 16px;
}

.account-toolbar .category-chips button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.section-heading.calendar-heading {
  justify-content: flex-start;
  gap: 10px;
}

.calendar-heading .category-chips {
  flex: 0 0 auto;
}

.calendar-heading .category-chips button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.calendar-heading .section-caption {
  display: inline-block;
  flex: 0 0 auto;
  color: var(--muted);
  white-space: nowrap;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.table-action {
  padding: 0;
  color: var(--link);
  border: 0;
  background: transparent;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 32%);
}

.modal-mask[hidden] {
  display: none;
}

.simple-modal {
  width: 620px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 28px rgb(0 0 0 / 20%);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.modal-head button {
  border: 0;
  background: transparent;
  font-size: 18px;
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.data-note {
  color: #7a8491;
}

.action-link {
  color: var(--brand);
  text-decoration: none;
}

@media (max-width: 1360px) {
  .search-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .date-range {
    grid-column: span 2;
  }

  .search-grid-full {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .search-actions-end {
    grid-column: 3;
  }
}
