:root {
  --ui-bg: #f4f7f6;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8faf9;
  --ui-sidebar: #ffffff;
  --ui-ink: #122a28;
  --ui-muted: #71807c;
  --ui-subtle: #95a19e;
  --ui-border: #dfe7e4;
  --ui-border-strong: #cfdad6;
  --ui-brand: #0d4943;
  --ui-brand-hover: #0a3b36;
  --ui-brand-soft: #eaf3f0;
  --ui-accent: #e86524;
  --ui-accent-hover: #cc5217;
  --ui-accent-soft: #fff1e8;
  --ui-danger: #c64638;
  --ui-warning: #b66a13;
  --ui-success: #16715d;
  --ui-radius-sm: 6px;
  --ui-radius: 10px;
  --ui-radius-lg: 14px;
  --ui-shadow-sm: 0 1px 2px rgba(17, 42, 39, 0.04);
  --ui-shadow: 0 8px 24px rgba(17, 42, 39, 0.06);
  --ui-shadow-popover: 0 18px 50px rgba(17, 42, 39, 0.16);
  --ui-sidebar-width: 248px;
  color: var(--ui-ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

html {
  background: var(--ui-bg);
}

body {
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-size: 14px;
  line-height: 1.55;
}

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

.ui-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-nav-trigger,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

.app-shell {
  grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
  background: var(--ui-bg);
}

/* Application frame */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--ui-sidebar-width);
  gap: 0;
  padding: 0 14px 18px;
  border-right: 1px solid var(--ui-border);
  background: var(--ui-sidebar);
  color: var(--ui-ink);
  box-shadow: none;
  scrollbar-color: #c9d3d0 transparent;
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #c9d3d0;
}

.brand {
  flex: 0 0 auto;
  min-height: 76px;
  margin: 0 -14px 14px;
  padding: 14px 20px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.brand::after {
  display: none;
}

.brand-mark {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--ui-accent);
}

.brand-logo {
  top: 0;
  left: -2px;
  height: 40px;
  filter: saturate(.94) contrast(1.02);
}

.brand-copy {
  gap: 0;
}

.brand-kicker {
  color: var(--ui-accent);
  font-size: 10px;
  letter-spacing: .08em;
}

.brand strong {
  color: var(--ui-ink);
  font-size: 16px;
  font-weight: 750;
}

.brand small {
  margin-top: 1px;
  color: var(--ui-muted);
  font-size: 11px;
}

.tenant-switch {
  position: relative;
  gap: 2px;
  margin: 0 2px 16px;
  padding: 11px 12px 11px 42px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-soft);
}

.tenant-switch::before {
  display: none;
}

.tenant-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--ui-brand);
  transform: translateY(-50%);
}

.tenant-switch span,
.nav-group span,
.brand small {
  color: var(--ui-muted);
}

.tenant-switch span {
  font-size: 11px;
}

.tenant-switch strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.module-nav {
  gap: 16px;
  padding-bottom: 18px;
}

.nav-group {
  gap: 3px;
}

.nav-group span {
  padding: 4px 10px 5px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #52615e;
  font-size: 14px;
  font-weight: 550;
}

.nav-item::before {
  display: none;
}

.nav-item .nav-icon {
  width: 17px;
  height: 17px;
  color: #91a09c;
}

.nav-item:hover {
  border-color: transparent;
  background: #f5f8f7;
  color: var(--ui-ink);
}

.nav-item.active {
  border-color: transparent;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  font-weight: 720;
  box-shadow: none;
}

.nav-item.active .nav-icon {
  color: var(--ui-accent);
}

.main {
  grid-column: 2;
  min-height: 100vh;
  padding: 0 30px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 64px;
  margin: 0 -30px;
  padding: 0 30px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.workspace-breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--ui-muted);
  font-size: 13px;
  white-space: nowrap;
}

.workspace-breadcrumb strong {
  overflow: hidden;
  color: #556360;
  font-weight: 600;
  text-overflow: ellipsis;
}

.workspace-breadcrumb-mark {
  color: #8b9996;
}

#moduleCrumb {
  overflow: hidden;
  color: var(--ui-ink);
  font-weight: 700;
  text-overflow: ellipsis;
}

.top-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.top-search,
.top-tool {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  color: #4e5d59;
  cursor: pointer;
}

.top-search:hover,
.top-tool:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-soft);
  color: var(--ui-ink);
}

.top-search {
  width: min(230px, 18vw);
  justify-content: flex-start;
  padding: 0 11px;
  color: var(--ui-subtle);
}

.top-search span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.top-search kbd {
  padding: 1px 5px;
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  background: #f7f9f8;
  color: var(--ui-subtle);
  font: inherit;
  font-size: 11px;
}

.top-tool {
  position: relative;
  padding: 0 11px;
  font-weight: 650;
}

.top-tool > span:first-child {
  color: #75837f;
  font-size: 16px;
}

.top-count {
  min-width: 16px;
  height: 16px;
  margin-left: -2px;
  border-radius: 99px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.user-chip {
  display: flex;
  min-width: 176px;
  max-width: 235px;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-ink);
  cursor: pointer;
  box-shadow: none;
}

.user-chip:hover,
.account-menu[open] .user-chip {
  border-color: var(--ui-border);
  background: var(--ui-surface-soft);
}

.user-avatar {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ui-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.user-avatar .ui-icon {
  width: 17px;
  height: 17px;
}

.user-chip-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 0;
}

.user-chip-copy strong,
.user-chip-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-copy strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.user-chip-copy small {
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 500;
}

.account-chevron {
  color: var(--ui-subtle);
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  z-index: 60;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--ui-shadow-popover);
}

.account-popover button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: #40504c;
  text-align: left;
  cursor: pointer;
}

.account-popover button:hover {
  background: var(--ui-surface-soft);
  color: var(--ui-ink);
}

.account-popover button:last-child {
  color: var(--ui-danger);
}

.topbar .primary-button {
  min-height: 38px;
  white-space: nowrap;
}

/* Page rhythm */
.workspace {
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
  padding-top: 28px;
}

.page-heading-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 90px;
  padding: 0 2px 18px;
  border-bottom: 1px solid var(--ui-border);
}

.page-heading-shell .eyebrow {
  margin: 0 0 5px;
  color: var(--ui-accent);
  font-size: 12px;
  font-weight: 750;
}

.page-heading-shell h1 {
  color: var(--ui-ink);
  font-size: clamp(25px, 2vw, 32px);
  font-weight: 760;
  letter-spacing: -.025em;
}

.page-heading-description {
  margin-top: 6px;
  color: var(--ui-muted);
  font-size: 14px;
}

.page-updated {
  flex: 0 0 auto;
  margin-top: 24px;
  color: var(--ui-subtle);
  font-size: 12px;
}

.page-updated::before {
  margin-right: 6px;
  color: var(--ui-success);
  content: "●";
  font-size: 8px;
}

.subnav {
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
}

.subnav button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  background: transparent;
  color: var(--ui-muted);
  box-shadow: none;
}

.subnav button:hover:not(.active):not(:disabled) {
  border: 0;
  background: var(--ui-surface-soft);
  color: var(--ui-ink);
}

.subnav button.active {
  border: 0;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  box-shadow: none;
}

.page-content {
  gap: 18px;
  padding-bottom: 32px;
}

/* Components */
.decision-head,
.sales-page-heading {
  min-height: 112px;
  align-items: center;
  padding: 24px 26px;
  border: 0;
  border-radius: 12px;
  background: var(--ui-brand);
  color: #fff;
  box-shadow: none;
}

.decision-head::after {
  position: absolute;
  right: 30px;
  bottom: -30px;
  color: rgba(255, 255, 255, .035);
  content: "SCRM";
  font-size: 88px;
  font-weight: 800;
  letter-spacing: -.08em;
  pointer-events: none;
}

.decision-head,
.sales-page-heading {
  position: relative;
  overflow: hidden;
}

.decision-head h2,
.sales-page-heading h2 {
  color: #fff;
  font-size: 25px;
  letter-spacing: -.02em;
}

.decision-head p,
.sales-page-heading p {
  color: rgba(255, 255, 255, .72);
}

.decision-kicker,
.sales-page-heading span {
  color: #ffb37c;
  font-size: 12px;
}

.sales-page-heading > strong,
.decision-actions span {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.dashboard-toolbar,
.panel,
.feature-card,
.filter-workbench,
.lead-filter-panel,
.notice-banner,
.metric-band,
.kpi {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.panel,
.feature-card,
.filter-workbench,
.lead-filter-panel,
.notice-banner {
  border-radius: var(--ui-radius);
}

.panel {
  padding: 20px;
}

.panel-head {
  margin-bottom: 15px;
}

.panel-head h2 {
  color: var(--ui-ink);
  font-size: 16px;
  font-weight: 730;
}

.panel-head p,
.panel-note,
.kpi span,
.kpi small,
.feature-card p,
.metric-band span {
  color: var(--ui-muted);
}

.kpi-grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: #fff;
}

.kpi {
  min-height: 135px;
  border: 0;
  border-right: 1px solid var(--ui-border);
  border-radius: 0;
  padding: 22px;
  box-shadow: none;
}

.kpi:last-child {
  border-right: 0;
}

.kpi:hover,
.feature-card:hover {
  transform: none;
}

.kpi strong {
  color: var(--ui-ink);
  font-size: 30px;
  letter-spacing: -.03em;
}

.kpi em {
  color: var(--ui-accent);
  font-style: normal;
}

.split-layout {
  gap: 18px;
}

.metric-band {
  gap: 0;
  overflow: hidden;
  border-radius: var(--ui-radius);
}

.metric-band div {
  min-height: 92px;
  border-right: 1px solid var(--ui-border);
  background: #fff;
}

.metric-band div:last-child {
  border-right: 0;
}

.metric-band div:hover {
  background: var(--ui-surface-soft);
  transform: none;
}

.metric-band strong {
  color: var(--ui-ink);
  letter-spacing: -.02em;
}

.decision-funnel,
.action-grid,
.risk-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

.funnel-step,
.action-grid article,
.risk-item {
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.funnel-step:last-child,
.action-grid article:last-child,
.risk-item:last-child {
  border-bottom: 0;
}

.funnel-step:hover,
.action-grid article:hover,
.risk-item:hover {
  background: var(--ui-surface-soft);
}

.funnel-step > span,
.risk-item > span {
  border-radius: 6px;
}

.risk-item.high > span {
  background: #fee9e5;
  color: var(--ui-danger);
}

.risk-item.medium > span {
  background: #fff3dc;
  color: var(--ui-warning);
}

.notice-banner,
.integration-notice {
  padding: 13px 15px;
  border-left: 3px solid var(--ui-accent);
  background: #fffaf6;
  color: #5e554d;
  box-shadow: none;
}

.feature-grid {
  gap: 14px;
}

.feature-card {
  padding: 18px;
}

.feature-card strong {
  color: var(--ui-ink);
}

/* Tables */
.data-table {
  overflow: auto;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  scrollbar-color: #c5d0cd transparent;
  scrollbar-width: thin;
}

.table-row {
  min-height: 54px;
  border-bottom: 1px solid #e8eeec;
  background: #fff;
  color: #354540;
}

.table-row:hover:not(.table-head) {
  background: #f8faf9;
}

.table-row.table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 43px;
  background: #f1f6f4;
  color: #65736f;
  font-size: 12px;
  font-weight: 700;
}

.table-row > * {
  padding: 11px 13px;
}

.data-table .table-row strong {
  color: var(--ui-ink);
}

.data-table .table-row small {
  margin-top: 2px;
  color: var(--ui-muted);
}

.row-actions {
  gap: 9px;
}

.badge {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.badge:not(.danger):not(.warn) {
  background: #e7f4ef;
  color: var(--ui-success);
}

.badge.warn {
  background: #fff0e6;
  color: #b5551d;
}

.badge.danger {
  background: #fdeae6;
  color: var(--ui-danger);
}

/* Forms and actions */
.primary-button,
.ghost-button,
.icon-button,
.text-button {
  font-weight: 650;
}

.primary-button {
  border: 1px solid var(--ui-accent);
  border-radius: 7px;
  background: var(--ui-accent);
  box-shadow: none;
}

.primary-button:hover {
  border-color: var(--ui-accent-hover);
  background: var(--ui-accent-hover);
  box-shadow: none;
}

.ghost-button,
.icon-button {
  border-color: var(--ui-border-strong);
  border-radius: 7px;
  background: #fff;
  color: #3d4d49;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: #bbc9c5;
  background: var(--ui-surface-soft);
  color: var(--ui-ink);
}

.text-button {
  color: var(--ui-brand);
  text-decoration: none;
}

.text-button:hover {
  color: var(--ui-accent-hover);
  text-decoration: none;
}

.segmented-control {
  padding: 3px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  background: #f7f9f8;
}

.segmented-control button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ui-muted);
}

.segmented-control button.active {
  background: #fff;
  color: var(--ui-brand);
  box-shadow: 0 1px 3px rgba(17, 42, 39, .09);
}

input,
select,
textarea,
.modal input,
.modal select,
.modal textarea,
.field-label input,
.field-label select,
.field-label textarea {
  border-color: var(--ui-border-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ui-ink);
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebdb8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px rgba(13, 73, 67, .11);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(13, 73, 67, .45);
  outline-offset: 2px;
  box-shadow: none;
}

.lead-filter-panel,
.filter-workbench {
  padding: 16px;
  background: #fbfcfc;
}

.lead-filter-grid label > span,
.modal label,
.field-label {
  color: #53625e;
  font-size: 12px;
  font-weight: 650;
}

.lead-filter-actions {
  border-top-color: var(--ui-border);
}

/* Modal and drawer */
.modal-backdrop {
  background: rgba(18, 31, 29, .42);
  backdrop-filter: blur(2px);
}

.modal {
  width: min(620px, calc(100vw - 32px));
  overflow-x: hidden;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(17, 42, 39, .24);
}

.modal.wide-modal {
  width: min(960px, calc(100vw - 32px));
}

.modal-head {
  position: sticky;
  top: -20px;
  z-index: 5;
  margin: -20px 0 18px;
  padding: 18px 0 15px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, .98);
}

.modal-head h2 {
  color: var(--ui-ink);
  font-size: 20px;
}

.modal-context {
  color: var(--ui-muted);
}

.modal-actions {
  margin: 18px -22px -22px;
  padding: 14px 22px;
  border-top: 1px solid var(--ui-border);
  background: #fafbfb;
}

.detail-drawer {
  width: min(720px, 52vw);
  border-left: 1px solid var(--ui-border);
  background: #f7f9f8;
  box-shadow: -18px 0 60px rgba(17, 42, 39, .14);
}

.drawer-head {
  min-height: 70px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, .97);
}

.drawer-head h2 {
  color: var(--ui-ink);
}

.drawer-content {
  gap: 12px;
  padding: 16px;
}

.drawer-section {
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
}

.lead-drawer-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
}

.lead-drawer-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
}

.lead-drawer-tabs button.active {
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.toast {
  top: 78px;
  bottom: auto;
  left: 50%;
  min-width: 280px;
  max-width: min(560px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: #153d38;
  color: #fff;
  box-shadow: var(--ui-shadow-popover);
  transform: translate(-50%, -16px);
}

.toast.show {
  transform: translate(-50%, 0);
}

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

/* Responsive shell */
@media (max-width: 1280px) {
  :root { --ui-sidebar-width: 218px; }
  .main { padding-right: 22px; padding-left: 22px; }
  .topbar { margin-right: -22px; margin-left: -22px; padding-right: 22px; padding-left: 22px; }
  .top-search { width: 42px; }
  .top-search span:nth-child(2), .top-search kbd, .top-tool > span:nth-child(2) { display: none; }
  .top-tool { width: 40px; justify-content: center; padding: 0; }
  .user-chip { min-width: 150px; }
}

@media (max-width: 980px) {
  :root { --ui-sidebar-width: 196px; }
  .brand { padding-right: 12px; padding-left: 12px; }
  .brand small, .brand-kicker { display: none; }
  .topbar { min-height: 58px; }
  .workspace-breadcrumb strong, .workspace-breadcrumb > span:nth-of-type(2) { display: none; }
  .user-chip { min-width: 42px; width: 42px; }
  .user-chip-copy, .account-chevron { display: none; }
  .topbar .primary-button { padding: 0 11px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-child(-n + 2) { border-bottom: 1px solid var(--ui-border); }
  .detail-drawer { width: min(760px, calc(100vw - 48px)); }
}

@media (max-width: 720px) {
  :root { --ui-sidebar-width: 0px; }
  .app-shell { display: block; }
  body.mobile-nav-open { overflow: hidden; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 42;
    width: min(86vw, 336px);
    height: 100dvh;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 14px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--ui-border);
    border-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    box-shadow: 20px 0 56px rgba(17, 42, 39, .18);
    transform: translateX(-100%);
    transition: transform 180ms ease, visibility 180ms ease;
  }
  body.mobile-nav-open .sidebar {
    visibility: visible;
    transform: translateX(0);
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(9, 31, 29, .48);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
  }
  body.mobile-nav-open .mobile-nav-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .mobile-nav-close {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: #fff;
    color: var(--ui-ink);
  }
  body.mobile-nav-open .mobile-nav-close { display: grid; }
  .brand {
    min-width: 0;
    min-height: 78px;
    margin: 0 -14px 14px;
    padding: max(16px, env(safe-area-inset-top)) 64px 14px 20px;
    border-bottom: 1px solid var(--ui-border);
  }
  .brand-mark { flex-basis: 40px; width: 40px; height: 40px; }
  .brand-logo { height: 40px; }
  .brand-copy { display: grid; }
  .brand-kicker { display: block; }
  .tenant-switch { display: grid; }
  .module-nav {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0;
    padding: 0 0 18px;
    overflow: visible;
  }
  .nav-group {
    display: grid;
    flex: none;
    width: 100%;
    gap: 3px;
  }
  .nav-group > span { display: block; }
  .nav-item {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    white-space: normal;
  }
  .nav-item .nav-icon { width: 19px; height: 19px; }
  .main { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 24;
    display: flex;
    min-height: 60px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin: 0 -14px;
    padding: 8px 14px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .mobile-nav-trigger {
    display: inline-flex;
    min-width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: #fff;
    color: var(--ui-ink);
    font-weight: 700;
  }
  .mobile-nav-trigger span { display: none; }
  .workspace-breadcrumb { display: flex; flex: 1 1 auto; }
  .workspace-breadcrumb > strong,
  .workspace-breadcrumb > span:not(#moduleCrumb),
  .workspace-breadcrumb-mark { display: none; }
  #moduleCrumb { display: block; max-width: 38vw; font-size: 14px; }
  .top-actions {
    display: flex;
    width: auto;
    align-items: center;
    flex: 0 0 auto;
    grid-template-columns: none;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .top-search, .top-tool.independent-window-button { display: none; }
  .top-tool.todo-button {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
  }
  .top-tool.todo-button > span { display: none; }
  .top-tool.todo-button .top-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border: 2px solid #fff;
    line-height: 14px;
  }
  .user-chip {
    display: grid;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    grid-column: auto;
    place-items: center;
    padding: 0;
  }
  .user-avatar { flex-basis: 32px; width: 32px; height: 32px; }
  .user-chip-copy, .account-chevron { display: none; }
  .account-popover { position: fixed; top: 58px; right: 12px; }
  .topbar .primary-button {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 28;
    width: auto;
    min-height: 48px;
    grid-column: auto;
    margin: 0;
    padding: 0 18px;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(204, 82, 23, .2);
  }
  .topbar .primary-button:disabled { display: none; }
  .workspace { padding-top: 16px; }
  .page-heading-shell { min-height: 70px; padding-bottom: 12px; }
  .page-heading-shell h1 { font-size: 23px; }
  .page-heading-description, .page-updated { display: none; }
  .subnav {
    flex-wrap: nowrap;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    margin: 0 -14px;
    padding: 4px 14px;
    overflow-x: auto;
    scroll-padding-inline: 14px;
  }
  .subnav button { flex: 0 0 auto; min-height: 44px; }
  .decision-head, .sales-page-heading { min-height: auto; padding: 20px; }
  .decision-head h2, .sales-page-heading h2 { font-size: 21px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--ui-border); }
  .kpi:last-child { border-bottom: 0; }
  .detail-drawer { width: 100vw; }
  .modal { border-radius: 12px 12px 0 0; }
  .forensic-watermark {
    inset: -20vh -80vw;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    grid-auto-rows: 210px;
    color: rgba(174, 73, 29, .045);
  }
  .forensic-watermark[data-level="high"] { color: rgba(174, 73, 29, .06); }
  .forensic-watermark__item { width: 250px; font-size: 10px; }
}

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

@media print {
  .sidebar,
  .topbar,
  .subnav,
  .page-updated {
    display: none !important;
  }
  .main {
    display: block;
    padding: 0;
  }
  .page-heading-shell {
    min-height: auto;
  }
}
