:root {
  color-scheme: light;
  font-family: "Aptos", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #17312a;
  background: #f3f6f4;
  --ink: #17312a;
  --muted: #50645c;
  --line: #dce6e0;
  --green: #176b50;
  --dark: #102c24;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #25866d;
  outline-offset: 3px;
}
.workspace { display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar {
  min-height: 100vh;
  background: var(--dark);
  color: #f9fffb;
  padding: 28px 19px 20px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; gap: 12px; align-items: center; font-weight: 750; line-height: 1.25; }
.monogram {
  display: grid;
  place-content: center;
  grid-auto-flow: column;
  min-width: 43px;
  height: 43px;
  border-radius: 12px;
  background: #bdf3d7;
  color: #12372b;
  font-weight: 850;
  letter-spacing: -0.07em;
}
.monogram span { color: #1d785a; }
.brand small, .sidebar-bottom small { display: block; font-size: .78rem; font-weight: 500; color: #c0d5ca; margin-top: 3px; }
.sidebar nav { display: grid; gap: 6px; margin: 44px 0 30px; }
.sidebar nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  min-height: 46px;
  border-radius: 9px;
  color: #d5e6de;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 620;
}
.sidebar nav a:hover, .sidebar nav [aria-current] { background: #254a3d; color: #fff; }
.sidebar nav [aria-current] { box-shadow: inset 3px 0 #92e3bc; }
.nav-icon { width: 19px; text-align: center; color: #a8dac0; font-size: 1.18rem; line-height: 1; }
.sidebar-bottom { margin-top: auto; display: flex; align-items: center; gap: 10px; border-top: 1px solid #315247; padding-top: 18px; font-size: .92rem; }
.avatar { border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; background: #365c4e; font-size: .76rem; }
.signout button { color: #dbebe3; background: none; border: 0; padding: 7px 0; margin-top: 10px; cursor: pointer; text-decoration: underline; font-size: .88rem; }
.workspace main { padding: 26px clamp(18px, 4vw, 59px) 48px; width: 100%; max-width: 1500px; margin-inline: auto; }
.demo { margin: 0 0 18px; font-size: .84rem; color: #53675d; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.055em; line-height: 1.05; }
h2 { font-size: 1.35rem; letter-spacing: -.028em; line-height: 1.2; }
p { color: var(--muted); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 5px 0 23px; }
.page-heading p { margin-top: 8px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid #cbdad2;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 670;
  font-size: .89rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.button:hover { border-color: #76a38e; background: #f1f8f4; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.button.primary:hover { background: #11513d; }
.button.subtle { background: transparent; border-color: transparent; }
.hero {
  background: #dcefe5;
  border: 1px solid #cee6d9;
  border-radius: 16px;
  padding: 26px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 19px;
}
.hero h2 { font-size: clamp(1.34rem, 2.7vw, 1.85rem); }
.hero p { margin-top: 6px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  padding: 17px 15px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
}
.metric:hover { border-color: #7ca78e; }
.metric-icon { width: 35px; height: 35px; display: grid; place-items: center; font-weight: 730; border-radius: 9px; margin-bottom: 12px; }
.mint { background: #e0f5e7; color: #176448; }
.violet { background: #efebfb; color: #5e468d; }
.peach { background: #fbecdf; color: #815126; }
.blue { background: #e8f1fa; color: #315b81; }
.metric-label { color: #40594e; font-size: .88rem; font-weight: 620; }
.metric strong { font-size: clamp(1.4rem, 2.7vw, 1.94rem); letter-spacing: -.06em; margin: 1px 0 3px; overflow-wrap: anywhere; }
.metric small, td small { color: var(--muted); font-size: .81rem; }
.panel { background: #fff; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.panel header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 21px; }
.panel header p { margin-top: 4px; font-size: .92rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 12px 16px; font-size: .91rem; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 21px; }
th:last-child, td:last-child { padding-right: 21px; }
th { font-size: .83rem; font-weight: 650; background: #f3f7f5; color: #40594e; white-space: nowrap; }
td { border-top: 1px solid var(--line); }
td small { display: block; margin-top: 2px; }
.record-link { text-decoration: none; font-weight: 700; }
.record-link:hover { text-decoration: underline; color: var(--green); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 7px; background: #edf2ef; color: #374e43; font-size: .81rem; font-weight: 650; white-space: nowrap; }
.badge[data-tone="Active"], .badge[data-tone="Paid"], .badge[data-tone="Live"],
.badge[data-tone="Logged"] { background: #e1f4e8; color: #15563f; }
.badge[data-tone="Follow-up"], .badge[data-tone="Approved"], .badge[data-tone="In conversation"] { background: #ede9f8; color: #574181; }
.badge[data-tone="Offer expiry"], .badge[data-tone="Pending"], .badge[data-tone="Missing"],
.badge[data-tone="Missing statement"], .badge[data-tone="Missing invoice"] { background: #fbecdc; color: #76441d; }
.badge[data-tone="Payment due"], .badge[data-tone="Scheduled"] { background: #e5effa; color: #2d567d; }
.badge[data-tone="Expired"], .badge[data-tone="Declined"], .late { color: #922c25; }
.badge[data-tone="Expired"], .badge[data-tone="Declined"] { background: #f9e9e8; }
.empty { padding: 30px 22px; border-top: 1px solid var(--line); }
.empty p { margin: 4px 0 12px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-count { color: var(--muted); font-size: .87rem; white-space: nowrap; }
input, select, textarea { border: 1px solid #bacdc2; color: var(--ink); background: #fff; border-radius: 8px; padding: 9px 11px; min-height: 42px; max-width: 100%; }
select { appearance: none; padding-right: 31px; background-image: linear-gradient(45deg, transparent 50%, #4b6458 50%), linear-gradient(135deg, #4b6458 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.filters input { width: min(230px, 100%); }
.summary-panel { margin-bottom: 20px; }
.statement-check { margin-top: 8px; }
.summary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-filters { padding: 17px 21px; }
.month-picker { border-bottom: 1px solid var(--line); }
.report-filters .filters { align-items: end; gap: 12px; }
.report-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.payout-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.payout-tabs a[aria-current="page"] { font-weight: 700; border-color: currentColor; }
.report-filters input, .report-filters select { min-width: 9rem; }
.revenue-chart { padding: 0 21px 18px; }
.revenue-legend { display: flex; gap: 14px; flex-wrap: wrap; list-style: none; margin: 0 0 10px; padding: 0; }
.revenue-legend li { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.revenue-legend span { width: 10px; height: 10px; border-radius: 2px; background: var(--series); }
.series-earned { --series: #178060; }
.series-received { --series: #3b68a2; }
.series-outstanding { --series: #ad6230; }
.revenue-plot { display: flex; overflow-x: auto; padding: 5px 0 9px; }
.revenue-month { flex: 1 0 118px; max-width: 190px; text-align: center; padding: 0 7px; }
.revenue-bars {
  display: flex; align-items: end; justify-content: center; gap: 5px;
  border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, #edf2ef 0 1px, transparent 1px 25%);
}
.revenue-bar { height: 128px; width: 16px; position: relative; }
.revenue-bar meter {
  position: absolute; bottom: 0; left: 0; width: 128px; height: 16px;
  transform-origin: left bottom; transform: translateX(16px) rotate(-90deg);
  appearance: none; -webkit-appearance: none; display: block;
}
.revenue-bar meter::-webkit-meter-bar { background: transparent; border: none; border-radius: 0; }
.revenue-bar meter::-webkit-meter-optimum-value { background: var(--series); border-radius: 0 3px 3px 0; }
.revenue-bar meter::-moz-meter-bar { background: var(--series); border-radius: 0 3px 3px 0; }
.revenue-month strong { display: block; margin: 7px 0 3px; font-size: .88rem; white-space: nowrap; }
.revenue-month small { display: grid; gap: 2px; font-size: .79rem; font-variant-numeric: tabular-nums; }
.revenue-month small span { color: var(--series); }
.back { margin: 0 0 9px; font-size: .9rem; }
.form-panel { max-width: 860px; }
.form-panel form { padding: 22px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.fields label, .login-card label { font-size: .92rem; font-weight: 640; }
.fields label > :is(input, select, textarea), .login-card input { display: block; width: 100%; margin-top: 5px; font-weight: 400; }
.fields label > small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.full-field { grid-column: 1 / -1; }
textarea { resize: vertical; }
.required { color: #17664d; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 21px; }
.allocation-fields { grid-template-columns: 1fr; }
.allocation-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.allocation-help { margin: 0 0 16px; }
.timeline-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; }
.timeline-allocations { list-style: none; padding: 0; margin: 4px 0 0; }
.timeline-notice { margin: 0 16px 12px; }
.notice, .errors { border-radius: 8px; padding: 9px 12px; max-width: 860px; margin: 0 0 14px; }
.notice { background: #e0f5e7; color: #15563f; }
.errors { background: #f9e9e8; color: #772320; }
.errors ul { margin: 4px 0 0; padding-left: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guest { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.guest main { width: min(100%, 410px); }
.login-card { padding: 28px; background: #fff; border-radius: 15px; border: 1px solid var(--line); }
.login-card .brand small { color: var(--muted); }
.login-card h1 { margin: 23px 0 15px; font-size: 2rem; }
.login-card form button { margin-top: 15px; width: 100%; }

@media (max-width: 1070px) {
  .workspace { grid-template-columns: 205px minmax(0, 1fr); }
  .workspace main { padding-inline: 24px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .workspace { display: block; }
  .sidebar { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 13px 16px 10px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 3px; margin: 0; grid-column: 1 / -1; grid-row: 2; }
  .sidebar nav a { min-height: 37px; gap: 5px; padding: 5px 8px; font-size: .88rem; }
  .sidebar nav [aria-current] { box-shadow: inset 0 -2px #92e3bc; }
  .nav-icon { display: none; }
  .sidebar-bottom { display: none; }
  .signout button { margin-top: 4px; }
  .workspace main { padding: 18px 14px 32px; }
  .hero { align-items: flex-start; flex-direction: column; padding: 16px; }
  .metric { padding: 13px; }
  .panel header { padding: 13px; }
  .list-header { align-items: flex-start !important; flex-direction: column; }
  th, td { padding: 10px; }
  th:first-child, td:first-child { padding-left: 13px; }
  th:last-child, td:last-child { padding-right: 13px; }
}
@media (max-width: 420px) {
  .fields { grid-template-columns: 1fr; }
  .metrics { gap: 8px; }
  .summary-metrics { grid-template-columns: 1fr; }
  .form-panel form { padding: 14px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { white-space: normal; text-align: center; }
}
