:root {
  --ground: #f5efe7;
  --surface: #fdfaf6;
  --raised: #ece7dc;
  --rule: #ebe5dc;
  --border: #dedbd3;
  --ink: #15221e;
  --muted: #53675b;
  --green: #223f33;
  --green-bg: #e6ece3;
  --coral: #db5b42;
  --display: "Cabinet Grotesk", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --amber: #815126;
  --amber-bg: #fbf3e8;
  --red: #9a3835;
  --red-bg: #faedeb;
  --radius: 8px;
  --control: 6px;
  font: 13px/1.55 "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input, select { color: inherit; font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3, .brand { font-family: var(--display); }
h1 { font-size: 36px; line-height: 1.12; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 14px; font-weight: 650; }
svg { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.shell { background: var(--surface); border-bottom: 1px solid var(--border); }
.shell-inner, .workspace { width: min(1208px, calc(100% - 56px)); margin-inline: auto; }
.shell-inner { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--green); text-decoration: none; font-size: 28px; font-weight: 700; letter-spacing: -.07em; white-space: nowrap; }
.brand-dot { color: var(--coral); }
.admin-label { color: var(--muted); font: 500 11px/1.6 "Poppins", sans-serif; letter-spacing: 0; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.module-menu { position: relative; z-index: 2; color: var(--green); }
.module-menu summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; list-style: none; }
.module-menu summary::-webkit-details-marker { display: none; }
.module-menu summary:hover, .module-menu[open] summary { background: var(--green-bg); }
.module-label { color: var(--muted); font-weight: 400; }
.module-menu nav { position: absolute; top: calc(100% + 5px); left: 0; min-width: max(100%, 195px); padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 18px #15221e16; }
.module-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px; border-radius: var(--control); white-space: nowrap; color: var(--muted); }
.module-item span { font-size: 11px; }
.module-item[aria-current] { color: var(--green); background: var(--green-bg); font-weight: 600; text-decoration: none; }
.module-item[aria-current]:hover { text-decoration: underline; }
.profile { display: flex; align-items: center; gap: 8px; }
.profile select { background: transparent; border: 0; max-width: 124px; font-size: 12px; font-weight: 550; }
.profile-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--raised); font-weight: 650; font-size: 12px; }
.demo-tag { color: var(--muted); font-size: 11px; white-space: nowrap; margin-right: 8px; }
.demo-tag i, .badge i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.workspace { padding-block: 22px 40px; }
.crumb { color: var(--muted); font-size: 12px; }
.crumb span { margin: 0 5px; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin: 12px 0 17px; }
.heading p { margin-top: 5px; color: var(--muted); }
.section-nav { display: flex; flex-wrap: wrap; gap: 2px 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.section-nav a { padding: 10px 0 9px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; font-weight: 550; }
.section-nav a[aria-current] { border-color: var(--coral); color: var(--green); font-weight: 600; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; min-height: 35px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 550; }
.button:hover:not(:disabled) { background: var(--raised); }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover:not(:disabled) { background: var(--ink); }
.ghost { background: transparent; border-color: transparent; padding-inline: 6px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.stack { display: grid; gap: 12px; }
.period { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.period-label { color: var(--muted); font-size: 12px; }
select.field, input.field { min-height: 35px; border: 1px solid var(--border); border-radius: var(--control); background: var(--surface); padding: 5px 9px; font-size: 13px; }
.period .field { min-width: 132px; }
.overview { padding: 14px 16px 0; }
.overview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.overview-title { display: grid; gap: 3px; }
.overview-head p, .muted { color: var(--muted); }
.small { font-size: 12px; }
.mini-months { display: inline-flex; gap: 3px; }
.mini-months button { min-height: 32px; padding: 0 9px; background: transparent; color: var(--muted); border: 0; border-radius: 5px; font-size: 12px; }
.mini-months button[aria-pressed="true"] { color: var(--green); background: var(--green-bg); font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 13px; border-top: 1px solid var(--rule); }
.metric { display: grid; gap: 2px; padding: 12px 12px 12px 0; }
.metric + .metric { border-left: 1px solid var(--rule); padding-left: 14px; }
.metric dt, .metric small { color: var(--muted); font-size: 11px; }
.metric dd { font-weight: 650; font-size: 25px; letter-spacing: -.045em; line-height: 1.22; font-variant-numeric: tabular-nums; }
.panel-head { padding: 13px 15px 11px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel-head p { margin-top: 2px; }
.filterbar { padding: 0 15px 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.search { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--control); padding: 0 8px; gap: 7px; color: var(--muted); min-width: min(190px, 100%); }
.search input { min-width: 0; width: 100%; min-height: 33px; border: 0; background: transparent; outline: 0; padding: 0; font-size: 13px; }
.search:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; font-size: 13px; }
th, td { padding: 8px 10px; border-top: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 15px; }
th:last-child, td:last-child { padding-right: 15px; }
th { color: var(--muted); font-weight: 500; font-size: 11px; }
tbody tr:hover { background: var(--ground); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.seller { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.seller:hover { text-decoration: underline; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--avatar-bg, var(--raised)); color: var(--avatar-ink, var(--ink)); font-size: 10px; font-weight: 650; }
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 11px; white-space: nowrap; background: var(--raised); color: var(--muted); }
.badge.good { background: var(--green-bg); color: var(--green); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.table-foot { padding: 8px 15px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 11px; }
.contribution-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
tr[data-revenue-row] { cursor: pointer; }
.revenue-total { display: flex; justify-content: space-between; padding: 10px 15px; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.revenue-description { white-space: normal; }
.referral-breakdown { list-style: none; margin: 0; padding: 0; }
.referral-breakdown li { display: grid; grid-template-columns: 3em minmax(0, 1fr) max-content; gap: 8px; align-items: baseline; }
.referral-breakdown li + li { margin-top: 3px; }
.referral-breakdown .rate, .referral-breakdown .rate-amount { white-space: nowrap; }
.referral-breakdown .rate-amount { text-align: right; }
.eligibility { padding: 13px 15px; border-block: 1px solid var(--rule); }
.eligibility .action-row { margin-top: 12px; }
.edit-group { border: 1px solid var(--border); border-radius: var(--control); margin-bottom: 8px; }
.edit-group summary { padding: 9px 12px; font-weight: 600; }
.edit-group .fields { padding: 0 12px 12px; }
.edit-field { display: grid; gap: 4px; min-width: 0; }
.edit-field span { font-size: 12px; color: var(--muted); }
.edit-field .field { width: 100%; min-width: 0; }
.edit-error { color: var(--red); }
.rail-panel { padding: 13px 14px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.journey { padding: 0; margin: 0; list-style: none; }
.journey li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; padding: 7px 0; border-top: 1px solid var(--rule); }
.journey li:first-child { border-top: 0; }
.journey svg { margin-top: 2px; }
.journey p { color: var(--muted); font-size: 11px; }
.journey a { text-decoration: none; }
.journey a:hover { text-decoration: underline; }
.rail-actions { display: grid; gap: 6px; margin-top: 8px; }
.rail-actions .button { justify-content: space-between; text-align: left; white-space: normal; }
.notice { display: flex; align-items: start; gap: 7px; background: var(--amber-bg); color: var(--amber); padding: 9px 10px; border-radius: var(--control); font-size: 12px; }
.notice svg { margin-top: 2px; }
.empty { padding: 24px 15px; color: var(--muted); border-top: 1px solid var(--rule); }
.content-pad { padding: 15px; }
.content-pad > * + * { margin-top: 10px; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px; }
.detail-id { display: flex; align-items: center; gap: 10px; }
.detail-id .avatar { width: 38px; height: 38px; font-size: 13px; }
.detail-id h2 { font-size: 20px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 14px; }
.fields dt { color: var(--muted); font-size: 11px; }
.fields dd { overflow-wrap: anywhere; }
.stripe-fields { grid-template-columns: minmax(0,1fr); gap: 7px; margin-block: 10px; }
.fold { border-top: 1px solid var(--rule); }
.fold summary { padding: 10px 15px; font-weight: 600; }
.fold .fields { padding: 0 15px 13px; }
.detail-tabs { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); gap: 4px; padding: 7px 9px; }
.detail-tabs button[aria-pressed="true"] { background: var(--raised); }
.api-connection summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.api-connection summary::-webkit-details-marker { display: none; }
.api-connection summary strong::before { content: '›'; display: inline-block; width: 1em; }
.api-connection[open] summary strong::before { content: '⌄'; }
.api-connection summary small { display: block; margin-left: 1em; font-weight: 400; }
.api-body { display: grid; gap: 14px; padding: 0 15px 15px; }
.api-body h3 { margin-bottom: 4px; }
.api-request + .api-request { margin-top: 8px; }
.api-request pre { margin: 3px 0 0; padding: 8px 10px; border-radius: var(--control); background: var(--ground); white-space: pre-wrap; overflow-wrap: anywhere; }
.muted-icon { color: var(--muted); }
dialog { width: min(540px,calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); box-shadow: 0 16px 65px #18282024; }
dialog:has(#dossier-form, .payout-receipt, .tally-review) { width: min(690px,calc(100% - 32px)); }
dialog:has(#dossier-form, .payout-receipt, .tally-review) .dialog-body { max-height: 67vh; overflow-y: auto; }
.payout-receipt, .tally-review { display: grid; gap: 12px; }
.tally-review td { white-space: normal; overflow-wrap: anywhere; }
dialog::backdrop { background: #16251e51; }
.dialog-head, .dialog-body, .dialog-foot { padding: 15px 17px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rule); }
.dialog-body { display: grid; gap: 10px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--rule); }
#toast { position: fixed; right: 16px; bottom: 16px; max-width: min(380px,calc(100% - 32px)); border-radius: 6px; background: var(--ink); color: white; font-size: 13px; }
#toast:not(:empty) { padding: 9px 13px; }
@media (max-width: 950px) {
  .grid { grid-template-columns: minmax(0,1fr) 253px; }
  .shell-inner, .workspace { width: calc(100% - 32px); }
}
@media (max-width: 820px) {
  .grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .shell-inner { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding-block: 8px; }
  .module-menu { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  h1 { font-size: 30px; }
  .heading { align-items: start; flex-direction: column; }
  .section-nav { gap: 0 15px; }
  .metric dd { font-size: 20px; }
  .metric { padding-right: 5px; }
  .metric + .metric { padding-left: 7px; }
}
@media (max-width: 460px) {
  .admin-label { display: none; }
  .brand { font-size: 20px; }
  .profile-avatar { display: none; }
  .edit-group .fields { grid-template-columns: 1fr; }
}
@media (max-width: 355px) {
  .demo-tag { display: none; }
  .metric dd { font-size: 18px; }
}
