/* 016N Supplier settlement hierarchy + closeout accumulation */

/* Reservation reader: neutralize the legacy mobile top offset while we carry the
   booking-title fix in the same closeout batch. */
body.supplier-studio-page .booking-workspace .booking-detail-head,
body.supplier-studio-page .booking-detail-head {
  top: auto !important;
  margin-top: 0 !important;
  transform: none !important;
}

/* Overview listings are intentionally collapsed on entry. */
.overview-offer-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.overview-offer-collapsible[hidden] { display: none !important; }
.overview-offer-collapsible { width: 100%; }

/* Settlements: one hierarchy, one management surface per payout method. */
.settlement-unified .settlement-current {
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 14px 0 20px;
}
.settlement-unified .settlement-rule {
  margin-bottom: 12px;
}
.settlement-unified .settlement-rule p {
  margin: 0;
}
.settlement-methods-unified {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid #e5ebf1;
}
.settlement-methods-unified .settlement-subhead {
  margin-bottom: 10px;
}
.settlement-methods-unified .settlement-subhead p {
  margin: 3px 0 0;
  color: #6b7b89;
  font-size: 11px;
}
.settlement-method-unified {
  border: 1px solid #dce5ee;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-top: 10px;
}
.settlement-method-unified > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  min-height: 62px;
}
.settlement-method-unified > summary::-webkit-details-marker { display: none; }
.settlement-method-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.settlement-method-name small {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #71808b;
}
.settlement-method-name b {
  color: #17324a;
  font-size: 16px;
}
.settlement-method-summary-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.settlement-method-summary-state i {
  font-style: normal;
  color: #6f8292;
  transition: transform .18s ease;
}
.settlement-method-unified[open] .settlement-method-summary-state i {
  transform: rotate(180deg);
}
.settlement-current-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e9f2ff;
  color: #0b6fd3;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
}
.settlement-method-body {
  border-top: 1px solid #edf1f5;
  padding: 15px 16px 17px;
  background: #fbfcfe;
}
.settlement-method-status {
  padding: 12px 13px;
  border: 1px solid #dfe7ee;
  border-radius: 11px;
  background: #fff;
}
.settlement-method-status b,
.settlement-method-status span {
  display: block;
}
.settlement-method-status b { color: #17324a; }
.settlement-method-status span {
  margin-top: 4px;
  color: #687985;
  font-size: 11px;
  line-height: 1.45;
}
.settlement-method-status.verified {
  border-color: #cbe6d6;
  background: #f4fbf7;
}
.settlement-method-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
}
.settlement-method-facts > div {
  padding: 11px 12px;
  border: 1px solid #e4eaf0;
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}
.settlement-method-facts small,
.settlement-method-facts b { display: block; }
.settlement-method-facts small {
  color: #7a8794;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.settlement-method-facts b {
  margin-top: 4px;
  color: #17324a;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.settlement-method-actions,
.settlement-edit-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.settlement-method-actions .settlement-secondary-action,
.settlement-edit-actions .settlement-secondary-action,
.settlement-edit-actions .module-action { margin-top: 0; }
.settlement-method-help {
  margin: 10px 0 0;
  color: #71808b;
  font-size: 10px;
  line-height: 1.45;
}
.settlement-edit-form {
  display: grid;
  gap: 10px;
}
.settlement-edit-form[hidden] { display: none !important; }
.settlement-edit-intro {
  padding: 12px 13px;
  border-radius: 11px;
  background: #f4f7fa;
  border: 1px solid #dfe7ee;
}
.settlement-edit-intro b { color: #17324a; }
.settlement-edit-intro p {
  margin: 4px 0 0;
  color: #6b7b89;
  font-size: 11px;
  line-height: 1.45;
}
.settlement-edit-form label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #405668;
}
.settlement-edit-form label > span {
  color: #7b8994;
  font-weight: 500;
}
.settlement-edit-form input,
.settlement-edit-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd6df;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: #17324a;
  font: inherit;
}

/* Centered unsaved settlement edit guard, consistent with governed editors. */
.settlement-exit-guard {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7,25,42,.56);
  backdrop-filter: blur(3px);
}
.settlement-exit-card {
  width: min(430px,100%);
  box-sizing: border-box;
  padding: 23px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 75px rgba(9,29,48,.28);
  color: #17324a;
}
.settlement-exit-card > small {
  color: #71808b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}
.settlement-exit-card h3 {
  margin: 5px 0 7px;
  font-size: 22px;
}
.settlement-exit-card p {
  margin: 0;
  color: #667786;
}
.settlement-exit-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.settlement-exit-actions button {
  width: 100%;
  border-radius: 11px;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}
.settlement-exit-actions > button:first-child {
  border: 0;
  background: #0b7ade;
  color: #fff;
}
.settlement-exit-actions .secondary-action,
.settlement-exit-actions .danger-secondary {
  border: 1px solid #cbd6df;
  background: #fff;
  color: #17324a;
}
.settlement-exit-actions .danger-secondary { color: #9a3e36; }

@media (max-width: 760px) {
  .settlement-unified .settlement-current {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 7px !important;
  }
  .settlement-unified .settlement-current > div {
    padding: 10px !important;
  }
  .settlement-method-unified > summary {
    padding: 13px 12px;
    gap: 8px;
  }
  .settlement-method-name b { font-size: 14px; }
  .settlement-method-summary-state { gap: 6px; }
  .settlement-method-facts { grid-template-columns: 1fr 1fr; }
  .overview-offer-summary {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
  .overview-offer-summary-actions {
    width: 100%;
    justify-content: stretch;
  }
  .overview-offer-summary-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 420px) {
  .settlement-unified .settlement-current { grid-template-columns: 1fr 1fr 1fr !important; }
  .settlement-method-facts { grid-template-columns: 1fr; }
  .settlement-current-pill { display: none; }
}

@media (max-width: 760px) {
  body[data-tp008g-module="settlements"] #moduleWorkspace .settlement-unified .settlement-methods-unified {
    order: 4 !important;
  }
  body[data-tp008g-module="settlements"] #moduleWorkspace .settlement-unified .settlement-current {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }
  body[data-tp008g-module="settlements"] #moduleWorkspace .settlement-unified .settlement-current > div:nth-child(3) {
    grid-column: auto !important;
  }
}
