:root {
    color-scheme: light;
    --ink: #202f36;
    --muted: #77818a;
    --line: #e3e8e7;
    --paper: #f6f8f7;
    --teal: #176d60;
    --teal-soft: #e8f3ef;
    --danger: #b65040;
    --radius: 14px;
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
}
a {
    color: inherit;
    text-decoration: none;
}
button,
input,
textarea,
select {
    font: inherit;
}
button,
a,
input,
select,
textarea {
    outline-offset: 4px;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 246px;
    flex-shrink: 0;
    padding: 34px 22px 24px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.5px;
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--teal);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 24px;
    letter-spacing: -2px;
}
.brand small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--muted);
    margin-top: 3px;
}
.nav-label {
    font-size: 10px;
    letter-spacing: 1.7px;
    color: #a0a9ae;
    margin: 42px 12px 12px;
}
.sidebar nav {
    display: grid;
    gap: 7px;
}
.sidebar nav a {
    padding: 12px 14px;
    border-radius: 9px;
    color: #69757d;
    display: flex;
    gap: 13px;
    font-weight: 500;
}
.sidebar nav a span {
    font-size: 18px;
    width: 19px;
    line-height: 20px;
}
.sidebar nav a:hover {
    background: #f6f8f7;
}
.sidebar nav a.active {
    color: var(--teal);
    background: var(--teal-soft);
}
.sidebar-bottom {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}
.sidebar-bottom small {
    display: block;
    font-size: 10px;
    color: var(--muted);
}
.sidebar-bottom form {
    margin-left: auto;
}
.avatar {
    border-radius: 50%;
    background: #ede9df;
    color: #6a6353;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
}
.icon-button {
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 21px;
}
.workspace {
    margin-left: 246px;
    width: calc(100% - 246px);
}
.topbar {
    height: 76px;
    border-bottom: 1px solid var(--line);
    padding: 0 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    background: #ffffff80;
}
.main-content {
    padding: 38px 44px 48px;
    max-width: 1480px;
    margin: auto;
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 1.8px;
    color: var(--teal);
    font-weight: 700;
    margin-bottom: 9px;
}
h1 {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -1px;
    margin: 0 0 10px;
}
h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 7px;
    letter-spacing: -0.3px;
}
p {
    margin: 0 0 14px;
}
.muted,
.help,
.footer-note,
.fine-print {
    color: var(--muted);
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}
.page-heading p {
    margin: 0;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 10px 18px;
    font-weight: 500;
    white-space: nowrap;
}
.primary {
    background: var(--teal);
    color: white;
}
.primary:hover {
    background: #105447;
}
.secondary {
    border-color: var(--line);
    background: white;
    color: var(--ink);
}
.secondary:hover {
    background: var(--paper);
}
.small {
    font-size: 12px;
    min-height: 32px;
    padding: 6px 11px;
}
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 18px;
    margin-bottom: 22px;
}
.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.metric-label {
    color: #637079;
    font-size: 12px;
    margin-bottom: 8px;
}
.metric strong {
    font-size: 32px;
    font-weight: 550;
    letter-spacing: -1px;
}
.metric > .muted {
    font-size: 11px;
}
.metric.totals strong {
    font-size: 24px;
}
.metric.totals > div > span {
    font-size: 12px;
    color: var(--muted);
    margin-left: 5px;
}
.danger-text {
    color: var(--danger);
}
.notice {
    background: #eff3f0;
    border: 1px solid #dbe5dd;
    border-radius: 10px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    margin-bottom: 24px;
    color: #586a61;
}
.notice div {
    display: grid;
    gap: 3px;
}
.notice a {
    margin-left: auto;
    font-weight: 600;
    white-space: nowrap;
    color: var(--teal);
}
.notice.error {
    background: #fcf0ec;
    border-color: #efd4cc;
    color: #a44837;
    display: block;
}
.notice.success {
    background: var(--teal-soft);
    color: var(--teal);
}
.notice ul {
    padding-left: 18px;
    margin: 7px 0 0;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bfa45c;
    flex-shrink: 0;
}
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}
.payments-panel {
    padding: 0;
    overflow: hidden;
}
.toolbar {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}
.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.tab {
    border: 0;
    background: none;
    color: var(--muted);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12px;
}
.tab.selected {
    background: #eef4f1;
    color: var(--teal);
    font-weight: 600;
}
.search-label {
    max-width: 230px;
}
.search-label input {
    font-size: 12px;
    min-height: 35px;
    padding: 8px 12px;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}
th {
    font-weight: 500;
    color: #8a959b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    background: #fafbfa;
    padding: 13px 22px;
}
td {
    padding: 21px 22px;
    border-top: 1px solid #eff1ef;
    vertical-align: middle;
}
td:last-child {
    text-align: right;
}
td.amount {
    font-weight: 600;
    white-space: nowrap;
}
.service-cell {
    display: flex;
    gap: 12px;
    align-items: center;
}
.service-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf2ef;
    color: var(--teal);
    font-size: 14px;
    font-weight: 600;
}
.service-name {
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.service-name:hover {
    color: var(--teal);
}
.cell-note {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
}
.badge {
    display: inline-block;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 5px;
    background: #f1f3f5;
    color: #697580;
    white-space: nowrap;
}
.badge.pending,
.badge.queued {
    background: #f8f3e5;
    color: #a18637;
}
.badge.paid,
.badge.sent {
    background: #e7f4ee;
    color: #348065;
}
.badge.overdue,
.badge.failed {
    background: #fbece6;
    color: #b25c45;
}
.badge.unknown {
    background: #f6eee3;
    color: #8e622f;
}
.text-link {
    color: var(--teal);
    white-space: nowrap;
}
.footer-note {
    font-size: 11px;
    margin: 18px 0;
}
.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--muted);
}
.empty-state h2 {
    color: var(--ink);
    margin: 16px 0 8px;
}
.empty-state p {
    max-width: 350px;
    margin: 0 auto 22px;
    font-size: 12px;
}
.empty-icon {
    width: 55px;
    height: 55px;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: inline-grid;
    place-items: center;
    font-size: 27px;
    color: #91a99d;
    background: #f8fbf9;
}
.pagination {
    padding: 14px 22px;
}
.pagination:empty {
    display: none;
}
.pagination svg {
    width: 18px;
    height: 18px;
}
.pagination nav > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.pagination nav > div.hidden {
    display: none;
}
.pagination nav a,
.pagination nav button {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
}
.form-panel {
    max-width: 790px;
    display: grid;
    gap: 21px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
label {
    display: block;
    font-size: 12px;
    font-weight: 500;
}
input:not([type="checkbox"]),
textarea,
select {
    display: block;
    width: 100%;
    min-height: 42px;
    border: 1px solid #dce3df;
    border-radius: 7px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    margin-top: 7px;
    transition: border-color 0.15s;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    outline: 2px solid #dbeee6;
}
input::placeholder,
textarea::placeholder {
    color: #a2aaa8;
    font-weight: 400;
}
.required {
    color: var(--teal);
}
.help {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 7px;
    line-height: 1.7;
}
.back-link {
    display: inline-block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 22px;
}
.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    margin-top: 5px;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.section-title {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 9px;
}
.section-title p {
    font-size: 11px;
    margin: 0;
}
.section-number {
    font-size: 12px;
    color: var(--teal);
    background: var(--teal-soft);
    border-radius: 9px;
    padding: 10px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    line-height: 1.5;
}
.check-label input {
    accent-color: var(--teal);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.compact {
    margin: 0;
    padding: 12px;
    font-size: 11px;
}
.settings-save {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}
.lower-grid {
    margin-top: 28px;
}
.status-list {
    font-size: 12px;
    margin: 22px 0;
}
.status-list > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
dt {
    color: var(--muted);
}
dd {
    margin: 0;
}
.endpoint {
    font-size: 11px;
    display: block;
    background: var(--paper);
    border-radius: 6px;
    padding: 12px;
    overflow-wrap: anywhere;
}
.spaced {
    margin-top: 18px;
}
blockquote {
    margin: 14px 0 20px;
    padding: 14px 16px;
    border-left: 3px solid #c2d8ce;
    background: var(--paper);
    font-size: 12px;
    line-height: 1.8;
}
.message-cell {
    white-space: pre-line;
    max-width: 560px;
    overflow-wrap: anywhere;
}
.guest-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 40px 30px;
}
.guest-shell .main-content {
    padding: 35px 0;
}
.login-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    max-width: 450px;
    margin: 40px auto;
    padding: 42px;
}
.login-card h1 {
    font-size: 38px;
}
.login-card .form-stack {
    margin-top: 30px;
}
.fine-print {
    font-size: 10px;
    margin: 25px 0 0;
}
.narrow {
    max-width: 650px;
    margin: 30px auto;
}
.permission-list {
    padding-left: 20px;
    margin: 20px 0;
}
.actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}
.skip-link {
    position: fixed;
    top: -60px;
    left: 10px;
    background: var(--ink);
    color: white;
    padding: 10px;
    z-index: 999;
}
.skip-link:focus {
    top: 10px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.table-scroll {
    overflow-x: auto;
}
@media (min-width: 1600px) {
    .main-content {
        padding-top: 50px;
    }
    .sidebar {
        width: 270px;
    }
    .workspace {
        margin-left: 270px;
        width: calc(100% - 270px);
    }
}
@media (max-width: 1150px) {
    .sidebar {
        width: 210px;
        padding: 28px 14px;
    }
    .workspace {
        margin-left: 210px;
        width: calc(100% - 210px);
    }
    .main-content {
        padding: 28px 24px;
    }
    .topbar {
        padding: 0 24px;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-label {
        max-width: none;
    }
    td,
    th {
        padding: 15px 14px;
    }
    .metrics {
        gap: 12px;
    }
    .metric {
        padding: 18px;
    }
    .page-heading {
        align-items: flex-start;
    }
    h1 {
        font-size: 26px;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .brand {
        font-size: 15px;
    }
    .brand small {
        font-size: 9px;
    }
}
@media (max-width: 760px) {
    .app-shell {
        display: block;
    }
    .sidebar {
        position: static;
        width: auto;
        padding: 18px 20px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand small,
    .nav-label,
    .sidebar-bottom {
        display: none;
    }
    .brand-mark {
        width: 34px;
        height: 34px;
        font-size: 21px;
    }
    .sidebar nav {
        display: flex;
        gap: 3px;
        flex-wrap: wrap;
        margin-top: 15px;
    }
    .sidebar nav a {
        font-size: 11px;
        padding: 8px 10px;
        gap: 5px;
    }
    .sidebar nav a span {
        font-size: 14px;
        width: 15px;
    }
    .workspace {
        margin: 0;
        width: 100%;
    }
    .topbar {
        height: 42px;
        padding: 0 20px;
        font-size: 10px;
    }
    .main-content {
        padding: 25px 18px;
    }
    .page-heading {
        display: block;
        margin-bottom: 22px;
    }
    .page-heading > .button {
        margin-top: 18px;
    }
    h1 {
        font-size: 25px;
    }
    .metrics {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .metric {
        padding: 17px;
    }
    .metric strong {
        font-size: 28px;
    }
    .metric.totals {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    .metric.totals .metric-label {
        margin: 0 auto 0 0;
    }
    .metric.totals strong {
        font-size: 20px;
    }
    .notice {
        font-size: 11px;
        flex-wrap: wrap;
        padding: 13px;
    }
    .notice a {
        margin-left: 22px;
    }
    .toolbar {
        padding: 15px;
    }
    .tab {
        font-size: 10px;
        padding: 8px;
    }
    .payments-table {
        min-width: 640px;
    }
    .panel {
        padding: 20px;
    }
    .payments-panel {
        padding: 0;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .form-panel {
        gap: 18px;
    }
    .guest-shell {
        padding: 25px 18px;
    }
    .login-card {
        padding: 28px;
        margin: 20px auto;
    }
    .message-cell {
        min-width: 220px;
    }
    .actions {
        flex-wrap: wrap;
    }
    .sidebar nav a.active {
        background: var(--teal-soft);
    }
}
.source-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 18px;
    color: var(--muted);
    font-size: 13px;
}
.source-filter select {
    max-width: 260px;
    padding: 9px 12px;
}
.table-scroll {
    position: relative;
}
