/*
 * Product UI system overrides.
 * Loaded after page-local styles to normalize the app toward a restrained SaaS UI.
 */
:root {
    --primary: #176b87;
    --primary-dark: #0f5065;
    --secondary: #25a18e;
    --warning: #c77700;
    --danger: #d92d20;
    --bg-gradient: linear-gradient(135deg, #176b87 0%, #25a18e 100%);
    --ui-bg: #f6f8fb;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f9fbfd;
    --ui-text: #172033;
    --ui-text-muted: #667085;
    --ui-border: #d9e1ea;
    --ui-border-strong: #c6d1dc;
    --ui-focus: rgba(23, 107, 135, 0.16);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 14px 36px rgba(16, 24, 40, 0.10);
    --shadow-xl: 0 22px 60px rgba(16, 24, 40, 0.12);
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
}

* {
    letter-spacing: 0 !important;
}

html {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scrollbar-color: #c6d1dc #f6f8fb;
    scrollbar-width: thin;
}

body {
    color: var(--ui-text) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", Arial, sans-serif !important;
}

a {
    color: var(--primary);
}

::selection {
    background: rgba(37, 161, 142, .18);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f6f8fb;
}

::-webkit-scrollbar-thumb {
    background: #c6d1dc;
    border: 2px solid #f6f8fb;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #98a2b3;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    transform: translateY(-160%);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: transform .16s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: none;
}

button,
.btn,
.login-button,
.register-button,
.verify-btn,
.upload-btn,
.download-btn,
.asset-picker-btn,
.picker-confirm-btn,
.picker-cancel-btn {
    border-radius: var(--radius-md) !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease !important;
}

button:hover:not(:disabled),
.btn:hover,
.login-button:hover:not(:disabled),
.register-button:hover:not(:disabled) {
    transform: none !important;
}

button:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.topbar-bell:focus-visible,
.user-avatar:focus-visible,
.sidebar-toggle:focus-visible,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--ui-focus) !important;
}

input,
select,
textarea,
.form-control {
    border-color: var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--ui-text) !important;
}

input::placeholder,
textarea::placeholder {
    color: #98a2b3 !important;
}

button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled,
button[disabled],
.btn[disabled],
input[readonly],
textarea[readonly] {
    cursor: not-allowed !important;
    opacity: .62 !important;
    box-shadow: none !important;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
    background: #f2f4f7 !important;
    color: #98a2b3 !important;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    accent-color: var(--primary);
    vertical-align: middle;
    cursor: pointer;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    cursor: not-allowed;
}

input[type="file"] {
    line-height: 1.4 !important;
}

input[type="file"]::file-selector-button {
    min-height: 30px;
    margin-right: 10px;
    padding: 0 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ui-text);
    font-weight: 650;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: #f0f6f8;
    color: var(--primary);
    border-color: #b9d9e1;
}

.error-message,
.success-message {
    border-radius: var(--radius-md) !important;
    border: 1px solid transparent !important;
}

.error-message {
    background: #fff1f0 !important;
    border-color: #ffccc7 !important;
    color: #b42318 !important;
}

.success-message {
    background: #ecfdf3 !important;
    border-color: #abefc6 !important;
    color: #067647 !important;
}

/* Common product components */
table,
.tx-table,
.order-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: var(--shadow-sm) !important;
}

thead,
table thead,
.tx-table thead,
.order-table thead {
    background: #f8fafc !important;
}

th,
td,
.tx-table th,
.tx-table td,
.order-table th,
.order-table td {
    padding: 11px 12px !important;
    border-bottom: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    text-align: left !important;
}

th,
.tx-table th,
.order-table th {
    color: #475467 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

tbody tr:last-child td {
    border-bottom: none !important;
}

tbody tr:hover {
    background: #fbfdff !important;
}

.modal-overlay,
.as-modal-overlay,
.custom-dialog-overlay {
    background: rgba(15, 23, 42, .46) !important;
    backdrop-filter: blur(6px);
}

.modal,
.as-modal,
.custom-dialog-box,
#assetPickerDialog {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--shadow-xl) !important;
}

.modal h3,
.as-modal h3 {
    color: var(--ui-text) !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
}

.modal-actions,
.as-modal-actions {
    gap: 8px !important;
}

.toast,
#toast,
#admToast {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

.toast.success,
#toast.success,
#admToast.success {
    background: #067647 !important;
    color: #fff !important;
}

.toast.error,
#toast.error,
#admToast.error {
    background: #b42318 !important;
    color: #fff !important;
}

.empty-state,
.empty-asset,
.empty-notif,
.empty,
.rpt-empty,
.rpt-loading,
.loading,
.error-state {
    border-radius: var(--radius-lg) !important;
    color: var(--ui-text-muted) !important;
}

.empty-asset,
.empty-notif,
.rpt-empty,
.rpt-loading {
    border: 1px dashed var(--ui-border-strong) !important;
    background: #fbfdff !important;
}

.loading i,
.error-state i,
.empty-state i,
.empty-asset i,
.empty-notif i {
    color: var(--primary) !important;
}

.page-retry-btn {
    min-height: 36px !important;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: var(--radius-md) !important;
    background: var(--primary) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-xs) !important;
}

.page-retry-btn:hover {
    background: var(--primary-strong) !important;
}

.page-retry-btn:focus-visible {
    outline: 3px solid rgba(12, 113, 128, 0.22) !important;
    outline-offset: 2px !important;
}

.notif-tab,
.as-tab,
.filter-btn,
.tag-btn,
.picker-scope-tab {
    min-height: 34px !important;
    padding: 0 12px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fff !important;
    color: #475467 !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    box-shadow: none !important;
}

.notif-tab:hover,
.as-tab:hover,
.filter-btn:hover,
.tag-btn:hover,
.picker-scope-tab:hover:not(.active) {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
    border-color: #b9d9e1 !important;
}

.notif-tab.active,
.as-tab.active,
.filter-btn.active,
.tag-btn.active,
.picker-scope-tab.active {
    background: #e8f3f6 !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.pagination-bar,
.task-filter-container,
.as-filter {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fbfdff !important;
}

.pagination-bar button,
#prevPageBtn,
#nextPageBtn {
    min-height: 32px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border: 1px solid var(--ui-border) !important;
    background: #fff !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}

.pagination-bar button:not(:disabled):hover,
#prevPageBtn:not(:disabled):hover,
#nextPageBtn:not(:disabled):hover {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Dark theme support for the shared design system */
body.dark {
    --ui-bg: #0f172a;
    --ui-surface: #111827;
    --ui-surface-muted: #172033;
    --ui-text: #e5e7eb;
    --ui-text-muted: #94a3b8;
    --ui-border: #334155;
    --ui-border-strong: #475569;
    --ui-focus: rgba(37, 161, 142, .22);
    color: var(--ui-text) !important;
    scrollbar-color: #475569 #0f172a;
}

body.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark ::-webkit-scrollbar-thumb {
    background: #475569;
    border-color: #0f172a;
}

body.dark .skip-link {
    background: #25a18e;
    color: #052e2b;
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark .form-control {
    background: #0f172a !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #64748b !important;
}

body.dark input:disabled,
body.dark select:disabled,
body.dark textarea:disabled,
body.dark input[readonly],
body.dark textarea[readonly] {
    background: #1e293b !important;
    color: #64748b !important;
    border-color: #334155 !important;
}

body.dark input[type="file"]::file-selector-button {
    background: #111827;
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.dark input[type="file"]::file-selector-button:hover {
    background: #1f2937;
    color: #7dd3c7;
}

body.dark table,
body.dark .tx-table,
body.dark .order-table,
body.dark .card,
body.dark .feature,
body.dark .product-shot,
body.dark .work-item,
body.dark .settings-card,
body.dark .assets-panel,
body.dark .org-card,
body.dark .recharge-card,
body.dark .modal,
body.dark .as-modal,
body.dark .custom-dialog-box,
body.dark #assetPickerDialog,
body.dark .task-item {
    background: var(--ui-surface) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}

body.dark thead,
body.dark table thead,
body.dark .tx-table thead,
body.dark .order-table thead,
body.dark .task-filter-container,
body.dark .as-filter,
body.dark .pagination-bar,
body.dark .empty-asset,
body.dark .empty-notif,
body.dark .rpt-empty,
body.dark .rpt-loading,
body.dark .task-empty,
body.dark .task-meta-grid span,
body.dark .cost-preview,
body.dark #paymentSourceArea,
body.dark .media-upload .upload-controls,
body.dark .media-upload .preview-area,
body.dark .upload-container,
body.dark .file-section {
    background: var(--ui-surface-muted) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

body.dark th,
body.dark td,
body.dark .tx-table th,
body.dark .tx-table td,
body.dark .order-table th,
body.dark .order-table td {
    border-bottom-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

body.dark tbody tr:hover {
    background: #1f2937 !important;
}

body.dark .workbench-titlebar h1,
body.dark .task-panel-card h3,
body.dark .modal h3,
body.dark .as-modal h3,
body.dark .task-prompt,
body.dark .custom-dialog-title,
body.dark .task-id {
    color: var(--ui-text) !important;
}

body.dark .workbench-subtitle,
body.dark .task-subline,
body.dark .custom-dialog-msg,
body.dark .empty-state,
body.dark .empty-asset,
body.dark .empty-notif,
body.dark .rpt-empty,
body.dark .rpt-loading,
body.dark .loading,
body.dark .error-state {
    color: var(--ui-text-muted) !important;
}

body.dark .submit-bar,
body.dark .topbar {
    background: rgba(17, 24, 39, .96) !important;
    border-color: var(--ui-border) !important;
}

body.dark .workbench-status-pill,
body.dark .trial-credit-tip,
body.dark .notif-tab.active,
body.dark .as-tab.active,
body.dark .filter-btn.active,
body.dark .tag-btn.active,
body.dark .picker-scope-tab.active {
    background: rgba(37, 161, 142, .14) !important;
    border-color: rgba(37, 161, 142, .44) !important;
    color: #7dd3c7 !important;
}

body.dark .network-status {
    border-color: var(--ui-border) !important;
    background: rgba(17, 24, 39, .82) !important;
    color: var(--ui-text-muted) !important;
}

body.dark .network-status.is-offline {
    border-color: rgba(248, 113, 113, .44) !important;
    background: rgba(127, 29, 29, .28) !important;
    color: #fca5a5 !important;
}

body.dark .network-status.is-online {
    border-color: rgba(74, 222, 128, .4) !important;
    background: rgba(20, 83, 45, .28) !important;
    color: #86efac !important;
}

body.dark .auth-panel {
    border-color: var(--ui-border) !important;
    background: var(--ui-surface) !important;
}

body.dark .auth-copy-panel {
    background: #020617 !important;
    color: #fff !important;
}

body.dark .notif-tab,
body.dark .as-tab,
body.dark .filter-btn,
body.dark .tag-btn,
body.dark .picker-scope-tab,
body.dark .pagination-bar button,
body.dark #prevPageBtn,
body.dark #nextPageBtn,
body.dark .asset-picker-btn,
body.dark .picker-cancel-btn {
    background: #0f172a !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

body.dark .workbench-badges .info-badge,
body.dark .task-status {
    background: #0f172a !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text-muted) !important;
}

body.dark .task-badge.org {
    background: rgba(37, 161, 142, .14);
    color: #7dd3c7;
}

body.dark .task-badge.pay {
    background: rgba(199, 119, 0, .18);
    color: #f8c471;
}

body.dark .error-message,
body.dark .task-error {
    background: rgba(217, 45, 32, .12) !important;
    border-color: rgba(217, 45, 32, .35) !important;
    color: #fca5a5 !important;
}

body.dark .success-message {
    background: rgba(6, 118, 71, .14) !important;
    border-color: rgba(6, 118, 71, .35) !important;
    color: #86efac !important;
}

/* Auth pages */
body:has(.login-container),
body:has(.register-container) {
    align-items: stretch !important;
    justify-content: center !important;
    background: #f7f9fc !important;
}

.auth-shell {
    width: min(1120px, calc(100vw - 32px));
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, .92fr) minmax(360px, 520px);
    gap: 18px;
    align-items: center;
    margin: 0 auto;
    padding: 34px 0;
}

.auth-panel {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--shadow-lg) !important;
}

.auth-copy-panel {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 34px;
    background: #101828 !important;
    color: #fff !important;
    overflow: hidden;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 780;
    text-decoration: none;
}

.auth-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
}

.auth-kicker {
    margin-bottom: 12px;
    color: #7dd3c7;
    font-size: 13px;
    font-weight: 820;
}

.auth-copy-panel h2 {
    max-width: 520px;
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
}

.auth-copy-panel p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .68);
    font-size: 15px;
    line-height: 1.75;
}

.auth-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-proof-grid span {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    font-weight: 760;
}

.login-container,
.register-container {
    max-width: 430px !important;
    padding: 36px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    text-align: left !important;
    justify-self: stretch;
}

.register-container {
    max-width: 520px !important;
}

.login-header,
.register-header {
    margin-bottom: 28px !important;
    text-align: left !important;
}

.login-header h1,
.register-header h1 {
    justify-content: flex-start !important;
    margin-bottom: 8px !important;
    color: var(--ui-text) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 26px !important;
    line-height: 1.25 !important;
}

.login-header p,
.register-header p,
.form-hint,
.register-link,
.login-link {
    color: var(--ui-text-muted) !important;
}

.login-form,
.register-form {
    gap: 16px !important;
}

.form-group label {
    color: #344054 !important;
    font-weight: 650 !important;
}

.form-group input {
    min-height: 44px !important;
    border-width: 1px !important;
    background: #fff !important;
}

.login-button,
.register-button,
.btn-primary,
.verify-btn {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm) !important;
}

.login-button:hover:not(:disabled),
.register-button:hover:not(:disabled),
.btn-primary:hover,
.verify-btn:hover:not(:disabled) {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.login-button,
.register-button {
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
}

.divider::before,
.divider::after {
    background: var(--ui-border) !important;
}

/* Home shell */
.sidebar {
    background: #fff !important;
    border-right: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
}

.sidebar-logo {
    min-height: 64px !important;
    padding: 18px 20px !important;
    border-bottom-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

.sidebar-logo i {
    color: var(--primary) !important;
}

.org-switcher-wrap {
    border-bottom-color: var(--ui-border) !important;
}

.nav-list {
    padding: 10px 8px !important;
}

.nav-item {
    margin: 2px 0 !important;
    padding: 10px 12px !important;
    border-radius: var(--radius-md) !important;
    color: #475467 !important;
    font-weight: 600 !important;
}

.nav-item:hover {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

.nav-item.active {
    background: #e8f3f6 !important;
    color: var(--primary) !important;
    box-shadow: none !important;
}

.nav-item.active::before {
    content: "";
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: var(--primary);
    margin-left: -6px;
}

.sidebar-footer {
    border-top-color: var(--ui-border) !important;
    color: var(--ui-text-muted) !important;
}

.topbar {
    height: 60px !important;
    border-bottom: 1px solid var(--ui-border) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: none !important;
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    transform: translateX(-100%);
    opacity: 0;
}

body.spa-loading .topbar::after {
    opacity: 1;
    animation: spaLoadingBar 1.1s ease-in-out infinite;
}

@keyframes spaLoadingBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.topbar-title {
    color: var(--ui-text) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.topbar-actions {
    gap: 10px !important;
    position: relative;
    z-index: 1;
}

.trial-credit-tip {
    border-color: #b9dfd8 !important;
    background: #f0fbf8 !important;
    color: #176f63 !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
}

.network-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fff !important;
    color: var(--ui-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.network-status[hidden] {
    display: none !important;
}

.network-status.is-offline {
    border-color: #fecaca !important;
    background: #fff1f2 !important;
    color: #b42318 !important;
}

.network-status.is-online {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #067647 !important;
}

.session-expired-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.62);
    padding: 20px;
}

.session-expired-dialog {
    width: min(400px, 92vw);
    padding: 32px 40px;
    text-align: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

.session-expired-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.session-expired-title {
    font-size: 18px;
    color: var(--ui-text);
    margin: 0 0 8px;
}

.session-expired-text {
    font-size: 14px;
    color: var(--ui-muted);
    margin: 0 0 24px;
}

.session-relogin-btn {
    padding: 12px 32px;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-gradient);
}

.topbar-bell,
.user-avatar,
.sidebar-toggle {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fff !important;
    color: #475467 !important;
    box-shadow: none !important;
}

.topbar-bell:hover,
.sidebar-toggle:hover {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

.topbar-bell .badge {
    background: var(--danger) !important;
}

.user-avatar {
    color: var(--primary) !important;
    font-weight: 750 !important;
}

.user-menu-wrap {
    position: relative;
    z-index: 1001;
}

.user-dropdown,
.custom-dialog-box {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
}

.user-dropdown {
    z-index: 1002 !important;
}

.content-frame {
    background: var(--ui-bg) !important;
    padding: 18px !important;
    position: relative;
    z-index: 0;
}

.content-frame:focus {
    outline: none;
}

.loading {
    gap: 10px !important;
    min-height: 220px !important;
    border: 1px dashed var(--ui-border-strong);
    border-radius: var(--radius-lg);
    background: #fbfdff;
    font-size: 14px;
    font-weight: 650;
}

/* Workbench and common child pages */
.container {
    max-width: 1180px !important;
    margin: 0 auto !important;
}

.card,
.feature,
.product-shot,
.work-item,
.settings-card,
.assets-panel,
.org-card,
.recharge-card {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--shadow-sm) !important;
}

.card:hover {
    transform: none !important;
    box-shadow: var(--shadow-md) !important;
}

.upload-container,
.file-section,
.task-filter-container,
.asset-picker-modal,
.picker-panel {
    border-color: var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
}

.upload-container {
    background: var(--ui-surface-muted) !important;
}

#submitBtn,
#syncBtn,
.download-btn,
.reedit-btn,
.picker-confirm-btn {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

#submitBtn:hover:not(:disabled),
#syncBtn:hover:not(:disabled),
.download-btn:hover:not(:disabled),
.reedit-btn:hover:not(:disabled),
.picker-confirm-btn:hover:not(:disabled) {
    background: var(--primary-dark) !important;
}

.asset-picker-btn,
.picker-cancel-btn {
    background: #fff !important;
    color: var(--ui-text) !important;
    border: 1px solid var(--ui-border) !important;
}

.asset-picker-btn:hover,
.picker-cancel-btn:hover {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

.asset-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.asset-picker-dialog {
    background: #fff;
    border-radius: 16px;
    width: min(90vw, 700px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.asset-picker-header,
.asset-picker-search,
.asset-picker-breadcrumb {
    flex-shrink: 0;
    border-bottom: 1px solid var(--ui-border);
}

.asset-picker-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asset-picker-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-text);
}

.asset-picker-title .fas {
    color: var(--primary);
}

.asset-picker-tabs {
    padding: 8px 20px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ui-border);
    flex-shrink: 0;
    overflow-x: auto;
}

.asset-picker-search {
    padding: 8px 20px;
}

.asset-picker-searchbox {
    position: relative;
    display: flex;
    align-items: center;
}

.asset-picker-searchbox .fa-search {
    position: absolute;
    left: 10px;
    color: var(--ui-muted);
    font-size: 12px;
    pointer-events: none;
}

.asset-picker-searchbox input {
    flex: 1;
    padding: 7px 28px 7px 30px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    outline: none;
    background: #fff;
}

.asset-picker-clear {
    display: none;
    position: absolute;
    right: 6px;
    background: none;
    border: 0;
    color: var(--ui-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
}

.asset-picker-breadcrumb {
    padding: 8px 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.asset-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.asset-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.asset-picker-empty {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--ui-muted);
    font-size: 13px;
}

.asset-picker-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--ui-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.asset-picker-actions {
    display: flex;
    gap: 8px;
}

.as-tab.active,
.filter-btn.active,
.as-action-btn.primary,
.as-modal-ok,
.picker-scope-tab.active {
    background: #e8f3f6 !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.as-action-btn.primary,
.as-modal-ok {
    background: var(--primary) !important;
    color: #fff !important;
}

.as-action-btn:hover,
.filter-btn:hover,
.as-breadcrumb a,
.section-title .icon {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.folder-item:hover,
.org-card:hover,
.asset-card:hover,
.stat-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-md) !important;
}

.drop-zone,
.upload-drop-zone {
    border-color: var(--ui-border-strong) !important;
    border-radius: var(--radius-lg) !important;
    background: #fbfdff !important;
}

.drop-zone.dragover,
.upload-drop-zone.dragover {
    border-color: var(--primary) !important;
    background: #f0f9fb !important;
}

.report-header,
.org-header,
.invite-header,
.pay-header {
    background: #fff !important;
    color: var(--ui-text) !important;
}

.stat-card.primary,
.stat-card,
.member-card,
.invite-card,
.pay-card,
.notification-card {
    border-color: var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
}

.stat-card.primary {
    border-left-color: var(--primary) !important;
}

.amount-display,
.price-card,
.plan-card {
    background: var(--ui-surface-muted) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
}

/* App page shell */
.adm-container,
.as-container,
.st-container,
.rch-container,
.notif-container,
.container {
    width: 100% !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
}

.adm-header,
.as-header,
.st-header,
.rch-header,
.notif-header,
.page-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.adm-header h2,
.as-header h2,
.st-header h2,
.rch-header h2,
.notif-header h2,
.page-header h2,
.page-header h1 {
    margin: 0 !important;
    color: var(--ui-text) !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
    font-weight: 760 !important;
}

.adm-header .subtitle,
.page-header p,
.st-header p,
.rch-header p {
    margin: 6px 0 0 !important;
    color: var(--ui-text-muted) !important;
    font-size: 13px !important;
}

.adm-card,
.as-modal,
.st-card,
.rch-card,
.card,
.balance-card,
.member-list,
.org-header,
.tab-nav,
.notif-list,
.order-list,
.admin-only,
.preview-grid,
.cfg-grid {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--shadow-sm) !important;
}

.adm-card,
.st-card,
.rch-card,
.card {
    padding: 18px !important;
    margin-bottom: 14px !important;
}

.adm-card h3,
.st-card h3,
.rch-card h3,
.card h3 {
    margin: 0 0 14px !important;
    color: var(--ui-text) !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    font-weight: 740 !important;
}

.adm-actions,
.st-actions,
.modal-actions,
.as-modal-actions,
.rpt-actions,
.page-header > div,
.as-header > div,
.notif-header > div {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
}

.adm-btn,
.st-btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline,
.notif-action,
.upload-btn,
.as-modal-ok,
.as-modal-cancel,
.rpt-range-btn {
    min-height: 36px !important;
    padding: 0 13px !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--ui-border) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    box-shadow: none !important;
}

.adm-btn.primary,
.st-btn-primary,
.btn-primary,
.upload-btn,
.as-modal-ok,
.notif-action.primary {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #fff !important;
}

.adm-btn.secondary,
.st-btn-outline,
.btn-outline,
.btn-secondary,
.as-modal-cancel,
.rpt-range-btn {
    background: #fff !important;
    color: #475467 !important;
}

.st-btn-green,
.btn-success {
    border-color: #16a34a !important;
    background: #16a34a !important;
    color: #fff !important;
}

.st-btn-danger,
.btn-danger,
.as-action-btn.danger {
    border-color: #fda29b !important;
    background: #fff1f0 !important;
    color: #b42318 !important;
}

.adm-btn:hover:not(:disabled),
.st-btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.upload-btn:hover:not(:disabled),
.notif-action:hover:not(:disabled),
.rpt-range-btn:hover:not(:disabled) {
    border-color: var(--primary) !important;
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

.adm-btn.primary:hover:not(:disabled),
.st-btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.upload-btn:hover:not(:disabled),
.as-modal-ok:hover:not(:disabled),
.notif-action.primary:hover:not(:disabled) {
    border-color: var(--primary-dark) !important;
    background: var(--primary-dark) !important;
    color: #fff !important;
}

.info-row,
.cfg-item,
.form-group,
.balance-row,
.quick-amounts,
.price-preview,
.rpt-custom {
    gap: 10px !important;
}

.info-row {
    min-height: 44px !important;
    padding: 11px 0 !important;
    border-bottom: 1px solid var(--ui-border) !important;
}

.info-row:last-child {
    border-bottom: 0 !important;
}

.info-label,
.cfg-item label,
.form-group label,
.balance-row .label {
    color: #344054 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.info-value,
.balance-row .value,
.hint,
.desc,
.meta,
.asset-meta,
.folder-meta,
.notif-time {
    color: var(--ui-text-muted) !important;
    font-size: 13px !important;
}

.role-badge,
.asset-badge,
.asset-tag-badge,
.badge,
.status-badge,
.member-role,
.rpt-range-btn.active,
.tab-btn.active {
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 750 !important;
}

.rpt-range-btn.active,
.tab-btn.active {
    border-color: var(--primary) !important;
    background: #e8f3f6 !important;
    color: var(--primary) !important;
}

.as-toolbar,
.notif-tabs,
.pagination-bar,
.tab-nav,
.task-filter-container {
    padding: 10px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--shadow-sm) !important;
}

.as-filter,
.notif-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.as-breadcrumb {
    min-height: 36px !important;
    margin: 12px 0 !important;
    padding: 8px 10px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fff !important;
    color: var(--ui-text-muted) !important;
}

.asset-grid {
    gap: 14px !important;
}

.asset-item,
.folder-item,
.notification-item,
.org-card,
.member-item {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--shadow-sm) !important;
}

.asset-item:hover,
.folder-item:hover,
.notification-item:hover,
.org-card:hover,
.member-item:hover {
    border-color: #b9d9e1 !important;
    box-shadow: var(--shadow-md) !important;
}

.asset-preview {
    border-radius: var(--radius-md) !important;
    background: #f2f4f7 !important;
}

.asset-actions-bar,
.member-actions,
.org-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.as-action-btn {
    min-width: 32px !important;
    min-height: 32px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-sm) !important;
    background: #fff !important;
    color: #475467 !important;
}

.balance-grid,
.rch-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.balance-item,
.quick-amount {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fbfdff !important;
}

.quick-amount:hover,
.quick-amount.active {
    border-color: var(--primary) !important;
    background: #f0f9fb !important;
    color: var(--primary) !important;
}

body.dark .adm-header,
body.dark .as-header,
body.dark .st-header,
body.dark .rch-header,
body.dark .notif-header,
body.dark .page-header {
    background: transparent !important;
}

body.dark .adm-header h2,
body.dark .as-header h2,
body.dark .st-header h2,
body.dark .rch-header h2,
body.dark .notif-header h2,
body.dark .page-header h2,
body.dark .page-header h1,
body.dark .adm-card h3,
body.dark .st-card h3,
body.dark .rch-card h3,
body.dark .card h3 {
    color: var(--ui-text) !important;
}

body.dark .adm-card,
body.dark .st-card,
body.dark .rch-card,
body.dark .card,
body.dark .balance-card,
body.dark .member-list,
body.dark .tab-nav,
body.dark .notif-list,
body.dark .order-list,
body.dark .admin-only,
body.dark .preview-grid,
body.dark .cfg-grid,
body.dark .as-toolbar,
body.dark .notif-tabs,
body.dark .pagination-bar,
body.dark .task-filter-container,
body.dark .as-breadcrumb,
body.dark .asset-item,
body.dark .folder-item,
body.dark .notification-item,
body.dark .member-item,
body.dark .balance-item,
body.dark .quick-amount,
body.dark .as-action-btn,
body.dark .st-btn-outline,
body.dark .btn-outline,
body.dark .btn-secondary,
body.dark .as-modal-cancel,
body.dark .rpt-range-btn {
    border-color: var(--ui-border) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
}

body.dark .info-row {
    border-bottom-color: var(--ui-border) !important;
}

body.dark .info-label,
body.dark .cfg-item label,
body.dark .form-group label,
body.dark .balance-row .label {
    color: var(--ui-text) !important;
}

body.dark .info-value,
body.dark .balance-row .value,
body.dark .hint,
body.dark .desc,
body.dark .meta,
body.dark .asset-meta,
body.dark .folder-meta,
body.dark .notif-time {
    color: var(--ui-text-muted) !important;
}

body.dark .rpt-range-btn.active,
body.dark .tab-btn.active,
body.dark .quick-amount.active {
    border-color: rgba(37, 161, 142, .44) !important;
    background: rgba(37, 161, 142, .14) !important;
    color: #7dd3c7 !important;
}

body.dark .st-btn-danger,
body.dark .btn-danger,
body.dark .as-action-btn.danger {
    border-color: rgba(248, 113, 113, .44) !important;
    background: rgba(127, 29, 29, .28) !important;
    color: #fca5a5 !important;
}

/* Workbench index page */
.workbench-layout {
    max-width: 1360px !important;
}

.workbench-composer-card,
.task-panel-card {
    padding: 22px !important;
}

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

.workbench-titlebar h1 {
    margin: 0 !important;
    color: var(--ui-text) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 24px !important;
    line-height: 1.25 !important;
}

.workbench-titlebar h1 i {
    color: var(--primary) !important;
}

.workbench-subtitle {
    margin: 6px 0 0;
    color: var(--ui-text-muted);
    font-size: 13px;
}

.workbench-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #b9dfd8;
    border-radius: var(--radius-md);
    background: #f0fbf8;
    color: #176f63;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.workbench-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.workbench-badges .info-badge {
    margin: 0 !important;
    border-radius: var(--radius-md) !important;
    background: #f8fafc !important;
    color: #475467 !important;
    border-color: var(--ui-border) !important;
}

.workbench-badges .info-badge.success {
    background: #ecfdf3 !important;
    color: #067647 !important;
    border-color: #abefc6 !important;
}

.workbench-badges .info-badge.error {
    background: #fff1f0 !important;
    color: #b42318 !important;
    border-color: #ffccc7 !important;
}

.parameter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
}

.parameter-grid .col {
    min-width: 0;
}

.parameter-grid label,
.prompt-section label,
.file-section label {
    margin-bottom: 7px !important;
    color: #344054 !important;
    font-size: 13px !important;
}

.parameter-grid select,
.parameter-grid input,
.prompt-section textarea {
    min-height: 42px !important;
    border-width: 1px !important;
}

.prompt-section {
    margin-bottom: 18px;
}

.prompt-section textarea {
    min-height: 132px !important;
    line-height: 1.65 !important;
}

.media-upload {
    display: grid !important;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 14px !important;
    align-items: stretch !important;
    margin-bottom: 14px !important;
}

.media-upload .upload-controls {
    width: auto !important;
    flex: none !important;
    min-height: 132px;
    padding: 16px !important;
    border-width: 1px !important;
    border-style: solid !important;
    background: #fbfdff !important;
}

.media-upload .file-section::before {
    content: "" !important;
}

.media-upload input[type="file"] {
    min-height: 38px !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
}

.media-upload .preview-area {
    min-height: 132px !important;
    padding: 14px !important;
    border-width: 1px !important;
    border-style: solid !important;
    background: #fff !important;
    overflow-x: auto;
}

.media-upload .preview-area:empty::before {
    content: "暂无素材";
    color: #98a2b3;
    font-size: 13px;
    align-self: center;
    margin: auto;
}

.file-item {
    width: 116px !important;
}

.file-item img,
.file-item video,
.audio-preview {
    width: 116px !important;
    height: 116px !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
}

.file-item img:hover,
.file-item video:hover,
.audio-preview:hover {
    transform: none !important;
}

.submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 18px -22px -22px;
    padding: 14px 22px;
    border-top: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.submit-bar #submitBtn {
    min-width: 148px;
    justify-content: center;
}

.cost-preview {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    background: #fbfdff;
    color: #344054 !important;
}

#calcPoints {
    color: var(--primary) !important;
}

#paymentSourceArea {
    border-color: var(--ui-border) !important;
    border-radius: var(--radius-md) !important;
    background: #fbfdff !important;
}

.media-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.payment-source-panel {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 14px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    background: #fbfdff;
    font-size: 13px;
}

.payment-source-title {
    font-weight: 600;
    color: var(--ui-muted);
}

.payment-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-option.is-hidden {
    display: none;
}

.payment-balance-hint {
    font-size: 12px;
    color: var(--ui-muted);
    margin-left: 4px;
}

.task-panel-card .header-actions {
    margin-bottom: 14px !important;
}

.task-panel-card h3 {
    margin: 0 !important;
    color: var(--ui-text) !important;
    font-size: 18px !important;
}

.task-filter-container {
    padding: 12px !important;
    background: #fbfdff !important;
}

.task-item {
    padding: 16px !important;
    border-color: var(--ui-border) !important;
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
}

.task-item:hover {
    transform: none !important;
}

.task-item p {
    margin-bottom: 8px !important;
    font-size: 13px !important;
}

.task-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.task-id {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.task-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--ui-border);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.task-badge.org {
    background: #e8f3f6;
    color: var(--primary);
}

.task-badge.pay {
    background: #fff7e6;
    color: #b54708;
}

.task-prompt {
    margin-bottom: 12px;
    color: var(--ui-text);
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.task-meta-grid span {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-md);
    background: #fbfdff;
    color: #475467;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta-grid strong {
    display: block;
    margin-bottom: 2px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 650;
}

.task-subline,
.task-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.task-subline {
    color: var(--ui-text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.task-actions {
    margin-top: 12px;
}

.task-actions button,
.task-copy-btn {
    min-height: 32px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    font-size: 12px !important;
    box-shadow: none !important;
}

.task-error {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #ffccc7;
    border-radius: var(--radius-md);
    background: #fff1f0;
    color: #b42318;
    font-size: 12px;
}

.task-error span {
    color: #912018;
    word-break: break-word;
}

.task-copy-btn {
    border: 1px solid #ffccc7 !important;
    background: #fff !important;
    color: #b42318 !important;
}

.task-empty {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed var(--ui-border-strong);
    border-radius: var(--radius-lg);
    background: #fbfdff;
    color: var(--ui-text-muted);
    font-size: 14px;
}

.task-empty i {
    font-size: 26px;
    color: #98a2b3;
}

@media (max-width: 1080px) {
    .parameter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .media-upload {
        grid-template-columns: 1fr !important;
    }

    .balance-grid,
    .rch-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 720px) {
    .adm-header,
    .as-header,
    .st-header,
    .rch-header,
    .notif-header,
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .adm-card,
    .st-card,
    .rch-card,
    .card {
        padding: 15px !important;
    }

    .adm-actions,
    .st-actions,
    .modal-actions,
    .as-modal-actions,
    .rpt-actions,
    .page-header > div,
    .as-header > div,
    .notif-header > div {
        align-items: stretch !important;
    }

    .adm-actions button,
    .st-actions button,
    .page-header button,
    .as-header button,
    .notif-header button {
        flex: 1 1 120px !important;
    }

    .info-row {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

    .as-toolbar,
    .notif-tabs,
    .pagination-bar,
    .tab-nav,
    .task-filter-container {
        padding: 8px !important;
    }

    .asset-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    .workbench-composer-card,
    .task-panel-card {
        padding: 16px !important;
    }

    .workbench-titlebar {
        flex-direction: column;
    }

    .parameter-grid {
        grid-template-columns: 1fr !important;
    }

    .submit-bar {
        margin: 16px -16px -16px;
        padding: 12px 16px;
    }

    .submit-bar #submitBtn,
    .cost-preview,
    #paymentSourceArea {
        width: 100%;
    }

    .task-item-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-error {
        grid-template-columns: 1fr;
    }
}

/* Welcome page */
.page .topbar {
    height: 68px !important;
}

.hero {
    min-height: 86vh !important;
}

.eyebrow {
    border-radius: var(--radius-md) !important;
}

.btn-ghost {
    background: #fff !important;
    color: var(--ui-text) !important;
    border-color: var(--ui-border) !important;
}

.btn-ghost:hover {
    background: #f0f6f8 !important;
    color: var(--primary) !important;
}

@media (max-width: 760px) {
    table,
    .tx-table,
    .order-table {
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap !important;
    }

    th,
    td,
    .tx-table th,
    .tx-table td,
    .order-table th,
    .order-table td {
        padding: 9px 10px !important;
        font-size: 12px !important;
    }

    .modal,
    .as-modal,
    .custom-dialog-box,
    #assetPickerDialog {
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
    }

    .modal-actions,
    .as-modal-actions,
    .custom-dialog-actions {
        flex-wrap: wrap !important;
    }

    .modal-actions button,
    .as-modal-actions button,
    .custom-dialog-actions button {
        flex: 1 1 120px !important;
        justify-content: center !important;
    }

    .pagination-bar,
    .task-filter-container,
    .as-filter {
        align-items: stretch !important;
        gap: 8px !important;
    }

    .pagination-bar button,
    #prevPageBtn,
    #nextPageBtn {
        flex: 1 1 90px !important;
        justify-content: center !important;
    }

    .login-container,
    .register-container {
        padding: 28px 20px !important;
    }

    .auth-shell {
        width: calc(100vw - 24px);
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 0;
    }

    .auth-copy-panel {
        min-height: auto;
        padding: 22px;
    }

    .auth-copy-panel h2 {
        font-size: 28px;
    }

    .phone-row {
        flex-direction: column !important;
    }

    .verify-btn {
        width: 100% !important;
    }

    .topbar {
        min-height: 60px !important;
        padding: 8px 10px !important;
        align-items: flex-start !important;
    }

    .topbar-actions {
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 6px !important;
    }

    .topbar-bell,
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .content-frame {
        padding: 12px !important;
    }

    .trial-credit-tip {
        max-width: 170px !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    .network-status {
        max-width: 150px !important;
        min-height: 28px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
        overflow: hidden !important;
    }

    .network-status span {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}
