body:has(#charter-invoice.active) #addEquipment {
  display: none;
}

.charter-invoice-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid #183f53;
  border-radius: 9px;
  background: radial-gradient(circle at 77% 20%, #ad884428, transparent 28%), linear-gradient(112deg, #092a39, #123e4a 68%, #163744);
  color: #fff;
}

.charter-invoice-hero:after {
  content: "¤";
  position: absolute;
  right: 27%;
  top: -48px;
  color: #ffffff09;
  font: 400 185px Georgia, serif;
}

.charter-invoice-hero > div {
  position: relative;
  z-index: 1;
}

.charter-invoice-hero small {
  color: #d0bb88;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: 1.6px;
}

.charter-invoice-hero h2 {
  margin: 7px 0 4px;
  color: #fff;
  font-size: 21px;
}

.charter-invoice-hero p {
  color: #afc4c7;
  font-size: 10px;
}

.charter-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.charter-state {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #d4bd824d;
  border-radius: 3px;
  color: #ddc68d;
  background: #2c372f6b;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: 1px;
}

.charter-state.final {
  border-color: #73c6af57;
  color: #9ce1ce;
  background: #0c4a414a;
}

.charter-finalise,
.charter-print,
.charter-next {
  border: 1px solid #d8c38f5e;
  border-radius: 3px;
  background: #e3ce98;
  color: #3d3824;
}

.charter-print {
  border-color: #b9e5d766;
  background: #d2eee6;
  color: #0c5653;
}

.charter-next {
  border-color: #ffffff2d;
  background: #ffffff10;
  color: #e3eceb;
}

.charter-invoice-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 15px;
}

.charter-invoice-stats article {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.charter-invoice-stats span {
  color: #788b90;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: .6px;
}

.charter-invoice-stats strong {
  display: block;
  margin: 7px 0 2px;
  font: 500 21px "DM Mono", monospace;
}

.charter-invoice-stats p {
  font-size: 8px;
}

.charter-invoice-stats .charter-total-stat {
  border-color: #c7dcd7;
  background: #ecf6f3;
}

.charter-total-stat strong {
  color: #0d756e;
}

.charter-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 15px;
  align-items: start;
  margin-bottom: 15px;
}

.charter-main-column {
  display: grid;
  gap: 15px;
  min-width: 0;
}

.charter-details {
  overflow: hidden;
}

.charter-details .panel-heading > span {
  color: #4a8780;
  font: 500 7px "DM Mono", monospace;
  letter-spacing: .7px;
}

.charter-detail-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.charter-detail-sections fieldset {
  min-width: 0;
  margin: 0;
  padding: 17px 19px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.charter-detail-sections fieldset:nth-child(2n) {
  border-right: 0;
}

.charter-detail-sections fieldset.charter-terms {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

.charter-detail-sections legend {
  padding: 0;
  color: #5b8581;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: 1px;
}

.charter-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.charter-detail-sections label,
.charter-entry-form label {
  display: block;
  margin-top: 11px;
  color: #506a72;
  font-size: 8px;
  font-weight: 700;
}

.charter-detail-sections input,
.charter-detail-sections select,
.charter-detail-sections textarea,
.charter-entry-form input,
.charter-entry-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 9px;
  border: 1px solid #d7e0df;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: #294751;
  font: 9px Manrope, sans-serif;
}

.charter-detail-sections input:focus,
.charter-detail-sections select:focus,
.charter-detail-sections textarea:focus,
.charter-entry-form input:focus,
.charter-entry-form select:focus {
  border-color: #6db5ac;
  box-shadow: 0 0 0 3px #4ca89c12;
}

.charter-detail-sections input:disabled,
.charter-detail-sections select:disabled,
.charter-detail-sections textarea:disabled {
  color: #536a70;
  background: #f1f4f3;
}

.charter-date-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.charter-log {
  overflow: hidden;
}

.charter-log th,
.charter-log td {
  padding: 10px 12px;
}

.charter-entry-product strong {
  display: block;
  font-size: 9px;
}

.charter-entry-product span {
  display: block;
  margin-top: 2px;
  color: #7b8e93;
  font: 8px "DM Mono", monospace;
}

.charter-category {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 8px;
  background: #e4f0f4;
  color: #4b7283;
  font: 500 7px "DM Mono", monospace;
}

.charter-category.lube-oil {
  background: #f2ecdf;
  color: #8a6d39;
}

.charter-row-actions {
  display: flex;
  gap: 4px;
}

.charter-row-actions button {
  padding: 4px 6px;
  border: 1px solid #d8e2e0;
  border-radius: 4px;
  background: #fff;
  color: #347d77;
  font-size: 8px;
  cursor: pointer;
}

.charter-row-actions button.remove {
  color: #a65b4f;
}

.charter-summary {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.charter-summary-head {
  padding: 19px 18px 16px;
  border-bottom: 1px solid #1d4b56;
  background: linear-gradient(135deg, #0b303d, #124a50);
  color: #fff;
}

.charter-summary-head small {
  color: #88c9bd;
  font: 500 7px "DM Mono", monospace;
  letter-spacing: 1px;
}

.charter-summary-head h2 {
  margin: 8px 0 3px;
  color: #fff;
  font: 500 16px "DM Mono", monospace;
}

.charter-summary-head p {
  color: #9bb5b7;
  font-size: 8px;
}

.charter-summary-lines {
  padding: 10px 17px;
}

.charter-summary-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0ef;
}

.charter-summary-lines span {
  color: #6d8186;
  font-size: 9px;
}

.charter-summary-lines strong {
  font: 500 9px "DM Mono", monospace;
}

.charter-summary-lines .total {
  margin-top: 2px;
  border-bottom: 0;
}

.charter-summary-lines .total span,
.charter-summary-lines .total strong {
  color: #08736e;
  font-weight: 700;
}

.charter-review-note {
  display: flex;
  gap: 8px;
  margin: 0 13px 12px;
  padding: 10px;
  border: 1px solid #ead9b7;
  border-radius: 5px;
  background: #fff8eb;
}

.charter-review-note span {
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  background: #c99743;
  color: #fff;
  font-size: 8px;
}

.charter-review-note p {
  margin: 0;
  color: #866c40;
  font-size: 8px;
  line-height: 1.5;
}

.charter-summary > .button {
  width: calc(100% - 26px);
  margin: 0 13px 14px;
}

.charter-invoice-document {
  position: relative;
  margin-bottom: 15px;
  padding: 33px 38px 25px;
  overflow: hidden;
  color: #18333e;
}

.invoice-watermark {
  position: absolute;
  right: 33px;
  top: 90px;
  color: #103f4c08;
  font: 800 85px Manrope, sans-serif;
  letter-spacing: -5px;
  transform: rotate(-10deg);
  pointer-events: none;
}

.charter-invoice-document > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #153d49;
}

.invoice-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.invoice-brand > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #2f776f;
  color: #1d716b;
  font: 500 14px "DM Mono", monospace;
}

.invoice-brand strong,
.invoice-brand small {
  display: block;
}

.invoice-brand strong {
  font-size: 13px;
  letter-spacing: 3px;
}

.invoice-brand small {
  margin-top: 2px;
  color: #73868a;
  font: 500 6px "DM Mono", monospace;
  letter-spacing: 1px;
}

.invoice-title {
  text-align: right;
}

.invoice-title > small {
  color: #5b8580;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: 1px;
}

.invoice-title h2 {
  margin: 5px 0 3px;
  font: 500 19px "DM Mono", monospace;
}

.invoice-title p {
  font-size: 8px;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 22px;
}

.invoice-parties small,
.invoice-vessel-strip span,
.invoice-terms-copy > span {
  display: block;
  margin-bottom: 6px;
  color: #758b8f;
  font: 500 7px "DM Mono", monospace;
  letter-spacing: .8px;
}

.invoice-parties strong {
  display: block;
  font-size: 11px;
}

.invoice-parties p {
  white-space: pre-line;
  font-size: 8px;
  line-height: 1.5;
}

.invoice-parties span {
  display: block;
  margin-top: 4px;
  color: #647b80;
  font: 8px "DM Mono", monospace;
}

.invoice-vessel-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
  gap: 10px;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: #eef5f3;
}

.invoice-vessel-strip strong {
  display: block;
  font-size: 9px;
}

.invoice-lines table,
.invoice-daily-schedule table {
  width: 100%;
}

.invoice-lines th,
.invoice-daily-schedule th {
  padding: 8px 9px;
  background: #153d49;
  color: #d8e8e5;
  border: 0;
  font-size: 7px;
}

.invoice-lines td,
.invoice-daily-schedule td {
  padding: 9px;
  font-size: 8px;
}

.invoice-lines td:nth-last-child(-n+2),
.invoice-lines th:nth-last-child(-n+2),
.invoice-daily-schedule td:nth-last-child(-n+2),
.invoice-daily-schedule th:nth-last-child(-n+2) {
  text-align: right;
}

.invoice-totals {
  display: grid;
  grid-template-columns: 1fr 255px;
  gap: 40px;
  align-items: start;
  margin-top: 20px;
}

.invoice-terms-copy strong {
  display: block;
  font-size: 9px;
}

.invoice-terms-copy p {
  max-width: 420px;
  margin-top: 6px;
  font-size: 8px;
}

.invoice-totals dl {
  margin: 0;
}

.invoice-totals dl > div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #e4e9e8;
}

.invoice-totals dt,
.invoice-totals dd {
  margin: 0;
  font-size: 9px;
}

.invoice-totals dd {
  font-family: "DM Mono", monospace;
}

.invoice-totals .grand {
  margin-top: 3px;
  padding: 10px;
  border: 0;
  background: #153d49;
  color: #fff;
}

.invoice-daily-schedule {
  margin-top: 27px;
}

.invoice-daily-schedule h3 {
  margin-bottom: 8px;
  color: #507075;
  font: 500 8px "DM Mono", monospace;
  letter-spacing: 1px;
}

.charter-invoice-document > footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #dfe6e4;
  color: #7a8b8e;
  font: 500 7px "DM Mono", monospace;
}

.charter-history {
  margin-bottom: 5px;
}

.charter-history th,
.charter-history td {
  padding: 10px 15px;
}

.charter-history-open {
  margin-top: 6px;
  padding: 4px 6px;
  border: 1px solid #d5e2df;
  border-radius: 4px;
  background: #fff;
  color: #187b74;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.charter-entry-form {
  padding: 2px 27px 22px;
}

.charter-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.charter-entry-calculation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 5px;
  background: #e9f4f1;
}

.charter-entry-calculation span {
  color: #5a807d;
  font: 500 8px "DM Mono", monospace;
}

.charter-entry-calculation strong {
  color: #126f69;
  font: 500 16px "DM Mono", monospace;
}

.charter-finalise-dialog {
  width: min(560px, calc(100vw - 30px));
}

.charter-finalise-body {
  display: flex;
  gap: 14px;
  margin: 0 27px 23px;
  padding: 16px;
  border: 1px solid #ead4ac;
  border-radius: 6px;
  background: #fff8eb;
}

.charter-finalise-body > span {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  height: 25px;
  border-radius: 50%;
  background: #c99238;
  color: #fff;
}

.charter-finalise-body strong {
  font: 500 12px "DM Mono", monospace;
}

.charter-finalise-body p {
  margin-top: 5px;
  color: #7f6841;
  font-size: 9px;
}

.charter-finalise-body dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 13px 0 0;
}

.charter-finalise-body dl div {
  padding: 8px;
  background: #fffdfa;
}

.charter-finalise-body dt {
  color: #9b8157;
  font: 500 7px "DM Mono", monospace;
}

.charter-finalise-body dd {
  margin: 4px 0 0;
  font: 500 10px "DM Mono", monospace;
}

@media (max-width: 1100px) {
  .charter-workspace {
    grid-template-columns: 1fr;
  }

  .charter-summary {
    position: static;
  }
}

@media (max-width: 780px) {
  .charter-invoice-hero,
  .charter-hero-actions {
    display: block;
  }

  .charter-hero-actions > * {
    margin: 10px 6px 0 0;
  }

  .charter-invoice-stats,
  .charter-detail-sections,
  .charter-form-grid,
  .charter-entry-grid,
  .invoice-parties,
  .invoice-totals {
    grid-template-columns: 1fr;
  }

  .charter-detail-sections fieldset,
  .charter-detail-sections fieldset:nth-child(2n) {
    border-right: 0;
  }

  .charter-invoice-document {
    padding: 24px 20px;
  }

  .invoice-vessel-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .charter-invoice-stats {
    grid-template-columns: 1fr 1fr;
  }

  .charter-date-pair,
  .invoice-vessel-strip {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.print-charter-invoice {
    background: #fff !important;
  }

  body.print-charter-invoice * {
    visibility: hidden !important;
  }

  body.print-charter-invoice #charterInvoiceDocument,
  body.print-charter-invoice #charterInvoiceDocument * {
    visibility: visible !important;
  }

  body.print-charter-invoice #charterInvoiceDocument {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 18mm 16mm;
    border: 0;
    box-shadow: none;
  }

  body.print-charter-invoice .invoice-watermark {
    display: none;
  }

  body.print-charter-invoice .invoice-lines th,
  body.print-charter-invoice .invoice-daily-schedule th,
  body.print-charter-invoice .invoice-totals .grand {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
