:root {
  --red: #c7000b;
  --red-dark: #98000a;
  --red-soft: #fff1f2;
  --red-line: #ffd6d9;
  --text: #2f3339;
  --muted: #6d747d;
  --line: #e6e8ec;
  --border: #e6e8ec;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --good: #34765b;
  --warn: #a86500;
  --risk: #b42318;
  --shadow: 0 1px 2px rgba(24, 31, 39, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f7f8fa;
}

.login-panel {
  width: min(440px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0 0 18px;
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label,
.login-form .form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
}

.login-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
  color: var(--text);
}

.register-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.password-change-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.login-message {
  min-height: 20px;
  color: var(--risk);
  font-size: 13px;
}

.login-message.warning {
  min-height: auto;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  width: 248px;
  height: 100vh;
  flex: 0 0 248px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-align: left;
}

.system-switch-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.system-switch-button:disabled {
  cursor: wait;
}

.system-switch-button.is-switching {
  opacity: 0.76;
}

.system-switch-button.is-switching .brand-system-pill {
  border-color: var(--red-line);
  color: var(--red);
  background: var(--red-soft);
}

.system-switch-button:hover .brand-system-pill,
.system-switch-button:focus-visible .brand-system-pill {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.system-switch-button:focus-visible {
  outline: 2px solid var(--red-line);
  outline-offset: 2px;
  border-radius: 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-title {
  font-weight: 700;
  line-height: 1.3;
}

.brand-content {
  min-width: 0;
  flex: 1;
}

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

.module-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px 6px 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f7f9;
}

.module-switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.module-switch-button:hover,
.module-switch-button:focus-visible {
  color: var(--red);
  background: #ffffff;
  outline: none;
}

.module-switch-button.active {
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(208, 0, 24, 0.18);
}

.module-switch-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.brand-switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.brand-system-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.brand-switch-cue {
  color: var(--muted);
  font-size: 12px;
}

.system-source-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-list {
  display: grid;
  gap: 4px;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #474d55;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f2f4f7;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.module-switch-button .nav-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--red);
}

.module-switch-button.active .nav-icon,
.nav-item.active .nav-icon {
  background: #ffffff;
  color: var(--red);
}

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

.nav-item.active {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  display: block;
}

.ssl-certificate-notice {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: #27313f;
  font-size: 12px;
  line-height: 1.35;
}

.ssl-certificate-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.ssl-certificate-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #475569;
}

.ssl-certificate-head strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssl-certificate-head span:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ssl-certificate-time {
  color: #475569;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.ssl-certificate-days {
  color: #111827;
  font-weight: 800;
}

.ssl-certificate-notice p {
  margin: 0;
  color: #475569;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.ssl-certificate-notice-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.ssl-certificate-notice-warning .ssl-certificate-dot,
.ssl-certificate-notice-warning .ssl-certificate-head span:last-child {
  background: #f59e0b;
  color: #ffffff;
}

.ssl-certificate-notice-warning .ssl-certificate-days {
  color: #92400e;
}

.ssl-certificate-notice-orange {
  border-color: #fed7aa;
  background: #fff7ed;
}

.ssl-certificate-notice-orange .ssl-certificate-dot,
.ssl-certificate-notice-orange .ssl-certificate-head span:last-child {
  background: #c2410c;
  color: #ffffff;
}

.ssl-certificate-notice-orange .ssl-certificate-days {
  color: #9a3412;
}

.ssl-certificate-notice-critical,
.ssl-certificate-notice-expired {
  border-color: #fecaca;
  background: #fff1f2;
}

.ssl-certificate-notice-critical .ssl-certificate-dot,
.ssl-certificate-notice-expired .ssl-certificate-dot,
.ssl-certificate-notice-critical .ssl-certificate-head span:last-child,
.ssl-certificate-notice-expired .ssl-certificate-head span:last-child {
  background: var(--red);
  color: #ffffff;
}

.ssl-certificate-notice-critical .ssl-certificate-days,
.ssl-certificate-notice-expired .ssl-certificate-days {
  color: var(--red-dark);
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.main-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none;
}

.app-shell.utility-topbar .topbar {
  display: none;
}

.app-shell.utility-topbar .scope-row {
  display: none;
}

.scope-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.scope-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-scope-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.analysis-scope-panel .scope-row {
  align-items: end;
}

.scope-filter {
  position: relative;
  display: grid;
  gap: 4px;
}

.month-range-filter {
  min-width: 154px;
}

.month-range-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-range-control select {
  width: 72px;
  min-width: 72px;
}

.month-range-separator {
  color: var(--muted);
  font-size: 12px;
}

.filter-button {
  position: relative;
  width: 168px;
  min-width: 150px;
  max-width: 240px;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  padding: 6px 28px 6px 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-button::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.scope-row select,
.scope-row .filter-button {
  font-size: 14px;
  font-weight: 400;
}

.filter-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, 80vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(24, 31, 39, 0.14);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 28px;
  padding: 4px 10px;
  cursor: pointer;
}

.filter-search {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  color: var(--text);
  font: inherit;
}

.filter-search:focus {
  outline: 2px solid var(--red-line);
  border-color: var(--red);
}

select,
input[type="file"] {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 6px 10px;
}

select[multiple] {
  min-height: 132px;
  padding: 6px;
}

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

.project-check-list {
  min-height: 132px;
  max-height: 184px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.project-check-list.compact {
  min-height: 96px;
  max-height: 240px;
}

.project-check-list.is-disabled {
  background: #f6f7f9;
}

.login-form .project-option,
.approval-grid .project-option,
.project-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.login-form .project-option:hover,
.approval-grid .project-option:hover,
.project-option:hover {
  background: var(--red-soft);
}

.login-form .project-option input,
.approval-grid .project-option input,
.project-option input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-height: auto;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: var(--red);
  justify-self: center;
  align-self: center;
}

.login-form .project-option span,
.approval-grid .project-option span,
.project-option span {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-form .project-option input:disabled + span,
.approval-grid .project-option input:disabled + span,
.project-option input:disabled + span {
  color: var(--muted);
}

.project-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px;
}

select:disabled {
  color: var(--text);
  opacity: 1;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

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

.sidebar-profile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sidebar-profile:hover,
.sidebar-profile:focus-visible {
  background: var(--red-soft);
  outline: none;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #ffffff;
  font-weight: 800;
}

.sidebar-profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-profile-copy strong {
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-chevron {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.topbar-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
}

.topbar-icon-button:hover {
  color: var(--red);
  border-color: var(--red-line);
  background: var(--red-soft);
}

.topbar-icon-button svg,
.topbar-logout svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--red);
}

.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workspace {
  padding: 20px 24px 24px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  margin: 0;
}

.section-conclusion {
  display: none;
}

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

.kpi-grid.compact {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.kpi-value {
  color: var(--red);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.kpi-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.content-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

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

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

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

.inline-filter select {
  min-height: 32px;
  font-size: 13px;
}

.source-hover {
  cursor: help;
  text-decoration: underline dotted rgba(109, 116, 125, 0.55);
  text-underline-offset: 3px;
}

.facts-preview-table {
  table-layout: fixed;
  min-width: 1080px;
}

.facts-preview-table th:nth-child(1),
.facts-preview-table td:nth-child(1) {
  width: 80px;
}

.facts-preview-table th:nth-child(2),
.facts-preview-table td:nth-child(2) {
  width: 230px;
}

.facts-preview-table th:nth-child(3),
.facts-preview-table td:nth-child(3) {
  width: 190px;
}

.facts-preview-table th:nth-child(4),
.facts-preview-table td:nth-child(4),
.facts-preview-table th:nth-child(5),
.facts-preview-table td:nth-child(5),
.facts-preview-table th:nth-child(6),
.facts-preview-table td:nth-child(6) {
  width: 110px;
}

.facts-preview-table th:nth-child(7),
.facts-preview-table td:nth-child(7) {
  width: 340px;
}

.facts-reason-cell {
  color: var(--text);
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red-line);
  font-size: 12px;
  font-weight: 700;
}

.badge.subtle {
  background: #f4f5f7;
  color: #4d5560;
  border-color: var(--line);
}

.chart-box {
  min-height: 250px;
}

.chart-box svg {
  width: 100%;
  min-height: 250px;
  display: block;
}

.bar-list,
.driver-list,
.reason-list,
.action-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(160px, 2fr) 90px;
  gap: 10px;
  align-items: center;
}

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

.bar-track {
  height: 10px;
  background: #f0f1f3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red);
}

.bar-fill.positive {
  background: #8f1d25;
}

.bar-fill.negative {
  background: #6b7280;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.panorama-layout {
  align-items: stretch;
}

.panorama-table {
  table-layout: fixed;
  width: 100%;
  min-width: 760px;
}

.panorama-table .panorama-col-name {
  width: 42%;
}

.panorama-table .panorama-col-amount {
  width: 14%;
}

.panorama-table .panorama-col-variance {
  width: 16%;
}

.panorama-table .panorama-col-share {
  width: 14%;
}

.panorama-table .panorama-col-rate {
  width: 14%;
}

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

.panorama-table .numeric {
  text-align: left;
}

.panorama-table .amount-with-revision {
  justify-content: start;
  min-width: 90px;
}

.panorama-table .amount-value {
  text-align: left;
}

.app-shell.map-mode .scope-row {
  display: none;
}

.budget-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.budget-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.budget-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

.budget-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}

.budget-layout.lower {
  grid-template-columns: 1fr 1fr;
}

.budget-monthly-bars {
  display: grid;
  gap: 10px;
}

.budget-month-row {
  display: grid;
  grid-template-columns: 42px minmax(160px, 1fr) 110px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.budget-month-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2f3f5;
}

.budget-month-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.budget-month-row.negative .budget-month-track i {
  background: var(--muted);
}

.budget-month-row b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.budget-gantt-panel {
  margin-top: 12px;
}

.budget-gantt {
  display: grid;
  gap: 12px;
}

.budget-gantt-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.budget-gantt-summary span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.budget-gantt-summary b {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.budget-gantt-head,
.budget-gantt-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(420px, 2fr) minmax(120px, 0.55fr);
  gap: 12px;
  align-items: center;
}

.budget-gantt-head {
  color: var(--muted);
  font-size: 12px;
}

.budget-gantt-month-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0;
  text-align: center;
}

.budget-gantt-rows {
  display: grid;
  gap: 8px;
}

.budget-gantt-row {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.budget-gantt-subject {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.budget-gantt-subject b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.budget-gantt-subject span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.budget-gantt-track {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 16px 16px 16px;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  position: relative;
}

.budget-gantt-cell {
  grid-row: 1 / span 3;
  border-left: 1px solid #eef0f3;
}

.budget-gantt-cell:first-child {
  border-left: 0;
}

.budget-gantt-bar {
  z-index: 1;
  height: 8px;
  align-self: center;
  margin: 0 4px;
  border-radius: 999px;
}

.budget-gantt-bar.budget {
  grid-row: 1;
  background: #f3c1c6;
}

.budget-gantt-bar.actual {
  grid-row: 2;
  background: var(--red);
}

.budget-gantt-bar.payment {
  grid-row: 3;
  background: #6b7280;
}

.budget-gantt-track em {
  grid-column: 1 / span 12;
  grid-row: 3;
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.budget-gantt-result {
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.budget-gantt-result b {
  color: var(--text);
}

.budget-gantt-result span {
  color: var(--muted);
  font-size: 12px;
}

.budget-gantt-result small {
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: #f3f4f6;
  font-size: 11px;
}

.budget-gantt-row.status-over .budget-gantt-result small,
.budget-gantt-row.status-noBudget .budget-gantt-result small {
  color: var(--red);
  background: #fff1f2;
}

.budget-gantt-row.status-noMatch .budget-gantt-result small {
  color: #6b7280;
  background: #f3f4f6;
}

.budget-gantt-row.status-onTrack .budget-gantt-result small {
  color: #047857;
  background: #ecfdf5;
}

.budget-gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.budget-gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.budget-gantt-legend i {
  width: 20px;
  height: 8px;
  border-radius: 999px;
}

.budget-gantt-legend .budget {
  background: #f3c1c6;
}

.budget-gantt-legend .actual {
  background: var(--red);
}

.budget-gantt-legend .payment {
  background: #6b7280;
}

.budget-table {
  table-layout: fixed;
}

.budget-table th,
.budget-table td {
  vertical-align: top;
}

.budget-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost-map-toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  align-items: end;
}

.cost-map-toolbar label,
.cost-map-scope-switch {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.segmented-control button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.segmented-control button.active {
  background: #fff1f2;
  color: var(--red);
}

.cost-map-toolbar select,
.cost-map-toolbar input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.cost-map-edit-notice {
  margin: -4px 0 12px;
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cost-map-edit-notice.active {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
  font-weight: 700;
}

.cost-map-edit-notice.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.cost-map-edit-notice.hidden {
  display: none;
}

.cost-map-dashboard-panel {
  overflow: hidden;
}

.cost-map-dashboard-header h2 {
  margin-bottom: 4px;
}

.cost-map-dashboard {
  display: grid;
  gap: 14px;
}

.cost-map-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.cost-map-dashboard-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.cost-map-dashboard-toolbar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.cost-map-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.cost-map-dashboard-stat {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  background: #fbfcfe;
}

.cost-map-dashboard-stat span,
.cost-map-dashboard-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cost-map-dashboard-stat b {
  display: block;
  margin: 5px 0 3px;
  color: var(--red);
  font-size: 21px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cost-map-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.cost-map-dashboard-chart {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  background: #fff;
}

.cost-map-chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.cost-map-chart-title h3 {
  margin: 0;
  font-size: 15px;
}

.cost-map-chart-title span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cost-map-chart-title i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 3px 0 8px;
  border-radius: 2px;
  vertical-align: -1px;
}

.cost-map-dashboard-bars,
.cost-map-composition-list {
  display: grid;
  gap: 8px;
}

.cost-map-dashboard-bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

.cost-map-dashboard-bar-row.is-empty {
  cursor: default;
}

.cost-map-dashboard-bar-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-map-dashboard-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.cost-map-dashboard-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d0021b, #f59e0b);
}

.cost-map-dashboard-bar-row b,
.cost-map-composition-row b {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.cost-map-composition-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
}

.cost-map-composition-row span {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-map-composition-shell {
  height: 14px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.cost-map-composition-stack {
  display: flex;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  overflow: hidden;
}

.cost-map-composition-stack i,
.cost-map-chart-title i.base,
.cost-map-level-mix .a {
  background: #2563eb;
}

.cost-map-composition-stack i.material,
.cost-map-chart-title i.material,
.cost-map-level-mix .b {
  background: #0f9f8f;
}

.cost-map-composition-stack i.management,
.cost-map-chart-title i.management,
.cost-map-level-mix .c {
  background: #f59e0b;
}

.cost-map-dashboard-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.cost-map-dashboard-table th,
.cost-map-dashboard-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

.cost-map-dashboard-table th {
  color: var(--muted);
  background: #f7f9fc;
  font-weight: 700;
}

.cost-map-level-mix {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.cost-map-level-mix span {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.cost-map-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  column-gap: 0;
  row-gap: 14px;
  overflow: visible;
}

.cost-map-matrix-panel,
.cost-map-detail-panel {
  min-width: 0;
  min-height: 420px;
  height: var(--cost-map-panel-height, min(68vh, 720px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cost-map-matrix-panel {
  flex: 0 0 var(--cost-map-left-size, 58%);
  max-width: calc(100% - 12px);
}

.cost-map-detail-panel {
  flex: 1 1 360px;
}

.cost-map-matrix-panel > .panel-header,
.cost-map-detail-panel > .panel-header {
  flex: 0 0 auto;
}

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

.cost-map-revision-toggle {
  height: 30px;
  border: 1px solid #e1e5ec;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: #303743;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cost-map-revision-toggle:hover,
.cost-map-revision-toggle.active {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.cost-map-view-switch {
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  min-height: 30px;
}

.cost-map-view-switch button {
  padding: 0 10px;
  font-size: 12px;
}

#costMapMatrix,
#costMapDetail {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

#costMapDetail {
  padding-right: 2px;
}

#costMapDetail .cost-map-detail {
  min-width: 0;
}

.cost-map-splitter {
  position: relative;
  flex: 0 0 12px;
  align-self: stretch;
  min-height: 420px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.cost-map-splitter::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: #dfe3ea;
}

.cost-map-splitter:hover::before,
.cost-map-splitter:focus-visible::before,
body.cost-map-resizing-x .cost-map-splitter::before {
  background: var(--red);
}

.cost-map-splitter:focus-visible {
  outline: 0;
}

.cost-map-panel-resize {
  flex: 0 0 18px;
  margin: 8px 0 0;
  cursor: row-resize;
  position: relative;
  touch-action: none;
}

.cost-map-panel-resize::before {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% - 34px);
  width: 68px;
  height: 3px;
  border-radius: 999px;
  background: #dfe3ea;
}

.cost-map-panel-resize:hover::before,
body.cost-map-resizing-y .cost-map-panel-resize::before {
  background: var(--red);
}

body.cost-map-resizing-x,
body.cost-map-resizing-y {
  user-select: none;
}

body.cost-map-resizing-x {
  cursor: col-resize;
}

body.cost-map-resizing-y {
  cursor: row-resize;
}

.cost-map-matrix-wrap {
  height: 100%;
  max-height: none;
}

.cost-map-matrix {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.cost-map-matrix .col-code {
  width: 6%;
}

.cost-map-matrix .col-subject {
  width: 18%;
}

.cost-map-matrix .col-quantity {
  width: 6%;
}

.cost-map-matrix .col-unit {
  width: 5%;
}

.cost-map-matrix .col-price {
  width: 11%;
}

.cost-map-matrix .col-guide {
  width: 32%;
}

.cost-map-matrix th,
.cost-map-matrix td {
  border-bottom: 1px solid #edf0f4;
  border-right: 1px solid #edf0f4;
  padding: 8px;
  vertical-align: top;
  background: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cost-map-matrix th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fb;
  color: #303743;
  text-align: left;
  font-weight: 700;
}

.cost-map-matrix tr.active td {
  background: #fff8f8;
}

.cost-map-subject-cell,
.cost-map-cost-cell {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cost-map-subject-cell {
  display: grid;
  gap: 2px;
  padding-left: calc(var(--depth, 0) * 12px);
}

.cost-map-subject-cell b {
  font-size: 11px;
  color: var(--muted);
}

.cost-map-subject-cell span {
  font-weight: 700;
}

.cost-map-cost-cell {
  min-height: 48px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.cost-map-cost-cell:hover,
.cost-map-cost-cell.active {
  border-color: var(--red-line);
  background: #fff0f0;
}

.cost-map-cost-cell b {
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cost-map-cost-cell small {
  color: var(--muted);
  line-height: 1.35;
}

.cost-map-price-empty {
  color: #9aa1ad;
  text-align: center;
}

.cost-map-manual-cell {
  background: #fffaf5 !important;
}

.cost-map-manual-quote {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.cost-map-manual-quote.active,
.cost-map-manual-quote.has-value {
  border-color: #ffd0d0;
  background: #fff7f7;
}

.cost-map-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.cost-map-manual-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #e1e5ec;
  border-radius: 6px;
  padding: 0 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.cost-map-manual-input:focus {
  outline: 2px solid rgba(218, 35, 35, 0.16);
  border-color: var(--red-line);
}

.cost-map-manual-input:disabled {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

.cost-map-manual-save,
.cost-map-manual-select {
  height: 30px;
  border: 1px solid #e1e5ec;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: #303743;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cost-map-manual-save:hover,
.cost-map-manual-select:hover {
  border-color: var(--red-line);
  color: var(--red);
}

.cost-map-manual-quote small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cost-map-tree {
  max-height: 620px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 4px;
}

.cost-map-node {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px 9px calc(10px + var(--depth, 0) * 16px);
  border: 1px solid #eef0f3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.cost-map-node:hover,
.cost-map-node.active {
  border-color: var(--red-line);
  background: #fff7f7;
}

.cost-map-node-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cost-map-node-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.cost-map-node-main small {
  color: var(--muted);
  font-size: 11px;
}

.cost-map-match,
.cost-map-unmatched {
  white-space: nowrap;
  font-size: 11px;
  color: #256f4a;
}

.cost-map-unmatched {
  color: #7a808a;
}

.cost-map-detail {
  display: grid;
  gap: 16px;
}

.cost-map-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.cost-map-title-row h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.cost-map-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.cost-map-facts div,
.cost-map-standard,
.cost-map-guide-block {
  border: 1px solid #eef0f3;
  border-radius: 6px;
  background: #fff;
}

.cost-map-facts div {
  padding: 10px;
}

.cost-map-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.cost-map-facts dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.cost-map-standards {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.cost-map-standard {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.cost-map-standard.active {
  border-color: var(--red-line);
  background: #fff7f7;
}

.cost-map-standard span {
  color: var(--muted);
  font-size: 12px;
}

.cost-map-standard b {
  line-height: 1.45;
}

.cost-map-guide-block {
  padding: 12px;
}

.cost-map-guide-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.cost-map-guide-block p {
  margin: 6px 0 0;
  color: #3f4651;
  line-height: 1.65;
  white-space: pre-line;
}

.cost-map-price-block {
  display: grid;
  gap: 12px;
}

.cost-map-price-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.cost-map-price-summary div {
  border: 1px solid #eef0f3;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

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

.cost-map-price-summary b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.cost-map-breakdown-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.cost-map-breakdown-table .col-project {
  width: 15%;
}

.cost-map-breakdown-table .col-source {
  width: 16%;
}

.cost-map-breakdown-table .col-level,
.cost-map-breakdown-table .col-action {
  width: 7%;
}

.cost-map-breakdown-table .col-money {
  width: 9%;
}

.cost-map-breakdown-table .col-rate {
  width: 8%;
}

.cost-map-breakdown-table .col-drag {
  width: 6%;
}

.cost-map-breakdown-table .col-category {
  width: 12%;
}

.cost-map-breakdown-table .col-component {
  width: 24%;
}

.cost-map-breakdown-table .col-param {
  width: 11%;
}

.cost-map-breakdown-table th,
.cost-map-breakdown-table td {
  border-bottom: 1px solid #edf0f4;
  padding: 7px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cost-map-breakdown-table tr.active td {
  background: #fff7f7;
}

.cost-map-component-table {
  min-width: 840px;
}

.cost-map-drag-cell {
  text-align: center;
}

.cost-map-drag-handle {
  width: 100%;
  min-height: 30px;
  border: 1px solid #e1e5ec;
  border-radius: 6px;
  background: #fff;
  color: #667085;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: grab;
}

.cost-map-drag-handle:active {
  cursor: grabbing;
}

.cost-map-component-row-dragging td {
  background: #fff7ed !important;
  opacity: 0.72;
}

.cost-map-param-input {
  width: 100%;
  min-width: 78px;
  height: 30px;
  border: 1px solid #dde3eb;
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.cost-map-param-input.numeric {
  text-align: right;
}

.cost-map-param-input:focus {
  outline: 0;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(199, 0, 11, 0.08);
}

.cost-map-inline-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
}

.cost-map-inline-button:hover {
  border-color: var(--red-line);
  color: var(--red);
}

.cost-map-row-action {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cost-map-row-action.danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.cost-map-row-action:hover {
  border-color: var(--red-line);
  color: var(--red);
}

.cost-map-edit-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}

.cost-map-edit-actions textarea {
  min-height: 38px;
  resize: vertical;
  border: 1px solid #dde3eb;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
}

.cost-map-history {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.cost-map-history-item {
  display: grid;
  gap: 3px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.cost-map-history-item span {
  color: var(--ink);
}

.cost-map-history-item small {
  color: var(--muted);
}

.cost-map-history-full {
  border-top: 1px solid #edf0f4;
  padding-top: 8px;
}

.cost-map-history-full summary {
  cursor: pointer;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 8px;
}

.panorama-project-table {
  min-width: 920px;
}

.panorama-link-button,
.panorama-subject-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.panorama-link-button:hover,
.panorama-link-button.active,
.panorama-subject-button:hover,
.panorama-subject-button.active {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panorama-link-button .muted {
  font-weight: 400;
}

.selected-row td {
  background: #fff0f1 !important;
}

.table-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.panorama-bars {
  display: grid;
  gap: 14px;
}

.panorama-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
  align-items: start;
}

.panorama-bar-label {
  min-width: 0;
}

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

.panorama-bar-label .panorama-link-button {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panorama-bar-label span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.panorama-bar-stack {
  display: grid;
  gap: 7px;
}

.panorama-mini-line {
  display: grid;
  grid-template-columns: 34px minmax(90px, 1fr) 86px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.panorama-mini-line b {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.panorama-track {
  height: 9px;
  background: #f0f1f3;
  border-radius: 999px;
  overflow: hidden;
}

.panorama-fill {
  height: 100%;
  border-radius: 999px;
}

.panorama-fill.budget {
  background: #f4c7ca;
}

.panorama-fill.actual {
  background: var(--red);
}

.cost-execution-panel {
  margin-top: 14px;
}

.cost-exec-matrix {
  --cost-exec-months: 3;
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cost-exec-head,
.cost-exec-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) repeat(var(--cost-exec-months), minmax(178px, 1fr)) minmax(106px, 0.45fr);
  gap: 8px;
  align-items: stretch;
  min-width: calc(300px + var(--cost-exec-months) * 178px);
}

.cost-exec-head {
  color: var(--muted);
  font-size: 12px;
  padding: 0 10px;
}

.cost-exec-head span:not(:first-child) {
  text-align: center;
}

.cost-exec-group {
  min-width: calc(300px + var(--cost-exec-months) * 178px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.cost-exec-group summary {
  cursor: pointer;
  list-style: none;
}

.cost-exec-group summary::-webkit-details-marker {
  display: none;
}

.cost-exec-group summary .cost-exec-row {
  background: #fff;
}

.cost-exec-group[open] summary .cost-exec-row {
  border-bottom: 1px solid var(--line);
}

.cost-exec-row {
  padding: 10px;
}

.cost-exec-row.leaf {
  padding-left: 24px;
  background: #fbfbfc;
  border-top: 1px solid #f0f1f3;
}

.cost-exec-subject {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.cost-exec-subject b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.cost-exec-group > summary .cost-exec-subject b::before {
  content: "▸";
  display: inline-block;
  width: 16px;
  color: var(--muted);
}

.cost-exec-group[open] > summary .cost-exec-subject b::before {
  content: "▾";
}

.cost-exec-row.leaf .cost-exec-subject b::before {
  content: "";
  width: 0;
}

.cost-exec-subject span {
  color: var(--muted);
  font-size: 12px;
}

.cost-exec-month-cell {
  display: grid;
  gap: 4px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
}

.cost-exec-row.leaf .cost-exec-month-cell {
  background: #ffffff;
}

.cost-exec-month-cell span,
.cost-exec-month-cell small {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.cost-exec-month-cell b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-exec-month-cell small {
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 4px;
}

.cost-exec-total-cell {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 3px;
  min-height: 86px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
}

.cost-exec-total-cell b {
  color: var(--text);
  font-size: 15px;
}

.cost-exec-total-cell span,
.cost-exec-total-cell small {
  color: var(--muted);
  font-size: 12px;
}

.cost-exec-children {
  display: grid;
}

.cost-exec-more,
.cost-exec-deduction-note {
  color: var(--muted);
  font-size: 12px;
}

.cost-exec-more {
  padding: 10px 24px 12px;
  background: #fbfbfc;
}

.cost-exec-deduction-note {
  min-width: calc(300px + var(--cost-exec-months) * 178px);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfbfc;
}

.cost-timeline-panel {
  margin-top: 10px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

#costTimeline .section-header {
  align-items: flex-start;
  margin-bottom: 16px;
}

#costTimeline .section-header h1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
}

#costTimeline .section-header h1 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.cost-timeline-page-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cost-timeline-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.cost-timeline-kpi-card {
  display: grid;
  gap: 14px;
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cost-timeline-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cost-timeline-kpi-head div {
  display: grid;
  gap: 5px;
}

.cost-timeline-kpi-head span {
  font-size: 15px;
  font-weight: 800;
}

.cost-timeline-kpi-head small,
.cost-timeline-kpi-foot {
  color: var(--muted);
  font-size: 12px;
}

.cost-timeline-kpi-head i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.cost-timeline-kpi-card > b {
  color: #111827;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cost-timeline-kpi-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cost-timeline-kpi-track {
  height: 7px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.cost-timeline-kpi-track em {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.cost-timeline-kpi-card.budget .cost-timeline-kpi-head span {
  color: #2563eb;
}

.cost-timeline-kpi-card.budget .cost-timeline-kpi-head i {
  background: #dbeafe;
  color: #2563eb;
}

.cost-timeline-kpi-card.budget .cost-timeline-kpi-track em {
  background: #cbd5e1;
}

.cost-timeline-kpi-card.actual .cost-timeline-kpi-head span {
  color: #16944a;
}

.cost-timeline-kpi-card.actual .cost-timeline-kpi-head i {
  background: #dcfce7;
  color: #16944a;
}

.cost-timeline-kpi-card.actual .cost-timeline-kpi-track em {
  background: #16a34a;
}

.cost-timeline-kpi-card.payment .cost-timeline-kpi-head span {
  color: #ea580c;
}

.cost-timeline-kpi-card.payment .cost-timeline-kpi-head i {
  background: #ffedd5;
  color: #ea580c;
}

.cost-timeline-kpi-card.payment .cost-timeline-kpi-track em {
  background: #f97316;
}

.cost-timeline-kpi-card.payable .cost-timeline-kpi-head span {
  color: #7c3aed;
}

.cost-timeline-kpi-card.payable .cost-timeline-kpi-head i {
  background: #ede9fe;
  color: #7c3aed;
}

.cost-timeline-kpi-card.payable .cost-timeline-kpi-track em {
  background: #8b5cf6;
}

.cost-timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: end;
  margin-bottom: 14px;
}

.cost-timeline-filter-field {
  flex: 0 1 150px;
}

.cost-timeline-period-field {
  flex: 1 1 720px;
}

.cost-timeline-quarter-filter {
  flex: 0 0 auto;
}

.cost-timeline-filter-field,
.cost-timeline-period-field,
.cost-timeline-search {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cost-timeline-filter-field span,
.cost-timeline-period-field span,
.cost-timeline-search span,
.cost-timeline-metric-filter span,
.cost-timeline-status-filter span {
  color: var(--muted);
  font-size: 12px;
}

.cost-timeline-filter-field b,
.cost-timeline-filter-field select {
  display: flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.cost-timeline-filter-field select {
  width: 100%;
  font: inherit;
}

.cost-timeline-month-filter {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  align-items: start;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding-bottom: 20px;
  cursor: pointer;
}

.cost-timeline-month-filter::before {
  content: "";
  position: absolute;
  left: var(--range-start, 4.1667%);
  right: calc(100% - var(--range-end, 95.8333%));
  bottom: 9px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
}

.cost-timeline-month-filter button {
  position: relative;
  z-index: 1;
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cost-timeline-month-filter button.active,
.cost-timeline-month-filter button:hover {
  color: var(--red);
}

.cost-timeline-month-filter button:hover {
  background: var(--red-soft);
}

.cost-timeline-range-handle {
  position: absolute;
  z-index: 2;
  bottom: 4px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 4px rgba(199, 0, 11, 0.35);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}

.cost-timeline-range-handle.start {
  left: var(--range-start, 4.1667%);
  transform: translateX(-50%);
}

.cost-timeline-range-handle.end {
  left: var(--range-end, 95.8333%);
  transform: translateX(-50%);
}

.cost-timeline-quarter-filter,
.cost-timeline-metric-filter,
.cost-timeline-status-filter,
.cost-timeline-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cost-timeline-metric-filter,
.cost-timeline-status-filter {
  flex: 0 1 auto;
}

.cost-timeline-search {
  flex: 1 1 360px;
}

.cost-timeline-toolbar-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-left: auto;
}

.cost-timeline-quarter-filter button,
.cost-timeline-metric-filter button,
.cost-timeline-status-filter button,
#costTimelineAllMonths,
.cost-timeline-toolbar-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: #303743;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cost-timeline-quarter-filter button.active,
.cost-timeline-quarter-filter button:hover,
.cost-timeline-metric-filter button.active,
.cost-timeline-metric-filter button:hover,
.cost-timeline-status-filter button.active,
.cost-timeline-status-filter button:hover,
#costTimelineAllMonths.active,
#costTimelineAllMonths:hover {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.cost-timeline-search input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
}

.cost-gantt-table {
  --cost-timeline-months: 12;
  min-width: 1180px;
  background: #fff;
}

.cost-gantt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
}

.cost-gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cost-gantt-legend b {
  margin-left: auto;
  color: #4b5563;
  font-weight: 700;
}

.cost-gantt-legend i {
  width: 26px;
  height: 7px;
  border-radius: 999px;
}

.cost-gantt-legend .budget,
.cost-gantt-bar.budget {
  background: #cbd5e1;
}

.cost-gantt-legend .actual,
.cost-gantt-bar.actual {
  background: var(--red);
}

.cost-gantt-legend .payment,
.cost-gantt-bar.payment {
  background: #3b82f6;
}

.cost-gantt-head,
.cost-gantt-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(130px, 0.55fr) minmax(520px, 2.5fr) 86px 118px 86px 90px;
  min-width: 0;
}

.cost-gantt-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.cost-gantt-head > span,
.cost-gantt-head > div,
.cost-gantt-row > div {
  border-right: 1px solid #edf0f4;
  padding: 12px;
}

.cost-gantt-head > *:last-child,
.cost-gantt-row > *:last-child {
  border-right: 0;
}

.cost-gantt-month-head,
.cost-gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--cost-timeline-months), minmax(36px, 1fr));
  min-width: 0;
}

.cost-gantt-month-head {
  align-items: center;
  padding: 0;
  text-align: center;
}

.cost-gantt-month-head span {
  padding: 12px 4px;
  border-right: 1px solid #edf0f4;
}

.cost-gantt-month-head span:last-child {
  border-right: 0;
}

.cost-gantt-row {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.cost-gantt-row.level-1 {
  background: #fbfbfc;
}

.cost-gantt-summary {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 1px solid #d9dee6;
  background: #fff;
  font-weight: 800;
}

.cost-gantt-subject {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-content: center;
  gap: 6px;
  padding-left: calc(12px + var(--depth) * 16px) !important;
}

.cost-gantt-caret {
  color: #64748b;
  font-size: 14px;
  line-height: 1.25;
}

.cost-gantt-subject b,
.cost-gantt-amount b,
.cost-gantt-rate b {
  color: #111827;
}

.cost-gantt-subject small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cost-gantt-amount,
.cost-gantt-rate,
.cost-gantt-diff,
.cost-gantt-paid {
  display: grid;
  align-content: center;
  justify-items: end;
  font-variant-numeric: tabular-nums;
}

.cost-gantt-track-wrap {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.cost-gantt-track-labels {
  display: grid;
  grid-template-rows: repeat(3, 10px);
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.cost-gantt-track {
  position: relative;
  grid-template-rows: repeat(3, 10px);
  gap: 5px;
  min-height: 42px;
}

.cost-gantt-cell {
  grid-row: 1 / span 3;
  border-left: 1px solid #edf0f4;
  background: transparent;
}

.cost-gantt-bar {
  z-index: 1;
  display: block;
  height: 6px;
  margin: 2px 4px 0;
  border-radius: 999px;
}

.cost-gantt-bar.budget {
  grid-row: 1;
}

.cost-gantt-bar.actual {
  grid-row: 2;
}

.cost-gantt-bar.payment {
  grid-row: 3;
}

.cost-gantt-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.cost-gantt-status.ok {
  background: #dcfce7;
  color: #168244;
}

.cost-gantt-status.warn {
  background: #ffedd5;
  color: #c2410c;
}

.cost-gantt-status.risk {
  background: #fee2e2;
  color: #b91c1c;
}

.panorama-breadcrumb {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px;
  margin-top: 8px;
}

.panorama-breadcrumb button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.panorama-breadcrumb button:hover {
  color: var(--red);
  text-decoration: underline;
}

.panorama-drill-kpis {
  margin-bottom: 14px;
}

.panorama-month-note {
  margin: 10px 0 0;
}

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

.quality-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.quality-number {
  font-size: 22px;
  color: var(--red);
  font-weight: 800;
}

.energy-quality-item {
  display: grid;
  gap: 5px;
}

.energy-metric-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-panel {
  margin-bottom: 14px;
}

.upload-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

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

.primary-button {
  border: 0;
  background: var(--red);
  color: #ffffff;
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

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

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--red-line);
  color: var(--red);
  background: var(--red-soft);
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  cursor: pointer;
  font-weight: 800;
  text-align: right;
}

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

.trend-link {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.trend-link:hover,
.trend-link.active {
  color: var(--red);
  text-decoration: underline;
}

.drill-panel {
  margin-top: 14px;
}

.drill-page-header {
  align-items: center;
}

.drill-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.drill-title h2 {
  font-size: 18px;
}

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

.drill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.monthly-trend-panel {
  margin-top: 14px;
}

.monthly-trend-card {
  padding: 16px;
}

.monthly-trend-header {
  align-items: flex-start;
}

.monthly-trend-summary {
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.monthly-trend-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  align-items: stretch;
}

.monthly-trend-chart {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.monthly-trend-chart svg {
  width: 100%;
  min-height: 260px;
  display: block;
}

.monthly-trend-table {
  max-height: 280px;
}

.reason-cell {
  min-width: 120px;
  color: var(--muted);
}

.reason-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red-line);
  font-size: 12px;
  font-weight: 700;
}

.reason-note-empty {
  color: #9aa1aa;
}

.reason-editor {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-width: 320px;
}

.reason-textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  resize: vertical;
  color: var(--text);
  font: inherit;
}

.reason-textarea:focus {
  outline: 2px solid var(--red-line);
  border-color: var(--red);
}

.reason-editor-actions {
  display: block;
}

.reason-save {
  min-height: 34px;
  min-width: 64px;
  padding: 6px 10px;
  white-space: nowrap;
}

.revision-amount-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  text-align: left;
}

.amount-with-revision {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.amount-value {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.revision-marker-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.amount-revision-col {
  text-align: left;
  white-space: nowrap;
}

.reason-detail-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1180px;
}

.reason-detail-table .reason-col-rank {
  width: 48px;
}

.reason-detail-table .reason-col-project {
  width: 160px;
}

.reason-detail-table .reason-col-subject {
  width: 170px;
}

.reason-detail-table .reason-col-amount {
  width: 116px;
}

.reason-detail-table .reason-col-variance {
  width: 104px;
}

.reason-detail-table .reason-col-tag {
  width: 170px;
}

.reason-detail-table .reason-col-note {
  width: 360px;
}

.reason-detail-table th,
.reason-detail-table td {
  vertical-align: middle;
}

.reason-detail-table .amount-revision-col {
  text-align: left;
}

.reason-detail-table .amount-with-revision {
  min-width: 0;
}

.dimension-table {
  table-layout: fixed;
  width: 100%;
  min-width: 680px;
}

.dimension-table .dimension-col-name {
  width: 44%;
}

.dimension-table .dimension-col-amount {
  width: 15%;
}

.dimension-table .dimension-col-variance {
  width: 16%;
}

.dimension-table .dimension-col-rate {
  width: 10%;
}

.dimension-table .numeric {
  text-align: left;
}

.rank-table {
  table-layout: fixed;
  width: 100%;
  min-width: 680px;
}

.rank-table .rank-col-index {
  width: 5%;
}

.rank-table .rank-col-name {
  width: 43%;
}

.rank-table .rank-col-amount {
  width: 14%;
}

.rank-table .rank-col-variance {
  width: 14%;
}

.rank-table .rank-col-rate {
  width: 10%;
}

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

.rank-table .numeric {
  text-align: left;
}

.rank-table .amount-with-revision {
  justify-content: start;
}

.rank-table .amount-value {
  text-align: left;
}

.revision-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--red-line);
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.amount-revise-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
}

.amount-revise-button:hover {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 31, 0.42);
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(24, 31, 39, 0.22);
  padding: 20px;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.icon-close-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.revision-scope {
  margin: 0 0 14px;
  color: var(--text);
  font-weight: 700;
}

.revision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.revision-grid label,
.revision-reason {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.revision-grid select,
.revision-grid input,
.revision-reason textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
}

.revision-baseline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.revision-baseline span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fb;
  padding: 8px 10px;
}

.revision-reason {
  margin-bottom: 12px;
}

.revision-history-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.revision-history {
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  margin-bottom: 14px;
}

.revision-history-item,
.revision-history-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
}

.revision-history-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.revision-history-item p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 0;
  color: var(--muted);
}

.revision-history-item p span {
  white-space: nowrap;
}

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

.revision-message {
  margin-right: auto;
  color: var(--risk);
  font-size: 12px;
}

.revision-message.ok {
  color: #087f5b;
}

.upload-status {
  margin-top: 14px;
  color: var(--muted);
}

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

.profile-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffafa;
}

.profile-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.profile-value {
  font-weight: 700;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fafbfc;
  position: sticky;
  top: 0;
}

tbody tr:nth-child(2n) td {
  background: #fff7f7;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.variance-positive {
  color: var(--risk);
  font-weight: 700;
}

.variance-negative {
  color: #505862;
  font-weight: 700;
}

.severity {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.severity.error,
.severity.risk {
  color: var(--risk);
  background: #fff0ee;
}

.severity.warning {
  color: var(--warn);
  background: #fff7e8;
}

.severity.info {
  color: var(--good);
  background: #ecf8f2;
}

.reason-card,
.action-card,
.driver-card,
.approval-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.reason-card h3,
.action-card h3,
.driver-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.approval-list {
  display: grid;
  gap: 12px;
}

.approval-card {
  display: grid;
  gap: 12px;
}

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

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

.approval-grid label,
.approval-grid .form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.approval-actions input,
.approval-actions select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.approvals-page {
  gap: 14px;
}

.approvals-page.active {
  display: grid;
}

.approval-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0 4px;
}

.approval-page-header h1 {
  margin: 2px 0 4px;
}

.approval-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(150px, 0.7fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

.approval-toolbar input,
.approval-toolbar select {
  min-height: 38px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
}

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

.approval-kpi-card {
  display: grid;
  gap: 4px;
  min-height: 90px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.approval-kpi-card span,
.approval-kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

.approval-kpi-card strong {
  color: #111827;
  font-size: 26px;
  line-height: 1.1;
}

.approval-kpi-card.risk {
  border-color: var(--red-line);
  background: #fff7f7;
}

.approval-kpi-card.warning {
  border-color: #ffe1ad;
  background: #fffbf3;
}

.approval-workbench {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(420px, 1.5fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}

.approval-org-panel,
.approval-list-panel,
.approval-detail-panel {
  min-height: 620px;
}

.approval-org-tree {
  display: grid;
  gap: 2px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.approval-tree-node {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
}

.approval-tree-node.level-1 {
  padding-left: 14px;
}

.approval-tree-node.level-2 {
  padding-left: 28px;
}

.approval-tree-node.level-3 {
  padding-left: 42px;
}

.approval-tree-toggle,
.approval-tree-spacer {
  width: 18px;
  height: 30px;
}

.approval-tree-toggle {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.approval-tree-toggle::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #98a2b3;
  transition: transform 0.15s ease;
}

.approval-tree-toggle.expanded::before {
  transform: rotate(90deg);
}

.approval-tree-label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  color: #344054;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.approval-tree-label:hover,
.approval-tree-node.active .approval-tree-label {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red);
}

.approval-tree-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-tree-label b {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f0f2f5;
  color: #667085;
  font-size: 12px;
  text-align: center;
}

.approval-tree-node.active .approval-tree-label b,
.approval-tree-label:hover b {
  background: #ffffff;
  color: var(--red);
}

.approval-org-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e8f1ff;
  color: #2f80ed;
  font-size: 12px;
  font-weight: 800;
}

.approval-tree-node.active .approval-org-icon,
.approval-tree-label:hover .approval-org-icon {
  background: #ffffff;
  color: var(--red);
}

.approval-org-branch {
  display: grid;
  gap: 4px;
}

.approval-org-projects {
  display: grid;
  gap: 2px;
}

.approval-org-projects .approval-tree-label {
  min-height: 30px;
  font-size: 12px;
}

.approval-list-header {
  align-items: center;
}

.approval-tabs {
  flex: 0 0 auto;
}

.approval-table-wrap {
  max-height: 560px;
  overflow: auto;
}

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

.approval-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.approval-table tbody tr {
  cursor: pointer;
}

.approval-table tbody tr:hover td,
.approval-table tbody tr.active td {
  background: #fff1f2;
}

.approval-member-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.approval-avatar,
.approval-detail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f4d8da;
  color: var(--red);
  font-weight: 800;
}

.approval-table small {
  color: var(--muted);
}

.approval-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.approval-status.success {
  color: var(--good);
  background: #ecf8f2;
  border: 1px solid #cfe8dc;
}

.approval-status.warning {
  color: var(--warn);
  background: #fff7e8;
  border: 1px solid #ffdca0;
}

.approval-status.neutral {
  color: #596579;
  background: #f3f5f8;
  border: 1px solid #dfe3ea;
}

.approval-status.danger {
  color: var(--risk);
  background: #fff4f2;
  border: 1px solid #ffd0cc;
}

.approval-detail-form {
  display: grid;
  gap: 14px;
}

.approval-detail-profile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  background: #fbfcfe;
}

.approval-detail-avatar {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.approval-detail-profile h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.approval-detail-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.approval-detail-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.approval-detail-form .approval-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.approval-detail-form .approval-grid label {
  align-self: start;
}

.approval-detail-form .approval-grid .form-field {
  grid-column: 1 / -1;
}

.approval-detail-section {
  display: grid;
  gap: 10px;
}

.approval-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.approval-section-title small {
  color: var(--muted);
  font-weight: 400;
}

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

.approval-permission-group {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.approval-permission-group b {
  color: var(--red);
  font-size: 13px;
}

.approval-permission-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-size: 12px;
}

.approval-permission-group input {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
}

.danger-button {
  border: 1px solid #ffd0cc;
  background: #fff4f2;
  color: var(--risk);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.reason-meta,
.action-meta,
.driver-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  line-height: 1.6;
}

.rule-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.loading,
.empty {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.material-search-panel {
  margin-bottom: 14px;
}

.material-mode-switch {
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  min-height: 32px;
}

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

.material-filter-grid label,
.material-fuzzy-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.material-filter-grid select,
.material-filter-grid input,
.material-fuzzy-panel input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.material-fuzzy-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.material-search-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.material-resizable-layout {
  --material-result-main-size: clamp(58%, 64vw, 70%);
  grid-template-columns: minmax(0, var(--material-result-main-size)) 10px minmax(300px, 1fr);
  align-items: stretch;
}

.material-maintenance-layout {
  --material-maintenance-main-size: clamp(64%, 70vw, 76%);
  grid-template-columns: minmax(0, var(--material-maintenance-main-size)) 10px minmax(220px, 1fr);
  align-items: stretch;
}

.material-resizable-layout > .panel,
.material-maintenance-layout > .panel {
  min-width: 0;
}

.material-pane-splitter {
  position: relative;
  align-self: stretch;
  min-height: 120px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.material-pane-splitter::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: #d8dde5;
  transform: translateX(-50%);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    width 0.15s ease;
}

.material-pane-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 34px;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow);
}

.material-pane-splitter:hover::before,
.material-pane-splitter:focus-visible::before,
.material-pane-splitter.is-resizing::before {
  width: 3px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(199, 0, 11, 0.08);
}

.material-pane-splitter:hover::after,
.material-pane-splitter:focus-visible::after,
.material-pane-splitter.is-resizing::after {
  border-color: var(--red-line);
}

.material-pane-splitter:focus-visible {
  outline: 2px solid var(--red-line);
  outline-offset: 2px;
}

.material-pane-resizing,
.material-pane-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.material-table {
  table-layout: fixed;
  width: max-content;
  min-width: 0;
}

.material-table th {
  position: sticky;
  overflow: visible;
  user-select: none;
}

.material-table th,
.material-table td {
  overflow-wrap: anywhere;
}

.material-col-label {
  display: block;
  padding-right: 8px;
}

.material-col-resizer {
  position: absolute;
  top: 0;
  right: -12px;
  z-index: 2;
  width: 24px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.material-col-resizer::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 11px;
  width: 1px;
  border-radius: 99px;
  background: #d7dde6;
  opacity: 0;
  transition:
    background 0.15s ease,
    opacity 0.15s ease,
    width 0.15s ease,
    box-shadow 0.15s ease;
}

.material-table th:hover .material-col-resizer::before {
  opacity: 0.42;
}

.material-col-resizer:hover::before,
.material-col-resizer.is-resizing::before {
  width: 2px;
  background: #d0001b;
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(208, 0, 27, 0.08);
}

.material-column-resizing,
.material-column-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.material-table td.numeric,
.material-table th.numeric {
  text-align: left;
  white-space: nowrap;
}

.material-feature-cell {
  color: #344054;
  line-height: 1.45;
}

.material-strategy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.material-strategy-badge.yes {
  color: var(--good);
  background: #edf7f2;
  border: 1px solid #cfe8dc;
}

.material-strategy-badge.no {
  color: #5d6672;
  background: #f4f5f7;
  border: 1px solid var(--line);
}

.material-table tbody tr {
  cursor: pointer;
}

.material-table tbody tr:hover td,
.material-table tbody tr.active td {
  background: #fff1f2;
}

.material-detail-card {
  display: grid;
  gap: 14px;
}

.material-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.material-detail-title h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

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

.material-detail-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-brand-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.material-brand-control select {
  min-width: 0;
}

.material-brand-control button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.material-filter-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.material-result-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.material-result-actions button {
  min-height: 28px;
  padding: 0 10px;
}

.material-result-footer {
  display: flex;
  justify-content: center;
  padding: 14px 0 2px;
}

.material-result-footer .secondary-button {
  min-height: 32px;
  padding: 0 14px;
}

.material-side-header {
  align-items: center;
}

.material-side-switch {
  width: min(240px, 100%);
  min-height: 36px;
}

.material-drag-cell,
.material-quote-add-cell {
  text-align: center;
  vertical-align: middle;
}

.material-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  color: #8b95a1;
  font-weight: 800;
  cursor: grab;
  user-select: none;
}

.material-table tbody tr.dragging td {
  background: #fff6f7;
  opacity: 0.72;
}

.material-quote-add-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--red-line);
  border-radius: 8px;
  background: #fff8f8;
  color: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.material-quote-add-button:hover {
  background: var(--red);
  color: #fff;
}

.material-quote-card {
  display: grid;
  gap: 14px;
}

.material-quote-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.material-quote-title h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.material-quote-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.material-quote-mode-switch {
  width: 196px;
  min-height: 32px;
}

.material-quote-title .secondary-button {
  min-height: 30px;
  padding: 5px 10px;
}

.material-quote-assist {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f1c7c9;
  border-radius: 8px;
  background: #fffafa;
}

.material-quote-assist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.material-quote-assist-head div {
  display: grid;
  gap: 4px;
}

.material-quote-assist-head b {
  font-size: 15px;
}

.material-quote-assist-head span,
.material-quote-assist-meta,
.material-quote-assist-chips button,
.material-suggestion-card small {
  color: var(--muted);
  font-size: 12px;
}

.material-quote-assist-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.material-quote-assist-search input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
}

.material-quote-assist-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.material-quote-assist-meta b {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--red);
  font-size: 12px;
}

.material-quote-assist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-quote-assist-chips button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  cursor: pointer;
}

.material-quote-assist-chips button:hover {
  border-color: var(--red-line);
  color: var(--red);
  background: var(--red-soft);
}

.material-quote-suggestions {
  display: grid;
  gap: 8px;
}

.material-suggestion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-suggestion-card div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.material-suggestion-card b,
.material-suggestion-card span {
  overflow-wrap: anywhere;
}

.material-suggestion-card span {
  color: #4d5762;
  font-size: 12px;
}

.material-suggestion-price {
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.material-suggestion-price strong {
  color: var(--red);
  font-size: 16px;
}

.material-quote-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed #ef9aa1;
  border-radius: 8px;
  background: #fff8f8;
  color: var(--red);
  text-align: center;
}

.material-quote-empty span {
  color: #9b5660;
  font-size: 12px;
}

.material-quote-empty.drag-over,
.material-quote-table-wrap.drag-over {
  border-color: var(--red);
  background: #fff5f6;
  box-shadow: inset 0 0 0 1px rgba(199, 0, 11, 0.12);
}

.material-quote-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-quote-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.material-quote-table th,
.material-quote-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.material-quote-table th {
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.material-quote-table tbody tr:last-child td {
  border-bottom: 0;
}

.material-quote-table tr.adjusted td {
  background: #fffaf2;
}

.material-quote-table tr.trace-missing td {
  background: #fff6f6;
}

.material-quote-table tr.editing td {
  background: #fffdf8;
}

.material-quote-table td:first-child {
  min-width: 150px;
}

.material-quote-table td:first-child b,
.material-quote-table td:first-child small {
  display: block;
}

.material-quote-table td:first-child small {
  margin: 4px 0 6px;
  color: var(--muted);
  line-height: 1.45;
}

.material-quote-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.material-quote-text-input,
.material-quote-textarea,
.material-quote-unit-input,
.material-quote-price-input,
.material-quote-trace-fields input,
.material-quote-trace-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.material-quote-text-input,
.material-quote-unit-input,
.material-quote-price-input,
.material-quote-trace-fields input {
  height: 30px;
  padding: 0 8px;
}

.material-quote-textarea,
.material-quote-trace-fields textarea {
  min-height: 48px;
  padding: 7px 8px;
  resize: vertical;
}

.material-quote-textarea.compact {
  margin-top: 6px;
}

.material-quote-text-input:focus,
.material-quote-textarea:focus,
.material-quote-unit-input:focus,
.material-quote-price-input:focus,
.material-quote-trace-fields input:focus,
.material-quote-trace-fields textarea:focus {
  outline: 2px solid rgba(218, 35, 35, 0.14);
  border-color: var(--red-line);
}

.material-quote-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.material-quote-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.material-quote-badge.manual {
  color: #216e4e;
  background: #e9f7ef;
  border: 1px solid #c7ead8;
}

.material-quote-badge.adjusted {
  color: #9a5b00;
  background: #fff4dc;
  border: 1px solid #f4d49a;
}

.material-quote-badge.missing {
  color: var(--risk);
  background: #fff1f1;
  border: 1px solid #f2b8b8;
}

.material-quote-unit-cell,
.material-quote-price-cell,
.material-quote-trace-display,
.material-quote-trace-fields {
  display: grid;
  gap: 5px;
}

.material-quote-unit-cell {
  width: 92px;
}

.material-quote-price-cell {
  width: 116px;
}

.material-quote-static-value,
.material-quote-unit-cell b,
.material-quote-price-cell b {
  font-weight: 700;
  white-space: nowrap;
}

.material-quote-unit-cell small,
.material-quote-price-cell small,
.material-quote-trace-display span,
.material-quote-trace-display small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.material-quote-price-input {
  text-align: right;
}

.material-quote-trace-fields {
  min-width: 230px;
}

.material-quote-trace-display {
  min-width: 220px;
  max-width: 320px;
}

.material-quote-trace-display b,
.material-quote-trace-display span,
.material-quote-trace-display small {
  overflow-wrap: anywhere;
}

.material-quote-trace-display.missing b {
  color: var(--risk);
}

.material-quote-trace-fields small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.material-quote-trace-fields .invalid {
  border-color: #e06666;
  background: #fffafa;
}

.material-quote-stepper {
  display: grid;
  grid-template-columns: 28px 52px 28px;
  align-items: center;
}

.material-quote-stepper button,
.material-quote-stepper input,
.material-quote-tax-input {
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.material-quote-stepper button {
  cursor: pointer;
  font-weight: 700;
}

.material-quote-stepper button:first-child {
  border-radius: 8px 0 0 8px;
}

.material-quote-stepper button:last-child {
  border-radius: 0 8px 8px 0;
}

.material-quote-stepper input {
  border-left: 0;
  border-right: 0;
  text-align: center;
}

.material-quote-tax-input {
  width: 66px;
  border-radius: 8px;
  padding: 0 8px;
  text-align: right;
}

.material-quote-tax-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.material-quote-tax-cell span {
  color: var(--muted);
  font-size: 12px;
}

.material-quote-remove-button {
  border: 0;
  background: transparent;
  color: var(--risk);
  font-weight: 700;
  cursor: pointer;
}

.material-quote-operation-cell {
  min-width: 68px;
}

.material-quote-actions {
  display: grid;
  gap: 8px;
}

.material-quote-actions .secondary-button {
  min-height: 28px;
  padding: 4px 9px;
}

.material-quote-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #f1c7c9;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8f8 0%, #ffffff 100%);
}

.material-quote-summary div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid #f1d9db;
  border-bottom: 1px solid #f1d9db;
}

.material-quote-summary div:nth-child(4n) {
  border-right: 0;
}

.material-quote-summary div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.material-quote-summary span {
  color: var(--muted);
  font-size: 12px;
}

.material-quote-summary b {
  font-size: 18px;
}

.material-quote-summary .total b {
  color: var(--red);
  font-size: 24px;
}

.material-quote-summary .warning b {
  color: var(--risk);
}

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

.material-detail-grid span,
.material-raw-text span {
  color: var(--muted);
  font-size: 12px;
}

.material-detail-grid b {
  overflow-wrap: anywhere;
}

.material-raw-text {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.material-raw-text p {
  margin: 0;
  line-height: 1.7;
}

.material-import-shell {
  display: grid;
  gap: 12px;
}

.material-import-drop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 14px;
  border: 1px dashed #d7dce5;
  border-radius: 8px;
  background: #fafbfc;
}

.material-import-drop span {
  color: var(--muted);
  font-size: 12px;
}

.material-import-drop > button {
  grid-row: span 2;
}

.material-ai-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
}

.material-ai-form label:first-child {
  grid-column: span 2;
  min-width: 0;
}

#materialAiUploadButton {
  min-height: 36px;
  white-space: nowrap;
}

.material-ai-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.material-ai-form input,
.material-ai-form select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.material-ai-message {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border: 1px solid #c7dbff;
  border-radius: 8px;
  background: #f3f7ff;
  color: #214a8d;
  font-size: 12px;
}

.material-ai-message.error {
  border-color: #f2b8b5;
  background: #fff5f5;
  color: #b42318;
}

.material-ai-review,
.material-ai-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-ai-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.material-ai-review-head div {
  display: grid;
  gap: 4px;
}

.material-ai-review-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
}

.material-ai-review-head span {
  color: var(--muted);
  font-size: 12px;
}

.material-ai-candidates {
  display: grid;
  gap: 10px;
}

.material-ai-progress {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f7;
  border-radius: 8px;
  background: #f7faff;
}

.material-ai-progress.error {
  border-color: #f2b8b5;
  background: #fff5f5;
}

.material-ai-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.material-ai-progress-head span {
  color: var(--muted);
}

.material-ai-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.material-ai-progress-track i {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: #d6000f;
  transition: width 0.35s ease;
}

.material-ai-trace {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.material-ai-trace-step {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.material-ai-trace-step i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.material-ai-trace-step.done i {
  background: #16a34a;
}

.material-ai-trace-step.active {
  border-color: #c7dbff;
  background: #f2f6ff;
}

.material-ai-trace-step.active i {
  background: #d6000f;
}

.material-ai-trace-step.error {
  border-color: #f2b8b5;
}

.material-ai-trace-step.error i {
  background: #b42318;
}

.material-ai-trace-step b,
.material-ai-trace-step span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.material-ai-trace-step b {
  font-size: 12px;
}

.material-ai-trace-step span {
  color: var(--muted);
  font-size: 11px;
}

.material-ai-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-ai-candidate-actions .danger {
  border-color: #ffd0cc;
  background: #fff4f2;
  color: var(--risk);
}

.material-ai-candidate-table,
.material-ai-job-table {
  min-width: 1200px;
}

.material-ai-candidate-table td,
.material-ai-job-table td {
  vertical-align: top;
}

.material-ai-candidate-table input[type="text"],
.material-ai-candidate-table input[type="number"],
.material-ai-candidate-table input[type="date"],
.material-ai-candidate-table select {
  width: 100%;
  min-width: 92px;
  min-height: 32px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.material-ai-candidate-table input[type="number"] {
  text-align: right;
}

.material-ai-candidate-table input:focus {
  border-color: #d6000f;
  outline: 2px solid rgba(214, 0, 15, 0.12);
}

.material-ai-candidate-table td b,
.material-ai-candidate-table td small {
  display: block;
}

.material-ai-candidate-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.material-ai-candidate-table tr.has-error td {
  background: #fff8f0;
}

.material-ai-job-table tbody tr {
  cursor: pointer;
}

.material-ai-job-table tbody tr:hover td,
.material-ai-job-table tbody tr.active td {
  background: #f4f7fb;
}

.material-import-table {
  min-width: 720px;
}

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

.material-alias-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-alias-item span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.energy-board-page {
  color: #e9fbff;
}

.page-section.active.energy-board-page {
  display: flex;
  flex-direction: column;
}

.energy-board-page .section-header,
.energy-board-page > .content-grid {
  display: none;
}

.energy-board-page #analysisScopePanel {
  order: 1;
  margin-bottom: 12px;
  border-color: #164d5e;
  background: #121a1d;
  box-shadow: none;
}

.energy-board-page #analysisScopePanel .field-label,
.energy-board-page #analysisScopePanel label {
  color: #88d8e9;
}

.energy-board-page #analysisScopePanel select,
.energy-board-page #analysisScopePanel .filter-button,
.energy-board-page #analysisScopePanel .filter-search {
  border-color: #1e5e70;
  background: #0d1417;
  color: #e9fbff;
}

.energy-board-page #analysisScopePanel .filter-panel,
.energy-board-page #analysisScopePanel .project-check-list {
  border-color: #1e5e70;
  background: #111a1e;
}

.energy-board-page #analysisScopePanel .project-option {
  color: #e9fbff;
}

.energy-board-page #analysisScopePanel .project-option:hover {
  background: rgba(47, 216, 255, 0.12);
}

.energy-board-page #kpiGrid {
  order: 2;
  display: block;
  margin-bottom: 0;
}

.energy-board {
  min-width: 1060px;
  padding: 14px;
  border: 1px solid #164d5e;
  border-radius: 6px;
  background: #0f1416;
  box-shadow: inset 0 0 0 1px rgba(49, 216, 255, 0.08);
}

.energy-board-titlebar {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 12px;
  color: #ffffff;
}

.energy-board-titlebar::before,
.energy-board-titlebar::after {
  content: "";
  position: absolute;
  top: 32px;
  height: 1px;
  background: #1db7d8;
}

.energy-board-titlebar::before {
  left: 0;
  right: calc(50% + 235px);
}

.energy-board-titlebar::after {
  left: calc(50% + 235px);
  right: 0;
}

.energy-board-titlebar > div:first-child {
  display: contents;
}

.energy-board-titlebar span {
  grid-column: 1;
  align-self: end;
  color: #ffffff;
  font-weight: 800;
}

.energy-board-titlebar h2 {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1.2;
}

.energy-board-date {
  grid-column: 3;
  justify-self: end;
  align-self: end;
  color: #ffffff;
  font-weight: 800;
}

.energy-board-top,
.energy-board-main {
  display: grid;
  gap: 12px;
}

.energy-board-top {
  grid-template-columns: minmax(260px, 1.05fr) minmax(360px, 1.35fr) minmax(300px, 1.05fr);
  margin-bottom: 12px;
}

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

.energy-board-panel {
  position: relative;
  min-width: 0;
  border: 1px solid #16c7ef;
  border-radius: 6px;
  background: #1c2629;
  padding: 14px 16px;
  overflow: hidden;
}

.energy-board-panel::before,
.energy-board-panel::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #2ce5ff;
  pointer-events: none;
}

.energy-board-panel::before {
  top: -1px;
  left: -1px;
  border-top: 3px solid;
  border-left: 3px solid;
}

.energy-board-panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 3px solid;
  border-bottom: 3px solid;
}

.energy-board-panel h3 {
  margin: 0 0 12px;
  color: #25d7ff;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}

.energy-board-panel h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  background: #36e49b;
}

.energy-board-panel h3 span {
  margin-left: 8px;
  color: #9cecff;
  font-size: 12px;
  font-weight: 700;
}

.energy-board-panel svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 210px;
}

.energy-board-panel-hero {
  display: grid;
  place-items: center;
  background: #1b2529;
  box-shadow: inset 0 0 70px rgba(67, 116, 203, 0.24);
}

.energy-hero-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 32px;
  text-align: center;
}

.energy-hero-metric {
  min-width: 0;
}

.energy-hero-metric strong {
  display: block;
  color: #35d4ff;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.energy-hero-metric span {
  display: block;
  margin-top: 9px;
  color: #ffffff;
  font-size: 14px;
}

.energy-hero-period {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid rgba(53, 212, 255, 0.52);
  color: #9cecff;
  font-size: 12px;
}

.energy-execution-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  color: #5bdfff;
}

.energy-execution-track {
  height: 22px;
  background: #2a3a50;
  overflow: hidden;
}

.energy-execution-track i {
  display: block;
  height: 100%;
}

.energy-execution-row b,
.energy-division-row b {
  color: #e9fbff;
  font-size: 12px;
  text-align: right;
}

.energy-division-bars {
  display: grid;
  gap: 8px;
}

.energy-division-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
}

.energy-division-row span {
  color: #37dfff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-division-stack {
  display: grid;
  gap: 3px;
}

.energy-division-stack i {
  display: block;
  height: 8px;
}

.energy-division-stack .actual,
.energy-mini-legend .actual {
  background: #32d8ff;
}

.energy-division-stack .budget,
.energy-mini-legend .budget {
  background: #ff7a2f;
}

.energy-mini-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  color: #e9fbff;
  font-size: 12px;
}

.energy-mini-legend i {
  width: 10px;
  height: 10px;
}

.energy-pie-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 250px;
}

.energy-pie {
  position: relative;
  width: min(230px, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.energy-pie::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #1c2629;
}

.energy-pie span {
  position: absolute;
  inset: 31%;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  color: #ffffff;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.energy-pie small {
  display: block;
  color: #9cecff;
  font-size: 11px;
}

.energy-pie-legend {
  display: grid;
  gap: 8px;
}

.energy-pie-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
  color: #dcefff;
  font-size: 12px;
}

.energy-pie-legend-row i {
  height: 10px;
}

.energy-pie-legend-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-pie-legend-row b {
  color: #ffffff;
  text-align: right;
}

.energy-board-observe {
  min-height: 260px;
}

.energy-observe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding-top: 8px;
}

.energy-observe-grid div {
  min-width: 0;
  border-top: 1px solid rgba(53, 212, 255, 0.38);
  padding-top: 10px;
}

.energy-observe-grid b {
  display: block;
  color: #ffc928;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.energy-observe-grid span {
  display: block;
  margin-top: 5px;
  color: #9cecff;
  font-size: 12px;
}

.energy-board-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: #9cecff;
}

.energy-division-panel-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.energy-division-pair {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.energy-division-name {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.energy-board-page {
  color: #111827;
}

.page-section.active.energy-board-page {
  gap: 12px;
}

.energy-board-page .section-header {
  order: 0;
  display: flex;
  align-items: center;
  min-height: 52px;
  margin-bottom: 0;
  padding: 0 4px 8px;
  border-bottom: 1px solid #f0f2f5;
}

.energy-board-page .eyebrow {
  display: none;
}

.energy-board-page .section-header h1 {
  color: #c7000b;
  font-size: 28px;
  font-weight: 900;
}

.energy-board-page .section-conclusion {
  display: block;
  margin: 0;
  color: #4b5563;
  font-weight: 700;
}

.energy-board-page #analysisScopePanel {
  order: 1;
  margin-bottom: 0;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.energy-board-page #analysisScopePanel .field-label,
.energy-board-page #analysisScopePanel label {
  color: #374151;
  font-weight: 700;
}

.energy-board-page #analysisScopePanel select,
.energy-board-page #analysisScopePanel .filter-button,
.energy-board-page #analysisScopePanel .filter-search {
  min-height: 38px;
  border-color: #d8dde6;
  background: #ffffff;
  color: #111827;
}

.energy-board-page #analysisScopePanel .filter-panel,
.energy-board-page #analysisScopePanel .project-check-list {
  border-color: #d8dde6;
  background: #ffffff;
}

.energy-board-page #analysisScopePanel .project-option {
  color: #111827;
}

.energy-board-page #analysisScopePanel .project-option:hover {
  background: #fff1f2;
}

.energy-board-page #kpiGrid {
  order: 2;
}

.energy-board {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.energy-board-titlebar {
  display: none;
}

.energy-board-top,
.energy-board-main,
.energy-division-panel-list {
  gap: 12px;
}

.energy-board-top {
  grid-template-columns: minmax(260px, 1fr) minmax(460px, 1.9fr) minmax(300px, 1.15fr);
}

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

.energy-board-main .energy-board-panel:nth-child(1),
.energy-board-main .energy-board-panel:nth-child(6) {
  grid-column: span 2;
}

.energy-board-panel {
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.energy-board-panel::before,
.energy-board-panel::after {
  display: none;
}

.energy-board-panel h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  color: #c7000b;
  font-size: 16px;
  font-weight: 900;
}

.energy-board-panel h3::before {
  width: 3px;
  height: 16px;
  margin-right: 0;
  background: #c7000b;
}

.energy-board-panel h3 span {
  margin-left: 0;
  color: #4b5563;
  font-size: 12px;
}

.energy-board-panel svg {
  min-height: 212px;
}

.energy-board-panel-hero {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.energy-hero-metrics {
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  text-align: center;
}

.energy-hero-metric {
  position: relative;
  min-height: 162px;
  padding: 24px 16px 16px;
  border-right: 1px solid #eef1f5;
}

.energy-hero-metric:last-of-type {
  border-right: 0;
}

.energy-hero-metric::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #d6000f;
  box-shadow: inset 0 -10px 18px rgba(255, 255, 255, 0.18);
}

.energy-hero-metric:nth-child(2)::before {
  background: #2f6fb8;
}

.energy-hero-metric:nth-child(3)::before {
  background: #f59e0b;
}

.energy-hero-metric:nth-child(4)::before {
  background: #31a66a;
}

.energy-hero-metric strong {
  color: #d6000f;
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
}

.energy-hero-metric:nth-child(2) strong {
  color: #2f6fb8;
}

.energy-hero-metric:nth-child(3) strong {
  color: #f59e0b;
}

.energy-hero-metric:nth-child(4) strong {
  color: #31a66a;
}

.energy-hero-metric span {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.energy-hero-period {
  padding-top: 12px;
  border-top-color: #eef1f5;
  color: #6b7280;
}

.energy-execution-row {
  grid-template-columns: 54px minmax(0, 1fr) 92px;
  min-height: 54px;
  color: #374151;
  font-weight: 700;
}

.energy-execution-track {
  height: 18px;
  background: #edf0f4;
}

.energy-execution-row b,
.energy-division-row b {
  color: #111827;
  font-weight: 900;
}

.energy-division-row {
  grid-template-columns: 84px minmax(0, 1fr) 72px;
}

.energy-division-row span {
  color: #374151;
}

.energy-division-stack i {
  height: 8px;
  border-radius: 999px;
}

.energy-division-stack .actual,
.energy-mini-legend .actual {
  background: #d6000f;
}

.energy-division-stack .budget,
.energy-mini-legend .budget {
  background: #f36b73;
}

.energy-mini-legend {
  color: #4b5563;
}

.energy-pie {
  border: 0;
  width: clamp(160px, 70%, 220px);
  max-width: 220px;
}

.energy-pie::after {
  background: #ffffff;
}

.energy-pie span {
  color: #111827;
  inset: 23%;
  font-size: 16px;
}

.energy-pie small,
.energy-observe-grid span {
  color: #6b7280;
}

.energy-pie-legend-row {
  color: #374151;
}

.energy-pie-legend-row i {
  border-radius: 2px;
}

.energy-pie-legend-row b {
  color: #111827;
}

.energy-observe-grid div {
  border-top-color: #eef1f5;
}

.energy-observe-grid b {
  color: #d6000f;
}

.energy-board-empty {
  color: #6b7280;
}

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

.energy-division-name {
  grid-column: 1 / -1;
  min-height: auto;
  justify-content: start;
  color: #c7000b;
  font-size: 18px;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.energy-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
  gap: 12px;
  align-items: start;
}

.energy-board-main-area {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.energy-board-top,
.energy-board-middle,
.energy-board-bottom {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.energy-board-top {
  grid-template-columns: minmax(0, 2.55fr) minmax(360px, 0.78fr);
}

.energy-board-middle {
  grid-template-columns: minmax(0, 1.48fr) minmax(430px, 0.72fr);
}

.energy-board-bottom {
  grid-template-columns: minmax(360px, 0.86fr) minmax(0, 1.14fr);
}

.energy-board-summary-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.42fr);
  padding: 0;
}

.energy-summary-bars {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid #eef1f5;
}

.energy-summary-kpis {
  min-width: 0;
  display: grid;
}

.energy-summary-kpis .energy-hero-metrics {
  height: 100%;
  min-height: 214px;
}

.energy-summary-kpis .energy-hero-metric {
  display: grid;
  align-content: center;
  min-height: 214px;
  padding: 22px 14px 18px;
}

.energy-summary-kpis .energy-hero-period {
  display: none;
}

.energy-share-panel {
  display: grid;
  align-content: start;
}

.energy-share-panel .energy-pie-layout {
  grid-template-columns: minmax(126px, 168px) minmax(0, 1fr);
  gap: 14px;
  min-height: 166px;
}

.energy-share-panel .energy-pie {
  width: clamp(128px, 92%, 164px);
}

.energy-share-panel .energy-pie-legend {
  width: 100%;
  gap: 6px;
}

.energy-share-panel .energy-pie-legend-row {
  grid-template-columns: 9px minmax(0, 1fr) 58px;
  gap: 6px;
  font-size: 11px;
}

.energy-rank-panel {
  display: grid;
  align-content: start;
}

.energy-rank-panel .energy-division-bars {
  gap: 11px;
}

.energy-rank-panel .energy-division-row {
  grid-template-columns: 88px minmax(0, 1fr) 72px;
  min-height: 27px;
}

.energy-rank-panel .energy-division-stack i {
  height: 8px;
}

.energy-category-table-wrap {
  overflow-x: auto;
}

.energy-category-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  color: #111827;
  font-size: 12px;
}

.energy-category-table th,
.energy-category-table td {
  border-bottom: 1px solid #edf0f4;
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
}

.energy-category-table th:first-child,
.energy-category-table td:first-child {
  text-align: left;
}

.energy-category-table th {
  background: #fff5f5;
  color: #9f1239;
  font-weight: 900;
}

.energy-category-table td {
  font-weight: 700;
}

.energy-category-table tr.energy-category-total td {
  border-bottom: 0;
  color: #c7000b;
  font-weight: 900;
}

.energy-usage-card {
  min-width: 0;
}

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

.energy-usage-chart {
  min-width: 0;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 10px 10px 4px;
  background: #ffffff;
}

.energy-usage-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 4px;
}

.energy-usage-chart-head strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.energy-usage-chart-head span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.energy-usage-chart svg {
  min-height: 0;
}

.energy-side-rail {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.energy-side-card {
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.energy-side-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: #c7000b;
  font-size: 16px;
  font-weight: 900;
}

.energy-side-card h3::before {
  content: "";
  width: 3px;
  height: 16px;
  background: #c7000b;
}

.energy-insight-list {
  display: grid;
  gap: 10px;
}

.energy-insight-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 8px;
  background: #fff7f7;
}

.energy-insight-item i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffe3e5;
  color: #c7000b;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.energy-insight-item strong,
.energy-insight-item span {
  display: block;
}

.energy-insight-item strong {
  color: #c7000b;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
}

.energy-insight-item span {
  margin-top: 5px;
  color: #374151;
  font-size: 12px;
  line-height: 1.55;
}

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

.energy-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f8fafc;
}

.energy-key-row span {
  min-width: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.energy-key-row b {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.energy-key-card p {
  margin: 12px 2px 0;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.5;
}

.energy-side-structure-list,
.energy-side-watch-list {
  display: grid;
  gap: 10px;
}

.energy-side-structure-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 0 12px;
  border-bottom: 1px solid #f0f2f5;
}

.energy-side-structure-row:last-child {
  border-bottom: 0;
}

.energy-side-structure-row div,
.energy-side-watch-row div {
  min-width: 0;
}

.energy-side-structure-row span,
.energy-side-structure-row b,
.energy-side-watch-row strong,
.energy-side-watch-row span,
.energy-side-watch-row small {
  display: block;
}

.energy-side-structure-row span {
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.energy-side-structure-row b {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.energy-side-structure-row em {
  color: #c7000b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.energy-side-structure-row i {
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d6000f, #ff9ca3);
}

.energy-side-watch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid #f0f2f5;
  border-radius: 8px;
  background: #fffafa;
}

.energy-side-watch-row strong {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-side-watch-row span,
.energy-side-watch-row small {
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
}

.energy-side-watch-row b {
  align-self: start;
  color: #c7000b;
  font-size: 12px;
  font-weight: 900;
}

.energy-division-trend-panel {
  min-width: 0;
}

.energy-division-trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.energy-division-trend-card {
  min-width: 0;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 10px 10px 6px;
  background: #ffffff;
}

.energy-division-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.energy-division-trend-head strong {
  min-width: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-division-trend-head span {
  flex: none;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 800;
}

.energy-division-trend-card svg {
  min-height: 0;
}

.energy-usage-detail-panel {
  min-width: 0;
}

.energy-usage-detail-wrap {
  overflow-x: auto;
}

.energy-usage-detail-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  color: #111827;
  font-size: 12px;
}

.energy-usage-detail-table th,
.energy-usage-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  text-align: right;
  white-space: nowrap;
}

.energy-usage-detail-table th:first-child,
.energy-usage-detail-table td:first-child {
  text-align: left;
}

.energy-usage-detail-table th {
  background: #fff5f5;
  color: #9f1239;
  font-weight: 900;
}

.energy-usage-detail-table td {
  font-weight: 800;
}

.energy-usage-detail-table .positive {
  color: #16a34a;
}

.energy-usage-detail-table .negative {
  color: #dc2626;
}

.contracts-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.contracts-toolbar label,
.contract-category-filter {
  display: grid;
  position: relative;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.contracts-toolbar select,
.contracts-toolbar input[type="search"],
.contract-multi-select-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.contract-multi-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}

.contract-multi-select-button::after {
  content: "⌄";
  margin-left: 8px;
  color: #64748b;
}

.contract-multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(300px, calc(100vw - 40px));
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  padding: 10px;
}

.contract-multi-select-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.contract-multi-select-actions button,
.contract-multi-select-done {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d9e2ec;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.contract-multi-select-options {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  margin: 0 -2px 8px;
}

.contracts-toolbar .contract-multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.contracts-toolbar .contract-multi-select-option:hover {
  background: #f8fafc;
}

.contracts-toolbar .contract-multi-select-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  min-height: 0;
  padding: 0;
  accent-color: var(--red);
}

.contracts-toolbar .contract-multi-select-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-multi-select-empty {
  padding: 10px 6px;
  color: var(--muted);
}

.contract-multi-select-done {
  width: 100%;
}

.contracts-toolbar-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-self: end;
}

.contracts-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

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

.contract-export-button,
.contract-hide-toggle-button,
.contract-import-button,
.contract-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border-color: var(--red-line);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contract-import-button,
.contract-hide-toggle-button,
.contract-sort-button {
  border-color: #d9e2ec;
  color: #475569;
}

.contract-sort-button.is-active {
  border-color: #c2410c;
  background: #fff7ed;
  color: #9a3412;
}

.contract-hide-toggle-button.is-active {
  border-color: #64748b;
  background: #f1f5f9;
  color: #1f2937;
}

.contract-import-button:not(:disabled):hover,
.contract-import-button:not(:disabled):focus-visible,
.contract-hide-toggle-button:not(:disabled):hover,
.contract-hide-toggle-button:not(:disabled):focus-visible,
.contract-sort-button:hover,
.contract-sort-button:focus-visible {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1f2937;
}

.contract-sort-button.is-active:hover,
.contract-sort-button.is-active:focus-visible {
  border-color: #c2410c;
  background: #ffedd5;
  color: #9a3412;
}

.contract-import-button:disabled,
.contract-hide-toggle-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.contract-export-button:hover,
.contract-export-button:focus-visible {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.contract-import-modal-card {
  width: min(520px, 100%);
}

.contract-import-drop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  margin-bottom: 12px;
}

.contract-import-drop div {
  display: grid;
  gap: 5px;
}

.contract-import-drop strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.contract-import-drop p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contract-import-icon {
  width: fit-content;
  border-radius: 6px;
  background: #e6fffb;
  color: #087f8c;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.contract-import-note {
  display: grid;
  gap: 4px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
}

.contract-import-note b {
  color: #991b1b;
}

.contracts-table-wrap,
.contracts-ledger-wrap {
  overflow: auto;
}

.contracts-table {
  min-width: 860px;
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.contracts-table th,
.contracts-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.contracts-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.contracts-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.contracts-ledger-table {
  min-width: 1580px;
  table-layout: fixed;
}

.contracts-ledger-table th:nth-child(1),
.contracts-ledger-table td:nth-child(1) {
  width: 150px;
}

.contracts-ledger-table th:nth-child(2),
.contracts-ledger-table td:nth-child(2) {
  width: 350px;
}

.contracts-ledger-table th:nth-child(3),
.contracts-ledger-table td:nth-child(3) {
  width: 90px;
}

.contracts-ledger-table th:nth-child(4),
.contracts-ledger-table td:nth-child(4) {
  width: 160px;
}

.contracts-ledger-table th:nth-child(5),
.contracts-ledger-table td:nth-child(5) {
  width: 270px;
}

.contracts-ledger-table th:nth-child(6),
.contracts-ledger-table td:nth-child(6),
.contracts-ledger-table th:nth-child(7),
.contracts-ledger-table td:nth-child(7),
.contracts-ledger-table th:nth-child(8),
.contracts-ledger-table td:nth-child(8),
.contracts-ledger-table th:nth-child(9),
.contracts-ledger-table td:nth-child(9) {
  width: 88px;
}

.contracts-ledger-table th:nth-child(10),
.contracts-ledger-table td:nth-child(10) {
  width: 170px;
}

.contracts-ledger-table th:nth-child(11),
.contracts-ledger-table td:nth-child(11) {
  width: 72px;
  text-align: right;
}

.contracts-ledger-table td:nth-child(1) b,
.contracts-ledger-table td:nth-child(1) span,
.contracts-ledger-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-name-cell {
  min-width: 320px;
}

.contract-name-cell b,
.contract-name-cell span {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-row-hidden {
  opacity: 0.52;
}

.contract-row-hidden td {
  background: #f8fafc;
}

.contract-row-hide-button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d9e2ec;
  border-radius: 7px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contract-row-hide-button:hover,
.contract-row-hide-button:focus-visible {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.contract-row-hide-button.restore {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.contract-row-context-menu {
  position: fixed;
  z-index: 1000;
  display: grid;
  min-width: 132px;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  padding: 5px;
}

.contract-row-context-menu button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
}

.contract-row-context-menu button:first-child {
  color: #b91c1c;
}

.contract-row-context-menu button:hover,
.contract-row-context-menu button:focus-visible {
  background: #f8fafc;
}

.contract-progress {
  display: grid;
  grid-template-columns: 52px minmax(90px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 150px;
}

.contract-progress span {
  color: var(--text);
  font-weight: 700;
}

.contract-progress i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.contract-progress em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f766e;
}

.contract-progress.warning em {
  background: #d97706;
}

.contract-progress.danger em {
  background: #dc2626;
}

.contract-progress.muted em {
  background: #94a3b8;
}

.contract-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.contract-risk-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.contract-risk-chip b {
  display: block;
  color: #b45309;
  font-size: 18px;
}

.contract-risk-chip span {
  color: var(--muted);
  font-size: 12px;
}

.contract-risk-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.contract-risk-item {
  border: 1px solid var(--border);
  border-left: 4px solid #d97706;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.contract-risk-item.danger {
  border-left-color: #dc2626;
}

.contract-risk-item.ok {
  border-left-color: #0f766e;
}

.contract-risk-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.contract-risk-item b,
.contract-risk-item span,
.contract-risk-item p,
.contract-risk-item small {
  display: block;
}

.contract-risk-item b {
  color: var(--text);
}

.contract-risk-item span,
.contract-risk-item small {
  color: var(--muted);
  font-size: 11px;
}

.contract-risk-item p {
  margin: 6px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.contract-risk-tags {
  min-width: 160px;
}

.contract-risk-tags span {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  white-space: nowrap;
}

.contract-lag-number {
  color: #b91c1c;
  font-weight: 800;
}

.contract-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.contract-mode.monthly {
  background: #ecfeff;
  color: #0e7490;
}

.contract-mode.cumulative {
  background: #f1f5f9;
  color: #475569;
}

.contract-category-label {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.contract-tracking-cell small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.contract-month-cell {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 6px 10px;
  min-width: 260px;
}

.contract-month-cell div {
  display: grid;
  gap: 2px;
}

.contract-month-cell span {
  color: var(--muted);
  font-size: 11px;
}

.contract-month-cell b {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.contract-month-cell strong {
  grid-column: 1 / -1;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
}

.contract-month-cell.warning strong {
  background: #fffbeb;
  color: #b45309;
}

.contract-month-cell.danger strong {
  background: #fef2f2;
  color: #b91c1c;
}

.contract-month-cell .contract-lag-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.contract-month-cell .contract-lag-tags strong {
  grid-column: auto;
}

.contract-month-cell .contract-selected-lag.ok {
  background: #ecfdf5;
  color: #047857;
}

.contract-month-cell .contract-selected-lag.warning {
  background: #fffbeb;
  color: #b45309;
}

.contract-month-cell .contract-selected-lag.danger,
.contract-month-cell .contract-total-lag.danger {
  background: #fef2f2;
  color: #b91c1c;
}

.contract-month-cell .contract-total-lag.warning {
  background: #fff7ed;
  color: #c2410c;
}

@media (max-width: 1540px) and (min-width: 981px) {
  .app-shell.contracts-mode .sidebar {
    width: 86px;
    flex-basis: 86px;
    padding: 14px 10px;
  }

  .app-shell.contracts-mode .brand {
    justify-content: center;
    padding: 4px 0 14px;
  }

  .app-shell.contracts-mode .brand-content,
  .app-shell.contracts-mode .sidebar-profile-copy,
  .app-shell.contracts-mode .sidebar-profile-chevron {
    display: none;
  }

  .app-shell.contracts-mode .module-switch {
    grid-template-columns: 1fr;
    margin: 10px 0 14px;
  }

  .app-shell.contracts-mode .module-switch-button,
  .app-shell.contracts-mode .nav-item {
    justify-content: center;
    gap: 0;
    padding-inline: 8px;
    font-size: 0;
  }

  .app-shell.contracts-mode .module-switch-button .nav-icon,
  .app-shell.contracts-mode .nav-item .nav-icon {
    font-size: 13px;
  }

  .app-shell.contracts-mode .nav-list {
    padding: 12px 0;
  }

  .app-shell.contracts-mode .sidebar-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 56px;
    padding: 10px 0;
  }

  .app-shell.contracts-mode .workspace {
    padding: 14px 16px 18px;
  }

  .contracts-page .section-header {
    margin-bottom: 12px;
  }

  .contracts-page h1 {
    font-size: 22px;
  }

  .contracts-page .kpi-grid.compact {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 10px;
  }

  .contracts-toolbar {
    grid-template-columns: repeat(4, minmax(148px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
  }

  .contracts-toolbar select,
  .contracts-toolbar input[type="search"],
  .contract-multi-select-button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .contracts-table {
    font-size: 11px;
  }

  .contracts-table th,
  .contracts-table td {
    padding: 8px 6px;
  }

  .contracts-ledger-table {
    min-width: 1280px;
  }

  .contracts-ledger-table th:nth-child(1),
  .contracts-ledger-table td:nth-child(1) {
    width: 128px;
  }

  .contracts-ledger-table th:nth-child(2),
  .contracts-ledger-table td:nth-child(2) {
    width: 280px;
  }

  .contracts-ledger-table th:nth-child(3),
  .contracts-ledger-table td:nth-child(3) {
    width: 76px;
  }

  .contracts-ledger-table th:nth-child(4),
  .contracts-ledger-table td:nth-child(4) {
    width: 126px;
  }

  .contracts-ledger-table th:nth-child(5),
  .contracts-ledger-table td:nth-child(5) {
    width: 210px;
  }

  .contracts-ledger-table th:nth-child(6),
  .contracts-ledger-table td:nth-child(6),
  .contracts-ledger-table th:nth-child(7),
  .contracts-ledger-table td:nth-child(7),
  .contracts-ledger-table th:nth-child(8),
  .contracts-ledger-table td:nth-child(8),
  .contracts-ledger-table th:nth-child(9),
  .contracts-ledger-table td:nth-child(9) {
    width: 70px;
  }

  .contracts-ledger-table th:nth-child(10),
  .contracts-ledger-table td:nth-child(10) {
    width: 120px;
  }

  .contracts-ledger-table th:nth-child(11),
  .contracts-ledger-table td:nth-child(11) {
    width: 60px;
  }

  .contract-name-cell {
    min-width: 0;
  }

  .contract-name-cell b,
  .contract-name-cell span,
  .contracts-ledger-table td:nth-child(1) b,
  .contracts-ledger-table td:nth-child(1) span {
    display: -webkit-box;
    max-width: none;
    overflow: hidden;
    line-height: 1.35;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .contract-name-cell span {
    -webkit-line-clamp: 1;
  }

  .contract-mode {
    min-width: 56px;
    padding: 3px 7px;
  }

  .contract-category-label {
    white-space: normal;
  }

  .contract-progress {
    grid-template-columns: 40px minmax(54px, 1fr);
    min-width: 0;
    gap: 6px;
  }

  .contract-month-cell {
    grid-template-columns: repeat(2, minmax(68px, 1fr));
    min-width: 0;
    gap: 5px 6px;
  }

  .contract-month-cell b {
    font-size: 11px;
  }

  .contract-month-cell strong {
    padding: 2px 7px;
  }

  .contract-risk-tags {
    min-width: 0;
  }

  .contract-risk-tags span {
    margin-right: 3px;
    padding: 2px 5px;
  }
}

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

  .energy-board {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .energy-board-titlebar {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }

  .energy-board-titlebar::before,
  .energy-board-titlebar::after {
    display: none;
  }

  .energy-board-titlebar span,
  .energy-board-titlebar h2,
  .energy-board-date {
    grid-column: 1;
    justify-self: center;
  }

  .energy-board-top,
  .energy-board-main,
  .energy-board-middle,
  .energy-board-bottom,
  .energy-board-summary-card,
  .energy-usage-split,
  .energy-division-pair {
    grid-template-columns: 1fr;
  }

  .energy-summary-bars {
    border-right: 0;
    border-bottom: 1px solid #eef1f5;
  }

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

  .energy-division-name {
    min-height: 42px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
}

@media (max-width: 1180px) {
  .material-resizable-layout,
  .material-maintenance-layout {
    grid-template-columns: 1fr;
  }

  .material-pane-splitter {
    display: none;
  }

  .material-ai-form label:first-child {
    grid-column: span 1;
  }
}

@media (max-width: 980px) {
  .contracts-toolbar {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .topbar,
  .section-header,
  .upload-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .section-conclusion {
    text-align: left;
  }

  .material-side-header,
  .material-quote-title,
  .material-quote-title-actions,
  .material-quote-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .material-quote-mode-switch {
    width: 100%;
  }

  .material-quote-assist-search,
  .material-suggestion-card {
    grid-template-columns: 1fr;
  }

  .material-suggestion-price {
    text-align: left;
  }

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

  .material-quote-summary div:nth-child(2n) {
    border-right: 0;
  }

  .material-quote-summary div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .kpi-grid,
  .kpi-grid.compact,
  .cost-timeline-kpi-grid,
  .two-cols,
  .profile-grid,
  .material-filter-grid,
  .material-fuzzy-panel,
  .material-ai-form,
  .material-ai-trace,
  .material-layout,
  .budget-toolbar,
  .budget-layout,
  .cost-timeline-toolbar,
  .cost-map-toolbar,
  .cost-map-dashboard-toolbar,
  .cost-map-dashboard-stats,
  .cost-map-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .cost-timeline-month-filter {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .cost-timeline-search,
  .cost-timeline-metric-filter,
  .cost-timeline-status-filter {
    grid-column: 1;
  }

  .cost-map-layout {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .budget-month-row {
    grid-template-columns: 38px minmax(120px, 1fr);
  }

  .budget-month-row b {
    grid-column: 2;
    text-align: left;
  }

  .budget-gantt-summary,
  .budget-gantt-head,
  .budget-gantt-row {
    grid-template-columns: 1fr;
  }

  .budget-gantt-head > span {
    display: none;
  }

  .budget-gantt-month-head,
  .budget-gantt-track {
    min-width: 520px;
  }

  .budget-gantt-head,
  .budget-gantt-row {
    overflow-x: auto;
  }

  .budget-gantt-result {
    justify-items: start;
  }

  .cost-map-splitter,
  .cost-map-panel-resize {
    display: none;
  }

  .cost-map-matrix-panel,
  .cost-map-detail-panel {
    height: auto;
    min-height: 0;
  }

  #costMapMatrix,
  #costMapDetail {
    overflow: visible;
  }

  #costMapDetail .cost-map-detail {
    min-width: 0;
  }

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

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

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

  .approval-page-header,
  .approval-section-title {
    display: grid;
  }

  .approval-toolbar,
  .approval-kpi-grid,
  .approval-workbench {
    grid-template-columns: 1fr;
  }

  .approval-org-panel,
  .approval-list-panel,
  .approval-detail-panel {
    min-height: 0;
  }

  .approval-permission-grid {
    grid-template-columns: 1fr;
  }

  .reason-editor {
    grid-template-columns: 1fr;
    min-width: 240px;
  }

  .reason-editor-actions {
    display: block;
  }

  .material-import-drop {
    grid-template-columns: 1fr;
  }

  .material-import-drop button {
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .energy-board {
    padding: 10px;
  }

  .energy-board-titlebar h2 {
    font-size: 22px;
  }

  .energy-hero-metrics,
  .energy-observe-grid {
    grid-template-columns: 1fr;
  }

  .energy-pie-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .energy-pie-legend {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .panorama-bar-row,
  .panorama-mini-line {
    grid-template-columns: 1fr;
  }

  .panorama-mini-line b {
    text-align: left;
  }

  .cost-map-facts,
  .cost-map-standards,
  .cost-map-price-summary {
    grid-template-columns: 1fr;
  }

  .cost-map-chart-title,
  .cost-map-dashboard-bar-row,
  .cost-map-composition-row {
    grid-template-columns: 1fr;
  }

  .cost-map-chart-title {
    display: grid;
  }

  .cost-map-dashboard-bar-row b,
  .cost-map-composition-row b {
    text-align: left;
  }
}
