:root {
  --ink: #17202d;
  --muted: #667085;
  --line: #d6dde8;
  --paper: #ffffff;
  --wash: #f3f7f4;
  --brand: #176b59;
  --brand-dark: #0e3f36;
  --accent: #a15c26;
  --danger: #a33a2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #edf5f1 0, #ffffff 340px);
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 46px);
  border-bottom: 1px solid rgba(23, 107, 89, 0.18);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand strong,
.brand span {
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-logo {
  width: min(240px, 42vw);
  height: 56px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.brand-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  min-width: 0;
}

.brand span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav form {
  margin: 0;
}

.button,
.nav a,
.nav button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--paper);
  color: var(--brand-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 60px;
}

.login-panel,
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

.login-panel {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  align-items: center;
  min-height: 70vh;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(161, 92, 38, 0.12);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--brand-dark);
  line-height: 1.08;
}

h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  margin-bottom: 14px;
  font-size: 1.32rem;
}

.lede {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

section,
.card,
.form-panel {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: 0 12px 28px rgba(23, 32, 45, 0.06);
}

.login-card {
  display: grid;
  gap: 14px;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #eef8f4;
  color: var(--brand-dark);
  font-weight: 800;
}

.notice.danger {
  border-color: var(--danger);
  background: #fff1f0;
  color: var(--danger);
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  color: #263343;
  font-size: 0.88rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d2df;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(23, 107, 89, 0.18);
  border-color: var(--brand);
}

.actions,
.filters,
.section-head,
.inline-form {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.filters {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.inline-form {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.field.compact {
  width: min(190px, 100%);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
}

.metric.net {
  border-color: rgba(161, 92, 38, 0.38);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7ecf2;
  text-align: left;
  vertical-align: top;
}

th {
  color: #344054;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pill.income {
  background: #e7f6ee;
  color: #126043;
}

.pill.expense {
  background: #fff1e8;
  color: #8a4317;
}

.pill.neutral {
  min-width: 0;
  background: #edf2f7;
  color: #344054;
}

.empty {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--wash);
  font-weight: 900;
}

.chips small {
  color: var(--muted);
}

.property-list {
  display: grid;
  gap: 10px;
}

.property-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper);
}

.property-item.inactive {
  background: #f7f8fa;
  color: var(--muted);
}

.property-item strong,
.property-item span {
  display: block;
}

.property-item span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions form {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .topbar,
  .login-panel,
  .hero-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .fields,
  .metrics,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .property-item {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-content: flex-start;
  }
}
