:root {
  --app-bg: #f4f6f8;
  --card-border: #dfe3e8;
  --table-border: #e6e9ee;
  --bs-primary: #022061;
  --bs-primary-rgb: 2, 32, 97;
  --bs-link-color: #022061;
  --bs-link-hover-color: #011746;
}

body {
  background: var(--app-bg);
}

.form-check-input {
  border-color: #9aa7bd;
}

.form-check-input:checked {
  background-color: #022061;
  border-color: #022061;
}

.form-check-input:focus,
.form-select:focus,
.form-control:focus,
.btn:focus {
  border-color: #022061;
  box-shadow: 0 0 0 0.2rem rgba(2, 32, 97, 0.2);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(2, 32, 97, 0.16);
}

.btn-primary {
  background-color: #022061;
  border-color: #022061;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn-primary.active {
  background-color: #011746;
  border-color: #011746;
}

.btn-outline-primary {
  color: #022061;
  border-color: #022061;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary.active {
  background-color: #022061;
  border-color: #022061;
  color: #fff;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  background-color: #022061;
  border-color: #022061;
  color: #fff;
}

.nav-pills .nav-link,
.nav-tabs .nav-link {
  color: #022061;
}

option:checked,
select[multiple] option:checked {
  background: #022061 linear-gradient(0deg, #022061 0%, #022061 100%);
  color: #fff;
}

.app-auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(2, 32, 97, 0.12), transparent 30%),
    linear-gradient(180deg, #f4f6f8 0%, #eef2f7 100%);
}

.auth-form-stack {
  display: grid;
  gap: 0.9rem;
}

.route-view .card {
  border: 1px solid var(--card-border);
}

.activity-description-editor {
  display: block;
  min-height: 96px;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: transparent;
  border: 0;
  padding: 0;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.activity-description-editor *,
.activity-description-editor::before,
.activity-description-editor::after {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.app-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--table-border);
  background: #fff;
}

.app-table-wrap:focus,
.app-table-wrap:focus-visible,
.app-table-wrap-no-scroll:focus,
.app-table-wrap-no-scroll:focus-visible,
.app-table-wrap-sm:focus,
.app-table-wrap-sm:focus-visible,
.tab-pane:focus,
.tab-pane:focus-visible {
  outline: none;
  box-shadow: none;
}

.app-table-wrap-no-scroll {
  max-height: none;
  overflow: visible;
}

.app-table-wrap-sm {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--table-border);
  background: #fff;
}

.app-table {
  margin-bottom: 0;
  font-size: 0.875rem;
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.app-table thead th {
  position: sticky;
  top: 0;
  background: #f8f9fb;
  z-index: 1;
  border-bottom: 1px solid var(--table-border);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  text-align: left;
}

.app-table td,
.app-table th {
  border-color: var(--table-border);
  vertical-align: middle;
  text-align: left;
}

.app-table th.app-table-col-truncate-300,
.app-table td.app-table-col-truncate-300 {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}

.app-table td.app-table-col-truncate-300 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-table tbody tr.app-row-selected > * {
  background: #e6d195 !important;
}

.app-table-header-wrap {
  display: inline-block;
  max-width: 7.5rem;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.2;
}

.invoice-lineitems-card {
  overflow: hidden;
}

.invoice-lineitems-card .card-body {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.invoice-lineitems-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.invoice-lineitems-table {
  width: 1870px;
  min-width: 1870px;
  max-width: none;
  table-layout: fixed;
  font-size: 0.9rem;
}

.invoice-lineitems-table thead th {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.invoice-lineitems-table th:nth-child(1),
.invoice-lineitems-table td:nth-child(1) {
  width: 64px;
}

.invoice-lineitems-table th:nth-child(2),
.invoice-lineitems-table td:nth-child(2) {
  width: 190px;
}

.invoice-lineitems-table th:nth-child(3),
.invoice-lineitems-table td:nth-child(3) {
  width: 185px;
}

.invoice-lineitems-table th:nth-child(4),
.invoice-lineitems-table td:nth-child(4) {
  width: 145px;
}

.invoice-lineitems-table th:nth-child(5),
.invoice-lineitems-table td:nth-child(5) {
  width: 240px;
}

.invoice-lineitems-table th:nth-child(6),
.invoice-lineitems-table td:nth-child(6) {
  width: 185px;
}

.invoice-lineitems-table th:nth-child(7),
.invoice-lineitems-table td:nth-child(7),
.invoice-lineitems-table th:nth-child(8),
.invoice-lineitems-table td:nth-child(8) {
  width: 118px;
}

.invoice-lineitems-table th:nth-child(9),
.invoice-lineitems-table td:nth-child(9) {
  width: 70px;
}

.invoice-lineitems-table th:nth-child(10),
.invoice-lineitems-table td:nth-child(10) {
  width: 110px;
}

.invoice-lineitems-table th:nth-child(11),
.invoice-lineitems-table td:nth-child(11) {
  width: 100px;
}

.invoice-lineitems-table th:nth-child(12),
.invoice-lineitems-table td:nth-child(12),
.invoice-lineitems-table th:nth-child(13),
.invoice-lineitems-table td:nth-child(13) {
  width: 150px;
}

.invoice-lineitems-table th:nth-child(14),
.invoice-lineitems-table td:nth-child(14) {
  width: 64px;
}

.invoice-lineitems-table .form-control,
.invoice-lineitems-table .form-select {
  width: 100%;
  min-width: 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.invoice-lineitems-table td,
.invoice-lineitems-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.form-control-sm,
.form-select-sm,
.btn-sm {
  border-radius: 0.35rem;
}

.muted-note {
  color: #6c757d;
  font-size: 0.875rem;
}

.offer-comparison-summary {
  margin-bottom: 1rem;
}

.offer-comparison-na-cell {
  background: #f8d7da;
  color: #842029;
  font-weight: 600;
}

.offer-input-section {
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.9rem 1rem;
}

.offer-input-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b1b1b;
}

.offer-input-section-note {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #6c757d;
}

.offer-environmental-empty {
  border: 1px dashed #cfd6df;
  border-radius: 0.45rem;
  background: #fbfcfe;
  padding: 0.75rem 0.85rem;
  color: #6c757d;
  font-size: 0.84rem;
}

.offer-environmental-backfill-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.9rem;
}

.offer-environmental-backfill-bar .form-check {
  flex: 0 0 auto;
}

.offer-environmental-backfill-bar .form-select {
  max-width: 18rem;
}

.offer-environmental-derived {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.offer-comparison-tab-content {
  margin-top: 1rem;
}

.app-offer-results {
  background: #f8f9fb;
  border: 1px solid var(--table-border);
  border-radius: 0.35rem;
  max-height: 24rem;
  overflow: auto;
  padding: 0.75rem;
  font-size: 0.8rem;
}

.offer-report-config {
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.9rem 1rem;
}

.offer-report-config-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b1b1b;
}

.offer-report-config-note {
  font-size: 0.8rem;
  color: #6c757d;
}

.offer-comparison-round-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem;
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.9rem 1rem;
}

.offer-comparison-round-actions-copy {
  min-width: 0;
}

.offer-comparison-round-actions-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b1b1b;
}

.offer-comparison-round-actions-note {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.2rem;
}

.offer-comparison-round-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.offer-comparison-round-selection-pill {
  border: 1px solid #d9e0ea;
  border-radius: 999px;
  background: #f8f9fb;
  color: #42526b;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.42rem 0.65rem;
}

.offer-comparison-round-reason {
  min-width: 18rem;
}

.offer-report-version-create {
  border-bottom: 1px solid #edf0f4;
  padding-bottom: 0.85rem;
}

.offer-report-round-group {
  border: 1px solid #edf0f4;
  border-radius: 0.5rem;
  background: #fbfcfe;
  padding: 0.75rem 0.85rem;
}

.offer-report-round-header {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #edf0f4;
}

.offer-report-round-revisions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.offer-report-version-list {
  display: grid;
  gap: 0.65rem;
}

.offer-report-version-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #edf0f4;
  border-radius: 0.45rem;
  background: #fff;
  padding: 0.75rem 0.85rem;
}

.offer-report-version-row.is-active {
  border-color: #022061;
  box-shadow: 0 0 0 1px rgba(2, 32, 97, 0.1);
}

.offer-report-version-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

.offer-report-version-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.offer-report-version-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.offer-report-version-pill {
  border: 1px solid #cfd6df;
  border-radius: 999px;
  background: #fff;
  color: #022061;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.28rem 0.48rem;
}

.offer-report-version-pill:hover {
  border-color: #022061;
  background: #f8f9fb;
}

.offer-report-config-section {
  border: 1px solid #edf0f4;
  border-radius: 0.45rem;
  background: #fbfcfe;
  padding: 0.75rem 0.85rem;
  height: 100%;
}

.offer-report-config-subsections {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #edf0f4;
}

.offer-report-config-disabled {
  opacity: 0.55;
}

.offer-report-detail-card {
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.9rem 1rem;
}

.offer-report-detail-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b1b1b;
  margin-bottom: 0.75rem;
}

.offer-report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.offer-report-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.offer-report-detail-value {
  font-size: 0.9rem;
  color: #1b1b1b;
  margin-top: 0.15rem;
  word-break: break-word;
}

.offer-report-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

@media (max-width: 991.98px) {
  .offer-comparison-round-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .offer-comparison-round-actions-toolbar {
    justify-content: flex-start;
  }

  .offer-comparison-round-reason {
    min-width: 0;
    width: 100%;
  }

  .offer-report-detail-grid {
    grid-template-columns: 1fr;
  }
}

.offer-report-preview-card {
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
}

.offer-report-preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--table-border);
  background: #fbfcfe;
}

.offer-report-preview-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1b1b1b;
}

.offer-report-preview-card-body {
  padding: 1rem;
  overflow-x: auto;
}

#offerComparisonForm input[name^="peak_rate_cents_"],
#offerComparisonForm input[name^="shoulder_rate_cents_"],
#offerComparisonForm input[name^="offpeak_rate_cents_"] {
  min-width: 6.5rem;
}

#offerComparisonReportBody h2,
#offerComparisonReportBody h3,
#offerComparisonReportBody h4 {
  margin: 0;
  color: #1b1b1b;
}

#offerComparisonReportBody h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

#offerComparisonReportBody h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.15rem;
  margin-bottom: 0.65rem;
}

#offerComparisonReportBody h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.9rem;
  margin-bottom: 0.35rem;
}

.offer-report-term-card {
  border: 1px solid var(--table-border);
  border-radius: 0.35rem;
  padding: 0.6rem 0.75rem;
  background: #fbfcfe;
}

.offer-report-disclaimer {
  border-top: 1px solid var(--table-border);
  padding-top: 0.6rem;
}

.offer-report-section-copy {
  font-size: 0.875rem;
  color: #495057;
}

.offer-report-appendix-block {
  border: 1px solid var(--table-border);
  border-radius: 0.35rem;
  padding: 0.75rem;
  background: #fff;
}

.offer-retailer-appendix-sheet {
  padding: 1rem;
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.12);
}

.offer-retailer-appendix-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.offer-retailer-appendix-offer-type {
  margin-left: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #d64545;
}

.offer-retailer-appendix-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.78rem;
  line-height: 1.2;
}

.offer-retailer-appendix-table th,
.offer-retailer-appendix-table td {
  padding: 0.2rem 0.3rem;
}

.offer-retailer-appendix-table th {
  white-space: normal;
  word-break: break-word;
}

.offer-retailer-appendix-table td {
  white-space: nowrap;
}

#offerComparisonReportBody .offer-report-page-break-before {
  position: relative;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px dashed #cfd6df;
}

#offerComparisonReportBody .offer-report-page-break-before::before {
  content: "Page Break";
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.1rem 0.55rem;
  border: 1px solid #cfd6df;
  border-radius: 999px;
  background: #fff;
  color: #6c757d;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-report-word-count {
  border: 1px solid var(--table-border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: #fbfcfe;
  font-size: 0.8rem;
  color: #495057;
}

.market-report-word-count.is-good {
  border-color: #b7dfc2;
  background: #eef9f1;
  color: #1f6b37;
}

.market-report-word-count.is-low,
.market-report-word-count.is-high {
  border-color: #f1d3a2;
  background: #fff7e8;
  color: #8a5a00;
}

.market-report-table-card {
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  background: #fbfcfe;
  padding: 0.8rem;
}

.market-report-table-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

#marketReportPreview {
  max-width: 920px;
}

.market-report-preview-sheet {
  background: #fff;
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.12);
  padding: 1.25rem 1.35rem;
}

.market-report-pdf.market-report-preview-sheet {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 10px 12px 0;
  background: #ffffff;
}

.market-report-cover-page {
  min-height: 1085px;
  display: flex;
  flex-direction: column;
}

.market-report-export-host {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  background: #fff;
  z-index: -1;
  pointer-events: none;
}

.market-report-brand-header {
  margin: 0;
  padding: 1.3rem 1.25rem 1.35rem;
  border-bottom: 1px solid #d9dde5;
  position: relative;
  z-index: 1;
  text-align: left;
}

.market-report-brand-frame {
  margin: 0 auto 0.8rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  max-width: 96%;
  position: relative;
  z-index: 1;
}

.market-report-brand-logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1.05rem;
}

.market-report-cover-logo {
  width: 126px;
  height: auto;
  display: block;
}

.market-report-brand-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #022061;
  margin-bottom: 0.25rem;
}

.market-report-brand-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8f7222;
  margin-bottom: 0.52rem;
  text-align: center;
}

.market-report-brand-title {
  font-size: 1.68rem;
  font-weight: 700;
  line-height: 1.08;
  color: #10203d;
  max-width: 88%;
  text-align: center;
  margin: 0 auto;
}

.market-report-brand-month {
  font-size: 0.96rem;
  font-weight: 600;
  color: #6a7280;
  margin-top: 0.36rem;
  text-align: center;
}

.market-report-body {
  position: relative;
  z-index: 1;
  padding: 0.45rem 1rem 0;
  max-width: 96%;
  margin: 0 auto;
  width: 100%;
  flex: 1 1 auto;
}

.market-report-section {
  margin-bottom: 1rem;
  break-inside: avoid-page;
  page-break-inside: avoid;
  padding: 0.7rem 0 0.2rem;
  background: transparent;
}

.market-report-section h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 0.72rem;
  color: #0c245f;
  break-after: avoid-page;
  page-break-after: avoid;
  position: relative;
  display: inline-block;
  padding-bottom: 0.28rem;
}

.market-report-section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b2a76 0%, #e4ba41 100%);
}

.market-report-section p {
  margin: 0 0 0.58rem;
  font-size: 0.84rem;
  color: #3f4755;
  line-height: 1.56;
}

.market-report-section ul {
  margin: 0.12rem 0 0.58rem 1rem;
  padding: 0;
}

.market-report-section li {
  margin: 0 0 0.28rem;
  font-size: 0.84rem;
  color: #3f4755;
  line-height: 1.54;
}

.market-report-citation {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-left: 0.04em;
}

.market-report-divider {
  border: 0;
  border-top: 1px solid #d7dce3;
  margin: 0.9rem 0 1rem;
  opacity: 1;
}

.market-report-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.market-report-preview-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1b1b1b;
  line-height: 1.1;
}

.market-report-preview-month {
  font-size: 0.9rem;
  color: #6c757d;
}

.market-report-preview-grid {
  display: grid;
  gap: 0.9rem;
}

.market-report-preview-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #022061;
}

.market-report-preview-section p {
  margin: 0;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.45;
}

.market-report-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.9);
  margin-top: 0.15rem;
}

.market-report-preview-table th,
.market-report-preview-table td {
  border: 1px solid #d8deea;
  padding: 0.38rem 0.42rem;
  vertical-align: top;
}

.market-report-preview-table th {
  background: linear-gradient(90deg, #0b2a76 0%, #173b91 100%);
  color: #fff;
  font-weight: 700;
}

.market-report-export-table {
  margin: 0 0 0.75rem;
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.market-report-preview-table tbody tr:nth-child(even) {
  background: #f8faff;
}

.market-report-preview-table tbody td:first-child {
  font-weight: 700;
  color: #0f2b6d;
}

@media (max-width: 720px) {
  .market-report-brand-title {
    max-width: none;
  }
}

.market-report-list {
  display: grid;
  gap: 0.65rem;
}

.market-report-list-item {
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
  cursor: pointer;
}

.market-report-list-item.is-active {
  border-color: #022061;
  background: #f7f9ff;
}

.market-report-list-title {
  font-weight: 700;
  color: #1b1b1b;
  margin-bottom: 0.2rem;
}

.market-report-list-meta {
  font-size: 0.78rem;
  color: #6c757d;
}

.market-report-list-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.market-report-editor-shell {
  background: #fff;
  border: 1px solid var(--table-border);
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.market-report-editor {
  min-height: 980px;
  padding: 1.25rem 1.35rem;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #1f2937;
  outline: none;
}

#contractCreatePageForm .form-control,
#contractCreatePageForm .form-select {
  width: 100%;
  max-width: 22rem;
}

#contractCreatePageForm.contract-form-grid {
  max-width: 1180px;
  margin: 0;
  align-items: start;
}

#contractCreatePageForm .contract-form-group-card {
  border: 1px solid #dfe3e8;
  border-radius: 0.5rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

#contractCreatePageForm input[disabled],
#contractCreatePageForm input[type="number"],
#contractCreatePageForm input[type="date"] {
  max-width: 8.5rem;
}

#contractCreatePageForm select {
  max-width: 16rem;
}

#contractCreatePageForm input[name="deal_name"],
#contractCreatePageForm input[name="energy_source"],
#contractCreatePageForm input[name="stage_reason"] {
  max-width: 26rem;
}

.nmi-info-icon {
  color: #6b7280;
  margin-left: 0.25rem;
}

#createContractNmis,
#contractNmisInput,
.nmi-count-text {
  font-family: Consolas, "Courier New", monospace;
}

.nmi-count-text.is-invalid {
  color: #b02a37;
}

.contract-validation-text {
  color: #b02a37;
}

#contractCreatePageForm .form-control.is-invalid,
#contractCreatePageForm .form-select.is-invalid {
  border-color: #b02a37;
}

#contractCreatePageForm .form-control:disabled,
#contractCreatePageForm .form-select:disabled,
#contractForm .form-control:disabled,
#contractForm .form-select:disabled,
.contract-field-disabled {
  background: #eef2f6;
  border-color: #d5dce5;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 1;
}

#contractCreatePageForm .form-select:disabled,
#contractForm .form-select:disabled,
.contract-field-disabled.form-select {
  background-image: none;
}

.contract-field-row-disabled .form-label,
.contract-field-row-disabled .manage-page-trigger,
.contract-field-row-disabled .manage-list-trigger {
  color: #6b7280;
}

.contract-field-xs {
  max-width: 8rem;
}

.contract-field-sm {
  max-width: 12rem;
}

.contract-field-md {
  max-width: 16rem;
}

.contract-field-lg {
  max-width: 100%;
}

#contractForm.contract-form-horizontal > .col-12 {
  display: grid;
  grid-template-columns: 1.2rem 8rem minmax(0, 1fr) 1.2rem;
  align-items: center;
  column-gap: 0.75rem;
}

#contractForm.contract-form-horizontal .form-label {
  margin-bottom: 0;
}

#contractForm.contract-form-horizontal .contract-column-toggle {
  margin: 0;
}

#contractForm.contract-form-horizontal .manage-list-spacer {
  width: 1.2rem;
  display: inline-block;
}

#contractForm.contract-form-horizontal .manage-list-trigger {
  text-decoration: underline;
  color: #022061;
  justify-self: start;
}

/* CSS fallback for DMA contract forms when JS field-state sync does not apply. */
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageNmisField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageUsageCard,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageElectricityTotalField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageElectricitySourceField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageGasField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageGasSourceField,
#contractForm:has(#contractTypeSelect option[value="DMA"]:checked) #contractModalNmisField {
  display: none !important;
}

#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageDmaMeterCountField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageDmaCostField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageDmaSellField,
#contractCreatePageForm:has(#createContractType option[value="DMA"]:checked) #contractPageDmaCommissionField,
#contractForm:has(#contractTypeSelect option[value="DMA"]:checked) #contractModalDmaMeterCountField,
#contractForm:has(#contractTypeSelect option[value="DMA"]:checked) #contractModalDmaCostField,
#contractForm:has(#contractTypeSelect option[value="DMA"]:checked) #contractModalDmaSellField,
#contractForm:has(#contractTypeSelect option[value="DMA"]:checked) #contractModalDmaCommissionField {
  display: block !important;
}

@media (max-width: 767.98px) {
  #contractForm.contract-form-horizontal > .col-12 {
    grid-template-columns: 1.2rem 1fr 1.2rem;
    row-gap: 0.35rem;
  }

  #contractForm.contract-form-horizontal > .col-12 > :nth-child(3) {
    grid-column: 1 / -1;
  }

  #contractForm.contract-form-horizontal .form-label {
    margin-bottom: 0;
  }
}

.invoice-detail-card {
  overflow: hidden;
}

.invoice-lineitems-card {
  overflow: visible;
}

.invoice-detail-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--table-border);
  background: #fff;
}

.invoice-detail-card-note {
  font-size: 0.8rem;
  color: #6c757d;
}

.invoice-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.invoice-detail-meta-item {
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  background: #fff;
  padding: 0.7rem 0.8rem;
}

.invoice-detail-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 0.2rem;
}

.invoice-detail-meta-value {
  font-size: 0.96rem;
  font-weight: 600;
  color: #1b1b1b;
  word-break: break-word;
}

.invoice-detail-meta-select {
  border: 1px solid #cfd6df;
  background-color: #fff;
  font-size: 0.96rem;
  font-weight: 600;
  color: #1b1b1b;
  padding: 0.35rem 2rem 0.35rem 0.55rem;
  min-height: 2.25rem;
  border-radius: 0.35rem;
  box-shadow: none;
  margin-top: 0.25rem;
}

.invoice-detail-meta-select:focus {
  border-color: #022061;
  box-shadow: 0 0 0 0.2rem rgba(2, 32, 97, 0.12);
}

.invoice-detail-meta-select:hover {
  border-color: #9aa7bd;
}

.lineitem-delete-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lineitem-delete-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  min-width: 7rem;
  padding: 0.3rem;
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.12);
  z-index: 3;
}

.lineitem-delete-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: #dc3545;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: left;
  padding: 0.45rem 0.55rem;
}

.lineitem-delete-menu-item:hover,
.lineitem-delete-menu-item:focus {
  background: #fff1f2;
  color: #bb2d3b;
  outline: none;
}

.lineitem-delete-control.is-open .lineitem-delete-menu {
  display: block;
}

.row-actions-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.row-actions-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  min-width: 11rem;
  padding: 0.3rem;
  border: 1px solid var(--table-border);
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.12);
  z-index: 4;
}

.row-actions-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: #1f2937;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: left;
  padding: 0.45rem 0.55rem;
}

.row-actions-menu-item:hover,
.row-actions-menu-item:focus {
  background: #eef2ff;
  color: #0f172a;
  outline: none;
}

.row-actions-menu-item.is-danger {
  color: #b42318;
}

.row-actions-menu-item.is-danger:hover,
.row-actions-menu-item.is-danger:focus {
  background: #fff1f2;
  color: #912018;
}

.row-actions-control.is-open .row-actions-menu {
  display: block;
}

.invoice-lineitems-wrap {
  max-height: none;
  overflow: visible;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.activity-panel-disabled {
  background: #f3f4f6;
  border-color: #d6d9df;
}

.activity-panel-disabled .card-body {
  opacity: 1;
  color: #6b7280;
}

.activity-panel-disabled .h6,
.activity-panel-disabled .muted-note,
.activity-panel-disabled p,
.activity-panel-disabled div,
.activity-panel-disabled span {
  color: #6b7280;
}

.activity-panel-disabled .btn[disabled],
.activity-panel-disabled .btn.disabled {
  background-color: #b8bec8;
  border-color: #b8bec8;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.activity-panel-disabled .btn[disabled]:hover,
.activity-panel-disabled .btn.disabled:hover,
.activity-panel-disabled .btn[disabled]:focus,
.activity-panel-disabled .btn.disabled:focus {
  background-color: #b8bec8;
  border-color: #b8bec8;
  color: #fff;
}

.contracts-settings-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.contracts-settings-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.contracts-settings-option .form-check-input {
  margin-top: 0;
  flex: 0 0 auto;
}

.contracts-settings-option .form-check-label {
  margin-bottom: 0;
  color: #1f2937;
  cursor: pointer;
}
