:root {
    color-scheme: light;
    --navy: #0b1f33;
    --navy-2: #102d49;
    --cyan: #19b8a8;
    --cyan-dark: #0e8d82;
    --blue: #2d6cdf;
    --ink: #172638;
    --muted: #6c7b8b;
    --line: #dce4ec;
    --surface: #fff;
    --canvas: #f3f6f9;
    --danger: #c43b4d;
    --warning: #d58a1f;
    --shadow: 0 12px 36px rgba(20, 39, 61, .09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { overflow-x: hidden; margin: 0; font: 14px/1.55 "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--ink); background: radial-gradient(circle at 100% 0, rgba(25,184,168,.06), transparent 28%), var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: radial-gradient(circle at 75% 18%, rgba(25,184,168,.22), transparent 34%), linear-gradient(135deg, #061525, #0d2944 58%, #113b55); }
.login-card { width: min(440px, 100%); padding: 38px; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(7,24,40,.78); box-shadow: 0 30px 80px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.login-card h1 { margin: 12px 0 6px; font-size: 29px; }
.login-card p { margin: 0 0 25px; color: #b7c8d8; }
.brand-chip { display: inline-block; color: #6ce2d4; font-size: 12px; font-weight: 800; letter-spacing: 2px; }
label { display: grid; gap: 7px; margin: 13px 0; font-weight: 650; color: #3c4b5b; }
.login-card label { color: #dce8f2; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--ink); border: 1px solid #cfd9e3; border-radius: 9px; outline: none; background: #fff; transition: .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(25,184,168,.13); }
.captcha-row { display: grid; grid-template-columns: 1fr 142px; gap: 10px; }
.captcha-button { overflow: hidden; height: 45px; padding: 0; border: 0; border-radius: 9px; background: #fff; }
.captcha-button img { width: 100%; height: 100%; object-fit: cover; }

button { min-height: 39px; padding: 9px 15px; border: 0; border-radius: 8px; font-weight: 700; }
button.primary, .primary { color: #fff; background: linear-gradient(135deg, var(--cyan), var(--cyan-dark)); box-shadow: 0 7px 18px rgba(14,141,130,.2); }
button.primary:hover { filter: brightness(.96); transform: translateY(-1px); }
button.ghost { color: var(--ink); border: 1px solid var(--line); background: #fff; box-shadow: none; }
button.danger { color: var(--danger); border: 1px solid #efc9cf; background: #fff7f8; }
.full { width: 100%; margin-top: 12px; }
.message { min-height: 22px; margin: 9px 0; color: var(--danger); }
.message.success { color: var(--cyan-dark); }

.shell { width: 100%; min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; color: #fff; background: radial-gradient(circle at 30% 0, rgba(67,216,198,.13), transparent 31%), linear-gradient(180deg, #0b2133, #071927); box-shadow: 6px 0 20px rgba(7,23,38,.08); }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; font-size: 18px; font-weight: 750; letter-spacing: .3px; }
.logo b { display: grid; place-items: center; width: 38px; height: 38px; color: #072033; border-radius: 11px; background: linear-gradient(135deg, #69e6d7, #35c4b3); box-shadow: 0 8px 20px rgba(49,201,182,.2); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 11px; color: #afc2d2; border-radius: 10px; text-align: left; background: transparent; transition: color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.sidebar nav button:hover { color: #fff; background: rgba(255,255,255,.065); }
.sidebar nav button.active { color: #fff; background: linear-gradient(135deg, rgba(55,204,187,.21), rgba(255,255,255,.08)); box-shadow: inset 0 0 0 1px rgba(111,230,215,.14); }
.nav-icon { display: grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px; color: #7f9cb1; }
.sidebar nav button:hover .nav-icon, .sidebar nav button.active .nav-icon { color: #60ddce; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar > .ghost { margin-top: auto; color: #ffc4cb; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.04); }

.content { min-width: 0; padding: 0 26px 38px; }
.topbar { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.topbar small { color: var(--cyan-dark); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; }
.topbar h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: -.35px; }
.operator { display: flex; align-items: center; gap: 13px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; color: #247056; background: #dff7ec; font-size: 12px; font-weight: 750; }
.badge.bad { color: #9c2737; background: #ffe4e7; }
.badge.warn { color: #89570f; background: #fff0d2; }

.panel { display: none; padding-top: 18px; }
.panel.active { display: block; }
.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-card { min-height: 106px; padding: 17px 18px; border: 1px solid #e3e9ef; border-radius: 13px; background: linear-gradient(145deg, #fff, #fbfdfd); box-shadow: 0 9px 26px rgba(20,39,61,.07); }
.summary-card span { color: var(--muted); }
.summary-card strong { display: block; margin-top: 9px; font-size: 24px; line-height: 1.25; }
.card { padding: 20px; border: 1px solid #e1e8ee; border-radius: 13px; background: var(--surface); box-shadow: 0 10px 30px rgba(20,39,61,.065); }
.card h2, .card h3 { margin: 0 0 15px; }
.card-head, .page-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-actions h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.page-actions p { margin: 6px 0 0; color: var(--muted); }
.table-card { overflow: auto; padding: 0; }
.desktop-access-intro { margin-bottom: 16px; border-left: 4px solid var(--cyan); }
.desktop-access-intro h3 { margin-bottom: 6px; }
.desktop-access-intro p { margin: 6px 0; color: var(--muted); }
.desktop-access-intro .notice { margin-top: 14px; }
.desktop-access-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.desktop-access-filter label { margin: 0; min-width: 170px; }
.desktop-access-filter label:first-child { flex: 1; max-width: 420px; }
.desktop-access-meta { color: var(--muted); }
.desktop-access-reason { display: block; min-width: 160px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
#desktop-access-table td:last-child:has(.row-actions), #desktop-access-table th:last-child { position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -3px 0 6px rgba(20,39,61,.04); }
#desktop-access-table th:last-child { background: #f7f9fb; }
.desktop-access-checkbox { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f5fbfa; }
.desktop-access-checkbox input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--cyan-dark); }
.desktop-access-checkbox small { display: block; color: var(--muted); font-weight: 400; }
.modal.desktop-devices-modal { width: min(1120px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 23px; overflow: auto; }
.desktop-device-toolbar { display: flex; align-items: flex-end; gap: 12px; margin: 16px 0; }
.desktop-device-toolbar label { flex: 1; margin: 0; }
.desktop-device-toolbar input { width: 100%; min-width: 0; }
#desktop-devices-table { overflow-x: auto; max-height: 50vh; }
@media (max-width: 600px) { .desktop-device-toolbar { flex-wrap: wrap; } .desktop-device-toolbar label { flex-basis: 100%; } }
@media (max-width: 600px) {
    .desktop-access-filter label, .desktop-access-filter label:first-child { flex: 1 1 100%; max-width: none; min-width: 0; }
    .desktop-access-filter button { flex: 1; }
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
th { position: sticky; top: 0; color: #526273; background: #f7f9fb; font-size: 12px; letter-spacing: .2px; }
tr:last-child td { border-bottom: 0; }
td .row-actions { display: flex; gap: 6px; }
.mini { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #edf2f7; }
.status.active, .status.paid, .status.success { color: #13745b; background: #dcf7ec; }
.status.published { color: #13745b; background: #dcf7ec; }
.status.pending, .status.trial, .status.grace, .status.running, .status.required { color: #9a6211; background: #fff0d0; }
.status.draft { color: #596878; background: #edf2f7; }
.status.suspended, .status.expired, .status.disabled, .status.cancelled { color: #a72d3e; background: #ffe3e7; }
.status.ended { color: #596878; background: #edf2f7; }
.status.healthy, .status.matched, .status.completed, .status.resolved { color: #13745b; background: #dcf7ec; }
.status.warning, .status.unread, .status.unreconciled, .status.requested, .status.approved, .status.read { color: #9a6211; background: #fff0d0; }
.status.critical, .status.amount_mismatch, .status.rejected, .status.failed { color: #a72d3e; background: #ffe5e8; }
.status.info { color: #2457a5; background: #e9f1ff; }

.commercial-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.commercial-section { margin-top: 16px; }
.commercial-section .card-head { align-items: flex-end; margin-bottom: 12px; }
.commercial-section .card-head h3 { margin: 0 0 4px; }
.commercial-section .card-head small { color: var(--muted); }
.operations-grid { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr); gap: 16px; }
.security-card dl, #mfa-status dl { display: grid; grid-template-columns: 100px 1fr; gap: 9px; margin: 0 0 18px; }
.security-card dt { color: var(--muted); }
.security-card dd { min-width: 0; margin: 0; }
.mfa-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.split-table { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.lifecycle-form { align-items: end; margin-bottom: 18px; padding: 16px; border: 1px solid #e4eaf0; border-radius: 12px; background: #f9fbfc; }
.lifecycle-form .modal-actions { align-self: end; }
.scope-fieldset { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 22px; min-width: 0; margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.scope-fieldset legend { padding: 0 6px; color: var(--muted); font-weight: 700; }
.scope-fieldset label { display: flex; align-items: center; gap: 7px; margin: 0; }
.scope-fieldset input { width: auto; }
.credential-result { margin-top: 16px; padding: 14px; color: #315f5b; border: 1px solid #bde9e3; border-radius: 10px; background: #edf9f7; }
.credential-result b, .credential-result code { display: block; }
.credential-result code { overflow-wrap: anywhere; margin-top: 9px; padding: 10px; color: var(--navy-2); border-radius: 7px; background: #fff; white-space: pre-wrap; user-select: all; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
.license-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 18px; }
.license-grid dl { display: grid; grid-template-columns: 110px 1fr; gap: 9px; }
.license-grid dt { color: var(--muted); }
.license-grid dd { margin: 0; word-break: break-all; }
.required-mark { margin-left: 4px; color: var(--danger); font-size: 12px; font-style: normal; font-weight: 800; }
.payment-page-heading { margin-bottom: 18px; }
.payment-status-card { overflow: hidden; margin-bottom: 18px; padding: 0; border-color: #d8e7e4; }
.payment-status-content { padding: 22px 24px; }
.payment-status-main { display: flex; align-items: center; gap: 16px; }
.payment-status-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; color: #fff; border-radius: 15px; background: linear-gradient(135deg, #1fc9ae, #0a8b7d); box-shadow: 0 9px 24px rgba(14,141,130,.22); font-size: 23px; font-weight: 850; }
.payment-status-icon.pending { color: #9a6211; background: #fff1d5; box-shadow: none; }
.payment-status-copy { min-width: 0; flex: 1; }
.payment-status-copy small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.payment-status-copy strong { display: block; margin: 2px 0 3px; font-size: 21px; }
.payment-status-copy span { color: #526273; }
.payment-ready-badge { flex: 0 0 auto; padding: 7px 12px; color: #13745b; border-radius: 999px; background: #dcf7ec; font-size: 12px; font-weight: 800; }
.payment-ready-badge.pending { color: #89570f; background: #fff0d2; }
.payment-status-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.payment-status-metric { min-width: 0; padding: 13px 15px; border: 1px solid #e6ecef; border-radius: 11px; background: #f8fafb; }
.payment-status-metric span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.payment-status-metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.payment-missing-box { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 13px; color: #8a5b16; border: 1px solid #f1d69e; border-radius: 10px; background: #fff9ed; }
.payment-missing-box b { flex: 0 0 auto; }
.payment-missing-box span { word-break: break-word; }
.payment-operation-notice { display: flex; gap: 10px; margin: 0; padding: 13px 24px; color: #315f5b; border-top: 1px solid #dcebe8; background: #f1faf8; }
.payment-operation-notice::before { content: "i"; display: grid; place-items: center; flex: 0 0 20px; height: 20px; color: #fff; border-radius: 50%; background: var(--cyan-dark); font-size: 12px; font-family: Arial, sans-serif; font-weight: 800; }
.payment-settings-form { display: grid; gap: 18px; }
.payment-config-section { padding: 24px; }
.payment-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.payment-section-heading.compact { align-items: flex-start; }
.payment-section-title { display: flex; align-items: flex-start; gap: 13px; }
.payment-section-title h3 { margin: 0 0 4px; font-size: 19px; }
.payment-section-title p { margin: 0; color: var(--muted); }
.payment-step { display: grid; place-items: center; flex: 0 0 36px; height: 36px; color: var(--cyan-dark); border: 1px solid #bfe5df; border-radius: 10px; background: #eaf8f6; font-size: 12px; font-weight: 850; letter-spacing: .5px; }
.payment-enable-switch { position: relative; display: flex; align-items: center; grid-template-columns: none; gap: 10px; min-width: 250px; margin: 0; padding: 10px 12px; border: 1px solid #dbe6e3; border-radius: 11px; background: #f8fbfa; cursor: pointer; }
.payment-enable-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-control { position: relative; flex: 0 0 42px; height: 24px; border-radius: 999px; background: #bdc8d2; transition: .2s ease; }
.switch-control i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s ease; }
.payment-enable-switch input:checked + .switch-control { background: var(--cyan-dark); }
.payment-enable-switch input:checked + .switch-control i { transform: translateX(18px); }
.payment-enable-switch input:focus-visible + .switch-control { box-shadow: 0 0 0 3px rgba(25,184,168,.18); }
.payment-enable-switch b, .payment-enable-switch small { display: block; }
.payment-enable-switch small { color: var(--muted); font-size: 11px; font-weight: 400; }
.payment-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.payment-mode-choice { position: relative; display: grid; grid-template-columns: 46px 1fr 24px; align-items: center; gap: 13px; min-height: 132px; margin: 0; padding: 18px; border: 1px solid #dce4ec; border-radius: 14px; background: #fff; cursor: pointer; transition: .18s ease; }
.payment-mode-choice:hover { border-color: #a8d7d1; box-shadow: 0 8px 20px rgba(20,39,61,.07); transform: translateY(-1px); }
.payment-mode-choice.selected { border-color: var(--cyan-dark); background: linear-gradient(135deg, #fff, #f1fbf9); box-shadow: 0 0 0 2px rgba(25,184,168,.1); }
.payment-mode-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.payment-mode-icon { display: grid; place-items: center; width: 46px; height: 46px; color: #fff; border-radius: 13px; background: linear-gradient(135deg, #21c7ae, #0d9487); font-size: 17px; font-weight: 850; }
.payment-mode-icon.api { color: #2457a5; background: #eaf1ff; font-size: 12px; }
.payment-mode-copy { min-width: 0; }
.payment-mode-copy > span { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.payment-mode-copy b { font-size: 16px; }
.payment-mode-copy small { display: block; margin: 7px 0; color: var(--muted); line-height: 1.6; font-weight: 400; }
.payment-mode-copy strong { color: var(--cyan-dark); font-size: 12px; }
.recommended-tag, .advanced-tag { padding: 2px 7px; color: #13745b; border-radius: 999px; background: #dcf7ec; font-size: 10px; font-style: normal; font-weight: 800; }
.advanced-tag { color: #2457a5; background: #e8f0ff; }
.payment-mode-check { display: grid; place-items: center; width: 22px; height: 22px; color: transparent; border: 1px solid #cbd6df; border-radius: 50%; }
.payment-mode-choice.selected .payment-mode-check { color: #fff; border-color: var(--cyan-dark); background: var(--cyan-dark); }
.payment-mode-choice input:focus-visible ~ .payment-mode-check { box-shadow: 0 0 0 3px rgba(25,184,168,.18); }
.payment-mode-panel { margin: 0; background: #fff; }
.manual-payment-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 24px; margin-top: 20px; }
.payment-form-panel { padding: 4px 2px; }
.payment-form-panel label:first-child { margin-top: 0; }
.payment-form-panel small, .payment-form-grid small { color: var(--muted); font-weight: 400; }
.qr-preview-card { padding: 16px; border: 1px solid #dfe8e6; border-radius: 14px; background: #f7faf9; }
.qr-preview-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qr-preview-label span { font-weight: 750; }
.qr-preview-label small { color: var(--muted); font-size: 11px; }
.qr-preview-shell { min-height: 285px; display: grid; place-items: center; overflow: hidden; padding: 12px; border: 1px dashed #bdcec9; border-radius: 12px; background: #fff; }
.manual-qr-preview { display: block; width: min(270px, 100%); max-height: 320px; margin: 0; padding: 5px; object-fit: contain; border: 0; border-radius: 8px; background: #fff; }
.manual-qr-preview[hidden] { display: none; }
.qr-preview-empty { display: grid; justify-items: center; gap: 5px; color: var(--muted); text-align: center; }
.qr-preview-empty::before { content: "＋"; display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 5px; color: var(--cyan-dark); border: 1px solid #bfe1dc; border-radius: 15px; background: #edf9f7; font-size: 25px; }
.qr-preview-empty b { color: var(--ink); }
.api-config-group { margin-top: 20px; padding: 20px; border: 1px solid #e1e8ee; border-radius: 13px; background: #fbfcfd; }
.api-config-heading { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e7edf2; }
.api-config-heading span { font-size: 15px; font-weight: 800; }
.api-config-heading small { color: var(--muted); }
.payment-form-grid { margin-top: 4px; }
.sensitive-config-group { background: #fcfbf8; }
.payment-security-confirm { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(300px, 1.2fr); align-items: center; gap: 22px; margin-top: 20px; padding: 18px 20px; border: 1px solid #f0d6a9; border-radius: 13px; background: #fffaf0; }
.payment-security-confirm > div b, .payment-security-confirm > div small { display: block; }
.payment-security-confirm > div small { margin-top: 4px; color: #806849; }
.payment-security-confirm label { margin: 0; }
.payment-save-bar { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: 20px; min-height: 72px; padding: 14px 18px; border: 1px solid #dbe5e3; border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 14px 36px rgba(15,41,61,.13); backdrop-filter: blur(14px); }
.payment-save-bar button { min-width: 220px; }
.payment-form-message { min-height: 22px; flex: 1; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.payment-form-message.success { color: #13745b; font-weight: 700; }
.payment-form-message.error { color: var(--danger); font-weight: 700; }
.record-summary { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.record-summary-item { padding: 18px 20px; border: 1px solid #e0e8ed; border-radius: 15px; background: linear-gradient(145deg, #fff, #f7fbfa); box-shadow: 0 10px 28px rgba(20,39,61,.06); }
.record-summary-item span { display: block; color: var(--muted); font-size: 13px; }
.record-summary-item strong { display: block; margin-top: 8px; color: var(--navy-2); font-size: 25px; }
.records-card { padding: 0; overflow: hidden; }
.records-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.records-toolbar h3 { margin: 0 0 3px; }
.records-toolbar small { color: var(--muted); }
.records-toolbar label { min-width: 180px; margin: 0; }
.record-type { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.record-type.audit { color: #2457a5; background: #e9f1ff; }
.record-type.support { color: #13745b; background: #dcf7ec; }
.order-period-summary { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.order-period-card { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 18px; min-height: 116px; padding: 20px 22px; border: 1px solid #dce8e5; border-radius: 14px; background: linear-gradient(135deg, #fff, #f0faf8); box-shadow: var(--shadow); }
.order-period-card span { grid-column: 1 / -1; color: var(--muted); font-weight: 700; }
.order-period-card strong { color: var(--cyan-dark); font-size: 28px; line-height: 1.2; }
.order-period-card small { color: var(--ink); font-size: 14px; font-weight: 700; }
.order-filter-card { margin-bottom: 16px; overflow-x: auto; }
.order-filter-grid { display: grid; grid-template-columns: minmax(190px, 1.15fr) minmax(180px, 1fr) minmax(190px, 1.05fr) minmax(330px, 1.6fr) auto; align-items: end; gap: 16px; min-width: 1080px; }
.order-filter-grid > label { margin: 0; }
.order-filter-actions { display: flex; align-items: center; gap: 9px; margin: 0; padding-bottom: 1px; white-space: nowrap; }
.order-date-range { display: grid; grid-template-columns: minmax(135px, 1fr) auto minmax(135px, 1fr); align-items: center; min-height: 43px; overflow: hidden; border: 1px solid #cfd9e3; border-radius: 9px; background: #fff; }
.order-date-range:focus-within { border-color: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(25,184,168,.13); }
.order-date-range input { min-width: 0; padding: 10px; border: 0; border-radius: 0; box-shadow: none; }
.order-date-range input:focus { border: 0; box-shadow: none; }
.order-date-range span { color: var(--muted); }
.order-report-grid { display: block; }
.order-record-card { min-width: 0; padding: 0; overflow: hidden; }
.report-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.report-card-head h3 { margin: 0; }
.report-card-head small { color: var(--muted); }
.table-scroll { overflow: auto; }
.order-total-footer { display: flex; align-items: center; justify-content: flex-end; gap: 22px; padding: 18px 22px; border-top: 1px solid var(--line); background: #f7fbfa; }
.order-total-footer span { color: var(--muted); }
.order-total-footer strong { color: var(--cyan-dark); font-size: 24px; }

.modal { width: min(760px, calc(100vw - 34px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 90px rgba(8,28,46,.25); }
.modal.small { width: min(500px, calc(100vw - 34px)); }
.modal::backdrop { background: rgba(4,18,31,.55); backdrop-filter: blur(4px); }
.modal form { padding: 23px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-head button { min-width: 36px; padding: 4px; color: var(--muted); background: transparent; font-size: 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }
.notice { padding: 12px; color: #155d58; border: 1px solid #bde9e3; border-radius: 9px; background: #e9faf7; }

@media (max-width: 1100px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .license-grid { grid-template-columns: 1fr; }
    .record-summary { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .payment-section-heading { align-items: flex-start; }
    .manual-payment-layout { grid-template-columns: 1fr; }
    .qr-preview-card { width: min(430px, 100%); }
    .order-period-summary { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
    .commercial-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .operations-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; width: 100%; height: auto; padding: 12px; }
    .logo { padding: 0 4px 12px; }
    .sidebar nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .sidebar nav button { flex: 0 0 auto; width: auto; min-width: 118px; min-height: 42px; }
    .sidebar > .ghost { width: 100%; margin-top: 10px; }
    .content { padding: 0 16px 28px; }
    .topbar { min-height: 72px; }
    .operator { flex-wrap: wrap; justify-content: flex-end; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .payment-status-main, .payment-section-heading { align-items: flex-start; flex-direction: column; }
    .payment-ready-badge { align-self: flex-start; }
    .payment-status-metrics, .payment-mode-options { grid-template-columns: 1fr; }
    .payment-enable-switch { width: 100%; min-width: 0; }
    .payment-mode-choice { grid-template-columns: 42px 1fr 22px; min-height: 0; padding: 15px; }
    .payment-mode-icon { width: 42px; height: 42px; }
    .payment-security-confirm { grid-template-columns: 1fr; }
    .payment-save-bar { position: static; align-items: stretch; flex-direction: column; gap: 8px; }
    .payment-save-bar button { width: 100%; min-width: 0; }
    .payment-form-message { text-align: left; }
    .record-summary { grid-template-columns: repeat(2, 1fr); }
    .records-toolbar { align-items: stretch; flex-direction: column; }
    .records-toolbar label { width: 100%; min-width: 0; }
    .order-period-summary { grid-template-columns: 1fr; }
    .order-total-footer { align-items: flex-end; flex-direction: column; gap: 5px; }
    .lifecycle-form { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .login-screen { align-items: start; padding: 16px; }
    .login-card { width: 100%; margin: auto 0; padding: 24px 20px; border-radius: 16px; }
    .login-card h1 { font-size: 26px; }
    .login-card p { margin-bottom: 20px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 132px; }
    .captcha-row input { min-width: 0; }
    .captcha-button { width: 100%; }
    .sidebar { padding: 10px; }
    .logo { padding: 0 3px 10px; font-size: 17px; }
    .logo b { width: 36px; height: 36px; }
    .sidebar nav button { min-width: 108px; padding: 8px 10px; }
    .content { padding: 0 12px 24px; }
    .topbar { min-height: 0; align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 0 13px; }
    .operator { width: 100%; justify-content: space-between; }
    .summary-grid { gap: 8px; margin-bottom: 12px; }
    .commercial-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-card { min-height: 94px; padding: 14px; }
    .summary-card strong { margin-top: 7px; font-size: 22px; }
    .card { padding: 16px; }
    .card-head, .page-actions { align-items: stretch; flex-direction: column; gap: 10px; }
    .page-actions > button { width: 100%; }
    th, td { padding: 10px 11px; }
}

@media (max-width: 360px) {
    .login-screen { padding: 10px; }
    .login-card { padding: 20px 16px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; }
}
