:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211a;
  background: #f3f8f3;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 88% 0, #d7f2df 0, transparent 31%), #f3f8f3; }
button, input, select { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 80px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.brand-logo { display: block; width: 116px; height: auto; object-fit: contain; }
.eyebrow, .section-label { margin: 0 0 5px; color: #138013; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; }
h2 { margin-bottom: 7px; font-size: clamp(25px, 4vw, 34px); }
h3 { margin: 0; font-size: 21px; }
.muted { color: #667369; }
.compact-copy { margin-bottom: 0; font-size: 13px; }
.card { border: 1px solid #d8e5da; border-radius: 21px; background: rgba(255,255,255,.96); box-shadow: 0 18px 45px rgba(29,68,36,.07); }
.auth-card { max-width: 520px; margin: 55px auto 0; padding: clamp(22px, 5vw, 34px); }
form { display: grid; gap: 10px; margin-top: 25px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 760; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd8cd; border-radius: 11px; background: #fff; color: #17211a; outline: none; }
input:focus, select:focus { border-color: #138013; box-shadow: 0 0 0 3px rgba(19,128,19,.12); }
.button { min-height: 44px; border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 800; cursor: pointer; }
.button:disabled { opacity: .48; cursor: wait; }
.primary { min-height: 48px; margin-top: 11px; background: #138013; color: #fff; }
.quiet { background: #e8f5e8; color: #0d600d; }
.text-button { display: block; margin: 17px auto 0; padding: 6px; border: 0; background: transparent; color: #0d600d; font-weight: 750; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.message { min-height: 20px; margin: 11px 0 0; color: #a12828; font-size: 14px; }
.message.success { color: #0d600d; }
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.toolbar-actions { display: flex; gap: 9px; align-items: center; }
.account-select { width: auto; min-width: 190px; min-height: 44px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 15px; }
.metric-card { display: flex; min-height: 120px; padding: 20px; flex-direction: column; justify-content: space-between; border: 1px solid #d8e5da; border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(29,68,36,.055); }
.metric-card span { color: #667369; font-size: 13px; font-weight: 720; }
.metric-card strong { color: #0d600d; font-size: 34px; line-height: 1; }
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.money-card { min-height: 142px; padding: 23px; }
.accent-card { background: linear-gradient(135deg, #effaef, #fff); }
.money-list { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 17px; }
.money-value { display: grid; gap: 3px; }
.money-value strong { font-size: 28px; color: #17211a; }
.money-value span { color: #6b786e; font-size: 12px; font-weight: 720; }
.money-zero { color: #718077; font-size: 14px; }
.disclosure { margin: 9px 3px 31px; color: #6d786f; font-size: 12px; }
.section-card { margin-top: 22px; padding: clamp(20px, 4vw, 30px); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 20px; }
.section-heading > .muted { max-width: 460px; margin: 0; font-size: 13px; line-height: 1.55; text-align: right; }
.source-list { display: grid; gap: 13px; }
.source-item { padding: 18px; border: 1px solid #e0e9e2; border-radius: 15px; background: #fbfdfb; }
.source-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.source-title { margin: 0; font-size: 16px; }
.source-meta { margin: 4px 0 0; color: #718077; font-size: 12px; }
.source-stats { display: flex; flex-wrap: wrap; gap: 8px 17px; color: #4d5c50; font-size: 12px; font-weight: 720; }
.code-list { display: grid; gap: 9px; margin-top: 15px; }
.code-row { display: grid; grid-template-columns: minmax(125px, .6fr) minmax(220px, 2fr) auto; align-items: center; gap: 10px; }
.code-badge { overflow: hidden; padding: 9px 11px; border-radius: 9px; background: #e8f5e8; color: #0d600d; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.code-badge.inactive { background: #f0f1f0; color: #757c77; }
.link-field { overflow: hidden; color: #5f6d62; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { min-height: 36px; border: 1px solid #bed5c1; border-radius: 9px; padding: 7px 11px; background: #fff; color: #0d600d; font-size: 12px; font-weight: 800; cursor: pointer; }
.table-scroll { overflow-x: auto; border: 1px solid #e0e9e2; border-radius: 13px; }
table { width: 100%; min-width: 650px; border-collapse: collapse; }
th, td { padding: 14px 15px; border-bottom: 1px solid #e7eee8; text-align: left; }
th { background: #f7faf7; color: #69766c; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #fff3d6; color: #7a5310; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.status.paid { background: #e3f6e5; color: #0d600d; }
.status.cancelled { background: #f3eded; color: #8b3333; }
.empty-state { margin: 18px 0 0; color: #718077; text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .toolbar { display: block; }
  .toolbar-actions { margin-top: 16px; }
  .section-heading { display: block; }
  .section-heading > .muted { margin-top: 8px; text-align: left; }
}

@media (max-width: 590px) {
  .shell { width: min(100% - 22px, 1120px); padding-top: 23px; }
  .brand { margin-left: 5px; }
  .brand-logo { width: 96px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .account-select { grid-column: 1 / -1; width: 100%; }
  .money-grid { grid-template-columns: 1fr; }
  .code-row { grid-template-columns: 1fr auto; }
  .link-field { grid-column: 1 / -1; grid-row: 2; }
  .source-top { display: block; }
  .source-stats { margin-top: 10px; }
}
