.wem-page {
  --wem-navy: #16324f;
  --wem-blue: #1f6feb;
  --wem-sky: #edf5ff;
  --wem-green: #16805c;
  --wem-red: #d94a4a;
  --wem-amber: #b7791f;
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
}
.wem-page * {
  box-sizing: border-box;
}
.wem-page .page-title {
  margin-bottom: 0;
}
.wem-title-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wem-title-actions button {
  white-space: nowrap;
}
.wem-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #cfe0f5;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff, #eef6ff);
  color: #29435e;
}
.wem-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #15324d;
}
.wem-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.wem-notice-icon {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #1769e0;
  color: #fff;
  font-weight: 800;
}
.wem-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wem-status-card {
  position: relative;
  min-height: 128px;
  padding: 17px 18px;
  border: 1px solid #e0e7ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 50, 77, 0.055);
  overflow: hidden;
}
.wem-status-card::after {
  content: '';
  position: absolute;
  right: -14px;
  bottom: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #edf4fb;
}
.wem-status-card small {
  display: block;
  margin-bottom: 11px;
  color: #6f7f90;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wem-status-card strong {
  display: block;
  color: #19344e;
  font-size: 21px;
  line-height: 1.25;
}
.wem-status-card p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  color: #7a8794;
  font-size: 12px;
}
.wem-status-card.is-good {
  border-color: #bce4d3;
  background: #f6fffb;
}
.wem-status-card.is-good strong {
  color: #147052;
}
.wem-status-card.is-warning {
  border-color: #f2d095;
  background: #fffaf0;
}
.wem-status-card.is-warning strong {
  color: #a45f08;
}
.wem-status-card.is-danger {
  border-color: #f0b5b5;
  background: #fff7f7;
}
.wem-status-card.is-danger strong {
  color: #c83c3c;
}
.wem-panel {
  border: 1px solid #e0e7ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 50, 77, 0.055);
  overflow: hidden;
}
.wem-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e8edf3;
}
.wem-panel-head h2 {
  margin: 0;
  color: #18334d;
  font-size: 17px;
}
.wem-panel-head p {
  margin: 4px 0 0;
  color: #7a8794;
  font-size: 12px;
}
.wem-panel-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wem-panel-body {
  padding: 20px;
}
.wem-setup-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
}
.wem-field {
  display: grid;
  gap: 6px;
  color: #526476;
  font-size: 12px;
  font-weight: 700;
}
.wem-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d4dee8;
  border-radius: 9px;
  background: #fff;
  color: #243b53;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}
.wem-field input:focus {
  outline: 2px solid #b8d7ff;
  border-color: #4b91eb;
}
.wem-master-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.wem-file-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #eaf7f1;
  color: #16805c;
  font-size: 11px;
  font-weight: 900;
}
.wem-master-copy b {
  display: block;
  color: #19344e;
}
.wem-master-copy span {
  display: block;
  margin-top: 4px;
  color: #7b8996;
  font-size: 12px;
}
.wem-empty {
  padding: 28px;
  text-align: center;
  color: #7b8996;
}
.wem-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #3d5268;
}
.wem-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #1769e0;
  border-radius: 8px;
  background: #1769e0;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.wem-upload-btn.secondary {
  border-color: #ccd8e4;
  background: #fff;
  color: #27445f;
}
.wem-workflow {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 10px;
  align-items: stretch;
}
.wem-quote-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #dfe7ef;
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}
.wem-quote-card.is-final {
  background: #fbfffd;
}
.wem-quote-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid #e7edf3;
}
.wem-step {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wem-step span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #173b5d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.wem-quote-card.is-final .wem-step span {
  background: #16805c;
}
.wem-step h3 {
  margin: 0;
  color: #17324d;
  font-size: 15px;
}
.wem-step p {
  margin: 3px 0 0;
  color: #84909d;
  font-size: 11px;
}
.wem-quote-file {
  padding: 12px 18px;
  background: #fff;
  color: #607284;
  font-size: 12px;
}
.wem-quote-file b {
  color: #2b435b;
}
.wem-quote-total {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: auto;
  background: #e4ebf2;
  border-top: 1px solid #e4ebf2;
}
.wem-quote-total div {
  padding: 13px 12px;
  background: #fff;
  text-align: center;
}
.wem-quote-total small {
  display: block;
  color: #8190a0;
  font-size: 10px;
}
.wem-quote-total strong {
  display: block;
  margin-top: 5px;
  color: #17324d;
  font-size: 15px;
}
.wem-flow-arrow {
  display: grid;
  place-items: center;
  color: #8092a5;
  font-size: 22px;
  font-weight: 800;
}
.wem-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid #dfe7ef;
  border-radius: 11px;
  background: #f4f7fa;
}
.wem-tabs button {
  padding: 8px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #617386;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.wem-tabs button.active {
  background: #fff;
  color: #1769e0;
  box-shadow: 0 2px 8px rgba(22, 50, 79, 0.1);
}
.wem-table-wrap {
  overflow: auto;
}
.wem-table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
}
.wem-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 10px;
  border-bottom: 1px solid #dbe4ed;
  background: #f5f8fb;
  color: #607184;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}
.wem-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf1f5;
  color: #314b63;
  font-size: 12px;
  text-align: right;
}
.wem-table td:first-child,
.wem-table td:nth-child(2),
.wem-table td:nth-child(3) {
  text-align: left;
}
.wem-table tbody tr:hover {
  background: #f8fbff;
}
.wem-table .wem-item-name {
  color: #17324d;
  font-weight: 800;
}
.wem-table .wem-sub {
  display: block;
  margin-top: 3px;
  color: #8b98a5;
  font-size: 10px;
}
.wem-delta-up {
  color: #d34747 !important;
  font-weight: 800;
}
.wem-delta-down {
  color: #187f5b !important;
  font-weight: 800;
}
.wem-delta-zero {
  color: #8794a1 !important;
}
.wem-match {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf8f2;
  color: #13704f;
  font-size: 10px;
  font-weight: 800;
}
.wem-match.miss {
  background: #fff2e2;
  color: #a35f09;
}
.wem-comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf3;
  background: #fbfcfe;
}
.wem-comparison-summary div {
  padding: 12px 14px;
  border-left: 3px solid #dbe7f3;
  background: #fff;
}
.wem-comparison-summary small {
  display: block;
  color: #8190a0;
  font-size: 10px;
}
.wem-comparison-summary strong {
  display: block;
  margin-top: 5px;
  color: #19344e;
  font-size: 18px;
}
.wem-comparison-summary .up {
  border-color: #e97979;
}
.wem-comparison-summary .up strong {
  color: #cf4141;
}
.wem-comparison-summary .down {
  border-color: #63b996;
}
.wem-comparison-summary .down strong {
  color: #147453;
}
.wem-footnote {
  margin: 0;
  padding: 12px 20px;
  background: #f8fafc;
  color: #7a8998;
  font-size: 11px;
  line-height: 1.6;
}
.wem-hidden {
  display: none !important;
}
.wem-raw-file {
  display: none;
}
.wem-print-title {
  display: none;
}
.wem-error-box {
  margin: 16px 20px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #fff2f2;
  color: #b93b3b;
  font-size: 12px;
}
.wem-master-details {
  margin-top: 16px;
}
.wem-master-details summary {
  cursor: pointer;
  color: #526b83;
  font-size: 12px;
  font-weight: 800;
}
.wem-master-details .wem-table-wrap {
  margin-top: 10px;
  max-height: 300px;
  border: 1px solid #e6ecf2;
  border-radius: 10px;
}
.wem-delete-link {
  border: 0;
  background: transparent;
  color: #a34b4b;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}
.wem-quote-total .has-mismatch {
  background: #fff6f6;
}
.wem-quote-total .has-mismatch strong {
  color: #c83d3d;
}
.wem-quote-detail-table {
  min-width: 1080px;
}
.wem-change-table {
  min-width: 980px;
}
.wem-table td:nth-child(4),
.wem-table td:nth-child(5) {
  text-align: left;
}
.wem-row-mismatch {
  background: #fffafa;
}
.wem-row-mismatch:hover {
  background: #fff4f4 !important;
}
.wem-rate-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.wem-rate-badge.matched {
  background: #e9f8f1;
  color: #12704f;
}
.wem-rate-badge.mismatch {
  background: #ffe9e9;
  color: #c63838;
}
.wem-rate-badge.unknown {
  background: #fff2df;
  color: #9c5d0d;
}
.wem-rate-delta {
  display: block;
  margin-top: 4px;
  color: #c63838;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.wem-transition {
  display: grid;
  grid-template-columns: auto 12px auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.wem-transition span {
  color: #718092;
}
.wem-transition i {
  color: #a4afba;
  font-style: normal;
}
.wem-transition strong {
  color: #18344e;
}
.wem-transition small {
  grid-column: 1/-1;
  text-align: center;
  font-size: 10px;
}
.wem-rate-stack {
  display: grid;
  gap: 5px;
  min-width: 145px;
  text-align: left;
}
.wem-rate-stack > small {
  padding-bottom: 5px;
  border-bottom: 1px solid #e5ebf1;
  color: #657789;
}
.wem-rate-stack > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: #5b6e81;
  font-size: 10px;
}
.wem-rate-stack .wem-rate-badge {
  padding: 2px 5px;
  font-size: 9px;
}
.wem-rate-stack .wem-rate-delta {
  display: none;
}
.wem-change-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0dd;
  color: #a35e08;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.wem-change-badge.same {
  background: #eef2f6;
  color: #758493;
}
.wem-comparison-notes {
  display: grid;
  gap: 4px;
  min-width: 210px;
  text-align: left;
}
.wem-comparison-notes span {
  display: block;
  color: #586d82;
  font-size: 10px;
  line-height: 1.45;
}
.wem-setup-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}
.wem-comparison-summary {
  grid-template-columns: repeat(3, 1fr);
}
.wem-master-upload {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.wem-master-upload > label:first-child {
  display: grid;
  gap: 5px;
  color: #617285;
  font-size: 10px;
  font-weight: 800;
}
.wem-master-upload input[type='number'] {
  width: 104px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccd8e4;
  border-radius: 8px;
  color: #19344e;
  font-weight: 800;
}
.wem-cycle-due {
  padding: 8px 12px;
  border-radius: 9px;
  background: #eef8f4;
  color: #147052;
  font-size: 11px;
}
.wem-cycle-due.is-warning {
  background: #fff5e4;
  color: #9e610d;
}
.wem-cycle-due.is-danger {
  background: #fff0f0;
  color: #c73b3b;
}
.wem-cycle-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow: auto;
}
.wem-cycle-flow > i {
  display: grid;
  place-items: center;
  color: #a0adba;
  font-style: normal;
}
.wem-cycle-flow article {
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid #dde6ee;
  border-radius: 11px;
  background: #fbfcfe;
}
.wem-cycle-flow article.done {
  border-color: #bfe4d3;
  background: #f6fffb;
}
.wem-cycle-flow article.next {
  border-color: #c7daf2;
  background: #f5f9ff;
}
.wem-cycle-flow article.next.is-warning {
  border-color: #f0cf94;
  background: #fffaf0;
}
.wem-cycle-flow article.next.is-danger {
  border-color: #efb7b7;
  background: #fff7f7;
}
.wem-cycle-flow span,
.wem-cycle-flow small {
  display: block;
  color: #7b8998;
  font-size: 10px;
}
.wem-cycle-flow b {
  display: block;
  margin: 5px 0;
  color: #19344e;
  font-size: 14px;
}
.wem-cycle-empty {
  margin: 12px 0 0;
  color: #7b8998;
  font-size: 11px;
}
.wem-mismatch-only {
  display: grid;
  gap: 4px;
}
.wem-mismatch-only span {
  padding: 4px 7px;
  border-radius: 6px;
  background: #ffeaea;
  color: #c43737;
  font-size: 10px;
  white-space: nowrap;
}
.wem-mismatch-only b {
  margin-right: 4px;
}
.wem-settlement-table {
  min-width: 1120px;
}
.wem-settlement-table td {
  text-align: center;
}
.wem-edit-settlement,
.wem-delete-settlement {
  padding: 6px 10px;
  border: 1px solid #cbd8e5;
  border-radius: 7px;
  background: #fff;
  color: #34516c;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.wem-delete-settlement {
  border-color: #efc3c3;
  color: #bd3f3f;
}
.wem-settlement-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.wem-no-revision {
  color: #8a98a7;
  font-size: 10px;
}
.wem-revision-details {
  min-width: 220px;
  text-align: left;
}
.wem-revision-details summary {
  cursor: pointer;
  color: #315776;
  font-size: 10px;
  font-weight: 900;
}
.wem-revision-details > div {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}
.wem-revision-details article {
  padding: 7px 8px;
  border: 1px solid #e1e8ef;
  border-radius: 7px;
  background: #f8fafc;
}
.wem-revision-details article b,
.wem-revision-details article small,
.wem-revision-details article span {
  display: block;
}
.wem-revision-details article b {
  color: #274b68;
  font-size: 10px;
}
.wem-revision-details article small {
  margin: 2px 0 4px;
  color: #8a98a7;
  font-size: 9px;
}
.wem-revision-details article span {
  color: #60758a;
  font-size: 9px;
  line-height: 1.45;
}
.wem-quote-total .has-unknown {
  background: #fffaf1;
}
.wem-quote-total .has-unknown strong {
  color: #916015;
}
.wem-quote-total em {
  display: block;
  margin-top: 4px;
  color: #9a681b;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
@media (max-width: 1100px) {
  .wem-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wem-setup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wem-workflow {
    grid-template-columns: 1fr;
  }
  .wem-flow-arrow {
    transform: rotate(90deg);
    height: 24px;
  }
  .wem-comparison-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .wem-status-grid,
  .wem-setup-grid,
  .wem-comparison-summary {
    grid-template-columns: 1fr;
  }
  .wem-panel-head,
  .wem-master-summary {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .wem-title-actions {
    width: 100%;
  }
  .wem-title-actions button {
    flex: 1;
  }
  .wem-quote-total {
    grid-template-columns: 1fr;
  }
  .wem-status-card {
    min-height: 105px;
  }
}
@media print {
  body * {
    visibility: hidden;
  }
  .wem-page,
  .wem-page * {
    visibility: visible;
  }
  .wem-page {
    position: absolute;
    inset: 0;
    padding: 0;
    background: #fff;
  }
  .sidebar,
  .topbar,
  .wem-title-actions,
  .wem-notice,
  .wem-status-grid,
  .wem-panel:not(.wem-comparison-panel),
  .wem-tabs {
    display: none !important;
  }
  .main,
  .content {
    margin: 0 !important;
    padding: 0 !important;
  }
  .wem-comparison-panel {
    border: 0;
    box-shadow: none;
  }
  .wem-print-title {
    display: block;
    padding: 0 0 18px;
  }
  .wem-print-title h1 {
    margin: 0 0 6px;
    font-size: 24px;
  }
  .wem-table {
    min-width: 0;
  }
  .wem-table th,
  .wem-table td {
    padding: 7px 5px;
    font-size: 9px;
  }
}
.wem-settlement-note {
  min-width: 220px;
  color: #60758a !important;
  line-height: 1.5;
  text-align: left !important;
  white-space: pre-wrap;
}
.wem-rate-mismatch-details {
  border-top: 1px solid #f0d5d5;
  background: #fffafa;
}
.wem-rate-mismatch-details summary {
  padding: 10px 14px;
  color: #bd3d3d;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.wem-rate-mismatch-details > div {
  display: grid;
  gap: 7px;
  padding: 0 14px 12px;
}
.wem-rate-mismatch-details article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 9px 10px;
  border: 1px solid #f0d6d6;
  border-radius: 8px;
  background: #fff;
}
.wem-rate-mismatch-details b {
  grid-column: 1/-1;
  color: #28445e;
  font-size: 11px;
}
.wem-rate-mismatch-details span {
  color: #687b8e;
  font-size: 10px;
}
.wem-rate-mismatch-details em {
  color: #c83d3d;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}
