/* Client SaaS Subscription Checkout & Admin Receipts Console (?v=212_a_2) */
/* Pure prefix .sb- | 0 exact/split selector duplicates | Dark + Light theme | Responsive 360px+ */

.sb-hub-card {
    margin-top: 18px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: linear-gradient(160deg, rgba(13, 24, 46, 0.94), rgba(9, 17, 34, 0.96));
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 14px 36px rgba(2, 8, 23, 0.34);
}

.sb-hub-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.sb-hub-title {
    margin: 0;
    font-size: 1.24rem;
    font-weight: 800;
    color: #f8fafc;
}

.sb-hub-sub {
    margin: 6px 0 0;
    font-size: 0.88rem;
    line-height: 1.48;
    color: #94a3b8;
    max-width: 780px;
}

.sb-operator-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.sb-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.sb-stat-box {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-stat-lbl {
    font-size: 0.76rem;
    color: #94a3b8;
    font-weight: 600;
}

.sb-stat-val {
    font-size: 1.02rem;
    font-weight: 800;
    color: #f8fafc;
    word-break: break-word;
}

.sb-stat-val.is-emerald {
    color: #34d399;
}

.sb-stat-val.is-sky {
    color: #38bdf8;
}

.sb-calc-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.sb-calc-left {
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sb-calc-right {
    background: linear-gradient(155deg, rgba(0, 82, 255, 0.14), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.sb-step-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #7dd3fc;
    margin-bottom: 8px;
}

.sb-plan-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sb-plan-tab {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.84);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 10px 10px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.sb-plan-tab:hover {
    border-color: rgba(56, 189, 248, 0.65);
}

.sb-plan-tab.is-active {
    background: linear-gradient(135deg, rgba(0, 82, 255, 0.28), rgba(56, 189, 248, 0.22));
    border-color: #38bdf8;
    color: #ffffff;
}

.sb-plan-desc {
    margin: 6px 0 0;
    font-size: 0.83rem;
    color: #cbd5e1;
    line-height: 1.42;
}

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

.sb-opt-pill {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 8px 13px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.sb-opt-pill:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

.sb-opt-pill.is-active {
    background: #0052ff;
    border-color: #60a5fa;
    color: #ffffff;
}

.sb-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-sum-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #cbd5e1;
}

.sb-sum-line strong {
    color: #f8fafc;
    font-weight: 700;
    text-align: right;
}

.sb-sum-total-box {
    border-top: 1px solid rgba(148, 163, 184, 0.26);
    padding-top: 12px;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.sb-sum-total-lbl {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}

.sb-sum-total-val {
    font-size: 1.42rem;
    font-weight: 900;
    color: #34d399;
}

.sb-legal-note {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.42;
    color: #94a3b8;
}

.sb-channel-notice {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.4;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.42);
    color: #fde68a;
}

.sb-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-btn-primary {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #0052ff, #0284c7);
    text-align: center;
    text-decoration: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.sb-btn-primary:hover {
    opacity: 0.94;
}

.sb-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sb-btn-secondary {
    appearance: none;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.78);
    text-align: center;
    text-decoration: none;
}

.sb-btn-secondary:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.sb-btn-success {
    appearance: none;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #059669, #10b981);
}

.sb-btn-danger {
    appearance: none;
    border: 1px solid rgba(248, 113, 113, 0.48);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.42);
}

.sb-btn-mini {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.85);
}

.sb-inv-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sb-inv-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 800;
    color: #f8fafc;
}

.sb-inv-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sb-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 10px;
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 0.85rem;
}

.sb-inv-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sb-inv-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 13px 15px;
}

.sb-inv-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    flex: 1 1 300px;
}

.sb-inv-top-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sb-inv-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 800;
    color: #f8fafc;
}

.sb-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

.sb-badge.is-issued {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}

.sb-badge.is-submitted {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

.sb-badge.is-checker {
    background: rgba(168, 85, 247, 0.22);
    color: #e9d5ff;
}

.sb-badge.is-approved {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.sb-badge.is-rejected {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.sb-badge.is-dup {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fecaca;
}

.sb-inv-subline {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
}

.sb-inv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Modal & NBU QR Quiet Zone */
.sb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(2, 6, 23, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow-y: auto;
}

.sb-modal-card {
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    overflow-y: auto;
    background: #0b1325;
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.sb-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.sb-modal-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: #f8fafc;
}

.sb-modal-close {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 1rem;
    cursor: pointer;
}

.sb-pay-grid {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.sb-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 12px;
}

.sb-qr-frame {
    width: 200px;
    height: 200px;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.sb-qr-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sb-qr-hint {
    margin: 0;
    font-size: 0.75rem;
    text-align: center;
    color: #94a3b8;
    line-height: 1.35;
}

.sb-req-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sb-req-row {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 9px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.sb-req-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.sb-req-lbl {
    display: block;
    font-size: 0.74rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.sb-req-val {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sb-receipt-box {
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sb-receipt-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #6ee7b7;
}

.sb-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 10px;
    padding: 9px 12px;
    color: #f8fafc;
    font-size: 0.88rem;
}

/* Admin Billing Config & Queue Styles */
.sb-adm-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.sb-adm-cfg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.sb-adm-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 10px 0 14px;
}

.sb-adm-check-lbl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    cursor: pointer;
}

.sb-adm-receipt-stage {
    margin: 12px 0;
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.sb-adm-receipt-img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    display: inline-block;
}

.sb-adm-review-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.sb-adm-ref-inp {
    flex: 1 1 180px;
    min-width: 150px;
}

/* Light Theme Support */
html[data-theme="light"] .sb-hub-card {
    background: linear-gradient(160deg, #ffffff, #f8fafc);
    border-color: rgba(2, 132, 199, 0.26);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .sb-hub-title,
html[data-theme="light"] .sb-stat-val,
html[data-theme="light"] .sb-sum-line strong,
html[data-theme="light"] .sb-sum-total-lbl,
html[data-theme="light"] .sb-inv-title,
html[data-theme="light"] .sb-inv-num,
html[data-theme="light"] .sb-modal-title,
html[data-theme="light"] .sb-req-val,
html[data-theme="light"] .sb-adm-check-lbl {
    color: #0f172a;
}

html[data-theme="light"] .sb-hub-sub,
html[data-theme="light"] .sb-stat-lbl,
html[data-theme="light"] .sb-plan-desc,
html[data-theme="light"] .sb-sum-line,
html[data-theme="light"] .sb-legal-note,
html[data-theme="light"] .sb-inv-subline,
html[data-theme="light"] .sb-req-lbl,
html[data-theme="light"] .sb-qr-hint {
    color: #475569;
}

html[data-theme="light"] .sb-stat-box,
html[data-theme="light"] .sb-calc-left,
html[data-theme="light"] .sb-inv-item,
html[data-theme="light"] .sb-qr-panel,
html[data-theme="light"] .sb-req-row,
html[data-theme="light"] .sb-adm-receipt-stage {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .sb-calc-right {
    background: linear-gradient(155deg, rgba(0, 82, 255, 0.06), rgba(14, 165, 233, 0.08));
    border-color: rgba(2, 132, 199, 0.34);
}

html[data-theme="light"] .sb-plan-tab,
html[data-theme="light"] .sb-opt-pill,
html[data-theme="light"] .sb-btn-secondary,
html[data-theme="light"] .sb-btn-mini,
html[data-theme="light"] .sb-select,
html[data-theme="light"] .sb-input,
html[data-theme="light"] .sb-modal-close {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .sb-plan-tab.is-active,
html[data-theme="light"] .sb-opt-pill.is-active {
    background: #0052ff;
    color: #ffffff;
    border-color: #0052ff;
}

html[data-theme="light"] .sb-modal-card {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.34);
}

html[data-theme="light"] .sb-channel-notice {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

html[data-theme="light"] .sb-operator-pill {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
}

html[data-theme="light"] .sb-sum-total-val,
html[data-theme="light"] .sb-stat-val.is-emerald,
html[data-theme="light"] .sb-receipt-title {
    color: #047857;
}

html[data-theme="light"] .sb-step-label,
html[data-theme="light"] .sb-stat-val.is-sky {
    color: #0369a1;
}

/* Mobile & Tablet Responsive (360px+) */
@media (max-width: 980px) {
    .sb-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sb-calc-wrap,
    .sb-adm-cfg-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 680px) {
    .sb-hub-card {
        padding: 14px;
    }

    .sb-plan-tabs {
        grid-template-columns: minmax(0, 1fr);
    }

    .sb-pay-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sb-qr-frame {
        width: 184px;
        height: 184px;
    }

    .sb-modal-card {
        padding: 14px;
    }
}

@media (max-width: 420px) {
    .sb-status-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sb-req-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
