:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-muted: #f8faf9;
  --border: #dfe5e2;
  --border-strong: #c9d2ce;
  --text: #17211d;
  --muted: #68736e;
  --muted-light: #8c9792;
  --green: #197451;
  --green-dark: #105c3f;
  --green-soft: #e6f3ed;
  --blue: #2d6fc2;
  --blue-soft: #e9f1fb;
  --amber: #b56b12;
  --amber-soft: #fbf0dd;
  --violet: #7554a6;
  --violet-soft: #f0ebf7;
  --red: #bc4b48;
  --red-soft: #faeaea;
  --shadow: 0 12px 36px rgba(24, 39, 32, 0.12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}

body.auth-pending .app-shell,
body.auth-guest .app-shell,
body.auth-authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
  background: #eef2f0;
}

.auth-layout {
  width: min(920px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px;
  background: #17211d;
  color: #ffffff;
}

.auth-brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 64px;
}

.auth-brand-line .brand-mark {
  background: #ffffff;
  color: var(--text);
}

.auth-brand-line strong,
.auth-brand-line span {
  display: block;
}

.auth-brand-line strong {
  font-size: 15px;
}

.auth-brand-line span {
  margin-top: 2px;
  color: #aebbb5;
  font-size: 10px;
  text-transform: uppercase;
}

.auth-brand-block h1 {
  max-width: 360px;
  margin: 0;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: 0;
}

.auth-brand-block > p {
  max-width: 360px;
  margin: 18px 0 0;
  color: #bac5c0;
  font-size: 15px;
  line-height: 1.8;
}

.auth-security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  color: #aebbb5;
  font-size: 13px;
}

.auth-security-note svg {
  width: 17px;
  height: 17px;
  color: #76c5a4;
}

.auth-panel {
  padding: 42px 46px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 6px;
  background: var(--surface-muted);
}

.auth-mode-tabs button {
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.auth-mode-tabs button.is-selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(24, 39, 32, 0.1);
}

.auth-form {
  margin-top: 38px;
}

.auth-form-heading {
  margin-bottom: 28px;
}

.auth-form-heading h2 {
  margin: 0;
  font-size: 22px;
}

.auth-form-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-form label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.auth-form input:focus {
  border-color: var(--green);
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 26px;
}

.auth-error {
  margin: 14px 0 0;
  color: var(--red);
  font-size: 13px;
}

.auth-success {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #bcdccb;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.5;
}

.auth-success svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(25, 116, 81, 0.18);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 224px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 34px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 650;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sidebar-meta strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.meta-label {
  color: var(--muted-light);
}

.main-content {
  min-width: 0;
  margin-left: 224px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.data-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-control {
  position: relative;
}

.account-menu-button {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.account-menu-button > svg {
  width: 15px;
  color: var(--muted-light);
}

.account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
}

.account-avatar svg {
  width: 16px;
  height: 16px;
}

.account-button-copy {
  min-width: 76px;
  text-align: left;
}

.account-button-copy strong,
.account-button-copy small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button-copy strong {
  font-size: 12px;
}

.account-button-copy small {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 220px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-menu-summary {
  padding: 10px 11px 12px;
  border-bottom: 1px solid var(--border);
}

.account-menu-summary span,
.account-menu-summary strong {
  display: block;
}

.account-menu-summary span {
  color: var(--muted-light);
  font-size: 10px;
}

.account-menu-summary strong {
  margin-top: 4px;
  font-size: 13px;
}

.account-menu button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.account-menu button:hover {
  background: var(--surface-muted);
}

.account-menu button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
}

.button {
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
}

.button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  background: var(--green);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.button-secondary:hover,
.icon-button:hover {
  background: var(--surface-muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.page-wrap {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 32px 30px 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.page-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.heading-stamp {
  min-width: 180px;
  padding-left: 18px;
  border-left: 2px solid var(--green);
}

.heading-stamp span,
.heading-stamp strong {
  display: block;
}

.heading-stamp span {
  margin-bottom: 4px;
  color: var(--muted-light);
  font-size: 11px;
}

.heading-stamp strong {
  font-size: 13px;
}

.overview-heading-tools {
  display: flex;
  align-items: center;
  gap: 22px;
}

.overview-region-control span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.overview-region-control select {
  min-width: 112px;
}

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

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

.overview-kpi-grid > .kpi-card {
  grid-column: auto;
}

.kpi-card {
  position: relative;
  min-width: 0;
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.kpi-link-card {
  appearance: none;
  color: inherit;
  text-align: left;
}

.kpi-link-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 5px 18px rgba(24, 39, 32, 0.08);
  transform: translateY(-1px);
}

.kpi-link-card:active {
  box-shadow: none;
  transform: translateY(0);
}

.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

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

.kpi-green { background: var(--green-soft); color: var(--green); }
.kpi-blue { background: var(--blue-soft); color: var(--blue); }
.kpi-amber { background: var(--amber-soft); color: var(--amber); }
.kpi-violet { background: var(--violet-soft); color: var(--violet); }
.kpi-red { background: var(--red-soft); color: var(--red); }

.kpi-label {
  display: block;
  max-width: calc(100% - 42px);
  color: var(--muted);
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin-top: 17px;
  overflow: hidden;
  color: var(--text);
  font-size: 25px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.panel {
  min-width: 0;
  min-height: 360px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.panel-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h2,
.section-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.panel-header p,
.section-title p {
  margin: 5px 0 0;
  color: var(--muted-light);
  font-size: 11px;
}

.achievement-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

.legend-actual {
  width: 14px;
  height: 5px;
  border-radius: 3px;
  background: var(--green);
}

.legend-target {
  width: 2px;
  height: 14px;
  margin-left: 4px;
  background: var(--amber);
}

.legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.legend-line {
  width: 15px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
}

.achievement-chart {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.achievement-row {
  display: grid;
  grid-template-columns: minmax(400px, 1.35fr) minmax(200px, 1fr) 86px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.achievement-name {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: visible;
  font-size: 12px;
  font-weight: 600;
}

.achievement-name-text {
  flex: 0 0 auto;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.achievement-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.project-avatar.type-new,
.achievement-avatar.type-new {
  background: var(--blue-soft);
  color: var(--blue);
}

.project-avatar.type-renew,
.achievement-avatar.type-renew {
  background: var(--amber-soft);
  color: var(--amber);
}

.project-avatar.type-second,
.achievement-avatar.type-second {
  background: var(--violet-soft);
  color: var(--violet);
}

.project-avatar.type-empower,
.achievement-avatar.type-empower {
  background: var(--green-soft);
  color: var(--green-dark);
}

.bar-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1ef;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.target-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  transform: translateX(-1px);
  border-radius: 1px;
  background: var(--amber);
}

.bar-fill.missing {
  width: 4px !important;
  background: var(--border-strong);
}

.achievement-value {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.achievement-value strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.trend-chart {
  position: relative;
  width: 100%;
  height: 264px;
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.trend-chart svg {
  width: var(--chart-width, 100%);
  min-width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-gridline {
  stroke: #e8edeb;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(25, 116, 81, 0.08);
}

.chart-point {
  fill: #ffffff;
  stroke: var(--green);
  stroke-width: 2;
}

.chart-label {
  fill: var(--muted-light);
  font-size: 10px;
}

.chart-axis-label {
  fill: var(--muted-light);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-data-label {
  fill: var(--text);
  stroke: #ffffff;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.stage-band,
.project-table-section {
  margin-top: 28px;
}

.project-list-page .project-table-section {
  margin-top: 0;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stage-item {
  min-height: 132px;
  padding: 16px 18px 14px;
  border-right: 1px solid var(--border);
}

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

.stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.stage-heading {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 10px;
}

.stage-heading span {
  color: var(--muted);
  font-size: 12px;
}

.stage-heading strong {
  font-size: 21px;
}

.attention-list {
  display: grid;
  gap: 8px;
  max-height: 168px;
  margin: 14px 0 0 19px;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
}

.attention-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.attention-project strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-project span,
.attention-empty {
  color: var(--muted-light);
  font-size: 11px;
  white-space: nowrap;
}

.attention-empty {
  list-style: none;
}

.stage-pending .stage-dot { background: var(--muted-light); }
.stage-progress .stage-dot { background: var(--green); }
.stage-watch .stage-dot { background: var(--amber); }
.stage-lagging .stage-dot { background: var(--red); }
.stage-closed .stage-dot { background: var(--blue); }

.table-title-row {
  align-items: flex-end;
  margin-bottom: 13px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 236px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-light);
}

.search-box svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

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

select {
  min-height: 36px;
  padding: 0 31px 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
  contain: paint;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

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

.project-table {
  min-width: 1930px;
}

th,
td {
  height: 58px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  height: 42px;
  background: var(--surface-muted);
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fbfcfb;
}

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

.project-table th:nth-child(1) { width: 260px; }
.project-table th:nth-child(2) { width: 96px; }
.project-table th:nth-child(3) { width: 100px; }
.project-table th:nth-child(4) { width: 124px; }
.project-table th:nth-child(5) { width: 120px; }
.project-table th:nth-child(6) { width: 96px; }
.project-table th:nth-child(7) { width: 68px; }
.project-table th:nth-child(8) { width: 96px; }
.project-table th:nth-child(9) { width: 112px; }
.project-table th:nth-child(10) { width: 116px; }
.project-table th:nth-child(11) { width: 92px; }
.project-table th:nth-child(12) { width: 84px; }
.project-table th:nth-child(13) { width: 138px; }
.project-table th:nth-child(14) { width: 118px; }
.project-table th:nth-child(15) { width: 230px; }
.project-table th:nth-child(16) { width: 84px; }

.project-note-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
}

.project-note-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-note-preview.is-empty {
  color: var(--muted-light);
}

.project-note-edit {
  width: 30px;
  height: 30px;
}

.project-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.delete-project-button {
  color: var(--red);
}

.delete-project-button:hover {
  border-color: color-mix(in srgb, var(--red) 28%, var(--border));
  background: var(--red-soft);
  color: var(--red);
}

.align-right {
  text-align: right;
}

.project-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.project-name-copy {
  min-width: 0;
}

.project-name-copy strong,
.project-name-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name-copy strong {
  color: var(--text);
  font-size: 12px;
}

.project-name-copy span {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 10px;
}

.money,
.metric-number {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.muted-value {
  color: var(--muted-light);
}

.mini-progress {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 8px;
}

.mini-progress .bar-track {
  height: 5px;
}

.mini-progress span {
  color: var(--text);
  font-size: 10px;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-待入场 { background: #edf0ef; color: var(--muted); }
.status-待入场::before { background: var(--muted-light); }
.status-推进中 { background: var(--green-soft); color: var(--green-dark); }
.status-推进中::before { background: var(--green); }
.status-已完结 { background: var(--blue-soft); color: var(--blue); }
.status-已完结::before { background: var(--blue); }
.status-暂停 { background: var(--amber-soft); color: var(--amber); }
.status-暂停::before { background: var(--amber); }
.status-非联营项目 { background: var(--violet-soft); color: var(--violet); }
.status-非联营项目::before { background: var(--violet); }

.project-status-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.status-date-note {
  color: var(--amber);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.attention-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: 1px;
}

.attention-tag-long-entry {
  background: var(--amber-soft);
  color: var(--amber);
}

.attention-tag-lagging {
  background: var(--red-soft);
  color: var(--red);
}

.row-action {
  width: 30px;
  height: 30px;
  border: 0;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(520px, 100vw);
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 94px;
  padding: 23px 24px;
  border-bottom: 1px solid var(--border);
}

.drawer-kicker,
.dialog-header span {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.drawer-header h2,
.dialog-header h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.drawer-body {
  height: calc(100vh - 94px);
  overflow-y: auto;
  padding: 22px 24px 36px;
}

.drawer-edit-form {
  display: grid;
  gap: 18px;
}

.drawer-edit-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-edit-heading span,
.drawer-edit-heading small {
  display: block;
}

.drawer-edit-heading span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.drawer-edit-heading small {
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 10px;
}

.drawer-edit-heading .button {
  min-height: 32px;
  font-size: 11px;
}

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

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

.drawer-edit-grid label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.drawer-edit-grid input,
.drawer-edit-grid select,
.drawer-edit-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.drawer-edit-grid textarea {
  min-height: 88px;
  padding-top: 9px;
  line-height: 1.5;
  resize: vertical;
}

.drawer-edit-grid .drawer-field-wide {
  grid-column: 1 / -1;
}

.drawer-derived-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.drawer-derived-grid > div {
  min-height: 78px;
  padding: 13px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.drawer-derived-grid span,
.drawer-derived-grid strong {
  display: block;
}

.drawer-derived-grid span {
  color: var(--muted-light);
  font-size: 10px;
}

.drawer-derived-grid strong {
  margin-top: 9px;
  color: var(--text);
  font-size: 15px;
}

.drawer-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.drawer-status-line .button {
  min-height: 34px;
}

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

.drawer-metric {
  min-height: 96px;
  padding: 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.drawer-metric span,
.detail-row span {
  display: block;
  color: var(--muted-light);
  font-size: 10px;
}

.drawer-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 19px;
}

.detail-section {
  margin-top: 26px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 13px;
}

.trend-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trend-section-heading h3 {
  margin-bottom: 0;
}

.trend-section-heading select {
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 11px;
}

.detail-list {
  border-top: 1px solid var(--border);
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

.detail-row strong {
  max-width: 65%;
  overflow: hidden;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-row-note {
  align-items: flex-start;
  padding: 13px 0;
}

.detail-row-note strong {
  overflow: visible;
  line-height: 1.55;
  text-align: right;
  text-overflow: clip;
  white-space: normal;
}

.owner-list {
  display: grid;
  gap: 8px;
}

.owner-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.owner-row .project-avatar {
  width: 26px;
  height: 26px;
}

.owner-row strong {
  font-size: 12px;
}

.owner-row span {
  color: var(--muted-light);
  font-size: 10px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(14, 20, 17, 0.35);
}

.metric-dialog {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-dialog::backdrop {
  background: rgba(14, 20, 17, 0.42);
}

.metric-dialog form {
  margin: 0;
}

.project-note-dialog {
  width: min(560px, calc(100vw - 32px));
}

.project-note-field {
  display: block;
  padding: 22px 24px 8px;
}

.project-note-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.project-note-field textarea {
  width: 100%;
  min-height: 150px;
  padding: 11px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

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

.form-grid label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.form-grid label > span em {
  color: var(--amber);
  font-style: normal;
  font-weight: 500;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.input-prefix {
  display: flex;
  align-items: center;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.input-prefix b {
  padding-left: 11px;
  color: var(--muted-light);
  font-size: 12px;
}

.input-prefix input {
  min-width: 0;
  border: 0;
}

.formula-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 24px 18px;
  padding: 11px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #7d541d;
  font-size: 11px;
  line-height: 1.5;
}

.formula-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.dialog-actions {
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 246, 0.86);
  backdrop-filter: blur(6px);
}

.upload-overlay[hidden] {
  display: none;
}

.upload-state {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.upload-state strong {
  color: var(--text);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(480px, calc(100vw - 32px));
  padding: 11px 15px;
  border-radius: 6px;
  background: var(--text);
  color: #ffffff;
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: #8e302f;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 210px;
  color: var(--muted-light);
  font-size: 12px;
}

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

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

.account-section {
  padding: 0;
}

.account-section .section-title {
  padding: 20px 22px 16px;
}

.account-create-dialog {
  width: min(620px, calc(100vw - 32px));
}

.dialog-form-error {
  margin: -6px 24px 18px;
}

.account-table,
.account-log-table {
  min-width: 900px;
}

.account-table td,
.account-log-table td {
  vertical-align: middle;
}

.account-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.account-status-active,
.login-result-success {
  background: var(--green-soft);
  color: var(--green-dark);
}

.account-status-disabled,
.login-result-failed {
  background: var(--red-soft);
  color: var(--red);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-actions .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.account-log-scroll {
  max-height: 520px;
  overflow: auto;
}

.account-device {
  display: block;
  max-width: 330px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-note {
  display: block;
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 10px;
}

.muted-text {
  color: var(--muted-light);
}

.login-result-success,
.login-result-failed {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.mobile-only {
  display: none;
}

[hidden] {
  display: none !important;
}

body.is-viewer [data-admin-only] {
  display: none !important;
}

body.is-not-admin [data-account-admin-only] {
  display: none !important;
}

.account-role-select {
  min-width: 96px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.account-real-name-input {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.account-real-name-input:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 16%, transparent);
}

.account-scope-label { display: inline-block; margin-right: 8px; color: var(--ink); }
.account-scope-button { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.account-scope-dialog { width: min(680px, calc(100vw - 40px)); }
.account-scope-multi { min-height: 92px; padding: 8px 10px; }
.account-scope-multi option { padding: 4px 6px; }
.account-scope-picker { position: relative; }
.account-scope-picker .multi-select-menu { width: 100%; max-height: 260px; overflow: auto; }
.account-scope-search { width: calc(100% - 20px); margin: 8px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }

.schedule-toolbar { padding: 14px 18px; }
.schedule-section { padding: 18px; }
.schedule-calendar { min-width: 0; overflow-x: auto; }
.schedule-weekdays, .schedule-month-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 6px; }
.schedule-weekdays { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.schedule-weekdays span { padding: 0 8px; }
.schedule-day { min-height: 126px; border: 1px solid var(--border); border-radius: 7px; background: #fbfcfc; padding: 8px; }
.schedule-day.is-adjacent { opacity: .5; background: var(--surface-muted); }
.schedule-day-number { display: flex; justify-content: space-between; color: var(--text); font-weight: 700; margin-bottom: 6px; }
.schedule-day-number small { color: var(--muted); font-weight: 500; }
.schedule-empty { display: block; padding-top: 23px; color: #a8b6b2; text-align: center; font-size: 12px; }
.schedule-event { display: block; width: 100%; margin: 5px 0 0; padding: 6px 7px; border: 0; border-radius: 5px; text-align: left; font-size: 11px; line-height: 1.3; cursor: pointer; }
.schedule-event strong, .schedule-event small { display: block; }
.schedule-event small { margin-top: 2px; opacity: .8; }
.schedule-event-project { background: #e2f3ed; color: #116c58; }
.schedule-event-visit { background: #e8f0fb; color: #315b91; }
.schedule-event-presale { background: #fff1d9; color: #946315; }
.schedule-event-training { background: #eeeafa; color: #6657a0; }
.schedule-event-other { background: #edf0ef; color: #596865; }
.schedule-readonly-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.schedule-dialog { width: min(620px, calc(100vw - 40px)); }
.schedule-matrix { display: grid; grid-template-columns: 150px repeat(var(--schedule-days), minmax(112px, 1fr)); min-width: max-content; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.schedule-matrix-corner, .schedule-matrix-date, .schedule-matrix-person, .schedule-matrix-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.schedule-matrix-corner { display: flex; min-height: 58px; align-items: center; padding: 8px 10px; background: var(--surface-muted); color: var(--muted); font-size: 12px; font-weight: 700; }
.schedule-matrix-date { display: flex; min-height: 58px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: var(--surface-muted); color: var(--text); }
.schedule-matrix-date strong { font-size: 16px; }
.schedule-matrix-date small { color: var(--muted); font-size: 10px; }
.schedule-matrix-date.is-adjacent { opacity: .55; }
.schedule-matrix-person { display: flex; min-height: 64px; align-items: center; padding: 8px 10px; background: var(--surface-muted); color: var(--text); font-size: 12px; font-weight: 700; }
.schedule-matrix-cell { display: flex; min-height: 64px; flex-direction: column; align-items: stretch; justify-content: center; gap: 3px; padding: 4px 6px; background: var(--surface); }
.schedule-matrix-date.is-non-workday, .schedule-matrix-cell.is-non-workday { background: #f3f6f5; }
.schedule-matrix-date.is-non-workday { color: #687a73; }
.schedule-matrix-date em, .schedule-non-workday-label { display: block; color: #8a9993; font-size: 10px; font-style: normal; }
.schedule-non-workday-label { align-self: center; margin-bottom: 1px; }
.schedule-matrix-cell .schedule-empty { padding-top: 0; text-align: center; }
.schedule-matrix-empty { grid-column: 2 / -1; padding: 30px; color: var(--muted); text-align: center; }
.schedule-people-picker { position: relative; }
.schedule-person-trigger { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.schedule-person-trigger[aria-expanded="true"] { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33, 132, 103, .14); }
.schedule-people-menu { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; right: 0; max-height: 250px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 26px rgba(24, 38, 34, .16); }
.schedule-person-option { display: flex; min-height: 34px; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 5px; color: var(--text); font-size: 13px; cursor: pointer; }
.schedule-person-option:hover { background: var(--surface-muted); }
.schedule-person-option input { accent-color: var(--green); }
.schedule-date-range-picker { position: relative; }
.schedule-date-range-trigger { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.schedule-date-range-trigger::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .65; }
.schedule-date-range-trigger[aria-expanded="true"] { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33, 132, 103, .14); }
.schedule-date-picker { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; width: min(390px, calc(100vw - 72px)); padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 14px 30px rgba(24, 38, 34, .18); }
.schedule-picker-header { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; margin-bottom: 10px; text-align: center; }
.schedule-picker-header strong { font-size: 15px; }
.schedule-picker-nav { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 23px; line-height: 1; cursor: pointer; }
.schedule-picker-nav:hover { background: var(--surface-muted); }
.schedule-picker-weekdays, .schedule-picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.schedule-picker-weekdays { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.schedule-picker-day { display: flex; min-height: 38px; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.schedule-picker-day.is-adjacent { color: var(--muted-light); }
button.schedule-picker-day:hover { background: var(--surface-muted); }
.schedule-picker-day.is-range { border-radius: 0; background: rgba(33, 132, 103, .12); }
.schedule-picker-day.is-start, .schedule-picker-day.is-end { border-radius: 5px; background: var(--green); color: #fff; font-weight: 700; }
.schedule-picker-day.is-empty { cursor: default; }
.schedule-picker-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.schedule-project-combobox { position: relative; }
.schedule-project-suggestions { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); box-shadow: 0 10px 24px rgba(24, 38, 34, .16); }
.schedule-project-suggestion { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.schedule-project-suggestion:hover, .schedule-project-suggestion:focus-visible { background: var(--surface-muted); outline: 0; }

.workspace-section {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.workspace-toolbar select,
.workspace-toolbar input {
  min-height: 38px;
}

.compact-section-title {
  margin-bottom: 13px;
}

.renewal-kpi-grid,
.sales-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.renewal-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.renewal-kpi-card {
  min-width: 0;
  min-height: 168px;
}

.renewal-kpi-card .kpi-label,
.renewal-kpi-card small {
  overflow-wrap: anywhere;
}

.renewal-region-breakdown {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}

.renewal-region-breakdown + small {
  margin-top: 5px;
}

.renewal-kpi-card.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green), 0 5px 18px rgba(24, 39, 32, 0.08);
}

.renewal-toolbar .search-box {
  width: min(300px, 100%);
}

.renewal-toolbar #renewal-month-filter {
  width: 150px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.renewal-multi-select {
  position: relative;
  width: 148px;
}

.operations-multi-select {
  width: 148px;
}

.entry-detail-toolbar {
  margin-top: 0;
  margin-bottom: 13px;
}

.entry-detail-toolbar #entry-detail-month {
  min-width: 148px;
}

.entry-detail-toolbar .operation-keyword-search {
  width: min(280px, 100%);
  margin-left: auto;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.multi-select-trigger:hover,
.multi-select-trigger[aria-expanded="true"] {
  border-color: var(--green);
}

.multi-select-trigger:focus-visible {
  outline: 3px solid rgba(25, 116, 81, 0.16);
  outline-offset: 1px;
}

.multi-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-trigger svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.multi-select-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 25;
  min-width: 210px;
  max-height: 286px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.multi-select-option:hover {
  background: var(--green-soft);
}

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

.multi-select-option-all {
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  border-radius: 5px 5px 0 0;
  font-weight: 700;
}

.renewal-table {
  min-width: 1690px;
}

.renewal-table th:nth-child(1) { width: 250px; }
.renewal-table th:nth-child(2) { width: 132px; }
.renewal-table th:nth-child(3) { width: 118px; }
.renewal-table th:nth-child(4) { width: 118px; }
.renewal-table th:nth-child(5) { width: 118px; }
.renewal-table th:nth-child(6) { width: 100px; }
.renewal-table th:nth-child(7) { width: 70px; }
.renewal-table th:nth-child(8) { width: 128px; }
.renewal-table th:nth-child(9) { width: 128px; }
.renewal-table th:nth-child(10) { width: 330px; }
.renewal-table th:nth-child(11) { width: 112px; }
.renewal-table th:nth-child(12) { width: 92px; }

.renewal-table td {
  height: 68px;
}

.renewal-table tbody tr[data-renewal-edit-id] {
  cursor: pointer;
}

.renewal-table tbody tr[data-renewal-edit-id]:hover td,
.renewal-table tbody tr[data-renewal-edit-id]:focus-visible td {
  background: #f6faf8;
}

.renewal-table tbody tr[data-renewal-edit-id]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.renewal-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.renewal-name-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.renewal-expiry-avatar {
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.renewal-expiry-avatar.is-overdue {
  border-color: #f0b8b6;
  background: var(--red-soft);
  color: var(--red);
}

.renewal-expiry-avatar.is-current {
  border-color: #efcf8b;
  background: var(--amber-soft);
  color: var(--amber);
}

.renewal-expiry-avatar.is-upcoming {
  border-color: #b9ccdc;
  background: var(--blue-soft);
  color: var(--blue);
}

.renewal-expiry-avatar.is-renewed {
  border-color: #afd6c6;
  background: var(--green-soft);
  color: var(--green-dark);
}

.renewal-name,
.latest-progress {
  min-width: 0;
}

.renewal-name {
  flex: 1;
}

.renewal-name-button {
  min-width: 0;
  padding: 4px 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.renewal-name-button:hover,
.renewal-name-button:focus-visible {
  background: var(--green-soft);
  outline: none;
}

.renewal-name-button:hover strong,
.renewal-name-button:focus-visible strong {
  color: var(--green-dark);
  text-decoration: underline;
}

.renewal-name strong,
.renewal-name span,
.latest-progress strong,
.latest-progress span,
.cell-note {
  display: block;
}

.renewal-name strong,
.latest-progress strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.renewal-name span,
.latest-progress span,
.cell-note {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-note.is-overdue {
  color: var(--red);
  font-weight: 700;
}

.renewal-stage {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.renewal-stage-won { background: var(--green-soft); color: var(--green-dark); }
.renewal-stage-active { background: var(--blue-soft); color: var(--blue); }
.renewal-stage-visit { background: var(--amber-soft); color: var(--amber); }
.renewal-stage-lost { background: var(--red-soft); color: var(--red); }
.renewal-stage-pending { background: #edf0ef; color: var(--muted); }

.renewal-progress-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.renewal-profile-dialog {
  width: min(680px, calc(100vw - 32px));
}

.renewal-profile-readonly {
  margin: 0 24px 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f6f8f7;
  color: var(--muted);
  font-size: 11px;
}

.renewal-project-combobox {
  position: relative;
}

.renewal-project-results {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 10;
  max-height: 238px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.renewal-project-option {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.renewal-project-option:last-child {
  border-bottom: 0;
}

.renewal-project-option:hover,
.renewal-project-option.is-active {
  background: var(--green-soft);
}

.renewal-project-option strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.renewal-project-option span {
  color: var(--muted-light);
  font-size: 10px;
}

.renewal-project-no-result {
  padding: 14px 11px;
  color: var(--muted-light);
  font-size: 11px;
}

.renewal-dialog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 24px 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.renewal-dialog-summary > div {
  min-height: 66px;
  padding: 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.renewal-dialog-summary span,
.renewal-dialog-summary strong {
  display: block;
}

.renewal-dialog-summary span {
  color: var(--muted-light);
  font-size: 10px;
}

.renewal-dialog-summary strong {
  margin-top: 7px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.renewal-history {
  max-height: 220px;
  margin: 16px 24px 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.renewal-history h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 11px;
}

.renewal-history-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.renewal-history-item:last-child {
  border-bottom: 0;
}

.renewal-history-item time,
.renewal-history-item span {
  color: var(--muted-light);
  font-size: 10px;
}

.renewal-history-item strong {
  font-size: 11px;
}

.renewal-history-item p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.renewal-history-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.renewal-history-empty span {
  color: var(--muted-light);
  font-size: 10px;
}

.renewal-history-empty strong {
  font-size: 11px;
  line-height: 1.5;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-grid textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.form-grid textarea:focus-visible {
  outline: 3px solid rgba(25, 116, 81, 0.18);
  outline-offset: 2px;
}

.sales-toolbar {
  margin-bottom: 12px;
  background: var(--surface);
}

.sales-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.sales-toolbar-label svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.sales-project-search {
  width: 190px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
}

.segmented-control button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-selected {
  background: var(--green-soft);
  color: var(--green-dark);
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
}

.inline-field span {
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

.inline-field input {
  width: 122px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.inline-field select {
  min-height: 34px;
  padding: 0 22px 0 0;
  border: 0;
  outline: 0;
  background-color: transparent;
  font-size: 11px;
}

.sales-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.sales-analysis-grid .panel {
  min-height: 410px;
}

.people-ranking-panel {
  min-width: 0;
}

.people-ranking-header {
  align-items: flex-start;
  gap: 16px;
}

.ranking-panel-metrics {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.ranking-panel-metrics span {
  min-width: 72px;
  text-align: right;
}

.ranking-panel-metrics small,
.ranking-panel-metrics strong {
  display: block;
}

.ranking-panel-metrics small {
  margin-bottom: 4px;
  color: var(--muted-light);
  font-size: 9px;
}

.ranking-panel-metrics strong {
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.compact-table-scroll {
  margin-top: 14px;
}

.sales-ranking-table,
.manager-ranking-table,
.sales-project-table,
.manager-project-table {
  min-width: 760px;
}

.sales-ranking-table {
  min-width: 450px;
}

.sales-ranking-table th:nth-child(1) { width: 48px; }
.sales-ranking-table th:nth-child(2) { width: 100px; }
.sales-ranking-table th:nth-child(3) { width: 150px; }
.sales-ranking-table th:nth-child(4) { width: 120px; }

.manager-ranking-table {
  min-width: 560px;
}

.manager-ranking-table th:nth-child(1) { width: 52px; }
.manager-ranking-table th:nth-child(2) { width: 110px; }
.manager-ranking-table th:nth-child(3) { width: 76px; }
.manager-ranking-table th:nth-child(4) { width: 88px; }
.manager-ranking-table th:nth-child(5) { width: 180px; }

.ranking-value {
  display: grid;
  grid-template-columns: 42px minmax(54px, 1fr);
  align-items: center;
  gap: 8px;
}

.ranking-value strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ranking-bar {
  display: block;
  overflow: hidden;
  height: 5px;
  border-radius: 3px;
  background: #e7ece9;
}

.ranking-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.manager-ranking-value {
  grid-template-columns: 48px minmax(50px, 1fr);
}

.manager-ranking-value small {
  grid-column: 1 / -1;
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
}

.manager-ranking-value .ranking-bar i {
  background: #3e78b2;
}

.sales-project-table th:nth-child(1) { width: 110px; }
.sales-project-table th:nth-child(2) { width: 380px; }
.sales-project-table th:nth-child(3) { width: 100px; }
.sales-project-table th:nth-child(4) { width: 130px; }
.sales-project-table th:nth-child(5) { width: 110px; }

.manager-analysis-section {
  margin-bottom: 24px;
}

.manager-project-table {
  min-width: 900px;
}

.manager-project-table th:nth-child(1) { width: 120px; }
.manager-project-table th:nth-child(2) { width: 300px; }
.manager-project-table th:nth-child(3) { width: 110px; }
.manager-project-table th:nth-child(4) { width: 110px; }
.manager-project-table th:nth-child(5) { width: 120px; }
.manager-project-table th:nth-child(6) { width: 120px; }

.manager-person-total .cell-note {
  display: block;
  margin-top: 3px;
  color: var(--green-dark);
  font-weight: 500;
}

.manager-project-detail td:nth-child(3) {
  color: var(--muted-light);
}

.sales-person-total {
  background: var(--green-soft);
}

.sales-person-total td {
  color: var(--green-dark);
  font-weight: 700;
}

.collapsible-total-row {
  cursor: pointer;
}

.collapsible-total-row:hover td,
.collapsible-total-row.is-expanded td {
  background: #dcefe7;
}

.collapsible-total-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.detail-toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.detail-toggle-label svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.sales-project-detail td:nth-child(1) {
  color: var(--muted-light);
}

.sales-project-detail td:nth-child(2) {
  padding-left: 24px;
}

.rank-number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #edf0ef;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.rank-number.is-top {
  background: var(--amber-soft);
  color: var(--amber);
}

.definition-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 34px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.definition-summary > div {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid var(--border);
}

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

.definition-summary span,
.definition-summary strong {
  display: block;
}

.definition-summary span {
  margin-bottom: 6px;
  color: var(--muted-light);
  font-size: 10px;
}

.definition-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.definition-section {
  margin-top: 34px;
}

.definition-section-last {
  margin-bottom: 24px;
}

.definition-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.definition-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.definition-heading span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.definition-heading h2,
.definition-heading p {
  margin: 0;
}

.definition-heading h2 {
  font-size: 16px;
}

.definition-heading p {
  color: var(--muted-light);
  font-size: 11px;
}

.definition-table-scroll {
  border-radius: 6px;
}

.definition-table {
  min-width: 1120px;
}

.definition-table th:nth-child(1) { width: 180px; }
.definition-table th:nth-child(2) { width: 420px; }
.definition-table th:nth-child(3) { width: 300px; }
.definition-table th:nth-child(4) { width: 220px; }

.definition-table td {
  height: auto;
  min-height: 58px;
  padding-top: 13px;
  padding-bottom: 13px;
  line-height: 1.6;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.definition-table td strong {
  color: var(--text);
  font-weight: 700;
}

.formula-text {
  color: var(--green-dark);
  font-weight: 700;
}

/* Sales-group and entry-operation surfaces share compact, scan-first patterns. */
.operations-page .page-heading {
  margin-bottom: 20px;
}

.operations-toolbar {
  margin-bottom: 12px;
  background: var(--surface);
}

.operations-toolbar select {
  min-width: 132px;
}

.operations-toolbar select:first-of-type {
  min-width: 112px;
}

.date-range-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-light);
  font-size: 11px;
  white-space: nowrap;
}

.date-range-control input {
  min-height: 30px !important;
  padding: 0 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sales-group-date-control,
.entry-date-control {
  gap: 6px;
}

.operations-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.entry-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.operations-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
}

.operations-analysis-grid .panel {
  min-height: 330px;
}

.opportunity-section {
  margin-top: 12px;
}

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

.opportunity-scope-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #c9ddd3;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.opportunity-toolbar .operation-keyword-search {
  width: min(250px, 100%);
  margin-left: auto;
}

.opportunity-regions {
  display: grid;
  gap: 28px;
}

.opportunity-region {
  min-width: 0;
}

.regional-analysis-section {
  margin-top: 22px;
}

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

.regional-analysis-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.regional-analysis-heading,
.regional-quadrant-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.regional-analysis-heading {
  margin-bottom: 14px;
}

.regional-analysis-heading h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.regional-analysis-heading > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.regional-table-scroll {
  max-height: 330px;
}

.regional-table {
  min-width: 720px;
}

.regional-table th:first-child,
.regional-table td:first-child {
  width: 130px;
  text-align: left;
}

.regional-table th:not(:first-child) {
  white-space: nowrap;
}

.regional-quadrant-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.regional-quadrant-heading {
  align-items: baseline;
  margin-bottom: 10px;
}

.regional-quadrant-heading strong {
  font-size: 13px;
}

.regional-quadrant-heading span {
  color: var(--muted-light);
  font-size: 11px;
}

.regional-quadrant {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(90px, auto));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}

.regional-quadrant-cell {
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface-muted);
}

.regional-quadrant-cell:nth-child(1) { grid-column: 2; grid-row: 1; }
.regional-quadrant-cell:nth-child(2) { grid-column: 1; grid-row: 1; }
.regional-quadrant-cell:nth-child(3) { grid-column: 2; grid-row: 2; }
.regional-quadrant-cell:nth-child(4) { grid-column: 1; grid-row: 2; }

.regional-quadrant-cell-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.regional-quadrant-cell-heading strong {
  font-size: 12px;
}

.regional-quadrant-cell-heading span {
  color: var(--muted);
  font-size: 11px;
}

.regional-quadrant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.regional-quadrant-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}

.regional-quadrant-tags em {
  color: var(--muted-light);
  font-size: 11px;
  font-style: normal;
}

.quadrant-high-high { background: #eaf5ef; }
.quadrant-low-high { background: #eef5fb; }
.quadrant-high-low { background: #fcf5e8; }
.quadrant-low-low { background: #f7f8f8; }

.opportunity-region .section-title {
  margin: 0 0 9px;
}

.opportunity-region[data-opportunity-region="江西"] .sales-region-kicker {
  color: var(--blue) !important;
}

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

.opportunity-table th:nth-child(1) { width: 290px; }
.opportunity-table th:nth-child(2),
.opportunity-table th:nth-child(3) { width: 78px; }
.opportunity-table th:nth-child(4) { width: 96px; }
.opportunity-table th:nth-child(5),
.opportunity-table th:nth-child(6),
.opportunity-table th:nth-child(7) { width: 132px; }
.opportunity-table th:nth-child(8) { width: 250px; }

.opportunity-table th:nth-child(n+2):nth-child(-n+7),
.opportunity-table td:nth-child(n+2):nth-child(-n+7) {
  text-align: center;
}

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

.opportunity-table td {
  height: 58px;
  font-variant-numeric: tabular-nums;
}

.opportunity-table .sales-hierarchy-region-total td {
  background: #dfeee7;
  border-bottom-color: #c8ddd2;
  color: var(--text);
  font-weight: 800;
}

.opportunity-region[data-opportunity-region="江西"] .sales-hierarchy-region-total td {
  background: #e5edf8;
  border-bottom-color: #cfdaea;
}

.opportunity-table .sales-hierarchy-group td {
  background: #edf4f0;
  border-bottom-color: #d6e2dc;
  color: var(--text);
  font-weight: 700;
}

.opportunity-table .sales-hierarchy-person td {
  background: #f8faf9;
  color: var(--text);
  font-weight: 600;
}

.opportunity-table .sales-hierarchy-group:hover td {
  background: #e8f1ec;
}

.opportunity-table .sales-hierarchy-person:hover td {
  background: #f3f7f5;
}

.opportunity-institution-row:hover {
  background: #fafcfb;
}

.opportunity-institution-row td {
  height: 64px;
}

.opportunity-institution {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 59px;
}

.opportunity-institution > span:last-child,
.opportunity-institution strong,
.opportunity-institution small {
  min-width: 0;
}

.opportunity-institution strong,
.opportunity-institution small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-institution strong {
  color: var(--text);
  font-size: 11px;
}

.opportunity-institution small {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 9px;
}

.opportunity-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
}

.opportunity-grade-badge.grade-A { background: #c93f3f; }
.opportunity-grade-badge.grade-B { background: #bc7506; }

.opportunity-followup-detail {
  display: grid;
  gap: 3px;
  max-width: 300px;
}

.opportunity-followup-detail strong,
.opportunity-followup-detail span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-followup-detail strong {
  color: var(--text);
  font-size: 10px;
}

.opportunity-followup-detail span {
  color: var(--muted);
  font-size: 9px;
}

.operations-bar-chart {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.operations-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

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

.operations-legend i {
  width: 12px;
  height: 4px;
  border-radius: 2px;
}

.operations-legend-contract {
  background: var(--violet);
}

.operations-legend-revenue {
  background: var(--green);
}

.operations-bar-row {
  display: grid;
  gap: 7px;
}

.operations-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}

.operations-bar-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-bar-label span {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.operations-bar-track {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 12px;
  padding: 2px 0;
  border-radius: 3px;
  background: #eef2f0;
}

.operations-bar-track i {
  display: block;
  min-width: 0;
  height: 4px;
  border-radius: 2px;
}

.operations-bar-contract {
  background: var(--violet);
}

.operations-bar-revenue {
  background: var(--green);
}

.stage-summary-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.stage-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}

.stage-summary-row strong {
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stage-summary-row > span:last-child {
  color: var(--muted-light);
  font-size: 11px;
}

.operations-table {
  min-width: 1080px;
}

.sales-group-match-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-left: auto;
  color: var(--green-dark);
  font-size: 11px;
  white-space: nowrap;
}

.sales-group-year-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sales-group-year-note svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.sales-group-match-note.is-warning {
  color: var(--amber);
}

.sales-group-match-note svg {
  width: 15px;
  height: 15px;
}

.sales-region-section {
  margin-top: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sales-region-section + .sales-region-section {
  margin-top: 32px;
}

.sales-region-kicker {
  margin: 0 0 5px !important;
  color: var(--green) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0;
}

.sales-region-section[data-sales-region="江西"] .sales-region-kicker {
  color: var(--blue) !important;
}

.sales-hierarchy-table {
  min-width: 1080px;
}

.sales-hierarchy-table th:nth-child(1) { width: 315px; }
.sales-hierarchy-table th:nth-child(2) { width: 105px; }
.sales-hierarchy-table th:nth-child(3) { width: 140px; }
.sales-hierarchy-table th:nth-child(4) { width: 100px; }
.sales-hierarchy-table th:nth-child(5) { width: 170px; }
.sales-hierarchy-table th:nth-child(6) { width: 120px; }
.sales-hierarchy-table th:nth-child(7) { width: 130px; }

.sales-hierarchy-table td {
  height: 62px;
  font-variant-numeric: tabular-nums;
}

.sales-hierarchy-table .money {
  color: var(--text);
  white-space: nowrap;
}

.sales-hierarchy-table .performance-money {
  color: var(--green-dark);
  font-weight: 800;
}

.sales-hierarchy-group {
  background: #edf4f0;
}

.sales-hierarchy-region-total {
  background: #dfeee7;
}

.sales-hierarchy-region-total:hover {
  background: #d9eae2;
}

.sales-hierarchy-region-total td {
  border-bottom-color: #c8ddd2;
  color: var(--text);
  font-weight: 800;
}

.sales-region-section[data-sales-region="江西"] .sales-hierarchy-region-total {
  background: #e5edf8;
}

.sales-region-section[data-sales-region="江西"] .sales-hierarchy-region-total:hover {
  background: #dfe9f6;
}

.sales-region-section[data-sales-region="江西"] .sales-hierarchy-region-total td {
  border-bottom-color: #cfdaea;
}

.sales-hierarchy-group:hover {
  background: #e8f1ec;
}

.sales-hierarchy-group td {
  border-bottom-color: #d6e2dc;
  color: var(--text);
  font-weight: 700;
}

.hierarchy-region-total {
  display: grid;
  gap: 3px;
}

.hierarchy-region-total strong {
  color: var(--text);
  font-size: 12px;
}

.hierarchy-region-total small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.sales-hierarchy-person {
  background: #f8faf9;
}

.sales-hierarchy-person:hover {
  background: #f3f7f5;
}

.sales-hierarchy-person td {
  color: var(--text);
  font-weight: 600;
}

.sales-hierarchy-project:hover {
  background: #fafcfb;
}

.hierarchy-project-count {
  color: var(--text);
  font-weight: 800;
}

.hierarchy-toggle,
.hierarchy-project-link {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.hierarchy-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hierarchy-toggle > svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.hierarchy-toggle span,
.hierarchy-project-link > span:nth-child(2) {
  min-width: 0;
}

.hierarchy-toggle strong,
.hierarchy-toggle small,
.hierarchy-project-link strong,
.hierarchy-project-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hierarchy-toggle strong,
.hierarchy-project-link strong {
  color: var(--text);
  font-size: 12px;
}

.hierarchy-toggle small,
.hierarchy-project-link small {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 500;
}

.hierarchy-level-person {
  padding-left: 30px;
}

.hierarchy-project-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding-left: 59px;
}

.hierarchy-project-link .project-avatar {
  width: 30px;
  height: 30px;
  font-size: 10px;
}

.hierarchy-project-link > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-light);
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease;
}

.hierarchy-project-link:hover strong,
.hierarchy-project-link:focus-visible strong {
  color: var(--green-dark);
}

.hierarchy-project-link:hover > svg,
.hierarchy-project-link:focus-visible > svg {
  color: var(--green);
  opacity: 1;
}

.hierarchy-toggle:focus-visible,
.hierarchy-project-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 28%, transparent);
  outline-offset: 4px;
}

.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.table-link:hover,
.table-link:focus-visible {
  color: var(--green);
  text-decoration-color: currentColor;
}

.stage-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.entry-trend-chart {
  min-height: 230px;
  margin-top: 18px;
}

.entry-trend-bars {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 220px;
  padding: 0 4px 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.entry-trend-column {
  flex: 1 0 54px;
  display: grid;
  grid-template-rows: 44px 1fr 22px;
  gap: 6px;
  min-width: 54px;
  text-align: center;
}

.entry-trend-values {
  display: grid;
  align-content: end;
  gap: 2px;
}

.entry-trend-values strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.entry-trend-values span,
.entry-trend-column > span {
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

.entry-trend-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 132px;
  padding: 0 12px;
  background: linear-gradient(to top, #eef2f0 1px, transparent 1px) 0 100% / 100% 33.333% repeat-y;
}

.entry-trend-track i {
  display: block;
  width: min(34px, 100%);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--green);
}

.entry-bucket-table {
  min-width: 640px;
}

.entry-bucket-table th:nth-child(1) { width: 125px; }
.entry-bucket-table th:nth-child(2),
.entry-bucket-table th:nth-child(3),
.entry-bucket-table th:nth-child(4),
.entry-bucket-table th:nth-child(5) { width: 82px; }
.entry-bucket-table th:nth-child(6) { width: 86px; }

.entry-institution-table {
  min-width: 1600px;
}

.entry-institution-table th:nth-child(1) { width: 250px; }
.entry-institution-table th:nth-child(2) { width: 100px; }
.entry-institution-table th:nth-child(3) { width: 150px; }
.entry-institution-table th:nth-child(4) { width: 120px; }
.entry-institution-table th:nth-child(5) { width: 120px; }
.entry-institution-table th:nth-child(6) { width: 105px; }
.entry-institution-table th:nth-child(7) { width: 105px; }
.entry-institution-table th:nth-child(8) { width: 110px; }
.entry-institution-table th:nth-child(9) { width: 90px; }
.entry-institution-table th:nth-child(10) { width: 170px; }
.entry-institution-table th:nth-child(11) { width: 330px; }

.profile-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.profile-level-badge.grade-A { background: #c93f3f; }
.profile-level-badge.grade-B { background: #bc7506; }
.profile-level-badge.grade-C { background: #3478b8; }
.profile-level-badge.grade-D { background: #65746d; }
.profile-level-badge.grade-E { background: #929b97; }

.bucket-tag,
.cooperation-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.bucket-tag {
  background: var(--blue-soft);
  color: var(--blue);
}

.bucket-under-100,
.bucket-missing {
  background: #edf0ef;
  color: var(--muted);
}

.cooperation-tag {
  background: #edf0ef;
  color: var(--muted);
}

.cooperation-tag.is-cooperated {
  background: var(--green-soft);
  color: var(--green-dark);
}

.entry-interview {
  display: grid;
  gap: 4px;
  max-width: 330px;
  line-height: 1.45;
}

.entry-interview strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.entry-interview span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

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

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

  .operations-analysis-grid {
    grid-template-columns: 1fr;
  }

  .regional-analysis-grid {
    grid-template-columns: 1fr;
  }

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

  .panel {
    min-height: 330px;
  }

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

  .definition-summary > div:nth-child(2) {
    border-right: 0;
  }

  .definition-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

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

  .sidebar {
    position: fixed;
    left: 0;
    z-index: 50;
    transform: translateX(-102%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

  .topbar {
    gap: 12px;
    min-height: 62px;
    padding: 0 16px;
  }

  .data-status {
    margin-right: auto;
  }

  .button {
    padding: 0 11px;
  }

  .topbar-actions .button span {
    display: none;
  }

  .page-wrap {
    padding: 24px 16px 48px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .heading-stamp {
    display: none;
  }

  .page-heading h1 {
    font-size: 24px;
  }

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

  .kpi-card:last-child {
    grid-column: 1 / -1;
  }

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

  .stage-item:nth-child(2) {
    border-right: 0;
  }

  .stage-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .table-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
  }

  .search-box {
    flex: 1;
    width: auto;
  }

  .opportunity-toolbar .operation-keyword-search {
    width: 100%;
    margin-left: 0;
  }

  .opportunity-table th:first-child,
  .opportunity-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 var(--border);
  }

  .opportunity-table th:first-child {
    z-index: 2;
    background: var(--surface-muted);
  }

  .opportunity-institution {
    padding-left: 44px;
  }

  .sales-group-match-note {
    width: 100%;
    margin-left: 0;
  }

  .sales-region-section .section-title {
    align-items: flex-end;
  }

  .sales-region-section .section-title > p {
    max-width: 190px;
    text-align: right;
  }

  .sales-hierarchy-table {
    min-width: 980px;
  }

  .sales-hierarchy-table th:nth-child(1) {
    width: 260px;
  }

  .sales-hierarchy-table th:first-child,
  .sales-hierarchy-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 var(--border);
  }

  .sales-hierarchy-table th:first-child {
    z-index: 2;
    background: var(--surface-muted);
  }

  .sales-hierarchy-group td:first-child {
    background: #edf4f0;
  }

  .sales-hierarchy-region-total td:first-child {
    background: #dfeee7;
  }

  .sales-region-section[data-sales-region="江西"] .sales-hierarchy-region-total td:first-child {
    background: #e5edf8;
  }

  .sales-hierarchy-person td:first-child {
    background: #f8faf9;
  }

  .sales-hierarchy-project td:first-child {
    background: var(--surface);
  }

  .hierarchy-project-link {
    padding-left: 44px;
  }

  .sales-hierarchy-project td {
    height: 72px;
  }

  .hierarchy-project-link strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 540px) {
  .data-status span:last-child {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading p:not(.eyebrow) {
    max-width: 300px;
    line-height: 1.55;
  }

  .sales-region-section .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sales-region-section .section-title > p {
    max-width: none;
    margin-top: 0;
    text-align: left;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    min-height: 130px;
    padding: 15px;
  }

  .kpi-card strong {
    font-size: 20px;
  }

  .kpi-icon {
    top: 13px;
    right: 13px;
  }

  .analysis-grid {
    gap: 8px;
  }

  .panel {
    min-height: 320px;
    padding: 16px;
  }

  .achievement-row {
    grid-template-columns: 105px minmax(80px, 1fr) 64px;
    gap: 8px;
  }

  .achievement-value span {
    display: none;
  }

  .stage-item {
    padding: 0 12px;
  }

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

  .table-tools select {
    width: 100%;
  }

  .operations-toolbar {
    align-items: stretch;
  }

  .operations-toolbar select {
    flex: 1 1 150px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    max-height: 55vh;
    overflow-y: auto;
  }

  .metric-dialog {
    width: calc(100vw - 20px);
  }

  .operations-page .page-heading {
    margin-bottom: 16px;
  }

  .operations-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .operations-toolbar .sales-toolbar-label {
    grid-column: 1 / -1;
  }

  .operations-toolbar select {
    width: 100%;
    min-width: 0;
  }

  .sales-group-date-control,
  .entry-date-control {
    width: 100%;
    justify-content: space-between;
  }

  .sales-group-date-control input,
  .entry-date-control input {
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  .entry-detail-toolbar .operation-keyword-search {
    width: 100%;
    margin-left: 0;
    grid-column: 1 / -1;
  }

  .operations-bar-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .operations-bar-label span {
    white-space: normal;
  }

  .stage-summary-row {
    grid-template-columns: minmax(0, 1fr) 54px auto;
  }
}

@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;
  }
}
