/* Premium product polish layer.
   This file intentionally overrides page-local prototype styles. */
:root {
  --page: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --sidebar: #ffffff;
  --sidebar-active: #f4f6f8;
  --border: #e6e8ec;
  --border-soft: #eef0f3;
  --text: #111827;
  --muted: #6b7280;
  --primary: #111827;
  --blue: #111827;
  --blue-soft: #f3f4f6;
  --green: #0f766e;
  --green-soft: #edf7f5;
  --amber: #8a5a00;
  --amber-soft: #f8f5ed;
  --red: #9f1239;
  --red-soft: #fbf1f4;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 16px 40px rgba(17, 24, 39, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

html {
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top left, rgba(17, 24, 39, 0.035), transparent 320px),
    var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

body[data-page]:not(.app-ready)::after {
  content: "正在加载工作台...";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--page);
  color: var(--muted);
  font-size: 15px;
  z-index: 100;
}

body[data-page]:not(.app-ready) .app {
  visibility: hidden;
}

a,
a:visited,
a:hover,
a:focus,
a:active {
  color: inherit;
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.app {
  grid-template-columns: 264px minmax(0, 1fr);
  width: 100%;
  overflow-x: hidden;
}

.main {
  min-width: 0;
  overflow-x: hidden;
}

.sidebar {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border-right: 1px solid var(--border-soft);
  padding: 24px 16px;
  backdrop-filter: blur(20px);
}

.brand {
  color: var(--text);
  padding: 0 12px;
  font-weight: 650;
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: #ffffff url("assets/yuanfeng-logo.png") center / 78% auto no-repeat;
  border-radius: 12px;
  box-shadow: none;
  color: transparent;
  font-size: 0;
}

.workspace {
  margin: 8px 8px 24px;
  padding: 12px;
  border-color: var(--border-soft);
  background: var(--surface-soft);
  border-radius: 14px;
}

.workspace-name {
  color: var(--text);
  font-weight: 600;
}

.workspace-meta,
.nav-title,
.sidebar-footer {
  color: var(--muted);
}

.nav-group {
  gap: 6px;
  margin-bottom: 24px;
  visibility: hidden;
  opacity: 0;
}

body.nav-ready .sidebar .nav-group {
  visibility: visible;
  opacity: 1;
}

.nav-title {
  padding: 8px 12px;
}

.nav-item {
  position: relative;
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  color: #374151;
  gap: 0;
  flex: 0 0 48px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none !important;
  border-left: 2px solid transparent;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.sidebar .nav-item,
.sidebar .nav-item:any-link,
.sidebar .nav-item *,
.nav-item:visited,
.nav-item:hover,
.nav-item:focus,
.nav-item span {
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.nav-item:hover {
  background: #f6f7f9;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--text);
  border-left-color: #111827;
  box-shadow: none;
  font-weight: 500;
}

.sidebar-footer {
  padding: 16px 12px 0;
  border-top-color: var(--border-soft);
}

.topbar {
  min-height: 80px;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--border-soft);
  backdrop-filter: blur(20px);
  flex-wrap: wrap;
}

h1 {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
}

.crumb {
  margin-top: 6px;
  color: var(--muted);
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px;
  gap: 24px;
}

.workbench-tasks {
  max-width: 960px;
}

.workbench-flow-panel {
  padding-bottom: 18px;
}

.workbench-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.workbench-flow li {
  min-width: 0;
  border-right: 1px solid var(--border-soft);
}

.workbench-flow li:last-child {
  border-right: 0;
}

.workbench-flow a {
  display: block;
  min-height: 110px;
  padding: 16px;
  background: var(--surface);
  transition: background-color 160ms ease-out;
}

.workbench-flow a:hover {
  background: var(--surface-soft);
}

.workbench-flow strong,
.workbench-flow span {
  display: block;
}

.workbench-flow strong {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.workbench-flow span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

@media (max-width: 1180px) {
  .workbench-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench-flow li:nth-child(3) {
    border-right: 0;
  }

  .workbench-flow li:nth-child(-n + 3) {
    border-bottom: 1px solid var(--border-soft);
  }
}

@media (max-width: 640px) {
  .workbench-flow {
    grid-template-columns: 1fr;
  }

  .workbench-flow li,
  .workbench-flow li:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .workbench-flow li:last-child {
    border-bottom: 0;
  }

  .workbench-flow a {
    min-height: 0;
  }
}

.review-strip {
  display: none;
}

.sidebar-footer {
  display: none;
}

.control,
.btn,
.input,
.icon-btn {
  height: 40px;
  border-color: var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: none;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, background 180ms ease-out;
}

.control,
.btn {
  padding: 0 16px;
}

.account-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid var(--border-soft);
}

.account-summary {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
}

.account-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef6f5;
  color: #0f766e;
  font-size: 14px;
  font-weight: 700;
}

.account-summary > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-menu.is-settings-page {
  grid-template-columns: minmax(0, 1fr) auto;
}

.account-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.account-role {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.input {
  min-width: 256px;
  padding: 0 14px;
  color: var(--muted);
}

.control:hover,
.btn:hover,
.input:hover {
  border-color: #cfd4dc;
  background: #fbfbfc;
}

.btn.primary {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: #f1f3f5;
  color: #111827;
  font-weight: 650;
}

.actions {
  min-width: 0;
  flex-wrap: wrap;
}

.actions > * {
  flex: 0 0 auto;
}

.actions .field {
  max-width: 100%;
}

.kpi-grid {
  gap: 16px;
}

.kpi,
.panel,
.metric,
.module,
.detail-card,
.health-card {
  border-color: var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.kpi {
  min-height: 136px;
  padding: 24px;
}

.kpi-head {
  color: var(--muted);
}

.kpi-value {
  margin-top: 16px;
  font-size: 30px;
  font-weight: 650;
}

.kpi-note,
.panel-subtitle,
.muted {
  color: var(--muted);
}

.layout {
  gap: 24px;
  min-width: 0;
}

.secondary-grid {
  min-width: 0;
}

.layout > :only-child,
.secondary-grid > :only-child {
  grid-column: 1 / -1;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel-head {
  min-height: 72px;
  padding: 20px 24px;
  border-bottom-color: var(--border-soft);
}

.panel-title {
  font-size: 15px;
  font-weight: 650;
}

th,
td {
  padding: 16px 24px;
  border-bottom-color: var(--border-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

th:last-child,
td:last-child {
  width: 176px;
}

th {
  background: #fbfbfc;
  color: var(--muted);
  font-weight: 500;
}

td {
  color: #1f2937;
}

.name,
.hospital-name,
.entity-name,
.row-title,
.item-title,
.field-name,
.role-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity,
.entity > div,
.muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity .mark,
.hospital-mark,
.entity-mark {
  display: none !important;
}

.entity {
  gap: 0;
}

.pill {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 500;
}

.pill.blue {
  background: #f3f4f6;
  color: #374151;
}

.pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.pill.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.red {
  background: var(--red-soft);
  color: var(--red);
}

.row-item,
.check,
.stage,
.map-row,
.role-row,
.task {
  padding: 16px 24px;
  border-bottom-color: var(--border-soft);
}

.side-stack,
.list {
  gap: 24px;
}

.panel:has(.check-list) {
  display: none;
}

.module-grid,
.detail,
.health-grid {
  padding: 24px;
  gap: 16px;
}

.module {
  padding: 20px;
  min-height: 144px;
  background: #fbfbfc;
}

.svg-icon {
  width: 17px;
  height: 17px;
}

.field {
  height: 40px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

input.field {
  width: 280px;
}

.toolbar-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.sub-panel,
.panel-body {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.account-profile {
  display: grid;
  gap: 22px;
  border-bottom: 0;
}

.account-profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-profile-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6f5;
  color: #0f766e;
  font-size: 18px;
  font-weight: 750;
}

.account-profile-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}

.account-profile-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.account-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #ffffff;
}

.account-profile-item {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--border-soft);
}

.account-profile-item:last-child {
  border-right: 0;
}

.account-profile-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.account-profile-item strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-body {
  border-bottom: 0;
}

.table-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 4px;
}

.current-row td {
  background: #fbfbfc;
}

.current-row td:first-child {
  box-shadow: inset 2px 0 0 #111827;
}

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

.detail-card,
.stack-item {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-soft);
}

.detail-label,
.metric-key {
  color: var(--muted);
  font-size: 12px;
}

.detail-label {
  margin-bottom: 12px;
}

.metric-list,
.stack-list,
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-list {
  gap: 0;
}

.metric-row,
.stack-head,
.notice-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.metric-value {
  font-weight: 650;
  text-align: right;
  line-height: 1.4;
}

.action-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice-row {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.notice-row:last-child {
  border-bottom: 0;
}

.notice-title {
  font-weight: 650;
  line-height: 1.4;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(3px);
  z-index: 30;
}

.app-inspector {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
  z-index: 31;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.app-backdrop[hidden],
.app-inspector[hidden] {
  display: none !important;
}

.app-inspector-head,
.app-inspector-actions {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-inspector-actions {
  border-bottom: 0;
  border-top: 1px solid var(--border-soft);
  justify-content: flex-end;
}

.app-inspector-title {
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
}

.app-inspector-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.app-inspector-body {
  padding: 20px 22px;
  overflow: auto;
}

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

.inspector-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fbfbfc;
  padding: 16px;
}

.inspector-label {
  color: var(--muted);
  font-size: 12px;
}

.inspector-value {
  margin-top: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.inspector-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}

.evidence-row:first-of-type {
  border-top: 0;
}

.evidence-row .source-code-state {
  justify-content: flex-end;
  text-align: right;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

td[data-label="操作"] {
  overflow: visible;
}

td[data-label="操作"] .row-actions {
  width: 100%;
  flex-direction: column;
  align-items: flex-end;
}

td[data-label="操作"] .btn,
.row-actions .btn {
  width: min(100%, 148px);
  max-width: 148px;
  min-width: 0;
  height: auto;
  min-height: 40px;
  padding: 8px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.35;
}

.source-code-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr);
  gap: 12px;
  margin-bottom: 16px;
}

.source-code-summary > div,
.source-code-empty {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fbfbfc;
  padding: 14px;
}

.source-code-summary-label {
  color: var(--muted);
  font-size: 12px;
}

.source-code-summary-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.source-code-list {
  display: grid;
  gap: 10px;
}

.source-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #ffffff;
}

.source-code-main {
  min-width: 0;
}

.source-code-title,
.source-code-empty-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.4;
}

.source-code-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-code-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.settlement-next {
  display: grid;
  gap: 6px;
  align-items: start;
  max-width: 180px;
}

.settlement-next .btn {
  width: fit-content;
}

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

.form-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.required-mark {
  margin-left: 4px;
  color: #dc2626;
}

.form-check-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fbfbfc;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.form-check input {
  width: 16px;
  height: 16px;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 40;
  text-align: center;
  font-weight: 500;
}

.app-toast.green {
  background: rgba(15, 118, 110, 0.94);
}

.app-toast.red {
  background: rgba(159, 18, 57, 0.94);
}

.app-toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.stack-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 6px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef0f3;
  margin-top: 10px;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #111827;
}

@media (max-width: 820px) {
  .topbar {
    padding: 24px 20px 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .content {
    padding: 16px;
  }

  .input {
    min-width: 100%;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  .account-menu {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto) minmax(112px, auto);
    gap: 10px;
    padding-left: 0;
    border-left: 0;
  }

  .account-summary {
    padding: 0;
  }

  .account-menu .btn {
    width: 100%;
  }

  .account-menu.is-settings-page {
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  }

  h1 {
    font-size: 28px;
    line-height: 1.15;
  }

  .crumb {
    font-size: 14px;
    line-height: 1.5;
  }

  .actions .icon-btn {
    width: 100%;
  }

  .actions .field,
  .actions .btn {
    width: 100%;
  }

  .actions .avatar {
    display: none;
  }

  .actions .btn.primary {
    grid-column: span 2;
  }

  .kpi {
    min-height: 120px;
    padding: 22px 24px;
  }

  .kpi-head {
    align-items: flex-start;
  }

  .kpi-value {
    font-size: 38px;
  }

  .kpi-note {
    font-size: 14px;
    line-height: 1.45;
  }

  .toolbar-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .toolbar-form .field,
  .toolbar-form .btn,
  input.field {
    width: 100%;
  }

  .account-profile {
    gap: 18px;
  }

  .account-profile-grid {
    grid-template-columns: 1fr;
  }

  .account-profile-item {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .account-profile-item:last-child {
    border-bottom: 0;
  }

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

  .panel {
    overflow: hidden;
  }

  .panel-head {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .sub-panel,
  .panel-body,
  .notice-row,
  .stack-item {
    padding-left: 18px;
    padding-right: 18px;
  }

  .metric-row,
  .notice-row,
  .stack-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-value {
    text-align: left;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  tr {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
  }

  .current-row {
    box-shadow: inset 2px 0 0 #111827;
  }

  .current-row td:first-child {
    box-shadow: none;
  }

  td {
    white-space: normal;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border-bottom: 1px solid var(--border-soft);
  }

  td:last-child {
    width: auto;
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
  }

  td .btn {
    width: 100%;
  }

  .row-actions,
  .evidence-row,
  .source-code-row,
  .source-code-summary {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .source-code-state,
  .evidence-row .source-code-state {
    justify-content: flex-start;
    text-align: left;
  }

  .settlement-next,
  .settlement-next .btn {
    width: 100%;
    max-width: none;
  }

  .app-inspector {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    border-radius: 18px;
  }

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

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Taste UI polish: regulated enterprise workspace, restrained and task-first. */
body[data-shell="enterprise"] {
  background: #f6f8f9;
}

body[data-shell="enterprise"] .sidebar {
  background: #ffffff;
  border-right-color: #e5e9e8;
  backdrop-filter: none;
}

body[data-shell="enterprise"] .workspace {
  margin-bottom: 20px;
  border-radius: 10px;
  background: #f7faf9;
}

body[data-shell="enterprise"] .nav-group {
  gap: 2px;
}

body[data-shell="enterprise"] .nav-item {
  height: 44px;
  min-height: 44px;
  flex-basis: 44px;
  border-radius: 8px;
}

body[data-shell="enterprise"] .nav-item.active {
  border-left-color: #0f766e;
  background: #eef7f5;
  color: #0b5f58;
  font-weight: 650;
}

body[data-shell="enterprise"] .topbar {
  min-height: 76px;
  padding: 18px 32px;
  background: #ffffff;
  backdrop-filter: none;
}

body[data-shell="enterprise"] h1 {
  font-size: 21px;
  font-weight: 700;
}

body[data-shell="enterprise"] .crumb {
  margin-top: 4px;
  line-height: 1.45;
}

body[data-shell="enterprise"] .content {
  max-width: 1440px;
  padding: 28px 32px 40px;
  gap: 20px;
}

body[data-shell="enterprise"] .btn,
body[data-shell="enterprise"] .field {
  height: 38px;
  border-radius: 8px;
}

body[data-shell="enterprise"] .btn.primary {
  background: #0f766e;
  border-color: #0f766e;
}

body[data-shell="enterprise"] .btn:hover,
body[data-shell="enterprise"] .field:hover {
  border-color: #b7cfca;
  background: #f8fbfa;
}

body[data-shell="enterprise"] .btn.primary:hover {
  background: #0b625c;
  border-color: #0b625c;
}

body[data-shell="enterprise"] .btn:focus-visible,
body[data-shell="enterprise"] .field:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

body[data-shell="enterprise"] .kpi-grid {
  gap: 12px;
}

body[data-shell="enterprise"] .kpi,
body[data-shell="enterprise"] .panel {
  border-color: #e5e9e8;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(18, 35, 38, 0.03), 0 8px 24px rgba(18, 35, 38, 0.035);
}

body[data-shell="enterprise"] .kpi {
  min-height: 122px;
  padding: 20px;
}

body[data-shell="enterprise"] .kpi-value {
  margin-top: 12px;
  font-size: 29px;
}

body[data-shell="enterprise"] .panel-head {
  min-height: 68px;
  padding: 18px 20px;
}

body[data-shell="enterprise"] .panel-title {
  font-size: 16px;
  font-weight: 700;
}

body[data-shell="enterprise"] .sub-panel,
body[data-shell="enterprise"] .panel-body {
  padding: 14px 20px;
  background: #fbfcfc;
}

body[data-page="certification"] .certification-optional {
  border-top: 1px solid #e5e9e8;
  padding-top: 18px;
}

body[data-page="certification"] .certification-optional-summary,
body[data-page="certification"] .certification-optional-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body[data-page="certification"] .certification-optional-title {
  color: #36423f;
  font-size: 14px;
  font-weight: 700;
}

body[data-page="certification"] .certification-optional-title span {
  display: inline-block;
  margin-left: 6px;
  color: #64716d;
  font-size: 12px;
  font-weight: 600;
}

body[data-page="certification"] .certification-optional-details {
  margin-top: 14px;
  border: 1px solid #e5e9e8;
  border-radius: 10px;
  overflow: hidden;
}

body[data-page="certification"] .certification-optional-actions {
  padding: 12px 16px;
  background: #fbfcfc;
  border-bottom: 1px solid #e5e9e8;
}

body[data-page="certification"] .certification-qualification-table {
  overflow-x: auto;
}

body[data-shell="enterprise"] th,
body[data-shell="enterprise"] td {
  padding: 14px 20px;
}

body[data-shell="enterprise"] th {
  background: #f8faf9;
}

body[data-shell="enterprise"] tr:hover td {
  background: #fcfdfd;
}

body[data-page="enterprise-home"] .enterprise-hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.65fr);
  gap: 16px;
}

body[data-page="enterprise-home"] .hero-card {
  padding: 24px;
  border-color: #dfe8e6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(18, 35, 38, 0.03), 0 8px 24px rgba(18, 35, 38, 0.035);
}

body[data-page="enterprise-home"] .hero-card:first-child {
  border-left: 3px solid #0f766e;
}

body[data-page="enterprise-home"] .hero-title {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.25;
}

body[data-page="enterprise-home"] .hero-copy {
  margin-top: 10px;
  line-height: 1.65;
}

body[data-page="enterprise-home"] .hero-actions {
  margin-top: 20px;
  gap: 8px;
}

body[data-page="enterprise-home"] .hero-item {
  border-radius: 8px;
  background: #f8fbfa;
}

@media (max-width: 820px) {
  body[data-shell="enterprise"] .topbar {
    padding: 20px 18px;
  }

  body[data-shell="enterprise"] .content {
    padding: 16px;
    gap: 16px;
  }

  body[data-shell="enterprise"] .kpi {
    min-height: 112px;
    padding: 18px;
  }

  body[data-shell="enterprise"] .kpi-value {
    font-size: 32px;
  }

  body[data-shell="enterprise"] .panel-head,
  body[data-shell="enterprise"] .sub-panel,
  body[data-shell="enterprise"] .panel-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  body[data-page="certification"] .certification-optional-summary,
  body[data-page="certification"] .certification-optional-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="certification"] .certification-optional-summary .btn,
  body[data-page="certification"] .certification-optional-actions .btn {
    width: 100%;
  }

  body[data-page="enterprise-home"] .enterprise-hero {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-shell="enterprise"] *,
  body[data-shell="enterprise"] *::before,
  body[data-shell="enterprise"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
