/* AI WebChat Onboarding Portal Styles */

:root {
    --primary-color: #1fa2ff;
    --primary-dark: #12d8fa;
    --secondary-color: #4dd0e1;
    --success-color: #a6ffcb;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #12d8fa;
    --bg-light: #0b0b0b;
    --bg-dark: #141414;
    --bg-white: #1a1a1a;
    --text-dark: #ffffff;
    --text-gray: #cfd8dc;
    --text-muted: #9e9e9e;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* vfix-2026-06: shared-utilities BEGIN */
/* PORTAL_LOGIN_VISIBILITY_FIX_2026_06_04 */

/* --- Token aliases (fix undefined-var bugs across audits) --- */
:root {
    --text-light: var(--text-dark);
    --primary-hover: var(--primary-dark);
    --card-bg: var(--bg-white);
    --text-color: var(--text-dark);
}

/* --- Chip buttons --- */
.btn-chip-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-chip-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-chip-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-chip-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-chip-secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--primary-color);
}

/* --- Visible link helper (use on every anchor on a dark surface) --- */
.btn-link-visible {
    color: var(--primary-color);
    text-decoration: underline;
}
.btn-link-visible:visited { color: var(--primary-color); }
.btn-link-visible:hover { color: var(--primary-dark); }

/* --- Form-input autofill survival (Chrome/Edge dark-theme fix) --- */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-dark) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--bg-white) inset !important;
    caret-color: var(--text-dark) !important;
    transition: background-color 9999s ease-in-out 0s;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* --- Generic safety net for dark-theme inputs / selects / textareas that
       miss the .form-group wrapper. Apply via .input-dark class. --- */
.input-dark,
input.input-dark,
select.input-dark,
textarea.input-dark {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    color-scheme: dark;
}

/* --- Status text helpers (replace ad-hoc #f44336 / #28a745 hexes) --- */
.text-danger  { color: var(--danger-color); }
.text-success { color: #a6ffcb; }
.text-warning { color: #ffa500; }
.text-muted-safe { color: var(--text-muted); }
.text-gray-safe  { color: var(--text-gray); }

/* --- Light island guard: any element with class .light-island must set
       its own dark text to avoid inheriting --text-dark from body. --- */
.light-island { color: #111 !important; }
.light-island * { color: inherit; }

/* vfix-2026-06: shared-utilities END */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Auth Screen */
.auth-container {
    max-width: 450px;
    margin: 80px auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.auth-container h1 {
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.form-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — form-group input dark surface */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--bg-dark);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* visibility-fix-2026-06: autofill */
/* PORTAL_LOGIN_VISIBILITY_FIX_2026_06_04 — Fix L1 (autofill + placeholder) */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-dark) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--bg-white) inset !important;
    caret-color: var(--text-dark) !important;
    transition: background-color 9999s ease-in-out 0s;
}
.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-gray);
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group select,
.input-group input {
    flex: 1;
}

.input-group span {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000000;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(31, 162, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 6px 16px rgba(31, 162, 255, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #000000;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #3ba3b8;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-back {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.btn-back:hover {
    background: var(--bg-light);
}

/* vfix-2026-06-dashboard: D7 btn-back-hover */
.btn-back:hover { background: rgba(255,255,255,0.08); }

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-gray);
}

.form-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.dashboard-header h1 {
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#username-display {
    font-weight: 500;
    color: var(--text-gray);
}

.dashboard-content {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 4fr 3fr;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.status-card,
.announcements-card,
.widget-code-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.status-card h3,
.announcements-card h3,
.widget-code-card h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.widget-code-card .code-block {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.widget-code-card pre {
    margin: 0 0 15px 0;
    padding: 0;
    background: transparent;
    border: none;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* vfix-2026-06-dashboard: D9 widget-code-theme */
.widget-code-card .code-block { background: var(--bg-dark); border-color: var(--border-color); }
.widget-code-card .code-block pre { color: var(--text-gray); }

.dashboard-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 15px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff !important;
    text-align: center;
    line-height: 1.2;
    min-height: 85px;
    justify-content: center;
}

/* PORTAL_NAVBTN_LABEL_VIS_2026_06_05 — guarantee tile label colour survives any
   later cascade override (audit blocks, inner <span> selectors, cache-stale
   stylesheets). The token --text-dark resolves to #fff under the dark theme,
   but we hard-code the literal so a future redefinition of the token cannot
   silently flip Products/Chat/Calendar/Settings labels dark-on-dark. */
.nav-btn,
.nav-btn > span,
.nav-btn .icon {
    color: #ffffff !important;
}
/* /PORTAL_NAVBTN_LABEL_VIS_2026_06_05 */

.nav-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--primary-color);
}

.nav-btn .icon {
    font-size: 32px;
}

/* vfix-2026-06-dashboard: D3 nav-btn-contrast */
.dashboard-nav { background: var(--bg-light); }
.nav-btn { border: 1px solid rgba(255,255,255,0.25); }
.nav-btn:hover { border-color: var(--primary-color); }

/* Dashboard Quick Navigation */
.dashboard-quick-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.quick-nav-link {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — quick-nav hover uses defined token */
.quick-nav-link:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* Onboarding Form */
.screen-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.screen-header h1 {
    font-size: 28px;
}

.onboarding-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-bottom: 3px solid var(--border-color);
    color: var(--text-gray);
    font-weight: 500;
    font-size: 14px;
}

.progress-step.active {
    /* Bright cyan — the medium-blue --primary-color (#1fa2ff) was too low-contrast
       to read on the dark progress bar (matches the .option-amount fix). */
    color: #4dd0e1;
    border-bottom-color: #4dd0e1;
}

.progress-step.completed {
    color: var(--success-color);
    border-bottom-color: var(--success-color);
}

.onboarding-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-step h2 {
    margin-bottom: 30px;
    font-size: 24px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    flex: 1;
}

#services-list {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    flex-wrap: wrap;
}

.service-item input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.service-item .service-name {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
}

.service-item .service-price {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
}

.service-item .service-currency {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
}

/* Legacy support for old input[type="text"] selector */
.service-item input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
}

.review-content {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.review-section {
    margin-bottom: 20px;
}

/* PORTAL_WIZARD_SUMMARY_HEADING_VIS_2026_06_05
   Wizard Summary cards sit on the dark --bg-white (#1a1a1a) surface; the
   brand cyan --primary-color only gives ~5.4:1 contrast and reads as dim
   (same failure as the login Register/Forgot links pre-blanket fix).
   Match the white weight of the field labels in the same card. */
.review-section h3 {
    margin-bottom: 10px;
    color: #ffffff !important;
}

.review-section p {
    margin: 5px 0;
}

/* Settings */
.settings-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.settings-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Account */
.account-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.account-section {
    margin-bottom: 40px;
}

.account-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.danger-zone {
    padding: 30px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    border-radius: 8px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(31, 162, 255, 0.15);
    border: 1px solid var(--info-color);
    color: #12d8fa;
}

.alert-success {
    background: rgba(166, 255, 203, 0.15);
    border: 1px solid var(--success-color);
    color: #a6ffcb;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger-color);
    color: #ff6b6b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning-color);
    color: #ffa500;
}

.warning {
    color: var(--danger-color);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    /* Cap height so tall content (e.g. long example-product preview)
       scrolls inside the modal instead of pushing the action buttons
       off-screen where they can't be reached. */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-actions .btn {
    flex: 1;
}

/* Toast Messages */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    /* vfix-2026-06-dashboard: D11 toast-color */
    color: var(--text-dark);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .auth-container {
        margin: 20px auto;
        padding: 30px 20px;
    }

    .onboarding-progress {
        flex-direction: column;
        gap: 10px;
    }

    .progress-step {
        border-bottom: none;
        border-left: 3px solid var(--border-color);
        text-align: left;
    }

    .progress-step.active {
        border-left-color: #4dd0e1;
    }

    .dashboard-nav {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .modal-actions {
        flex-direction: column;
    }

    #toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Config Data View */
#config-data-view {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

#config-data-view pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-gray);
}

/* QR Code */
#qr-code-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#qr-code-container img {
    max-width: 200px;
}

#2fa-secret {
    background: var(--bg-dark);
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

/* Account Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(166, 255, 203, 0.2);
    color: #a6ffcb;
}

.status-badge.trial {
    background: rgba(245, 158, 11, 0.2);
    color: #ffa500;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

/* Tab Navigation */
.tab-container {
    display: flex;
    gap: 10px;
    margin: 20px 20px 0 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-gray);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Subtab Navigation */
.subtab-container {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--bg-dark);
    padding: 5px;
    border-radius: 8px;
}

.subtab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    color: var(--text-gray);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.subtab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

.subtab-btn.active {
    background: var(--primary-color);
    color: white;
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* Help Hints */
.help-hint {
    display: inline-block;
    cursor: help;
    color: var(--info-color);
    background: rgba(18, 216, 250, 0.15);
    border: 1px solid var(--info-color);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 16px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0.8;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.help-hint:hover {
    opacity: 1;
    background: rgba(18, 216, 250, 0.25);
    transform: scale(1.1);
}


/* ==============================================================
   WORKSPACE SWITCHER STYLES
   ============================================================== */

.workspace-switcher {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.workspace-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.workspace-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.workspace-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.workspace-btn.active {
    background: rgba(77, 208, 225, 0.2);
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(77, 208, 225, 0.1);
}

.workspace-icon {
    font-size: 18px;
}

.workspace-name {
    font-weight: 500;
}

/* Workspace Placeholder for Coming Soon products */
.workspace-placeholder {
    display: none;
    padding: 60px 20px;
    text-align: center;
}

.placeholder-content {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.placeholder-content h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.placeholder-content p {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 15px;
    line-height: 1.6;
}

.placeholder-status {
    margin: 20px 0;
}

.placeholder-text {
    font-size: 14px;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info {
    background: rgba(18, 216, 250, 0.2);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}



/* Product Selection Checkboxes */
.product-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-checkbox {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.product-checkbox.checked {
    background: rgba(77, 208, 225, 0.15);
    border-color: var(--secondary-color);
}

.product-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

.product-checkbox-content {
    flex: 1;
}

.product-checkbox-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.product-checkbox-icon {
    font-size: 20px;
}

.product-checkbox-description {
    font-size: 13px;
    color: var(--text-gray);
}

.product-checkbox-badge {
    display: inline-block;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ff9800;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.product-checkbox.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-checkbox.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

/* Product Items and Categories */
.product-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    transition: all 0.2s ease;
}

.product-item.category-box {
    background: rgba(77, 208, 225, 0.1);
    border: 2px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(77, 208, 225, 0.15);
}

.category-label {
    background: var(--secondary-color);
    color: #000000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    margin-left: 10px;
    letter-spacing: 0.5px;
}

.product-label {
    background: var(--primary-color);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    margin-left: 10px;
    letter-spacing: 0.5px;
}

.expand-icon {
    cursor: pointer;
    font-size: 1.2em;
    user-select: none;
    color: var(--secondary-color);
    transition: transform 0.2s ease;
}

.expand-icon:hover {
    transform: scale(1.2);
}


/* ============================================================
   REFERRALS PAGE STYLES
   ============================================================ */

.referrals-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.referral-activation-prompt {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.referral-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.referral-benefits {
    text-align: left;
    margin: 30px 0;
    padding: 20px;
    background: rgba(77, 208, 225, 0.1);
    border-radius: 8px;
}

.referral-benefits ul {
    list-style: none;
    padding-left: 0;
}

.referral-benefits li {
    padding: 8px 0;
    font-size: 16px;
}

.payment-method-selection {
    margin: 30px 0;
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.payment-option {
    cursor: pointer;
}

.payment-option input[type="radio"] {
    display: none;
}

.option-card {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.payment-option input[type="radio"]:checked + .option-card {
    border-color: var(--primary-color);
    background: rgba(77, 208, 225, 0.1);
}

.option-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.option-amount {
    font-size: 24px;
    font-weight: 700;
    /* Bright cyan accent — the medium-blue --primary-color (#1fa2ff) was too
       low-contrast to read on the near-black option cards. */
    color: #4dd0e1;
    margin: 10px 0;
}

.option-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.referral-link-section {
    margin-bottom: 30px;
}

.referral-link-display {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* vfix-2026-06-dashboard: D1 referral-input-color */
.referral-link-display input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: monospace;
    background: var(--bg-dark);
    color: var(--text-dark);
}

.referral-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.customize-form {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
    display: flex;
    gap: 10px;
}

.customize-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.stat-card.stat-active {
    border-left-color: #4caf50;
}

.stat-card.stat-trial {
    border-left-color: #ff9800;
}

.stat-card.stat-earnings {
    border-left-color: #2196f3;
}

.stat-card.stat-pending {
    border-left-color: #9c27b0;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-settings,
.invoice-details,
.referral-rules,
.referrals-list {
    margin-bottom: 30px;
}

.current-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 15px;
}

.payment-change-form,
.bank-form,
.invoice-form {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-top: 15px;
}

.bank-details-section h4 {
    margin-bottom: 10px;
}

.warning-text {
    color: #ff9800;
    font-weight: 500;
    margin: 10px 0;
}

.rules-content ol {
    padding-left: 20px;
}

.rules-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.rules-content .note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
    border-radius: 4px;
}

.table-responsive {
    overflow-x: auto;
}

.referrals-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.referrals-table th,
.referrals-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.referrals-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.referrals-table tr:hover {
    background: var(--bg-light);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — status badges use dark-theme tokens */
.status-trial {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-active {
    background: rgba(166, 255, 203, 0.15);
    color: var(--success-color);
}

.status-cancelled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.recurring-status {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 3px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 18px;
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — btn-link stays visible on primary parents */
.btn-link {
    background: rgba(31, 162, 255, 0.12);
    color: var(--primary-color);
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .payment-options {
        grid-template-columns: 1fr;
    }

    .stats-summary {
        grid-template-columns: 1fr 1fr;
    }

    .current-method {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .referral-link-display {
        flex-direction: column;
    }
}


/* ============================================================
   Phase 2 / Step 2 — Account & Settings hub sub-tab strip
   ============================================================
   Rendered programmatically by js/account.js and js/settings-hub.js
   at the top of the active screen body (just below .screen-header). */

/* PORTAL_SUBTAB_VISIBILITY_2026_06_04 — chip-shaped inactive tabs */
.portal-subtab-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 20px;
    padding: 6px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.portal-subtab {
    appearance: none;
    background: var(--bg-dark);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.portal-subtab:hover {
    color: var(--text-dark);
    background: rgba(31, 162, 255, 0.12);
    border-color: rgba(31, 162, 255, 0.4);
}

/* PORTAL_SUBTAB_ACTIVE_HARDEN_2026_06_05 — literal hex + !important so the
   active subtab survives any future :root token override, audit block, or
   same-specificity collision; covers :hover/:focus so the active pill does
   not regress when pointed at or keyboard-focused. */
.portal-subtab.active,
.portal-subtab.active:link,
.portal-subtab.active:visited {
    background: #1fa2ff !important;
    color: #0b0b0b !important;
    border-color: #1fa2ff !important;
}
.portal-subtab.active:hover,
.portal-subtab.active:focus {
    background: #1fa2ff !important;
    color: #0b0b0b !important;
    border-color: #1fa2ff !important;
}
/* /PORTAL_SUBTAB_ACTIVE_HARDEN_2026_06_05 */


/* ============================================================
   Phase 2 / Step 2 — Settings → Users page
   ============================================================ */

.users-content {
    padding: 20px 0;
}

.mobile-app-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.mobile-app-panel__title {
    margin: 0 0 4px;
    color: var(--text-dark);
    font-size: 16px;
}

.mobile-app-panel__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mobile-app-panel__buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #000;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.mobile-app-store-btn:hover {
    border-color: var(--primary-color);
}

.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.users-headcount {
    color: var(--text-muted);
    font-size: 13px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.user-row__color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-row__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-row__name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

.user-row__login {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.user-row__meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.user-row__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-gray);
}

.user-row__badge--active   { background: rgba(76, 175, 80, 0.16); color: #a6ffcb; }
.user-row__badge--inactive { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.user-row__badge--pending  { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }

.user-row__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.user-row__action-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-gray);
    cursor: pointer;
}

.user-row__action-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-dark);
}

.user-row__action-btn--danger:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}


/* ============================================================
   Phase 2 / Step 2 — Users modal (Add / Edit / Reveal QR)
   ============================================================ */

.users-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.users-modal__panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-width: 720px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.users-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.users-modal__title {
    margin: 0;
    color: var(--text-dark);
    font-size: 18px;
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — users-modal close icon visible */
.users-modal__close {
    background: transparent;
    border: 0;
    color: var(--text-dark);
    font-size: 22px;
    cursor: pointer;
}

.users-modal__body { padding: 20px 24px; }
.users-modal__footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.users-form-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.users-form-tab {
    background: transparent;
    border: 0;
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.users-form-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.users-form-panel { display: none; }
.users-form-panel.active { display: block; }

.users-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.users-color-swatch.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.users-passphrase-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: #fcd34d;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.users-passphrase-display {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 24px;
    text-align: center;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 14px 0;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.users-username-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.users-username-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-gray);
    cursor: pointer;
}

.users-username-chip:hover {
    border-color: var(--primary-color);
    color: var(--text-dark);
}

.users-qr-svg {
    display: block;
    margin: 16px auto;
    width: 256px;
    height: 256px;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
}

.users-error-block {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--danger-color);
    color: #fca5a5;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

.users-permissions-section {
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
}

.users-permissions-section h4 {
    margin: 0 0 10px;
    color: var(--text-dark);
    font-size: 14px;
}

.users-permissions-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--text-gray);
    font-size: 13px;
    cursor: pointer;
}


/* ===========================================================================
   Promo messages (Settings hub sub-tab)
   =========================================================================== */
.promo-rte-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.promo-rte-toolbar button {
    min-width: 34px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
}

.promo-rte-toolbar button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.promo-rte-editor {
    min-height: 120px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    background: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    line-height: 1.5;
}

.promo-rte-editor:focus {
    border-color: var(--primary-color);
}

.promo-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
}

.promo-card__thumb {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex: 0 0 auto;
}

.promo-card__main {
    flex: 1 1 auto;
    min-width: 0;
}

.promo-card__body {
    margin-bottom: 8px;
    color: var(--text-gray);
    word-break: break-word;
}

.promo-card__meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    margin-bottom: 10px;
}

.promo-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.promo-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.promo-status-badge--active {
    background: rgba(166, 255, 203, 0.15);
    border: 1px solid var(--success-color);
    color: #a6ffcb;
}

.promo-status-badge--paused {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning-color);
    color: #ffa500;
}

/* PORTAL_VISIBILITY_UTILS_2026_06_04 — promo archived badge uses text-gray */
.promo-status-badge--archived {
    background: rgba(158, 158, 158, 0.15);
    border: 1px solid var(--text-muted);
    color: var(--text-gray);
}

.promo-card__actions .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}


/* vfix-2026-06-dashboard: D4 alert-text-contrast */
.alert-success { color: var(--text-dark); border-color: #a6ffcb; }
.alert-success strong, .alert-success a { color: #a6ffcb; }
.alert-info { color: var(--text-dark); border-color: #12d8fa; }
.alert-info strong, .alert-info a { color: #12d8fa; }

/* vfix-2026-06-dashboard: D5 status-pills */
.status-trial    { color: #ffa500; }
.status-active   { color: #a6ffcb; }
.status-cancelled{ color: #ff6b6b; }

/* vfix-2026-06-dashboard: D6 referral-row-hover */
.referrals-table tr:hover { background: rgba(255,255,255,0.05); }

/* PORTAL_VISIBILITY_UTILS_2026_06_04 */
/* Shared visibility utilities. Use these instead of bare inline color/background
   on chips, anchors-as-buttons, close icons, and status hints so the dark-theme
   tokens (and any future theme flip) drive contrast in ONE place. */

.btn-chip-primary {
    background: var(--primary-color, #1fa2ff);
    color: #ffffff;
    border: 0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
}
.btn-chip-primary:hover {
    background: var(--primary-dark, #12d8fa);
    color: #ffffff;
}

.btn-chip-secondary {
    background: transparent;
    color: var(--text-dark, #ffffff);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.25));
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
}
.btn-chip-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dark, #ffffff);
}

/* Chip variant for use on light/pastel parents (e.g. .alert-success Go-to-login
   links, light-bg announcement cards). Forces dark text on a white pill. */
.btn-chip-on-light {
    background: #ffffff;
    color: #111111;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
}
.btn-chip-on-light:hover {
    background: #f3f4f6;
    color: #111111;
}

.btn-link-visible {
    color: var(--primary-color, #1fa2ff);
    text-decoration: underline;
    font-weight: 500;
}
.btn-link-visible:visited {
    color: var(--primary-color, #1fa2ff);
}
.btn-link-visible:hover {
    color: var(--primary-dark, #12d8fa);
    text-decoration: underline;
}

/* Modal/announcement close (X) icon. Always render with its own affordance
   regardless of the surrounding accent color or theme. */
.modal-close-visible {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.6);
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-close-visible:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #000000;
}
/* Dark-surface variant for modals that live on var(--bg-white). */
.modal-close-visible.on-dark {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark, #ffffff);
}
.modal-close-visible.on-dark:hover {
    background: rgba(255, 255, 255, 0.16);
    color: var(--text-dark, #ffffff);
}

/* Inline-code chip used in modal copy ("set a new password" prompts etc.). */
.inline-code-chip {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark, #ffffff);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.95em;
}

/* Generic typography helpers for dark-surface content. */
.text-on-surface {
    color: var(--text-dark, #ffffff);
}
.text-muted-on-surface {
    color: var(--text-muted, #9e9e9e);
}
.text-readable-on-surface {
    color: var(--text-gray, #cfd8dc);
}

/* Replacement for legacy inline `<small style="color:#666">💡 ...</small>`
   tip lines that disappear on the dark theme. */
.form-hint {
    color: var(--text-muted, #9e9e9e);
    font-size: 0.85em;
    display: block;
    margin-top: 4px;
}

/* Replacement for legacy `style="color:#888"` muted paragraphs inside dark
   modals/cards. Stays readable everywhere. */
.muted-paragraph {
    color: var(--text-muted, #9e9e9e);
}

/* Forced light-surface text — use when a textarea/input is intentionally
   given a light background (e.g. recovery-codes box, widget-snippet box)
   so the inherited white body color doesn't make the content invisible. */
.input-on-light {
    color: #0b0b0b;
    background: #f5f5f5;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.15));
}

/* Empty-state placeholder used for "No announcements" / "No products yet"
   copy. Readable on every dark card without being shouty. */
.empty-state {
    color: var(--text-gray, #cfd8dc);
    font-style: italic;
}

/* Dark-surface status badges. Replace inline `color:green`/`color:red` text
   with these chips so contrast survives the dark theme. */
.badge-active {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(166, 255, 203, 0.15);
    color: var(--success-color, #a6ffcb);
}
.badge-inactive {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color, #EF4444);
}
.badge-pending {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color, #F59E0B);
}

/* Dark-friendly form input override. Apply to any input/select/textarea that
   was previously rendered with only `border: 1px solid #ddd` and no bg/color
   — guarantees the field is distinct from its dark parent. */
.input-dark {
    background: var(--bg-dark, #141414);
    color: var(--text-dark, #ffffff);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.25));
    border-radius: 4px;
    padding: 8px 10px;
}
.input-dark::placeholder {
    color: var(--text-muted, #9e9e9e);
}

/* Stronger input border for the auth screen, where the default
   rgba(255,255,255,0.1) border melts into the panel. */
.auth-container .form-group input,
.auth-container .form-group select,
.auth-container .form-group textarea {
    background: var(--bg-dark, #141414);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Make Terms / Privacy / DPA / inline support-ticket anchors in the auth
   screen visibly link-coloured regardless of visited state. */
.auth-container .consent-group a,
.auth-container a.form-switch-link {
    color: var(--primary-color, #1fa2ff);
    text-decoration: underline;
}
.auth-container .consent-group a:visited,
.auth-container a.form-switch-link:visited {
    color: var(--primary-color, #1fa2ff);
}

/* Override for cancelled calendar bookings — base .cell-booking / .tl-chip
   use color:var(--on-accent) (white) which fails on var(--hint) gray. */
.cell-booking.is-cancelled,
.tl-chip.is-cancelled {
    color: #1a1a1a;
}
.booking-card .status.cancelled,
.booking-card .reason.cancelled_by_client {
    color: var(--bg, #1a1a1a);
}

/* Define the missing .ghost-btn used by booking-card.js / customers.js note
   remove (✕) so it renders as a real chip instead of a UA-default button. */
.ghost-btn {
    background: transparent;
    color: var(--text, #ffffff);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    line-height: 1.2;
}
.ghost-btn.tiny {
    font-size: 12px;
    padding: 1px 6px;
}
.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text, #ffffff);
}

/* PORTAL_LOGIN_LABELS_VIS_2026_06_04 — auth-container title + switch links specificity */
.auth-container h1.text-on-surface {
    color: var(--text-dark, #ffffff) !important;
}
/* PORTAL_LOGIN_LABELS_VIS_VISITED_2026_06_05 — extend 2026_06_04 fix to cover
   :link and :visited explicitly. Register/Forgot anchors use href="#" so once
   clicked the browser flips them into the UA :visited state (dark purple).
   The previous fix only covered the default + :hover states, leaving :visited
   unprotected and producing the "links still dark" symptom. Also adds :focus
   parity so keyboard users see the same affordance. Literal hex fallbacks
   guard against a stylesheet-load-order race nulling the CSS variable. */
/* PORTAL_LOGIN_LABELS_VIS_WHITE_2026_06_05 — bump anchor color from
   --primary-color (cyan #1fa2ff, ~5.4:1 contrast on var(--bg-white))
   to flat #ffffff (~16:1 contrast) so Register / Forgot password? read
   as boldly as the "Sign In" header. Hover keeps cyan as the
   interaction-state cue. */
.auth-container .form-switch a.btn-link-visible,
.auth-container .form-switch a.btn-link-visible:link,
.auth-container .form-switch a.btn-link-visible:visited,
.form-switch a.btn-link-visible,
.form-switch a.btn-link-visible:link,
.form-switch a.btn-link-visible:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600;
}
.auth-container .form-switch a.btn-link-visible:hover,
.auth-container .form-switch a.btn-link-visible:focus,
.form-switch a.btn-link-visible:hover,
.form-switch a.btn-link-visible:focus {
    color: var(--primary-color, #1fa2ff) !important;
    text-decoration: underline !important;
}
/* /PORTAL_LOGIN_LABELS_VIS_VISITED_2026_06_05 */
/* /PORTAL_LOGIN_LABELS_VIS_2026_06_04 */
/* /PORTAL_VISIBILITY_UTILS_2026_06_04 */

/* PORTAL_ANCHOR_VIS_BLANKET_2026_06_05 */
/* =========================================================================
   PORTAL_ANCHOR_VIS_BLANKET_2026_06_05
   Blanket high-contrast anchor visibility on every dark portal surface.
   Synthesized from 14 audits (login/register/forgot/reset, wizard, modals,
   dashboard, settings, calendar mini-app, account hub, users/products admin,
   alerts, success banners, JS-injected anchors).
   Goal: NO anchor on a dark surface in the portal renders below ~10:1.
   ========================================================================= */

/* --- 1. Reusable utility class (used by per-file class additions + JS) ---- */
.btn-link-visible,
.btn-link-visible:link,
.btn-link-visible:visited,
a.btn-link-visible,
a.btn-link-visible:link,
a.btn-link-visible:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    text-decoration-thickness: 1px !important;
    font-weight: 600 !important;
    background: transparent !important;
}
.btn-link-visible:hover,
.btn-link-visible:focus,
a.btn-link-visible:hover,
a.btn-link-visible:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
    outline: none;
}

/* --- 2. Blanket: every anchor inside the auth box (login / register /
       forgot-password / reset-password / email-verification screens) ------- */
.auth-container a,
.auth-container a:link,
.auth-container a:visited,
.auth-container p a,
.auth-container p a:link,
.auth-container p a:visited,
.auth-container .form-switch a,
.auth-container .form-switch a:link,
.auth-container .form-switch a:visited,
.auth-container .consent-group a,
.auth-container .consent-group a:link,
.auth-container .consent-group a:visited,
.auth-container #email-verification-form a,
.auth-container #email-verification-form a:link,
.auth-container #email-verification-form a:visited,
.auth-container #reset-password-form a,
.auth-container #reset-password-form a:link,
.auth-container #reset-password-form a:visited,
.auth-container #forgot-password-form a,
.auth-container #forgot-password-form a:link,
.auth-container #forgot-password-form a:visited,
.auth-container #login-form a,
.auth-container #login-form a:link,
.auth-container #login-form a:visited,
.auth-container #register-form a,
.auth-container #register-form a:link,
.auth-container #register-form a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
}
.auth-container a:hover,
.auth-container a:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
}

/* --- 3. Blanket: .form-switch a (Register / Forgot password? / Back to
       Sign In / Sign In / Back to Login switch links) anywhere ------------- */
.form-switch a,
.form-switch a:link,
.form-switch a:visited,
p.form-switch a,
p.form-switch a:link,
p.form-switch a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
}
.form-switch a:hover,
.form-switch a:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
}

/* --- 4. Blanket: .consent-group a (Terms / Privacy / DPA) anywhere -------- */
.consent-group a,
.consent-group a:link,
.consent-group a:visited,
.consent-group label a,
.consent-group label a:link,
.consent-group label a:visited,
.consent-group span a,
.consent-group span a:link,
.consent-group span a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 500 !important;
}
.consent-group a:hover,
.consent-group a:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
}

/* --- 5. Modal anchors (Stripe-pricing link, service-picker breadcrumb,
       JS-built confirmation links inside .modal / .modal-content) --------- */
.modal a,
.modal a:link,
.modal a:visited,
.modal-content a,
.modal-content a:link,
.modal-content a:visited,
.modal p a,
.modal p a:link,
.modal p a:visited,
.modal .muted a,
.modal .muted a:link,
.modal .muted a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 500 !important;
}
.modal a:hover,
.modal a:focus,
.modal-content a:hover,
.modal-content a:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
}

/* --- 6. Alert/banner anchors on dark surface (.alert-info, .alert-success,
       .alert-error, .alert-warning) — JS-injected "Go to Login" CTAs etc. - */
.alert a,
.alert a:link,
.alert a:visited,
.alert-info a,
.alert-info a:link,
.alert-info a:visited,
.alert-success a,
.alert-success a:link,
.alert-success a:visited,
.alert-error a,
.alert-error a:link,
.alert-error a:visited,
.alert-warning a,
.alert-warning a:link,
.alert-warning a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
}
.alert a:hover,
.alert a:focus {
    color: #4fc3f7 !important;
    text-decoration: underline !important;
}

/* --- 7. .btn-link utility — used inside modals, dashboard, promo cards.
       Force pill-style high contrast on dark surfaces. -------------------- */
.btn-link,
.btn-link:link,
.btn-link:visited,
a.btn-link,
a.btn-link:link,
a.btn-link:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    background: rgba(31, 162, 255, 0.12) !important;
    font-weight: 600 !important;
}
.btn-link:hover,
.btn-link:focus {
    color: #4fc3f7 !important;
    background: rgba(31, 162, 255, 0.22) !important;
    text-decoration: underline !important;
}

/* --- 8. Calendar mini-app rules (#svc-breadcrumb, .text-btn, .tl-restore-*,
       any modal link). calendar.css surfaces use --surface #1a1a1a / --bg
       #0b0b0b. We also paint :visited so the UA purple never wins. --------- */
#svc-breadcrumb a,
#svc-breadcrumb a:link,
#svc-breadcrumb a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}
#svc-breadcrumb a:hover,
#svc-breadcrumb a:focus {
    color: #4fc3f7 !important;
}
.text-btn,
.text-btn:link,
.text-btn:visited,
.tl-restore-chip,
.tl-restore-chip:link,
.tl-restore-chip:visited,
.tl-restore-all,
.tl-restore-all:link,
.tl-restore-all:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}
.text-btn:hover,
.text-btn:focus,
.tl-restore-chip:hover,
.tl-restore-chip:focus,
.tl-restore-all:hover,
.tl-restore-all:focus {
    color: #4fc3f7 !important;
}

/* --- 9. Permissions banner / info-box anchors (users admin "Settings →
       Chat settings" link inside booking-disabled info panel) -------------- */
.info-banner a,
.info-banner a:link,
.info-banner a:visited,
.permissions-info a,
.permissions-info a:link,
.permissions-info a:visited,
.x-form-help a,
.x-form-help a:link,
.x-form-help a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

/* --- 10. Suggestion-chip anchors (wizard #company_name_message "did you
       mean..." links) ------------------------------------------------------ */
#company_name_message a,
#company_name_message a:link,
#company_name_message a:visited {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

/* --- 11. Global safety net: any bare anchor on the dark portal body that
       has NO container class hits a UA #0000EE / #551A8B fallback. Force a
       portal-wide default so future ad-hoc <a>s ship visible by default. --- */
body a,
body a:link,
body a:visited {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}
body a:hover,
body a:focus {
    color: #4fc3f7;
    text-decoration: underline;
}

/* --- 12. Kill UA :visited purple on every named portal anchor selector.
       Belt-and-braces in case any earlier rule loses specificity. ---------- */
.auth-container a:visited,
.form-switch a:visited,
.consent-group a:visited,
.modal a:visited,
.modal-content a:visited,
.alert a:visited,
.alert-info a:visited,
.alert-success a:visited,
.alert-error a:visited,
.alert-warning a:visited,
.btn-link:visited,
.btn-link-visible:visited,
#svc-breadcrumb a:visited,
.text-btn:visited,
.tl-restore-chip:visited,
.tl-restore-all:visited,
.info-banner a:visited,
.permissions-info a:visited,
.x-form-help a:visited,
#company_name_message a:visited {
    color: #ffffff !important;
}

/* === END PORTAL_ANCHOR_VIS_BLANKET_2026_06_05 ============================ */
/* /PORTAL_ANCHOR_VIS_BLANKET_2026_06_05 */
