:root {
  --ink: #172625;
  --muted: #6f7d7a;
  --teal: #0b756b;
  --teal-dark: #075a53;
  --teal-pale: #dfeeea;
  --cream: #f4f4ee;
  --paper: #fcfcf8;
  --line: #dfe5df;
  --rust: #c8714c;
  --sage: #8ba49a;
  --danger: #b4443b;
  --shadow: 0 12px 40px rgba(29, 53, 50, .07);
  --radius: 18px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
code { padding: 2px 6px; border-radius: 5px; background: #edf0ea; color: var(--teal-dark); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--sidebar); flex-direction: column; padding: 28px 20px 22px; border-right: 1px solid #e5e8e2; background: #fafaf6; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; color: var(--ink); font-size: 21px; letter-spacing: -.6px; }
.brand strong { font-weight: 760; }
.brand em { margin-left: 5px; color: var(--teal); font-size: 10px; font-style: normal; font-weight: 760; letter-spacing: .8px; text-transform: uppercase; }
.brand-mark { display: flex; align-items: end; gap: 3px; height: 25px; }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: var(--teal); }
.brand-mark i:nth-child(1) { height: 11px; }
.brand-mark i:nth-child(2) { height: 23px; }
.brand-mark i:nth-child(3) { height: 16px; }
.nav { margin-top: 48px; }
.nav-label { margin: 25px 10px 8px; color: #9aa5a1; font-size: 10px; font-weight: 750; letter-spacing: 1.5px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; margin: 3px 0; padding: 10px 12px; border-radius: 9px; color: #62706d; font-size: 13.5px; font-weight: 570; transition: .18s ease; }
.nav-item > span { display: grid; width: 21px; color: #84928e; font-size: 19px; place-items: center; }
.nav-item:hover { background: #eff1eb; color: var(--ink); }
.nav-item.active { background: var(--teal-pale); color: var(--teal-dark); font-weight: 690; }
.nav-item.active > span { color: var(--teal); }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-chip, .user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.profile-chip > span:last-child, .user-cell > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.profile-chip strong, .user-cell strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip small, .user-cell small { color: var(--muted); font-size: 11px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--teal); color: white; font-size: 12px; font-weight: 750; place-items: center; }
.profile-actions { display: flex; gap: 12px; margin: 11px 0 0 44px; color: var(--muted); font-size: 11px; }
.profile-actions form { display: inline; }
.link-button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.profile-actions a:hover, .link-button:hover { color: var(--teal); }
.powered-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 34px; padding: 18px 0 2px; border-top: 1px solid rgba(215,222,216,.75); color: #8b9793; font-size: 9px; letter-spacing: .35px; }
.powered-footer img, .invoice-footer img { width: 104px; height: auto; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar); padding: 38px 42px 60px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin: 0 0 28px; }
.page-header h1 { margin: 2px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3vw, 42px); font-weight: 500; letter-spacing: -1.2px; line-height: 1.08; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 10px; font-weight: 790; letter-spacing: 1.65px; text-transform: uppercase; }
.header-actions { display: flex; gap: 9px; padding-top: 9px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 12px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 12px; font-weight: 720; cursor: pointer; transition: .18s ease; }
.button:hover { border-color: #c6cec8; transform: translateY(-1px); }
.button.primary { border-color: var(--teal); background: var(--teal); color: white; box-shadow: 0 7px 18px rgba(11,117,107,.16); }
.button.primary:hover { background: var(--teal-dark); }
.button.subtle { background: #fbfbf7; }
.button.small { min-height: 35px; padding: 6px 13px; }
.button.wide { width: 100%; }
.mobile-menu { display: none; }

.flash-stack { position: fixed; top: 18px; right: 22px; z-index: 100; display: grid; gap: 8px; max-width: 420px; }
.flash { padding: 12px 16px; border: 1px solid #c9ded6; border-radius: 9px; background: #eef8f4; box-shadow: var(--shadow); color: var(--teal-dark); font-size: 13px; }
.flash.error { border-color: #eccac4; background: #fff3f0; color: var(--danger); }
.flash.warning { border-color: #ead6aa; background: #fff8e9; color: #815b21; }

.filter-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #d9dfda; }
.segment { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #e9ece6; }
.segment button { padding: 6px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 690; cursor: pointer; }
.segment button.active { background: white; box-shadow: 0 2px 6px rgba(30,50,46,.09); color: var(--ink); }
.campaign-filter { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 650; }
select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"] { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #d5ddd7; border-radius: 7px; outline: none; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s; }
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,117,107,.1); }
.campaign-filter select { min-width: 220px; min-height: 35px; padding: 5px 32px 5px 10px; font-size: 12px; }
.custom-dates { display: flex; align-items: end; gap: 8px; }
.custom-dates label { color: var(--muted); font-size: 10px; font-weight: 650; }
.custom-dates input { min-height: 35px; padding: 5px 8px; font-size: 11px; }
.period-inputs { display: flex; align-items: end; gap: 8px; }
.period-inputs > label { min-width: 145px; color: var(--muted); font-size: 10px; font-weight: 650; }
.period-inputs input { min-height: 35px; padding: 5px 8px; font-size: 11px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-card, .panel { border: 1px solid rgba(214,222,216,.9); border-radius: var(--radius); background: var(--paper); box-shadow: 0 3px 14px rgba(29,53,50,.025); }
.kpi-card { min-height: 137px; padding: 20px; }
.kpi-card.accent-card { background: var(--teal); color: white; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: var(--muted); font-size: 11px; font-weight: 660; }
.accent-card .kpi-top, .accent-card small { color: rgba(255,255,255,.72); }
.kpi-card > strong { display: block; margin-bottom: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -.4px; }
.kpi-card > small { color: var(--muted); font-size: 10.5px; }
.mini-icon { display: grid; width: 27px; height: 27px; border-radius: 50%; background: rgba(255,255,255,.16); color: white; place-items: center; }
.mini-icon.neutral { background: #edf1ec; color: var(--teal); }
.mini-icon.positive { background: #e3f0e9; color: #3d8067; }
.negative { color: var(--danger) !important; }
.positive-text { color: var(--teal-dark); }
.scope-disclosure { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #d6ddd7; border-radius: 11px; background: #f8f8f3; }
.scope-icon { display: grid; width: 25px; height: 25px; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-weight: 760; place-items: center; }
.scope-disclosure strong { font-size: 11.5px; }
.scope-disclosure p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.scope-actions { display: flex; gap: 7px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; margin-bottom: 14px; }
.panel { padding: 22px; }
.mapping-panel { margin-top: 14px; }
.panel-intro { max-width: 900px; margin: -7px 0 18px; color: var(--muted); font-size: 12px; }
.mapping-form { display: flex; min-width: 300px; align-items: center; gap: 8px; }
.mapping-form select { min-height: 35px; padding-top: 5px; padding-bottom: 5px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h2, .report-title h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 500; letter-spacing: -.3px; }
.panel-stat, .muted-small { color: var(--muted); font-size: 10.5px; }
.canvas-wrap { position: relative; height: 208px; }
canvas { width: 100%; height: 100%; }
.chart-legend { display: flex; justify-content: space-between; margin-top: 11px; color: var(--muted); font-size: 10px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.legend-dot.teal { background: var(--teal); }
.legend-dot.rust { background: var(--rust); }
.reason-list { display: grid; gap: 15px; }
.reason-row > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 10.5px; }
.reason-row span { overflow: hidden; color: #4f5f5c; text-overflow: ellipsis; white-space: nowrap; }
.reason-row strong { font-size: 10px; }
progress { display: block; width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 5px; background: #e7ebe5; color: var(--teal); }
progress::-webkit-progress-bar { border-radius: 5px; background: #e7ebe5; }
progress::-webkit-progress-value { border-radius: 5px; background: var(--teal); }
progress::-moz-progress-bar { border-radius: 5px; background: var(--teal); }
.no-data { display: grid; min-height: 200px; color: var(--muted); place-items: center; align-content: center; }
.no-data > span { color: var(--sage); font-size: 38px; }
.no-data.compact { min-height: 120px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #8a9692; font-size: 9.5px; font-weight: 740; letter-spacing: .7px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #e9ece7; color: #4b5a57; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td > strong { display: block; max-width: 270px; overflow: hidden; color: var(--ink); font-size: 11.5px; text-overflow: ellipsis; }
td > small { display: block; max-width: 280px; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; }
.tag, .status { display: inline-flex; width: max-content; align-items: center; padding: 4px 8px; border-radius: 20px; background: #edf1ec; color: #53645f; font-size: 9px; font-weight: 720; letter-spacing: .25px; }
.status.complete { background: #e4f1eb; color: #34715b; }
.status.processing { background: #fff1d7; color: #9a671f; }
.status.warning { background: #fff1d7; color: #8b5e1d; }
.status.failed { background: #fae7e3; color: #a4483d; }
.align-right { text-align: right; }

.empty-state { text-align: center; }
.empty-state.large { display: grid; min-height: 440px; padding: 60px 20px; place-items: center; align-content: center; }
.empty-state h2 { margin: 5px 0 4px; font: 500 28px/1.2 Georgia, serif; }
.empty-state p:not(.eyebrow) { max-width: 500px; margin: 0 0 20px; color: var(--muted); }
.empty-icon { display: grid; width: 58px; height: 58px; margin-bottom: 17px; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-size: 27px; place-items: center; }
.empty-inline { padding: 35px; color: var(--muted); text-align: center; }

.split-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel-intro { margin: -5px 0 20px; color: var(--muted); font-size: 12px; }
.form-stack { display: grid; gap: 16px; }
.form-stack label { display: grid; gap: 6px; color: #455451; font-size: 11px; font-weight: 680; }
.form-stack label small { color: var(--muted); font-size: 9.5px; font-weight: 480; }
.file-drop { position: relative; display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px !important; min-height: 78px; padding: 15px; border: 1px dashed #bdc9c2; border-radius: 11px; background: #f8f9f4; cursor: pointer; }
.file-drop:hover { border-color: var(--teal); background: #f3f8f4; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop > span:nth-child(2) { display: flex; flex-direction: column; }
.file-drop em { color: var(--teal); font-size: 10px; font-style: normal; font-weight: 720; }
.file-icon { display: grid; width: 37px; height: 37px; border-radius: 8px; background: var(--teal-pale); color: var(--teal); font-size: 10px; place-items: center; }
.check-list { display: grid; gap: 19px; margin: 24px 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 12px; }
.check-list li > span { display: grid; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-size: 11px; place-items: center; }
.check-list div { display: flex; flex-direction: column; }
.check-list strong { font-size: 11px; }
.check-list small { color: var(--muted); font-size: 9.5px; }
.info-note { padding: 15px; border-left: 3px solid var(--rust); border-radius: 0 8px 8px 0; background: #f5ede7; font-size: 10.5px; }
.info-note p { margin: 3px 0 0; color: var(--muted); }
.source-totals { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 18px; }
.source-totals span { display: flex; flex-direction: column; padding: 12px; border-radius: 8px; background: #eef2ed; }
.source-totals strong { font: 500 18px Georgia,serif; }
.source-totals small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.step-badge { display: grid; width: 42px; height: 42px; border-radius: 50%; background: var(--teal); color: white; font-size: 9px; font-weight: 750; place-items: center; }

.settings-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.campaign-list { padding: 14px; }
.campaign-list .panel-head { padding: 8px 8px 11px; }
.campaign-links { display: grid; gap: 3px; }
.campaign-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 9px; color: var(--muted); }
.campaign-link:hover { background: #f0f2ed; }
.campaign-link.active { background: var(--teal-pale); color: var(--teal-dark); }
.campaign-link > span:first-child { display: flex; min-width: 0; flex-direction: column; }
.campaign-link strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-link small { font-size: 9.5px; }
.billing-form-panel { padding: 27px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; color: #455451; font-size: 11px; font-weight: 690; }
.choice-grid, .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.choice-card { position: relative; display: flex !important; min-height: 74px; grid-template-columns: auto 1fr !important; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--teal); background: #f1f8f5; box-shadow: 0 0 0 1px var(--teal); }
.choice-card input { width: 15px; accent-color: var(--teal); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card small { margin-top: 2px; }
.money-input { position: relative; display: block; }
.money-input i { position: absolute; top: 50%; left: 12px; z-index: 1; color: var(--muted); font-style: normal; transform: translateY(-50%); }
.money-input input { padding-left: 26px; }
.vote-fieldset { display: grid; gap: 13px; padding: 17px; border-radius: 11px; background: #f0f3ed; }
.switch-row { display: flex !important; grid-template-columns: 1fr auto !important; align-items: center; justify-content: space-between; gap: 15px !important; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { position: relative; display: block; width: 39px; height: 22px; flex: 0 0 auto; border-radius: 22px; background: #bcc5bf; transition: .2s; }
.switch-row i:after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; content: ""; transition: .2s; }
.switch-row input:checked + i { background: var(--teal); }
.switch-row input:checked + i:after { left: 20px; }
.compact-switch { padding: 5px 0; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-footer .muted-small { margin-right: auto; }

.user-summary { grid-template-columns: repeat(3, 1fr); }
.user-summary .kpi-card { min-height: 120px; }
.row-actions { display: flex; justify-content: flex-end; gap: 11px; }
.row-actions form { display: inline; }
.text-action { padding: 0; border: 0; background: none; color: var(--teal); font-size: 10px; font-weight: 650; cursor: pointer; }
.text-action.danger { color: var(--danger); }
.text-action:disabled { color: #b8c0bc; cursor: not-allowed; }
.modal { width: min(480px, calc(100vw - 30px)); padding: 25px; border: 0; border-radius: 16px; box-shadow: 0 25px 80px rgba(18,38,35,.25); background: var(--paper); }
.modal::backdrop { background: rgba(18,32,30,.48); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.modal-head h2 { margin: 0; font: 500 25px Georgia, serif; }
.modal-head button { border: 0; background: none; color: var(--muted); font-size: 25px; cursor: pointer; }
.small-modal { width: min(430px, calc(100vw - 30px)); }
.access-summary { display: block; max-width: 230px; overflow: hidden; color: #566561; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-access { display: grid; gap: 8px; padding: 14px; border-radius: 10px; background: #f0f3ed; }
.campaign-access > p { margin: -5px 0 3px; color: var(--muted); font-size: 9.5px; }
.checkbox-list { display: grid; max-height: 175px; overflow-y: auto; gap: 5px; }
.checkbox-list label, .select-all { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; gap: 9px !important; min-height: 35px; padding: 7px 9px; border-radius: 7px; background: white; cursor: pointer; }
.checkbox-list input, .select-all input { width: 15px; height: 15px; accent-color: var(--teal); }
.checkbox-list strong, .select-all strong { font-size: 10.5px; }
.billing-modal { width: min(620px, calc(100vw - 30px)); }
.bill-campaign-list { grid-template-columns: 1fr 1fr; }
.client-note { max-width: 620px; margin-bottom: 14px; }
.reconcile-note { display: flex; width: 100%; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px 15px; border: 1px solid #d7e3dc; border-radius: 10px; background: #eef5f0; color: inherit; text-align: left; cursor: pointer; transition: .18s ease; }
.reconcile-note:hover { border-color: #abc8bb; background: #e7f2ec; transform: translateY(-1px); }
.reconcile-note > span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; background: var(--teal); color: white; font: 700 10px Georgia,serif; place-items: center; }
.reconcile-note p { margin: 0; color: var(--muted); font-size: 10.5px; }
.reconcile-note strong { color: var(--ink); }
.reconcile-note em { margin-left: 5px; color: var(--teal); font-style: normal; font-weight: 720; white-space: nowrap; }
.data-modal { width: min(1180px, calc(100vw - 30px)); }
.identifier-rule { padding: 14px 16px; border-radius: 10px; background: #eef3ef; }
.identifier-rule > span { display: block; margin-bottom: 5px; color: var(--teal); font-size: 8px; font-weight: 780; letter-spacing: 1.2px; text-transform: uppercase; }
.identifier-rule p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.reconcile-stats { display: grid; grid-template-columns: repeat(2,minmax(0,220px)); gap: 9px; margin: 13px 0; }
.reconcile-stats span { display: flex; flex-direction: column; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.reconcile-stats strong { font: 500 22px Georgia,serif; }
.reconcile-stats small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.modal-search { display: flex; gap: 8px; margin-bottom: 12px; }
.modal-search input { min-height: 36px; }
.modal-table { max-height: 440px; border: 1px solid var(--line); border-radius: 9px; }
.modal-table thead { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.modal-table td:first-child strong { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 9.5px; }
.modal-load { display: flex; align-items: center; justify-content: space-between; min-height: 42px; color: var(--muted); font-size: 9.5px; }
.muted { color: var(--muted); }

.account-grid { display: grid; grid-template-columns: 300px minmax(0, 650px); gap: 14px; align-items: start; }
.audit-policy { margin-bottom: 14px; }
.audit-section { margin-bottom: 14px; }
.audit-filter label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.audit-filter select { min-width: 230px; min-height: 35px; padding-block: 5px; }
.identity-card { display: flex; align-items: center; flex-direction: column; padding: 40px 20px; text-align: center; }
.large-avatar { width: 68px; height: 68px; font-size: 23px; }
.identity-card h2 { margin: 16px 0 2px; font: 500 24px Georgia, serif; }
.identity-card p { margin: 0 0 13px; color: var(--muted); }
.narrow-form { max-width: 440px; }

.report-cover { display: grid; grid-template-columns: auto 1.3fr 2fr; align-items: center; gap: 30px; min-height: 170px; margin-bottom: 14px; background: var(--teal); color: white; }
.report-brand { display: flex; align-items: center; gap: 8px; padding-right: 30px; border-right: 1px solid rgba(255,255,255,.2); }
.report-brand .brand-mark i { background: white; }
.report-cover .eyebrow { color: #a7d6ce; }
.report-cover h2 { margin: 0; font: 500 25px Georgia, serif; }
.report-cover p:not(.eyebrow) { margin: 5px 0 0; color: rgba(255,255,255,.68); font-size: 10px; }
.report-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 14px; }
.report-totals div { display: flex; flex-direction: column; }
.report-totals small { color: rgba(255,255,255,.65); font-size: 9px; }
.report-totals strong { font: 500 19px Georgia, serif; }
.report-campaign { margin-bottom: 14px; break-inside: avoid; }
.report-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); margin-bottom: 24px; border-block: 1px solid var(--line); }
.report-kpis div { display: flex; min-width: 0; flex-direction: column; padding: 15px 12px; border-right: 1px solid var(--line); }
.report-kpis div:first-child { padding-left: 0; }
.report-kpis div:last-child { border: 0; }
.report-kpis small { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.report-kpis strong { margin-top: 3px; font: 500 17px Georgia, serif; }
.report-detail-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 45px; }
.report-detail-grid h3 { margin: 0 0 12px; font-size: 11px; }
.billing-breakdown { margin: 0; }
.billing-breakdown div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e8ece7; font-size: 10px; }
.billing-breakdown dt { color: var(--muted); }
.billing-breakdown dd { margin: 0; font-weight: 680; }
.report-reasons { gap: 10px; }
.report-reasons .reason-row small { color: var(--muted); font-size: 8px; }
.error-code { color: var(--teal); font: 500 70px Georgia, serif; }

.bill-view-modal { width: min(1120px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto; background: #e9ede7; }
.bill-dialog-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 10px 16px; border-bottom: 1px solid #d6ddd7; background: rgba(252,252,248,.96); }
.bill-dialog-toolbar a { color: var(--teal); font-size: 10px; font-weight: 720; }
.bill-dialog-toolbar a:first-child { margin-right: auto; }
.bill-dialog-toolbar button { border: 0; background: transparent; color: var(--muted); font-size: 25px; cursor: pointer; }
.invoice-sheet { width: min(100%,980px); margin: 0 auto; padding: 38px 42px 24px; background: white; box-shadow: 0 15px 55px rgba(22,45,42,.09); }
.invoice-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 19px; border-bottom: 1px solid #dae1dc; }
.invoice-brand { display: flex; align-items: center; gap: 9px; font-size: 19px; }
.invoice-brand > span:last-child { display: flex; align-items: baseline; }
.invoice-brand em { margin-left: 5px; color: var(--teal); font-size: 9px; font-style: normal; font-weight: 760; letter-spacing: .8px; text-transform: uppercase; }
.invoice-label { display: flex; align-items: flex-end; flex-direction: column; }
.invoice-label span { color: var(--muted); font-size: 8px; letter-spacing: 1.1px; text-transform: uppercase; }
.invoice-label strong { font: 500 17px Georgia,serif; }
.invoice-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 35px 0 27px; }
.invoice-hero h1 { margin: 0; font: 500 38px/1.05 Georgia,serif; letter-spacing: -1.2px; }
.invoice-hero p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.amount-due { display: flex; min-width: 220px; align-items: flex-end; flex-direction: column; padding: 20px 22px; border-radius: 13px; background: var(--teal); color: white; }
.amount-due small { color: rgba(255,255,255,.65); font-size: 8px; letter-spacing: .8px; text-transform: uppercase; }
.amount-due strong { font: 500 31px Georgia,serif; }
.amount-due span { color: rgba(255,255,255,.6); font-size: 8px; }
.invoice-meta { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 27px; border-block: 1px solid #e1e6e2; }
.invoice-meta div { display: flex; flex-direction: column; padding: 13px 14px; border-right: 1px solid #e1e6e2; }
.invoice-meta div:first-child { padding-left: 0; }.invoice-meta div:last-child { border: 0; }
.invoice-meta small,.invoice-kpis small,.campaign-due small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.invoice-meta strong { margin-top: 3px; font-size: 10.5px; }
.invoice-overview { margin-bottom: 26px; padding: 19px; border-radius: 13px; background: #f3f5f0; }
.invoice-overview .panel-head { margin-bottom: 13px; }
.invoice-chart-wrap { height: 225px; }
.invoice-bars { display: grid; gap: 11px; }
.invoice-bar > div { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 10px; }
.invoice-bar small { color: var(--muted); font-size: 8px; }
.invoice-campaign { margin: 0 0 22px; padding: 23px; border: 1px solid #dfe5df; border-radius: 14px; break-inside: avoid; }
.invoice-campaign-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.invoice-campaign-head h2 { margin: 0; font: 500 23px Georgia,serif; }
.campaign-due { display: flex; align-items: flex-end; flex-direction: column; }
.campaign-due strong { font: 500 21px Georgia,serif; }
.invoice-kpis { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 20px; border-block: 1px solid #e4e8e4; }
.invoice-kpis div { display: flex; flex-direction: column; padding: 12px; border-right: 1px solid #e4e8e4; }
.invoice-kpis div:first-child { padding-left: 0; }.invoice-kpis div:last-child { border: 0; }
.invoice-kpis strong { margin-top: 3px; font: 500 17px Georgia,serif; }
.invoice-detail-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 35px; }
.invoice-detail-grid h3 { margin: 0 0 10px; font-size: 10px; letter-spacing: .3px; }
.billing-breakdown .breakdown-total { padding-top: 11px; border-bottom: 0; color: var(--ink); font-size: 11px; }
.composition-card { display: grid; gap: 11px; padding: 13px; border-radius: 9px; background: #f4f5f1; }
.composition-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 9.5px; }
.composition-row progress { grid-column: 1/-1; }
.composition-row.vote progress::-webkit-progress-value { background: var(--rust); }.composition-row.vote progress::-moz-progress-bar { background: var(--rust); }
.outcome-title { margin-top: 17px !important; }
.invoice-reasons { gap: 9px; }
.invoice-reasons .reason-row small { color: var(--muted); font-size: 7.5px; }
.invoice-total { display: flex; align-items: center; justify-content: space-between; padding: 21px 23px; border-radius: 12px; background: var(--teal-dark); color: white; }
.invoice-total > span { display: flex; align-items: flex-end; flex-direction: column; }
.invoice-total > span:first-child { align-items: flex-start; }
.invoice-total small { color: rgba(255,255,255,.65); font-size: 8px; text-transform: uppercase; }
.invoice-total > span:last-child strong { font: 500 28px Georgia,serif; }
.invoice-monthly-detail { margin-top: 24px; padding: 20px; border: 1px solid #dfe5df; border-radius: 12px; break-inside: avoid; }
.invoice-monthly-detail .panel-head { margin-bottom: 12px; }
.invoice-monthly-detail td,.invoice-monthly-detail th { padding-inline: 8px; }
.invoice-monthly-detail tfoot td { border-top: 2px solid var(--teal); border-bottom: 0; color: var(--ink); }
.invoice-monthly-detail tfoot td:first-child { text-align: right; }
.invoice-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 23px; padding-top: 18px; border-top: 1px solid #e0e5e1; color: var(--muted); font-size: 8px; }

.auth-body { background: var(--paper); }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }
.auth-story { position: relative; display: flex; overflow: hidden; flex-direction: column; padding: 46px 55px; background: var(--teal-dark); color: white; }
.auth-story:before, .auth-story:after { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.auth-story:before { right: -230px; bottom: -240px; width: 650px; height: 650px; }
.auth-story:after { right: -110px; bottom: -110px; width: 380px; height: 380px; }
.brand-light { color: white; }
.brand-light .brand-mark i { background: #9fd0c6; }
.auth-copy { position: relative; z-index: 1; margin: auto 0; }
.auth-copy .eyebrow { color: #9fd0c6; }
.auth-copy h1 { margin: 10px 0 21px; font: 500 clamp(44px, 5vw, 70px)/1.02 Georgia, serif; letter-spacing: -2.7px; }
.auth-copy > p:not(.eyebrow) { max-width: 470px; color: rgba(255,255,255,.65); font-size: 16px; }
.auth-metric { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: max-content; padding: 11px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.06); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #8ad5bb; box-shadow: 0 0 0 5px rgba(138,213,187,.12); }
.auth-metric > span:last-child { display: flex; flex-direction: column; }
.auth-metric strong { font-size: 10px; }
.auth-metric small { color: rgba(255,255,255,.58); font-size: 8.5px; }
.auth-panel { display: grid; padding: 50px; place-items: center; }
.auth-card { width: min(390px, 100%); }
.auth-card h2 { margin: 2px 0 5px; font: 500 35px Georgia, serif; letter-spacing: -.7px; }
.auth-card > .muted { margin: 0 0 28px; font-size: 12px; }
.auth-card .form-stack { gap: 17px; }
.auth-help { margin-top: 25px; color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .main-shell { padding-inline: 26px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .report-cover { grid-template-columns: 1fr; }
  .report-brand { padding: 0; border: 0; }
  .report-kpis { grid-template-columns: repeat(3, 1fr); }
  .report-totals { max-width: 600px; }
}

@media (max-width: 800px) {
  .mobile-menu { position: fixed; top: 14px; left: 13px; z-index: 40; display: grid; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow); color: var(--teal); cursor: pointer; place-items: center; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-shell { margin-left: 0; padding: 70px 17px 40px; }
  .page-header { flex-direction: column; }
  .header-actions { width: 100%; flex-wrap: wrap; padding: 0; }
  .filter-bar { align-items: flex-start; flex-wrap: wrap; }
  .period-inputs { width: 100%; flex-wrap: wrap; }
  .campaign-filter { width: 100%; margin: 0; }
  .campaign-filter select { flex: 1; min-width: 0; }
  .dashboard-grid, .split-grid, .settings-layout, .account-grid { grid-template-columns: 1fr; }
  .campaign-list { max-height: 280px; overflow-y: auto; }
  .report-detail-grid { grid-template-columns: 1fr; gap: 25px; }
  .report-actions { padding-right: 0; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px; }
  .invoice-sheet { padding: 26px 18px 20px; }
  .invoice-hero,.invoice-campaign-head { align-items: flex-start; flex-direction: column; }
  .amount-due { width: 100%; align-items: flex-start; }
  .invoice-meta,.invoice-kpis { grid-template-columns: repeat(2,1fr); }
  .invoice-detail-grid { grid-template-columns: 1fr; }
  .scope-disclosure { grid-template-columns: auto 1fr; align-items: start; }
  .scope-actions { grid-column: 2; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .kpi-grid, .user-summary { grid-template-columns: 1fr; }
  .kpi-card { min-height: 115px; }
  .choice-grid, .field-grid { grid-template-columns: 1fr; }
  .custom-dates { width: 100%; flex-wrap: wrap; }
  .custom-dates label { flex: 1; }
  .report-totals { grid-template-columns: repeat(2, 1fr); }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-kpis div { border-bottom: 1px solid var(--line); }
}

@media print {
  @page { margin: 14mm; }
  body { background: white; color: #111; }
  .sidebar, .mobile-menu, .report-actions .header-actions, .flash-stack { display: none !important; }
  .main-shell { margin: 0; padding: 0; }
  .report-actions { margin-bottom: 16px; }
  .panel { box-shadow: none; }
  .report-cover { color: white !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-campaign { page-break-inside: avoid; }
  .no-print { display: none !important; }
  .invoice-sheet { width: 100%; padding: 0; box-shadow: none; }
  .invoice-campaign { page-break-inside: avoid; }
}
