* {
  box-sizing: border-box;
}

:root {
  --sidebar-width: 176px;
  --portal-desktop-width: 1280px;
  --page-bg: #f6f1e8;
  --surface: #fffdf8;
  --surface-subtle: #f8f1e6;
  --line: #e3d9c9;
  --line-soft: #eee4d5;
  --text: #1e252b;
  --heading: #151b20;
  --muted: #706b61;
  --brand: #b87318;
  --primary: #b87318;
  --brand-dark: #6c4717;
  --brand-panel: #e5d3b2;
  --sidebar-bg: #efe2c9;
  --sidebar-bg-strong: #e5d3b2;
  --sidebar-text: #443b31;
  --sidebar-muted: #7c6f5f;
  --sidebar-border: #dbc7a5;
  --sidebar-glow: rgba(184, 115, 24, 0.13);
  --accent: #b87318;
  --danger: #b42318;
  --warning: #a05a00;
  --success: #087443;
  --focus-ring: rgba(108, 71, 23, 0.2);
  --surface-hover: #f4ead8;
  --table-head: #f6eddd;
  --soft-shadow: 0 10px 26px rgba(96, 66, 28, 0.07);
  --metric-danger-bg: #fff8f6;
  --metric-warning-bg: #fff8ea;
  --metric-info-bg: #f3f7ff;
  --metric-success-bg: #f5fbf8;
  --metric-subtle-bg: #fffdf8;
}

html[data-portal-theme="bluegray"] {
  --page-bg: #f3f6fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --line: #d9e1ea;
  --line-soft: #e7edf5;
  --text: #192231;
  --heading: #101828;
  --muted: #697386;
  --brand: #315f8f;
  --primary: #315f8f;
  --brand-dark: #233f63;
  --brand-panel: #d7e2ed;
  --sidebar-bg: #e6edf4;
  --sidebar-bg-strong: #d7e2ed;
  --sidebar-text: #2d3b4d;
  --sidebar-muted: #697386;
  --sidebar-border: #cbd8e3;
  --sidebar-glow: rgba(49, 95, 143, 0.1);
  --accent: #a76618;
  --focus-ring: rgba(49, 95, 143, 0.18);
  --surface-hover: #eef3f8;
  --table-head: #edf3f8;
  --soft-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
  --metric-danger-bg: #fff8f8;
  --metric-warning-bg: #fffaf0;
  --metric-info-bg: #f3f7ff;
  --metric-success-bg: #f6fbf9;
  --metric-subtle-bg: #ffffff;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.platform-delegation-banner {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  color: #fff;
  background: #b42318;
  box-shadow: 0 6px 18px rgb(180 35 24 / 24%);
}

.platform-delegation-banner > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.platform-delegation-banner strong {
  font-size: 15px;
}

.platform-delegation-banner span {
  color: #fee4e2;
  font-size: 13px;
}

.platform-delegation-banner .platform-delegation-readonly {
  padding: 3px 8px;
  color: #7a271a;
  background: #fef3f2;
  border-radius: 999px;
  font-weight: 700;
}

.platform-delegation-exit {
  min-height: 34px;
  padding: 7px 13px;
  color: #b42318;
  background: #fff;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.tenant-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.truncated-text-tooltip {
  position: fixed;
  z-index: 1200;
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  color: var(--heading);
  background: color-mix(in srgb, var(--surface) 96%, white);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.16);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  pointer-events: auto;
  user-select: text;
  cursor: text;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  backdrop-filter: blur(12px);
}

.truncated-text-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.96) 0 12%, transparent 34%),
    radial-gradient(circle at 42% 42%, rgba(185, 130, 44, 0.18), transparent 28%),
    radial-gradient(circle at 58% 58%, rgba(47, 95, 135, 0.16), transparent 34%),
    linear-gradient(180deg, #f8fafc, #edf3f8);
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(47, 95, 135, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47, 95, 135, 0.04) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at center, #000 0 42%, transparent 78%);
}

.login-shell {
  width: min(388px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.28));
  box-shadow:
    0 34px 90px rgba(27, 45, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.login-form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(127, 144, 166, 0.26);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 18px 42px rgba(32, 48, 66, 0.08);
}

.login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 34px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #c6923d, transparent);
  opacity: 0.9;
}

.login-form input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(127, 144, 166, 0.26);
  border-radius: 10px;
  padding: 0 15px;
  color: #172033;
  background: rgba(255, 255, 255, 0.62);
  outline: none;
  font-size: 15px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-form input::placeholder {
  color: #7a8699;
  font-weight: 520;
}

.login-form input:focus {
  border-color: rgba(96, 116, 139, 0.34);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 0 0 4px rgba(47, 95, 135, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-turnstile {
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.login-form button,
.ghost-button {
  height: 50px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
}

.login-form button {
  color: #ffffff;
  background: linear-gradient(180deg, #2f5f87, #254d70);
  font-size: 16px;
  font-weight: 850;
  box-shadow:
    0 14px 26px rgba(47, 95, 135, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.login-form button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow:
    0 18px 34px rgba(47, 95, 135, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.login-form button:active {
  transform: translateY(0);
}

.error-message {
  margin: 0 0 12px;
  padding: 11px 14px;
  color: #9f1d20;
  background: rgba(255, 240, 240, 0.86);
  border: 1px solid rgba(255, 164, 164, 0.72);
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .login-shell {
    width: min(360px, calc(100vw - 28px));
    padding: 10px;
    border-radius: 18px;
  }

  .login-form {
    padding: 20px;
  }
}

.compliance-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: var(--page-bg);
}

.compliance-modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(23, 32, 42, 0.14);
}

.compliance-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.compliance-modal-card h1,
.compliance-modal-card h2 {
  margin: 0;
  color: #101828;
  font-size: 26px;
  line-height: 1.25;
}

.compliance-modal-card h2 {
  font-size: 22px;
}

.compliance-version {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.compliance-confirmation-text {
  margin: 20px 0 16px;
  padding: 18px 20px;
  color: #344054;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  line-height: 1.8;
}

.compliance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 0 18px;
}

.compliance-links a {
  color: var(--brand);
  font-weight: 700;
}

.compliance-form {
  display: grid;
  gap: 16px;
}

.compliance-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #344054;
  font-weight: 700;
  line-height: 1.6;
}

.compliance-check input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

.compliance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.compliance-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
}

.compliance-gate-card {
  width: min(720px, calc(100vw - 32px));
}

.legal-document-shell {
  max-width: 980px;
  margin: 0 auto;
}

.legal-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.legal-document-head h1 {
  margin: 0;
  font-size: 24px;
}

.legal-document-body {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.legal-document-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #344054;
  font-family: inherit;
  line-height: 1.8;
}

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

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
  overflow-y: auto;
  padding: 20px 12px;
  color: var(--sidebar-text);
  background:
    linear-gradient(180deg, var(--sidebar-glow), transparent 34%),
    var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.brand {
  margin-bottom: 22px;
}

.brand strong {
  display: block;
  color: var(--sidebar-text);
  font-size: 14px;
  line-height: 1.3;
}

.brand small {
  font-size: 11px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-section {
  margin: 14px 10px 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 800;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item-active {
  color: #ffffff;
  background: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(38, 57, 76, 0.14);
}

.nav-item:hover {
  transform: translateX(1px);
  background: var(--brand-dark);
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar span {
  margin-left: 12px;
  color: var(--muted);
}

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

.topbar-actions form {
  margin: 0;
}

.ghost-button {
  background: var(--surface-subtle);
  color: #344054;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 3px;
}

.theme-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button.is-active {
  color: #ffffff;
  background: var(--brand-dark);
  box-shadow: 0 6px 14px var(--focus-ring);
}

.text-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.content {
  padding: 28px 32px;
}

.page-heading {
  margin-bottom: 20px;
}

.page-heading p {
  margin: 0 0 4px;
  color: var(--muted);
}

.page-heading h1 {
  margin: 0;
  color: var(--heading);
  font-size: 30px;
  line-height: 1.16;
}

.empty-state {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.snapshot-meta {
  display: flex;
  gap: 12px;
  color: #667085;
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card,
.worklist,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.metric-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.metric-card span {
  color: #667085;
  font-size: 14px;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.metric-card.danger {
  border-color: #ffd7d7;
  background: #fffafa;
}

.metric-card.warning {
  border-color: #ffe4b5;
  background: #fffaf0;
}

.metric-card.info {
  border-color: #c7d7fe;
  background: #f4f7ff;
}

.metric-card.subtle {
  border-color: #ddd6fe;
  background: #fbfaff;
}

.metric-card small {
  color: #98a2b3;
  font-size: 12px;
}

.metric-card-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-card-link:hover {
  border-color: #9db7ff;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.worklist {
  padding: 20px;
  margin-bottom: 20px;
}

.worklist h2,
.table-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.worklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.worklist-grid div {
  padding: 14px;
  background: #f8fafc;
  border-radius: 6px;
}

.worklist-grid span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
}

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

.table-panel {
  overflow: hidden;
  padding: 20px;
}

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

.platform-table th,
.platform-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: #344054;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.platform-table th {
  color: var(--muted);
  background: var(--table-head);
  font-weight: 800;
}

.table-panel tbody tr {
  transition: background-color 0.14s ease;
}

.table-panel tbody tr:hover td {
  background: var(--surface-hover);
}

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

.muted-line {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.platform-task-table th:first-child,
.platform-task-table td:first-child {
  width: 12%;
}

.platform-task-table th:nth-child(2),
.platform-task-table td:nth-child(2) {
  width: 16%;
}

.platform-task-table th:nth-child(3),
.platform-task-table td:nth-child(3) {
  width: 16%;
}

.platform-task-table th:nth-child(4),
.platform-task-table td:nth-child(4) {
  width: 10%;
}

.platform-task-table th:nth-child(5),
.platform-task-table td:nth-child(5) {
  width: 8%;
}

.platform-task-table th:nth-child(6),
.platform-task-table td:nth-child(6) {
  width: 20%;
}

.platform-task-table th:nth-child(7),
.platform-task-table td:nth-child(7) {
  width: 10%;
}

.platform-task-table th:nth-child(8),
.platform-task-table td:nth-child(8) {
  width: 8%;
}

.inline-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-action-group form {
  margin: 0;
}

.log-trace-links {
  margin-top: 8px;
}

.platform-log-table th:first-child,
.platform-log-table td:first-child {
  width: 11%;
}

.platform-log-table th:nth-child(2),
.platform-log-table td:nth-child(2) {
  width: 9%;
}

.platform-log-table th:nth-child(3),
.platform-log-table td:nth-child(3) {
  width: 17%;
}

.platform-log-table th:nth-child(4),
.platform-log-table td:nth-child(4) {
  width: 12%;
}

.platform-log-table th:nth-child(5),
.platform-log-table td:nth-child(5) {
  width: 12%;
}

.platform-log-table th:nth-child(7),
.platform-log-table td:nth-child(7) {
  width: 22%;
}

.tenant-health-panel {
  margin-bottom: 20px;
}

.tenant-health-panel .panel-heading p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.tenant-health-table th:first-child,
.tenant-health-table td:first-child {
  width: 16%;
}

.tenant-health-table th:nth-child(2),
.tenant-health-table td:nth-child(2) {
  width: 10%;
}

.tenant-health-table th:nth-child(3),
.tenant-health-table td:nth-child(3) {
  width: 17%;
}

.tenant-health-table th:nth-child(4),
.tenant-health-table td:nth-child(4) {
  width: 17%;
}

.tenant-health-table th:nth-child(5),
.tenant-health-table td:nth-child(5) {
  width: 14%;
}

.tenant-health-table th:nth-child(6),
.tenant-health-table td:nth-child(6) {
  width: 16%;
}

.tenant-health-table th:nth-child(7),
.tenant-health-table td:nth-child(7) {
  width: 10%;
}

.tenant-troubleshooting-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tenant-troubleshooting-panel .panel-heading p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.tenant-troubleshooting-panel h3 {
  margin: 0;
  font-size: 16px;
}

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

.compact-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.compact-stats-grid div {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.compact-stats-grid dt {
  color: #667085;
  font-size: 12px;
}

.compact-stats-grid dd {
  margin: 4px 0 0;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.compact-platform-table th,
.compact-platform-table td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.warning-note,
.success-note {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}

.warning-note {
  color: #92400e;
  background: #fff7ed;
}

.success-note {
  color: #087443;
  background: #eaf7ef;
}

.ops-detail-layout {
  align-items: start;
  margin-bottom: 16px;
}

.ops-check-table th:first-child,
.ops-check-table td:first-child {
  width: 18%;
}

.ops-check-table th:nth-child(2),
.ops-check-table td:nth-child(2) {
  width: 12%;
}

.ops-check-table th:nth-child(3),
.ops-check-table td:nth-child(3) {
  width: 18%;
}

.ops-task-table th,
.ops-task-table td {
  text-align: center;
}

.ops-task-table th:first-child,
.ops-task-table td:first-child {
  text-align: left;
}

.ops-volume-table th:first-child,
.ops-volume-table td:first-child {
  width: 32%;
}

.ops-volume-table th:nth-child(2),
.ops-volume-table td:nth-child(2) {
  width: 18%;
  text-align: right;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.entry-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.form-panel {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.compact-form-panel {
  max-width: 640px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 14px;
}

.required-mark {
  color: #d92d20;
  font-style: normal;
  font-weight: 800;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  color: #17202a;
  background: #ffffff;
  font-size: 14px;
}

.form-section-title {
  margin-top: 8px;
  padding-top: 4px;
  color: #10233f;
  font-size: 15px;
  font-weight: 800;
}

.form-errors,
.errorlist {
  margin: 0;
  padding: 0;
  color: #b42318;
  font-size: 13px;
  list-style: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.settings-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.settings-card h2 {
  margin: 8px 0;
  font-size: 20px;
}

.settings-card p {
  margin: 0;
  color: #667085;
  line-height: 1.6;
}

.settings-card-kicker {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.platform-settings-card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.platform-settings-card:hover,
.platform-settings-card:focus-visible {
  border-color: rgba(47, 109, 143, 0.42);
  box-shadow: 0 14px 32px rgba(30, 64, 90, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.platform-settings-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: #667085;
  font-size: 13px;
}

.platform-settings-card-footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.platform-settings-card-footer strong {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 14px;
}

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

.settings-profile-meta > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-profile-meta span {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.settings-profile-meta strong {
  overflow-wrap: anywhere;
}

.muted-card {
  background: #f8fafc;
}

.searchable-select {
  position: relative;
}

.searchable-select-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  color: #17202a;
  background: #ffffff;
  font-size: 14px;
}

.searchable-select-input:focus {
  border-color: #1f6feb;
  outline: 2px solid rgba(31, 111, 235, 0.16);
  outline-offset: 0;
}

.searchable-select-original {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.searchable-select-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 14px 32px rgba(23, 32, 42, 0.14);
}

.searchable-select-option {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 7px 9px;
  color: #17202a;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}

.searchable-select-option:hover {
  background: #eef4ff;
}

.searchable-select-empty {
  padding: 8px 9px;
  color: #667085;
  font-size: 14px;
}

.checkbox-field {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

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

.contract-action-buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.entry-modal-footer.contract-action-footer {
  justify-content: flex-start;
}

.contract-save-note {
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.contract-save-note-panel {
  align-self: end;
  padding: 0 4px 4px;
}

.contract-save-note-panel span {
  display: block;
}

.clipboard-file-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: end;
}

.clipboard-file-upload-field {
  min-width: 0;
}

.clipboard-file-upload-field input[type="file"] {
  width: 100%;
}

.upload-card-form .clipboard-file-upload-layout {
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: stretch;
}

.upload-card-form .clipboard-file-paste-box {
  min-height: 58px;
}

.clipboard-file-paste-box {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed #9aaec2;
  border-radius: 8px;
  color: #344054;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  cursor: text;
}

.clipboard-file-paste-box:focus {
  outline: 2px solid rgba(31, 111, 235, 0.24);
  outline-offset: 2px;
  border-color: #1f6feb;
}

.clipboard-file-paste-box.has-file {
  border-style: solid;
  border-color: #8ec5a7;
  background: #f3faf6;
}

.clipboard-file-paste-title {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
}

.clipboard-file-paste-name {
  min-width: 0;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-grid .id-card-ocr-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 14px;
}

.entry-modal .id-card-ocr-dropzone {
  display: flex;
  width: 100%;
  min-height: 92px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 2px dashed #7b93ac;
  border-radius: 8px;
  color: #344054;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
}

.entry-modal .id-card-ocr-dropzone:focus {
  outline: 2px solid rgba(31, 111, 235, 0.24);
  outline-offset: 2px;
  border-color: #1f6feb;
}

.entry-modal .id-card-ocr-dropzone.is-loading {
  border-style: solid;
  border-color: #d19b2a;
  background: #fffaf0;
}

.entry-modal .id-card-ocr-dropzone.has-file {
  border-style: solid;
  border-color: #8ec5a7;
  background: #f3faf6;
}

.entry-modal .id-card-ocr-dropzone.is-error {
  border-style: solid;
  border-color: #f04438;
  background: #fff6f5;
}

.id-card-ocr-title {
  font-weight: 800;
}

.id-card-ocr-status {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .clipboard-file-upload-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .contract-import-guide {
    min-height: 0;
  }

  .contract-import-guide-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* SMS service settings and merchant evidence ledger. */
.sms-channel-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sms-channel-heading {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.sms-channel-heading strong,
.sms-provider-config-card header strong {
  display: block;
  color: var(--heading);
  font-size: 16px;
  font-weight: 900;
}

.sms-channel-heading small,
.sms-provider-config-card header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.sms-service-switch {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--heading);
  font-weight: 800;
  white-space: nowrap;
}

.sms-service-switch input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.sms-provider-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.sms-provider-option {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.sms-provider-option:has(input:checked) {
  border-color: var(--theme-action);
  background: var(--theme-action-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-action) 10%, transparent);
}

.sms-provider-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.sms-provider-option strong,
.sms-provider-option small {
  display: block;
}

.sms-provider-option strong {
  color: var(--heading);
  font-weight: 900;
}

.sms-provider-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.sms-provider-config-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sms-provider-config-card header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-subtle);
}

.sms-provider-fields {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.sms-provider-fields > label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.sms-provider-fields input[type="text"],
.sms-provider-fields input[type="password"] {
  width: 100%;
}

.sms-provider-fields > label > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.sms-provider-fields .sms-clear-field {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.sms-provider-fields .sms-clear-field span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sms-page-heading {
  margin-bottom: 12px;
}

.sms-filter-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
}

.sms-filter-form {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(190px, .65fr) 164px 92px 82px;
  gap: 10px;
  align-items: center;
}

.sms-filter-form input,
.sms-filter-form select {
  width: 100%;
  min-width: 0;
  height: 40px;
}

.sms-filter-form .primary-button,
.sms-filter-form .secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.sms-record-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

.sms-record-layout.without-detail {
  grid-template-columns: 1fr;
}

.sms-record-table-panel {
  min-width: 0;
  overflow-x: auto;
}

.sms-record-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.sms-record-table th:first-child,
.sms-record-table td:first-child {
  width: 24%;
}

.sms-record-table th:nth-child(2),
.sms-record-table td:nth-child(2) {
  width: 20%;
}

.sms-record-table th:nth-child(3),
.sms-record-table td:nth-child(3) {
  width: 20%;
}

.sms-record-table th:nth-child(4),
.sms-record-table td:nth-child(4) {
  width: 12%;
}

.sms-record-table th:nth-child(5),
.sms-record-table td:nth-child(5) {
  width: 14%;
}

.sms-record-table th:nth-child(6),
.sms-record-table td:nth-child(6) {
  width: 10%;
}

.sms-record-table td {
  height: 68px;
}

.sms-record-table td strong {
  display: block;
  overflow: hidden;
  color: var(--heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-record-table tr.is-selected td {
  background: var(--theme-action-soft);
}

.sms-evidence-panel {
  position: sticky;
  top: 82px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.sms-evidence-heading {
  min-height: 66px;
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.sms-evidence-heading h2 {
  margin: 0;
  color: var(--heading);
  font-size: 17px;
}

.sms-evidence-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sms-evidence-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-subtle);
}

.sms-evidence-summary div {
  min-width: 0;
  padding: 7px 8px 7px 0;
}

.sms-evidence-summary dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sms-evidence-summary dd {
  margin: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-evidence-timeline {
  margin: 0;
  padding: 18px 16px 2px;
  list-style: none;
}

.sms-evidence-timeline li {
  position: relative;
  min-height: 112px;
  padding: 0 0 20px 38px;
}

.sms-evidence-timeline li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: -3px;
  width: 1px;
  background: var(--line);
}

.sms-evidence-timeline li:last-child::before {
  display: none;
}

.sms-evidence-dot {
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.sms-evidence-timeline li.success .sms-evidence-dot {
  border-color: var(--success);
  color: var(--success);
}

.sms-evidence-timeline li.danger .sms-evidence-dot {
  border-color: var(--danger);
  color: var(--danger);
}

.sms-evidence-timeline time {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sms-evidence-timeline strong {
  display: block;
  margin-bottom: 5px;
  color: var(--heading);
  font-size: 13px;
}

.sms-evidence-timeline p {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.sms-evidence-timeline code,
.sms-evidence-timeline small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .sms-provider-config-grid,
  .sms-record-layout {
    grid-template-columns: 1fr;
  }

  .sms-evidence-panel {
    position: static;
  }
}

.wide {
  grid-column: 1 / -1;
}

.collection-create-panel {
  margin-bottom: 16px;
}

.assistant-token-form {
  grid-template-columns: minmax(240px, 420px) auto;
}

.assistant-download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.assistant-download-panel h2,
.assistant-download-panel p {
  margin: 0;
}

.assistant-download-panel p {
  margin-top: 6px;
}

.assistant-download-panel .primary-button {
  flex: 0 0 auto;
}

.token-copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-copy-field .compact-button {
  flex: 0 0 auto;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.inline-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
}

.inline-form input,
.inline-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  color: #17202a;
  background: #ffffff;
}

.table-action-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filing-candidate {
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px 10px;
  border-left: 3px solid #b7791f;
  background: #fff8eb;
  color: #25324a;
}

.filing-candidate strong {
  font-size: 0.92rem;
  line-height: 1.35;
}

.filing-candidate .status-chip {
  width: fit-content;
}

.table-action-form select {
  min-height: 36px;
  max-width: 180px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
  background: #ffffff;
}

.table-action-form .primary-button {
  min-height: 36px;
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-bar a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #344054;
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  font-size: 14px;
}

.filter-bar a.active {
  color: #ffffff;
  background: #1f6feb;
  border-color: #1f6feb;
}

.workbench-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.workbench-heading > div {
  max-width: 760px;
}

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

.workbench-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 16px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.workbench-tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  color: #667085;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.workbench-tabs a:hover {
  color: #1f6feb;
  background: #f4f7ff;
}

.workbench-tabs a.active {
  color: #ffffff;
  background: #1f6feb;
}

.tenant-detail-tabs {
  width: 100%;
  margin-top: 0;
  scrollbar-width: thin;
}

.tenant-detail-tabs a {
  flex: 0 0 auto;
}

.tenant-overview-accounts {
  grid-column: 1 / -1;
}

.violation-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.import-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.entry-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  -webkit-overflow-scrolling: touch;
}

.entry-modal::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.entry-modal-card {
  overflow: visible;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.compact-entry-modal-card {
  max-width: 560px;
  margin: 0 auto;
}

.entry-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.entry-modal-header h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.entry-modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal-close-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475467;
  background: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close-button:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.entry-modal-body {
  display: grid;
  gap: 12px;
  padding: 20px 22px 22px;
}

.material-context-summary {
  display: grid;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.material-context-row {
  display: grid;
}

.material-context-row + .material-context-row {
  border-top: 1px solid var(--line);
}

.material-context-primary-row {
  grid-template-columns: minmax(0, 1.25fr) minmax(110px, 0.75fr) minmax(110px, 0.75fr);
}

.material-context-time-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(190px, 0.8fr);
}

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

.material-context-item {
  min-width: 0;
  padding: 12px 14px;
}

.material-context-item + .material-context-item {
  border-left: 1px solid var(--line);
}

.material-context-item dt {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.material-context-item dd {
  margin: 0;
  color: var(--heading);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.entry-modal .entry-modal-body .transfer-template-actions {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}

.transfer-template-actions .compact-button {
  flex: 0 0 auto;
  width: 100%;
  min-height: 42px;
  justify-content: center;
}

.transfer-template-summary {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: flex-start;
  gap: 16px;
}

.transfer-material-reminder {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.transfer-material-reminder strong {
  color: #475467;
  font-weight: 600;
}

.transfer-upload-list {
  display: grid;
  gap: 10px;
}

.transfer-upload-list .clipboard-file-upload-layout {
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: stretch;
}

.file-upload-field {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.file-upload-field:hover {
  border-color: var(--brand);
  background: var(--surface-hover);
}

.file-upload-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.file-upload-field.has-file {
  border-color: #8ec5a7;
  background: #f3faf6;
}

.file-upload-meta,
.file-upload-control {
  min-width: 0;
}

.file-upload-meta {
  display: grid;
  gap: 2px;
}

.file-upload-meta strong {
  font-size: 14px;
  line-height: 1.35;
}

.file-upload-meta small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.file-upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-upload-button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.file-upload-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-shell .entry-modal .file-upload-control {
  display: flex;
  margin-top: 0;
}

body.app-shell .entry-modal .file-upload-button {
  display: inline-flex;
  width: auto;
  min-width: 68px;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 7px 10px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

body.app-shell .entry-modal .file-upload-name {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.file-upload-field input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.transfer-upload-list .clipboard-file-paste-box {
  min-height: 62px;
  padding: 10px;
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-subtle);
}

.transfer-upload-list .clipboard-file-paste-title {
  font-size: 12px;
}

.transfer-material-rules {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--brand);
  padding: 9px 12px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

.transfer-material-rules p {
  margin: 0;
}

.entry-modal .searchable-select-list {
  z-index: 80;
  max-height: min(240px, 34vh);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.entry-modal-footer,
.modal-inline-actions,
.entry-modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.entry-modal-footer {
  justify-content: space-between;
  align-items: flex-end;
}

.entry-modal-footer .transfer-material-rules {
  flex: 1 1 360px;
  max-width: 520px;
  margin-right: auto;
}

.entry-modal-footer-actions {
  flex: 0 0 auto;
}

.entry-modal-footer-actions .primary-button {
  min-width: 132px;
}

@media (max-width: 760px) {
  .material-context-primary-row,
  .material-context-time-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-context-primary-row .material-context-item + .material-context-item,
  .material-context-time-row .material-context-item + .material-context-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .transfer-template-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .transfer-upload-list .clipboard-file-upload-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-upload-field {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .entry-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-modal-footer .transfer-material-rules {
    max-width: none;
    margin-right: 0;
  }

  .entry-modal-footer-actions {
    justify-content: flex-end;
  }
}

.entry-modal-footer .primary-button,
.entry-modal-footer .secondary-button,
.entry-modal-footer .ghost-button {
  height: 50px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
}

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

.contract-import-layout {
  grid-template-columns: minmax(320px, 1.08fr) minmax(280px, 0.92fr);
  align-items: stretch;
  gap: 18px;
}

.upload-card-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.upload-card-form h3 {
  margin: 0;
  font-size: 16px;
}

.contract-import-upload {
  align-content: start;
}

.contract-import-guide {
  display: grid;
  position: relative;
  min-width: 0;
  min-height: 232px;
  align-content: start;
  gap: 12px;
  overflow: hidden;
  padding: 14px 16px 14px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  border: 1px solid #d9e3ec;
  border-radius: 8px;
}

.contract-import-guide::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 4px;
  background: #2d6f92;
}

.contract-import-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 800;
}

.contract-import-guide-header a {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.contract-import-guide-header a:hover {
  text-decoration: underline;
}

.contract-import-checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contract-import-checklist li {
  display: grid;
  position: relative;
  gap: 4px;
  padding-left: 18px;
}

.contract-import-checklist li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 8px;
  height: 8px;
  background: #9bb7c9;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #edf4f8;
}

.contract-import-checklist strong {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.35;
}

.contract-import-checklist span {
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.contract-import-result {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d9e3ec;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
}

.contract-import-result.is-success {
  border-color: #abefc6;
  background: #f6fef9;
  color: #067647;
}

.contract-import-result.is-error {
  border-color: #fecdca;
  background: #fffbfa;
  color: #b42318;
}

.contract-import-result ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.upload-modal-field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
}

.upload-modal-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}

.workbench-toolbar {
  display: block;
  position: relative;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.compact-filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: nowrap;
}

.filter-field {
  display: grid;
  gap: 6px;
  min-width: 136px;
  color: #344054;
  font-size: 13px;
}

.filter-field-keyword {
  min-width: min(320px, 100%);
  flex: 1 1 auto;
}

.filter-field span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #f8fafc;
  font-size: 14px;
}

.filter-field select {
  appearance: auto;
  background: #ffffff;
}

.more-filter-popover {
  position: relative;
}

.more-filter-popover summary {
  height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 0 12px;
  color: #344054;
  background: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.more-filter-popover summary::-webkit-details-marker {
  display: none;
}

.more-filter-popover summary::after {
  content: "⌄";
  margin-left: 8px;
  color: #667085;
}

.more-filter-popover[open] summary {
  border-color: #1f6feb;
  color: #1f6feb;
}

.more-filter-panel {
  position: absolute;
  right: 0;
  z-index: 20;
  width: min(860px, calc(100vw - 260px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 22px 50px rgba(16, 24, 40, 0.14);
}

.compact-more-filter-panel {
  width: min(320px, calc(100vw - 260px));
  grid-template-columns: 1fr;
}

.transfer-more-filter-panel {
  width: min(640px, calc(100vw - 260px));
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.active-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.active-filter-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfd2ff;
  border-radius: 999px;
  padding: 0 10px;
  color: #1d4ed8;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 700;
}

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

.violation-table-panel {
  padding: 0;
  overflow-x: auto;
}

.violation-table-panel .panel-heading {
  margin: 0;
  padding: 14px 18px 8px;
}

.violation-table {
  min-width: 980px;
  table-layout: fixed;
}

.violation-table th {
  padding: 10px 12px;
  background: var(--table-head);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.violation-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f5;
}

.violation-table tr:hover td {
  background: #fbfdff;
}

.violation-table th:first-child,
.violation-table td:first-child {
  width: 16%;
}

.violation-table th:nth-child(2),
.violation-table td:nth-child(2) {
  width: 38%;
}

.violation-table th:nth-child(3),
.violation-table td:nth-child(3) {
  width: 20%;
}

.violation-table th:nth-child(4),
.violation-table td:nth-child(4) {
  width: 26%;
}

.contract-table,
.vehicle-table,
.customer-table,
.transfer-table,
.unit-table {
  min-width: 920px;
  table-layout: fixed;
}

.contract-table,
.customer-table {
  min-width: 1080px;
}

.contract-table {
  width: 100%;
  min-width: 0;
}

.vehicle-table {
  width: 100%;
  min-width: 0;
}

.merchant-list-table thead th {
  padding-block: 12px;
}

.contract-table th,
.contract-table td,
.vehicle-table th,
.vehicle-table td,
.customer-table th,
.customer-table td,
.transfer-table th,
.transfer-table td,
.unit-table th,
.unit-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.contract-table th:first-child,
.contract-table td:first-child {
  width: 24%;
}

.contract-table th:nth-child(2),
.contract-table td:nth-child(2) {
  width: 8%;
}

.contract-table th:nth-child(3),
.contract-table td:nth-child(3) {
  width: 12%;
}

.contract-table th:nth-child(4),
.contract-table td:nth-child(4) {
  width: 12%;
}

.contract-table th:nth-child(5),
.contract-table td:nth-child(5) {
  width: 20%;
}

.contract-table th:nth-child(6),
.contract-table td:nth-child(6) {
  width: 9%;
}

.contract-table th:nth-child(7),
.contract-table td:nth-child(7) {
  width: 15%;
}

.contract-table td:nth-child(7) {
  min-width: 0;
}

.contract-table .contract-row-actions {
  justify-content: flex-start;
  min-width: 132px;
}

.contract-table th,
.contract-table td {
  padding-top: 9px;
  padding-bottom: 9px;
  overflow-wrap: anywhere;
}

.contract-table th:nth-child(3),
.contract-table th:nth-child(4),
.contract-table td:nth-child(3),
.contract-table td:nth-child(4) {
  text-align: center;
}

.contract-table th:nth-child(7),
.contract-table td:nth-child(7) {
  text-align: left;
}

.contract-identity-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}

.contract-vehicle-link {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
}

.contract-number {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-unit-name {
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-period-line {
  white-space: nowrap;
}

.vehicle-table th:first-child,
.vehicle-table td:first-child {
  width: 19%;
}

.vehicle-table th:nth-child(2),
.vehicle-table td:nth-child(2) {
  width: 14%;
}

.vehicle-table th:nth-child(3),
.vehicle-table td:nth-child(3) {
  width: 10%;
}

.vehicle-table th:nth-child(4),
.vehicle-table td:nth-child(4) {
  width: 13%;
}

.vehicle-table th:nth-child(5),
.vehicle-table td:nth-child(5) {
  width: 18%;
}

.vehicle-table th:nth-child(6),
.vehicle-table td:nth-child(6) {
  width: 13%;
}

.vehicle-table th:nth-child(7),
.vehicle-table td:nth-child(7) {
  width: 13%;
}

.vehicle-table-panel {
  overflow-x: auto;
}

.vehicle-table th,
.vehicle-table td,
.vehicle-table .plate-link,
.vehicle-table .sub-value,
.vehicle-risk-label {
  overflow-wrap: normal;
  white-space: nowrap;
}

.vehicle-risk-label {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.vehicle-table .status-chip-row {
  flex-wrap: wrap;
  max-width: none;
}

.vehicle-table .vehicle-risk-chips {
  flex-wrap: nowrap;
  max-width: none;
  white-space: nowrap;
}

.vehicle-table .vehicle-operation-chips {
  flex-wrap: nowrap;
  max-width: none;
  white-space: nowrap;
}

.vehicle-table .status-action-cell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.vehicle-table .status-action-cell .compact-button {
  padding-inline: 10px;
  white-space: nowrap;
}

.vehicle-table td:first-child .sub-value {
  overflow: hidden;
  text-overflow: ellipsis;
}

.insurance-date-stack {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 13px;
}

.insurance-date-stack span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.insurance-date-stack b {
  min-width: 30px;
  color: var(--muted);
  font-size: 11px;
}

.vehicle-risk-chips {
  gap: 5px;
}

.vehicle-readonly-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.vehicle-readonly-panel > strong {
  color: #475467;
  font-size: 13px;
}

.vehicle-readonly-panel input[readonly] {
  color: var(--muted);
  background: #eef2f6;
  cursor: not-allowed;
}

.vehicle-supplement-import-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.vehicle-supplement-import-note strong {
  color: #344054;
}

.vehicle-supplement-save-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-table th:first-child,
.customer-table td:first-child {
  width: 23%;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 16%;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  width: 10%;
}

.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
  width: 28%;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
  width: 11%;
}

.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
  width: 12%;
}

.customer-table .customer-violation-chip-row {
  flex-wrap: nowrap;
  max-width: none;
  white-space: nowrap;
}

.transfer-table-panel {
  overflow-x: auto;
}

.table-panel.transfer-table-panel {
  overflow-x: auto;
}

.transfer-table {
  width: 100%;
  min-width: 1020px;
}

.transfer-table th:first-child,
.transfer-table td:first-child {
  width: 28%;
}

.transfer-table th:nth-child(2),
.transfer-table td:nth-child(2) {
  width: 18%;
}

.transfer-table th:nth-child(3),
.transfer-table td:nth-child(3) {
  width: 12%;
}

.transfer-table th:nth-child(4),
.transfer-table td:nth-child(4) {
  width: 13%;
}

.transfer-table th:nth-child(5),
.transfer-table td:nth-child(5) {
  width: 17%;
}

.transfer-table th:nth-child(6),
.transfer-table td:nth-child(6) {
  width: 12%;
  text-align: center;
}

.transfer-table th,
.transfer-table td {
  padding: 10px 12px;
}

.transfer-table th {
  white-space: nowrap;
}

.transfer-table td:first-child .sub-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-table .row-actions-column {
  align-items: center;
}

.transfer-group-details {
  margin-top: 2px;
}

.transfer-group-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.transfer-table td:nth-child(7) .summary-value {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.unit-table-panel {
  overflow-x: auto;
}

.unit-table th:first-child,
.unit-table td:first-child {
  width: 24%;
}

.unit-table th:nth-child(2),
.unit-table td:nth-child(2) {
  width: 28%;
}

.unit-table th:nth-child(3),
.unit-table td:nth-child(3) {
  width: 12%;
}

.unit-table th:nth-child(4),
.unit-table td:nth-child(4) {
  width: 14%;
  white-space: nowrap;
}

.unit-table th:nth-child(5),
.unit-table td:nth-child(5) {
  width: 22%;
}

.unit-table th:nth-child(6),
.unit-table td:nth-child(6) {
  width: 12%;
}

.plate-link {
  display: block;
  margin-bottom: 2px;
  color: #101828;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

.sub-value,
.fine-value,
.status-note {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fine-value {
  color: #344054;
  font-weight: 700;
}

.violation-info {
  display: grid;
  gap: 2px;
}

.violation-time-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #101828;
  font-size: 14px;
  line-height: 1.3;
}

.violation-time-line strong,
.violation-time-line span {
  white-space: nowrap;
}

.violation-time-line span {
  color: #344054;
  font-weight: 800;
}

.location-value {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.behavior-value {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

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

.row-actions-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.contract-table .row-actions-column,
.customer-table .row-actions-column {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.status-action-cell form,
.row-actions-column form {
  margin: 0;
}

.status-action-cell {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.vehicle-table .status-action-cell {
  grid-template-columns: minmax(0, max-content) max-content;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 210px;
}

.status-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 7px;
  color: #344054;
  background: #f2f4f7;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.info {
  color: #1d4ed8;
  background: #eaf1ff;
}

.status-chip.muted {
  color: #667085;
  background: #eef2f5;
}

.status-chip.warning-chip {
  color: #a05a00;
  background: #fff7ed;
}

.status-chip.danger-chip {
  color: #b42318;
  background: #fff5f5;
}

.status-chip.success-chip {
  color: #087443;
  background: #eaf7ef;
}

.todo-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  margin-bottom: 14px;
}

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

.todo-group-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.todo-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.16s ease;
}

.todo-group-head:hover {
  background: #f8fafc;
}

.todo-group-card strong {
  font-size: 15px;
}

.todo-group-head span,
.todo-group-card dd {
  color: #667085;
  font-size: 13px;
}

.todo-group-card dl {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line-soft);
}

.todo-group-card dl a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.16s ease;
}

.todo-group-card dl a:hover {
  background: #f8fafc;
}

.todo-group-card dt,
.todo-group-card dd {
  margin: 0;
}

.todo-group-card dt {
  color: #17202a;
  font-size: 13px;
  font-weight: 700;
}

.todo-manual-panel {
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.todo-manual-panel summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #344054;
  cursor: pointer;
  font-weight: 700;
}

.todo-manual-grid {
  display: grid;
  gap: 12px;
  overflow: visible;
  padding: 0 16px 16px;
}

.manual-sync-form {
  display: grid;
  grid-template-columns: 180px minmax(360px, 1fr) 128px;
  gap: 12px;
  align-items: end;
  min-width: 692px;
}

.manual-sync-unit-dropdown {
  position: relative;
  min-width: 0;
}

.manual-sync-unit-trigger {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 4px 34px 4px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--page));
  color: var(--heading);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.manual-sync-unit-trigger::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}

.manual-sync-unit-trigger[aria-expanded="true"]::after {
  transform: translateY(-30%) rotate(225deg);
}

.manual-sync-selected-display {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
}

.manual-sync-selected-chip,
.manual-sync-selected-more {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  max-width: 210px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--surface));
  color: var(--heading);
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-sync-selected-more {
  flex: 0 0 auto;
  color: var(--muted);
  padding: 0 9px;
}

.todo-manual-sync-panel .manual-sync-selected-chip {
  flex: 0 1 auto;
  max-width: 100%;
}

.todo-manual-sync-panel .manual-sync-selected-display {
  width: 100%;
}

.manual-sync-unit-dropdown-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  width: min(680px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.14);
}

.manual-sync-unit-dropdown-menu[hidden] {
  display: none;
}

.manual-sync-unit-search {
  width: 100%;
  min-height: 34px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
}

.manual-sync-unit-list {
  max-height: 240px;
  display: grid;
  gap: 2px;
  overflow-y: auto;
}

.manual-sync-unit-option[hidden] {
  display: none;
}

.manual-sync-unit-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 0 34px 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.manual-sync-unit-option:hover {
  background: var(--surface-hover);
}

.manual-sync-unit-option.is-selected {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}

.manual-sync-unit-option.is-selected::after {
  content: "✓";
  position: absolute;
  right: 11px;
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
}

.manual-sync-unit-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
}

.manual-sync-unit-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-sync-unit-name {
  flex: 1 1 auto;
  min-width: 0;
}

.manual-sync-unit-status {
  flex: 0 0 auto;
}

.manual-sync-offline-warning {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
  color: var(--warning);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 700;
}

.manual-sync-offline-warning[hidden] {
  display: none;
}

.manual-sync-submit {
  min-height: 42px;
  white-space: nowrap;
}

.todo-table-panel {
  overflow-x: auto;
}

.todo-table {
  min-width: 1240px;
  table-layout: fixed;
}

.todo-table th,
.todo-table td {
  padding: 11px 16px;
  vertical-align: middle;
}

.todo-table th {
  color: var(--muted);
  background: var(--table-head);
  font-size: 12px;
}

.todo-table tr:hover td {
  background: #fbfdff;
}

.todo-table th:first-child,
.todo-table td:first-child {
  width: 14%;
}

.todo-table th:nth-child(2),
.todo-table td:nth-child(2) {
  width: 21%;
}

.todo-table th:nth-child(3),
.todo-table td:nth-child(3) {
  width: 17%;
}

.todo-table th:nth-child(4),
.todo-table td:nth-child(4) {
  width: 14%;
}

.todo-table th:nth-child(5),
.todo-table td:nth-child(5) {
  width: 12%;
}

.todo-table th:nth-child(6),
.todo-table td:nth-child(6) {
  width: 22%;
}

.platform-violation-todo-table th:first-child,
.platform-violation-todo-table td:first-child {
  width: 15%;
}

.platform-violation-todo-table th:nth-child(2),
.platform-violation-todo-table td:nth-child(2) {
  width: 9%;
}

.platform-violation-todo-table th:nth-child(3),
.platform-violation-todo-table td:nth-child(3) {
  width: 14%;
}

.platform-violation-todo-table th:nth-child(4),
.platform-violation-todo-table td:nth-child(4) {
  width: 18%;
}

.platform-violation-todo-table th:nth-child(5),
.platform-violation-todo-table td:nth-child(5) {
  width: 12%;
}

.platform-violation-todo-table th:nth-child(6),
.platform-violation-todo-table td:nth-child(6) {
  width: 10%;
}

.platform-violation-todo-table th:nth-child(7),
.platform-violation-todo-table td:nth-child(7) {
  width: 22%;
}

.platform-violation-todo-table .status-chip-row {
  flex-direction: column;
  flex-wrap: nowrap;
}

.platform-violation-summary-table tr.is-selected td {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.platform-violation-summary-table td strong,
.platform-violation-summary-table td span {
  display: block;
}

.platform-violation-summary-table td strong {
  color: var(--heading);
}

.platform-violation-summary-table td span:not(.status-chip) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.platform-violation-todo-detail-table th:first-child,
.platform-violation-todo-detail-table td:first-child {
  width: 13%;
}

.platform-violation-todo-detail-table th:nth-child(2),
.platform-violation-todo-detail-table td:nth-child(2) {
  width: 18%;
}

.platform-violation-todo-detail-table th:nth-child(3),
.platform-violation-todo-detail-table td:nth-child(3) {
  width: 28%;
}

.platform-violation-todo-detail-table th:nth-child(4),
.platform-violation-todo-detail-table td:nth-child(4) {
  width: 14%;
}

.platform-violation-todo-detail-table th:nth-child(5),
.platform-violation-todo-detail-table td:nth-child(5) {
  width: 12%;
}

.platform-violation-todo-detail-table th:nth-child(6),
.platform-violation-todo-detail-table td:nth-child(6) {
  width: 15%;
}

.todo-table .todo-generated-at {
  white-space: nowrap;
}

.todo-table td strong,
.todo-table td span {
  display: block;
}

.todo-table td strong {
  color: #17202a;
  font-size: 14px;
  line-height: 1.25;
}

.todo-table td span {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.todo-table .line-clamp {
  margin: 0;
  color: #344054;
}

.line-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.platform-table .table-actions {
  gap: 8px;
}

.platform-unit-table th:nth-child(1) {
  width: 22%;
}

.platform-unit-table th:nth-child(2) {
  width: 9%;
}

.platform-unit-table th:nth-child(3) {
  width: 14%;
}

.platform-unit-table th:nth-child(4) {
  width: 10%;
}

.platform-unit-table th:nth-child(5) {
  width: 22%;
}

.platform-unit-table th:nth-child(6) {
  width: 23%;
}

.platform-unit-table .table-actions {
  flex-wrap: nowrap;
}

.platform-unit-table .table-actions > * {
  flex: 0 0 auto;
}

.platform-table .table-actions .compact-button {
  box-sizing: border-box;
  height: 34px;
  min-height: 34px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1;
}

.row-action-select {
  box-sizing: border-box;
  width: 112px;
  height: 36px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  padding: 0 10px;
  color: #344054;
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.row-action-select:hover {
  border-color: #9fb4cb;
}

.row-action-select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(31, 106, 148, 0.14);
  outline-offset: 1px;
}

.platform-table td:has(.row-action-select) {
  overflow-wrap: normal;
  text-align: center;
  vertical-align: middle;
}

.tenant-list-panel {
  overflow-x: auto;
}

.tenant-list-table {
  min-width: 1180px;
  table-layout: auto;
}

.tenant-list-table th,
.tenant-list-table td {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
}

.tenant-list-table th:nth-child(1),
.tenant-list-table td:nth-child(1) {
  width: 12%;
}

.tenant-list-table th:nth-child(2),
.tenant-list-table td:nth-child(2),
.tenant-list-table th:nth-child(3),
.tenant-list-table td:nth-child(3) {
  width: 10%;
}

.tenant-list-table th:nth-child(4),
.tenant-list-table td:nth-child(4),
.tenant-list-table th:nth-child(5),
.tenant-list-table td:nth-child(5),
.tenant-list-table th:nth-child(7),
.tenant-list-table td:nth-child(7) {
  width: 7%;
  text-align: center;
}

.tenant-list-table th:nth-child(6),
.tenant-list-table td:nth-child(6) {
  width: 13%;
}

.tenant-list-table th:nth-child(8),
.tenant-list-table td:nth-child(8) {
  width: 9%;
}

.tenant-list-table th:nth-child(9),
.tenant-list-table td:nth-child(9) {
  width: 10%;
  text-align: center;
}

.data-overview-table th:last-child,
.data-overview-table td:last-child {
  width: 132px;
  padding-right: 16px;
  text-align: center;
}

.data-status-filter a {
  gap: 8px;
  padding-right: 8px;
}

.data-status-filter a strong {
  min-width: 24px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #475467;
  background: #f2f6fa;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.data-status-filter a.active strong {
  color: #1f5f89;
  background: #ffffff;
}

.data-overview-table {
  min-width: 1160px;
}

.data-overview-table th,
.data-overview-table td {
  vertical-align: middle;
}

.data-overview-table th:nth-child(1),
.data-overview-table td:nth-child(1) {
  width: 14%;
}

.data-overview-table th:nth-child(2),
.data-overview-table td:nth-child(2) {
  width: 12%;
}

.data-overview-table th:nth-child(3),
.data-overview-table td:nth-child(3) {
  width: 19%;
}

.data-overview-table th:nth-child(4),
.data-overview-table td:nth-child(4),
.data-overview-table th:nth-child(5),
.data-overview-table td:nth-child(5) {
  width: 16%;
}

.data-overview-table th:nth-child(6),
.data-overview-table td:nth-child(6) {
  width: 11%;
}

.data-tenant-cell {
  min-width: 0;
}

.data-tenant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.data-tenant-title strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-tenant-title .status-chip {
  flex: 0 0 auto;
}

.data-health-stack,
.data-issue-stack,
.data-recent-cell {
  display: grid;
  gap: 6px;
  align-content: center;
}

.data-health-stack > span:last-child,
.data-recent-cell small {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.data-health-chip,
.data-issue-total,
.data-issue-clear {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.data-health-success,
.data-issue-clear {
  color: #027a48;
  background: #ecfdf3;
  border-color: #abefc6;
}

.data-health-danger,
.data-issue-total {
  color: #b42318;
  background: #fff1f0;
  border-color: #fecdca;
}

.data-health-muted {
  color: #475467;
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.overview-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  color: inherit;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #e4ebf2;
  border-radius: 8px;
}

.overview-stat:hover {
  border-color: #b9c8d8;
  background: #ffffff;
}

.overview-stat span,
.overview-stat small {
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-stat strong {
  color: #1f5f89;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
}

.data-signal-list,
.data-issue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.data-signal-list a,
.data-signal-list span,
.data-issue-tags a {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: #1f5f89;
  background: #eff6fb;
  border: 1px solid #d4e4f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.data-signal-list span {
  color: #667085;
  background: #f8fafc;
  border-color: #e4ebf2;
}

.data-issue-tags a {
  color: #b42318;
  background: #fff7f6;
  border-color: #fecdca;
}

.data-recent-cell > span {
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.data-row-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
  width: 100%;
  max-width: 110px;
  margin-left: auto;
  margin-right: auto;
}

.data-row-actions a {
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #1f5f89;
  background: #ffffff;
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.data-row-actions a:first-child {
  color: #ffffff;
  background: #285f87;
  border-color: #285f87;
}

.data-row-actions a:hover {
  border-color: #9fb4cb;
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.08);
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.todo-error-list {
  margin: 6px 0 0;
  color: #b42318;
}

.muted-dash {
  color: #98a2b3;
}

.assistant-overview-panel {
  margin-top: 16px;
  overflow-x: auto;
}

.upload-drawer {
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.04);
}

.upload-drawer summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #344054;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.upload-drawer summary::after {
  content: "展开";
  margin-left: auto;
  color: #667085;
  font-size: 12px;
}

.upload-drawer[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.upload-drawer[open] summary::after {
  content: "收起";
}

.upload-drawer-body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 14px 16px 16px;
}

.upload-file-field input {
  padding-top: 9px;
}

.import-table-panel,
.import-error-panel {
  padding: 0;
  overflow-x: auto;
}

.import-table-panel .panel-heading,
.import-error-panel .panel-heading {
  margin: 0;
  padding: 14px 18px 8px;
}

.import-table,
.import-error-table {
  min-width: 980px;
  table-layout: fixed;
}

.import-table th,
.import-error-table th {
  padding: 10px 12px;
  color: var(--muted);
  background: var(--table-head);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.import-table td,
.import-error-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f5;
}

.import-table th:first-child,
.import-table td:first-child {
  width: 24%;
}

.import-table th:nth-child(2),
.import-table td:nth-child(2) {
  width: 12%;
}

.import-table th:nth-child(3),
.import-table td:nth-child(3) {
  width: 16%;
}

.import-table th:nth-child(4),
.import-table td:nth-child(4) {
  width: 17%;
}

.import-table th:nth-child(5),
.import-table td:nth-child(5) {
  width: 13%;
}

.import-table th:nth-child(6),
.import-table td:nth-child(6) {
  width: 18%;
}

.summary-value {
  display: -webkit-box;
  max-width: 100%;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-empty {
  padding: 18px;
}

.compact-empty p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.pagination-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.pagination-summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 13px 0 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pagination-summary strong {
  color: var(--heading);
  font-size: 15px;
}

.pagination-cluster a,
.pagination-cluster .disabled,
.pagination-jump button,
.pagination-size select {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.pagination-cluster a,
.pagination-jump button,
.pagination-size select {
  color: var(--brand);
  background: var(--surface);
}

.pagination-cluster a:hover,
.pagination-jump button:hover,
.pagination-size select:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.pagination-cluster .disabled {
  color: var(--muted);
  background: var(--surface-subtle);
}

.pagination-meter {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pagination-meter strong {
  color: var(--heading);
  font-size: 15px;
  margin: 0 3px;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding-left: 4px;
}

.pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding-left: 4px;
}

.pagination-jump label,
.pagination-size label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pagination-jump input {
  width: 58px;
  min-height: 30px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  padding: 0 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.pagination-size select {
  width: 56px;
  min-width: 56px;
  padding: 0;
  color: var(--heading);
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.pagination-size select:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 2px;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
  font-size: 14px;
}

th {
  color: #667085;
  font-weight: 600;
}

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

.detail-panel {
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-badges span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #344054;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

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

.detail-grid div {
  min-width: 0;
}

.detail-grid dt {
  margin-bottom: 4px;
  color: #667085;
  font-size: 13px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 15px;
}

.detail-grid-wide {
  grid-column: 1 / -1;
}

.section-title-row,
.heading-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title-row {
  margin-bottom: 18px;
}

.section-title-row h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
}

.section-title-row p {
  margin: 6px 0 0;
  color: #667085;
}

.payload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.payload-block {
  min-width: 0;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.payload-block h3 {
  margin: 0 0 10px;
  color: #344054;
  font-size: 15px;
}

.payload-block pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #17202a;
  font-size: 13px;
  line-height: 1.6;
}

.message-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #d8dee8;
  background: #ffffff;
}

.message-success {
  color: #087443;
  background: #effdf6;
  border-color: #b8efd0;
}

.message-error {
  color: #9f1d20;
  background: #fff0f0;
  border-color: #ffd0d0;
}

.message-info {
  color: #175cd3;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.message-warning {
  color: #8a4b0f;
  background: #fff7ed;
  border-color: #fed7aa;
}

.muted-text {
  margin: 0 0 14px;
  color: #667085;
}

.primary-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: #1f6feb;
  cursor: pointer;
  font-weight: 700;
}

a.primary-button,
a.secondary-button,
a.ghost-button,
a.danger-button,
button.primary-button,
button.secondary-button,
button.ghost-button,
button.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

a.primary-button:hover,
button.primary-button:hover {
  background: #175cd3;
}

a.primary-button:active,
a.secondary-button:active,
a.ghost-button:active,
a.danger-button:active,
button.primary-button:active,
button.secondary-button:active,
button.ghost-button:active,
button.danger-button:active {
  transform: translateY(1px);
}

.secondary-button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  color: #344054;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.secondary-button:hover {
  border-color: #1f6feb;
  color: #1f6feb;
}

.danger-button {
  min-height: 36px;
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 0 12px;
  color: #b42318;
  background: #fff5f5;
  cursor: pointer;
  font-weight: 700;
}

.danger-button:hover {
  border-color: #f04438;
  background: #fee4e2;
}

button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.compact-button {
  min-height: 30px;
  padding: 0 12px;
  white-space: nowrap;
}

.operator-checkbox-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.operator-checkbox-list legend {
  padding: 0 6px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.operator-checkbox-list label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 6px;
}

.operator-checkbox-list label:hover {
  background: #f8fafc;
}

.operator-checkbox-list small {
  color: #667085;
  white-space: nowrap;
}

.operator-management-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.operator-account-panel {
  position: sticky;
  top: 78px;
  overflow: hidden;
}

.operator-account-search,
.operator-filter-form {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.operator-account-search {
  grid-template-columns: minmax(0, 1fr) auto;
}

.operator-account-heading.edge-to-edge-heading {
  margin: 0 -20px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--line);
}

.operator-account-search.edge-to-edge-form {
  margin: 0 -20px;
  padding: 10px 20px;
}

.operator-filter-form {
  grid-template-columns: minmax(160px, 240px) minmax(180px, 1fr) auto auto;
  align-items: center;
}

.operator-filter-panel {
  padding: 0;
  overflow: hidden;
}

.operator-filter-panel .operator-filter-form {
  padding: 10px 16px;
  border-bottom: 0;
  background: #fff;
}

.operator-authorization-panel > .panel-heading {
  margin-bottom: 0;
}

.operator-authorization-panel.compact-auth-panel {
  padding-top: 10px;
}

.operator-auth-filter-form {
  margin: 8px -20px 0;
  padding: 8px 20px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.operator-filter-form label {
  display: block;
}

.operator-account-search input,
.operator-filter-form input,
.operator-filter-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.operator-account-search input,
.operator-filter-form input,
.operator-filter-form select {
  min-height: 36px;
  padding: 0 10px;
}

.operator-filter-form .operator-filter-submit,
.operator-filter-form .operator-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 36px;
  min-width: 72px;
  min-height: 36px;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}

.operator-account-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.operator-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: #fff;
}

.operator-account-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.operator-account-row:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.operator-account-row.is-selected {
  border-color: #9fc4de;
  background: #eef6fc;
}

.operator-account-row strong,
.operator-account-row small {
  display: block;
  min-width: 0;
}

.operator-account-row strong {
  overflow-wrap: anywhere;
}

.operator-account-row small {
  margin-top: 3px;
  color: #667085;
  font-weight: 700;
}

.operator-account-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.operator-account-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
}

.operator-account-actions form {
  display: grid;
}

.operator-account-actions .compact-button {
  justify-content: center;
  width: 100%;
}

.operator-detail-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.operator-summary-panel {
  padding: 18px;
}

.operator-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.operator-summary-main h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.operator-summary-main p {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.operator-summary-chips {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.operator-auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.operator-tabbar {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.operator-tabbar a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.operator-tabbar a:first-child {
  border-left: 0;
}

.operator-tabbar a.is-active {
  border-color: #255f8b;
  color: #fff;
  background: #255f8b;
}

.operator-tab-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.operator-access-table.edge-to-edge-table {
  width: calc(100% + 40px);
  margin: 0 -20px;
}

.compact-empty-state {
  padding: 18px 12px;
}

@media (max-width: 1100px) {
  .operator-management-layout {
    grid-template-columns: 1fr;
  }

  .operator-account-panel {
    position: static;
  }
}

body.app-shell .filter-field .multi-filter-panel .multi-filter-clear,
body.app-shell .filter-field .multi-filter-panel .multi-filter-option {
  min-height: 26px;
  padding: 2px 7px;
}

body.app-shell .filter-field .multi-filter-panel .multi-filter-option > input[type="checkbox"] {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: auto;
  -webkit-appearance: checkbox;
}

body.app-shell .filter-field .multi-filter-panel .multi-filter-option > span {
  line-height: 18px;
}

.multi-filter-select {
  position: relative;
  width: 100%;
}

.multi-filter-original {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

body.app-shell .multi-filter-trigger {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 0 36px 0 12px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  color: var(--heading);
  background: var(--glass-field);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

body.app-shell .multi-filter-trigger::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: translateY(-70%) rotate(45deg);
}

body.app-shell .multi-filter-trigger:focus-visible {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 18%, transparent);
  outline-offset: 0;
}

.multi-filter-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(23, 32, 42, 0.16);
}

.multi-filter-clear,
.multi-filter-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--heading);
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.multi-filter-clear {
  color: var(--muted);
}

.multi-filter-clear:hover,
.multi-filter-option:hover {
  background: var(--glass-field);
}

.multi-filter-option {
  gap: 8px;
}

.multi-filter-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.filter-field .multi-filter-option > span {
  line-height: 20px;
}

.active-filter-tags span {
  gap: 5px;
}

.active-filter-tags span > a {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: -5px;
  place-items: center;
  color: currentColor;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.active-filter-tags span > a:hover,
.active-filter-tags span > a:focus-visible {
  color: #b42318;
  outline: none;
}

/* Finance workbench and contract master record */
.finance-page-heading {
  margin-bottom: 12px;
}

.finance-page-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.finance-metric-strip,
.finance-record-summary,
.finance-payment-summary {
  display: grid;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.finance-metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-metric-card,
.finance-payment-summary article {
  min-width: 0;
  min-height: 112px;
  padding: 19px 20px;
  border-right: 1px solid var(--line-soft);
}

.finance-metric-card {
  appearance: none;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.finance-metric-card:hover {
  background: var(--surface-hover);
}

.finance-metric-card:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.finance-metric-card.is-active {
  background: var(--surface-hover);
}

.finance-metric-card:last-child,
.finance-payment-summary article:last-child {
  border-right: 0;
}

.finance-metric-strip span,
.finance-metric-strip strong,
.finance-metric-strip small,
.finance-payment-summary span,
.finance-payment-summary strong {
  display: block;
}

.finance-metric-strip span,
.finance-payment-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-metric-strip strong,
.finance-payment-summary strong {
  margin: 8px 0 5px;
  color: var(--heading);
  font-size: 25px;
  line-height: 1.1;
}

.finance-metric-strip small {
  color: var(--muted);
  font-size: 12px;
}

.finance-metric-success { box-shadow: inset 3px 0 0 var(--success); }
.finance-metric-warning { box-shadow: inset 3px 0 0 var(--warning); }
.finance-metric-danger { box-shadow: inset 3px 0 0 var(--danger); }

.receivable-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  min-width: 0;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.receivable-schedule,
.receivable-overdue-queue {
  min-width: 0;
}

.receivable-schedule {
  border-right: 1px solid var(--line);
}

.receivable-workbench-heading {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
}

.receivable-workbench-heading span,
.receivable-workbench-heading h2,
.receivable-workbench-heading strong,
.receivable-workbench-heading small {
  display: block;
}

.receivable-workbench-heading span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.receivable-workbench-heading h2 {
  margin: 0;
  font-size: 17px;
}

.receivable-workbench-heading > div:last-child {
  text-align: right;
}

.receivable-workbench-heading > div:last-child strong {
  color: var(--primary);
  font-size: 20px;
}

.receivable-workbench-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.receivable-day-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  height: 68px;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.receivable-day-tab {
  min-width: 0;
  height: 67px;
  min-height: 67px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 5px 7px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.receivable-day-tab:last-child {
  border-right: 0;
}

.receivable-day-tab:hover {
  background: var(--surface-hover);
}

.receivable-day-tab:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.receivable-day-tab.is-active {
  color: #ffffff;
  background: var(--primary);
}

.receivable-day-tab span,
.receivable-day-tab strong,
.receivable-day-tab small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-day-tab span,
.receivable-day-tab small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.receivable-day-tab strong {
  margin: 2px 0;
  color: var(--heading);
  font-size: 14px;
  line-height: 1.2;
}

.receivable-day-tab.is-active span,
.receivable-day-tab.is-active strong,
.receivable-day-tab.is-active small {
  color: #ffffff;
}

.receivable-day-panels {
  min-height: 360px;
  padding: 0;
}

.receivable-day-panel[hidden] {
  display: none;
}

.receivable-day-list {
  max-height: 306px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.receivable-bill-head,
.receivable-bill-row {
  display: grid;
  grid-template-columns: minmax(112px, 1.1fr) minmax(92px, 0.75fr) minmax(116px, 1fr) 104px minmax(110px, 0.9fr) 126px;
  align-items: center;
  gap: 12px;
}

.receivable-bill-head {
  min-height: 60px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--heading);
  font-size: 12px;
  font-weight: 800;
}

.receivable-bill-head span:last-child {
  text-align: left;
}

.receivable-bill-row {
  min-height: 60px;
  padding: 5px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.receivable-bill-row:hover {
  background: var(--surface-hover);
}

.receivable-bill-row span,
.receivable-bill-row strong,
.receivable-bill-row b {
  display: block;
  min-width: 0;
}

.receivable-bill-row strong,
.receivable-bill-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-bill-contact {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receivable-bill-plate,
.receivable-bill-contact {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-bill-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.finance-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.receivable-overdue-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(190, 45, 37, 0.24);
  border-radius: 999px;
  color: var(--danger);
  background: rgba(190, 45, 37, 0.08);
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
  vertical-align: 1px;
}

.receivable-overdue-queue .receivable-workbench-heading {
  border-bottom: 1px solid var(--line);
}

.receivable-overdue-list {
  max-height: 468px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.receivable-overdue-row {
  min-height: 60px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.receivable-overdue-row:hover {
  background: var(--surface-hover);
}

.receivable-overdue-list i {
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.receivable-overdue-list span,
.receivable-overdue-list strong,
.receivable-overdue-list small {
  display: block;
  min-width: 0;
}

.receivable-overdue-list strong,
.receivable-overdue-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-overdue-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.receivable-overdue-actions {
  display: grid;
  justify-items: stretch;
  gap: 5px;
}

.receivable-empty-state {
  min-height: 116px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.finance-dashboard-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.finance-analysis-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.finance-section-heading {
  min-height: 68px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.finance-section-heading span,
.finance-section-heading h2 {
  display: block;
}

.finance-section-heading span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.finance-section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.finance-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.finance-compact-list > a {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.finance-compact-list > a:last-child {
  border-bottom: 0;
}

.finance-compact-list > a:hover {
  background: var(--surface-hover);
}

.finance-compact-list span,
.finance-compact-list strong,
.finance-compact-list small {
  display: block;
}

.finance-compact-list > a > span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.finance-compact-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.finance-month-summary {
  flex: 1 1 610px;
  max-width: 800px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.finance-summary-pill {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.finance-summary-pill small,
.finance-summary-pill em {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.finance-summary-pill strong {
  color: var(--heading);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

.finance-summary-pill.current {
  border-left-color: var(--primary);
  background: var(--surface-hover);
}

.finance-summary-pill.good {
  border-left-color: var(--success);
}

.finance-summary-pill.good strong {
  color: var(--success);
}

.finance-summary-pill.bad {
  border-left-color: var(--danger);
}

.finance-summary-pill.bad strong {
  color: var(--danger);
}

.finance-summary-pill.peak {
  border-left-color: var(--warning);
}

.finance-month-chart {
  padding: 15px 22px 20px;
  overflow-x: auto;
  background: var(--surface-subtle);
}

.finance-chart-range {
  min-width: 760px;
  margin: 0 12px 9px;
  color: var(--muted);
  text-align: right;
  font-size: 11px;
  font-weight: 800;
}

.finance-month-plot,
.finance-month-axis {
  min-width: 760px;
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  column-gap: 14px;
}

.finance-month-plot {
  height: 205px;
  align-items: end;
  padding: 0 12px;
  border-bottom: 2px solid var(--line);
  background:
    linear-gradient(var(--line-soft), var(--line-soft)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line-soft), var(--line-soft)) 0 50% / 100% 1px no-repeat;
}

.finance-month-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.finance-month-bar {
  width: min(52px, 100%);
  height: calc(100% - 30px);
  display: flex;
  align-items: flex-end;
}

.finance-month-bar b {
  width: 100%;
  height: var(--h);
  min-height: 5px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 66%, white) 0%, var(--primary) 100%);
  box-shadow: 0 8px 14px color-mix(in srgb, var(--primary) 16%, transparent);
}

.finance-month-value {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--heading);
  background: var(--surface);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.finance-month-value.zero {
  color: var(--muted);
  background: var(--surface-subtle);
}

.finance-month-col.current .finance-month-value {
  color: #ffffff;
  border-color: transparent;
  background: var(--primary);
}

.finance-month-col.peak:not(.current) .finance-month-value {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 30%, var(--line-soft));
}

.finance-month-axis {
  margin-top: 9px;
  padding: 0 12px;
}

.finance-month-axis span {
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.finance-overdue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.finance-overdue-summary > span {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 18px;
  border-right: 1px solid var(--line-soft);
}

.finance-overdue-summary > span:last-child {
  border-right: 0;
}

.finance-overdue-summary small,
.finance-overdue-summary em {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 750;
}

.finance-overdue-summary strong {
  color: var(--heading);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}

.finance-overdue-summary .bad strong {
  color: var(--danger);
}

.finance-overdue-summary .good strong {
  color: var(--success);
}

.finance-overdue-insight-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
}

.finance-aging-section {
  border-right: 1px solid var(--line);
}

.finance-aging-section > header,
.finance-overdue-trend-section > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.finance-aging-section h3,
.finance-overdue-trend-section h3,
.finance-aging-section p,
.finance-overdue-trend-section p {
  margin: 0;
}

.finance-aging-section h3,
.finance-overdue-trend-section h3 {
  font-size: 14px;
}

.finance-aging-section p,
.finance-overdue-trend-section p,
.finance-overdue-trend-section > header > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.finance-overdue-trend-section > header > span {
  margin-top: 0;
  white-space: nowrap;
}

.finance-overdue-line-chart {
  padding: 13px 20px 17px;
  overflow-x: auto;
  background: var(--surface-subtle);
}

.finance-overdue-line-chart svg {
  width: 100%;
  min-width: 760px;
  height: 206px;
  display: block;
  overflow: visible;
}

.finance-overdue-line-chart line {
  stroke: var(--line-soft);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
}

.finance-overdue-line-chart .finance-overdue-line {
  fill: none;
  stroke: var(--danger);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.finance-overdue-line-chart circle {
  fill: var(--surface);
  stroke: var(--danger);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.finance-overdue-line-chart circle.current {
  fill: var(--danger);
}

.finance-overdue-line-chart .finance-month-axis {
  min-width: 760px;
}

.finance-aging-list {
  display: grid;
  padding: 12px 18px;
}

.finance-aging-list a {
  min-height: 55px;
  display: grid;
  grid-template-columns: 92px minmax(80px, 1fr) 108px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.finance-aging-list a:last-child {
  border-bottom: 0;
}

.finance-aging-list span strong,
.finance-aging-list span small {
  display: block;
}

.finance-aging-list span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.finance-aging-list > a > i {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-hover);
}

.finance-aging-list > a > i > b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
}

.finance-aging-list em {
  color: var(--danger);
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

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

.finance-record-summary a {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 3px solid transparent;
}

.finance-record-summary a:last-child {
  border-right: 0;
}

.finance-record-summary a.is-active {
  color: var(--primary);
  background: var(--surface-subtle);
  border-bottom-color: var(--primary);
}

.finance-record-summary span {
  font-weight: 750;
}

.finance-record-summary strong {
  font-size: 20px;
}

.finance-filter-panel {
  margin-bottom: 12px;
}

.finance-filter-form {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto;
  gap: 10px;
}

.finance-filter-form input {
  width: 100%;
}

.finance-filter-form input,
.billing-config-empty input,
.billing-config-empty select,
.billing-action-grid input:not([type="file"]),
.billing-action-grid select,
.billing-action-grid textarea,
.billing-plan-adjustment input,
.billing-plan-adjustment select {
  box-sizing: border-box;
  width: 100%;
  padding: 0 14px;
  font-size: 14px;
}

.billing-action-grid textarea {
  min-height: 72px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

.finance-table-panel {
  padding: 0;
}

.finance-table-panel .table-scroll {
  overflow-x: auto;
}

.finance-bill-table {
  min-width: 1020px;
  table-layout: fixed;
}

.finance-bill-col-identity {
  width: 11%;
}

.finance-bill-col-customer {
  width: 11%;
}

.finance-bill-col-period {
  width: 14%;
}

.finance-bill-col-money {
  width: 9%;
}

.finance-bill-col-due {
  width: 12%;
}

.finance-bill-col-status {
  width: 10%;
}

.finance-bill-col-actions {
  width: 15%;
}

.finance-bill-status-cell {
  text-align: center;
}

.finance-bill-action-cell {
  text-align: left;
}

.finance-bill-action-cell .finance-row-actions {
  justify-content: flex-start;
}

.finance-payment-table,
.finance-collection-table {
  min-width: 1040px;
}

.finance-table-panel th,
.finance-table-panel td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.numeric-cell {
  text-align: right;
  white-space: nowrap;
}

.finance-money {
  color: var(--heading);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

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

.finance-payment-summary article {
  min-height: 88px;
}

.finance-payment-action-row,
.finance-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.finance-payment-action-row {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.finance-inline-form {
  margin: 0;
}

.finance-inline-form .finance-payment-reversal-input {
  box-sizing: border-box;
  width: 132px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  color: #172033;
  background: var(--glass-field);
  font-size: 12px;
  font-weight: 680;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.finance-inline-form .finance-payment-reversal-input:focus {
  border-color: var(--glass-line-strong);
  outline: 4px solid var(--theme-action-focus);
  background: rgba(255, 255, 255, 0.88);
}

.text-link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.contract-lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface-subtle);
}

.contract-lifecycle > div {
  min-width: 0;
  min-height: 66px;
  padding: 12px 18px;
  border-right: 1px solid var(--line-soft);
}

.contract-lifecycle > div:last-child {
  border-right: 0;
}

.contract-lifecycle span,
.contract-lifecycle strong {
  display: block;
}

.contract-lifecycle span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.contract-lifecycle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-section-nav {
  position: sticky;
  top: 96px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.contract-section-nav-links,
.contract-section-heading-actions {
  display: flex;
  align-items: center;
}

.contract-section-nav-links {
  gap: 4px;
}

.contract-section-heading-actions {
  gap: 8px;
  margin-left: auto;
}

.contract-section-heading-actions .inline-action-form {
  display: inline-flex;
  margin: 0;
}

.contract-section-nav-links > a {
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contract-section-nav-links > a:hover {
  color: var(--primary);
  background: var(--surface-hover);
}

.contract-record-section {
  scroll-margin-top: 150px;
  margin-bottom: 12px;
  padding: 0 22px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.contract-record-section.table-panel {
  padding: 0;
}

.contract-section-heading {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -22px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.table-panel .contract-section-heading {
  margin: 0;
}

.contract-section-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.contract-section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.contract-section-heading > div > span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.contract-section-heading > small {
  color: var(--muted);
  text-align: right;
}

.contract-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-left: 1px solid var(--line);
}

.contract-overview-grid > div {
  min-width: 0;
  min-height: 82px;
  padding: 14px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contract-overview-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.contract-overview-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--heading);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-config-empty {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(480px, 1.4fr);
  align-items: center;
  gap: 30px;
  padding: 22px 0 2px;
}

.billing-config-empty p {
  margin: 6px 0 0;
  color: var(--muted);
}

.billing-config-empty form,
.billing-plan-adjustment form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
}

.billing-config-empty label,
.billing-plan-adjustment label,
.billing-action-grid label {
  display: grid;
  gap: 6px;
}

.billing-config-empty label span,
.billing-plan-adjustment label span,
.billing-action-grid label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.contract-money-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 -22px 16px;
  border-bottom: 1px solid var(--line);
}

.contract-money-strip > div {
  min-height: 96px;
  padding: 16px 22px;
  border-right: 1px solid var(--line-soft);
}

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

.contract-money-strip span,
.contract-money-strip strong,
.contract-money-strip small {
  display: block;
}

.contract-money-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.contract-money-strip strong {
  margin: 7px 0 4px;
  font-size: 22px;
}

.contract-money-strip small {
  color: var(--muted);
  font-size: 11px;
}

.contract-money-strip .has-risk {
  background: var(--metric-danger-bg);
  box-shadow: inset 3px 0 0 var(--danger);
}

.contract-bill-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.contract-bill-table {
  min-width: 1040px;
}

.embedded-bill-detail {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
}

.bill-detail-modal {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(92vh, 920px);
}

.bill-detail-modal-card {
  position: relative;
  overflow: hidden;
}

.bill-detail-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
}

.bill-detail-modal .embedded-bill-detail {
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.bill-detail-modal .embedded-bill-head {
  padding-right: 74px;
}

.bill-modal-loading {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 750;
}

.bill-modal-loading.is-error {
  color: var(--danger);
}

.embedded-bill-head {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 21px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.embedded-bill-head h3,
.embedded-bill-head p {
  margin: 0;
}

.embedded-bill-head h3 {
  margin-top: 7px;
  font-size: 21px;
}

.embedded-bill-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.embedded-balance {
  text-align: right;
}

.embedded-balance span,
.embedded-balance strong {
  display: block;
}

.embedded-balance span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.embedded-balance strong {
  margin-top: 5px;
  color: var(--danger);
  font-size: 27px;
}

.embedded-bill-columns {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(430px, 1.1fr);
}

.embedded-line-items,
.embedded-activity {
  min-width: 0;
  padding: 19px 21px;
}

.embedded-line-items {
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.embedded-subheading {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.embedded-subheading h4 {
  margin: 0;
  font-size: 15px;
}

.embedded-subheading span {
  color: var(--muted);
  font-size: 11px;
}

.embedded-line,
.embedded-paid-line,
.embedded-total-line {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.embedded-line b,
.embedded-line small {
  display: block;
}

.embedded-line small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.embedded-paid-line {
  color: var(--muted);
}

.embedded-total-line {
  min-height: 64px;
  border-bottom: 0;
  font-weight: 850;
}

.embedded-total-line strong {
  color: var(--danger);
  font-size: 20px;
}

.billing-activity-timeline {
  display: grid;
  gap: 0;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.billing-activity-timeline li {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0 10px;
}

.billing-activity-timeline li::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -10px;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.billing-activity-timeline li:last-child::before {
  display: none;
}

.billing-activity-timeline li > i {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 2px solid var(--warning);
  border-radius: 50%;
  background: var(--surface);
}

.billing-activity-timeline li.is-payment > i {
  border-color: var(--success);
}

.billing-activity-timeline time,
.billing-activity-timeline strong,
.billing-activity-timeline p,
.billing-activity-timeline small {
  display: block;
}

.billing-activity-timeline time,
.billing-activity-timeline p,
.billing-activity-timeline small {
  color: var(--muted);
  font-size: 11px;
}

.billing-activity-timeline strong {
  margin: 3px 0;
}

.billing-activity-timeline b {
  color: var(--success);
}

.billing-activity-timeline p {
  margin: 3px 0 0;
}

.billing-activity-timeline li.is-empty {
  display: block;
  color: var(--muted);
}

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

.billing-action-grid details {
  min-width: 0;
  padding: 15px 20px 19px;
  border-right: 1px solid var(--line);
}

.billing-action-grid details:last-child {
  border-right: 0;
}

.billing-action-grid summary,
.billing-plan-adjustment summary {
  cursor: pointer;
  color: var(--heading);
  font-weight: 850;
}

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

.billing-action-grid .wide {
  grid-column: 1 / -1;
}

.billing-action-grid .clipboard-file-upload-layout {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: stretch;
}

.billing-action-grid .clipboard-file-upload-layout > .wide {
  grid-column: auto;
}

.billing-action-grid .clipboard-file-paste-box {
  min-height: 62px;
}

.billing-action-grid button {
  grid-column: 1 / -1;
  justify-self: end;
}

.billing-plan-adjustment {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.billing-plan-adjustment form {
  margin-top: 12px;
}

.billing-plan-adjustment p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .receivable-workbench {
    grid-template-columns: 1fr;
  }

  .receivable-schedule {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .finance-overdue-insight-grid,
  .embedded-bill-columns {
    grid-template-columns: 1fr;
  }

  .finance-aging-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .finance-section-heading {
    flex-wrap: wrap;
  }

  .finance-month-summary {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .finance-overdue-summary > span:nth-child(2) {
    border-right: 0;
  }

  .finance-overdue-summary > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .embedded-line-items {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

/* Task center manual sync: one unit, one clearly scoped command. */
.todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
  grid-template-columns: 128px minmax(260px, 1fr) 112px 88px 88px;
}

.todo-filter-panel .compact-filter-form > [data-modal-open] {
  box-sizing: border-box;
  min-height: var(--toolbar-control-height);
  border-radius: var(--toolbar-control-radius);
  white-space: nowrap;
}

.manual-sync-modal-card {
  max-width: 680px;
  margin: 0 auto;
}

.manual-sync-modal .manual-sync-form {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.manual-sync-modal-section {
  display: grid;
  gap: 9px;
}

.manual-sync-modal-label {
  color: var(--heading);
  font-size: 13px;
  font-weight: 850;
}

.manual-sync-modal .manual-sync-unit-trigger {
  min-height: 46px;
  padding-inline: 14px 40px;
  border-radius: 8px;
  background: var(--surface);
}

.manual-sync-modal .manual-sync-selected-display {
  color: var(--heading);
  font-weight: 780;
}

.manual-sync-modal .manual-sync-unit-trigger:focus-visible,
.manual-sync-command-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent);
  outline-offset: 2px;
  border-color: var(--brand);
}

.manual-sync-modal .manual-sync-unit-dropdown-menu {
  z-index: 90;
  width: 100%;
  max-width: none;
}

.manual-sync-modal .manual-sync-unit-option:has(input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: -2px;
}

.manual-sync-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-sync-command-button {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--heading);
  background: color-mix(in srgb, var(--surface-subtle) 76%, var(--surface));
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.manual-sync-command-button strong {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 880;
}

.manual-sync-command-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
}

.manual-sync-command-button:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--brand) 58%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  box-shadow: 0 8px 18px rgba(35, 63, 99, 0.08);
}

.manual-sync-command-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.manual-sync-warm-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px 12px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.manual-sync-warm-note strong {
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 880;
  white-space: nowrap;
}

.manual-sync-warm-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 650;
}

@media (max-width: 1100px) {
  .todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
    grid-template-columns: 128px minmax(240px, 1fr) 112px 88px 88px;
  }
}

@media (max-width: 760px) {
  .todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .todo-filter-panel .compact-filter-form .filter-field-keyword {
    grid-column: 1 / -1;
  }

  .manual-sync-command-grid,
  .manual-sync-warm-note {
    grid-template-columns: minmax(0, 1fr);
  }

  .manual-sync-warm-note {
    gap: 4px;
  }
}

@media (max-width: 760px) {
  .billing-action-grid {
    grid-template-columns: 1fr;
  }

  .billing-action-grid details {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .billing-action-grid details:last-child {
    border-bottom: 0;
  }

  .billing-action-grid .clipboard-file-upload-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .operator-filter-form,
  .operator-account-row,
  .operator-account-actions {
    grid-template-columns: 1fr;
  }

  .operator-account-meta {
    justify-items: start;
  }

  .operator-summary-main,
  .operator-auth-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .operator-summary-chips,
  .operator-tab-actions {
    justify-content: flex-start;
  }
}

/* Design refresh: shared operational console patterns. */
.workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 190px),
    var(--page-bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  padding: 0 28px;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.topbar strong {
  font-size: 15px;
  letter-spacing: 0;
}

.content {
  padding: 24px 30px 34px;
}

.page-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.page-heading::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  width: 148px;
  height: 3px;
  background: var(--brand);
  opacity: 0.22;
}

.page-heading p {
  max-width: 860px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-heading p:first-child {
  margin-top: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.page-heading h1 {
  font-size: 26px;
  line-height: 1.18;
}

.snapshot-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.snapshot-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.page-actions {
  position: relative;
  z-index: 1;
}

.metric-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  --metric-tone: var(--brand);
  --metric-bg: var(--metric-subtle-bg);
  min-height: 104px;
  align-content: start;
  gap: 10px;
  padding: 17px 18px;
  border-color: color-mix(in srgb, var(--metric-tone) 34%, var(--line));
  background: var(--metric-bg);
  box-shadow: none;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card span {
  font-size: 14px;
  font-weight: 800;
}

.metric-card strong {
  color: var(--heading);
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  line-height: 1.35;
}

.metric-card.danger {
  --metric-tone: var(--danger);
  --metric-bg: var(--metric-danger-bg);
}

.metric-card.warning {
  --metric-tone: var(--warning);
  --metric-bg: var(--metric-warning-bg);
}

.metric-card.info {
  --metric-tone: var(--primary);
  --metric-bg: var(--metric-info-bg);
}

.metric-card.subtle {
  --metric-tone: var(--success);
  --metric-bg: var(--metric-success-bg);
}

.metric-card-link:hover {
  border-color: var(--metric-tone);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.08);
}

.workbench-toolbar,
.todo-manual-panel,
.todo-group-card,
.table-panel,
.detail-panel,
.entry-panel,
.form-panel,
.settings-card,
.upload-drawer {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.workbench-toolbar {
  margin-bottom: 14px;
  padding: 12px;
}

.compact-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: end;
}

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

.filter-field span {
  color: var(--muted);
}

.filter-field input,
.filter-field select,
.searchable-select-input {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.filter-field input:focus,
.filter-field select:focus,
.searchable-select-input:focus {
  border-color: var(--brand);
  outline: 2px solid var(--focus-ring);
}

.more-filter-popover summary {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-subtle);
}

.more-filter-popover[open] summary {
  border-color: var(--brand);
  color: var(--brand);
}

.more-filter-panel,
.searchable-select-list {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 22px 50px rgba(16, 24, 40, 0.14);
}

.active-filter-tags span {
  border-color: var(--line);
  color: var(--brand-dark);
  background: var(--surface-subtle);
}

.primary-button {
  border-radius: 7px;
  background: var(--brand);
}

a.primary-button:hover,
button.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button,
.ghost-button {
  border-radius: 7px;
}

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

.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ghost-button {
  background: var(--surface-subtle);
  color: var(--text);
}

.todo-group-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.todo-group-head {
  min-height: 48px;
  padding: 10px 13px;
}

.todo-group-head:hover,
.todo-group-card dl a:hover,
.todo-table tr:hover td,
.violation-table tr:hover td {
  background: var(--surface-hover);
}

.todo-group-head span,
.todo-group-card dd,
.todo-table-panel .panel-heading p,
.todo-table td span,
.muted-text,
.sub-value,
.status-note {
  color: var(--muted);
}

.todo-group-card dl {
  background: var(--line);
}

.todo-group-card dl a {
  min-height: 38px;
  padding: 9px 13px;
  background: var(--surface);
}

.todo-group-card dt,
.todo-table td strong {
  color: var(--heading);
}

.todo-manual-panel summary {
  min-height: 42px;
  color: var(--text);
}

.todo-manual-panel summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.todo-manual-panel[open] summary::after,
.todo-manual-panel details[open] summary::after {
  content: "收起";
}

.table-panel {
  overflow: hidden;
}

.panel-heading {
  margin-bottom: 0;
}

.todo-table-panel .panel-heading,
.violation-table-panel .panel-heading {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.todo-table th,
.violation-table th,
.platform-table th,
th {
  color: var(--muted);
  background: var(--table-head);
  font-size: 12px;
  font-weight: 800;
}

.todo-table td,
.violation-table td {
  border-bottom-color: var(--line-soft);
}

.todo-table th,
.todo-table td {
  padding: 10px 14px;
}

.violation-table th,
.violation-table td {
  padding: 10px 12px;
}

.violation-time-line {
  gap: 8px;
}

.status-chip {
  min-height: 22px;
  border-radius: 5px;
  background: var(--surface-subtle);
}

.theme-toggle {
  background: var(--surface-subtle);
}

.theme-toggle button.is-active {
  background: var(--brand-dark);
}

@media (max-width: 1180px) {
  .violation-workbench {
    grid-template-columns: 1fr;
  }

  .violation-metrics {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

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

  .sidebar {
    height: auto;
    min-height: auto;
    position: static;
    overflow-y: visible;
  }

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

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .content {
    padding: 20px;
  }

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

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

  .settings-profile-meta {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .workbench-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .modal-split-grid {
    grid-template-columns: 1fr;
  }

  .violation-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .compact-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .filter-field,
  .filter-field-keyword {
    min-width: 0;
    flex: initial;
  }

  .more-filter-popover {
    position: static;
  }

  .more-filter-panel {
    left: 20px;
    right: 20px;
    width: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .violation-metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 20px;
  }

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

/* SaaS visual direction copied from the approved dashboard preview. */
:root {
  --sidebar-width: 208px;
  --control-border: #cfd8df;
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  padding: 18px 12px;
}

.brand {
  align-items: flex-start;
  gap: 0;
  margin-bottom: 0;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand strong {
  color: var(--heading);
  font-size: 15px;
  line-height: 1.35;
}

.brand small {
  display: block;
  margin-top: 6px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
}

.nav {
  gap: 5px;
  padding-top: 12px;
}

.nav-section {
  margin: 14px 8px 4px;
  font-size: 11px;
}

.nav-item {
  min-height: 34px;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.nav-item > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item small {
  color: #7f8da3;
  font-size: 11px;
  font-weight: 900;
}

.nav-item-active small,
.nav-item:hover small {
  color: rgba(255, 255, 255, 0.74);
}

.topbar {
  height: 58px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.topbar strong {
  font-size: 15px;
}

.theme-toggle {
  gap: 8px;
  border-color: var(--line);
  background: transparent;
  padding: 0;
}

.theme-toggle button {
  min-height: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--heading);
  padding: 0 12px;
}

.theme-toggle button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: none;
}

.ghost-button,
.secondary-button,
.primary-button,
.danger-button {
  min-height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: #334155;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
}

a.primary-button:hover,
button.primary-button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.content {
  padding: 24px 28px 40px;
}

.workbench-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.workbench-heading::after {
  display: none;
}

.workbench-heading p {
  max-width: none;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.workbench-heading p:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.workbench-heading h1 {
  margin: 0;
  color: var(--heading);
  font-size: 28px;
  line-height: 1.15;
}

.snapshot-meta {
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.snapshot-meta span {
  min-height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.snapshot-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--muted);
}

.todo-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 98px;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: none;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-card strong {
  margin-top: 0;
  color: var(--heading);
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric-card.danger {
  border-color: #f1c7bd;
  background: #fff8f6;
}

.metric-card.warning {
  border-color: #f1d69f;
  background: #fffaf0;
}

.metric-card.info {
  border-color: #bad5ff;
  background: #f4f8ff;
}

.metric-card.subtle {
  border-color: #c8d8d4;
  background: #f7fbfa;
}

html[data-portal-theme="bluegray"] .metric-card.danger {
  border-color: #f1c7bd;
  background: #fff8f8;
}

html[data-portal-theme="bluegray"] .metric-card.warning {
  border-color: #f1d69f;
  background: #fffaf0;
}

html[data-portal-theme="bluegray"] .metric-card.info {
  border-color: #bad5ff;
  background: #f4f8ff;
}

.workbench-toolbar {
  padding: 14px 16px;
  border-radius: 8px;
}

.compact-filter-form {
  grid-template-columns: minmax(220px, 1fr) 112px 88px 88px;
  gap: 10px;
}

.filter-field input,
.filter-field select,
.searchable-select-input {
  height: 36px;
  border-color: var(--control-border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}

.more-filter-popover summary {
  height: 36px;
  border-color: var(--control-border);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 14px;
}

.todo-group-card,
.todo-manual-panel,
.table-panel,
.workbench-toolbar {
  border-radius: 8px;
}

.todo-group-head,
.panel-heading {
  padding: 14px 16px;
}

.todo-group-card strong,
.panel-heading h2 {
  font-size: 17px;
}

.todo-group-card dl a {
  min-height: 39px;
  padding: 10px 16px;
}

.status-chip {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-chip.warning-chip {
  color: var(--brand);
  background: #fff1dc;
}

.status-chip.info,
.status-chip.muted {
  color: var(--brand-dark);
  background: #eaf4f1;
}

.todo-table th,
.todo-table td {
  padding: 13px 16px;
}

.todo-table td strong {
  font-size: 14px;
}

.todo-table td span {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .todo-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 920px) {
  :root {
    --sidebar-width: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: auto;
  }

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

/* Final title treatment: remove page intro banners and keep a compact centered title. */
.page-heading,
.workbench-heading,
.dashboard-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin: 0 0 18px;
  padding: 0;
  overflow: visible;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-heading::after,
.workbench-heading::after,
.dashboard-heading::after {
  display: none;
}

.page-heading > div:first-child,
.workbench-heading > div:first-child,
.dashboard-heading > div:first-child {
  min-width: 0;
}

.page-heading p,
.workbench-heading p,
.dashboard-heading p,
.page-heading .snapshot-meta,
.workbench-heading .snapshot-meta,
.dashboard-heading .snapshot-meta {
  display: none;
}

.page-heading h1,
.workbench-heading h1,
.dashboard-heading h1 {
  margin: 0;
  color: var(--heading);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-heading .page-actions,
.workbench-heading .page-actions,
.dashboard-heading .page-actions {
  position: absolute;
  right: 0;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  transform: translateY(-50%);
}

/* Move page titles into the top bar and remove the old content title strip. */
.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  column-gap: 18px;
}

.topbar-tenant {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-tenant strong,
.topbar-tenant span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
}

.topbar-actions {
  justify-self: end;
}

.page-heading,
.workbench-heading,
.dashboard-heading {
  display: none;
}

.content {
  padding-top: 24px;
}

.filter-field-keyword > span {
  display: none;
}

.page-sync-meta {
  margin: -14px 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

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

.compact-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-filter-form .filter-field-keyword {
  flex: 1 1 320px;
  min-width: min(320px, 100%);
}

.compact-filter-form > button,
.compact-filter-form > a,
.compact-filter-form > details {
  flex: 0 0 auto;
}

/* Task center refinement: keep filter and manual sync in one card, reduce list chrome. */
.todo-filter-panel {
  margin-bottom: 10px;
  padding: 10px 14px 0;
}

.todo-filter-panel .compact-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 112px 88px 88px;
  align-items: end;
  gap: 10px;
  flex-wrap: initial;
}

.todo-filter-panel .compact-filter-form .filter-field-keyword {
  min-width: 0;
}

.todo-filter-panel .active-filter-tags {
  margin-top: 8px;
}

.todo-manual-sync-panel {
  margin: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.todo-manual-sync-panel details {
  margin: 0;
}

.todo-manual-sync-panel summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  padding: 0;
  cursor: pointer;
}

.todo-manual-sync-panel summary::marker {
  content: "";
  font-size: 0;
}

.todo-manual-sync-panel summary::-webkit-details-marker {
  display: none;
}

.todo-manual-sync-panel .todo-manual-grid {
  padding: 0 0 10px;
}

.todo-manual-sync-panel .manual-sync-form {
  grid-template-columns: 180px minmax(360px, 1fr) 128px;
}

.todo-manual-sync-panel summary::after,
.todo-manual-sync-panel details[open] summary::after {
  content: "" !important;
  display: none !important;
}

.todo-manual-summary-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-left: auto;
}

.todo-manual-sync-panel summary strong {
  color: var(--heading);
  font-size: 18px;
  font-weight: 900;
}

.contract-table .status-chip-row {
  flex-wrap: nowrap;
  align-items: center;
  max-width: none;
  gap: 6px;
}

.contract-table .status-chip {
  flex: 0 0 auto;
  width: auto;
  max-width: max-content;
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.15;
}

.todo-table-panel {
  padding: 0 !important;
}

.todo-table th,
.todo-table td {
  padding-top: 6px;
  padding-right: 14px;
  padding-bottom: 6px;
  padding-left: 14px;
}

.todo-table .table-actions {
  gap: 6px;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.todo-action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.todo-error-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.todo-transfer-violation-list {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.todo-transfer-violation-list a {
  display: block;
  white-space: nowrap;
}

.todo-table .status-chip-row {
  flex-wrap: wrap;
  align-items: flex-start;
  max-width: 160px;
  gap: 6px;
}

.todo-table .status-chip {
  min-height: 28px;
  display: inline-flex;
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.15;
}

.list-row-actions {
  gap: 6px;
}

.contract-binding-row-actions {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.contract-binding-table {
  table-layout: fixed;
  min-width: 1120px;
}

.contract-binding-table th:nth-child(1) {
  width: 4%;
}

.contract-binding-table th:nth-child(2),
.contract-binding-table th:nth-child(3) {
  width: 13%;
}

.contract-binding-table th:nth-child(4),
.contract-binding-table th:nth-child(5) {
  width: 14%;
}

.contract-binding-table th:nth-child(6) {
  width: 26%;
}

.contract-binding-table th:nth-child(7) {
  width: 10%;
}

.contract-binding-table th:nth-child(8) {
  width: 128px;
}

.unit-table .list-row-actions {
  flex-wrap: nowrap;
}

.unit-table .list-row-actions form {
  margin: 0;
}

.list-row-actions .compact-button,
.merchant-list-table .list-row-actions .compact-button {
  box-sizing: border-box;
  flex: 0 0 auto;
  height: 28px;
  min-width: 50px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  justify-content: center;
}

.sensitive-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.sensitive-value-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
  text-underline-offset: 3px;
}

.sensitive-value-clickable:hover,
.sensitive-value-clickable:focus-visible {
  color: var(--heading);
  outline: none;
  text-decoration-color: var(--accent);
}

@media (max-width: 1100px) {
  .todo-filter-panel .compact-filter-form,
  .todo-manual-sync-panel .manual-sync-form {
    grid-template-columns: 1fr;
  }

}

/* Premium glass SaaS skin: extends the login visual language across the product. */
:root {
  --sidebar-width: 208px;
  --glass-page-top: #f8fafc;
  --glass-page-bottom: #edf3f8;
  --glass-panel: rgba(255, 255, 255, 0.72);
  --glass-panel-strong: rgba(255, 255, 255, 0.86);
  --glass-field: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(127, 144, 166, 0.24);
  --glass-line-strong: rgba(96, 116, 139, 0.34);
  --glass-shadow: 0 24px 70px rgba(27, 45, 66, 0.12);
  --glass-shadow-soft: 0 14px 38px rgba(27, 45, 66, 0.08);
  --glass-blue: #2f5f87;
  --glass-blue-dark: #254d70;
  --glass-blue-soft: rgba(47, 95, 135, 0.1);
  --glass-brass: #c6923d;
  --glass-brass-dark: #a36f28;
  --glass-brass-soft: rgba(198, 146, 61, 0.13);
  --theme-action: var(--glass-brass);
  --theme-action-dark: var(--glass-brass-dark);
  --theme-action-soft: var(--glass-brass-soft);
  --theme-action-shadow: rgba(198, 146, 61, 0.18);
  --theme-action-shadow-strong: rgba(198, 146, 61, 0.24);
  --theme-action-focus: rgba(198, 146, 61, 0.11);
  --glass-red-soft: rgba(180, 35, 24, 0.08);
  --glass-green-soft: rgba(8, 116, 67, 0.09);
  --glass-violet-soft: rgba(112, 78, 204, 0.08);
}

html[data-portal-theme="warm"] {
  --brand: var(--glass-brass);
  --primary: var(--glass-brass);
  --brand-dark: var(--glass-brass-dark);
  --accent: var(--glass-brass);
  --focus-ring: rgba(198, 146, 61, 0.18);
  --theme-action: var(--glass-brass);
  --theme-action-dark: var(--glass-brass-dark);
  --theme-action-soft: var(--glass-brass-soft);
  --theme-action-shadow: rgba(198, 146, 61, 0.18);
  --theme-action-shadow-strong: rgba(198, 146, 61, 0.24);
  --theme-action-focus: rgba(198, 146, 61, 0.11);
}

html[data-portal-theme="bluegray"] {
  --brand: var(--glass-blue);
  --primary: var(--glass-blue);
  --brand-dark: var(--glass-blue-dark);
  --accent: var(--glass-brass);
  --focus-ring: rgba(47, 95, 135, 0.18);
  --theme-action: var(--glass-blue);
  --theme-action-dark: var(--glass-blue-dark);
  --theme-action-soft: var(--glass-blue-soft);
  --theme-action-shadow: rgba(47, 95, 135, 0.18);
  --theme-action-shadow-strong: rgba(47, 95, 135, 0.24);
  --theme-action-focus: rgba(47, 95, 135, 0.1);
}

body.app-shell {
  min-height: 100vh;
  min-width: var(--portal-desktop-width);
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  color: #172033;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.96) 0 10%, transparent 32%),
    radial-gradient(circle at 22% 22%, rgba(185, 130, 44, 0.16), transparent 24%),
    radial-gradient(circle at 82% 34%, rgba(47, 95, 135, 0.15), transparent 28%),
    radial-gradient(circle at 52% 84%, rgba(47, 95, 135, 0.09), transparent 34%),
    linear-gradient(180deg, var(--glass-page-top), var(--glass-page-bottom));
  font-family: Inter, "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(47, 95, 135, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47, 95, 135, 0.04) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0 48%, transparent 82%);
}

body.app-shell .sidebar {
  position: sticky;
  top: 14px;
  width: auto;
  height: calc(100vh - 28px);
  min-height: 0;
  padding: 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.3));
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(18px);
}

body.app-shell .brand {
  margin: 0;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--glass-line);
}

body.app-shell .brand strong {
  color: #172033;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

body.app-shell .nav {
  gap: 5px;
  padding-top: 14px;
}

body.app-shell .nav-section {
  margin: 16px 10px 8px;
  color: #8a96a8;
  font-size: 12px;
  font-weight: 850;
}

body.app-shell .nav-section:first-child {
  margin-top: 0;
}

body.app-shell .nav-group {
  min-width: 0;
}

body.app-shell .nav-group + .nav-group {
  margin-top: 2px;
}

body.app-shell .nav-group-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #314054;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

body.app-shell .nav-group-trigger:hover,
body.app-shell .nav-group.is-open .nav-group-trigger {
  color: var(--theme-action-dark);
  background: var(--theme-action-soft);
}

body.app-shell .nav-group-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--theme-action) 40%, transparent);
  outline: 3px solid var(--theme-action-focus);
  outline-offset: 1px;
}

body.app-shell .nav-group-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.66;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

body.app-shell .nav-group.is-open .nav-group-chevron {
  transform: rotate(45deg);
}

body.app-shell .nav-group-panel[hidden] {
  display: none;
}

body.app-shell .nav-submenu {
  position: relative;
  display: grid;
  gap: 3px;
  margin: 3px 0 8px 9px;
  padding: 2px 0 2px 15px;
}

body.app-shell .nav-submenu::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 4px;
  width: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-action) 28%, var(--glass-line));
}

body.app-shell .nav-submenu .nav-item {
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

body.app-shell .nav-item {
  min-height: 38px;
  justify-content: space-between;
  gap: 8px;
  border-radius: 9px;
  padding: 0 10px;
  color: #314054;
  background: transparent;
  font-size: 14px;
  font-weight: 820;
}

body.app-shell .nav-item:hover {
  color: #172033;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: none;
  transform: translateX(1px);
}

body.app-shell .nav-item-active,
body.app-shell .nav-item-active:hover {
  color: #ffffff;
  background: linear-gradient(180deg, var(--theme-action), var(--theme-action-dark));
  box-shadow: 0 12px 24px var(--theme-action-shadow);
}

body.app-shell .nav-item small {
  color: inherit;
  opacity: 0.68;
  font-size: 12px;
  font-weight: 900;
}

body.app-shell .workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  background: transparent;
}

body.app-shell[data-platform-delegation-context-id] .workspace {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.app-shell .topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  min-height: 74px;
  height: auto;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  column-gap: 18px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(18px);
}

body.app-shell .topbar strong {
  color: #172033;
  font-size: 16px;
  font-weight: 900;
}

body.app-shell .topbar span {
  color: #6d7a8e;
  font-weight: 760;
}

body.app-shell .topbar-center {
  justify-self: center;
}

body.app-shell .theme-toggle {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

body.app-shell .theme-toggle button {
  min-width: 62px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #6d7a8e;
  background: transparent;
  font-size: 14px;
  font-weight: 880;
}

body.app-shell .theme-toggle button.is-active {
  color: #ffffff;
  border: 0;
  background: var(--brand);
  box-shadow: 0 10px 22px var(--theme-action-shadow);
}

body.app-shell .topbar-actions {
  justify-self: end;
}

body.app-shell .content {
  min-width: 0;
  padding: 0 0 24px;
}

.metric-grid,
.todo-metrics {
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 126px;
  padding: 20px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.metric-card span {
  color: #6d7a8e;
  font-size: 14px;
  font-weight: 880;
}

.metric-card strong {
  margin-top: 14px;
  color: #101827;
  font-size: 38px;
  line-height: 1;
  font-weight: 950;
}

.metric-card small {
  margin-top: 12px;
  color: #6d7a8e;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.5;
}

.metric-card.danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), var(--glass-red-soft));
}

.metric-card.warning {
  border-color: rgba(185, 130, 44, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), var(--glass-brass-soft));
}

.metric-card.info {
  border-color: rgba(47, 95, 135, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), var(--glass-blue-soft));
}

.metric-card.subtle {
  border-color: rgba(8, 116, 67, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), var(--glass-green-soft));
}

.table-panel,
.detail-panel,
.entry-panel,
.form-panel,
.settings-card,
.workbench-toolbar,
.todo-filter-panel,
.todo-manual-panel,
.todo-group-card,
.tenant-health-panel,
.tenant-troubleshooting-panel,
.upload-drawer,
.compliance-modal-card,
.legal-document-body,
.assistant-download-panel {
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.table-panel {
  overflow: hidden;
}

.panel-heading,
.todo-group-head,
.table-panel > h2:first-child {
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.44);
}

.panel-heading h2,
.todo-group-card strong,
.table-panel > h2:first-child {
  color: #172033;
  font-size: 18px;
  font-weight: 900;
}

.panel-heading p,
.panel-heading span,
.todo-group-head span {
  color: #6d7a8e;
  font-size: 13px;
  font-weight: 780;
}

.workbench-toolbar,
.todo-filter-panel {
  padding: 14px 18px;
}

.compact-filter-form {
  gap: 10px;
}

.filter-field input,
.filter-field select,
.finance-filter-form input,
.billing-config-empty input,
.billing-config-empty select,
.billing-action-grid input,
.billing-action-grid select,
.billing-action-grid textarea,
.billing-plan-adjustment input,
.billing-plan-adjustment select,
.searchable-select-input,
.table-action-form select,
.token-copy-field input,
.modal-form input,
.modal-form select,
.modal-form textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 42px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  color: #172033;
  background: var(--glass-field);
  font-weight: 680;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.filter-field input:focus,
.filter-field select:focus,
.finance-filter-form input:focus,
.billing-config-empty input:focus,
.billing-config-empty select:focus,
.billing-action-grid input:focus,
.billing-action-grid select:focus,
.billing-action-grid textarea:focus,
.billing-plan-adjustment input:focus,
.billing-plan-adjustment select:focus,
.searchable-select-input:focus,
.table-action-form select:focus,
.token-copy-field input:focus,
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--glass-line-strong);
  outline: 4px solid var(--theme-action-focus);
  background: rgba(255, 255, 255, 0.88);
}

.form-grid .checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 4px;
  box-shadow: none;
}

.more-filter-popover summary {
  height: 42px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  color: #314054;
  background: var(--glass-field);
  font-weight: 850;
}

.more-filter-popover[open] summary {
  border-color: var(--brand);
  color: var(--brand);
}

.more-filter-panel,
.searchable-select-list {
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(27, 45, 66, 0.14);
  backdrop-filter: blur(18px);
}

.active-filter-tags span,
.tag-pill,
.status-chip {
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

a.primary-button,
button.primary-button,
.login-form button {
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--theme-action), var(--theme-action-dark));
  box-shadow: 0 12px 24px var(--theme-action-shadow);
}

a.primary-button:hover,
button.primary-button:hover {
  border: 0;
  background: linear-gradient(180deg, var(--theme-action), var(--theme-action-dark));
  box-shadow: 0 16px 30px var(--theme-action-shadow-strong);
  transform: translateY(-1px);
}

a.secondary-button,
a.ghost-button,
button.secondary-button,
button.ghost-button,
.compact-button {
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  color: #314054;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

a.secondary-button:hover,
a.ghost-button:hover,
button.secondary-button:hover,
button.ghost-button:hover,
.compact-button:hover {
  border-color: var(--glass-line-strong);
  color: #172033;
  background: rgba(255, 255, 255, 0.82);
}

a.danger-button,
button.danger-button {
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 10px;
  color: #b42318;
  background: rgba(255, 255, 255, 0.72);
}

table {
  border-collapse: collapse;
}

th,
td {
  border-bottom-color: var(--glass-line);
}

th {
  color: var(--muted);
  background: var(--table-head);
  font-weight: 880;
}

td {
  color: #243247;
}

.todo-table td strong,
td strong,
.object-title {
  color: #172033;
  font-weight: 900;
}

.todo-table td span,
td small,
.object-sub,
.muted-text {
  color: #6d7a8e;
}

.status-chip.warning-chip {
  color: var(--glass-brass-dark);
  background: var(--glass-brass-soft);
}

.status-chip.info,
.status-chip.muted {
  color: var(--glass-blue-dark);
  background: var(--glass-blue-soft);
}

.status-chip.success,
.status-chip.done {
  color: #087443;
  background: var(--glass-green-soft);
}

.status-chip.danger-chip,
.status-chip.danger,
.status-chip.error {
  color: #b42318;
  background: var(--glass-red-soft);
}

.pagination a,
.pagination span,
.page-button {
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  color: #314054;
  background: rgba(255, 255, 255, 0.58);
  font-weight: 850;
}

.pagination .current,
.pagination .active,
.page-button.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--theme-action);
}

body.app-shell .filter-bar a.active,
body.app-shell .workbench-tabs a.active {
  color: #ffffff;
  border-color: var(--theme-action);
  background: var(--theme-action);
}

body.app-shell .filter-bar a.active:hover,
body.app-shell .workbench-tabs a.active:hover {
  color: #ffffff;
  border-color: var(--theme-action-dark);
  background: var(--theme-action-dark);
}

body.app-shell .workbench-tabs a:hover {
  color: var(--theme-action-dark);
  background: var(--theme-action-soft);
}

body.app-shell .manual-sync-unit-option.is-selected {
  color: var(--theme-action-dark);
  background: var(--theme-action-soft);
}

body.app-shell .manual-sync-unit-option.is-selected::after {
  color: var(--theme-action);
}

.todo-filter-panel .compact-filter-form {
  grid-template-columns: minmax(260px, 1fr) 112px 88px 88px;
}

.todo-manual-sync-panel {
  border-top-color: var(--glass-line);
}

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

  body.app-shell .sidebar {
    position: relative;
    top: 0;
    height: auto;
  }
}

@media (max-width: 720px) {
  body.app-shell {
    padding: 10px;
  }

  body.app-shell .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.app-shell .topbar-center,
  body.app-shell .topbar-actions {
    justify-self: start;
  }

  .metric-grid,
  .todo-metrics {
    grid-template-columns: 1fr;
  }
}

/* Glass theme performance pass: keep the texture, remove scroll-heavy live blur. */
:root {
  --glass-panel: rgba(255, 255, 255, 0.78);
  --glass-panel-strong: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 18px 44px rgba(27, 45, 66, 0.1);
  --glass-shadow-soft: 0 10px 24px rgba(27, 45, 66, 0.07);
}

body.app-shell::before {
  display: none;
}

body.app-shell .sidebar,
body.app-shell .topbar,
.metric-card,
.table-panel,
.detail-panel,
.entry-panel,
.form-panel,
.settings-card,
.workbench-toolbar,
.todo-filter-panel,
.todo-manual-panel,
.todo-group-card,
.tenant-health-panel,
.tenant-troubleshooting-panel,
.upload-drawer,
.compliance-modal-card,
.legal-document-body,
.assistant-download-panel {
  backdrop-filter: none;
}

body.app-shell .sidebar,
body.app-shell .topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 248, 252, 0.78)),
    rgba(255, 255, 255, 0.72);
  box-shadow: var(--glass-shadow-soft);
}

body.app-shell .topbar {
  box-shadow: 0 8px 22px rgba(27, 45, 66, 0.07);
}

.metric-card,
.table-panel,
.detail-panel,
.entry-panel,
.form-panel,
.settings-card,
.workbench-toolbar,
.todo-filter-panel,
.todo-manual-panel,
.todo-group-card,
.tenant-health-panel,
.tenant-troubleshooting-panel,
.upload-drawer,
.compliance-modal-card,
.legal-document-body,
.assistant-download-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.7)),
    rgba(255, 255, 255, 0.74);
  box-shadow: var(--glass-shadow-soft);
}

.more-filter-panel,
.searchable-select-list {
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(27, 45, 66, 0.12);
}

a.primary-button,
button.primary-button,
.login-form button {
  box-shadow: 0 8px 18px var(--theme-action-shadow);
}

a.primary-button:hover,
button.primary-button:hover {
  box-shadow: 0 10px 22px var(--theme-action-shadow-strong);
  transform: none;
}

.metric-card:hover,
.table-panel:hover,
.todo-group-card:hover {
  transform: none;
}

/* Merchant detail pages follow the task-center layout rhythm. */
.detail-metrics {
  margin-bottom: 14px;
}

.unit-detail-metrics {
  grid-template-columns: 1.05fr repeat(4, minmax(0, 1fr));
}

.detail-metrics .metric-card {
  min-height: 118px;
}

.detail-metrics .metric-card strong {
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.detail-metrics .metric-card small {
  overflow-wrap: anywhere;
}

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

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

.detail-panel {
  padding: 0;
  overflow: hidden;
}

.detail-panel .panel-heading {
  margin-bottom: 0;
}

.detail-panel .detail-grid {
  padding: 16px 18px;
  gap: 12px 18px;
}

.detail-panel .form-grid {
  padding: 16px 18px 0;
}

.detail-panel > .form-actions,
.detail-panel > .muted-text {
  margin: 0;
  padding: 0 18px 16px;
}

.detail-panel > form.form-actions {
  margin: 0;
  padding: 0 18px 16px;
}

.detail-panel > form:not(.form-actions) {
  margin: 0;
}

.detail-panel > form:not(.form-actions) > button {
  margin: 0 18px 16px;
}

.detail-panel .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-panel .form-actions .inline-action-form {
  display: inline-flex;
  margin: 0;
}

.detail-panel .form-actions input[type="file"] {
  max-width: 360px;
}

.reference-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px 18px;
}

.reference-image-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.reference-image-preview-button {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}

.reference-image-preview-button:focus-visible {
  outline: 3px solid rgba(43, 101, 140, 0.28);
  outline-offset: 3px;
}

.reference-image-preview-button img {
  display: block;
  width: 100%;
  min-height: 160px;
  max-height: 360px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.reference-image-card figcaption {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.reference-image-preview-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.96);
}

.reference-image-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
}

.reference-image-preview-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 24px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reference-image-preview-navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: center;
}

.reference-image-preview-stage {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.reference-image-preview-stage.is-draggable {
  cursor: grab;
}

.reference-image-preview-stage.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.reference-image-preview-canvas {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: auto;
}

.reference-image-preview-canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.reference-image-preview-canvas img.is-switching {
  opacity: 0;
  visibility: hidden;
}

.reference-image-preview-nav,
.reference-image-zoom-controls button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.reference-image-preview-nav {
  width: 44px;
  height: 54px;
  border-radius: 7px;
  font-size: 32px;
  line-height: 1;
}

.reference-image-preview-nav:disabled,
.reference-image-zoom-controls button:disabled {
  opacity: 0.28;
  cursor: default;
}

.reference-image-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) auto 36px;
  min-height: 38px;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.reference-image-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-image-zoom-controls button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 18px;
}

.reference-image-zoom-controls span {
  min-width: 48px;
  text-align: center;
}

.reference-image-preview-close {
  position: static;
  width: 36px;
  height: 36px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.unit-risk-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 0;
  padding: 18px 22px 22px;
}

.unit-risk-summary div {
  min-width: 0;
}

.unit-risk-summary dt {
  color: #75859a;
  font-size: 14px;
  font-weight: 800;
}

.unit-risk-summary dd {
  margin: 6px 0 0;
  color: #172033;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

/* List pages share the task-center rhythm: table header attached to the card, pagination as the card footer. */
.table-panel:has(> table:first-child),
.table-panel:has(> .panel-heading + table) {
  padding: 0 !important;
}

.table-panel:has(> table:first-child) > table,
.table-panel:has(> .panel-heading + table) > table {
  margin: 0;
}

.table-panel > .pagination-bar,
.table-panel + .pagination-bar,
.violation-workbench + .pagination-bar {
  margin: 0;
  padding: 18px 16px 22px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.5);
}

.table-panel + .pagination-bar,
.violation-workbench + .pagination-bar {
  margin-top: -1px;
  margin-bottom: 18px;
  border: 1px solid var(--glass-line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: var(--glass-shadow-soft);
}

.table-panel:has(+ .pagination-bar),
.violation-workbench:has(+ .pagination-bar) .table-panel {
  margin-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.violation-workbench:has(+ .pagination-bar) {
  gap: 0;
}

/* Unified search toolbar controls across merchant and platform list pages. */
:root {
  --toolbar-control-height: 42px;
  --toolbar-control-radius: 10px;
  --toolbar-button-min-width: 88px;
}

.workbench-toolbar .compact-filter-form,
.table-panel > .compact-filter-form {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}

.workbench-toolbar .compact-filter-form > input[type="hidden"],
.table-panel > .compact-filter-form > input[type="hidden"] {
  display: none;
}

.workbench-toolbar .compact-filter-form > .filter-field,
.table-panel > .compact-filter-form > .filter-field {
  min-width: 0;
  align-self: center;
}

.workbench-toolbar .compact-filter-form > .filter-field-keyword,
.table-panel > .compact-filter-form > .filter-field-keyword {
  flex: 1 1 auto;
  min-width: 240px;
}

.workbench-toolbar .filter-field input,
.workbench-toolbar .filter-field select,
.table-panel > .compact-filter-form .filter-field input,
.table-panel > .compact-filter-form .filter-field select,
.workbench-toolbar .more-filter-popover summary,
.table-panel > .compact-filter-form .more-filter-popover summary,
.workbench-toolbar .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button),
.table-panel > .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button) {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  border-radius: var(--toolbar-control-radius);
  font-size: 14px;
  line-height: 1;
}

.workbench-toolbar .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button),
.table-panel > .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button),
.workbench-toolbar .more-filter-popover summary,
.table-panel > .compact-filter-form .more-filter-popover summary {
  min-width: var(--toolbar-button-min-width);
  padding: 0 16px;
  white-space: nowrap;
}

.workbench-toolbar .more-filter-popover,
.table-panel > .compact-filter-form .more-filter-popover {
  align-self: center;
  flex: 0 0 auto;
}

.workbench-toolbar .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button),
.table-panel > .compact-filter-form > :is(a.primary-button, a.secondary-button, a.ghost-button, button.primary-button, button.secondary-button, button.ghost-button) {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1180px) {
  .workbench-toolbar .compact-filter-form,
  .table-panel > .compact-filter-form {
    flex-wrap: wrap;
  }

  .workbench-toolbar .compact-filter-form > .filter-field-keyword,
  .table-panel > .compact-filter-form > .filter-field-keyword {
    flex-basis: 100%;
    order: 10;
  }
}

@media (max-width: 1100px) {
  .detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Platform transfer review case file. */
.review-case-heading {
  margin-bottom: 14px;
}

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

.review-case-summary article {
  min-width: 0;
  min-height: 102px;
  padding: 14px 16px;
  border: 1px solid var(--glass-line, #dde7ef);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 253, 0.82)),
    rgba(255, 255, 255, 0.76);
  box-shadow: var(--glass-shadow-soft, 0 10px 24px rgba(27, 45, 66, 0.07));
}

.review-case-summary span,
.review-case-summary small,
.review-check-card span,
.review-check-card small,
.review-material-row span,
.review-note-box span {
  display: block;
  color: var(--muted, #667085);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.review-case-summary strong {
  display: block;
  margin: 9px 0 8px;
  overflow-wrap: anywhere;
  color: var(--heading, #172033);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.15;
}

.review-check-panel,
.review-action-panel {
  margin-bottom: 14px;
  border: 1px solid var(--glass-line, #dde7ef);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.74);
  box-shadow: var(--glass-shadow-soft, 0 10px 24px rgba(27, 45, 66, 0.07));
}

.review-check-panel .section-title-row {
  padding: 14px 16px 0;
}

.review-check-panel .section-title-row h2,
.review-action-panel h2 {
  margin: 0;
  color: var(--heading, #172033);
  font-size: 18px;
}

.review-check-panel .section-title-row p,
.review-action-panel p {
  margin: 5px 0 0;
  color: var(--muted, #667085);
  font-size: 13px;
  line-height: 1.4;
}

.review-check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.review-check-card {
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #d9e4ed;
  border-left-width: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.review-check-card strong {
  display: block;
  margin: 7px 0 6px;
  overflow-wrap: anywhere;
  color: var(--heading, #172033);
  font-size: 14px;
  line-height: 1.25;
}

.review-check-ok {
  border-left-color: #2f9e68;
  background: #f4fbf7;
}

.review-check-warn {
  border-left-color: #d68b22;
  background: #fff9ed;
}

.review-check-danger {
  border-left-color: #c23b32;
  background: #fff6f5;
}

.review-check-ok span {
  color: #23764f;
}

.review-check-warn span {
  color: #9c6414;
}

.review-check-danger span {
  color: #a33028;
}

.review-case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: 14px;
  margin-bottom: 14px;
}

.review-case-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line, #dde7ef);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.74);
  box-shadow: var(--glass-shadow-soft, 0 10px 24px rgba(27, 45, 66, 0.07));
}

.review-case-panel .panel-heading {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e5edf3);
}

.review-case-panel .panel-heading h2 {
  margin: 0;
  color: var(--heading, #172033);
  font-size: 17px;
}

.review-case-panel .detail-grid {
  padding: 16px;
  gap: 12px 16px;
}

.review-material-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.review-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.review-material-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading, #172033);
  font-size: 14px;
}

.review-note-box {
  margin: 0 16px 16px;
  padding: 12px;
  border: 1px solid #f1d69f;
  border-radius: 8px;
  background: #fffaf0;
}

.review-note-box p {
  margin: 6px 0 0;
  color: #583f16;
  font-size: 14px;
  line-height: 1.45;
}

.review-action-panel {
  padding: 16px;
}

.review-action-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.review-action-form {
  display: grid;
  gap: 10px;
  align-content: start;
}

.review-action-form label {
  display: grid;
  gap: 6px;
  color: var(--heading, #172033);
  font-size: 13px;
  font-weight: 800;
}

.review-action-form input[type="text"],
.review-action-form input:not([type]) {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--control-border, #cfd8df);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--heading, #172033);
  font-size: 14px;
}

.review-confirm-check {
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 700 !important;
}

.review-confirm-check input {
  width: 16px;
  height: 16px;
}

.review-reject-area {
  display: grid;
  gap: 12px;
}

.review-reason-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-reason-grid form {
  margin: 0;
}

.review-reason-grid .compact-button {
  min-height: 34px;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .review-check-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-case-layout,
  .review-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .review-case-summary,
  .review-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .review-case-summary,
  .review-check-grid {
    grid-template-columns: 1fr;
  }

  .review-material-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .detail-layout,
  .detail-layout.detail-layout-single,
  .detail-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

/* Merchant risk center */
.risk-dashboard-shell {
  display: grid;
  gap: 14px;
}

.risk-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
}

.risk-command-title,
.risk-score-card {
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-command-title {
  min-height: 190px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 10px;
  background:
    linear-gradient(90deg, rgba(47, 95, 135, 0.12), transparent 46%),
    var(--glass-panel);
}

.risk-command-title > span,
.risk-meta-row span {
  color: #6d7a8e;
  font-size: 13px;
  font-weight: 850;
}

.risk-command-title h1 {
  margin: 0;
  color: #101827;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 950;
}

.risk-command-title p {
  max-width: 760px;
  margin: 0;
  color: #5f6e82;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 720;
}

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

.risk-meta-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.risk-score-card {
  min-height: 190px;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.risk-score-card::before {
  content: "";
  position: absolute;
  inset: 14px 14px auto auto;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 12px solid rgba(47, 95, 135, 0.13);
  border-top-color: var(--theme-action);
  transform: rotate(32deg);
}

.risk-score-card span {
  color: #6d7a8e;
  font-size: 13px;
  font-weight: 880;
}

.risk-score-card strong {
  color: #101827;
  font-size: 58px;
  line-height: 0.96;
  font-weight: 950;
}

.risk-score-card em {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--theme-action);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.risk-score-card p {
  margin: 0;
  color: #5f6e82;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 720;
}

.risk-score-card.danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), var(--glass-red-soft));
}

.risk-score-card.warning {
  border-color: rgba(185, 130, 44, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), var(--glass-brass-soft));
}

.risk-anchor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-anchor-tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #526175;
  background: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  font-weight: 880;
}

.risk-anchor-tabs a:hover {
  color: #ffffff;
  background: var(--theme-action);
}

.risk-kpi-grid,
.risk-health-grid,
.risk-mini-grid,
.risk-segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.risk-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.risk-layout-grid-wide {
  grid-template-columns: minmax(0, 0.92fr) minmax(520px, 1.08fr);
}

.risk-overview-grid,
.risk-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.85fr);
  gap: 14px;
  align-items: start;
}

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

.risk-two-column-narrow {
  grid-template-columns: minmax(340px, 0.75fr) minmax(0, 1.25fr);
}

.risk-section-title {
  min-height: 112px;
  display: flex;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(47, 95, 135, 0.1), transparent 44%),
    var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-section-title span {
  color: var(--theme-action);
  font-size: 12px;
  font-weight: 950;
}

.risk-section-title h2 {
  margin: 4px 0;
  color: #101827;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 950;
}

.risk-section-title p {
  margin: 0;
  color: #667589;
  font-size: 13px;
  font-weight: 740;
}

.risk-map-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(280px, 1fr);
  gap: 14px;
  padding: 14px;
}

.risk-map-panel {
  min-height: 330px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(47, 95, 135, 0.06) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, rgba(47, 95, 135, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    rgba(255, 255, 255, 0.54);
}

.risk-road {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: rgba(49, 64, 84, 0.14);
  transform-origin: left center;
}

.risk-road.road-1 {
  width: 84%;
  left: 8%;
  top: 40%;
  transform: rotate(-12deg);
}

.risk-road.road-2 {
  width: 76%;
  left: 15%;
  top: 66%;
  transform: rotate(18deg);
}

.risk-road.road-3 {
  width: 74%;
  left: 15%;
  top: 24%;
  transform: rotate(7deg);
}

.risk-hotspot-dot {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.72);
  background: rgba(180, 35, 24, 0.18);
  box-shadow: 0 0 0 9px rgba(180, 35, 24, 0.07);
  font-size: 12px;
  font-weight: 950;
}

.risk-hotspot-dot.pos-1 {
  width: 82px;
  height: 82px;
  left: 57%;
  top: 28%;
}

.risk-hotspot-dot.pos-2 {
  width: 64px;
  height: 64px;
  left: 22%;
  top: 55%;
  color: var(--glass-brass-dark);
  border-color: var(--glass-brass);
  background: rgba(198, 146, 61, 0.2);
  box-shadow: 0 0 0 9px rgba(198, 146, 61, 0.08);
}

.risk-hotspot-dot.pos-3 {
  width: 54px;
  height: 54px;
  left: 38%;
  top: 18%;
  color: #665a8f;
  border-color: rgba(102, 90, 143, 0.78);
  background: rgba(102, 90, 143, 0.18);
  box-shadow: 0 0 0 9px rgba(102, 90, 143, 0.08);
}

.risk-map-note {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 7px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: #526175;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 850;
}

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

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

.risk-rank-item strong {
  display: block;
  color: #172033;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.risk-rank-item span {
  display: block;
  margin-top: 3px;
  color: #667589;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 740;
}

.risk-rank-item em {
  color: #172033;
  text-align: right;
  font-size: 22px;
  line-height: 1;
  font-style: normal;
  font-weight: 950;
}

.risk-action-list,
.risk-hotspot-list,
.risk-pressure-list,
.risk-timeline {
  padding: 14px 16px 16px;
  display: grid;
  gap: 10px;
}

.risk-action-item,
.risk-hotspot-row {
  min-width: 0;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.risk-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-left: 4px solid var(--theme-action);
}

.risk-action-item.danger {
  border-left-color: #b42318;
}

.risk-action-item.warning {
  border-left-color: var(--glass-brass);
}

.risk-action-item.subtle {
  border-left-color: #087443;
}

.risk-action-item strong,
.risk-hotspot-row strong {
  display: block;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.risk-action-item p,
.risk-hotspot-row span {
  margin: 4px 0 0;
  color: #667589;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 720;
}

.risk-action-item > span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #526175;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.risk-pressure-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  color: #526175;
  font-size: 13px;
  font-weight: 850;
}

.risk-pressure-row > div,
.risk-rank-bar {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 95, 135, 0.1);
}

.risk-pressure-row i,
.risk-rank-bar i {
  display: block;
  width: min(var(--w), 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--theme-action);
}

.risk-pressure-row.danger i {
  background: #b42318;
}

.risk-pressure-row.warning i {
  background: var(--glass-brass);
}

.risk-pressure-row.violet i {
  background: #665a8f;
}

.risk-pressure-row strong {
  color: #172033;
  text-align: right;
  font-size: 15px;
  font-weight: 950;
}

.risk-hotspot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
}

.risk-hotspot-row em {
  color: #172033;
  text-align: right;
  font-size: 24px;
  line-height: 1;
  font-style: normal;
  font-weight: 950;
}

.risk-rank-bar {
  margin-top: 10px;
  height: 8px;
}

.risk-heatmap-wrap {
  padding: 16px;
  overflow-x: auto;
}

.risk-heatmap {
  min-width: 620px;
  display: grid;
  grid-template-columns: 48px repeat(8, minmax(54px, 1fr));
  gap: 7px;
  align-items: center;
}

.risk-heatmap span {
  color: #6d7a8e;
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.risk-heatmap i {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: color-mix(in srgb, #b42318 var(--level), #eef4f8);
}

.risk-timeline-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-line);
}

.risk-timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.risk-timeline-item time {
  color: var(--theme-action);
  font-size: 12px;
  font-weight: 950;
}

.risk-timeline-item strong {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.risk-timeline-item p {
  margin: 4px 0 0;
  color: #667589;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 720;
}

.risk-segment-grid {
  margin: 0;
}

.risk-segment-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 16px 16px;
}

.risk-segment-card {
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-left: 4px solid var(--theme-action);
  border-radius: 14px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-segment-card.danger {
  border-left-color: #b42318;
}

.risk-segment-card.warning {
  border-left-color: var(--glass-brass);
}

.risk-segment-card.subtle {
  border-left-color: #087443;
}

.risk-segment-card strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.risk-segment-card p {
  margin: 0;
  color: #667589;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 720;
}

.risk-segment-card span {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #526175;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 950;
}

.risk-detail-panel .compact-filter-form {
  padding: 14px 16px;
}

.risk-detail-panel .active-filter-tags {
  padding: 0 16px 12px;
}

.risk-empty-state {
  padding: 18px;
  border: 1px dashed var(--glass-line-strong);
  border-radius: 12px;
  color: #6d7a8e;
  background: rgba(255, 255, 255, 0.46);
  font-size: 13px;
  font-weight: 760;
}

@media (max-width: 1180px) {
  .risk-command-hero,
  .risk-layout-grid,
  .risk-layout-grid-wide,
  .risk-overview-grid,
  .risk-two-column,
  .risk-two-column-narrow,
  .risk-map-workbench {
    grid-template-columns: 1fr;
  }

  .risk-kpi-grid,
  .risk-health-grid,
  .risk-mini-grid,
  .risk-segment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .risk-command-title,
  .risk-score-card {
    min-height: 0;
    padding: 18px;
  }

  .risk-command-title h1 {
    font-size: 28px;
  }

  .risk-kpi-grid,
  .risk-health-grid,
  .risk-mini-grid,
  .risk-segment-grid,
  .risk-segment-grid-compact {
    grid-template-columns: 1fr;
  }

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

/* Power BI-style merchant risk dashboard, embedded in the SaaS shell. */
.risk-bi-page {
  --risk-blue: #315f8f;
  --risk-blue-dark: #244b73;
  --risk-amber: #a76618;
  --risk-red: #b4232a;
  --risk-green: #087443;
  --risk-violet: #665a8f;
  --risk-muted: #697386;
  display: grid;
  gap: 14px;
}

.risk-bi-topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.risk-bi-title p {
  margin: 0 0 5px;
  color: var(--risk-muted);
  font-size: 13px;
  font-weight: 850;
}

.risk-bi-title h1 {
  margin: 0;
  color: #101827;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 950;
}

.risk-bi-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-bi-select,
.risk-bi-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(137, 155, 178, 0.34);
  border-radius: 10px;
  color: #172033;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 760;
}

.risk-bi-button.primary {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(180deg, var(--risk-blue), var(--risk-blue-dark));
  box-shadow: 0 12px 22px rgba(49, 95, 143, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.risk-bi-grid {
  display: grid;
  gap: 14px;
}

.risk-bi-kpi-grid {
  grid-template-columns: 1.35fr minmax(320px, 1.85fr) repeat(2, minmax(140px, 1fr));
}

.risk-bi-panel,
.risk-bi-metric {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-bi-metric {
  min-height: 126px;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

.risk-bi-unprocessed {
  position: relative;
  grid-template-columns: minmax(128px, 0.9fr) minmax(180px, 1fr);
  column-gap: 16px;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(180, 35, 42, 0.09), transparent 44%),
    var(--glass-panel);
}

.risk-bi-unprocessed::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: var(--risk-red);
}

.risk-bi-unprocessed > .trend {
  grid-column: 1 / -1;
}

.risk-bi-debt-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.risk-bi-debt-strip > span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.risk-bi-debt-strip b {
  color: #101827;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
  order: 2;
}

.risk-bi-debt-strip small {
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 820;
  order: 1;
  white-space: nowrap;
}

.risk-bi-metric span,
.risk-bi-metric small,
.risk-bi-panel-head p {
  color: var(--risk-muted);
  font-size: 13px;
  font-weight: 780;
}

.risk-bi-metric strong {
  color: #101827;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.risk-bi-metric .trend {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.risk-bi-metric .trend.up {
  color: var(--risk-red);
  background: rgba(180, 35, 42, 0.08);
}

.risk-bi-metric .trend.down {
  color: var(--risk-green);
  background: rgba(8, 116, 67, 0.09);
}

.risk-bi-score {
  position: relative;
  min-height: 126px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-left: 4px solid var(--risk-amber);
  background:
    linear-gradient(90deg, rgba(167, 102, 24, 0.08), transparent 34%),
    var(--glass-panel);
}

.risk-bi-score::before {
  content: "风险雷达";
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: rgba(49, 95, 143, 0.42);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.risk-bi-score-ring {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--risk-red) 0deg 256deg, #dce6ee 256deg 360deg);
}

.risk-bi-score-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
}

.risk-bi-score-ring strong {
  position: relative;
  z-index: 1;
  color: #101827;
  font-size: 31px;
  line-height: 1;
  font-weight: 950;
}

.risk-bi-score-meta h2 {
  margin: 0 0 6px;
  color: #101827;
  font-size: 16px;
  line-height: 1.28;
  font-weight: 950;
}

.risk-bi-score-meta p {
  margin: 0 0 8px;
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 740;
}

.risk-bi-panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.12));
}

.risk-bi-panel-head h2 {
  margin: 0;
  color: #101827;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 950;
}

.risk-bi-panel-head p {
  margin: 3px 0 0;
  font-size: 12px;
}

.risk-bi-tabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.risk-bi-tabs span,
.risk-bi-tabs a {
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.risk-bi-tabs span.active,
.risk-bi-tabs a.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--risk-blue), var(--risk-blue-dark));
}

.risk-bi-workbench {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: stretch;
}

.risk-bi-workbench > .risk-bi-panel {
  height: 100%;
}

.risk-bi-month-section {
  grid-template-columns: 1fr;
}

.risk-bi-month-section .risk-bi-panel-head {
  align-items: flex-start;
  gap: 16px;
}

.risk-bi-month-summary {
  flex: 1 1 560px;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr));
  gap: 8px;
}

.month-summary-pill {
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(137, 155, 178, 0.28);
  border-left: 3px solid rgba(49, 95, 143, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.month-summary-pill small,
.month-summary-pill em {
  color: var(--risk-muted);
  font-size: 10px;
  line-height: 1.15;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.month-summary-pill strong {
  color: #101827;
  font-size: 19px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.month-summary-pill.current {
  border-left-color: var(--risk-blue);
  background: rgba(49, 95, 143, 0.08);
}

.month-summary-pill.good {
  border-left-color: var(--risk-green);
  background: rgba(8, 116, 67, 0.08);
}

.month-summary-pill.good strong {
  color: var(--risk-green);
}

.month-summary-pill.bad {
  border-left-color: var(--risk-red);
  background: rgba(180, 35, 42, 0.08);
}

.month-summary-pill.bad strong {
  color: var(--risk-red);
}

.month-summary-pill.flat {
  border-left-color: #8fa2b6;
}

.month-summary-pill.peak {
  border-left-color: var(--risk-amber);
  background: rgba(167, 102, 24, 0.08);
}

.risk-bi-month-chart {
  min-height: 232px;
  padding: 14px 22px 20px;
  overflow-x: auto;
}

.risk-bi-month-range {
  min-width: 720px;
  margin: 0 14px 8px;
  color: var(--risk-amber);
  text-align: right;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.risk-bi-month-plot,
.risk-bi-month-axis {
  min-width: 720px;
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  column-gap: 14px;
}

.risk-bi-month-plot {
  height: 186px;
  align-items: end;
  padding: 0 14px;
  border-bottom: 2px solid rgba(225, 232, 241, 0.96);
  background:
    linear-gradient(rgba(210, 219, 231, 0.9), rgba(210, 219, 231, 0.9)) 0 0 / 100% 2px no-repeat,
    linear-gradient(rgba(231, 237, 244, 0.95), rgba(231, 237, 244, 0.95)) 0 50% / 100% 2px no-repeat,
    linear-gradient(rgba(244, 247, 251, 0.98), rgba(244, 247, 251, 0.98)) 0 100% / 100% 2px no-repeat;
}

.risk-bi-month-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.risk-bi-month-col .month-bar {
  width: min(66px, 100%);
  height: calc(100% - 31px);
  display: flex;
  align-items: flex-end;
}

.risk-bi-month-col .month-count {
  min-width: 28px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid rgba(137, 155, 178, 0.28);
  border-radius: 999px;
  color: #1d2b3d;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 12px rgba(36, 75, 115, 0.08);
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
}

.risk-bi-month-col .month-count.zero {
  color: #9aa7b6;
  background: rgba(247, 250, 252, 0.78);
  box-shadow: none;
}

.risk-bi-month-col .month-bar b {
  width: 100%;
  height: var(--h);
  min-height: 5px;
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(180deg, #78a4d0 0%, #2c628f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 9px 16px rgba(44, 98, 143, 0.14);
}

.risk-bi-month-col.danger .month-bar b {
  background: linear-gradient(180deg, #7fa9d2 0%, #275d88 100%);
}

.risk-bi-month-col.current .month-count {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--risk-blue), var(--risk-blue-dark));
}

.risk-bi-month-col.peak:not(.current) .month-count {
  color: var(--risk-amber);
  border-color: rgba(167, 102, 24, 0.26);
  background: rgba(255, 248, 235, 0.9);
}

.risk-bi-month-axis {
  margin-top: 10px;
  padding: 0 14px;
}

.risk-bi-month-axis span {
  color: #697386;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.risk-bi-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.78fr);
  gap: 14px;
  padding: 14px;
}

.risk-bi-map {
  min-height: 326px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(49, 95, 143, 0.06) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(49, 95, 143, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    rgba(255, 255, 255, 0.54);
}

.risk-bi-map .road {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: rgba(49, 64, 84, 0.16);
  transform-origin: left center;
}

.risk-bi-map .r1 {
  width: 86%;
  left: 7%;
  top: 42%;
  transform: rotate(-12deg);
}

.risk-bi-map .r2 {
  width: 70%;
  left: 18%;
  top: 67%;
  transform: rotate(18deg);
}

.risk-bi-map .r3 {
  width: 74%;
  left: 15%;
  top: 24%;
  transform: rotate(8deg);
}

.risk-bi-map .hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--risk-red);
  border: 1px solid rgba(180, 35, 42, 0.72);
  background: rgba(180, 35, 42, 0.18);
  box-shadow: 0 0 0 9px rgba(180, 35, 42, 0.07);
  font-size: 12px;
  font-weight: 950;
}

.risk-bi-map .h1 {
  width: 82px;
  height: 82px;
  left: 57%;
  top: 28%;
}

.risk-bi-map .h2 {
  width: 64px;
  height: 64px;
  left: 22%;
  top: 55%;
  color: var(--risk-amber);
  border-color: var(--risk-amber);
  background: rgba(167, 102, 24, 0.18);
  box-shadow: 0 0 0 9px rgba(167, 102, 24, 0.08);
}

.risk-bi-map .h3 {
  width: 54px;
  height: 54px;
  left: 38%;
  top: 18%;
  color: var(--risk-violet);
  border-color: var(--risk-violet);
  background: rgba(102, 90, 143, 0.18);
  box-shadow: 0 0 0 9px rgba(102, 90, 143, 0.08);
}

.risk-bi-map .map-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 7px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: #526175;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 850;
}

.risk-bi-rank-list {
  display: grid;
  gap: 12px;
  align-content: center;
}

.risk-bi-rank-list .rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
}

.risk-bi-rank-list strong {
  display: block;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.risk-bi-rank-list span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--risk-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 740;
}

.risk-bi-rank-list .bar,
.risk-bi-stack-bars .stack-track {
  height: 9px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(49, 95, 143, 0.1);
}

.risk-bi-rank-list .bar i,
.risk-bi-stack-bars .stack-track i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--color);
}

.risk-bi-rank-list .rank-value {
  color: #172033;
  text-align: right;
  font-size: 22px;
  font-weight: 950;
}

.risk-bi-insights {
  padding: 14px 16px 16px;
  display: grid;
  gap: 10px;
}

.risk-bi-insights .insight {
  border: 1px solid var(--glass-line);
  border-left: 4px solid var(--risk-blue);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.risk-bi-insights .insight.danger {
  border-left-color: var(--risk-red);
}

.risk-bi-insights .insight.warning {
  border-left-color: var(--risk-amber);
}

.risk-bi-insights .insight.subtle {
  border-left-color: var(--risk-green);
}

.risk-bi-insights strong {
  display: block;
  margin-bottom: 4px;
  color: #172033;
  font-size: 13px;
  font-weight: 950;
}

.risk-bi-insights p {
  margin: 0;
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 740;
}

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

.risk-bi-heatmap-wrap {
  padding: 14px 16px 16px;
  overflow-x: auto;
}

.risk-bi-heatmap {
  min-width: 620px;
  display: grid;
  grid-template-columns: 56px repeat(8, 1fr);
  gap: 6px;
  align-items: center;
}

.risk-bi-heatmap span {
  color: var(--risk-muted);
  text-align: center;
  font-size: 11px;
  font-weight: 850;
}

.risk-bi-heatmap i {
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: color-mix(in srgb, var(--risk-red) var(--level), #eef4f8);
}

.risk-behavior-analysis {
  padding: 16px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.behavior-ring {
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(216, 225, 234, 0.86), 0 18px 34px rgba(35, 48, 64, 0.08);
}

.behavior-ring > div {
  width: 86px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(216, 225, 234, 0.9);
}

.behavior-ring strong {
  color: #101827;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.behavior-ring span {
  margin-top: 4px;
  color: var(--risk-muted);
  font-size: 11px;
  font-weight: 850;
}

.behavior-list {
  display: grid;
  gap: 10px;
}

.behavior-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.behavior-row > i {
  width: 10px;
  height: 34px;
  border-radius: 999px;
  background: var(--behavior-color);
}

.behavior-row strong {
  display: block;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.behavior-row span {
  display: block;
  margin-top: 2px;
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 780;
}

.behavior-track {
  grid-column: 2;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(231, 238, 244, 0.86);
}

.behavior-track b {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--behavior-color);
}

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

.risk-bi-table th,
.risk-bi-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--glass-line);
  text-align: left;
  vertical-align: middle;
  color: #172033;
  background: rgba(255, 255, 255, 0.46);
  font-size: 13px;
}

.risk-bi-table th {
  color: var(--risk-muted);
  background: rgba(237, 243, 248, 0.86);
  font-size: 12px;
  font-weight: 950;
}

.risk-bi-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.risk-bi-chip.red {
  color: var(--risk-red);
  background: rgba(180, 35, 42, 0.08);
}

.risk-bi-chip.amber {
  color: var(--risk-amber);
  background: rgba(167, 102, 24, 0.1);
}

.risk-bi-chip.green {
  color: var(--risk-green);
  background: rgba(8, 116, 67, 0.09);
}

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

.risk-bi-panel.recommendation {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border-left: 4px solid var(--risk-blue);
}

.risk-bi-panel.recommendation.danger {
  border-left-color: var(--risk-red);
}

.risk-bi-panel.recommendation.warning {
  border-left-color: var(--risk-amber);
}

.risk-bi-panel.recommendation.subtle {
  border-left-color: var(--risk-green);
}

.risk-bi-panel.recommendation h3 {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 950;
}

.risk-bi-panel.recommendation p {
  margin: 0;
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 740;
}

.risk-bi-panel .mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.risk-bi-panel .mini-metrics span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #526175;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 850;
}

.risk-bi-divider {
  min-height: 112px;
  display: flex;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(49, 95, 143, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.54);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(16px);
}

.risk-bi-divider span {
  color: var(--risk-blue);
  font-size: 12px;
  font-weight: 950;
}

.risk-bi-divider h2 {
  margin: 4px 0;
  color: #101827;
  font-size: 24px;
  font-weight: 950;
}

.risk-bi-divider p {
  margin: 0;
  color: var(--risk-muted);
  font-size: 13px;
  font-weight: 740;
}

.risk-bi-mini-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.risk-bi-panel.mini-card {
  min-height: 108px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.risk-bi-panel.mini-card span {
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 880;
}

.risk-bi-panel.mini-card strong {
  color: #101827;
  font-size: 22px;
  font-weight: 950;
}

.risk-bi-panel.mini-card small {
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.45;
}

.risk-bi-two-one-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

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

.risk-bi-timeline {
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}

.risk-bi-timeline .timeline-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-line);
}

.risk-bi-timeline .timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.risk-bi-timeline time {
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 950;
}

.risk-bi-timeline strong {
  display: block;
  margin-bottom: 4px;
  color: #172033;
  font-size: 13px;
  font-weight: 950;
}

.risk-bi-timeline p {
  margin: 0;
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 740;
}

.risk-bi-matrix {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.risk-bi-matrix .matrix-box {
  min-height: 122px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--glass-line);
  border-left: 4px solid var(--risk-blue);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.risk-bi-matrix .matrix-box.danger {
  border-left-color: var(--risk-red);
}

.risk-bi-matrix .matrix-box.warning {
  border-left-color: var(--risk-amber);
}

.risk-bi-matrix .matrix-box.subtle {
  border-left-color: var(--risk-green);
}

.risk-bi-matrix strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.risk-bi-matrix p {
  margin: 0;
  color: var(--risk-muted);
  font-size: 12px;
  line-height: 1.45;
}

.risk-bi-customer-list {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.risk-ranking-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.risk-ranking-pagination {
  min-height: 54px;
  padding: 10px 14px;
  border-top: 1px solid var(--glass-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 760;
}

.risk-ranking-pagination > div {
  display: flex;
  gap: 8px;
}

.risk-ranking-pagination a,
.risk-ranking-pagination .disabled {
  width: 64px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  color: var(--risk-blue-dark);
  background: rgba(255, 255, 255, 0.56);
  text-decoration: none;
}

.risk-ranking-pagination a:hover {
  border-color: rgba(49, 95, 143, 0.42);
  background: rgba(49, 95, 143, 0.08);
}

.risk-ranking-pagination .disabled {
  color: var(--risk-muted);
  opacity: 0.5;
}

.risk-bi-customer-row {
  --rank-accent: var(--risk-blue);
  --rank-soft: rgba(49, 95, 143, 0.08);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--glass-line);
  border-left: 4px solid var(--rank-accent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.risk-bi-customer-list .risk-bi-customer-row:nth-child(even) {
  --rank-accent: var(--risk-amber);
  --rank-soft: rgba(167, 102, 24, 0.08);
}

.risk-bi-customer-list .risk-bi-customer-row:nth-child(3n) {
  --rank-accent: var(--risk-violet);
  --rank-soft: rgba(102, 90, 143, 0.08);
}

.risk-bi-customer-row.danger {
  border-left-color: var(--risk-red);
}

.risk-bi-customer-row.warning {
  border-left-color: var(--risk-amber);
}

.risk-bi-customer-row.subtle {
  border-left-color: var(--risk-green);
}

.risk-bi-customer-row .customer-rank {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #172033;
  background: var(--rank-soft);
  font-weight: 950;
}

.risk-bi-customer-row .customer-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.risk-bi-customer-row strong {
  color: #172033;
  font-size: 14px;
  font-weight: 950;
}

.risk-bi-customer-row span {
  color: var(--risk-muted);
  font-size: 12px;
  font-weight: 760;
}

.risk-bi-customer-row > .risk-bi-chip {
  justify-self: end;
  white-space: nowrap;
}

.customer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-metrics span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--rank-soft);
}

.customer-metrics b {
  color: #172033;
  font-weight: 950;
}

.risk-bi-stack-bars {
  padding: 18px 22px;
  display: grid;
  gap: 12px;
}

.risk-bi-stack-bars .stack-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
  color: #526175;
  font-size: 13px;
  font-weight: 850;
}

.risk-bi-stack-bars .stack-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-bi-stack-bars .stack-row span {
  color: #172033;
  text-align: right;
  font-weight: 950;
}

.risk-bi-detail-panel .compact-filter-form {
  padding: 14px 16px;
}

.risk-bi-detail-panel .active-filter-tags {
  padding: 0 16px 12px;
}

.risk-bi-empty {
  padding: 14px;
  color: var(--risk-muted);
  font-size: 13px;
  font-weight: 760;
}

@media (max-width: 1320px) {
  .risk-bi-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .risk-bi-score {
    grid-column: span 2;
  }

  .risk-bi-unprocessed {
    grid-column: span 2;
  }
}

@media (max-width: 1180px) {
  .risk-bi-workbench,
  .risk-bi-chart-grid,
  .risk-bi-section-grid,
  .risk-bi-recommendation-grid,
  .risk-bi-two-one-grid,
  .risk-bi-mini-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .risk-bi-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .risk-bi-kpi-grid {
    grid-template-columns: 1fr;
  }

  .risk-bi-score {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .risk-bi-unprocessed {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .risk-bi-debt-strip {
    grid-template-columns: 1fr;
  }

  .risk-bi-month-section .risk-bi-panel-head {
    flex-direction: column;
  }

  .risk-bi-month-summary {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .risk-bi-matrix {
    grid-template-columns: 1fr;
  }

  .risk-bi-customer-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .risk-bi-customer-row > .risk-bi-chip {
    grid-column: 2;
    justify-self: start;
  }

  .risk-ranking-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .risk-behavior-analysis {
    grid-template-columns: 1fr;
  }

  .behavior-ring {
    justify-self: center;
  }
}

.site-ops-hero {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.site-ops-health-card {
  position: relative;
  min-height: 232px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  overflow: hidden;
  padding: 26px 28px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.site-ops-health-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.site-ops-health-card.warning::before {
  background: linear-gradient(180deg, var(--warning), var(--accent));
}

.site-ops-health-card.danger::before {
  background: linear-gradient(180deg, var(--danger), var(--warning));
}

.site-ops-gauge {
  width: 124px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 48%, transparent 49%),
    conic-gradient(var(--brand) 0 var(--score), #dfe7ef var(--score) 100%);
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05);
}

.site-ops-health-card.warning .site-ops-gauge {
  background:
    radial-gradient(circle at center, var(--surface) 0 48%, transparent 49%),
    conic-gradient(var(--warning) 0 var(--score), #ead8bd var(--score) 100%);
}

.site-ops-health-card.danger .site-ops-gauge {
  background:
    radial-gradient(circle at center, var(--surface) 0 48%, transparent 49%),
    conic-gradient(var(--danger) 0 var(--score), #f1d4d7 var(--score) 100%);
}

.site-ops-gauge strong {
  color: var(--heading);
  font-size: 40px;
  line-height: 1;
  font-weight: 950;
}

.site-ops-health-card h2 {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 950;
}

.site-ops-health-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 680;
}

.site-ops-flow-panel {
  overflow: hidden;
}

.site-ops-bars {
  min-height: 148px;
  display: grid;
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  align-items: end;
  gap: 8px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, transparent 32%, rgba(217, 225, 234, 0.55) 33%, transparent 34%),
    linear-gradient(180deg, transparent 66%, rgba(217, 225, 234, 0.55) 67%, transparent 68%);
}

.site-ops-bars span {
  min-width: 0;
  height: 104px;
  display: grid;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 7px;
}

.site-ops-bars i {
  display: block;
  height: var(--h);
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #6f98c3, var(--brand));
}

.site-ops-bars em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.site-ops-flow-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.site-ops-flow-summary div {
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
}

.site-ops-flow-summary div:last-child {
  border-right: 0;
}

.site-ops-flow-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-ops-flow-summary strong {
  color: var(--heading);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.site-ops-metrics {
  margin-bottom: 18px;
}

.site-ops-main-grid {
  grid-template-columns: minmax(420px, 1.45fr) minmax(340px, 1fr);
  margin-bottom: 18px;
}

.site-ops-table code {
  color: var(--brand-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.site-ops-issue-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.site-ops-issue {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
}

.site-ops-issue.warning {
  border-left-color: var(--warning);
}

.site-ops-issue.danger {
  border-left-color: var(--danger);
}

.site-ops-issue strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 920;
}

.site-ops-issue p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.site-ops-empty {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.site-ops-heatmap {
  padding: 18px 20px 22px;
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(28px, 1fr));
  gap: 8px;
  align-items: center;
}

.site-ops-heatmap span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.site-ops-heatmap i {
  display: block;
  height: 28px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand) var(--level), #eef3f8);
}

.site-ops-source-list {
  display: grid;
  gap: 13px;
  padding: 20px 22px 24px;
}

.site-ops-source-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.site-ops-source-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.site-ops-source-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.site-ops-source-row i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6f98c3);
}

.site-ops-source-row strong {
  color: var(--heading);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.site-ops-footnote {
  margin: 0;
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .site-ops-hero,
  .site-ops-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-ops-health-card {
    grid-template-columns: 1fr;
  }

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

  .site-ops-flow-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .site-ops-flow-summary div:last-child {
    border-bottom: 0;
  }

  .site-ops-issue {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body.app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  body.app-shell .sidebar {
    position: sticky;
    top: 14px;
    width: auto;
    height: calc(100vh - 28px);
    min-height: 0;
    overflow-y: auto;
  }

  body.app-shell .nav {
    grid-template-columns: 1fr;
  }

  body.app-shell .nav-item {
    justify-content: space-between;
    text-align: left;
  }

  body.app-shell .topbar {
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    gap: 18px;
  }

  body.app-shell .topbar-center {
    justify-self: center;
  }

  body.app-shell .topbar-actions {
    justify-self: end;
  }
}

/* Shared list filters stay unframed; controls provide the visual boundary. */
.workbench-toolbar {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.finance-filter-panel,
.sms-filter-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.finance-filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.finance-filter-form .filter-field-keyword {
  flex: 1 1 auto;
  min-width: 260px;
}

.finance-filter-form > :is(.primary-button, .secondary-button),
.finance-filter-form .more-filter-popover summary,
.sms-filter-form > :is(.primary-button, .secondary-button) {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--toolbar-control-radius);
  padding: 0 16px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.billing-filter-popover {
  flex: 0 0 auto;
}

.billing-more-filter-panel {
  width: min(580px, calc(100vw - 300px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-status-filter-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.billing-status-filter-field legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-status-options label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-subtle);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.finance-filter-form .billing-status-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--theme-action);
  box-shadow: none;
}

.sms-filter-form .filter-field {
  min-width: 0;
  gap: 0;
}

.sms-filter-form .filter-field-keyword {
  min-width: 250px;
}

.sms-filter-form .filter-field input,
.sms-filter-form .filter-field select {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  border-radius: var(--toolbar-control-radius);
  font-size: 14px;
}

.todo-manual-sync-panel {
  margin-top: 10px;
  padding-top: 10px;
}

.todo-manual-sync-panel .todo-manual-grid {
  padding: 0;
}

.todo-manual-sync-panel .manual-sync-form {
  grid-template-columns: minmax(360px, 1fr) 180px 128px;
  align-items: center;
}

.manual-sync-task-field {
  min-width: 0;
  gap: 0;
}

.manual-sync-unit-trigger,
.manual-sync-task-select,
.manual-sync-submit {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  border-radius: var(--toolbar-control-radius);
  font-size: 14px;
}

.manual-sync-task-select {
  padding: 0 12px;
  color: var(--heading);
  background: var(--glass-field);
  font-weight: 800;
}

.contract-bill-table .list-row-actions {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1180px) {
  .finance-filter-form,
  .sms-filter-form {
    flex-wrap: wrap;
  }

  .finance-filter-form .filter-field-keyword,
  .sms-filter-form .filter-field-keyword {
    flex-basis: 100%;
  }
}

@media (min-width: 1101px) {
  .todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
    grid-template-columns: 128px minmax(260px, 1fr) 112px 88px 88px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
    grid-template-columns: 128px minmax(240px, 1fr) 112px 88px 88px;
  }
}

@media (max-width: 760px) {
  .todo-filter-panel .compact-filter-form[data-has-manual-sync-trigger] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .todo-filter-panel .compact-filter-form .filter-field-keyword {
    grid-column: 1 / -1;
  }
}
/* 平台车辆计费工作台 */
.billing-page { display: grid; gap: 16px; }
.danger-button { border-color: #e4aaa6; color: #aa3028; background: #fff5f4; }

/* Platform billing dashboard: mirrors the approved billing-ledger preview. */
.platform-billing-dashboard {
  --billing-ink: #16283b;
  --billing-muted: #6d7f91;
  --billing-line: #dbe5ee;
  --billing-brand: #285f88;
  --billing-brand-deep: #1e4c70;
  --billing-brand-soft: #e8f1f7;
  --billing-green: #2f8069;
  --billing-green-soft: #eaf6f1;
  --billing-amber: #b8751f;
  --billing-amber-soft: #fff4df;
  --billing-red: #b84f45;
  --billing-red-soft: #fff0ed;
  display: grid;
  gap: 18px;
  padding: 4px 0 24px;
  color: var(--billing-ink);
}

.billing-dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px;
}

.billing-eyebrow {
  margin: 0 0 7px;
  color: var(--billing-brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}

.billing-dashboard-heading h1 {
  margin: 0;
  color: var(--billing-ink);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.035em;
}

.billing-dashboard-heading > div:first-child > p:last-child {
  margin: 7px 0 0;
  color: var(--billing-muted);
  font-size: 13px;
  font-weight: 650;
}

.billing-dashboard-navigation,
.billing-period-switch,
.billing-view-switch {
  display: flex;
  align-items: center;
}

.billing-dashboard-navigation { gap: 12px; }

.billing-view-switch {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--billing-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}

.billing-view-switch a {
  min-width: 54px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--billing-muted);
  font-size: 12px;
  font-weight: 850;
}

.billing-view-switch a.active {
  color: #fff;
  background: var(--billing-brand);
  box-shadow: 0 7px 16px rgba(40, 95, 136, .18);
}

.billing-period-switch { gap: 8px; }

.billing-period-switch a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--billing-line);
  border-radius: 9px;
  color: var(--billing-muted);
  background: rgba(255, 255, 255, .82);
  font-size: 17px;
  font-weight: 700;
}

.billing-period-switch strong {
  min-width: 112px;
  color: var(--billing-ink);
  font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  text-align: center;
}

.billing-ledger {
  overflow: hidden;
  border: 1px solid var(--billing-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(31, 62, 90, .08);
}

.billing-ledger-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
}

.billing-ledger-head h2 {
  margin: 0;
  color: var(--billing-ink);
  font-size: 15px;
  font-weight: 900;
}

.billing-ledger-head p {
  margin: 0;
  color: var(--billing-muted);
  font-size: 11px;
  font-weight: 650;
}

.billing-rail-wrap {
  padding: 18px 28px 24px;
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
}

.billing-rail {
  position: relative;
  height: 72px;
  margin: 0 12px;
}

.billing-rail-line {
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6ee;
}

.billing-rail-line::before {
  content: "";
  display: block;
  width: var(--billing-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--billing-brand);
}

.billing-tick {
  position: absolute;
  top: 19px;
  z-index: 2;
  transform: translateX(-50%);
  text-align: center;
}

.billing-tick.start { left: 0; transform: none; text-align: left; }
.billing-tick.end { left: 100%; transform: translateX(-100%); text-align: right; }

.billing-tick i {
  width: 12px;
  height: 12px;
  display: block;
  margin: 7px auto 8px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--billing-brand);
  box-shadow: 0 0 0 2px var(--billing-brand);
}

.billing-tick.start i { margin-left: 0; }
.billing-tick.end i { margin-right: 0; background: #fff; box-shadow: 0 0 0 2px #9eb0bf; }
.billing-tick.stopping i { background: var(--billing-amber); box-shadow: 0 0 0 2px var(--billing-amber); }
.billing-tick.current i { background: #fff; box-shadow: 0 0 0 2px var(--billing-brand); }

.billing-tick b,
.billing-tick span { display: block; white-space: nowrap; }
.billing-tick b { color: var(--billing-ink); font-size: 10px; font-weight: 850; }
.billing-tick span { margin-top: 2px; color: var(--billing-muted); font-size: 9px; }

.billing-rail-tag {
  position: absolute;
  top: -7px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.billing-rail-tag.added { color: var(--billing-green); background: var(--billing-green-soft); }
.billing-rail-tag.stopping { color: var(--billing-amber); background: var(--billing-amber-soft); }

.billing-ledger-totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--billing-line);
}

.billing-ledger-totals > div {
  min-height: 86px;
  padding: 14px 18px;
  border-right: 1px solid var(--billing-line);
}

.billing-ledger-totals > div:last-child { border-right: 0; }
.billing-ledger-totals span,
.billing-ledger-totals strong,
.billing-ledger-totals small { display: block; }
.billing-ledger-totals span { color: var(--billing-muted); font-size: 10px; font-weight: 750; }
.billing-ledger-totals strong { margin-top: 5px; color: var(--billing-ink); font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace; font-size: 20px; line-height: 1; }
.billing-ledger-totals small { margin-top: 6px; color: var(--billing-muted); font-size: 9px; }
.billing-ledger-totals .billing-ledger-money { background: var(--billing-brand-soft); }

.billing-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 132px 132px auto auto;
  gap: 9px;
  align-items: center;
}

.billing-dashboard-toolbar input,
.billing-dashboard-toolbar select,
.billing-dashboard-toolbar button,
.billing-dashboard-toolbar > a {
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid var(--billing-line);
  border-radius: 10px;
  color: var(--billing-ink);
  background: rgba(255, 255, 255, .88);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.billing-dashboard-toolbar input { width: 100%; padding: 0 13px; }
.billing-dashboard-toolbar select { padding: 0 11px; }
.billing-dashboard-toolbar button,
.billing-dashboard-toolbar > a { display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; cursor: pointer; }
.billing-dashboard-toolbar button { color: #fff; border-color: var(--billing-brand); background: var(--billing-brand); font-weight: 850; }
.billing-dashboard-toolbar > a { color: var(--billing-muted); }
.billing-dashboard-toolbar :is(input, select, button, a):focus-visible { outline: 3px solid rgba(40, 95, 136, .18); outline-offset: 2px; }

.billing-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.billing-merchant-panel,
.billing-selected-panel {
  overflow: hidden;
  border: 1px solid var(--billing-line);
  border-radius: 15px;
  background: #fff;
}

.billing-merchant-panel table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.billing-merchant-panel th { padding: 11px 13px; color: #617487; background: #edf4f9; font-size: 10px; font-weight: 900; text-align: left; }
.billing-merchant-panel th:nth-child(1) { width: 27%; }
.billing-merchant-panel th:nth-child(2) { width: 15%; }
.billing-merchant-panel th:nth-child(3) { width: 18%; }
.billing-merchant-panel th:nth-child(4) { width: 17%; }
.billing-merchant-panel th:nth-child(5) { width: 13%; }
.billing-merchant-panel th:nth-child(6) { width: 10%; }
.billing-merchant-panel td { padding: 13px; border-top: 1px solid var(--billing-line); color: var(--billing-ink); font-size: 11px; vertical-align: middle; }
.billing-merchant-panel tbody tr { transition: background .16s ease; }
.billing-merchant-panel tbody tr:hover,
.billing-merchant-panel tbody tr.selected { background: #f3f8fc; }
.billing-merchant-panel tbody tr.selected td:first-child { box-shadow: inset 3px 0 var(--billing-brand); }

.billing-merchant-name a,
.billing-merchant-name strong,
.billing-merchant-name span,
.billing-cell-note { display: block; }
.billing-merchant-name strong { color: var(--billing-ink); font-size: 12px; font-weight: 900; }
.billing-merchant-name span,
.billing-cell-note { margin-top: 3px; color: var(--billing-muted); font-size: 9px; }
.billing-count,
.billing-money { font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace; font-size: 13px; font-weight: 900; }

.billing-deltas { display: flex; flex-wrap: wrap; gap: 4px; }
.billing-deltas span { padding: 3px 5px; border-radius: 5px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.billing-deltas .up { color: var(--billing-green); background: var(--billing-green-soft); }
.billing-deltas .down { color: var(--billing-amber); background: var(--billing-amber-soft); }

.billing-status-chip {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.billing-status-chip.pending,
.billing-status-chip.partial { color: var(--billing-amber); background: var(--billing-amber-soft); }
.billing-status-chip.paid { color: var(--billing-green); background: var(--billing-green-soft); }
.billing-status-chip.overdue,
.billing-status-chip.cancelled { color: var(--billing-red); background: var(--billing-red-soft); }
.billing-status-chip.muted { color: var(--billing-muted); background: #eef2f6; }

.billing-row-button {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #aec4d5;
  border-radius: 7px;
  color: var(--billing-brand);
  background: #fff;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.billing-row-button.primary { color: #fff; border-color: var(--billing-brand); background: var(--billing-brand); }
.billing-dashboard-empty { padding: 40px 18px !important; text-align: center; }
.billing-dashboard-empty strong,
.billing-dashboard-empty span { display: block; }
.billing-dashboard-empty strong { font-size: 13px; }
.billing-dashboard-empty span { margin-top: 6px; color: var(--billing-muted); font-size: 10px; }

.billing-selected-panel { position: sticky; top: 102px; }
.billing-selected-head { padding: 17px 18px 14px; border-bottom: 1px solid var(--billing-line); }
.billing-selected-head span { color: var(--billing-muted); font-size: 9px; font-weight: 750; }
.billing-selected-head h2 { margin: 5px 0 0; color: var(--billing-ink); font-size: 16px; font-weight: 950; }
.billing-selected-body { padding: 15px 18px 18px; }
.billing-bill-no { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 13px; color: var(--billing-muted); font-size: 9px; }
.billing-bill-no b { color: var(--billing-ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }

.billing-breakdown { overflow: hidden; border: 1px solid var(--billing-line); border-radius: 10px; }
.billing-breakdown > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 11px; border-bottom: 1px solid var(--billing-line); font-size: 10px; }
.billing-breakdown > div:last-child { border-bottom: 0; }
.billing-breakdown span small { display: block; margin-top: 3px; color: var(--billing-muted); font-size: 8px; }
.billing-breakdown strong { font-family: "DIN Alternate", Consolas, monospace; }

.billing-selected-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 15px 0 17px; }
.billing-selected-total span { color: var(--billing-muted); font-size: 10px; }
.billing-selected-total strong { color: var(--billing-ink); font-family: "DIN Alternate", Consolas, monospace; font-size: 25px; letter-spacing: -.03em; }
.billing-selected-body h3 { margin: 0 0 7px; color: var(--billing-ink); font-size: 10px; font-weight: 900; }

.billing-event-list { display: grid; }
.billing-event-list > div { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--billing-line); }
.billing-event-list > div:last-child { border-bottom: 0; }
.billing-event-list time { color: var(--billing-muted); font-family: "DIN Alternate", Consolas, monospace; font-size: 9px; }
.billing-event-list p { margin: 0; }
.billing-event-list p strong,
.billing-event-list p span { display: block; }
.billing-event-list p strong { color: var(--billing-ink); font-size: 9px; }
.billing-event-list p span { margin-top: 2px; color: var(--billing-muted); font-size: 8px; line-height: 1.45; }
.billing-event-empty { display: block !important; color: var(--billing-muted); font-size: 9px; }

.billing-rule-note { margin: 12px 0 0; padding: 9px 10px; border-radius: 9px; color: #835a22; background: var(--billing-amber-soft); font-size: 8px; font-weight: 650; line-height: 1.55; }
.billing-selected-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.billing-selected-actions a,
.billing-primary-action { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--billing-line); border-radius: 8px; color: var(--billing-ink); background: #fff; font-size: 9px; font-weight: 900; }
.billing-selected-actions .billing-primary-action,
.billing-selected-empty .billing-primary-action { color: #fff; border-color: var(--billing-brand); background: var(--billing-brand); }

.billing-selected-empty { display: grid; gap: 8px; padding: 16px 0 4px; }
.billing-selected-empty.standalone { padding: 24px 18px; }
.billing-selected-empty span { color: var(--billing-muted); font-size: 9px; }
.billing-selected-empty strong { color: var(--billing-ink); font-size: 12px; line-height: 1.55; }
.billing-selected-empty .billing-primary-action { margin-top: 8px; }

@media (max-width: 1380px) {
  .billing-dashboard-grid { grid-template-columns: minmax(620px, 1fr) 300px; }
  .billing-ledger-totals strong { font-size: 17px; }
  .billing-dashboard-toolbar { grid-template-columns: minmax(240px, 1fr) 120px 120px auto auto; }
}

@media (max-width: 1120px) {
  .billing-dashboard-heading { align-items: flex-start; flex-direction: column; }
  .billing-dashboard-grid { grid-template-columns: 1fr; }
  .billing-selected-panel { position: static; }
  .billing-ledger-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-ledger-totals > div { border-bottom: 1px solid var(--billing-line); }
  .billing-dashboard-toolbar { grid-template-columns: 1fr 1fr; }
  .billing-dashboard-search { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .platform-billing-dashboard * { transition: none !important; }
}

.billing-entry-modal {
  --billing-ink: #16283b;
  --billing-muted: #6d7f91;
  --billing-line: #dbe5ee;
  --billing-brand-soft: #e8f1f7;
  --billing-amber-soft: #fff4df;
  --billing-red: #b84f45;
  width: min(560px, calc(100vw - 32px));
}

.billing-entry-modal form {
  display: grid;
  gap: 18px;
}

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

.billing-field {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--billing-muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-field input,
.billing-field select {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--billing-line);
  border-radius: 8px;
  color: var(--billing-ink);
  background: #fff;
  font: inherit;
}

.billing-field small {
  position: absolute;
  right: 11px;
  bottom: 12px;
  color: var(--billing-muted);
  font-size: 11px;
  pointer-events: none;
}

.billing-field ul.errorlist {
  margin: 0;
  padding: 0;
  color: var(--billing-red);
  font-size: 11px;
  list-style: none;
}

.billing-modal-summary,
.billing-modal-alert {
  padding: 13px 14px;
  border-radius: 10px;
}

.billing-modal-summary {
  display: grid;
  gap: 4px;
  color: var(--billing-muted);
  background: var(--billing-brand-soft);
  font-size: 12px;
  line-height: 1.55;
}

.billing-modal-summary strong,
.billing-modal-alert strong {
  color: var(--billing-ink);
  font-size: 13px;
}

.billing-modal-alert {
  border: 1px solid #ead18f;
  color: #7a5a23;
  background: var(--billing-amber-soft);
  font-size: 12px;
}

.billing-modal-alert p {
  margin: 5px 0 0;
}

.billing-entry-modal .entry-modal-footer {
  justify-content: flex-end;
  align-items: center;
}

.billing-entry-modal .entry-modal-footer .primary-button,
.billing-entry-modal .entry-modal-footer .secondary-button {
  min-height: 40px;
  height: 40px;
  padding: 0 18px;
  font-size: 13px;
}

@media (max-width: 620px) {
  .billing-form-grid { grid-template-columns: 1fr; }
}

.billing-tenant-workspace {
  --billing-tenant-ink: #16283b;
  --billing-tenant-muted: #6d7f91;
  --billing-tenant-line: #dbe5ee;
  --billing-tenant-brand: #285f88;
  display: grid;
  gap: 16px;
  color: var(--billing-tenant-ink);
}

.billing-tenant-workspace .billing-detail-heading { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: end; }
.billing-tenant-workspace .billing-detail-heading .back-link { align-self: center; }
.billing-tenant-workspace .billing-detail-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.billing-tenant-workspace .billing-detail-heading .billing-status-chip { margin-top: 8px; }
.billing-tenant-workspace .billing-tenant-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--billing-tenant-line); border-radius: 14px; background: #fff; }
.billing-tenant-workspace .billing-tenant-summary article { min-height: 82px; display: grid; align-content: center; gap: 7px; padding: 14px 16px; border-right: 1px solid var(--billing-tenant-line); }
.billing-tenant-workspace .billing-tenant-summary article:last-child { border-right: 0; }
.billing-tenant-workspace .billing-tenant-summary span { color: var(--billing-tenant-muted); font-size: 10px; font-weight: 800; }
.billing-tenant-workspace .billing-tenant-summary strong { font-size: 14px; line-height: 1.35; }
.billing-tenant-workspace .billing-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.billing-tenant-workspace .billing-detail-actions button { min-height: 32px; padding: 0 12px; border: 1px solid #aec4d5; border-radius: 8px; color: var(--billing-tenant-brand); background: #fff; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.billing-tenant-workspace .billing-detail-actions .danger-button { border-color: #e4aaa6; color: #aa3028; background: #fff5f4; }
.billing-tenant-workspace .billing-enrollment-panel,
.billing-tenant-workspace .billing-history-panel { overflow: hidden; border: 1px solid var(--billing-tenant-line); border-radius: 14px; background: #fff; }
.billing-tenant-workspace .billing-panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 18px; border-bottom: 1px solid var(--billing-tenant-line); }
.billing-tenant-workspace .billing-panel-heading h2 { margin: 0; font-size: 15px; }
.billing-tenant-workspace .billing-panel-heading span { display: block; margin-top: 4px; color: var(--billing-tenant-muted); font-size: 10px; }
.billing-tenant-workspace .billing-enrollment-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto auto; gap: 9px; padding: 14px 18px; border-bottom: 1px solid var(--billing-tenant-line); }
.billing-tenant-workspace .billing-enrollment-filters :is(input, select, button, a) { box-sizing: border-box; min-height: 40px; border: 1px solid var(--billing-tenant-line); border-radius: 9px; color: var(--billing-tenant-ink); background: #fff; font: inherit; font-size: 12px; }
.billing-tenant-workspace .billing-enrollment-filters input,
.billing-tenant-workspace .billing-enrollment-filters select { width: 100%; padding: 0 11px; }
.billing-tenant-workspace .billing-enrollment-filters button { padding: 0 15px; border-color: var(--billing-tenant-brand); color: #fff; background: var(--billing-tenant-brand); font-weight: 850; cursor: pointer; }
.billing-tenant-workspace .billing-enrollment-filters a { display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; color: var(--billing-tenant-muted); text-decoration: none; }
.billing-tenant-workspace .billing-enrollment-table-wrap { overflow-x: auto; }
.billing-tenant-workspace table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.billing-tenant-workspace th { padding: 11px 14px; color: #617487; background: #edf4f9; font-size: 10px; font-weight: 900; text-align: left; }
.billing-tenant-workspace td { padding: 12px 14px; border-top: 1px solid var(--billing-tenant-line); font-size: 11px; vertical-align: middle; }
.billing-tenant-workspace th:last-child,
.billing-tenant-workspace td:last-child { width: 82px; }
.billing-tenant-workspace .billing-row-button { min-height: 30px; border: 1px solid #aec4d5; background: #fff; font-size: 10px; cursor: pointer; }
.billing-tenant-workspace .billing-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 54px; padding: 0 18px; border-top: 1px solid var(--billing-tenant-line); color: var(--billing-tenant-muted); font-size: 11px; }
.billing-tenant-workspace .billing-pagination a { min-height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--billing-tenant-line); border-radius: 7px; color: var(--billing-tenant-brand); text-decoration: none; }

@media (max-width: 960px) {
  .billing-tenant-workspace .billing-detail-heading { grid-template-columns: 1fr auto; }
  .billing-tenant-workspace .billing-detail-heading .back-link { grid-column: 1 / -1; }
  .billing-tenant-workspace .billing-tenant-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-tenant-workspace .billing-tenant-summary article:nth-child(2n) { border-right: 0; }
  .billing-tenant-workspace .billing-enrollment-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .billing-tenant-workspace .billing-detail-heading { grid-template-columns: 1fr; }
  .billing-tenant-workspace .billing-tenant-summary { grid-template-columns: 1fr; }
  .billing-tenant-workspace .billing-tenant-summary article { border-right: 0; border-bottom: 1px solid var(--billing-tenant-line); }
  .billing-tenant-workspace .billing-enrollment-filters { grid-template-columns: 1fr; }
  .billing-tenant-workspace .billing-pagination { justify-content: center; }
}

.billing-bill-workspace {
  --billing-bill-ink: #16283b;
  --billing-bill-muted: #6d7f91;
  --billing-bill-line: #dbe5ee;
  --billing-bill-brand: #285f88;
  display: grid;
  gap: 16px;
  color: var(--billing-bill-ink);
}

.billing-bill-heading {
  display: grid;
  gap: 10px;
}

.billing-bill-heading .back-link { width: fit-content; }
.billing-bill-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.billing-bill-heading > div > p:last-child { margin: 7px 0 0; color: var(--billing-bill-muted); font-size: 12px; font-weight: 700; }
.billing-bill-title-row { display: flex; align-items: center; gap: 10px; }

.billing-bill-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--billing-bill-line);
  border-radius: 14px;
  background: #fff;
}

.billing-bill-summary article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px 17px;
  border-right: 1px solid var(--billing-bill-line);
}

.billing-bill-summary article:last-child { border-right: 0; }
.billing-bill-summary span { color: var(--billing-bill-muted); font-size: 10px; font-weight: 800; }
.billing-bill-summary strong { font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace; font-size: 20px; }

.billing-bill-layout {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.billing-charge-panel,
.billing-bill-sidecard,
.billing-payment-panel {
  overflow: hidden;
  border: 1px solid var(--billing-bill-line);
  border-radius: 14px;
  background: #fff;
}

.billing-bill-workspace .billing-panel-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--billing-bill-line);
}

.billing-bill-workspace .billing-panel-heading h2 { margin: 0; font-size: 15px; }
.billing-bill-workspace .billing-panel-heading span { display: block; margin-top: 4px; color: var(--billing-bill-muted); font-size: 10px; }
.billing-charge-table-wrap { overflow-x: auto; }
.billing-bill-workspace table { width: 100%; border-collapse: collapse; }
.billing-bill-workspace th { padding: 11px 13px; color: #617487; background: #edf4f9; font-size: 10px; font-weight: 900; text-align: left; white-space: nowrap; }
.billing-bill-workspace td { padding: 12px 13px; border-top: 1px solid var(--billing-bill-line); color: var(--billing-bill-ink); font-size: 11px; vertical-align: middle; }
.billing-table-money { font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace; font-weight: 900; white-space: nowrap; }

.billing-bill-sidecard { position: sticky; top: 102px; }
.billing-bill-sidecard dl { margin: 0; padding: 4px 18px; }
.billing-bill-sidecard dl > div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--billing-bill-line); }
.billing-bill-sidecard dt { color: var(--billing-bill-muted); font-size: 10px; font-weight: 800; }
.billing-bill-sidecard dd { margin: 0; color: var(--billing-bill-ink); font-size: 11px; font-weight: 800; text-align: right; }

.billing-bill-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 18px 18px; }
.billing-bill-actions h3 { grid-column: 1 / -1; margin: 0 0 2px; font-size: 11px; }
.billing-bill-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #aec4d5;
  border-radius: 8px;
  color: var(--billing-bill-brand);
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.billing-bill-actions .primary-button { color: #fff; border-color: var(--billing-bill-brand); background: var(--billing-bill-brand); }
.billing-bill-actions .danger-button { color: #aa3028; border-color: #e4aaa6; background: #fff5f4; }
.billing-payment-panel .billing-row-button { min-height: 30px; padding: 0 10px; border: 1px solid #aec4d5; border-radius: 7px; color: var(--billing-bill-brand); background: #fff; font: inherit; font-size: 10px; font-weight: 850; cursor: pointer; }

@media (max-width: 1120px) {
  .billing-bill-layout { grid-template-columns: 1fr; }
  .billing-bill-sidecard { position: static; }
}

@media (max-width: 720px) {
  .billing-bill-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-bill-summary article:nth-child(2n) { border-right: 0; }
}

/* 平台计费正式版：紧凑概况、全宽表格和统一分页。 */
.billing-tenant-workspace,
.billing-bill-workspace {
  --billing-green: #2f8069;
  --billing-green-soft: #eaf6f1;
  --billing-amber: #b8751f;
  --billing-amber-soft: #fff4df;
  --billing-red: #b84f45;
  --billing-red-soft: #fff0ed;
}

.billing-overview {
  overflow: hidden;
  border: 1px solid var(--billing-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 36px rgba(31, 62, 90, .08);
}

.billing-overview-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--billing-line);
}

.billing-overview-head h2,
.billing-overview-title h3 { margin: 0; color: var(--billing-ink); font-weight: 900; }
.billing-overview-head h2 { font-size: 18px; }
.billing-overview-title h3 { font-size: 16px; }
.billing-overview-head p,
.billing-overview-title p { margin: 5px 0 0; color: var(--billing-muted); font-size: 13px; line-height: 1.55; }
.billing-overview-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.billing-overview-actions > .secondary-button { min-height: 36px; padding: 0 14px; }
.billing-overview-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-overview-section { min-width: 0; padding: 18px 20px 20px; }
.billing-overview-section + .billing-overview-section { border-left: 1px solid var(--billing-line); }
.billing-overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.billing-overview-metric { min-width: 0; padding: 0 16px; border-left: 1px solid var(--billing-line); }
.billing-overview-metric:first-child { padding-left: 0; border-left: 0; }
.billing-overview-metric span,
.billing-overview-metric strong,
.billing-overview-metric small { display: block; }
.billing-overview-metric span { color: var(--billing-muted); font-size: 13px; font-weight: 760; }
.billing-overview-metric strong { margin-top: 7px; color: var(--billing-ink); font-family: "DIN Alternate", "SFMono-Regular", Consolas, monospace; font-size: 24px; line-height: 1; }
.billing-overview-metric small { margin-top: 7px; color: var(--billing-muted); font-size: 12px; }
.billing-change-list { display: grid; margin-top: 16px; border-top: 1px solid var(--billing-line); }
.billing-change-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 44px; border-bottom: 1px dashed var(--billing-line); }
.billing-change-row:last-child { border-bottom: 0; }
.billing-change-row time { color: var(--billing-ink); font-family: "DIN Alternate", Consolas, monospace; font-size: 14px; font-weight: 850; }
.billing-change-row > small { color: var(--billing-muted); font-size: 12px; }
.billing-change-row.empty { grid-template-columns: 1fr; color: var(--billing-muted); font-size: 13px; }
.billing-change-events { display: flex; flex-wrap: wrap; gap: 6px; }
.billing-change-events span { min-height: 25px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 900; }
.billing-change-events .up { color: var(--billing-green); background: var(--billing-green-soft); }
.billing-change-events .down { color: var(--billing-amber); background: var(--billing-amber-soft); }
.billing-cancel-note,
.billing-valid-note { margin-top: 16px; padding: 11px 12px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.billing-cancel-note { display: flex; align-items: flex-start; gap: 9px; border: 1px solid rgba(184, 79, 69, .17); color: #7d4944; background: var(--billing-red-soft); }
.billing-cancel-note b { flex: 0 0 auto; }
.billing-valid-note { color: var(--billing-muted); background: #f4f7fa; }

.platform-billing-dashboard .billing-merchant-panel { width: 100%; }
.platform-billing-dashboard .billing-merchant-panel .billing-panel-heading { min-height: 58px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--billing-line); }
.platform-billing-dashboard .billing-panel-heading h2 { margin: 0; font-size: 17px; }
.platform-billing-dashboard .billing-panel-heading span { display: block; margin-top: 4px; color: var(--billing-muted); font-size: 13px; }
.platform-billing-dashboard .billing-merchant-panel { overflow-x: auto; }
.platform-billing-dashboard .billing-merchant-panel table { min-width: 1120px; table-layout: auto; }
.platform-billing-dashboard .billing-merchant-panel th { width: auto; padding: 13px 14px; font-size: 12px; }
.platform-billing-dashboard .billing-merchant-panel th:first-child { width: 22%; }
.platform-billing-dashboard .billing-merchant-panel th:last-child { width: 180px; }
.platform-billing-dashboard .billing-merchant-panel td { padding: 14px; font-size: 13px; }
.platform-billing-dashboard .billing-merchant-name strong { font-size: 14px; }
.platform-billing-dashboard .billing-merchant-name span,
.platform-billing-dashboard .billing-cell-note { font-size: 12px; }
.platform-billing-dashboard .billing-status-chip,
.platform-billing-dashboard .billing-row-button { font-size: 12px; }
.billing-bill-code { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 800; white-space: nowrap; }
.billing-money.muted { color: var(--billing-muted); }
.billing-cancelled-row { background: #fbf8f7; }
.billing-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.billing-row-placeholder { color: var(--billing-muted); font-size: 12px; white-space: nowrap; }

.billing-tenant-workspace .billing-tenant-summary span { font-size: 12px; }
.billing-tenant-workspace .billing-tenant-summary strong { font-size: 16px; }
.billing-settings-note { padding: 12px 14px; border: 1px solid #ead18f; border-radius: 10px; color: #7a5a23; background: #fff4df; font-size: 13px; line-height: 1.65; }
.billing-tenant-workspace .billing-panel-heading { min-height: 66px; gap: 18px; padding: 10px 18px; }
.billing-tenant-workspace .billing-panel-heading h2 { font-size: 17px; }
.billing-tenant-workspace .billing-panel-heading span { font-size: 12px; }
.billing-panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.billing-panel-heading-actions :is(button, a) { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0 12px; border: 1px solid #aec4d5; border-radius: 8px; color: var(--billing-tenant-brand); background: #fff; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; }
.billing-panel-heading-actions .danger-button { border-color: #e4aaa6; color: #aa3028; background: #fff5f4; }
.billing-tenant-workspace th { font-size: 12px; }
.billing-tenant-workspace td { font-size: 13px; }
.billing-tenant-workspace .billing-row-button,
.billing-tenant-workspace .billing-status-chip { font-size: 12px; }
.billing-tenant-workspace .pagination-bar { border-top: 1px solid var(--billing-tenant-line); }

.billing-bill-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--billing-bill-line);
  border-radius: 14px;
  background: #fff;
}
.billing-bill-overview article { min-height: 78px; display: grid; align-content: center; gap: 7px; padding: 13px 17px; border-right: 1px solid var(--billing-bill-line); }
.billing-bill-overview article:nth-child(4n) { border-right: 0; }
.billing-bill-overview article:nth-child(n + 5) { border-top: 1px solid var(--billing-bill-line); }
.billing-bill-overview span { color: var(--billing-bill-muted); font-size: 12px; font-weight: 800; }
.billing-bill-overview strong { color: var(--billing-bill-ink); font-size: 16px; line-height: 1.4; }
.billing-detail-cancel-note { padding: 12px 14px; border: 1px solid rgba(184, 79, 69, .2); border-radius: 11px; color: #7d4944; background: #fff0ed; font-size: 13px; line-height: 1.6; }
.billing-bill-workspace .billing-bill-panel-heading { min-height: 66px; gap: 18px; padding: 9px 18px; }
.billing-bill-panel-title { min-width: 180px; }
.billing-bill-workspace .billing-bill-panel-title h2 { font-family: "SFMono-Regular", Consolas, monospace; font-size: 17px; letter-spacing: 0; }
.billing-bill-workspace .billing-bill-panel-title > span { font-size: 12px; }
.billing-bill-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.billing-bill-toolbar > :is(a, button),
.billing-more-actions > summary { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0 12px; border: 1px solid #aec4d5; border-radius: 8px; color: var(--billing-bill-brand); background: #fff; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; list-style: none; }
.billing-bill-toolbar > .primary-button { color: #fff; border-color: var(--billing-bill-brand); background: var(--billing-bill-brand); }
.billing-more-actions { position: relative; }
.billing-more-actions > summary::-webkit-details-marker { display: none; }
.billing-more-actions > summary::after { content: "▾"; margin-left: 7px; }
.billing-more-actions[open] > summary::after { transform: rotate(180deg); }
.billing-more-actions > div { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 170px; padding: 6px; border: 1px solid var(--billing-bill-line); border-radius: 9px; background: #fff; box-shadow: 0 16px 36px rgba(31, 62, 90, .16); }
.billing-more-actions > div button { width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--billing-bill-ink); background: transparent; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.billing-more-actions > div button:hover { background: #e8f1f7; }
.billing-more-actions > div .danger-button { color: #aa3028; }
.billing-bill-workspace th { font-size: 12px; }
.billing-bill-workspace td { font-size: 13px; }
.billing-payment-panel .billing-row-button,
.billing-payment-panel .billing-status-chip { font-size: 12px; }

.billing-list-workspace {
  --billing-list-ink: #16283b;
  --billing-list-muted: #6d7f91;
  --billing-list-line: #dbe5ee;
  --billing-list-brand: #285f88;
  --billing-green: #2f8069;
  --billing-green-soft: #eaf6f1;
  --billing-amber: #b8751f;
  --billing-amber-soft: #fff4df;
  --billing-red: #b84f45;
  --billing-red-soft: #fff0ed;
  color: var(--billing-list-ink);
}
.billing-list-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--billing-list-line); border-radius: 14px; background: #fff; }
.billing-list-summary.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.billing-list-summary article { min-height: 86px; display: grid; align-content: center; gap: 7px; padding: 14px 18px; border-right: 1px solid var(--billing-list-line); }
.billing-list-summary article:last-child { border-right: 0; }
.billing-list-summary span { color: var(--billing-list-muted); font-size: 13px; }
.billing-list-summary strong { font-size: 19px; }
.billing-list-panel { overflow: hidden; border: 1px solid var(--billing-list-line); border-radius: 14px; background: #fff; }
.billing-list-panel .billing-panel-heading { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--billing-list-line); }
.billing-list-panel .billing-panel-heading h2 { margin: 0; font-size: 17px; }
.billing-list-panel .billing-panel-heading span { display: block; margin-top: 4px; color: var(--billing-list-muted); font-size: 12px; }
.billing-list-panel .billing-panel-heading .secondary-button { min-height: 36px; }
.billing-list-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 150px auto auto; gap: 9px; padding: 14px 18px; border-bottom: 1px solid var(--billing-list-line); }
.billing-list-filters :is(input, select, button, a) { box-sizing: border-box; min-height: 40px; border: 1px solid var(--billing-list-line); border-radius: 9px; color: var(--billing-list-ink); background: #fff; font: inherit; font-size: 13px; }
.billing-list-filters :is(input, select) { width: 100%; padding: 0 11px; }
.billing-list-filters button { padding: 0 15px; border-color: var(--billing-list-brand); color: #fff; background: var(--billing-list-brand); font-weight: 850; cursor: pointer; }
.billing-list-filters a { display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; color: var(--billing-list-muted); }
.billing-table-wrap { overflow-x: auto; }
.billing-list-panel table { width: 100%; min-width: 920px; border-collapse: collapse; }
.billing-list-panel th { padding: 12px 14px; color: #617487; background: #edf4f9; font-size: 12px; text-align: left; }
.billing-list-panel td { padding: 13px 14px; border-top: 1px solid var(--billing-list-line); font-size: 13px; }
.billing-list-panel .pagination-bar { border-top: 1px solid var(--billing-list-line); }

.billing-entry-modal .billing-field { font-size: 13px; }
.billing-entry-modal .billing-field :is(input, select, textarea) { min-height: 42px; font-size: 13px; }
.billing-entry-modal .billing-modal-summary,
.billing-entry-modal .billing-modal-alert { font-size: 13px; }
.billing-entry-modal .billing-modal-summary small { color: var(--billing-muted); font-size: 12px; }
.billing-entry-modal [data-payment-remaining-preview].is-over { color: var(--billing-red); }

.billing-delegation-guard-card { width: 100%; }
.billing-delegation-guard-body {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 32px;
}
.billing-delegation-guard-body > div:first-child { max-width: 620px; }
.billing-delegation-guard-label {
  display: block;
  margin-bottom: 8px;
  color: var(--billing-list-muted);
  font-size: 13px;
  font-weight: 800;
}
.billing-delegation-guard-body strong {
  color: var(--billing-list-ink);
  font-size: 22px;
}
.billing-delegation-guard-body p {
  margin: 10px 0 0;
  color: var(--billing-list-muted);
  font-size: 13px;
  line-height: 1.65;
}
.billing-delegation-guard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}
.billing-delegation-guard-actions form { margin: 0; }
.billing-delegation-guard-actions :is(button, a) {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .billing-overview-body { grid-template-columns: 1fr; }
  .billing-overview-section + .billing-overview-section { border-top: 1px solid var(--billing-line); border-left: 0; }
  .billing-bill-workspace .billing-bill-panel-heading { align-items: flex-start; flex-direction: column; }
  .billing-bill-toolbar { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .billing-overview-head { align-items: flex-start; flex-direction: column; }
  .billing-overview-actions { justify-content: flex-start; }
  .billing-overview-metrics,
  .billing-bill-overview,
  .billing-list-summary,
  .billing-list-summary.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-bill-overview article:nth-child(n) { border-right: 1px solid var(--billing-bill-line); border-top: 1px solid var(--billing-bill-line); }
  .billing-bill-overview article:nth-child(-n + 2) { border-top: 0; }
  .billing-bill-overview article:nth-child(2n) { border-right: 0; }
  .billing-list-filters { grid-template-columns: 1fr 1fr; }
  .billing-list-filters input { grid-column: 1 / -1; }
  .billing-panel-heading-actions { justify-content: flex-start; }
  .billing-delegation-guard-body { align-items: flex-start; flex-direction: column; padding: 24px 20px; }
  .billing-delegation-guard-actions { justify-content: flex-start; }
}

/* 平台运营中心：沿用后台主题，把概览、数据和商家管理收进一张商家总表。 */
.operations-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--glass-line, var(--line));
  border-radius: 14px;
  background: var(--glass-panel, var(--surface));
  box-shadow: var(--glass-shadow-soft, var(--soft-shadow));
}

.operations-summary article {
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
  border-right: 1px solid var(--glass-line, var(--line));
}

.operations-summary article:last-child { border-right: 0; }
.operations-summary span,
.operations-summary small { color: var(--muted); }
.operations-summary span { font-size: 13px; font-weight: 800; }
.operations-summary strong { color: var(--heading); font-size: 22px; line-height: 1; }
.operations-summary small { overflow: hidden; font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }

.operations-toolbar {
  display: grid;
  gap: 13px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.operations-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.operations-toolbar-actions > :is(a, button),
.operations-filter-form > .operations-export-button,
.operations-query-actions :is(a, button) {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 850;
}

.operations-filter-form {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.operations-export-button { align-self: end; }
.operations-search-field { min-width: 0; }
.operations-search-field input { min-height: 40px; }

.operations-status-filter {
  min-height: 40px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--glass-line, var(--line));
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
}

.operations-status-filter a {
  min-width: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-right: 1px solid var(--glass-line, var(--line));
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.operations-status-filter a:last-child { border-right: 0; }
.operations-status-filter a:hover { color: var(--heading); background: var(--surface-hover); }
.operations-status-filter a.active { color: #fff; background: var(--theme-action, var(--brand)); }
.operations-status-filter strong { font-size: 11px; }

.operations-query-actions {
  display: flex;
  gap: 7px;
}

.operations-merchant-panel { padding: 0; }

.operations-merchant-panel { margin-bottom: 14px; }
.operations-merchant-panel > .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 10px 18px;
}

.operations-merchant-panel .panel-heading h2 { margin: 0; }

.operations-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(220px, 1.25fr) minmax(300px, 1.65fr) minmax(118px, .7fr);
}

.operations-row-head {
  min-height: 43px;
  align-items: center;
  border-bottom: 1px solid var(--glass-line, var(--line));
  color: var(--muted);
  background: var(--table-head);
  font-size: 12px;
  font-weight: 850;
}

.operations-row-head span { padding: 0 14px; }
.operations-row-list > .operations-row {
  position: relative;
  border-bottom: 1px solid var(--glass-line, var(--line));
  background: rgba(255, 255, 255, .34);
}
.operations-row-list > .operations-row:last-child { border-bottom: 0; }
.operations-row-list > .operations-row:hover { background: rgba(255, 255, 255, .64); }
.operations-row-list > .operations-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
}
.operations-row-list > .operations-row-danger::before { background: var(--danger); }
.operations-row-list > .operations-row-warning::before { background: var(--warning); }

.operations-row > section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 15px 14px;
  border-right: 1px solid var(--glass-line, var(--line));
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.operations-row > section:last-child { border-right: 0; }

.operations-title-line {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.operations-title-line > strong { color: var(--heading); font-size: 15px; }
.operations-row .muted-line { margin: 0; line-height: 1.45; }
.operations-row .status-chip { font-size: 11px; }
.operations-row .status-chip-row { gap: 5px; }

.operations-data-links {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--glass-line, var(--line));
  border-radius: 9px;
  background: rgba(255, 255, 255, .56);
}
.operations-data-links a {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 8px;
  border-right: 1px solid var(--glass-line, var(--line));
  color: var(--heading);
  font-weight: 850;
}
.operations-data-links a:last-child { border-right: 0; }
.operations-data-links a:hover { background: var(--surface-hover); }
.operations-data-links small { color: var(--muted); font-size: 11px; font-weight: 700; }

.operations-risk-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.operations-risk-links a {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
}
.operations-risk-links a.danger { color: var(--danger); background: var(--metric-danger-bg); }
.operations-risk-links a.warning { color: var(--warning); background: var(--metric-warning-bg); }

.operations-action-cell { justify-content: center; }
.operations-action-cell > :is(a, form, .data-row-actions),
.operations-action-cell form > button,
.operations-action-cell .row-action-select { width: 100%; }
.operations-action-cell form { margin: 0; }
.operations-action-cell .compact-button,
.operations-action-cell .row-action-select {
  min-height: 36px;
  justify-content: center;
  font-size: 12px;
}

.operations-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.operations-merchant-panel > .pagination-bar { border-top: 1px solid var(--glass-line, var(--line)); }

@media (max-width: 1180px) {
  .operations-filter-form { grid-template-columns: auto minmax(220px, 1fr) auto; }
  .operations-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-row-head { display: none; }
  .operations-row > section:nth-child(2n) { border-right: 0; }
  .operations-row > section:nth-child(n + 3) { border-top: 1px solid var(--glass-line, var(--line)); }
}

@media (max-width: 820px) {
  .operations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-summary article { border-bottom: 1px solid var(--glass-line, var(--line)); }
  .operations-summary article:nth-child(2n) { border-right: 0; }
  .operations-summary article:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .operations-filter-form { grid-template-columns: 1fr; }
  .operations-export-button { justify-self: start; }
  .operations-status-filter { max-width: 100%; overflow-x: auto; }
  .operations-query-actions { justify-content: flex-end; }
  .operations-row { grid-template-columns: 1fr; }
  .operations-row > section { border-right: 0; border-top: 1px solid var(--glass-line, var(--line)); }
  .operations-row > section:first-child { border-top: 0; }
  .operations-merchant-panel > .panel-heading { align-items: flex-start; flex-direction: column; }
}

/* Merchant summary strips: one compact title/value row across merchant pages. */
body.portal-merchant .merchant-compact-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) {
  min-width: 0;
  min-height: 72px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
  transform: none;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div):last-child {
  border-right: 0;
}

body.portal-merchant .merchant-compact-stat-strip > :is(
  .metric-card.danger,
  .metric-card.warning,
  .metric-card.info,
  .metric-card.subtle
) {
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 3px solid transparent;
  background: var(--surface);
}

body.portal-merchant .merchant-compact-stat-strip > :is(
  .metric-card.danger,
  .metric-card.warning,
  .metric-card.info,
  .metric-card.subtle
):last-child {
  border-right: 0;
}

body.portal-merchant .merchant-compact-stat-strip > :is(
  .metric-card.danger,
  .metric-card.warning,
  .metric-card.info,
  .metric-card.subtle
):hover {
  background: var(--surface-hover);
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) > span,
body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) > strong {
  display: block;
  min-width: 0;
  margin: 0;
  line-height: 1.2;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) > span {
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) > strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 19px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) > small {
  display: none;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, button) {
  appearance: none;
  cursor: pointer;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, button):hover {
  background: var(--surface-hover);
  transform: none;
}

body.portal-merchant .merchant-compact-stat-strip > :is(a, button):focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

body.portal-merchant .merchant-compact-stat-strip > .is-active {
  color: var(--primary);
  background: var(--surface-subtle);
  border-bottom-color: var(--primary);
}

body.portal-merchant .merchant-compact-stat-strip > .metric-card.is-active {
  color: var(--primary);
  background: var(--surface-subtle);
  border-bottom-color: var(--primary);
}

body.portal-merchant .merchant-compact-stat-strip > .is-active > span {
  color: var(--primary);
}

body.portal-merchant .merchant-compact-stat-strip .danger-text {
  color: var(--danger);
}

@media (max-width: 820px) {
  body.portal-merchant .merchant-compact-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-merchant .merchant-compact-stat-strip > :is(a, article, button, div) {
    border-bottom-color: var(--line-soft);
  }

  body.portal-merchant .merchant-compact-stat-strip > .is-active {
    border-bottom-color: var(--primary);
  }
}

/* Merchant vehicle and customer detail: one complete dossier instead of duplicate summary cards. */
.merchant-detail-layout {
  margin-bottom: 14px;
}

.merchant-detail-dossier {
  margin: 0;
}

.merchant-detail-dossier-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--glass-line, var(--line));
  background:
    linear-gradient(90deg, var(--theme-action-soft), transparent 34%),
    rgba(255, 255, 255, .5);
}

.merchant-detail-dossier-identity {
  min-width: 0;
}

.merchant-detail-dossier-identity > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.merchant-detail-dossier-identity-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.merchant-detail-dossier-identity-line > strong {
  color: var(--heading);
  font-size: 27px;
  font-weight: 950;
  line-height: 1.1;
}

.merchant-detail-dossier-identity > small {
  display: block;
  max-width: 760px;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-detail-status-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.merchant-detail-status-chip.success {
  color: var(--success);
  background: var(--glass-green-soft, var(--metric-success-bg));
}

.merchant-detail-status-chip.info {
  color: var(--glass-blue-dark, var(--brand-dark));
  background: var(--glass-blue-soft, var(--metric-info-bg));
}

.merchant-detail-status-chip.muted {
  color: var(--muted);
  background: var(--surface-subtle);
}

.merchant-detail-dossier-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.merchant-detail-dossier-actions form {
  margin: 0;
}

.merchant-detail-dossier-sections {
  display: grid;
}

.merchant-detail-dossier-sections-vehicle {
  grid-template-columns: 1.05fr 1.35fr .8fr;
}

.merchant-detail-dossier-sections-customer {
  grid-template-columns: 1.05fr .95fr;
}

.merchant-detail-dossier-sections-unit {
  grid-template-columns: 1fr 1.25fr;
}

.merchant-detail-dossier-sections-violation {
  grid-template-columns: 1.25fr 1fr 1fr;
}

.merchant-detail-dossier-section {
  min-width: 0;
  padding: 19px 22px 22px;
  border-right: 1px solid var(--glass-line, var(--line));
}

.merchant-detail-dossier-section:last-child {
  border-right: 0;
}

.merchant-detail-dossier-section-heading {
  min-height: 34px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  padding: 0 0 10px 11px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 4px solid var(--theme-action, var(--brand));
}

.merchant-detail-dossier-section-heading h2 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 900;
}

.merchant-detail-dossier-section-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-panel .merchant-detail-dossier-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  padding: 0;
}

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

.merchant-detail-dossier-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.merchant-detail-dossier-grid dd {
  color: var(--heading);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.45;
}

.merchant-detail-dossier-grid .merchant-detail-emphasis {
  color: var(--theme-action-dark, var(--brand-dark));
  font-size: 20px;
  font-weight: 950;
}

@media (max-width: 1180px) {
  .merchant-detail-dossier-sections-vehicle,
  .merchant-detail-dossier-sections-customer,
  .merchant-detail-dossier-sections-unit,
  .merchant-detail-dossier-sections-violation {
    grid-template-columns: minmax(0, 1fr);
  }

  .merchant-detail-dossier-section {
    border-right: 0;
    border-bottom: 1px solid var(--glass-line, var(--line));
  }

  .merchant-detail-dossier-section:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .merchant-detail-dossier-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .merchant-detail-dossier-identity > small {
    max-width: 100%;
    white-space: normal;
  }

  .detail-panel .merchant-detail-dossier-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Unified vehicle authorization ledger and separate authorization-party accounts. */
.operator-unified-workbench,
.operator-party-workbench {
  display: grid;
  gap: 14px;
}

.operator-section-tabs {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-line, var(--line));
  border-radius: 8px;
  background: var(--surface);
}

.operator-section-tabs a {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
  white-space: nowrap;
}

.operator-section-tabs a.is-active {
  color: #fff;
  background: var(--theme-action);
}

.operator-unified-summary,
.operator-party-summary {
  margin-bottom: 0 !important;
}

.operator-unified-panel {
  overflow: hidden;
  padding: 0 !important;
}

.operator-unified-toolbar {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(380px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.operator-unified-actions,
.operator-party-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operator-unified-actions {
  flex-wrap: wrap;
}

.operator-unified-filter {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
}

.operator-unified-filter .filter-field-keyword {
  width: 100%;
  max-width: none;
}

.operator-unified-filter input {
  width: 100%;
  font-size: 14px;
}

.operator-unified-filter input::placeholder {
  font-size: 13px;
  font-weight: 500;
}

.operator-unified-filter .operator-unified-more-filter-panel {
  width: min(620px, calc(100vw - 360px));
  grid-template-columns: repeat(2, minmax(230px, 1fr));
}

.operator-log-more-filter-panel {
  width: min(620px, calc(100vw - 360px));
  grid-template-columns: repeat(2, minmax(230px, 1fr));
}

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

.operator-unified-table {
  width: 100%;
  min-width: 1020px;
  margin: 0;
  table-layout: fixed;
}

.operator-unified-table.edge-to-edge-table {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.operator-unified-table th:nth-child(1) { width: 56px; }
.operator-unified-table th:nth-child(2) { width: 112px; }
.operator-unified-table th:nth-child(3) { width: 180px; }
.operator-unified-table th:nth-child(4) { width: 126px; }
.operator-unified-table th:nth-child(5) { width: 100px; }
.operator-unified-table th:nth-child(6) { width: 190px; }
.operator-unified-table th:nth-child(7) { width: 140px; }
.operator-unified-table th:nth-child(8) { width: 130px; }

.operator-unified-table td,
.operator-unified-table th {
  vertical-align: middle;
}

.operator-unified-table .select-cell {
  box-sizing: border-box;
  padding-right: 8px;
  padding-left: 18px;
  overflow: visible;
  text-align: left;
}

.operator-unified-table .select-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0;
}

.operator-unified-table .table-actions {
  flex-wrap: nowrap;
}

.operator-access-log-tabs {
  margin-bottom: 14px;
}

.operator-party-toolbar {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
}

.operator-party-filter {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.operator-party-filter .filter-field-keyword {
  max-width: none;
}

.operator-party-toolbar > [data-modal-open="operatorCreateModal"] {
  min-width: 132px;
  min-height: var(--toolbar-control-height);
  padding: 0 22px;
  white-space: nowrap;
}

.operator-unified-filter :is(
  input,
  select,
  .operator-filter-submit,
  .operator-filter-reset
) {
  box-sizing: border-box;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  border-radius: var(--toolbar-control-radius);
}

.operator-unified-filter :is(.operator-filter-submit, .operator-filter-reset) {
  width: auto;
  min-width: var(--toolbar-button-min-width);
  padding: 0 16px;
}

.operator-party-table {
  table-layout: fixed;
}

.operator-party-table th:nth-child(1) { width: 20%; }
.operator-party-table th:nth-child(2) { width: 16%; }
.operator-party-table th:nth-child(3) { width: 12%; }
.operator-party-table th:nth-child(4) { width: 9%; }
.operator-party-table th:nth-child(5) { width: 15%; }
.operator-party-table th:nth-child(6) { width: 28%; }

.operator-party-table td,
.operator-party-table th {
  vertical-align: middle;
}

.operator-party-table .operator-party-identity-cell,
.operator-party-table .operator-party-account-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-party-table .operator-party-identity-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-party-table td:nth-child(5),
.operator-party-table .list-row-actions,
.operator-party-table .list-row-actions form {
  white-space: nowrap;
}

.operator-party-table .list-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.operator-party-table .list-row-actions form {
  margin: 0;
}

@media (max-width: 1180px) {
  .operator-unified-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .operator-unified-filter {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .operator-unified-filter .filter-field-keyword {
    grid-column: 1 / -1;
  }

  .operator-unified-filter .operator-unified-more-filter-panel {
    width: min(320px, calc(100vw - 32px));
    grid-template-columns: minmax(0, 1fr);
  }

  .operator-log-more-filter-panel {
    width: min(320px, calc(100vw - 32px));
    grid-template-columns: minmax(0, 1fr);
  }

  .operator-party-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .operator-party-filter {
    width: 100%;
    flex-wrap: wrap;
  }

  .operator-party-filter .filter-field-keyword {
    max-width: none;
    flex-basis: 100%;
  }

  .operator-party-panel {
    overflow-x: auto;
  }

  .operator-party-table {
    min-width: 820px;
  }
}

/* One dropdown visual language across merchant and platform workspaces. */
body.app-shell select:not(.searchable-select-original) {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  max-width: 100%;
  appearance: none;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 0 40px 0 12px;
  color: #172033;
  background-color: var(--glass-field);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font-family: inherit;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

body.app-shell select:not(.searchable-select-original):hover {
  border-color: var(--glass-line-strong);
  background-color: rgba(255, 255, 255, 0.76);
}

body.app-shell select:not(.searchable-select-original):focus {
  border-color: var(--glass-line-strong);
  outline: 4px solid var(--theme-action-focus);
  outline-offset: 0;
  background-color: rgba(255, 255, 255, 0.88);
}

body.app-shell select:not(.searchable-select-original):disabled {
  color: var(--muted);
  background-color: var(--surface-subtle);
  cursor: not-allowed;
  opacity: 0.7;
}

body.app-shell select:not(.searchable-select-original) option {
  color: #172033;
  background: var(--surface);
  font-size: 14px;
}

body.app-shell .pagination-size select:not(.searchable-select-original) {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  height: 32px;
  min-height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

body.app-shell .searchable-select-input,
body.app-shell .manual-sync-unit-trigger {
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  color: #172033;
  background: var(--glass-field);
  font-family: inherit;
  font-size: 14px;
  font-weight: 680;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.app-shell .searchable-select-input {
  padding-right: 40px;
}

body.app-shell .searchable-select::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

body.app-shell .searchable-select:focus-within::after {
  transform: translateY(-30%) rotate(225deg);
}

body.app-shell .searchable-select-input:focus,
body.app-shell .manual-sync-unit-trigger:focus-visible {
  border-color: var(--glass-line-strong);
  outline: 4px solid var(--theme-action-focus);
  outline-offset: 0;
  background: rgba(255, 255, 255, 0.88);
}

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

.filing-review-toolbar .more-filter-popover {
  position: relative;
}

.filing-review-toolbar .more-filter-panel {
  right: 0;
  left: auto;
  width: min(280px, calc(100vw - 32px));
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.filing-review-panel {
  overflow: hidden;
}

.filing-review-panel-header,
.filing-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filing-review-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.filing-review-panel-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.filing-review-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}

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

.filing-review-period-table {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.filing-review-periods > section {
  min-width: 0;
}

.filing-review-period-table .merchant-list-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.filing-review-period-table th:nth-child(1) {
  width: 8%;
}

.filing-review-period-table th:nth-child(2) {
  width: 63%;
}

.filing-review-period-table th:nth-child(3) {
  width: 29%;
}

.filing-review-period-table th,
.filing-review-period-table td {
  padding: 10px 8px;
}

.filing-review-period-table th:nth-child(3),
.filing-review-period-table td:nth-child(3) {
  white-space: nowrap;
}

.filing-review-panel-header h2 {
  margin: 8px 0 4px;
  font-size: 20px;
  line-height: 1.3;
}

.filing-review-summary-grid h3,
.filing-review-periods h3,
.filing-review-conflicts h3 {
  margin: 0 0 12px;
}

.filing-review-summary-grid h3,
.filing-review-periods h3 {
  font-size: 16px;
  line-height: 1.35;
}

.filing-review-panel-header p,
.filing-review-record small {
  color: var(--muted);
}

.filing-review-panel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

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

.filing-review-record {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--glass-line);
}

.filing-review-record-grid .filing-review-record:nth-child(-n + 2) {
  border-top: 0;
}

.filing-review-select-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
}

.filing-review-select-form select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.filing-review-select-form .compact-button {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
}

.period-time-with-status {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.period-time-with-status .status-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.filing-review-conflicts,
.filing-review-alert {
  color: #8b2d24;
  background: rgba(255, 233, 228, 0.82);
}

.filing-review-conflicts {
  padding: 16px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
}

.filing-review-alert {
  padding: 12px 14px;
  border-radius: 12px;
}

.filing-review-actions {
  justify-content: flex-end;
}

.filing-review-readonly {
  margin: 0;
  color: var(--muted);
}

.filing-review-confirm-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-field);
}

.filing-review-bulk-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-field);
}

.filing-review-bulk-bar > .primary-button {
  margin-left: auto;
}

.filing-review-bulk-select-all,
.filing-review-select-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--heading);
  font-weight: 700;
  cursor: pointer;
}

.filing-review-bulk-select-all input,
.filing-review-select-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.filing-review-select-check {
  margin-bottom: 8px;
  font-size: 13px;
}

.filing-review-record-table td small {
  display: block;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .filing-review-summary-grid,
  .filing-review-periods {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .filing-review-record-grid .filing-review-record {
    border-top: 1px solid var(--glass-line);
  }

  .filing-review-record-grid .filing-review-record:first-child {
    border-top: 0;
  }

  .filing-review-bulk-bar {
    flex-wrap: wrap;
  }

  .filing-review-bulk-bar > .primary-button {
    width: 100%;
    margin-left: 0;
  }
}
