:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #172033;
    --muted: #657083;
    --line: #dce1e8;
    --accent: #1f6feb;
    --accent-soft: #edf4ff;
    --ok: #187447;
    --bad: #a43131;
    --warn: #9a6a13;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 40px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.admin-header h1,
.payment-panel h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0;
}

.admin-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-main {
    width: min(1440px, calc(100% - 40px));
    margin: 26px auto 56px;
}

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

.grid-full {
    grid-column: 1 / -1;
}

.card,
.payment-panel,
.login-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(20, 32, 50, 0.06);
}

.card {
    padding: 24px;
}

.card h2,
.payment-panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
    letter-spacing: 0;
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.card-title h2 {
    margin: 0;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

code,
pre {
    font-family: Consolas, Monaco, monospace;
}

pre {
    overflow: auto;
    padding: 14px;
    background: #101828;
    color: #e7edf8;
    border-radius: 6px;
    font-size: 12px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-paid {
    background: #e8f6ef;
    color: var(--ok);
}

.status-failed {
    background: #faecec;
    color: var(--bad);
}

.status-pending {
    background: #fff5db;
    color: var(--warn);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.button.primary,
button.success {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

button.danger {
    border-color: var(--bad);
    background: var(--bad);
    color: #ffffff;
}

.button.secondary {
    background: #f8fafc;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #b7d6ef;
    border-radius: 6px;
    background: #eff7ff;
}

.notice.error {
    border-color: #efb7b7;
    background: #fff0f0;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    white-space: normal;
}

.empty-state strong {
    color: var(--text);
    font-size: 16px;
}

.details {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 14px;
    margin: 0;
}

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

.details dd {
    margin: 0;
}

.status-form {
    margin-top: 22px;
}

.email-panel {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.email-panel textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.email-panel .button { justify-self: start; }
.email-log { display: block; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.email-component-warning { margin-top: 14px; }

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.actions form {
    margin: 0;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 14px;
}

.account-form {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.account-form > button {
    align-self: end;
    justify-self: start;
}

.create-form {
    grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
}

.quick-grid,
.guide-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.quick-card,
.guide-panel > div {
    display: grid;
    gap: 6px;
    min-height: 94px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 8px 20px rgba(20, 32, 50, 0.04);
}

.quick-card:hover {
    text-decoration: none;
    border-color: #9dc4ff;
    background: var(--accent-soft);
}

.quick-card strong,
.guide-panel strong {
    color: var(--text);
    font-size: 16px;
}

.quick-card span,
.guide-panel span {
    color: var(--muted);
}

.muted-card {
    background: #fbfcfe;
}

.merchant-card {
    margin-top: 18px;
}

.merchant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.merchant-head h2 {
    margin: 0 0 8px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3f5f8;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tag-ok {
    background: #e8f6ef;
    color: var(--ok);
}

.tag-bad {
    background: #faecec;
    color: var(--bad);
}

.merchant-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.authorized-sites {
    min-width: 0;
    padding: 15px;
    border: 1px solid #dce7dc;
    border-radius: 8px;
    background: #fbfdf9;
}

.site-card-heading,
.site-row,
.site-add-form,
.site-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-card-heading { justify-content: space-between; }
.site-card-heading span,
.authorized-sites p { color: var(--muted); font-size: 12px; }
.authorized-sites p { margin: 6px 0 10px; }
.site-list { display: grid; gap: 7px; }
.site-row { min-width: 0; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid #edf0eb; }
.site-url { min-width: 0; flex: 1 1 190px; color: #2d4c3b; font-size: 12px; overflow-wrap: anywhere; }
.site-actions { margin-left: auto; }
.site-actions .text-button { min-height: 0; padding: 2px 0; border: 0; background: transparent; color: #2d6a4b; font-size: 12px; }
.site-add-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf0eb; }
.site-add-form input { min-width: 0; flex: 1 1 200px; min-height: 34px; }

.routing-box {
    width: min(420px, 100%);
    padding: 16px;
    border: 1px solid #b7d6ef;
    border-radius: 8px;
    background: #eff7ff;
}

.routing-box strong {
    display: block;
    margin-bottom: 6px;
}

.routing-box p {
    margin: 0;
    color: var(--muted);
}

.sub-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 10px;
}

.sub-title h3 {
    margin: 0;
    font-size: 15px;
}

.sub-title span {
    color: var(--muted);
    font-size: 12px;
}

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

.account-empty {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px dashed #d8d0c4;
    border-radius: 8px;
    background: #fffdf9;
}

.account-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e1d9cd;
    border-radius: 8px;
    background: #fffdf9;
}

.account-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.account-kicker {
    color: #7a847b;
    font-size: 11px;
    font-weight: 700;
}

.account-card h4 {
    margin: 5px 0 4px;
    color: #273b30;
    font-size: 16px;
}

.account-ref {
    display: block;
    overflow: hidden;
    color: #7a847b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-dot {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f5e9e7;
    color: #a05045;
    font-size: 11px;
    font-weight: 700;
}

.status-dot.is-ready {
    background: #eaf4eb;
    color: #28734d;
}

.account-usage {
    display: grid;
    gap: 7px;
    margin: 16px 0;
    padding: 13px;
    border: 1px solid #eee6da;
    border-radius: 6px;
    background: #fcf8f1;
}

.usage-heading,
.usage-line,
.account-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.usage-heading span,
.usage-line span,
.account-usage small,
.key-note {
    color: #7a847b;
    font-size: 11px;
}

.usage-heading strong,
.usage-line b {
    color: #31473a;
    font-size: 12px;
}

.usage-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7e1d7;
}

.usage-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #547d60;
}

.account-limit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 9px;
}

.account-limit-form label {
    margin: 0;
    color: #627067;
    font-size: 11px;
}

.account-limit-form input,
.account-limit-form select {
    min-height: 34px;
    margin-top: 4px;
    font-size: 12px;
}

.account-limit-form .button {
    min-height: 34px;
    white-space: nowrap;
}

.account-card-foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee6da;
}

.account-card-foot form {
    margin: 0;
}

.highlight-card {
    border-color: #9dc4ff;
    background: var(--accent-soft);
}

.credentials code {
    user-select: all;
}

.back-link,
.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.public-payment {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.payment-panel {
    width: min(620px, 100%);
    padding: 30px;
}

.topline {
    margin-bottom: 10px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 6px;
}

.summary strong,
.summary span {
    display: block;
}

.summary strong {
    color: var(--muted);
    font-size: 12px;
}

.items {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.items li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.order-list-card {
    padding: 22px;
}

.order-list {
    display: grid;
    gap: 16px;
}

.order-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.order-media {
    display: grid;
    width: 132px;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}

.order-media:hover {
    text-decoration: none;
}

.order-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-content {
    min-width: 0;
}

.order-head,
.order-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.order-product {
    display: inline-block;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
}

.order-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.order-amount {
    display: grid;
    justify-items: end;
    gap: 8px;
    white-space: nowrap;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.order-info-grid div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.order-info-grid span,
.order-address span,
.order-foot {
    color: var(--muted);
    font-size: 12px;
}

.order-info-grid strong,
.order-info-grid a,
.order-info-grid em {
    display: block;
    min-width: 0;
    margin-top: 2px;
    overflow-wrap: anywhere;
    font-style: normal;
}

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

.order-address {
    padding: 12px;
    border: 1px solid #c9ddff;
    border-radius: 8px;
    background: var(--accent-soft);
}

.order-address p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: var(--text);
}

.order-foot {
    align-items: center;
    margin-top: 14px;
}

.order-foot code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.login-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-box {
    width: min(380px, 100%);
    padding: 28px;
}

.login-box h1 {
    margin: 0 0 18px;
}

.login-box button {
    width: 100%;
    margin-top: 14px;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

@media (max-width: 760px) {
    .admin-header,
    .summary,
    .quick-grid,
    .guide-panel,
    .grid,
    .order-card,
    .order-info-grid,
    .order-addresses,
    .merchant-grid,
    .merchant-head,
    .inline-form,
    .account-form,
    .create-form {
        grid-template-columns: 1fr;
    }

    .admin-header {
        display: grid;
        padding: 22px 18px;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .merchant-head {
        display: grid;
    }

    .order-media {
        width: 100%;
        max-width: 180px;
    }

    .order-head,
    .order-foot {
        display: grid;
        justify-items: start;
    }

    .order-amount {
        justify-items: start;
    }
}

.export-form { display: grid; gap: 14px; }
.export-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; }
.export-filter-grid label { margin: 0; color: #536259; font-size: 11px; }
.export-filter-grid input, .export-filter-grid select { min-height: 38px; margin-top: 5px; border-color: #ded8ce; border-radius: 5px; background: #fffdf9; }
.export-search { grid-column: span 2; }
.field-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.export-field-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 8px; }
.field-option { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; padding: 8px 10px; border: 1px solid #e3ddd3; border-radius: 5px; background: #fffdf9; color: #45534a; }
.field-option input { width: 16px; height: 16px; margin: 0; }
.export-submit-bar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #d8d5cc; border-radius: 8px; background: #fffaf3; box-shadow: 0 8px 24px rgba(52, 48, 39, .14); }
.export-submit-bar strong, .export-submit-bar span { display: block; }
.export-submit-bar span { margin-top: 3px; color: #788278; font-size: 11px; }
@media (max-width: 1120px) { .export-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); } .export-field-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 760px) { .export-filter-grid, .export-field-grid { grid-template-columns: 1fr; } .export-search { grid-column: auto; } .export-submit-bar { position: static; display: grid; } }
.order-tools-link { margin: -8px 0 14px; text-align: right; }
.trash-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.trash-filters { display: grid; grid-template-columns: minmax(220px,2fr) repeat(3,minmax(150px,1fr)) auto auto; align-items: end; gap: 10px; }
.trash-filters label { margin: 0; color: #536259; font-size: 11px; }
.trash-filters input, .trash-filters select { min-height: 36px; margin-top: 4px; border-color: #ded8ce; border-radius: 5px; background: #fffdf9; }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e3ddd3; }
.bulk-toolbar label { margin: 0; }
.button.danger { border-color: #a63f3a; background: #a63f3a; color: #fff; }
.trash-table { min-width: 850px; }
.trash-table th:nth-child(1), .trash-table td:nth-child(1) { width: 5%; }
.trash-table th:nth-child(2), .trash-table td:nth-child(2) { width: 14%; }
.trash-table th:nth-child(3), .trash-table td:nth-child(3) { width: 25%; }
.trash-table th:nth-child(4), .trash-table td:nth-child(4) { width: 22%; }
.trash-table th:nth-child(5), .trash-table td:nth-child(5) { width: 15%; }
.trash-table th:nth-child(6), .trash-table td:nth-child(6) { width: 19%; }
@media (max-width: 900px) { .trash-filters { grid-template-columns: 1fr 1fr; } .bulk-toolbar { align-items: flex-start; flex-wrap: wrap; } }

/* Operations dashboard */
.app-body {
    background: #f5efe5;
    color: #26322b;
}

.app-shell {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 22px 16px;
    background: #20332a;
    color: #edf5ee;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 16px;
    color: #fff8ec;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-brand:hover { text-decoration: none; }
.app-brand strong, .app-brand small { display: block; }
.app-brand strong { font-size: 16px; }
.app-brand small { margin-top: 2px; color: #a7c1ad; font-size: 9px; font-weight: 700; }

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: #d27745;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.sidebar-nav { display: grid; gap: 4px; }
.nav-caption { margin: 14px 9px 5px; color: #9cb2a2; font-size: 11px; font-weight: 700; }
.nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 8px 10px; border-radius: 6px; color: #dbe8dd; font-size: 13px; }
.nav-link:hover, .nav-link.active { background: #304c3e; color: #ffffff; text-decoration: none; }
.nav-link b { display: grid; min-width: 21px; height: 20px; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; }
.sidebar-user { margin-top: auto; padding: 12px; border-radius: 7px; background: rgba(255, 255, 255, .07); }
.sidebar-user span, .sidebar-user strong { display: block; }
.sidebar-user span { color: #9cb2a2; font-size: 11px; }
.sidebar-user strong { margin-top: 3px; color: #fff; font-size: 13px; }

.workspace { min-width: 0; padding: 20px 24px 40px; }
.workspace .admin-main { width: 100%; margin: 18px 0 0; }
.merchant-header { align-items: flex-start; }
.merchant-workspace .guide-panel { margin-bottom: 16px; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.workspace-header h1 { margin: 0; color: #24342b; font-size: 26px; }
.eyebrow { margin: 0 0 4px; color: #748177; font-size: 11px; font-weight: 700; }
.header-summary { padding: 10px 14px; border: 1px solid #dddfd7; border-radius: 7px; background: rgba(255, 255, 255, .6); }
.header-summary span, .header-summary strong { display: block; }
.header-summary span { color: #788278; font-size: 11px; }
.header-summary strong { margin-top: 2px; color: #375b45; }

.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric-card { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid #e2ddd4; border-radius: 8px; background: #fffaf3; color: #526056; }
.metric-card:hover { border-color: #cab196; text-decoration: none; }
.metric-card strong { color: #2a3e32; font-size: 22px; }
.metric-card.warning strong { color: #a36823; }
.metric-card.success strong { color: #28734d; }
.metric-card.danger strong { color: #a84c43; }

.filter-panel, .data-panel { border: 1px solid #e0d9ce; border-radius: 9px; background: rgba(255, 252, 246, .96); box-shadow: 0 8px 24px rgba(79, 61, 38, .06); }
.filter-panel { margin-bottom: 12px; padding: 13px 15px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-heading h2 { margin: 0; color: #26382d; font-size: 15px; }
.panel-heading span { color: #7b817a; font-size: 12px; }
.order-filters { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; }
.order-filters label { margin: 0; color: #536259; font-size: 11px; }
.order-filters input, .order-filters select { min-height: 36px; margin-top: 4px; border-color: #ded8ce; border-radius: 5px; background: #fffdf9; font-size: 13px; }
.filter-actions { display: flex; gap: 7px; }
.filter-actions .button { min-height: 36px; white-space: nowrap; }
.button.primary { border-color: #315f45; background: #315f45; }
.button.primary:hover { background: #244c36; }

.data-panel { overflow: hidden; }
.table-heading { padding: 13px 16px 10px; margin: 0; border-bottom: 1px solid #e6e0d6; }
.table-count { padding: 4px 8px; border-radius: 999px; background: #edf3eb; color: #497157 !important; font-weight: 700; }
.data-table-wrap { overflow-x: auto; }
.operations-table { width: 100%; min-width: 1080px; table-layout: fixed; background: #fffdf9; }
.operations-table th { padding: 11px 14px; color: #888174; background: #faf5ec; font-size: 11px; text-transform: none; white-space: nowrap; }
.operations-table td { padding: 9px 10px; color: #4a544d; font-size: 12px; vertical-align: middle; white-space: normal; }
.operations-table tbody tr:hover { background: #fcf7ef; }
.operations-table a { color: #2c6a48; }
.operations-table strong, .operations-table span, .operations-table a { overflow-wrap: anywhere; }
.operations-table .order-meta { display: block; margin-top: 3px; color: #758177; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cell-time strong, .cell-time span, .cell-order strong, .cell-order span, .cell-customer strong, .cell-customer a, .cell-payment strong, .cell-account span { display: block; }
.cell-time { white-space: nowrap !important; }
.cell-time span, .cell-order span, .cell-product span, .cell-customer a, .cell-address span, .cell-account span { margin-top: 3px; color: #80877f; font-size: 11px; line-height: 1.35; }
.operations-table th:nth-child(1), .operations-table td:nth-child(1) { width: 8%; }
.operations-table th:nth-child(2), .operations-table td:nth-child(2) { width: 17%; }
.operations-table th:nth-child(3), .operations-table td:nth-child(3) { width: 20%; }
.operations-table th:nth-child(4), .operations-table td:nth-child(4) { width: 14%; }
.operations-table th:nth-child(5), .operations-table td:nth-child(5) { width: 18%; }
.operations-table th:nth-child(6), .operations-table td:nth-child(6) { width: 9%; }
.operations-table th:nth-child(7), .operations-table td:nth-child(7) { width: 10%; }
.operations-table th:nth-child(8), .operations-table td:nth-child(8) { width: 4%; }

.cell-order { width: auto; }
.cell-order a { font-size: 13px; }
.cell-product { width: auto; }
.product-cell { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 9px; }
.product-cell img, .product-placeholder { width: 42px; height: 42px; border: 1px solid #e1dbd0; border-radius: 5px; object-fit: cover; }
.product-placeholder { display: grid; place-items: center; background: #f6f0e7; color: #9a9387; font-size: 10px; }
.cell-product strong, .cell-address span, .cell-customer a, .cell-account span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.cell-order strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-customer { width: auto; }
.cell-address { width: auto; }
.cell-payment { width: auto; }
.cell-payment .status { margin-top: 5px; min-height: 20px; padding: 2px 7px; font-size: 10px; }
.cell-account { width: auto; }
.cell-action { width: auto; }
.cell-action .button { min-height: 30px; padding: 5px 9px; font-size: 11px; }

@media (max-width: 1120px) {
    .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
    .workspace { padding: 22px 18px 36px; }
    .order-filters { grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(130px, 1fr)); }
    .account-grid { grid-template-columns: 1fr; }
    .account-form { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { gap: 10px; padding: 13px; }
    .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-caption, .sidebar-user { display: none; }
    .nav-link { padding: 7px; font-size: 12px; }
    .workspace { padding: 18px 12px 28px; }
    .workspace-header, .metric-row, .order-filters { display: grid; grid-template-columns: 1fr; }
    .header-summary { display: none; }
    .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .merchant-grid, .account-limit-form, .account-form { grid-template-columns: 1fr; }
    .account-form > button { justify-self: stretch; }
}
