:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #34a853;
    --warning: #f9ab00;
    --danger: #ea4335;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e8eaed;
    --border-color: #dadce0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --topbar-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d68f00;
}

.btn-danger:hover {
    background: #c5221f;
}

.btn-success:hover {
    background: #2d8e47;
}

.btn-info {
    background: #1a73e8;
    color: white;
}

.btn-info:hover {
    background: #1557b0;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #d0d4d9;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #e6f4ea;
    color: var(--success);
}

.status-badge.inactive {
    background: #fce8e6;
    color: var(--danger);
}

.status-badge.pending {
    background: #fef7e0;
    color: var(--warning);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
    appearance: auto;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
}

.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    resize: vertical;
    min-height: 80px;
}

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-nopad {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-nopad .data-table {
    border-radius: var(--radius-md);
}

.data-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg-secondary);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.alert-success {
    background: #e6f4ea;
    color: var(--success);
}

.alert-danger {
    background: #fce8e6;
    color: var(--danger);
}

.alert-warning {
    background: #fef7e0;
    color: var(--warning);
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    width: 140px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tag-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.tag-success {
    background: #e6f4ea;
    color: var(--success);
}

.tag-danger {
    background: #fce8e6;
    color: var(--danger);
}

.tag-warning {
    background: #fef7e0;
    color: var(--warning);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
/* === Form Layouts === */
.form-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.form-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-card-body {
    padding: 20px;
}

.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.form-inline .btn {
    flex-shrink: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.form-grid-5 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.form-grid-6 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

@media (max-width: 768px) {
    .form-inline {
        flex-direction: column;
    }
    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .form-grid-5,
    .form-grid-6 {
        grid-template-columns: 1fr;
    }
}
/* === Inline Form (for POST action buttons) === */
.inline-form {
    display: inline;
}

/* === Card Spacing === */
.card-spacer {
    margin-bottom: 20px;
}

/* === Section Header (card title bar) === */
.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* === Card Body Padding === */
.card-body-pad {
    padding: 20px;
}

/* === Flex Layouts === */
.flex-row {
    display: flex;
    gap: 16px;
}

.flex-gap-4 {
    display: flex;
    gap: 4px;
}

.flex-gap-8 {
    display: flex;
    gap: 8px;
}

.flex-gap-12 {
    display: flex;
    gap: 12px;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
}

.flex-align-center {
    display: flex;
    align-items: center;
}

/* === Button Alignment === */
.btn-align-end {
    align-self: flex-end;
}

.btn-span-2 { grid-column: span 2; }
.btn-span-4 { grid-column: span 4; }
.btn-span-5 { grid-column: span 5; }
.btn-span-6 { grid-column: span 6; }

/* === Text Helpers === */
.text-xs-muted {
    font-size: 12px;
    color: var(--text-muted);
}

.text-sm-muted {
    font-size: 13px;
    color: var(--text-muted);
}

.text-sm {
    font-size: 13px;
}

.text-xs {
    font-size: 11px;
}

.text-center-muted {
    text-align: center;
    color: var(--text-muted);
}

/* === Info Box === */
.info-box {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* === Detail Row === */
.detail-row {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

/* === Reply Item === */
.reply-item {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* === Empty State === */
.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-lg {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* === Divider === */
.divider-top {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
}

/* === Code Display === */
.code-display {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

/* === Inline Inputs === */
.input-inline-auto {
    display: inline-block;
    width: auto;
}

.input-inline-120 {
    display: inline-block;
    width: 120px;
}

/* === Margin Helpers === */
.margin-top-12 { margin-top: 12px; }
.margin-top-16 { margin-top: 16px; }
.margin-top-20 { margin-top: 20px; }
.margin-bottom-16 { margin-bottom: 16px; }

/* === Pricing Grid === */
.grid-pricing {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}

/* === Notification Item === */
.notif-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notif-unread {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

/* === Features Grid === */
.features-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

/* === Feature Card === */
.feature-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.2s;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === Feature Card Variants === */
.feature-card-wide {
    grid-column: span 2;
}

.feature-card-full {
    grid-column: span 3;
}

.feature-card-left {
    text-align: left;
}

.feature-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.feature-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* === Price Display === */
.price-large {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

/* === Conditional text (for Razor) === */
.text-danger-conditional {
    color: var(--danger);
}

.text-success-conditional {
    color: var(--success);
}
/* === Text Weight === */
.text-bold { font-weight: bold; }
.text-normal { font-weight: normal; }

/* === Text Muted Color === */
.text-muted-color { color: var(--text-muted); }

/* === Text Success Small === */
.text-sm-success {
    font-size: 13px;
    color: var(--success);
}

/* === Feature Card Center === */
.feature-card-center { text-align: center; }

/* === Margin Y 20 === */
.margin-y-20 { margin: 20px 0; }

/* === Flex Wrap === */
.flex-wrap { flex-wrap: wrap; }

/* === Small Margins === */
.mt-4 { margin-top: 4px; }
.mb-4 { margin-bottom: 4px; }

/* === Dashboard shared === */
.page-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-unit {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-header .panel-title {
    margin-bottom: 0;
}

.panel-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.panel-link {
    font-size: 13px;
    color: var(--primary);
}

.chart-box {
    position: relative;
    width: 100%;
    height: 250px;
}

.chart-box canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-with-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-box-donut {
    flex: 0 0 44%;
    height: 230px;
}

.chart-legend {
    flex: 1;
    min-width: 0;
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    min-width: 0;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.chart-legend-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.chart-legend-value {
    flex: none;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.chart-legend-value strong {
    color: var(--text-primary);
    font-weight: 600;
}

.chart-legend-pct {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-tip {
    position: absolute;
    z-index: 30;
    pointer-events: none;
    min-width: 120px;
    max-width: 260px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.94);
    color: #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.chart-tip-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.chart-tip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chart-tip-row i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.chart-tip-row span {
    color: #cbd5e1;
}

.chart-tip-row b {
    margin-left: auto;
    color: #fff;
    font-weight: 600;
    padding-left: 12px;
}

.chart-tip-row.chart-tip-total {
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    margin-top: 4px;
    padding-top: 4px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.metric-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--bg-secondary);
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-value {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.metric-value-sm {
    font-size: 15px;
}

.metric-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.todo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.todo-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.todo-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s;
}

.todo-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.todo-count {
    min-width: 32px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

.todo-count.warn { color: #d97706; }
.todo-count.danger { color: #dc2626; }

.todo-label {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.todo-footnote {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.table-scroll {
    overflow-x: auto;
}

@media (max-width: 1024px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .todo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-with-legend {
        flex-direction: column;
        align-items: stretch;
    }
    .chart-box-donut {
        flex: none;
        height: 210px;
    }
    .chart-legend {
        max-height: none;
    }
}

/* === V2.0.40 shared pages: feature grid (tenant Package / Model) === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-card-full { grid-column: span 2; }
}

@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
    .feature-card-wide, .feature-card-full { grid-column: span 1; }
}

/* === Payment channel tags === */
.tag-wechat { background: #dcfce7; color: #166534; }
.tag-alipay { background: #dbeafe; color: #1e40af; }
.tag-bank { background: #fef3c7; color: #92400e; }

/* === Badge fallbacks (public pages) === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-success { background: #e6f4ea; color: #34a853; }
.badge-warning { background: #fef7e0; color: #f9ab00; }
.badge-danger { background: #fce8e6; color: #ea4335; }
.badge-info, .badge-primary { background: #e8f0fe; color: #1a73e8; }
.badge-muted { background: #f1f3f4; color: #5f6368; }

/* === Public status page fallbacks === */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-primary); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.dashboard-panel { background: var(--bg-primary); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px; }

/* === Info bar === */
.info-bar { border-radius: var(--radius-md); }

/* === Real-name verification: type cards & upload zone === */
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
    text-align: center;
}
.type-card input { display: none; }
.type-card:hover { border-color: var(--primary); }
.type-card.active { border-color: var(--primary); background: var(--primary-light); }
.type-card-icon { font-size: 28px; }
.type-card-name { font-weight: 600; color: var(--text-primary); }
.type-card-desc { font-size: 12px; color: var(--text-muted); }

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone-placeholder { color: var(--text-secondary); font-size: 14px; }
.upload-zone-icon { font-size: 32px; margin-bottom: 8px; }
.upload-preview img { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); }
.upload-preview div { margin-top: 8px; }

.ocr-status {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.ocr-ok { background: #e6f4ea; color: #166534; border-color: #bbf7d0; }
.ocr-fail { background: #fef7e0; color: #92400e; border-color: #fde68a; }

.status-banner { border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 16px; }
.status-banner-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.status-banner-icon-ok { background: #dcfce7; color: #15803d; }
.status-banner-icon-pending { background: #fef3c7; color: #b45309; }
.status-banner-icon-fail { background: #fee2e2; color: #b91c1c; }

.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--border-color); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg-secondary); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--border-color); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg-tertiary); }
.rich-toolbar button, .rte-toolbar button { min-width: 32px; padding: 4px 9px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: all .15s; font-size: 13px; }
.rich-toolbar button:hover, .rich-toolbar button.active, .rte-toolbar button:hover, .rte-toolbar button.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.rich-editor { min-height: 150px; max-height: 460px; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; }
.rte-editor { min-height: 150px; max-height: 460px; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; outline: none; }
.rte-hidden { display: none; }
.rich-editor:empty::before, .rte-editor:empty::before { content: attr(data-placeholder); color: var(--text-secondary); pointer-events: none; }
.rich-editor:focus, .rte-editor:focus { outline: 2px solid var(--primary); outline-offset: -2px; border-color: var(--primary); }
.rich-content { line-height: 1.7; overflow-wrap: anywhere; margin-top: 12px; color: var(--text-primary); }
.rich-content p { margin: 8px 0; }
.rte-editor pre, .rich-editor pre, .rich-content pre { white-space: pre-wrap; background: #1e293b; color: #e2e8f0; padding: 12px 14px; border-radius: var(--radius-md); overflow-x: auto; overflow-wrap: anywhere; }

/* === Shared rich-text rendering === */
.rte-editor, .rich-editor, .rich-content { color: var(--text-primary); line-height: 1.75; overflow-wrap: anywhere; }
.rte-editor h2, .rich-editor h2, .rich-content h2 { margin: 20px 0 10px; font-size: 22px; }
.rte-editor h3, .rich-editor h3, .rich-content h3 { margin: 18px 0 8px; font-size: 18px; }
.rte-editor h4, .rich-editor h4, .rich-content h4 { margin: 16px 0 8px; font-size: 16px; }
.rte-editor p, .rich-editor p, .rich-content p { margin: 8px 0; }
.rte-editor ul, .rich-editor ul, .rich-content ul,
.rte-editor ol, .rich-editor ol, .rich-content ol { margin: 8px 0; padding-left: 24px; }
.rte-editor blockquote, .rich-editor blockquote, .rich-content blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--primary); background: var(--primary-light); color: var(--text-secondary); }
.rte-editor a, .rich-editor a, .rich-content a { color: var(--primary); text-decoration: underline; }
.rte-editor pre code, .rich-editor pre code, .rich-content pre code { background: transparent; color: inherit; padding: 0; }
.rte-editor :not(pre) > code, .rich-editor :not(pre) > code, .rich-content :not(pre) > code { padding: 2px 5px; border-radius: 4px; background: var(--bg-tertiary); font-family: Consolas, monospace; }
.rte-editor table, .rich-editor table, .rich-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.rte-editor th, .rich-editor th, .rich-content th,
.rte-editor td, .rich-editor td, .rich-content td { border: 1px solid var(--border-color); padding: 8px 10px; text-align: left; vertical-align: top; }
.rte-editor th, .rich-editor th, .rich-content th { background: var(--bg-secondary); font-weight: 600; }
.rte-editor img, .rich-editor img, .rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rte-editor hr, .rich-editor hr, .rich-content hr { margin: 18px 0; border: 0; border-top: 1px solid var(--border-color); }
.rte-toolbar button.active, .rich-toolbar button.active { background: var(--primary-light) !important; color: var(--primary) !important; border-color: var(--primary) !important; }
.ticket-message { max-width: 82%; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--bg-secondary); }
.ticket-message.from-tenant { margin-left: auto; border-bottom-right-radius: 2px; }
.ticket-message.from-support { margin-right: auto; border-bottom-left-radius: 2px; border-left: 3px solid var(--primary); }

/* === V2.0.58 shared marketing and payment components === */
.marketing-page { width: 100%; max-width: 1180px; margin: 0 auto; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-subtitle { max-width: 760px; margin: 6px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.flow-steps { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: flow; }
.flow-step { position: relative; flex: 1; min-width: 0; padding: 12px 14px 12px 42px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-secondary); font-size: 13px; counter-increment: flow; }
.flow-step::before { content: counter(flow); position: absolute; left: 13px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-weight: 700; }
.flow-step.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.flow-step.active::before { background: var(--primary); color: #fff; }
.state-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg-secondary); color: var(--text-secondary); }
.state-badge.success { background: #dcfce7; color: #166534; }
.state-badge.warning { background: #fef3c7; color: #92400e; }
.state-badge.danger { background: #fee2e2; color: #991b1b; }
.state-badge.info { background: #dbeafe; color: #1e40af; }
.state-badge.neutral { background: #e2e8f0; color: #334155; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 18px 0; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--border-color); }
.metric-item { padding: 14px; background: var(--bg-primary); text-align: center; }
.metric-label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; }
.metric-value { display: block; color: var(--text-primary); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--bg-tertiary); }
.progress-bar { height: 100%; border-radius: inherit; background: var(--primary); }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 18px; align-items: stretch; }
.package-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.package-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.package-card.recommended { border: 2px solid var(--primary); padding: 23px; }
.package-card.purchased { border-color: #86efac; }
.package-card.pending { border-color: #fcd34d; }
.package-ribbon { position: absolute; top: 0; right: 20px; padding: 5px 12px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.package-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.package-card h3 { margin: 0; color: var(--text-primary); font-size: 19px; }
.package-description { min-height: 42px; margin: 8px 0 16px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.package-price { color: var(--primary); font-size: 34px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.package-price small { margin-left: 3px; font-size: 14px; font-weight: 500; }
.package-original { margin-left: 7px; color: var(--text-muted); font-size: 13px; text-decoration: line-through; }
.package-benefits { display: grid; gap: 9px; margin: 18px 0; padding: 14px; border-radius: var(--radius-md); background: var(--bg-secondary); }
.benefit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: 13px; }
.benefit-row strong { color: var(--text-primary); font-weight: 650; }
.package-actions { display: grid; gap: 10px; margin-top: auto; }
.package-note { margin: 10px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; text-align: center; }
.quote-box { padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); font-size: 13px; }
.quote-box.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.quote-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--text-secondary); }
.quote-row strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.quote-row.total { margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--border-color); font-size: 15px; }
.quote-row.total strong { color: var(--primary); font-size: 18px; }
.segmented-tabs { display: inline-flex; gap: 4px; margin-bottom: 20px; padding: 4px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.segmented-tab { padding: 9px 16px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; }
.segmented-tab.active { background: var(--bg-primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-panel[hidden] { display: none; }
.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.coupon-ticket { position: relative; display: grid; grid-template-columns: 112px 1fr; min-height: 150px; overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); }
.coupon-ticket::before, .coupon-ticket::after { content: ""; position: absolute; left: 103px; width: 18px; height: 18px; border: 1px solid var(--border-color); border-radius: 50%; background: var(--bg-secondary); z-index: 1; }
.coupon-ticket::before { top: -10px; }
.coupon-ticket::after { bottom: -10px; }
.coupon-value { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px 12px; border-right: 1px dashed var(--border-color); background: var(--primary-light); color: var(--primary); }
.coupon-value strong { font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.coupon-value span { font-size: 12px; }
.coupon-body { display: flex; flex-direction: column; min-width: 0; padding: 17px; }
.coupon-body h3 { margin: 0 0 6px; font-size: 15px; color: var(--text-primary); }
.coupon-meta { display: grid; gap: 5px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.coupon-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; }
.coupon-ticket.locked { filter: saturate(.7); }
.coupon-ticket.expired, .coupon-ticket.used { opacity: .62; filter: grayscale(.35); }
.summary-list { display: grid; gap: 0; margin: 0; }
.summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row dt { color: var(--text-secondary); }
.summary-row dd { margin: 0; color: var(--text-primary); font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.summary-row.accent dd { color: var(--primary); font-size: 18px; font-weight: 750; }
.payment-layout { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(320px, 1.18fr); gap: 18px; align-items: start; }
.margin-top-8 { margin-top: 8px; }
.margin-top-16 { margin-top: 16px; }
.margin-top-12 { margin-top: 12px; }
.payment-panel { padding: 26px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); }
.payment-heading { text-align: center; }
.payment-amount { margin: 5px 0; color: var(--primary); font-size: 36px; font-weight: 750; }
.payment-subtitle { color: var(--text-secondary); font-size: 13px; }
.qr-frame { display: grid; place-items: center; width: 232px; height: 232px; margin: 22px auto; padding: 10px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: #fff; }
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder { padding: 24px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.payment-message { margin: 12px 0; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-secondary); font-size: 13px; line-height: 1.6; text-align: center; }
.payment-message.error { background: #fef2f2; color: #991b1b; }
.payment-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #dcfce7; color: #166534; }
.result-symbol svg { width: 32px; height: 32px; }
.result-symbol.pending { background: #fef3c7; color: #92400e; }
.result-symbol.failed { background: #fee2e2; color: #991b1b; }
.result-symbol.neutral { background: #e2e8f0; color: #334155; }
.empty-panel { padding: 38px 20px; border: 1px dashed var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); color: var(--text-secondary); text-align: center; }
.empty-panel h3 { margin: 0 0 8px; color: var(--text-primary); font-size: 16px; }
.empty-panel p { margin: 0; font-size: 13px; line-height: 1.7; }
.form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-color); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section-title { margin: 0 0 13px; color: var(--text-primary); font-size: 15px; font-weight: 650; }
.field-hint { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.admin-entity-card { min-width: 0; padding: 20px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); }
.admin-entity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-entity-head h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.admin-entity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.inline-form { display: inline-flex; margin: 0; }
.tenant-picker-search { position: sticky; top: 0; z-index: 1; margin-bottom: 10px; background: var(--bg-primary); }
.tenant-picker-list { max-height: 280px; overflow-y: auto; padding: 10px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.tenant-picker-item { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.tenant-picker-item:hover { background: var(--primary-light); }
.checkbox-line { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.checkbox-line input { margin-top: 3px; }
.channel-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 750; }
.channel-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.amount-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.channel-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.channel-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.channel-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.payment-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 14px; }
.payment-config-card { padding: 18px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-primary); }
.payment-config-card h4 { margin: 0 0 10px; color: var(--text-primary); font-size: 15px; }
.payment-config-card ul { margin: 0; padding-left: 18px; color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.toast { position: fixed; top: 20px; left: 50%; z-index: 2000; max-width: min(520px, calc(100vw - 32px)); transform: translateX(-50%); padding: 12px 18px; border-radius: var(--radius-md); background: #0f172a; color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .58; }

@media (max-width: 900px) {
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-step { padding-left: 36px; font-size: 12px; }
    .flow-step::before { left: 9px; width: 20px; height: 20px; }
}
@media (max-width: 640px) {
    .marketing-page { max-width: none; }
    .page-header { align-items: flex-start; gap: 14px; flex-direction: column; }
    .flow-steps { gap: 6px; }
    .flow-step { padding: 10px 8px; text-align: center; }
    .flow-step::before { position: static; transform: none; margin: 0 auto 6px; }
    .package-grid, .coupon-grid, .admin-card-grid, .form-grid-2, .payment-layout { grid-template-columns: 1fr; }
    .amount-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .package-card { padding: 20px; }
    .package-card.recommended { padding: 19px; }
    .coupon-ticket { grid-template-columns: 94px 1fr; }
    .coupon-ticket::before, .coupon-ticket::after { left: 85px; }
    .coupon-value strong { font-size: 24px; }
    .coupon-body { padding: 14px; }
    .segmented-tabs { display: flex; }
    .segmented-tab { flex: 1; padding: 9px 10px; }
    .payment-panel { padding: 20px 16px; }
    .payment-amount { font-size: 31px; }
    .qr-frame { width: 210px; height: 210px; }
    .summary-row { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .package-card, .channel-card, .flow-step, .segmented-tab { transition: none !important; }
    .package-card:hover { transform: none; }
}

@media (max-width: 768px) {
    .type-cards { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* === V2.0.61 distribution and marketing operations === */
.v2061-page { width: 100%; max-width: 1600px; }
.v2061-page .page-header { margin-bottom: 20px; }
.ops-section { margin-top: 24px; }
.ops-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.ops-section-heading h2 { margin: 0; color: var(--text-primary); font-size: 18px; font-weight: 700; }
.ops-section-heading p { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; }
.ops-metric-grid { display: grid; gap: 14px; }
.ops-metric-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ops-metric-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ops-metric { --tone: #1a73e8; --tone-bg: #e8f0fe; position: relative; min-width: 0; overflow: hidden; padding: 19px 20px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.ops-metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.ops-metric::after { content: ""; position: absolute; top: -34px; right: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--tone-bg); opacity: .72; }
.ops-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ops-metric > * { position: relative; z-index: 1; }
.ops-metric-label { display: block; color: var(--text-secondary); font-size: 13px; font-weight: 550; }
.ops-metric strong { display: block; margin: 7px 0 5px; color: var(--text-primary); font-size: clamp(22px, 2vw, 29px); font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ops-metric small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.tone-blue { --tone: #1a73e8; --tone-bg: #dbeafe; }
.tone-cyan { --tone: #0891b2; --tone-bg: #cffafe; }
.tone-violet { --tone: #7c3aed; --tone-bg: #ede9fe; }
.tone-green { --tone: #15803d; --tone-bg: #dcfce7; }
.tone-amber { --tone: #b45309; --tone-bg: #fef3c7; }
.tone-red { --tone: #dc2626; --tone-bg: #fee2e2; }
.tone-slate { --tone: #475569; --tone-bg: #e2e8f0; }
.ops-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; padding: 14px 17px; border: 1px solid #bfdbfe; border-radius: var(--radius-md); background: #eff6ff; color: #1e40af; font-size: 13px; line-height: 1.7; }
.ops-note strong { flex: 0 0 auto; }
.ops-config-card { margin-top: 24px; padding: 24px; }
.ops-config-card h2 { margin: 0; font-size: 18px; }
.ops-config-card .metric-strip { margin-bottom: 0; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-span-2 { grid-column: span 2; }
.form-span-3 { grid-column: span 3; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 4px 0 16px; }
.ops-collapse { margin-top: 20px; overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-primary); box-shadow: var(--shadow-sm); }
.ops-collapse > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; color: var(--text-primary); font-size: 15px; font-weight: 650; cursor: pointer; list-style: none; }
.ops-collapse > summary::-webkit-details-marker { display: none; }
.ops-collapse > summary::after { content: "+"; color: var(--text-muted); font-size: 22px; font-weight: 400; }
.ops-collapse[open] > summary::after { content: "−"; }
.ops-collapse > summary span { margin-left: auto; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.ops-collapse > form { padding: 4px 20px 0; }
.campaign-card { display: flex; flex-direction: column; }
.campaign-card .admin-entity-actions { margin-top: auto; }
.metric-strip-2 small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.v2061-page .data-table { min-width: 680px; }
.promotion-workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; margin-top: 24px; align-items: start; }
.share-panel h2, .rules-panel h2 { margin: 0; font-size: 18px; }
.share-link-actions { display: flex; gap: 9px; }
.share-link-actions .share-link-input { min-width: 0; flex: 1; }
.share-link-box { padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
.qr-code-box { margin-top: 16px; padding: 20px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: linear-gradient(145deg, #fff, #f8fafc); text-align: center; }
.qr-code-box h3 { margin: 0 0 13px; font-size: 15px; }
.qr-code-box img { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto; border: 8px solid #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.qr-code-box p { margin: 11px 0 0; color: var(--text-muted); font-size: 12px; }
.rule-list { display: grid; gap: 13px; margin: 17px 0; }
.rule-list article { display: flex; gap: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--border-color); }
.rule-list article:last-child { padding-bottom: 0; border-bottom: 0; }
.rule-index { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 750; }
.rule-list h3 { margin: 0 0 3px; font-size: 14px; }
.rule-list p { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.form-grid-site { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(260px, 1.35fr) auto; gap: 14px; align-items: end; }
.withdraw-metrics { margin-bottom: 22px; }
.withdraw-form-panel { margin-bottom: 24px; }
.v2061-page .ops-collapse .table-wrap { border-top: 1px solid var(--border-color); }

@media (max-width: 1200px) {
    .ops-metric-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .promotion-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-span-3 { grid-column: span 2; }
    .ops-metric-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-site { grid-template-columns: 1fr 1fr; }
    .form-grid-site .form-actions { grid-column: span 2; }
    .flow-steps { overflow-x: auto; padding-bottom: 4px; }
    .flow-step { flex: 0 0 150px; }
}
@media (max-width: 640px) {
    .ops-metric-grid-4, .ops-metric-grid-3, .form-grid-3, .form-grid-site { grid-template-columns: 1fr; }
    .form-span-2, .form-span-3, .form-grid-site .form-actions { grid-column: span 1; }
    .ops-metric strong { font-size: 25px; }
    .ops-config-card { padding: 18px; }
    .ops-section-heading { flex-direction: column; gap: 9px; }
    .ops-collapse > summary { padding: 15px 16px; }
    .ops-collapse > form { padding: 3px 16px 0; }
    .share-link-actions { flex-direction: column; }
    .payment-panel { padding: 20px 16px; }
    .ops-note { flex-direction: column; gap: 3px; }
    .v2061-page .data-table { min-width: 650px; }
}
@media (prefers-reduced-motion: reduce) {
    .ops-metric { transition: none; }
    .ops-metric:hover { transform: none; }
}