:root {
    --ink: #172c2b;
    --muted: #788785;
    --green: #19745b;
    --green-dark: #125840;
    --line: #e5ebe8;
    --canvas: #f6f8f7;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #98cbb6;
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: 32px;
    letter-spacing: -1.3px;
    margin-bottom: 8px;
}

h2 {
    font-size: 19px;
    letter-spacing: -0.5px;
}

small {
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--green);
    display: block;
    margin-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--green);
    color: white;
    text-align: center;
    font-size: 29px;
    line-height: 31px;
    margin-right: 11px;
}

.brand-dot {
    color: #75b99e;
}

.button {
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 43px;
    padding: 10px 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.primary {
    background: var(--green);
    color: white;
    box-shadow: 0 3px 7px #144b3510;
}

.primary:hover {
    background: var(--green-dark);
}

.dark {
    background: #253f38;
    color: white;
}

.subtle {
    color: #63746b;
    background: #fff;
    border-color: var(--line);
}

.full {
    width: 100%;
}

input,
select {
    display: block;
    width: 100%;
    height: 44px;
    border: 1px solid #dce4df;
    border-radius: 7px;
    padding: 10px 13px;
    background: white;
    color: var(--ink);
    min-width: 0;
}

input::placeholder {
    color: #a0aaa5;
}

label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
}

.notice {
    background: #edf6f0;
    color: #296044;
    border: 1px solid #d2e7d8;
    padding: 13px 15px;
    border-radius: 8px;
    margin: 14px 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.notice.error {
    background: #fff1ee;
    color: #a24432;
    border-color: #f0d5cd;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 46% 54%;
    background: #fff;
}

.login-story {
    background: #153e32;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 48px 10%;
    position: relative;
    overflow: hidden;
}

.login-story:after {
    content: "";
    position: absolute;
    width: 550px;
    height: 550px;
    border: 1px solid #ffffff10;
    border-radius: 50%;
    bottom: -350px;
    left: -180px;
    box-shadow: 0 0 0 70px #ffffff03,
    0 0 0 140px #ffffff03;
    pointer-events: none;
}

.login-story .brand-mark {
    background: #dceae0;
    color: #154a36;
}

.story-copy {
    margin: auto 0;
    padding: 75px 0;
}

.story-copy .eyebrow {
    color: #99c6b3;
}

.story-copy h1 {
    font-size: clamp(28px, 3vw, 45px);
    line-height: 1.4;
    letter-spacing: -1.7px;
    margin: 24px 0;
}

.story-copy p {
    color: #abc5b9;
    line-height: 1.9;
    font-size: 16px;
}

.story-line {
    width: 50px;
    height: 2px;
    background: #86b79f;
    margin: 35px 0;
}

.story-steps {
    display: flex;
    gap: 22px;
    font-size: 12px;
    color: #c0d2c9;
}

.login-story > small {
    color: #93afa2;
    font-size: 11px;
}

.login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 70px 35px;
}

.login-box {
    width: 100%;
    max-width: 370px;
}

.login-box h2 {
    font-size: 29px;
    margin: 13px 0 8px;
}

.login-form {
    margin-top: 32px;
}

.login-form input {
    margin-bottom: 22px;
    height: 48px;
}

.login-form .button {
    height: 49px;
    margin-top: 5px;
    justify-content: space-between;
}

.login-help {
    margin-top: 24px;
    color: #8a968e;
    font-size: 12px;
    text-align: center;
}

.login-footer {
    position: absolute;
    bottom: 28px;
    color: #9aa49e;
    font-size: 11px;
}

.workspace {
    display: flex;
    background: var(--canvas);
    min-height: 100vh;
}

.sidebar {
    width: 218px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 30px 22px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
}

.sidebar .brand {
    padding-left: 10px;
}

.nav-label {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #a4afa9;
    margin: 58px 14px 15px;
}

.nav-item {
    border-radius: 8px;
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    gap: 13px;
    align-items: center;
}

.nav-item span {
    font-size: 22px;
    line-height: 20px;
}

.nav-item.active {
    background: #eaf3ee;
    color: var(--green);
}

.sidebar-bottom {
    margin-top: auto;
    font-size: 11px;
    color: #718478;
    padding: 14px 9px;
}

.sidebar-bottom small {
    display: block;
    font-size: 10px;
    color: #a3afa8;
    padding: 8px 15px;
}

.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #79a890;
    margin-right: 6px;
}

.workspace-main {
    min-width: 0;
    width: calc(100% - 218px);
    margin-left: 218px;
}

.topbar {
    height: 78px;
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #86938c;
    font-size: 12px;
}

.topbar strong {
    color: #536459;
    font-weight: 500;
}

.breadcrumb {
    padding: 0 15px;
    color: #c3cbc7;
}

.account {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #455b4f;
    min-width: 0;
}

.account > span:nth-child(2) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar {
    display: grid;
    place-items: center;
    background: #eef3ee;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.role {
    border: 1px solid #e2e8e3;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    color: #839286;
}

.text-button {
    background: none;
    border: 0;
    color: #87978b;
    font-size: 11px;
    border-left: 1px solid var(--line);
    margin-left: 6px;
    padding-left: 15px;
}

.content {
    max-width: 1440px;
    margin: auto;
    padding: 43px 40px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.page-heading p {
    margin-bottom: 0;
    font-size: 13px;
}

.page-heading .eyebrow {
    font-size: 10px;
    margin-bottom: 9px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
}

.summary-card > span {
    font-size: 12px;
    color: #687d70;
}

.summary-card > strong {
    display: block;
    font-size: 29px;
    letter-spacing: -0.7px;
    margin: 13px 0 6px;
    font-variant-numeric: tabular-nums;
}

.summary-card strong small {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 6px;
    color: #6b7e71;
}

.summary-card p {
    font-size: 11px;
    color: #9ba69f;
    margin-bottom: 0;
}

.amber {
    color: #ab8037;
}

.list-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-title {
    padding: 23px 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title h2 {
    font-size: 16px;
    margin: 0;
}

.panel-title h2 span {
    font-size: 11px;
    background: #edf3ef;
    color: #689178;
    border-radius: 5px;
    padding: 3px 7px;
    margin-left: 6px;
}

.compact {
    font-size: 10px;
}

.filters {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 24px 25px;
}

.filters > div {
    min-width: 0;
}

.filters input {
    height: 40px;
    font-size: 12px;
    max-width: 185px;
}

.filters label {
    font-size: 11px;
    color: #7c8c82;
    margin-bottom: 6px;
    font-weight: 500;
}

.filters .button {
    min-height: 40px;
    height: 40px;
    padding: 8px 18px;
    font-size: 12px;
}

.filter-name {
    flex: 1;
    max-width: 250px;
}

.filter-name input {
    max-width: none;
}

.date-divider {
    padding-bottom: 10px;
    color: #9aa69f;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    white-space: nowrap;
}

thead {
    background: #f7f9f7;
    border-top: 1px solid #edf0ed;
    border-bottom: 1px solid #edf0ed;
}

th {
    font-size: 11px;
    font-weight: 500;
    color: #7e8c83;
    padding: 13px 17px;
}

td {
    padding: 18px 17px;
    font-size: 12px;
    border-bottom: 1px solid #f0f3f0;
}

th:first-child,
td:first-child {
    padding-left: 25px;
}

th:last-child,
td:last-child {
    padding-right: 25px;
}

.table-sub {
    display: block;
    font-size: 10px;
    color: #99a39c;
    margin-top: 5px;
}

.mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.25px;
}

.align-right {
    text-align: right;
}

.amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.currency {
    font-size: 10px;
    font-weight: 400;
    color: #8a958d;
}

.badge {
    display: inline-block;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
}

.SUCCESS {
    background: #edf6ee;
    color: #4b845c;
}

.FAILED {
    background: #fff0ec;
    color: #b2654d;
}

.UNKNOWN,
.SUBMITTED {
    background: #fcf5e5;
    color: #a3813a;
}

.refresh-button {
    border: 1px solid #e1e8e1;
    color: #5d7965;
    background: white;
    border-radius: 5px;
    font-size: 10px;
    padding: 6px 8px;
}

.empty-state {
    text-align: center;
    padding: 68px 20px !important;
}

.empty-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: #f0f5f0;
    border-radius: 14px;
    color: #8caf97;
    font-size: 25px;
    margin: 0 auto 16px;
}

.empty-state h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #6c8172;
}

.empty-state p {
    font-size: 11px;
    color: #9caaa0;
    margin: 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 25px;
    font-size: 11px;
    color: #8b998e;
}

.pagination strong {
    color: #637b69;
    font-weight: 500;
}

.pagination > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination a {
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.current-page {
    background: #edf3ed;
    color: #4c7b59;
    padding: 3px 9px;
    border-radius: 4px;
}

.bottom-note {
    font-size: 11px;
    color: #95a398;
    margin: 18px 3px;
}

.list-panel > .notice {
    margin: 0 25px 15px;
}

dialog {
    border: 0;
    border-radius: 18px;
    padding: 30px;
    width: min(460px, calc(100% - 30px));
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 90px #102c2833;
    color: var(--ink);
}

dialog::backdrop {
    background: #132b245c;
    backdrop-filter: blur(3px);
}

.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dialog-heading h2 {
    font-size: 23px;
    margin-bottom: 10px;
}

.dialog-heading .eyebrow {
    font-size: 9px;
    margin-bottom: 7px;
}

.close-button {
    border: 0;
    background: transparent;
    font-size: 25px;
    color: #809386;
    padding: 0 3px;
}

.dialog-description {
    font-size: 12px;
    margin-bottom: 25px;
}

.field {
    margin-bottom: 18px;
}

.field small {
    display: block;
    margin-top: 7px;
    font-size: 10px;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.input-unit {
    position: relative;
}

.input-unit input {
    padding-right: 68px;
}

.input-unit > span {
    position: absolute;
    right: 15px;
    top: 12px;
    color: #96a398;
    font-size: 12px;
}

.confirmation {
    background: #f1f7f1;
    border: 1px solid #dce9dc;
    border-radius: 9px;
    padding: 17px;
    margin: 15px 0;
}

.confirmation > span {
    font-size: 11px;
    color: #5d8265;
}

.confirmation strong {
    display: block;
    font-size: 27px;
    color: var(--green);
    margin: 5px 0;
}

.confirmation p {
    font-size: 11px;
    margin-bottom: 7px;
}

.confirmation small {
    color: #839b86;
    font-size: 10px;
}

.dialog-actions {
    margin-top: 23px;
}

.error-page {
    background: var(--canvas);
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 30px;
}

.error-page h1 {
    font-size: 26px;
}

.error-page .login-box {
    max-width: 500px;
}

.error-page .button {
    margin-top: 20px;
}

@media (min-width: 1500px) {
    .content {
        padding-top: 52px;
    }

    .summary-card {
        padding: 28px 30px;
    }
}

@media (max-width: 1150px) {
    .sidebar {
        width: 180px;
        padding: 28px 16px;
    }

    .workspace-main {
        margin-left: 180px;
        width: calc(100% - 180px);
    }

    .content {
        padding: 30px 24px;
    }

    .topbar {
        padding: 0 24px;
    }

    .filters {
        flex-wrap: wrap;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-card > strong {
        font-size: 24px;
    }

    .filter-name {
        flex-basis: 100%;
        max-width: none;
    }

    .filters .filter-name input {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-story {
        padding: 22px 25px;
        min-height: 0;
    }

    .story-copy,
    .login-story > small {
        display: none;
    }

    .login-main {
        padding: 48px 25px 80px;
        min-height: calc(100vh - 85px);
    }

    .workspace {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        padding: 12px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .sidebar .brand {
        grid-column: 1 / -1;
        padding: 0 0 8px;
        font-size: 24px;
    }

    .sidebar .brand-mark {
        width: 30px;
        height: 30px;
        font-size: 25px;
        line-height: 28px;
    }

    .nav-label,
    .sidebar-bottom {
        display: none;
    }

    .nav-item {
        font-size: 12px;
        padding: 10px 6px;
        min-height: 44px;
        justify-content: center;
        text-align: center;
        gap: 4px;
    }

    .nav-item span {
        display: none;
    }

    .workspace-main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        min-height: 60px;
        height: auto;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .topbar > span {
        font-size: 11px;
    }

    .breadcrumb {
        padding: 0 6px;
    }

    .account {
        font-size: 11px;
        gap: 6px;
    }

    .account > span:nth-child(2) {
        max-width: 110px;
    }

    .content {
        padding: 27px 16px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
        margin-bottom: 22px;
    }

    h1 {
        font-size: 27px;
    }

    .page-heading .button {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-bottom: 22px;
    }

    .summary-card {
        padding: 15px 17px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0 10px;
    }

    .summary-card > strong {
        font-size: 22px;
        margin: 0;
        grid-column: 2;
        grid-row: 1/3;
    }

    .summary-card > p {
        font-size: 10px;
    }

    .panel-title {
        padding: 19px 15px 0;
    }

    .panel-title > .compact {
        display: none;
    }

    .filters {
        padding: 20px 15px;
        gap: 10px;
    }

    .filters > div:not(.filter-name) {
        flex: 1;
        min-width: 105px;
    }

    .filters input {
        max-width: none;
    }

    .filter-name {
        flex-basis: 100%;
    }

    .date-divider {
        display: none;
    }

    .filters .button {
        flex: 1;
    }

    .pagination {
        padding: 16px 15px;
        gap: 10px;
        font-size: 10px;
    }

    .bottom-note {
        font-size: 10px;
        line-height: 1.8;
    }

    .empty-state {
        white-space: normal;
        min-width: 250px;
    }

    .empty-state p {
        max-width: 210px;
        margin: auto;
    }

    dialog {
        padding: 24px;
    }

    .summary-card strong small {
        font-size: 11px;
    }
}

@media (max-width: 760px) {
    table:has(.empty-state) {
        table-layout: fixed;
        white-space: normal;
    }

    table:has(.empty-state) thead {
        display: none;
    }

    table:has(.empty-state) .empty-state {
        min-width: 0;
    }
}

.balance-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.balance-panel .panel-title {
    padding: 23px 25px;
    gap: 14px;
}

.balance-panel .eyebrow {
    font-size: 9px;
    margin-bottom: 5px;
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 23px 25px 10px;
}

.balance-grid span {
    display: block;
    color: #70877a;
    font-size: 12px;
}

.balance-grid strong {
    display: block;
    font-size: 24px;
    margin-top: 7px;
    font-variant-numeric: tabular-nums;
}

.balance-status,
.balance-help {
    margin: 7px 25px;
    font-size: 11px;
    color: #66806f;
}

.balance-status.error {
    color: #a06e2e;
}

.balance-help {
    color: #82958a;
}

@media (max-width: 760px) {
    .balance-panel .panel-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .balance-panel .button {
        font-size: 11px;
        min-height: 36px;
    }

    .balance-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px 15px 10px;
    }

    .balance-grid > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .balance-grid strong {
        font-size: 20px;
        margin: 0;
    }

    .balance-status,
    .balance-help {
        margin: 7px 15px;
    }
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.admin-card {
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card h2 {
    margin-bottom: 20px;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-form label {
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.admin-form input,
.admin-form select,
.admin-assignment select {
    width: 100%;
    min-height: 42px;
    padding: 10px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: white;
    color: #263248;
}

.admin-assignment {
    display: flex;
    gap: 8px;
    min-width: 240px;
}

.admin-notice {
    padding: 16px;
    border-radius: 10px;
    background: #eaf6f0;
    overflow-wrap: anywhere;
}

.admin-error {
    background: #fff0ed;
    color: #a33223;
}

.serial-number {
    font-family: monospace;
    overflow-wrap: anywhere;
    max-width: 210px;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-form .checkbox-label input {
    width: 16px;
    min-height: 16px;
}

.retry-button {
    border: 1px solid #d6dedb;
    border-radius: 6px;
    padding: 6px 10px;
    background: white;
    color: #1d7059;
    cursor: pointer;
}

.retry-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.failure-reason {
    white-space: normal;
    max-width: 320px;
    color: #ad3d30;
}

#account-edit-dialog {
    width: min(480px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0;
}

#account-edit-dialog::backdrop {
    background: rgb(20 40 35 / 35%);
}

/* Shared form sizing keeps registration compact while tables use the full panel. */
.registration-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 880px;
    align-items: start;
    gap: 18px 24px;
}

.registration-form > p,
.registration-form > .checkbox-label,
.registration-form > [data-webhook-field] {
    grid-column: 1 / -1;
}

.registration-form > .button {
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 144px;
}

.registration-form > p {
    margin: 0;
    font-size: 12px;
}

.admin-form > label {
    margin-bottom: 0;
    min-width: 0;
}

.admin-form .checkbox-label {
    min-height: 44px;
}

.admin-form .checkbox-label input {
    height: 18px;
    min-height: 18px;
    width: 18px;
    flex: 0 0 18px;
    padding: 0;
    accent-color: var(--green);
}

.admin-card {
    background: white;
    border-color: var(--line);
    min-width: 0;
}

.admin-card > .muted {
    font-size: 12px;
    margin: 16px 0 0;
}

.admin-card > h2 + .muted {
    margin: 0 0 20px;
}

.admin-grid > .admin-form {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 0;
    background: var(--canvas);
}

.admin-grid > .admin-form > .button {
    justify-self: start;
}

.admin-assignment {
    max-width: 360px;
    align-items: center;
}

.admin-assignment .button {
    flex-shrink: 0;
}

.admin-assignment select {
    min-width: 180px;
}

.serial-number {
    white-space: normal;
    min-width: 150px;
}

.table-scroll {
    max-width: 100%;
    overscroll-behavior-x: contain;
}

.page-heading > div,
.summary-card {
    min-width: 0;
}

.summary-card > strong {
    overflow-wrap: anywhere;
}

.button {
    white-space: nowrap;
}

.account > span:first-child {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar {
    overflow-y: auto;
}

#account-edit-dialog .admin-card {
    margin: 0;
}

@media (min-width: 761px) and (max-width: 1100px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .nav-item {
        padding: 12px 8px;
        font-size: 12px;
    }
}

@media (max-width: 760px) {
    .admin-card {
        padding: 20px 16px;
        margin-bottom: 18px;
    }

    .admin-grid {
        gap: 14px;
    }

    .registration-form {
        gap: 16px;
    }

    input,
    select,
    .filters input {
        font-size: 16px;
    }

    .refresh-button,
    .retry-button,
    .text-button,
    .pagination a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .account {
        margin-left: auto;
    }

    .account > span:first-child {
        max-width: 120px;
    }

    dialog {
        max-height: calc(100dvh - 24px);
        padding: 20px;
    }

    .close-button {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 540px) {
    .registration-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .registration-form > .button,
    .admin-grid > .admin-form > .button {
        width: 100%;
    }

    .content {
        padding: 24px 12px;
    }

    h1 {
        font-size: 25px;
    }

    .nav-item {
        font-size: 11px;
    }

    .summary-card {
        display: block;
    }

    .summary-card > strong {
        margin: 6px 0;
    }
}

.api-key-value {
    display: block;
    max-width: 250px;
    min-width: 140px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.api-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.api-state > span:first-child {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.api-state.enabled {
    color: var(--green);
}

.api-state.enabled > span:first-child {
    background: #eaf3ee;
}

.api-state.disabled {
    color: #b33d32;
}

.api-state.disabled > span:first-child {
    background: #fff0ed;
}

.merchant-edit-dialog {
    width: min(840px, calc(100% - 24px));
}

.merchant-edit-dialog > .muted {
    font-size: 12px;
}

.merchant-edit-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.merchant-edit-sections > .admin-form {
    align-content: start;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
}

.merchant-edit-sections h3,
.merchant-edit-sections p {
    margin: 0;
}

.merchant-edit-sections p {
    font-size: 12px;
    white-space: normal;
}

.merchant-edit-sections .button {
    background: var(--green);
    color: white;
}

@media (max-width: 760px) {
    .merchant-edit-sections {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .merchant-edit-sections > .admin-form {
        padding: 16px;
    }
}

/* List panels share edge-to-edge tables and aligned title/footer insets. */
.admin-list-card {
    padding: 0;
    overflow: hidden;
}

.admin-list-card > h2 {
    padding: 23px 25px;
    margin: 0;
    font-size: 16px;
}

.admin-list-card > .muted,
.admin-list-card > h2 + .muted {
    margin: 0;
    padding: 16px 25px;
}

.admin-list-card > h2 + .muted {
    padding-top: 0;
}

.admin-list-card td {
    vertical-align: middle;
}

.admin-list-card td:last-child .button {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 12px;
}

.merchant-registration {
    grid-template-columns: minmax(0, 240px) minmax(0, 260px) minmax(0, 320px);
    max-width: 852px;
    margin-inline: 0;
    gap: 16px;
}

.registration-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.registration-actions .checkbox-label {
    margin: 0;
}

.registration-actions .button {
    min-width: 144px;
}

@media (min-width: 541px) and (max-width: 1000px) {
    .merchant-registration {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .merchant-registration > label:nth-of-type(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .admin-list-card {
        padding: 0;
    }

    .admin-list-card > h2 {
        padding: 20px 16px;
    }

    .admin-list-card > .muted,
    .admin-list-card > h2 + .muted {
        padding: 16px;
    }

    .admin-list-card > h2 + .muted {
        padding-top: 0;
    }

    .admin-list-card th:first-child,
    .admin-list-card td:first-child {
        padding-left: 16px;
    }

    .admin-list-card th:last-child,
    .admin-list-card td:last-child {
        padding-right: 16px;
    }

    .admin-list-card td:last-child .button {
        min-height: 44px;
    }
}

@media (max-width: 540px) {
    .merchant-registration {
        grid-template-columns: minmax(0, 1fr);
    }

    .registration-actions {
        flex-wrap: wrap;
    }

    .registration-actions .button {
        width: 100%;
    }
}

.registration-section .admin-card > h2 {
    margin-inline: 0;
    font-size: 16px;
}

.merchant-table {
    table-layout: fixed;
    min-width: 1080px;
}

.merchant-table .col-mid {
    width: 7%;
}

.merchant-table .col-name {
    width: 14%;
}

.merchant-table .col-password {
    width: 10%;
}

.merchant-table .col-account {
    width: 17%;
}

.merchant-table .col-key {
    width: 26%;
}

.merchant-table .col-state {
    width: 8%;
}

.merchant-table .col-action {
    width: 7%;
}

.merchant-table th,
.merchant-table td {
    padding: 16px;
    line-height: 1.65;
    text-align: center;
}

.merchant-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.merchant-table td .api-key-value {
    min-width: 0;
    max-width: none;
    line-height: inherit;
}

.merchant-table tbody tr:hover {
    background: #fafcfb;
}

.merchant-table th:nth-child(7),
.merchant-table td:nth-child(7),
.merchant-table th:last-child,
.merchant-table td:last-child {
    text-align: center;
    padding-inline: 10px;
}

.merchant-table .api-state {
    white-space: nowrap;
}

.admin-list-card .merchant-table td:last-child .button {
    width: 64px;
    min-height: 40px;
    padding: 8px;
}

@media (max-width: 760px) {
    .admin-list-card .merchant-table td:last-child .button {
        min-height: 44px;
    }
}

#merchant-create-dialog {
    width: min(920px, calc(100% - 24px));
}

#merchant-create-dialog .merchant-registration {
    margin-top: 16px;
    max-width: none;
}

select,
.admin-form select,
.admin-assignment select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23536459' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
}

@media (forced-colors: active) {
    select,
    .admin-form select,
    .admin-assignment select {
        appearance: auto;
        -webkit-appearance: auto;
        background-image: none;
    }
}

.merchant-table .col-key {
    width: 22%;
}

.merchant-table .col-fee {
    width: 7%;
}

.merchant-table .fee-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#merchant-create-dialog .merchant-registration {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 540px) {
    #merchant-create-dialog .merchant-registration {
        grid-template-columns: minmax(0, 1fr);
    }
}

.merchant-table td:not(.default-value) .api-key-value {
    text-align: left;
}

/* Keep list alignment identical for HQ and merchant pages. */
.workspace .table-scroll th,
.workspace .table-scroll td {
    text-align: center;
    vertical-align: middle;
}

.table-scroll .failure-reason {
    text-align: center;
    margin-inline: auto;
}

.table-scroll .button,
.table-scroll .refresh-button,
.table-scroll .retry-button {
    min-width: 64px;
    min-height: 40px;
    justify-content: center;
}

.table-scroll td > form {
    margin: 0;
}

@media (max-width: 760px) {
    .table-scroll .button,
    .table-scroll .refresh-button,
    .table-scroll .retry-button {
        min-height: 44px;
    }
}

.balance-live-table {
    table-layout: fixed;
    min-width: 960px;
}

.balance-live-table th,
.balance-live-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.balance-live-table tbody tr {
    height: 96px;
}

.balance-live-table .table-sub {
    overflow-wrap: anywhere;
}

.balance-live-table td {
    font-variant-numeric: tabular-nums;
}

.balance-live-table .refresh-button {
    white-space: nowrap;
}

.merchant-available-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 25px;
}

.merchant-available-points strong {
    font-size: clamp(24px, 5vw, 36px);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.merchant-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 540px) {
    .merchant-settings-actions > .button {
        flex: 1;
    }
}

.filters {
    flex-wrap: wrap;
}

.all-dates-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    white-space: nowrap;
}

.all-dates-filter input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.filters select {
    min-width: 100px;
    height: 40px;
}

.list-heading-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.pagination-count {
    flex-wrap: wrap;
}

.pagination-count select {
    width: 82px;
    height: 32px;
    padding: 5px 30px 5px 10px;
    font-size: 12px;
    background-position: right 9px center;
}

@media (max-width: 760px) {
    .list-heading-actions .compact {
        display: none;
    }

    .pagination-count select {
        height: 44px;
        font-size: 16px;
        width: 90px;
    }
}

.page-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-links a,
.page-links .current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 6px 10px;
}

.page-links .current-page {
    background: var(--green);
    color: white;
    font-weight: 700;
}

@media (max-width: 760px) {
    .page-links a, .page-links .current-page {
        min-width: 40px;
        min-height: 44px;
    }
}

.money-error {
    display: block;
    color: #b42318;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 6px;
}

.money-error[hidden] {
    display: none;
}

input[data-money][aria-invalid="true"] {
    border-color: #b42318;
}

.filters .filter-name select {
    height: 40px;
    font-size: 12px;
    width: 100%;
    max-width: none;
}

.transfer-list-table thead th {
    text-align: center;
}

.transfer-list-table tbody tr:not(:has(.empty-state)) {
    height: 76px;
}

.transfer-list-table tbody td {
    vertical-align: middle;
}

.transfer-list-table tbody td:nth-last-child(-n+2) {
    text-align: center;
}

.transfer-list-table tbody td:last-child .button {
    min-height: 34px;
}

.sidebar {
    overflow-y: auto;
}

.sidebar-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-group > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #667c70;
    cursor: pointer;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group > summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s;
}

.nav-group[open] > summary::after {
    transform: rotate(45deg);
}

.nav-children {
    margin-left: 10px;
    padding-left: 8px;
    border-left: 1px solid #e1e9e4;
}

.nav-children .nav-item {
    padding: 10px 12px;
    font-size: 12px;
    min-height: 40px;
}

@media (max-width: 760px) {
    .sidebar-groups {
        grid-column: 1/-1;
        display: grid;
        grid-template-columns:repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-children {
        margin-left: 0;
        padding-left: 4px;
    }

    .nav-children .nav-item {
        justify-content: flex-start;
        text-align: left;
        padding: 8px 6px;
    }

    .nav-group > summary {
        padding: 8px 6px;
    }
}

.withdrawal-quote {
    margin: 16px 0;
    display: grid;
    gap: 10px;
}

.withdrawal-quote > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.withdrawal-quote dt {
    font-size: 13px;
    color: var(--muted);
}

.withdrawal-quote dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.withdrawal-quote .quote-total {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.withdrawal-quote .quote-total dd {
    color: var(--primary);
}
