:root {
  --navy: #0b1f3a;
  --navy-deep: #071527;
  --charcoal: #252a32;
  --green: #18724a;
  --green-dark: #105c3a;
  --red: #b42318;
  --red-soft: #fbe9e7;
  --rose-gold: #d89b8c;
  --rose-gold-dark: #9f5f68;
  --rose-gold-soft: #f8e7e1;
  --rose-gold-pale: #fff7f4;
  --ink: #20242b;
  --muted: #667085;
  --line: #ddd7d6;
  --panel: #f7f4f3;
  --white: #ffffff;
  --focus: #b86f77;
  --shadow: 0 14px 30px rgba(11, 31, 58, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fff9f6 0, #f8f9fb 260px);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 64%, #142d53);
  color: var(--white);
  border-bottom: 5px solid var(--rose-gold);
}

.page-shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.header-content {
  padding: 26px 0 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(216, 155, 140, 0.42);
  border-radius: 8px;
}

.brand-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.firm-name {
  margin: 0 0 6px;
  color: var(--rose-gold);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  color: var(--charcoal);
  font-size: 1.35rem;
  line-height: 1.25;
}

h3 {
  margin-bottom: 0;
  color: var(--charcoal);
  font-size: 1.05rem;
}

form {
  padding: 28px 0 48px;
}

.section-panel {
  margin-bottom: 20px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid rgba(216, 155, 140, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.report-details-panel {
  background: var(--white);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading.with-total {
  align-items: center;
}

.section-kicker {
  margin-bottom: 4px;
  color: var(--rose-gold-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-grid.one-column {
  max-width: 340px;
  grid-template-columns: 1fr;
}

.field {
  min-width: 0;
}

.field.full-width {
  grid-column: 1 / -1;
}

label,
.checkbox-label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-weight: 700;
}

.required-mark {
  color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #cfd6e1;
  border-radius: 6px;
}

textarea {
  min-height: 170px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(216, 155, 140, 0.28);
  outline-offset: 2px;
  border-color: var(--focus);
}

.input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

.entry-list {
  display: grid;
  gap: 16px;
}

.entry-card {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--rose-gold);
  border-radius: 8px;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding-top: 26px;
}

.checkbox-field input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.checkbox-field label {
  margin: 0;
}

.payment-total {
  min-width: 230px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid rgba(216, 155, 140, 0.6);
  border-radius: 8px;
  text-align: right;
}

.payment-total span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.payment-total strong {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 1.45rem;
}

.section-actions {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.secondary-button {
  color: var(--navy);
  background: var(--white);
  border-color: rgba(159, 95, 104, 0.44);
}

.secondary-button:hover {
  background: var(--rose-gold-pale);
}

.submit-button {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.submit-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.remove-button {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.remove-button:hover {
  background: #941b13;
  border-color: #941b13;
}

.danger-outline-button {
  color: var(--red);
  background: var(--white);
  border-color: #d92d20;
}

.danger-outline-button:hover {
  background: var(--red-soft);
}

.empty-state {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed rgba(159, 95, 104, 0.46);
  border-radius: 8px;
}

.empty-state.is-hidden {
  display: none;
}

.status-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.status-message:empty {
  display: none;
}

.status-message.success {
  color: #075e3c;
  background: #e8f5ee;
  border: 1px solid #9bd4b8;
}

.status-message.error {
  color: #8f1d14;
  background: var(--red-soft);
  border: 1px solid #f0aaa3;
}

.report-preview {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-item {
  padding: 12px;
  background: var(--rose-gold-pale);
  border: 1px solid var(--rose-gold-soft);
  border-radius: 6px;
}

.preview-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.preview-value {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-weight: 700;
}

.preview-section h3 {
  margin-bottom: 8px;
}

.preview-list {
  margin: 0;
  padding-left: 22px;
}

.preview-list li + li {
  margin-top: 8px;
}

.preview-muted {
  margin: 0;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 1080px);
  }

  .header-content {
    padding: 26px 0 24px;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 14px;
  }

  .logo-frame {
    width: 88px;
    height: 88px;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
  }

  form {
    padding-top: 18px;
  }

  .section-panel {
    padding: 18px;
  }

  .section-heading,
  .section-heading.with-total,
  .entry-header {
    display: grid;
    gap: 12px;
  }

  .field-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .payment-total {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .checkbox-field {
    padding-top: 0;
  }

  .form-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .site-header {
    color: var(--ink);
    background: var(--white);
    border-bottom-color: var(--line);
  }

  .section-panel {
    break-inside: avoid;
    box-shadow: none;
  }

  .form-actions,
  .section-actions,
  .remove-button,
  .status-message {
    display: none !important;
  }
}
