:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-strong: #f0f4f7;
  --ink: #17212b;
  --muted: #657282;
  --line: #dfe6ee;
  --green: #168a5b;
  --teal: #1f8a9c;
  --amber: #c47a21;
  --rose: #c65164;
  --blue: #3867d6;
  --shadow: 0 18px 44px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
select,
input {
  font: inherit;
}

body.login-mode {
  background:
    linear-gradient(135deg, rgba(14, 96, 107, 0.18), rgba(255, 255, 255, 0)),
    #edf3f6;
}

body.login-mode .app-shell {
  display: none;
}

.login-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

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

.login-panel .brand-mark {
  margin-bottom: 18px;
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
}

.login-copy {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

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

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.login-form button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.login-status {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 13px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #111820;
  color: #f8fbff;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: linear-gradient(135deg, #20a879, #2d6cdf);
  color: white;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.brand p,
.source-note span {
  margin: 5px 0 0;
  color: #aebbc8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-section-title {
  margin: 12px 4px 2px;
  color: #7f93a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item,
.nav-link {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d9e4ef;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover,
.nav-link:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.source-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.source-note strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
}

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

select {
  min-width: 132px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 34px 0 12px;
}

input[type="search"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
}

.view {
  display: grid;
  gap: 18px;
}

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

.kpi {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi .label {
  color: var(--muted);
  font-size: 13px;
}

.kpi .value {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

.positive {
  color: var(--green);
}

.negative {
  color: var(--rose);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

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

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

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

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

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

.chart {
  width: 100%;
  min-height: 260px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--panel);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  color: #415061;
  font-size: 12px;
}

tbody tr:hover {
  background: #f8fafc;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.bar-track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

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

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

.status {
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.status span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.module-grid {
  display: grid;
  gap: 10px;
}

.module-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.module-link strong,
.module-link span {
  display: block;
}

.module-link strong {
  font-size: 14px;
}

.module-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.module-link b {
  color: var(--teal);
  font-size: 13px;
  white-space: nowrap;
}

.module-button {
  min-width: 58px;
  min-height: 32px;
  height: auto;
  padding: 6px 11px;
  border: 1px solid #b7c6d5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.module-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.module-button.active {
  border-color: var(--teal);
  background: #eaf7f8;
  color: var(--teal);
}

.decision-box {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 260px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.decision-box strong {
  font-size: 24px;
}

.decision-box span {
  color: var(--muted);
  line-height: 1.7;
}

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

.assumption-field {
  display: grid;
  gap: 6px;
}

.assumption-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.assumption-field div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.assumption-field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
}

.assumption-field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-header h3 {
  margin: 0;
  font-size: 24px;
}

.report-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.report-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.target-rate-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.target-rate-form label {
  display: grid;
  gap: 4px;
}

.target-rate-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.target-rate-form input {
  width: 84px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.report-list,
.action-list {
  margin: 0;
  padding-left: 0;
}

.report-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-list span {
  color: var(--muted);
}

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

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  line-height: 1.5;
}

.alert.risk {
  border-color: #e1a8b2;
  background: #fff2f4;
  color: #943448;
}

.alert.warn {
  border-color: #e1bf83;
  background: #fff8ec;
  color: #825114;
}

.alert.ok {
  border-color: #9acbb7;
  background: #eefaf5;
  color: #176344;
}

.app-notice {
  position: fixed;
  z-index: 50;
  top: 18px;
  right: 22px;
  max-width: min(520px, calc(100vw - 44px));
  border: 1px solid #9acbb7;
  border-radius: 10px;
  background: #eefaf5;
  color: #176344;
  box-shadow: 0 18px 40px rgba(18, 31, 45, 0.18);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.app-notice[hidden] {
  display: none;
}

.app-notice.warn {
  border-color: #e1bf83;
  background: #fff8ec;
  color: #825114;
}

.app-notice.risk {
  border-color: #e1a8b2;
  background: #fff2f4;
  color: #943448;
}

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

.overview-action {
  align-content: start;
}

.overview-action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.overview-action-footer .status-pill {
  min-width: 0;
  height: auto;
  min-height: 28px;
  white-space: normal;
}

.warning-grid {
  display: grid;
  gap: 12px;
}

.warning-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.warning-card.risk {
  border-color: #e1a8b2;
  background: #fff2f4;
}

.warning-card.warn {
  border-color: #e1bf83;
  background: #fff8ec;
}

.warning-card.ok {
  border-color: #9acbb7;
  background: #eefaf5;
}

.warning-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warning-top b {
  color: var(--ink);
}

.warning-card h4 {
  margin: 0;
  font-size: 16px;
}

.warning-card p {
  margin: 0;
  color: #415061;
  line-height: 1.55;
}

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

.warning-card small {
  color: var(--muted);
  line-height: 1.5;
}

.formal-import-gate {
  display: grid;
  gap: 16px;
}

.formal-import-gate.locked {
  border-color: #e1a8b2;
  background: #fff9fa;
}

.formal-import-gate.open {
  border-color: #9acbb7;
  background: #f7fffb;
}

.formal-gate-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.formal-gate-banner h3 {
  margin-top: 2px;
  font-size: 20px;
}

.formal-gate-kpis {
  margin: 0;
}

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

.formal-gate-rules article {
  display: grid;
  gap: 6px;
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.formal-gate-rules article.risk {
  border-color: #e1a8b2;
  background: #fff2f4;
}

.formal-gate-rules strong {
  color: var(--ink);
}

.formal-gate-rules span {
  color: var(--muted);
  line-height: 1.55;
}

.formal-gate-blockers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.formal-gate-actions {
  justify-content: flex-start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(420px, 48vw);
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf3f4;
  color: #365057;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
}

.status-pill.risk {
  background: #ffe5e9;
  color: #943448;
}

.status-pill.warn {
  background: #fff0d5;
  color: #825114;
}

.status-pill.ok {
  background: #daf4e9;
  color: #176344;
}

.action-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
  line-height: 1.6;
}

.report-text {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1720;
  color: #e8f0f7;
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3f4;
  color: #365057;
  font-size: 12px;
  font-weight: 700;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #415061;
  cursor: pointer;
  font-weight: 800;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--teal);
  background: #eaf7f8;
  color: var(--teal);
}

.product-dev-filter-panel {
  display: grid;
  gap: 12px;
}

.product-dev-filter-panel .panel-header {
  margin-bottom: 0;
}

.source-name,
.source-path {
  display: block;
  max-width: min(520px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-name {
  font-weight: 800;
}

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

.text-link {
  color: var(--teal);
  text-decoration: none;
}

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

.product-dev-filter-panel + .grid-2 table,
.product-dev-filter-panel ~ .panel table {
  min-width: 980px;
}

.supplier-risk-filters {
  margin-bottom: 12px;
}

.gap-toolbar {
  display: grid;
  gap: 12px;
}

.gap-toolbar .filter-chip-row {
  align-items: center;
}

.formula-gap-batch {
  display: grid;
  grid-template-columns: 180px 140px minmax(140px, 1fr) 160px minmax(220px, 1.3fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.formula-gap-batch > div {
  display: grid;
  gap: 4px;
}

.formula-gap-batch strong {
  font-size: 14px;
}

.formula-gap-batch div span,
.formula-gap-batch label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.formula-gap-batch label {
  display: grid;
  gap: 5px;
}

.formula-gap-batch input,
.formula-gap-batch select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.formula-gap-batch-presets {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.formula-gap-batch-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f1c7d1;
  border-radius: 8px;
  background: #fff7f9;
}

.formula-gap-batch-undo-preview {
  margin-top: 10px;
  min-width: 980px;
}

.batch-audit-summary {
  margin: 14px 0;
}

.formula-gap-workflow {
  display: grid;
  grid-template-columns: 148px 150px 160px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.formula-gap-workflow label {
  display: grid;
  gap: 5px;
}

.formula-gap-workflow label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.formula-gap-workflow input,
.formula-gap-workflow select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.formula-gap-save-button {
  min-height: 38px;
  white-space: nowrap;
}

.formula-gap-workflow small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.formula-gap-detail-table .formula-gap-detail-action td {
  padding: 0 18px 18px;
  background: #fbfdff;
}

.formula-gap-action-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
}

.formula-gap-action-note {
  display: grid;
  gap: 4px;
}

.formula-gap-action-note strong {
  color: var(--ink);
  font-size: 14px;
}

.formula-gap-action-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wrap-cell {
  min-width: 240px;
  max-width: 520px;
  white-space: normal;
  text-align: left;
  line-height: 1.5;
}

.wrap-cell strong,
.wrap-cell span {
  display: block;
}

.wrap-cell > span {
  color: var(--muted);
  font-size: 12px;
}

.prefill-material-cell {
  min-width: 180px;
}

.prefill-field-list {
  display: grid;
  gap: 4px;
}

.prefill-field-list span {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  color: #415061;
  font-size: 12px;
}

.prefill-field-list b {
  color: var(--muted);
}

.prefill-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

@media (max-width: 1180px) {
  .formula-gap-batch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-gap-batch > div,
  .formula-gap-batch .wide {
    grid-column: 1 / -1;
  }

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

  .formula-gap-save-button {
    width: 100%;
  }

  .formal-gate-rules {
    grid-template-columns: 1fr;
  }
}

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

.ap-status-tile {
  display: grid;
  justify-items: start;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.ap-status-tile strong {
  font-size: 24px;
}

.ap-status-tile:hover,
.ap-status-tile.active {
  border-color: var(--teal);
  background: #eef9fa;
}

.ap-progress {
  height: 8px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 999px;
  background: #e7edf2;
}

.ap-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.ap-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ap-status-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ap-status-button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #415061;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ap-status-button:hover,
.ap-status-button.active {
  border-color: var(--teal);
  background: #eaf7f8;
  color: var(--teal);
}

.ap-followup-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ap-followup-form label {
  display: grid;
  gap: 6px;
}

.ap-followup-form label.wide {
  grid-column: 1 / -2;
}

.ap-followup-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ap-followup-form input,
.ap-followup-form select,
.ap-followup-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  font-weight: 700;
}

.ap-followup-form textarea {
  resize: vertical;
}

.ap-followup-form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ap-alias-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ap-unmatched-assignment {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(96px, 1fr) minmax(110px, 1fr) minmax(160px, 1.4fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 560px;
}

.ap-unmatched-assignment input,
.ap-unmatched-assignment select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.ap-alias-button {
  min-height: 30px;
  padding: 0 10px;
}

.ap-alias-button.danger {
  border-color: #f1c4cf;
  color: var(--red);
}

.ap-alias-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.empty {
  padding: 48px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .nav-section-title {
    grid-column: 1 / -1;
  }

  .nav-item,
  .nav-link {
    justify-content: center;
    text-align: center;
  }

  .kpi-grid,
  .grid-2,
  .grid-3,
  .overview-action-list,
  .ap-status-grid {
    grid-template-columns: 1fr;
  }

  .ap-followup-form {
    grid-template-columns: 1fr;
  }

  .ap-followup-form label.wide {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .filters,
  .report-header,
  .report-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .module-link {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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