:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #26332a;
  background: #f5f7f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(218, 231, 207, 0.6), transparent 34rem),
    #f5f7f2;
}

.invoice-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.invoice-card {
  width: min(760px, 100%);
  padding: 34px 38px;
  border: 1px solid #e6eae2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(46, 63, 41, 0.08);
}

.invoice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e9ede6;
}

.organization-name {
  margin: 0 0 7px;
  color: #66806c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-heading h1,
.notice-heading {
  margin: 0;
  color: #26382c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.invoice-number {
  margin: 8px 0 0;
  color: #758075;
  font-size: 12px;
}

.invoice-status {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #f0f3ed;
  color: #5b6d5e;
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid #e9ede6;
}

.detail-group h2,
.invoice-services h2 {
  margin: 0 0 11px;
  color: #718071;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-group p {
  margin: 4px 0;
  color: #687368;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-group .detail-primary {
  color: #2f3e32;
  font-size: 14px;
  font-weight: 700;
}

.invoice-services {
  padding: 23px 0 12px;
}

.services-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.services-table th {
  padding: 10px 8px;
  border-bottom: 1px solid #e9ede6;
  color: #849084;
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
}

.services-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f0f2ee;
  color: #465248;
  font-size: 11px;
  line-height: 1.45;
}

.services-table th:first-child,
.services-table td:first-child {
  padding-left: 0;
}

.services-table th:last-child,
.services-table td:last-child {
  padding-right: 0;
  text-align: right;
}

.services-table td:last-child {
  color: #26382c;
  font-weight: 700;
  white-space: nowrap;
}

.services-table .empty-lines {
  color: #879087;
  text-align: center;
}

.invoice-totals {
  width: min(100%, 300px);
  margin: 7px 0 0 auto;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  color: #737d73;
  font-size: 11px;
}

.total-line strong {
  color: #3c473e;
  font-weight: 650;
}

.total-line.grand-total {
  margin-top: 5px;
  padding: 12px 0 0;
  border-top: 1px solid #e5e9e2;
  color: #283a2d;
  font-size: 14px;
  font-weight: 750;
}

.total-line.grand-total strong {
  color: #245c43;
  font-size: 16px;
}

.paid-to-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 300px);
  margin: 26px 0 0 auto;
  padding: 14px 16px;
  border: 1px solid #d9e1d7;
  background: #fff;
  text-align: right;
}

.paid-to-label {
  flex: 0 0 auto;
  color: #718071;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paid-to-box strong {
  min-width: 0;
  color: #2f3e32;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.loading-message,
.invoice-notice {
  margin: 0;
  color: #657365;
  font-size: 14px;
  line-height: 1.6;
}

.notice-heading {
  margin-bottom: 12px;
}

.invoice-notice {
  color: #566357;
}

@media (max-width: 580px) {
  .invoice-card {
    padding: 25px 20px;
    border-radius: 13px;
  }

  .invoice-heading h1,
  .notice-heading {
    font-size: 25px;
  }

  .invoice-parties {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .services-table th,
  .services-table td {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 10px;
  }
}
