[hidden] { display: none !important; }
.icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.panel *, .panel *::before, .panel *::after { box-sizing: border-box; }
.panel { --sidebar-width: 244px; }
.panel[data-sidebar-open="false"] { --sidebar-width: 68px; }
.panel .app-workspace { min-width: 0; margin-left: var(--sidebar-width); }
.panel main { max-width: 1440px; padding: 0 28px; margin: 28px auto; }
.panel .topbar { height: 64px; justify-content: flex-end; padding: 0 28px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.topbar .logout-button { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-dark); font-weight: 700; }
.topbar .logout-button:hover { background: #fff1f1; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 40; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.sidebar-heading { min-height: 80px; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 14px; }
.sidebar-brand { color: var(--brand-dark); font-size: 18px; font-weight: 900; text-decoration: none; line-height: 1.3; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.icon-button { width: 36px; height: 36px; padding: 8px; flex-shrink: 0; background: transparent; border: 1px solid var(--line); }
.icon-button:hover { background: #fff1f1; }
.sidebar-open-icon { display: none; }
.sidebar-navigation { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 16px; }
.sidebar-group + .sidebar-group { margin-top: 24px; }
.sidebar-group-title { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 10px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 10px; margin-top: 3px; border-radius: 6px; text-decoration: none; color: #464b53; font-size: 14px; font-weight: 700; }
.sidebar-link:hover { background: #f3f4f6; }
.sidebar-link.is-active { background: #fff0f0; color: var(--brand-dark); box-shadow: inset 3px 0 var(--brand); }
.sidebar-link.is-active .icon { filter: invert(15%) sepia(87%) saturate(5689%) hue-rotate(358deg) brightness(79%) contrast(117%); }
.sidebar-subnav { margin: 4px 0 8px 42px; padding-left: 10px; border-left: 1px solid var(--line); }
.sidebar-sublink { display: block; padding: 7px 10px; border-radius: 6px; color: #5c6673; text-decoration: none; font-size: 13px; font-weight: 700; }
.sidebar-sublink:hover { background: #f3f4f6; }
.sidebar-sublink.is-active { color: var(--brand-dark); background: #fff7f7; }
.sidebar-account { border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 16px; min-width: 0; }
.account-initial { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; background: #f3f4f6; border-radius: 6px; color: var(--brand-dark); font-weight: 900; }
.sidebar-account .sidebar-label { min-width: 0; }
.sidebar-account strong, .sidebar-account .sidebar-label > span { display: block; overflow-wrap: anywhere; font-size: 13px; }
.sidebar-account .sidebar-label > span { color: var(--muted); margin-top: 3px; }
[data-sidebar-open="false"] .sidebar-brand, [data-sidebar-open="false"] .sidebar-group-title { display: none; }
[data-sidebar-open="false"] .sidebar-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-sidebar-open="false"] .sidebar-subnav { display: none; }
[data-sidebar-open="false"] .sidebar-heading { padding-inline: 16px; }
[data-sidebar-open="false"] .sidebar-navigation { padding-inline: 12px; }
[data-sidebar-open="false"] .sidebar-link { justify-content: center; }
[data-sidebar-open="false"] .sidebar-close-icon { display: none; }
[data-sidebar-open="false"] .sidebar-open-icon { display: block; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100%; border-radius: 0; background: rgb(0 0 0 / 32%); padding: 0; }
.panel h1 { font-size: 28px; line-height: 1.25; margin: 0 0 10px; overflow-wrap: anywhere; }
.panel h2 { font-size: 19px; line-height: 1.35; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-heading p { margin: 0; }
.period-filter { margin-bottom: 24px; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.filter-title { display: block; font-size: 13px; margin-bottom: 10px; }
.period-options { display: flex; gap: 4px; flex-wrap: wrap; }
.period-option { position: relative; display: inline-flex; margin: 0; }
.period-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.period-option span { padding: 9px 13px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 14px; }
.period-option input:checked + span { color: var(--brand-dark); background: #fff0f0; border-color: var(--brand); }
.period-option input:focus-visible + span, .panel :is(a, button, input, select):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.date-range, .smooth-daterange { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; }
.date-range label, .smooth-date { margin: 0; width: 190px; }
.filter-form { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; margin-bottom: 14px; }
.filter-fields label { margin: 0; font-size: 14px; }
.filter-fields input, .filter-fields select, .date-range input, .smooth-date input { display: block; margin-top: 7px; min-width: 0; min-height: 40px; background: #fff; color: var(--ink); }
.smooth-date { position: relative; font-size: 14px; }
.smooth-date input[type="date"] { padding-right: 38px; cursor: pointer; }
.smooth-date::after { content: ""; position: absolute; right: 12px; bottom: 11px; width: 16px; height: 16px; border: 2px solid var(--muted); border-top-width: 5px; border-radius: 4px; pointer-events: none; opacity: .8; }
.smooth-date:focus-within::after { border-color: var(--brand); }
.smooth-daterange { grid-column: 1 / -1; margin-top: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.smooth-daterange .smooth-date { flex: 1 1 190px; }
.filter-errors { padding: 12px 16px; margin-bottom: 16px; background: #fff1f1; border-left: 3px solid var(--brand); color: var(--brand-dark); }
.filter-errors p { margin: 4px 0; }
.auth-field-error { display: block; margin: 7px 0 0; color: var(--brand-dark); font-size: 13px; line-height: 1.5; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; }
.metric-card { padding: 18px; }
.metric-label { font-size: 13px; color: #565c66; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.metric-value { font-family: "Roboto", "Lato", sans-serif; font-size: 28px; line-height: 1.25; font-weight: 700; margin: 18px 0 8px; overflow-wrap: anywhere; }
.metric-card p { margin: 0; }
.metric-card.success { border-top: 3px solid #15803d; }
.metric-card.payout { border-top: 3px solid var(--brand); }
.metric-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.section-heading { margin: 30px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.section-heading a, .table-link { color: var(--brand-dark); font-weight: 700; font-size: 14px; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.panel table { font-size: 14px; }
.panel th { background: #f1f3f5; font-size: 12px; color: #4d535c; font-weight: 700; }
.panel th, .panel td { padding: 13px 14px; }
.panel td { overflow-wrap: anywhere; }
.table-scroll table { display: table; min-width: 720px; }
.date-cell, .amount-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.date-cell time { display: block; }
.date-cell .muted { display: block; margin-top: 3px; font-size: 12px; }
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; white-space: nowrap; font-size: 12px; font-weight: 700; background: #f1f3f5; color: #4d535c; }
.status-paid { background: #eaf7ed; color: #166534; }
.status-failed { background: #fff0f0; color: #a80000; }
.status-pending, .status-initiated { background: #fff8d9; color: #765d03; }
.empty-state { text-align: center; padding: 36px 18px !important; color: var(--muted); }
.report-empty { margin: 0; background: #fff; border: 1px solid var(--line); border-top: 0; font-size: 14px; }
.pagination { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.pagination a { color: var(--brand-dark); font-weight: 700; }
.pagination .disabled { color: var(--muted); }
.api-keys-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.api-keys-layout > section { min-width: 0; }
.api-key-form { min-width: 0; }
.compact-form { max-width: 820px; }
.api-key-edit { max-width: 820px; }
.api-key-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.api-key-fields label { margin: 0; font-size: 14px; min-width: 0; }
.api-key-fields input, .api-key-fields textarea { display: block; margin-top: 7px; background: #fff; min-width: 0; }
.api-key-fields textarea { resize: vertical; }
.api-key-full { grid-column: 1 / -1; }
.api-keys-create .api-key-fields { grid-template-columns: 1fr; }
.api-key-events { min-width: 0; border: 0; border-top: 1px solid var(--line); margin: 24px 0; padding: 12px 0 0; }
.api-key-events legend { font-weight: 700; padding: 0 10px 0 0; }
.api-key-events > p { margin: 0 0 12px; }
.api-key-event { display: flex; align-items: start; gap: 9px; margin: 12px 0; font-size: 14px; }
.api-key-event input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px; accent-color: var(--brand); }
.api-key-event > span { min-width: 0; overflow-wrap: anywhere; }
.api-key-event .muted { display: block; font-weight: 400; margin-top: 3px; }
.api-key-actions { flex-wrap: nowrap; }
.api-key-edit-link { display: inline-flex; align-items: center; justify-content: center; }
.table-scroll .api-key-table { min-width: 520px; }
.api-key-token { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.api-key-token code { word-break: normal; }
.api-key-created { justify-content: space-between; }
.api-key-copy-new { display: inline-flex; align-items: center; gap: 8px; }
.api-key-copy-new .icon { filter: brightness(0) invert(1); }
.api-key-copy-status { min-height: 20px; margin: 8px 0; }
.api-key-copy-status.error { color: var(--brand-dark); }
[data-api-key-copy][aria-busy="true"] { opacity: .6; cursor: progress; }
.key-reveal { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 10px; }
.key-reveal span { color: var(--muted); font-size: 13px; font-weight: 700; }
.key-reveal code { padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.key-reveal.secret code { background: #0b1220; color: #dbeafe; border-color: #0b1220; }
.api-key-details { max-width: 820px; margin-bottom: 16px; }
.credential-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; margin: 12px 0; }
.credential-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.credential-grid span, .credential-grid code { display: block; }
.credential-grid code { margin-top: 6px; }
.inline-warning { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.checkbox-label { display: inline-flex !important; align-items: center; gap: 9px; width: auto; }
.checkbox-label input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.provider-form { max-width: 720px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.account-card { min-width: 0; }
.account-card h2 { margin-top: 0; }
.account-form-card { max-width: 760px; }
.profile-type-options { border: 0; padding: 0; margin: 0 0 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.profile-type-options legend { width: 100%; margin-bottom: 8px; font-weight: 700; }
.profile-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 1150px) { .api-keys-layout { grid-template-columns: 1fr; } .api-keys-list { order: -1; } }
@media (max-width: 540px) { .api-key-fields { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .panel main { padding-inline: 20px; } }
@media (max-width: 760px) {
    .panel { --sidebar-width: min(268px, calc(100vw - 48px)); }
    .panel .app-workspace { margin-left: 0; }
    .panel .topbar { padding: 0 16px 0 64px; }
    .panel main { padding: 0 16px; margin: 22px auto; }
    .panel h1 { font-size: 25px; }
    .sidebar-heading { min-height: 64px; }
    [data-sidebar-open="false"] .sidebar { height: 64px; width: 64px; border: 0; background: transparent; }
    [data-sidebar-open="false"] .sidebar-heading { padding: 14px; }
    [data-sidebar-open="false"] .sidebar-navigation, [data-sidebar-open="false"] .sidebar-account { display: none; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .metric-card { padding: 14px; }
    .metric-value { font-size: 24px; }
    .metric-label { font-size: 12px; align-items: flex-start; }
    .date-range label, .smooth-date { width: auto; flex: 1 1 150px; min-width: 0; }
    .date-range button { width: 100%; }
    .key-reveal { grid-template-columns: 1fr; }
}
@media (max-width: 360px) { .metric-grid { grid-template-columns: 1fr; } }
