:root {
  --ink: #18201b;
  --muted: #647067;
  --line: #d9ded8;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --accent: #1c6b57;
  --accent-strong: #0f4e3e;
  --warn: #9a5b10;
  --bad: #9d2d24;
  --shadow: 0 18px 50px rgba(24, 32, 27, 0.11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(28, 107, 87, 0.13), transparent 34%),
    repeating-linear-gradient(90deg, rgba(24, 32, 27, 0.025) 0 1px, transparent 1px 82px),
    var(--paper);
}
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 64px; }
.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-size: 1.35rem; font-weight: 700; }
nav { display: flex; gap: 18px; align-items: center; color: var(--muted); }
.language-form label { display: flex; align-items: center; gap: 8px; }
.language-form select { width: auto; padding: 7px 28px 7px 9px; }
.hero {
  min-height: calc(100vh - 180px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 36px;
  align-items: center;
}
.hero h1, .page-head h1, .panel h1 { font-size: clamp(2.3rem, 7vw, 5.7rem); line-height: 0.95; margin: 0 0 20px; max-width: 860px; }
.lead { font-size: 1.2rem; line-height: 1.65; color: var(--muted); max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--accent-strong); font-weight: 700; }
.hero-panel, .panel, .loan-card, .summary-strip {
  background: rgba(255, 255, 255, 0.87);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-panel { padding: 34px; display: grid; gap: 12px; }
.hero-panel strong { font-size: clamp(2rem, 6vw, 4rem); }
.hero-panel span, .hero-panel small, dt, .summary-strip span { color: var(--muted); }
.button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  cursor: pointer;
}
.primary { background: var(--accent); color: white; }
.secondary { background: transparent; color: var(--accent-strong); }
.hint, .empty { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 4rem); }
.loan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.loan-card { padding: 22px; display: grid; gap: 16px; }
.loan-card h2, .panel h2 { margin: 0; }
.loan-card dl { display: grid; gap: 12px; margin: 0; }
.loan-card div, .summary-strip div { display: grid; gap: 4px; }
dd { margin: 0; font-weight: 700; }
.status { justify-self: start; border-radius: 999px; padding: 5px 10px; font-size: 0.8rem; text-transform: uppercase; background: #e9ece5; color: var(--muted); }
.status.accepted { background: #d9eee4; color: var(--accent-strong); }
.status.pending { background: #f5e7c8; color: var(--warn); }
.status.rejected { background: #f2d3cf; color: var(--bad); }
.panel { padding: 28px; margin-bottom: 20px; }
.panel.narrow { max-width: 520px; margin-inline: auto; }
.panel.compact { padding: 20px; }
.form-grid { display: grid; gap: 16px; margin-top: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: var(--muted); }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px; margin-bottom: 20px; }
.summary-strip.report-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-strip strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.actions { display: flex; gap: 12px; align-items: center; }
.inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px; align-items: end; margin-top: 14px; }
.inline-form.payment-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.inline-form.report-form { grid-template-columns: 1fr 0.8fr auto; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.quick-links a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--accent-strong); background: white; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; }
.rate-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.rate-list li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { border-radius: 6px; padding: 12px 14px; background: #e9ece5; }
.flash.error { background: #f2d3cf; color: var(--bad); }
.flash.success { background: #d9eee4; color: var(--accent-strong); }

@media (max-width: 760px) {
  main, .topbar { width: min(100% - 20px, 1180px); }
  .topbar, .page-head { align-items: start; flex-direction: column; }
  nav { flex-wrap: wrap; gap: 10px; }
  .hero, .form-grid.two, .summary-strip, .summary-strip.report-summary, .inline-form, .inline-form.payment-form, .inline-form.report-form { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-bottom: 32px; }
  .hero h1, .page-head h1, .panel h1 { font-size: 2.45rem; }
}
