:root {
  color: #142033;
  font-synthesis: none;
  text-rendering: optimizelegibility;
  --navy: #12355b;
  --navy-dark: #0b2847;
  --gold: #d8a928;
  --gold-soft: #fff7db;
  --ink: #142033;
  --muted: #66758a;
  --line: #dce4ed;
  --surface: #fff;
  --danger: #b33b3b;
  --success: #1b7d5c;
  background: #f3f6fa;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    Segoe UI,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  background: #f3f6fa;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 0.35rem;
  font-size: 2.3rem;
}
h2 {
  letter-spacing: -0.03em;
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}
h3 {
  margin-bottom: 0.35rem;
}
small,
.muted {
  color: var(--muted);
}
.grow {
  flex: 1;
  min-width: 0;
}
.grow > span,
td small,
.sidebar-brand span,
.sidebar-user span {
  color: var(--muted);
  margin-top: 0.2rem;
  font-size: 0.78rem;
  display: block;
}
.eyebrow {
  color: #5275a0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
}
.brand-mark {
  background: var(--navy);
  width: 56px;
  height: 56px;
  color: var(--gold);
  border-radius: 18px;
  place-items: center;
  font-size: 1.55rem;
  font-weight: 900;
  display: grid;
  box-shadow: 0 12px 30px #12355b40;
}
.brand-mark.small {
  width: 40px;
  height: 40px;
  box-shadow: none;
  border-radius: 13px;
  font-size: 1.05rem;
}
.auth-shell {
  background: radial-gradient(
    circle at 15% 15%,
    #e7eef7 0,
    #f4f7fb 42%,
    #eef2f7 100%
  );
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  display: grid;
}
.auth-card {
  background: #fffffff5;
  border: 1px solid #fffc;
  border-radius: 28px;
  width: min(440px, 100%);
  padding: clamp(28px, 7vw, 52px);
  box-shadow: 0 30px 80px #1e344e24;
}
.auth-card .brand-mark {
  margin-bottom: 30px;
}
.stack {
  gap: 16px;
  margin-top: 30px;
  display: grid;
}
label {
  color: #47576c;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
}
input,
select {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd9e4;
  border-radius: 12px;
  outline: none;
  padding: 12px 13px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
input:focus,
select:focus {
  border-color: #5275a0;
  box-shadow: 0 0 0 4px #5275a021;
}
.primary,
.secondary {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 11px 18px;
  font-weight: 800;
}
.primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 9px 22px #12355b2e;
}
.primary:hover {
  background: var(--navy-dark);
}
.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary.compact {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 0.86rem;
}
.secondary {
  color: var(--navy);
  background: #e9eef4;
}
.link-button,
.icon-button {
  color: #47698f;
  background: 0 0;
  border: 0;
  padding: 5px;
}
.link-button {
  font-weight: 700;
}
.form-message {
  color: var(--danger);
  margin: 0;
  font-size: 0.86rem;
}
.success-message {
  color: var(--success);
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  z-index: 20;
  background: #fff;
  flex-direction: column;
  gap: 28px;
  width: 248px;
  padding: 24px 18px;
  display: flex;
  position: fixed;
  inset: 0 auto 0 0;
}
.sidebar-brand {
  align-items: center;
  gap: 12px;
  padding: 0 5px;
  display: flex;
}
.sidebar-brand strong {
  font-size: 0.98rem;
  display: block;
}
.sidebar nav {
  gap: 6px;
  display: grid;
}
.sidebar nav button {
  color: #5c6c80;
  text-align: left;
  background: 0 0;
  border: 0;
  border-radius: 11px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  font-weight: 700;
  display: flex;
}
.sidebar nav button > span,
.bottom-nav button > span {
  color: #5a7695;
  background: #eef3f8;
  border-radius: 9px;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
  font-weight: 900;
  display: grid;
}
.sidebar nav button.active {
  color: var(--navy);
  background: #edf3f9;
}
.sidebar nav button.active > span,
.bottom-nav button.active > span {
  background: var(--navy);
  color: var(--gold);
}
.sidebar-user {
  border-top: 1px solid var(--line);
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 18px;
  display: flex;
}
.avatar {
  width: 38px;
  height: 38px;
  color: var(--navy);
  background: #e7eef7;
  border-radius: 12px;
  flex: none;
  place-items: center;
  font-weight: 900;
  display: grid;
}
.content {
  margin-left: 248px;
  padding: 38px clamp(24px, 4vw, 62px) 80px;
}
.content > section {
  max-width: 1180px;
  margin: 0 auto;
}
.mobile-header,
.bottom-nav {
  display: none;
}
.page-heading {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  margin-bottom: 24px;
  display: flex;
}
.status-chip,
.pill,
.status {
  white-space: nowrap;
  border-radius: 999px;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
}
.status-chip {
  background: var(--gold-soft);
  color: #725500;
}
.pill {
  color: #365a82;
  background: #edf3f9;
}
.metric-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
  display: grid;
}
.metric-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  flex-direction: column;
  justify-content: center;
  min-height: 145px;
  padding: 22px;
  display: flex;
  box-shadow: 0 8px 25px #1e344e0d;
}
.metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.metric-card strong {
  letter-spacing: -0.035em;
  margin: 8px 0 6px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  display: block;
}
.metric-card.accent {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.metric-card.accent span,
.metric-card.accent small {
  color: #b8c6d6;
}
.compact-metrics .metric-card {
  min-height: 112px;
  padding: 18px;
}
.compact-metrics .metric-card strong {
  font-size: 1.45rem;
}
.panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  margin-bottom: 18px;
  padding: 22px;
  box-shadow: 0 8px 25px #1e344e0b;
}
.panel-heading {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  display: flex;
}
.next-card {
  background: linear-gradient(110deg, #fff, #f7f9fc);
  justify-content: space-between;
  align-items: center;
  display: flex;
}
.week-orb {
  background: var(--gold-soft);
  color: #7a5c00;
  border: 7px solid #fff;
  border-radius: 50%;
  place-items: center;
  width: 66px;
  height: 66px;
  font-size: 1.4rem;
  font-weight: 900;
  display: grid;
  box-shadow: 0 8px 25px #b18b122e;
}
.member-progress-list {
  gap: 4px;
  display: grid;
}
.progress-row {
  border-bottom: 1px solid #edf1f5;
  align-items: center;
  gap: 12px;
  padding: 12px 3px;
  display: flex;
}
.progress-row:last-child {
  border-bottom: 0;
}
.danger-text {
  color: var(--danger) !important;
}
.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-panel .panel-heading {
  padding: 20px 22px 0;
}
.responsive-table {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  color: #647286;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f6f8fb;
  padding: 13px 16px;
  font-size: 0.72rem;
}
td {
  vertical-align: middle;
  border-top: 1px solid #e8edf3;
  padding: 15px 16px;
  font-size: 0.86rem;
}
td.actions {
  text-align: right;
  white-space: nowrap;
}
.status-paid {
  color: #187052;
  background: #e4f5ed;
}
.status-partial {
  color: #8b6200;
  background: #fff3d5;
}
.status-outstanding {
  color: #9d3434;
  background: #fde9e9;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  display: grid;
}
.wide-field {
  grid-column: 1/-1;
}
.payment-form {
  border-left: 4px solid var(--gold);
}
.payment-grid {
  grid-template-columns: 2fr 0.7fr 1fr 1fr;
}
.payment-grid .wide {
  grid-column: span 4;
}
.payment-balance-panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 16px;
  padding: 16px;
}
.payment-balance-head {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  display: flex;
}
.payment-balance-head > div {
  gap: 3px;
  display: grid;
}
.payment-balance-head span:first-child {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.payment-balance-head strong {
  font-size: 1.25rem;
}
.owing-help {
  color: var(--muted);
  margin: 14px 0 9px;
  font-size: 0.78rem;
  line-height: 1.45;
}
.owing-week-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  display: grid;
}
.owing-week-button {
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid #d6e0ea;
  border-radius: 11px;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
  display: flex;
}
.owing-week-button:hover,
.owing-week-button:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #d8a9281f;
}
.owing-week-button span {
  gap: 2px;
  display: grid;
}
.owing-week-button small {
  color: #8b6200;
  font-size: 0.67rem;
  font-weight: 800;
}
.owing-week-money {
  text-align: right;
}
.owing-week-money strong {
  color: var(--danger);
  white-space: nowrap;
  font-size: 0.82rem;
}
.owing-week-money small {
  color: var(--muted);
  white-space: nowrap;
}
.up-to-date-message {
  color: var(--success);
  background: #e9f7f1;
  border-radius: 10px;
  margin: 13px 0 0;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}
.button-row {
  gap: 10px;
  margin-top: 18px;
  display: flex;
}
.inline-field {
  align-items: center;
  gap: 7px;
  display: flex;
}
.inline-field input {
  width: 78px;
  padding: 8px;
}
.modal-backdrop {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 100;
  background: #07182a8c;
  place-items: center;
  padding: 20px;
  display: grid;
  position: fixed;
  inset: 0;
}
.modal {
  background: #fff;
  border-radius: 20px;
  width: min(620px, 100%);
  max-height: 90vh;
  padding: 24px;
  overflow: auto;
  box-shadow: 0 30px 80px #00000040;
}
.modal > .primary {
  width: 100%;
  margin-top: 18px;
}
.report-controls {
  grid-template-columns: 0.7fr 1.5fr auto;
  align-items: end;
  gap: 14px;
  display: grid;
}
.statement-summary {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  display: flex;
}
.statement-numbers {
  gap: 26px;
  display: flex;
}
.statement-numbers span {
  color: var(--muted);
  font-size: 0.76rem;
  display: grid;
}
.statement-numbers strong {
  color: var(--ink);
  margin-top: 5px;
  font-size: 1rem;
}
.poster-layout {
  grid-template-columns: 320px minmax(0, 550px);
  align-items: start;
  gap: 20px;
  display: grid;
}
.poster-controls {
  gap: 14px;
  display: grid;
}
.poster-frame {
  background: #dfe5ec;
  border-radius: 20px;
  padding: 14px;
}
.poster-frame canvas {
  background: var(--navy);
  border-radius: 12px;
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 14px 35px #09213a38;
}
.allocation-grid,
.audit-list {
  gap: 4px;
  display: grid;
}
.allocation-row,
.audit-row {
  border-bottom: 1px solid #e9eef3;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  display: flex;
}
.allocation-row:last-child,
.audit-row:last-child {
  border-bottom: 0;
}
.check-field {
  grid-template-columns: auto auto;
  align-items: center;
  display: flex;
}
.check-field input {
  width: 18px;
  height: 18px;
}
.file-drop {
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #9db0c4;
  border-radius: 14px;
  margin-top: 16px;
  padding: 22px;
}
.migration-review {
  margin-top: 18px;
}
.warning-box {
  color: #715500;
  background: #fff6de;
  border-radius: 12px;
  margin: 14px 0;
  padding: 16px;
  font-size: 0.84rem;
}
.info-box {
  border-left: 4px solid var(--gold);
  background: #fffcf1;
}
.info-box p {
  color: var(--muted);
  margin: 7px 0 0;
  line-height: 1.55;
}
.standalone-message {
  background: #e9f7f1;
  border-radius: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
}
.warning-box p {
  margin: 8px 0 0;
}
.audit-dot {
  background: var(--gold);
  border-radius: 50%;
  width: 9px;
  height: 9px;
}
.audit-row small {
  text-align: right;
}
.loader {
  border: 4px solid #d9e2ec;
  border-top-color: var(--navy);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  animation: 0.8s linear infinite spin;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.bank-upload,
.statement-banner {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  display: flex;
}
.statement-banner {
  flex-wrap: wrap;
}
.statement-banner div {
  gap: 4px;
  display: grid;
}
.statement-banner span {
  color: var(--muted);
  font-size: 0.82rem;
}
.file-button {
  background: var(--gold);
  color: #10233b;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
}
.file-button input {
  display: none;
}
.match-control {
  gap: 8px;
  min-width: 310px;
  display: flex;
}
.match-control select {
  min-width: 220px;
}
@media (width<=980px) {
  .metric-grid,
  .payment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .payment-grid .wide {
    grid-column: span 2;
  }
}
@media (width<=760px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .sidebar {
    display: none;
  }
  .mobile-header {
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 30;
    background: #fffffff0;
    justify-content: space-between;
    align-items: center;
    height: 68px;
    padding: 10px 16px;
    display: flex;
    position: sticky;
    top: 0;
  }
  .content {
    margin-left: 0;
    padding: 22px 15px 28px;
  }
  .bottom-nav {
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 40;
    scrollbar-width: none;
    background: #fffffff7;
    display: flex;
    position: fixed;
    inset: auto 0 0;
    overflow-x: auto;
  }
  .bottom-nav button {
    color: #738196;
    background: 0 0;
    border: 0;
    flex: 1 0 72px;
    place-items: center;
    gap: 3px;
    min-width: 72px;
    padding: 3px 0;
    font-size: 0.58rem;
    font-weight: 800;
    display: grid;
  }
  .bottom-nav button > span {
    border-radius: 9px;
    width: 27px;
    height: 27px;
  }
  .page-heading {
    align-items: flex-end;
    margin-bottom: 18px;
  }
  .metric-grid {
    gap: 10px;
  }
  .metric-card {
    border-radius: 16px;
    min-height: 122px;
    padding: 16px;
  }
  .panel {
    border-radius: 16px;
    padding: 17px;
  }
  .form-grid,
  .payment-grid,
  .report-controls,
  .poster-layout {
    grid-template-columns: 1fr;
  }
  .payment-grid .wide {
    grid-column: auto;
  }
  .payment-balance-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .owing-week-list {
    grid-template-columns: 1fr 1fr;
  }
  .report-controls .secondary {
    width: 100%;
  }
  .statement-summary,
  .statement-numbers {
    align-items: flex-start;
  }
  .statement-summary {
    flex-direction: column;
  }
  .statement-numbers {
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .poster-layout {
    max-width: 560px;
    margin: 0 auto;
  }
  .allocation-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .audit-row {
    align-items: flex-start;
  }
  .audit-row small {
    width: 90px;
  }
  .bank-upload {
    flex-direction: column;
    align-items: stretch;
  }
  .file-button {
    text-align: center;
  }
  .match-control {
    flex-direction: column;
    min-width: 0;
  }
  .responsive-table {
    overflow: visible;
  }
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }
  thead {
    display: none;
  }
  tbody {
    gap: 10px;
    padding: 10px;
    display: grid;
  }
  tr {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 13px;
  }
  td {
    text-align: right;
    border: 0;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    display: flex;
  }
  td:before {
    content: attr(data-label);
    color: var(--muted);
    text-transform: uppercase;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
  }
  td.actions {
    border-top: 1px solid #edf1f5;
    justify-content: flex-end;
    padding-top: 11px;
  }
  td.actions:before {
    content: "";
  }
  td.empty {
    text-align: center;
    display: block;
  }
  td.empty:before {
    content: "";
  }
}
@media (width<=430px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-card strong {
    font-size: 1.25rem;
  }
  .metric-card small {
    font-size: 0.7rem;
  }
  .bottom-nav button {
    font-size: 0.53rem;
  }
}

.week-close-panel{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:1rem 0;padding:1rem;border:1px solid rgba(216,169,40,.35);border-radius:14px;background:rgba(216,169,40,.08)}.week-close-panel p{margin:.25rem 0 0}.week-close-panel button{flex:0 0 auto}@media(max-width:640px){.week-close-panel{align-items:stretch;flex-direction:column}.week-close-panel button{width:100%}}

.arrears-editor{margin-top:1rem}.balance-input{min-width:150px}.danger-button{background:#fff1f1;border:1px solid #d65b5b;color:#a42828;border-radius:12px;font-weight:700;padding:.75rem 1rem}.poster-open-link{display:block;text-align:center;text-decoration:none}.poster-controls .success-message,.poster-controls .form-message{margin:.25rem 0}@media(max-width:640px){.arrears-editor .balance-input{width:100%;min-width:0}.week-close-panel{gap:.75rem}}

.pdf-controls{display:grid;grid-template-columns:minmax(150px,220px) repeat(3,minmax(150px,1fr));gap:.8rem;align-items:end;margin-bottom:1rem}.pdf-controls>a{display:flex;align-items:center;justify-content:center;text-decoration:none}.pdf-member-list{display:grid;gap:.8rem}.pdf-member-card{padding:1rem}.pdf-member-card p{margin:.35rem 0}.other-balance-lines{display:grid;gap:.25rem;margin-top:.65rem;padding:.7rem;border-radius:12px;background:rgba(216,169,40,.08)}.other-balance-lines span{font-size:.88rem}.merger-panel{margin-top:1rem;border-color:rgba(216,169,40,.42)}.fixed-payment-form{border-color:rgba(82,170,126,.4)}@media(max-width:760px){.pdf-controls{grid-template-columns:1fr}.pdf-controls>*{width:100%}.pdf-member-card .panel-heading{align-items:flex-start;gap:.5rem}.other-balance-lines{padding:.6rem}}

.reconciliation-filter{font:inherit;text-align:left;cursor:pointer;width:100%;appearance:none}.reconciliation-filter.active{border-color:var(--gold);box-shadow:0 0 0 2px rgba(216,169,40,.2)}.bank-status-awaiting-statement{background:#edf2f7;color:#53677d}.bank-status-verified{background:#e1f4e9;color:#176a48}.bank-status-possible-match{background:#fff3cd;color:#795a00}.bank-status-not-found{background:#fde8e8;color:#a42828}.bank-status-needs-review{background:#f6e9ff;color:#683b91}.bank-status{white-space:nowrap}
