:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --line: #d9e0e7;
  --text: #1f2933;
  --muted: #667481;
  --blue: #2563eb;
  --green: #16835f;
  --amber: #a76000;
  --red: #b42318;
  --teal: #0f766e;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.brand {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #24384f;
  font-size: 17px;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 12px;
  line-height: 1.35;
}

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

.nav-tabs {
  display: grid;
  gap: 5px;
}

.nav-tab {
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #384756;
  background: transparent;
  font-size: 14px;
  line-height: 1.1;
  text-align: left;
}

.nav-tab:hover {
  background: var(--surface-2);
}

.nav-tab.active {
  border-color: #c7d8f7;
  color: #173b78;
  background: #eaf2ff;
  font-weight: 700;
}

.subnav {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.subnav-button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #4c5d6f;
  background: transparent;
  font-size: 14px;
  white-space: nowrap;
}

.subnav-button.active {
  color: #143e6f;
  background: #eaf2ff;
  font-weight: 700;
}

.sidebar-note {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}

.sidebar-note + .sidebar-note {
  margin-top: -6px;
}

.sidebar-note.stacked {
  align-items: flex-start;
}

.sidebar-note strong {
  color: var(--text);
}

.sidebar-note.stacked strong {
  color: #173b78;
}

.main {
  min-width: 0;
  padding: 16px 24px 28px;
}

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

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

.topbar h2 {
  margin-top: 2px;
  font-size: 24px;
  line-height: 1.15;
}

.topbar-title {
  min-width: 0;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 34px;
}

.low-top-subnav {
  display: none;
  margin: 0;
}

.topbar.low-active .low-top-subnav {
  display: inline-grid;
}

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

.primary-button,
.icon-button,
.pager button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--text);
}

.primary-button {
  border-color: #204c8f;
  color: #fff;
  background: #285a9f;
  font-weight: 700;
}

.primary-button:hover {
  background: #214c87;
}

.icon-button:hover,
.pager button:hover {
  background: var(--surface-2);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.kpi-card {
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card span {
  color: var(--muted);
  font-size: 11px;
}

.kpi-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  line-height: 1;
}

.kpi-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

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

.full-panel {
  width: 100%;
}

.full-panel.fullscreen {
  position: fixed;
  inset: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.full-panel.fullscreen .matrix-wrap {
  max-height: none;
  flex: 1;
}

.full-panel.fullscreen .low-display-title {
  display: grid;
  margin-bottom: 4px;
}

.full-panel.fullscreen .low-display-title > strong {
  font-size: 13px;
}

.full-panel.fullscreen .matrix-filter-toolbar {
  margin-bottom: 5px;
  padding: 3px 6px;
}

.full-panel.fullscreen .panel-head {
  align-items: center;
  margin-bottom: 4px;
}

.full-panel.fullscreen .panel-head h3 {
  font-size: 14px;
  line-height: 1.1;
}

.full-panel.fullscreen .panel-head span {
  font-size: 10px;
  line-height: 1.1;
}

.full-panel.fullscreen .matrix-actions {
  gap: 5px;
}

.full-panel.fullscreen .matrix-actions .primary-button,
.full-panel.fullscreen .matrix-actions .icon-button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 13px;
}

.full-panel.fullscreen .matrix-actions span {
  min-width: 36px;
  font-size: 11px;
}

.full-panel.fullscreen .matrix-rule-panel {
  gap: 8px;
  padding: 4px 7px;
  font-size: 10px;
}

.full-panel.fullscreen .matrix-rule-block strong {
  font-size: 10px;
  line-height: 1.15;
}

.full-panel.fullscreen .matrix-rule-block span {
  line-height: 1.16;
}

.full-panel.fullscreen .matrix-footer {
  margin-top: 4px;
  font-size: 10px;
}

.low-subview {
  display: none;
}

.low-subview.active {
  display: block;
}

.panel {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.low-display-title {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
}

.low-display-title strong {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.matrix-title-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rule-panel {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #c7d8f7;
  border-radius: 8px;
  background: #f3f7ff;
  color: #31465c;
  font-size: 13px;
}

.rule-panel strong {
  color: #173b78;
}

.rule-panel span {
  line-height: 1.55;
}

.matrix-rule-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  font-size: 10.5px;
}

.matrix-rule-block {
  display: grid;
  gap: 3px;
  align-content: start;
  justify-items: start;
  min-width: 0;
  min-height: 62px;
  padding: 6px 8px;
  border: 1px solid #c7d8f7;
  border-radius: 7px;
  background: #f8fbff;
  text-align: left;
}

.matrix-rule-block strong {
  font-size: 10.5px;
  line-height: 1.15;
  color: #173b78;
}

.matrix-rule-block span {
  line-height: 1.28;
}

@media (max-width: 1360px) {
  .matrix-rule-panel {
    grid-template-columns: 1fr;
  }
}

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

.matrix-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.matrix-actions span {
  min-width: 36px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.matrix-actions .primary-button,
.matrix-actions .icon-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.matrix-filter-toolbar {
  margin: 0 0 6px;
  padding: 4px 6px;
  border-color: #e3e8ee;
  box-shadow: none;
}

.matrix-search-field {
  min-width: 300px;
}

.matrix-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.mini-kpi {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.mini-kpi strong {
  font-size: 18px;
}

.positive-diff {
  color: var(--green);
  font-weight: 800;
}

.negative-diff {
  color: var(--red);
  font-weight: 800;
}

.panel h3 {
  font-size: 16px;
}

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

.bar-chart {
  display: grid;
  gap: 5px;
  height: 140px;
  overflow: auto;
  padding-right: 4px;
}

.bar-chart.compact {
  height: 250px;
}

.bar-row {
  display: grid;
  grid-template-columns: 94px 1fr 68px;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  color: var(--muted);
  font-size: 10.5px;
}

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

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

.status-list {
  display: grid;
  gap: 6px;
}

.summary-table {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 78px 70px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  background: #fbfcfd;
  font-size: 13px;
}

.summary-row strong,
.summary-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-row span {
  color: var(--muted);
}

.priority-pill {
  display: inline-grid;
  min-width: 32px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.priority-p1 {
  color: #fff;
  background: var(--red);
}

.priority-p2 {
  color: #7a3e00;
  background: #ffe2ad;
}

.priority-p3 {
  color: #475569;
  background: #edf2f7;
}

.matrix-wrap {
  width: 100%;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-head {
  align-items: start;
}

.calendar-today {
  display: grid;
  gap: 2px;
  min-width: 108px;
  text-align: right;
}

.calendar-today span {
  color: var(--muted);
  font-size: 11px;
}

.calendar-today strong {
  color: #0b8f45;
  font-size: 16px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #fbfcfd;
  color: #45566a;
  font-size: 12px;
}

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

.legend-chip {
  width: 16px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.legend-chip.locked {
  background: #c9c9c9;
}

.legend-chip.lock-today {
  background: #ffe8e8;
  border-color: #f0a3a3;
}

.legend-chip.lock-tomorrow {
  background: #e2f1ff;
  border-color: #9cc7ee;
}

.calendar-wrap {
  width: 100%;
  max-height: calc(100vh - 210px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.forecast-calendar-table {
  width: max-content;
  min-width: 1360px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.forecast-calendar-table th,
.forecast-calendar-table td {
  width: 76px;
  height: 24px;
  padding: 2px 4px;
  border-right: 1px solid #b8c0c8;
  border-bottom: 1px solid #b8c0c8;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.forecast-calendar-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eaf3ff;
  color: #111827;
  font-weight: 800;
}

.forecast-calendar-table thead tr:nth-child(2) th {
  top: 24px;
  background: #eaf3ff;
  color: #c01d1d;
}

.forecast-calendar-table .corner-head,
.forecast-calendar-table .category-head {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 92px;
  background: #eaf3ff;
  color: #111827;
  font-weight: 800;
}

.forecast-calendar-table .category-head {
  z-index: 2;
}

.forecast-calendar-table td {
  background: #f7f7f7;
}

.forecast-calendar-table td.locked {
  background: #c9c9c9;
  color: #333;
}

.forecast-calendar-table td.lock-today {
  background: #ffe8e8;
  color: #d00000;
  font-weight: 800;
}

.forecast-calendar-table td.lock-tomorrow {
  background: #e2f1ff;
  color: #174f82;
  font-weight: 800;
}

.low-matrix-table {
  min-width: 1720px;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.low-matrix-table th,
.low-matrix-table td {
  height: var(--matrix-row-height, 28px);
  padding: 2px 3px;
  border-right: 1px solid #d7dde4;
  border-bottom: 1px solid #d7dde4;
  font-size: inherit;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.low-matrix-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #fff;
  background: #223044;
}

.low-matrix-table th.date-head {
  background: #2f75b5;
}

.low-matrix-table td.meta {
  color: #4d7f35;
  font-weight: 700;
}

.low-matrix-table td.code {
  color: #0070c0;
  font-weight: 700;
}

.low-matrix-table th:nth-child(-n + 9),
.low-matrix-table td:nth-child(-n + 9) {
  position: sticky;
  z-index: 3;
}

.low-matrix-table th:nth-child(-n + 9) {
  z-index: 5;
}

.low-matrix-table th:nth-child(1),
.low-matrix-table td:nth-child(1) {
  left: 0;
  min-width: 58px;
  max-width: 58px;
}

.low-matrix-table th:nth-child(2),
.low-matrix-table td:nth-child(2) {
  left: 58px;
  min-width: 54px;
  max-width: 54px;
}

.low-matrix-table th:nth-child(3),
.low-matrix-table td:nth-child(3) {
  left: 112px;
  min-width: 58px;
  max-width: 58px;
}

.low-matrix-table th:nth-child(4),
.low-matrix-table td:nth-child(4) {
  left: 170px;
  min-width: 88px;
  max-width: 88px;
}

.low-matrix-table th:nth-child(5),
.low-matrix-table td:nth-child(5) {
  left: 258px;
  min-width: 68px;
  max-width: 68px;
}

.low-matrix-table th:nth-child(6),
.low-matrix-table td:nth-child(6) {
  left: 326px;
  min-width: 150px;
  max-width: 150px;
}

.low-matrix-table th:nth-child(7),
.low-matrix-table td:nth-child(7) {
  left: 476px;
  min-width: 82px;
  max-width: 82px;
}

.low-matrix-table th:nth-child(8),
.low-matrix-table td:nth-child(8) {
  left: 558px;
  min-width: 82px;
  max-width: 82px;
}

.low-matrix-table th:nth-child(9),
.low-matrix-table td:nth-child(9) {
  left: 640px;
  min-width: 74px;
  max-width: 74px;
  box-shadow: 3px 0 0 rgba(34, 48, 68, 0.18);
}

.low-matrix-table th:nth-child(n + 10),
.low-matrix-table td:nth-child(n + 10) {
  min-width: 78px;
}

.low-matrix-table tr:nth-child(even) td:not(.zero-cell):not(.above-ref-cell):not(.below-ref-cell) {
  background: #d9d9d9;
}

.low-matrix-table tr:nth-child(odd) td:not(.zero-cell):not(.above-ref-cell):not(.below-ref-cell) {
  background: #ffffff;
}

.low-matrix-table .zero-cell {
  color: #c00000;
  background: #ffc7ce;
  font-weight: 800;
}

.low-matrix-table .above-ref-cell {
  background: #c6efce;
}

.low-matrix-table .below-ref-cell {
  background: #ffc7ce;
}

.low-matrix-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-size: 11px;
}

.overview-breakdown-panel {
  margin-top: 10px;
}

.overview-breakdown-wrap {
  max-height: 260px;
  box-shadow: none;
}

.overview-breakdown-table {
  min-width: 820px;
}

.overview-breakdown-table th,
.overview-breakdown-table td {
  height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.overview-breakdown-table th:not(:first-child),
.overview-breakdown-table td:not(:first-child) {
  width: 116px;
  text-align: right;
}

.overview-breakdown-table td:first-child {
  font-weight: 700;
  color: #3f7b36;
}

.overview-breakdown-table .status-pill {
  min-height: 18px;
  min-width: 36px;
  justify-content: center;
  padding: 0 6px;
  font-size: 10px;
}

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

.compact-toolbar {
  gap: 5px 10px;
  margin-bottom: 8px;
  padding: 5px 8px;
}

.low-detail-toolbar {
  align-items: end;
}

.search-field,
.select-field {
  display: grid;
  gap: 3px;
}

.search-field {
  position: relative;
  min-width: 292px;
}

.compact-toolbar .search-field {
  min-width: 260px;
}

.low-detail-toolbar .search-field {
  min-width: 300px;
}

.search-field span,
.select-field span,
.bulk-fill-field span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.bulk-fill-field {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-fill-field label {
  display: grid;
  gap: 3px;
}

.bulk-fill-field input {
  width: 112px;
  min-width: 112px;
}

.bulk-fill-field .icon-button,
.bulk-fill-field .primary-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.bulk-fill-field small {
  flex-basis: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

input,
select {
  height: 28px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
}

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

.compact-toolbar .primary-button,
.compact-toolbar .icon-button {
  min-height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 8;
  display: none;
  width: min(520px, 72vw);
  max-height: 248px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(31, 41, 51, 0.16);
}

.search-suggestions.open {
  display: grid;
  gap: 3px;
}

.suggestion-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.suggestion-row:hover {
  background: #eef4fb;
}

.suggestion-row strong {
  color: #0069b7;
  font-size: 12px;
}

.suggestion-row span {
  min-width: 0;
  color: #2f3c48;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.suggestion-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

input[type="number"] {
  width: 88px;
  min-width: 88px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

th,
td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5ebf0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #506071;
  background: #f2f5f8;
  font-weight: 700;
}

td input {
  height: 30px;
}

.low-detail-table {
  width: max-content;
  min-width: 1312px;
  table-layout: fixed;
}

.low-detail-table th,
.low-detail-table td {
  height: 28px;
  padding: 3px 5px;
  font-size: 10.5px;
  line-height: 1.18;
}

.low-detail-table th:nth-child(1),
.low-detail-table td:nth-child(1) {
  width: 42px;
  text-align: center;
}

.low-detail-table th:nth-child(2),
.low-detail-table td:nth-child(2) {
  width: 88px;
}

.low-detail-table th:nth-child(3),
.low-detail-table td:nth-child(3) {
  width: 104px;
}

.low-detail-table th:nth-child(4),
.low-detail-table td:nth-child(4) {
  width: 78px;
}

.low-detail-table th:nth-child(5),
.low-detail-table td:nth-child(5) {
  width: 196px;
}

.low-detail-table th:nth-child(6),
.low-detail-table td:nth-child(6) {
  width: 88px;
}

.low-detail-table th:nth-child(7),
.low-detail-table td:nth-child(7) {
  width: 58px;
}

.low-detail-table th:nth-child(8),
.low-detail-table td:nth-child(8) {
  width: 76px;
}

.low-detail-table th:nth-child(9),
.low-detail-table td:nth-child(9) {
  width: 86px;
}

.low-detail-table th:nth-child(10),
.low-detail-table td:nth-child(10) {
  width: 58px;
}

.low-detail-table th:nth-child(11),
.low-detail-table td:nth-child(11) {
  width: 118px;
}

.low-detail-table th:nth-child(12),
.low-detail-table td:nth-child(12) {
  width: 64px;
}

.low-detail-table th:nth-child(13),
.low-detail-table td:nth-child(13) {
  width: 58px;
}

.low-detail-table th:nth-child(14),
.low-detail-table td:nth-child(14) {
  width: 172px;
}

.low-detail-table td input {
  width: 100%;
  min-width: 0;
  height: 22px;
  font-size: 10.5px;
  padding: 0 6px;
}

.low-detail-table td:nth-child(12) input {
  text-align: right;
}

.low-detail-table .priority-pill {
  min-width: 28px;
  min-height: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
}

.low-detail-table .status-pill {
  min-height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

.reason-input {
  min-width: 0;
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-ok {
  color: var(--green);
  background: #e6f4ef;
}

.status-warn {
  color: var(--amber);
  background: #fff2d8;
}

.status-risk {
  color: var(--red);
  background: #fde8e5;
}

.status-info {
  color: var(--blue);
  background: #eaf2ff;
}

.lock-pill {
  color: #475569;
  background: #edf2f7;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.template-preview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.template-preview span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: #526273;
  font-size: 13px;
  font-weight: 700;
}

.export-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #c7d8f7;
  border-radius: 8px;
  background: #f3f7ff;
  color: #31465c;
  font-size: 13px;
  line-height: 1.5;
}

.export-rule-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #fbfcfd;
  color: #3a4b5d;
  font-size: 12px;
  line-height: 1.45;
}

.export-rule-card strong {
  color: #173b78;
  font-size: 13px;
}

.export-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.export-metrics div {
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.export-metrics span,
.export-metrics small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.export-metrics strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 18px;
}

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

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    gap: 12px;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-tab {
    padding: 0 8px;
    text-align: center;
  }

  .main {
    padding: 18px 14px 26px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .overview-grid,
  .export-grid,
  .low-overview-grid {
    grid-template-columns: 1fr;
  }

  .search-field,
  .select-field,
  input,
  select {
    width: 100%;
    min-width: 0;
  }
}
