:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-tint: #eaf3ff;
  --line: #d8e0e7;
  --line-strong: #b8c6d1;
  --text: #111b26;
  --muted: #66717d;
  --blue: #1f6fd1;
  --blue-dark: #155db7;
  --green: #13805d;
  --amber: #a45f10;
  --red: #bd3535;
  --teal: #087b83;
  --sidebar: #121c26;
  --sidebar-soft: #1a2733;
  --sidebar-active: #edf5ff;
  --shadow: 0 12px 28px rgba(20, 35, 50, 0.08);
  --shadow-soft: 0 1px 2px rgba(20, 35, 50, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 26px;
}

h3 {
  font-size: 14px;
  line-height: 22px;
  margin-bottom: 8px;
}

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

.sidebar {
  background: var(--sidebar);
  color: #eef4f8;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf3ff;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 13px;
}

.brand-name {
  font-weight: 760;
  font-size: 16px;
  line-height: 22px;
}

.brand-subtitle {
  color: #a8b5c1;
  font-size: 12px;
  line-height: 18px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  min-height: 40px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  color: #c6d2dd;
  text-align: left;
  line-height: 20px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-soft);
  color: #ffffff;
}

.nav-section {
  margin: 14px 8px 5px;
  color: #8798a8;
  font-size: 12px;
  line-height: 18px;
  font-weight: 760;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-parent {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #eef4f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 720;
  text-align: left;
}

.nav-parent:hover {
  background: var(--sidebar-soft);
}

.nav-children {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  margin-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-children.collapsed {
  display: none;
}

.nav-child {
  min-height: 34px;
  padding: 0 10px;
  color: #b8c5d0;
  font-size: 13px;
}

.nav-child.active {
  background: var(--sidebar-active);
  color: var(--blue-dark);
  font-weight: 760;
  box-shadow: inset 3px 0 0 var(--blue);
}

.icon {
  width: 20px;
  text-align: center;
  color: #84b5ef;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 8px 2px;
}

.env-label {
  color: #9eacb8;
  font-size: 12px;
}

.env-value {
  margin-top: 4px;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 22px 28px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#viewSubtitle {
  color: var(--muted);
  font-size: 13px;
}

.view-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-height: 28px;
}

.subtitle-edit-button {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.subtitle-edit-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.subtitle-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  margin: -2px 0 14px;
  box-shadow: var(--shadow-soft);
}

.subtitle-editor .textarea-input {
  min-height: 84px;
  resize: vertical;
}

.subtitle-editor-actions {
  margin-top: 10px;
  justify-content: flex-end;
}

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

.search-box {
  width: 320px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.primary-action,
.secondary-action,
.icon-button,
.danger-action {
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.primary-action {
  min-height: 40px;
  padding: 0 15px;
  background: var(--blue);
  color: #fff;
  font-weight: 760;
  box-shadow: 0 6px 14px rgba(31, 111, 209, 0.18);
}

.primary-action:hover {
  background: var(--blue-dark);
}

.secondary-action {
  min-height: 38px;
  padding: 0 13px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 660;
}

.secondary-action:hover {
  border-color: #9eb1c2;
  background: #fbfdff;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.danger-action {
  min-height: 38px;
  padding: 0 14px;
  border-color: #f0b8b8;
  background: #fff6f6;
  color: var(--red);
}

.danger-action:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.identity-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e8edf2;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.avatar.online {
  background: #dff3ed;
  color: var(--green);
}

.identity-name {
  font-weight: 760;
  line-height: 22px;
}

.identity-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.identity-pills,
.task-meta,
.detail-actions,
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.identity-pills {
  justify-content: flex-end;
}

.wecom-identity-block {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.identity-switch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.identity-switch-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.identity-switch-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.top-actions {
  margin: -2px 0 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf2f6;
  color: #465461;
  font-size: 12px;
  max-width: 100%;
}

.pill.success {
  background: #ddf2ea;
  color: var(--green);
}

.pill.warning {
  background: #fff0dc;
  color: var(--amber);
}

.pill.danger {
  background: #fde7e7;
  color: var(--red);
}

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

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.metric {
  min-height: 124px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.metric:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 32px;
  line-height: 40px;
  margin-top: 8px;
}

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

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

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

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

.dictionary-page {
  display: block;
}

.dictionary-page-head {
  align-items: flex-start;
}

.dictionary-page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dictionary-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.dictionary-search {
  display: grid;
  gap: 6px;
  flex: 1 1 420px;
  max-width: 560px;
}

.dictionary-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.dictionary-stats {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dictionary-audit-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.dictionary-audit-bar strong {
  white-space: nowrap;
}

.dictionary-audit-bar > span {
  color: var(--muted);
  min-width: 0;
}

.dictionary-audit-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dictionary-table-wrap {
  min-height: 180px;
}

.dictionary-table td:last-child,
.dictionary-table th:last-child {
  width: 210px;
}

.empty-table-cell {
  color: var(--muted);
  text-align: center;
  padding: 34px 12px;
}

.system-subnav {
  display: inline-flex;
  gap: 4px;
  min-height: 38px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #e8edf2;
  overflow-x: auto;
}

.system-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4e5b67;
  padding: 0 14px;
  white-space: nowrap;
}

.system-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(31, 44, 58, 0.08);
}

.system-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.system-breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
}

.system-breadcrumb strong {
  color: var(--text);
}

.system-page {
  min-width: 0;
}

.system-home-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.system-entry-card {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.system-entry-card:hover {
  border-color: var(--blue);
  background: #fbfdff;
}

.system-entry-card span,
.system-entry-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.system-entry-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
  line-height: 36px;
}

.system-page-head,
.role-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.system-page-head p,
.role-detail-head p,
.panel-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  margin-top: 3px;
}

.role-workbench,
.role-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.role-detail-head {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

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

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

.permission-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.permission-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.permission-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.permission-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: var(--surface);
  min-width: 0;
  max-width: 100%;
}

.permission-table {
  min-width: 1100px;
}

.permission-table th,
.permission-table td {
  min-width: 132px;
  white-space: normal;
}

.permission-table th span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.permission-table th:first-child,
.permission-table td:first-child {
  min-width: 120px;
}

.permission-toggle {
  width: 46px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #edf2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-toggle.on {
  border-color: #b9decf;
  background: #ddf2ea;
  color: var(--green);
}

.field-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.field-mode-button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}

.field-mode-button strong,
.field-mode-button span {
  display: block;
}

.field-mode-button strong {
  line-height: 20px;
}

.field-mode-button span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.field-mode-button.success {
  border-color: #b9decf;
  background: #f2fbf7;
}

.field-mode-button.warning {
  border-color: #f0d2a3;
  background: #fffaf1;
}

.field-mode-button.masked {
  border-color: #c5d9ee;
  background: #f4f9ff;
}

.field-mode-button.danger {
  border-color: #f0b8b8;
  background: #fff6f6;
}

.split-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.wide-detail {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.7fr);
}

.panel,
.detail-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

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

.section-gap {
  margin-top: 16px;
}

.activity-list,
.record-list,
.task-board,
.finance-list,
.integration-rows {
  display: grid;
  gap: 10px;
}

.compact-list {
  gap: 8px;
}

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

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
}

.task-item strong,
.task-item > span,
.task-meta {
  grid-column: 1;
}

.task-item .secondary-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}

.activity-item,
.task-item,
.record-item,
.finance-item,
.integration-rows > div {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

button.record-item,
button.finance-item {
  width: 100%;
  text-align: left;
}

.plain-record-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: 100%;
}

.record-item:hover,
.finance-item:hover,
.activity-item:hover,
.task-item:hover {
  border-color: #b9cad9;
  background: #fbfdff;
}

.record-item.active-record {
  border-color: var(--blue);
  background: var(--surface-tint);
}

.activity-item strong,
.task-item strong,
.record-item strong,
.finance-item strong {
  display: block;
  line-height: 22px;
  color: var(--text);
}

.activity-item span,
.task-item span,
.record-item span,
.finance-item span,
.integration-rows span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.record-item p {
  color: #42515f;
  font-size: 13px;
  line-height: 20px;
  margin-top: 6px;
}

.linked-record-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.integration-rows strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  word-break: break-all;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.pending {
  background: var(--amber);
}

.status-dot.ready {
  background: var(--green);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.object-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}

.registration-list-head {
  align-items: center;
  justify-content: space-between;
}

.list-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.customer-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.registration-table {
  min-width: 1180px;
}

.registration-table th:nth-child(5),
.registration-table td:nth-child(5) {
  min-width: 220px;
}

.registration-table td {
  vertical-align: top;
}

.list-main {
  min-width: 0;
}

.list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.list-search {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted);
}

.list-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.list-count {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}

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

.media-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.media-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.media-filter-bar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 18px;
}

.media-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.list-pagination-summary,
.list-pagination-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.list-pagination-summary strong {
  color: var(--text);
  font-size: 13px;
}

.icon-page-action {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.icon-page-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rail-panel,
.section-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.approval-list-column {
  min-width: 0;
}

.section-title-row p {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  margin-top: 2px;
}

.risk-stack {
  display: grid;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  background: #e7edf3;
  padding: 3px;
  border-radius: 8px;
  min-height: 38px;
  overflow-x: auto;
}

.segment {
  border: 0;
  min-width: 76px;
  border-radius: 6px;
  background: transparent;
  color: #4e5b67;
  padding: 0 12px;
  white-space: nowrap;
}

.segment.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(31, 44, 58, 0.08);
  font-weight: 760;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.opportunity-table {
  min-width: 1440px;
}

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

.detail-subtable {
  min-width: 980px;
}

.customer-related-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 14px 12px;
}

.customer-related-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  min-height: 40px;
  padding: 0 12px;
}

.customer-related-tab.active {
  border-bottom-color: var(--blue);
  color: var(--text);
}

.request-application-table {
  min-width: 1480px;
}

.contract-v3-table {
  min-width: 1500px;
}

.media-v3-table {
  min-width: 1340px;
  table-layout: fixed;
}

.media-v3-table col.media-col-status {
  width: 108px;
}

.media-v3-table col.media-col-form {
  width: 116px;
}

.media-v3-table col.media-col-name {
  width: 190px;
}

.media-v3-table col.media-col-owner,
.media-v3-table col.media-col-first-owner {
  width: 112px;
}

.media-v3-table col.media-col-province,
.media-v3-table col.media-col-city {
  width: 72px;
}

.media-v3-table col.media-col-photo {
  width: 78px;
}

.media-v3-table col.media-col-spec {
  width: 140px;
}

.media-v3-table col.media-col-area {
  width: 68px;
}

.media-v3-table col.media-col-price {
  width: 108px;
}

.media-v3-table col.media-col-actions {
  width: 152px;
}

.media-v3-table th,
.media-v3-table td {
  padding: 11px 12px;
}

.media-v3-table th {
  white-space: nowrap;
}

.media-v3-table td {
  color: var(--text);
}

.media-v3-table .media-cell-value,
.media-v3-table .media-point-name,
.media-v3-table .media-money {
  color: var(--text);
  display: block;
  font-size: 13px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-v3-table .media-point-name {
  color: #14212b;
  font-weight: 780;
}

.media-v3-table .media-money {
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  text-align: right;
}

.media-v3-table th.media-col-price,
.media-v3-table td.media-col-price,
.media-v3-table th.media-col-area,
.media-v3-table td.media-col-area {
  text-align: right;
}

.media-v3-table td.media-col-photo {
  padding-bottom: 8px;
  padding-top: 8px;
}

.media-photo-thumb {
  align-items: center;
  background: #edf2f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-grid;
  height: 46px;
  justify-items: center;
  max-width: 62px;
  overflow: hidden;
  position: relative;
  width: 62px;
}

.media-photo-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.media-photo-more {
  align-items: center;
  background: rgba(20, 33, 43, 0.78);
  border-radius: 999px;
  bottom: 4px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 780;
  height: 17px;
  justify-content: center;
  line-height: 1;
  min-width: 22px;
  padding: 0 5px;
  position: absolute;
  right: 4px;
}

.media-photo-empty {
  align-items: center;
  background: #f7fafc;
  border: 1px dashed #c8d2dc;
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 760;
  height: 46px;
  justify-content: center;
  width: 62px;
}

.media-v3-table th.media-col-actions,
.media-v3-table td.media-col-actions {
  background: var(--surface);
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.05);
  position: sticky;
  right: 0;
  z-index: 1;
}

.media-v3-table th.media-col-actions {
  background: #eef3f7;
  z-index: 2;
}

.media-v3-table .media-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.media-v3-table .media-row-actions .secondary-action,
.media-v3-table .media-row-actions .danger-action {
  border-radius: 6px;
  font-size: 12px;
  min-height: 30px;
  padding: 0 8px;
}

.closing-v3-table {
  min-width: 1120px;
}

.compact-media-table {
  min-width: 820px;
}

.contract-v3-table tbody tr,
.media-v3-table tbody tr,
.closing-v3-table tbody tr {
  cursor: pointer;
}

.contract-v3-table tbody tr:hover,
.media-v3-table tbody tr:hover,
.closing-v3-table tbody tr:hover {
  background: rgba(31, 111, 235, 0.035);
}

.request-application-table .tag-cell {
  white-space: nowrap;
}

.request-application-table .row-actions {
  min-width: 82px;
}

.customer-name-cell strong {
  font-size: 14px;
}

.customer-name-cell > span {
  display: block;
  margin-top: 3px;
}

.opportunity-table .demand-site-cell {
  min-width: 220px;
}

.customer-health-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.customer-health-row > span:not(.pill) {
  color: var(--muted);
  font-size: 12px;
}

.customer-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.customer-detail-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 21px;
  vertical-align: middle;
}

th {
  font-size: 12px;
  color: var(--muted);
  background: #eef3f7;
  font-weight: 700;
  position: relative;
}

td span {
  color: var(--muted);
  font-size: 12px;
}

td > strong {
  line-height: 20px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
.selected-row {
  background: #eef7ff;
}

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

.row-actions .secondary-action,
.row-actions .primary-action {
  min-height: 34px;
  padding: 0 10px;
}

.action-cell {
  min-width: 158px;
}

.progress-text {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #40505e;
}

.detail-pane {
  min-height: 360px;
  position: sticky;
  top: 16px;
}

.project-detail {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.customer-detail-page {
  background: transparent;
  border: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  position: static;
}

.business-detail-page {
  background: transparent;
  border: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  position: static;
}

.back-action {
  margin-bottom: 0;
}

.detail-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  margin-bottom: 12px;
}

.detail-nav-row,
.detail-title-row,
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-nav-row {
  align-items: center;
  margin-bottom: 10px;
}

.detail-title-row h2 {
  font-size: 22px;
  line-height: 30px;
}

.detail-title-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  margin-top: 3px;
}

.detail-actionbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: min(430px, 100%);
}

.workflow-spine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.spine-step {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
}

.spine-step > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--line-strong);
}

.spine-step strong,
.spine-step small {
  grid-column: 2;
}

.spine-step strong {
  font-size: 13px;
  line-height: 20px;
}

.spine-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.spine-step.done > span {
  background: var(--green);
}

.spine-step.current {
  border-color: #b7ccea;
  background: #f4f9ff;
}

.spine-step.current > span {
  background: var(--blue);
}

.spine-step.blocked {
  border-color: #f0d2a3;
  background: #fffaf1;
}

.spine-step.blocked > span {
  background: var(--amber);
}

.key-summary {
  margin-bottom: 12px;
}

.detail-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 14px;
  align-items: start;
}

.detail-main,
.detail-rail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.section-card,
.rail-panel {
  padding: 12px;
}

.section-card h3,
.rail-panel h3 {
  margin-bottom: 10px;
}

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

.field-list div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.field-list div:nth-child(odd) {
  padding-right: 12px;
}

.field-list div:nth-child(even) {
  padding-left: 12px;
}

.field-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.field-list strong {
  display: block;
  margin-top: 3px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.business-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.matrix-item {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
  text-align: left;
}

.matrix-item:hover {
  border-color: #b9cad9;
  background: #f7fbff;
}

.matrix-item span,
.matrix-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.matrix-item strong {
  display: block;
  font-size: 22px;
  line-height: 30px;
  margin: 5px 0 2px;
}

.vertical-actions {
  display: grid;
  align-items: stretch;
}

.vertical-actions .secondary-action {
  justify-content: flex-start;
}

.single-column-grid {
  grid-template-columns: 1fr;
}

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

.detail-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.detail-head-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.detail-attachment-cell {
  grid-column: 1 / -1;
}

.detail-attachment-list {
  margin-top: 8px;
}

.detail-grid,
.summary-strip,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.detail-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.detail-section {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

.detail-section h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.section-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  margin-bottom: 10px;
}

.payment-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.28fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.payment-detail-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.payment-flow-panel {
  position: sticky;
  top: 12px;
}

.media-library-detail-main {
  margin-top: 14px;
}

.media-detail-photo-section {
  background: var(--surface);
}

.media-unified-shell {
  gap: 14px;
}

.media-unified-image-section {
  display: grid;
  gap: 12px;
}

.media-unified-image-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-image-manager {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.media-image-manager .section-title-row h3 {
  font-size: 14px;
  margin: 0;
}

.media-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.media-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  margin: 0;
  overflow: hidden;
  min-width: 0;
}

.media-photo-card img {
  aspect-ratio: 1 / 1;
  background: #edf2f7;
  display: block;
  object-fit: cover;
  width: 100%;
}

.media-photo-card figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
}

.media-photo-card figcaption strong,
.media-photo-card figcaption span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-photo-card figcaption strong {
  color: var(--text);
  font-size: 12px;
  line-height: 18px;
}

.media-photo-card figcaption span {
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.media-photo-placeholder {
  align-items: center;
  border: 1px dashed #c8d2dc;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 92px;
  padding: 12px;
}

.media-file-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.media-file-chip {
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-detail-file-groups {
  display: grid;
  gap: 10px;
}

.media-detail-file-groups > div > span,
.media-edit-file-preview > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 760;
  line-height: 18px;
}

.media-edit-photo-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.media-edit-photo-preview .section-title-row {
  align-items: center;
}

.media-edit-photo-preview .section-title-row h3 {
  font-size: 13px;
  margin: 0;
}

.media-photo-gallery-edit {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.media-photo-gallery-edit .media-photo-card figcaption {
  padding: 6px;
}

.media-asset-card img {
  aspect-ratio: 4 / 3;
  background: #eef3f8;
  object-fit: contain;
}

.media-asset-name-input {
  font-size: 12px;
  height: 34px;
  min-width: 0;
}

.media-asset-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.media-asset-replace-button {
  cursor: pointer;
  justify-content: center;
  min-height: 32px;
}

.media-edit-file-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
}

.media-create-shell {
  display: grid;
  gap: 12px;
}

.media-create-hero {
  position: sticky;
  top: 0;
  z-index: 4;
}

.media-create-section-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.media-create-section-nav a {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 10px;
  text-decoration: none;
}

.media-create-section-nav a small {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.media-create-section-nav a.is-conditional {
  background: #fffaf1;
  border-color: #f0d2a3;
}

.media-create-sections {
  display: grid;
  gap: 12px;
}

.media-create-section {
  scroll-margin-top: 118px;
}

.media-create-conditional-section {
  background: #fffdf8;
}

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

.media-create-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.media-create-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 18px;
}

.media-create-field-wide {
  grid-column: span 2;
}

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

.media-create-field.is-missing .field-input {
  border-color: #d9480f;
  box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.1);
}

.workflow-timeline {
  display: grid;
  gap: 10px;
}

.workflow-timeline div {
  border-left: 2px solid var(--blue);
  padding-left: 10px;
}

.workflow-timeline strong,
.workflow-timeline span {
  display: block;
}

.workflow-timeline span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.compact-detail-grid {
  margin: 0;
}

.compact-detail-grid div {
  background: var(--surface);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-link {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  padding: 7px 10px;
  text-decoration: none;
}

.attachment-link:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.12);
}

.detail-grid div,
.summary-strip div,
.summary-strip .summary-jump-card,
.mini-grid div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.summary-jump-card {
  text-align: left;
  color: var(--text);
}

.summary-jump-card:hover {
  border-color: #b9cad9;
  background: #fbfdff;
}

.detail-grid span,
.summary-strip span,
.mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong,
.summary-strip strong,
.mini-grid strong {
  display: block;
  margin-top: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.subsection {
  margin-top: 14px;
}

.payment-print-section {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

.payment-print-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.print-template-field {
  flex-wrap: wrap;
}

.payment-template-select {
  width: min(320px, 100%);
}

.print-template-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.print-modal-sheet {
  width: min(1120px, 100%);
}

.print-form-section {
  display: grid;
  gap: 16px;
  background: #f3f6f8;
}

.payment-print-context {
  display: grid;
  gap: 12px;
}

.print-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.print-meta-grid div {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px;
}

.print-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.print-meta-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.print-preview-shell {
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe6ec;
}

.print-paper {
  position: relative;
  width: min(760px, 100%);
  aspect-ratio: 210 / 297;
  min-height: 0;
  background: #fff;
  border: 1px solid #d9dee4;
  box-shadow: 0 10px 26px rgba(20, 35, 50, 0.14);
  padding: 48px 58px 48px 72px;
  color: #1a1f24;
}

.print-corner {
  position: absolute;
  top: 34px;
  width: 18px;
  height: 18px;
  border-top: 1px solid #d7dce1;
}

.print-corner-left {
  left: 34px;
  border-left: 1px solid #d7dce1;
}

.print-corner-right {
  right: 34px;
  border-right: 1px solid #d7dce1;
}

.print-content {
  width: min(560px, 100%);
  margin: 0 auto 0 0;
}

.print-title {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  left: 28px;
}

.print-title h2 {
  font-size: 26px;
  line-height: 32px;
  letter-spacing: 0;
}

.print-title::after {
  content: "";
  width: 216px;
  height: 2px;
  background: #1a1f24;
}

.print-body {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0;
}

.print-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-height: 20px;
}

.print-line strong {
  text-align: right;
}

.print-line span {
  border-bottom: 1px solid #1a1f24;
  overflow-wrap: anywhere;
}

.print-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 14px 0 0;
}

.print-signatures div {
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr);
  align-items: end;
  gap: 8px;
}

.print-signatures span {
  min-height: 20px;
  border-bottom: 1px solid #1a1f24;
}

.print-signatures .print-date {
  grid-column: 1 / -1;
  max-width: 180px;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-columns section {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 10px;
}

.detail-columns p {
  color: #42515f;
  font-size: 13px;
  line-height: 20px;
  margin-top: 4px;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #f0d2a3;
  background: #fffaf1;
  border-radius: 8px;
  padding: 9px;
}

.check-row.done {
  border-color: #cce7dc;
  background: #f2fbf7;
}

.check-row > span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.check-row.done > span {
  background: var(--green);
}

.check-row strong {
  display: block;
  font-size: 13px;
  line-height: 18px;
}

.check-row small {
  color: var(--muted);
  font-size: 12px;
}

.blocker-box {
  display: grid;
  gap: 4px;
  border: 1px solid #f0d2a3;
  background: #fffaf1;
  border-radius: 8px;
  padding: 10px;
  margin-top: 14px;
}

.success-box {
  border-color: #cce7dc;
  background: #f2fbf7;
}

.info-box {
  border-color: #c5d9ee;
  background: #f4f9ff;
}

.blocker-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.duplicate-box {
  border: 1px solid #f0d2a3;
  background: #fffaf1;
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
  color: #5a4630;
  font-size: 13px;
  line-height: 20px;
}

.empty-state {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.empty-inline {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.field-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.field-input:disabled {
  background: #eef2f5;
  color: #51606e;
  cursor: not-allowed;
}

.field-input:focus {
  border-color: var(--blue);
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.field-label,
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-hint {
  font-weight: 500;
}

.field-help-control {
  position: relative;
  display: block;
  width: 100%;
}

.field-help-control > .field-input {
  padding-right: 10px;
}

.field-help-control-select > .field-input {
  padding-right: 10px;
}

.field-help-dropzone {
  position: relative;
}

.field-help-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.field-help-button {
  position: static;
  flex: 0 0 auto;
  margin-left: auto;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #93a4b7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.field-help-button.has-field-help {
  border-color: rgba(31, 111, 209, 0.45);
  background: #f3f7fb;
  color: var(--blue);
}

.field-help-button.empty-field-help {
  opacity: 0;
  pointer-events: none;
}

label:hover > .field-help-label .field-help-button.empty-field-help,
label:focus-within > .field-help-label .field-help-button.empty-field-help,
.field-help-label:hover .field-help-button.empty-field-help {
  opacity: 0.62;
  pointer-events: auto;
}

.field-help-button:hover,
.field-help-button:focus-visible,
.field-help-button[aria-expanded="true"] {
  border-color: var(--blue);
  background: var(--surface-tint);
  color: var(--blue-dark);
  opacity: 1;
  pointer-events: auto;
  outline: none;
}

.field-help-popover {
  position: fixed;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #aac9ee;
  border-radius: 8px;
  background: #edf6ff;
  box-shadow: 0 12px 28px rgba(31, 111, 209, 0.18);
}

.field-help-popover::before {
  display: none;
}

.field-help-editor-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-help-editor {
  min-height: 76px;
  resize: vertical;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
}

.field-help-editor:focus {
  border-color: var(--blue);
  outline: none;
}

.field-help-readonly {
  color: var(--text);
  font-size: 12px;
  line-height: 18px;
  white-space: pre-wrap;
}

.field-help-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.compact-field-help-action {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.compact-select {
  width: 100%;
  height: 34px;
  padding-right: 28px;
}

.textarea-input {
  min-height: 84px;
  padding: 9px 10px;
  resize: vertical;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.attachment-dropzone {
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  min-height: 58px;
  padding: 10px;
  background: var(--surface-soft);
}

.attachment-dropzone:focus-within,
.attachment-dropzone:focus {
  border-color: var(--blue);
  outline: 0;
}

.attachment-upload-action {
  cursor: pointer;
}

.attachment-dropzone-text {
  color: var(--muted);
  font-size: 13px;
}

.attachment-draft-list {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-draft-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.wide {
  width: 100%;
  margin-top: 14px;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.code-output {
  min-height: 120px;
  background: #17212b;
  color: #e8f3ff;
  border-radius: 8px;
  padding: 12px;
  word-break: break-all;
  line-height: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #41505e;
}

.status-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.status-list > div {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 10px;
}

.status-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-list strong {
  display: block;
  margin-top: 4px;
  word-break: break-all;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  min-height: 38px;
  max-width: min(560px, calc(100vw - 32px));
  border-radius: 8px;
  background: #17212b;
  color: #fff;
  padding: 9px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: var(--shadow);
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: start center;
  overflow: auto;
  padding: 20px 18px;
  background: rgba(23, 33, 43, 0.42);
  z-index: 30;
}

.modal-backdrop.open {
  display: grid;
}

.form-workspace-backdrop {
  inset: 0 0 0 272px;
  place-items: stretch;
  overflow: hidden;
  padding: 22px 28px 24px;
  background: var(--bg);
}

.form-workspace-backdrop.open {
  display: grid;
}

.modal-sheet {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(23, 33, 43, 0.18);
}

.form-workspace-sheet {
  width: 100%;
  height: calc(100vh - 46px);
  max-height: none;
  display: grid;
  grid-template-areas:
    "head head"
    "nav body"
    "nav actions";
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.form-workspace-sheet .modal-head {
  grid-area: head;
  padding: 18px 20px;
}

.form-workspace-sheet .modal-body {
  grid-area: body;
  background: var(--surface);
}

.form-workspace-sheet .modal-actions {
  grid-area: actions;
  padding: 14px 20px;
}

.form-section-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: #f6f9fc;
}

.form-workspace-sheet .form-section-nav {
  grid-area: nav;
  align-items: stretch;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: #f5f8fb;
}

.form-section-nav-summary {
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 92px;
}

.form-workspace-sheet .form-section-nav-summary {
  min-width: 0;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
}

.form-section-nav-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.form-section-nav-summary strong {
  color: var(--text);
  font-size: 12px;
}

.form-workspace-sheet .form-section-nav-summary strong {
  font-size: 16px;
  line-height: 22px;
}

.form-section-chip-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
}

.form-workspace-sheet .form-section-chip-row {
  display: grid;
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}

.form-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.form-workspace-sheet .form-section-chip {
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  height: auto;
  padding: 8px 10px;
  text-align: left;
}

.form-section-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.form-section-chip.is-incomplete {
  border-color: #f1c36d;
  background: #fff8e8;
}

.form-section-chip.is-incomplete small {
  color: #9a5b00;
}

.form-section-chip.is-complete {
  border-color: #b8d8c2;
  background: #effaf3;
}

.form-section-chip.is-complete small {
  color: #2f7a4b;
}

.form-section-chip.is-optional {
  color: var(--muted);
}

.form-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.form-workspace-sheet .form-section {
  padding: 18px 24px;
}

.form-workspace-sheet .form-section h3 {
  margin-bottom: 12px;
}

.page-form-card {
  overflow: hidden;
}

.page-form-card .form-section:first-child {
  padding-top: 16px;
}

.page-form-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.form-page-host {
  min-height: 620px;
}

.long-form-page-shell.modal-sheet {
  width: 100%;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.long-form-page-shell .modal-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.long-form-page-shell .modal-head h2 {
  font-size: 22px;
  line-height: 30px;
}

.long-form-page-shell .back-text-button {
  width: auto;
  min-width: 72px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.long-form-page-shell .back-text-button::before {
  content: "←";
  margin-right: 4px;
}

.customer-page-shell {
  display: grid;
  grid-template-areas:
    "head head head"
    "nav body inspector"
    "nav actions inspector";
  grid-template-columns: 220px minmax(0, 1fr) 286px;
  gap: 16px;
}

.customer-page-shell .modal-head {
  grid-area: head;
}

.customer-page-shell .form-section-nav {
  grid-area: nav;
  align-self: start;
  position: sticky;
  top: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.customer-page-shell .form-section-nav-summary {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.customer-page-shell .form-section-nav-summary strong {
  font-size: 16px;
  line-height: 22px;
}

.customer-page-shell .form-section-chip-row {
  display: grid;
  gap: 8px;
  overflow: visible;
  padding: 0;
}

.customer-page-shell .form-section-chip {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
  padding: 8px 10px;
}

.customer-page-shell .modal-body {
  grid-area: body;
  display: grid;
  gap: 14px;
  overflow: visible;
}

.customer-page-shell .form-section,
.wizard-form-shell .form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.customer-page-shell .form-section {
  padding: 18px;
}

.customer-page-shell .form-section h3,
.wizard-form-shell .form-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 24px;
}

.customer-page-shell .modal-actions {
  grid-area: actions;
  position: sticky;
  bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.customer-vertical-shell {
  display: grid;
  gap: 14px;
}

.customer-vertical-shell .modal-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.customer-vertical-shell .modal-body {
  display: grid;
  gap: 14px;
  overflow: visible;
  counter-reset: customer-step;
}

.customer-vertical-shell .form-section {
  position: relative;
  padding: 18px 18px 18px 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  counter-increment: customer-step;
}

.customer-vertical-shell .form-section::before {
  content: counter(customer-step);
  position: absolute;
  top: 18px;
  left: 18px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.customer-vertical-shell .form-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 24px;
}

.customer-vertical-shell .modal-actions {
  position: sticky;
  bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-save-inspector {
  grid-area: inspector;
  align-self: start;
  position: sticky;
  top: 0;
}

.form-save-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-save-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-save-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.form-save-title strong {
  font-size: 16px;
  line-height: 22px;
}

.form-save-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf1;
}

.form-save-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.form-save-checks {
  display: grid;
  gap: 8px;
}

.form-save-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.form-save-check span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.form-save-check.warn span {
  background: #fff4dc;
  color: var(--amber);
}

.form-save-check.done span {
  background: #e4f6ed;
  color: var(--green);
}

.form-save-check strong {
  overflow-wrap: anywhere;
}

.form-save-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.wizard-form-shell {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.wizard-form-shell .modal-head {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  box-shadow: none;
}

.wizard-form-shell .modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 14px;
  padding: 18px;
  background: var(--bg);
  overflow: visible;
}

.wizard-form-shell .form-section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px;
  display: block;
}

.wizard-form-shell.wizard-mode-vertical .modal-body {
  counter-reset: opportunity-step;
}

.wizard-form-shell.wizard-mode-vertical .form-section {
  position: relative;
  display: block;
  max-width: none;
  padding-left: 58px;
  counter-increment: opportunity-step;
}

.wizard-form-shell .form-grid {
  width: 100%;
}

.wizard-form-shell.wizard-mode-vertical .form-section::before {
  content: counter(opportunity-step);
  position: absolute;
  top: 18px;
  left: 18px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.wizard-form-shell .modal-actions {
  align-items: center;
  border-radius: 0 0 8px 8px;
}

.short-task-sheet {
  width: min(620px, 100%);
  border-radius: 10px;
}

.short-task-sheet .modal-body {
  overflow: visible;
}

.short-task-sheet .form-section {
  border-bottom: 0;
}

.print-confirm-sheet {
  width: min(1120px, 100%);
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-note-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.form-note-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.form-note-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.form-grid label.required-field > span {
  color: var(--text);
}

.field-label.required-field {
  color: var(--text);
}

@media (max-width: 1180px) {
  .customer-page-shell {
    grid-template-areas:
      "head"
      "nav"
      "body"
      "inspector"
      "actions";
    grid-template-columns: 1fr;
  }

  .customer-page-shell .form-section-nav,
  .form-save-inspector {
    position: static;
  }

  .customer-page-shell .form-section-chip-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .long-form-page-shell .modal-head,
  .wizard-form-shell .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .long-form-page-shell .back-text-button {
    width: max-content;
  }

  .customer-page-shell {
    gap: 12px;
  }

  .customer-page-shell .form-section-nav,
  .customer-page-shell .form-section,
  .form-save-panel,
  .wizard-form-shell,
  .wizard-form-shell .form-section {
    border-radius: 8px;
  }

  .customer-page-shell .form-section-chip-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wizard-form-shell .modal-body {
    padding: 12px;
  }

  .wizard-form-shell.wizard-mode-vertical .form-section {
    padding-left: 50px;
  }
}

.required-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #c81e1e;
  font-weight: 800;
  vertical-align: baseline;
  white-space: nowrap;
}

.required-field-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  vertical-align: baseline;
  white-space: nowrap;
}

.required-field-inline .required-marker {
  color: #c81e1e;
  font-weight: 800;
}

.required-marker {
  color: #c81e1e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.full-span {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.modal-actions.page-form-actions {
  bottom: 0;
  position: sticky;
}

@media (max-width: 1180px) {
  .split-detail,
  .wide-detail,
  .content-split,
  .wecom-grid,
  .role-workbench,
  .role-detail-layout,
  .list-workbench,
  .detail-workbench {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    position: static;
  }

  .dictionary-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .dictionary-search {
    max-width: none;
  }

  .dictionary-stats {
    justify-content: flex-start;
  }

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

  .dictionary-audit-pills {
    justify-content: flex-start;
  }

  .project-detail {
    max-height: none;
  }

  .metric-grid,
  .finance-grid,
  .domain-grid,
  .compact-board,
  .system-home-grid,
	  .permission-summary,
    .business-matrix {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }
	}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 184px 1fr;
  }

  .form-workspace-backdrop {
    inset: 0 0 0 184px;
    padding: 16px;
  }

  .form-workspace-sheet {
    grid-template-columns: 212px minmax(0, 1fr);
    height: calc(100vh - 32px);
  }

  .detail-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actionbar {
    min-width: 0;
    justify-content: flex-start;
  }

  .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-foot {
    display: none;
  }

  .nav-item {
    padding: 0 10px;
  }

  .nav-section {
    margin-left: 4px;
  }

  .nav-children {
    padding-left: 8px;
    margin-left: 6px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 10px;
  }

  .brand {
    display: none;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .nav-section,
  .nav-parent {
    display: none;
  }

  .nav-group,
  .nav-children {
    display: contents;
  }

  .nav-item {
    height: 40px;
    min-width: 112px;
    justify-content: center;
    padding: 0 10px;
  }

  .workspace {
    padding: 16px;
  }

  .modal-backdrop.form-workspace-backdrop {
    inset: 0;
    padding: 0;
  }

  .form-workspace-sheet {
    height: 100vh;
    border: 0;
    border-radius: 0;
    grid-template-areas:
      "head"
      "nav"
      "body"
      "actions";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .form-workspace-sheet .modal-head {
    padding: 14px 16px;
  }

  .form-workspace-sheet .form-section-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-workspace-sheet .form-section-nav-summary {
    align-items: center;
    display: flex;
    gap: 8px;
    padding: 0;
    border-bottom: 0;
  }

  .form-workspace-sheet .form-section-nav-summary strong {
    font-size: 13px;
    line-height: 18px;
  }

  .form-workspace-sheet .form-section-chip-row {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    width: 100%;
  }

  .form-workspace-sheet .form-section-chip {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
  }

  .form-workspace-sheet .form-section {
    padding: 16px;
  }

  .toolbar,
  .object-page-head,
  .list-controls,
  .detail-title-row,
  .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-pills {
    justify-content: flex-start;
  }

  .metric-grid,
  .finance-grid,
  .domain-grid,
  .compact-board,
  .system-home-grid,
  .permission-summary,
  .field-rule-grid,
  .detail-grid,
  .summary-strip,
  .detail-section-grid,
  .detail-columns,
  .payment-detail-layout,
  .media-create-grid,
  .mini-grid,
  .button-row,
  .form-grid,
  .field-list,
  .identity-switch-grid,
  .print-meta-grid,
  .business-matrix {
    grid-template-columns: 1fr;
  }

  .field-list div:nth-child(odd),
  .field-list div:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
  }

  .media-create-field-wide,
  .media-create-field-full {
    grid-column: auto;
  }

  .media-create-hero {
    position: static;
  }

  .media-photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }

  .media-unified-image-grid {
    grid-template-columns: 1fr;
  }

  .media-photo-gallery-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-image-manager .media-photo-gallery-edit {
    grid-template-columns: 1fr;
  }

  .object-page-head .primary-action,
  .detail-actionbar,
  .detail-actionbar .primary-action,
  .detail-actionbar .secondary-action,
  .list-search {
    width: 100%;
  }

  .detail-actionbar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actionbar > * {
    width: auto;
    min-width: 0;
  }

  .workflow-spine {
    grid-template-columns: 1fr;
  }

  .payment-flow-panel {
    position: static;
  }

  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap table thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .table-wrap td {
    border-bottom: 0;
    display: grid;
    grid-template-columns: minmax(82px, 0.36fr) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    padding-top: 2px;
  }

  .table-wrap td[colspan] {
    display: block;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }

  .table-wrap .row-actions {
    display: grid;
  }

  .media-v3-table th.media-col-actions,
  .media-v3-table td.media-col-actions {
    box-shadow: none;
    position: static;
  }

  .media-v3-table .media-row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-wrap .row-actions .primary-action,
  .table-wrap .row-actions .secondary-action,
  .table-wrap .row-actions .danger-action {
    width: 100%;
  }

  .task-item {
    grid-template-columns: 1fr;
  }

  .task-item .secondary-action {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .full-span {
    grid-column: auto;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-sheet {
    max-height: calc(100vh - 24px);
  }

  .form-section-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .form-section-nav-summary {
    align-items: center;
    display: flex;
    gap: 8px;
  }

  .form-section-chip-row {
    flex-wrap: wrap;
    overflow: visible;
    width: 100%;
  }

  .detail-head {
    flex-direction: column;
  }

  .detail-head-actions {
    width: 100%;
    justify-items: stretch;
  }

	  .segmented {
    width: 100%;
  }

  .segment {
    min-width: 92px;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions .primary-action {
    width: 100%;
  }

  .payment-print-controls,
  .payment-print-controls .primary-action,
  .print-template-field,
  .payment-template-select {
    width: 100%;
  }

  .print-preview-shell {
    padding: 10px;
  }

  .print-paper {
    min-height: 0;
    padding: 42px 22px;
  }

  .print-line {
    grid-template-columns: minmax(72px, 0.38fr) minmax(0, 1fr);
  }

  .print-signatures {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    background: #fff;
  }

  body > * {
    display: none !important;
  }

  #paymentPrintModal {
    position: fixed;
    inset: 0 auto auto 0;
    display: block !important;
    padding: 0;
    margin: 0;
    background: #fff;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    visibility: visible;
    z-index: 1;
  }

  #paymentPrintModal * {
    visibility: visible;
  }

  #paymentPrintModal .modal-sheet,
  #paymentPrintModal .print-preview-shell {
    border: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    width: 100%;
  }

  #paymentPrintModal .modal-head,
  #paymentPrintModal .payment-print-context,
  #paymentPrintModal .modal-actions {
    display: none;
  }

  #paymentPrintModal .print-form-section {
    display: block;
    padding: 0;
    background: #fff;
    border: 0;
  }

  #paymentPrintModal .print-paper {
    width: 210mm;
    height: 297mm;
    min-height: 0;
    aspect-ratio: auto;
    margin: 0;
    box-shadow: none;
    border: 0;
    padding: 20mm 0 0 20mm;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  #paymentPrintModal .print-corner {
    top: 12mm;
    width: 5mm;
    height: 5mm;
  }

  #paymentPrintModal .print-corner-left {
    left: 16mm;
  }

  #paymentPrintModal .print-corner-right {
    right: 16mm;
  }

  #paymentPrintModal .print-content {
    width: 142mm;
    margin: 0 auto 0 0;
  }

  #paymentPrintModal .print-title {
    gap: 2.5mm;
    margin-bottom: 5mm;
    left: 14mm;
  }

  #paymentPrintModal .print-title h2 {
    font-size: 20pt;
    line-height: 24pt;
  }

  #paymentPrintModal .print-title::after {
    width: 58mm;
    height: 0.5mm;
  }

  #paymentPrintModal .print-body {
    gap: 2mm;
    width: 100%;
  }

  #paymentPrintModal .print-line {
    grid-template-columns: 26mm minmax(0, 1fr);
    gap: 3mm;
    min-height: 5mm;
    font-size: 10.5pt;
    line-height: 14pt;
  }

  #paymentPrintModal .print-line span {
    border-bottom-width: 0.25mm;
  }

  #paymentPrintModal .print-signatures {
    gap: 3.5mm;
    width: 100%;
    margin-top: 5mm;
    font-size: 10.5pt;
    line-height: 14pt;
  }

  #paymentPrintModal .print-signatures div {
    gap: 3mm;
  }

  #paymentPrintModal .print-signatures span {
    min-height: 5mm;
  }

  #paymentPrintModal .print-signatures .print-date {
    max-width: 48mm;
  }
}
