/* Global UI/UX consistency overrides (2026-02-19)
 * Applies cross-module normalization for Marketplace, CRM, and Dashboard surfaces.
 */

:root {
    --rc-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --rc-fs-100: 0.75rem;
    --rc-fs-200: 0.875rem;
    --rc-fs-300: 1rem;
    --rc-fs-400: 1.125rem;
    --rc-fs-500: 1.25rem;
    --rc-fs-600: 1.5rem;

    --rc-lh-tight: 1.25;
    --rc-lh-body: 1.5;
    --rc-lh-relaxed: 1.6;

    --rc-fw-regular: 400;
    --rc-fw-medium: 500;
    --rc-fw-semibold: 600;
    --rc-fw-bold: 700;

    --rc-color-primary: var(--brand-primary, #0d6efd);
    --rc-color-primary-hover: #0b5ed7;
    --rc-color-primary-soft: rgba(13, 110, 253, 0.12);
    --rc-color-secondary: #6c757d;
    --rc-color-accent: #7c3aed;
    --rc-color-border: var(--border-color, #e9ecef);
    --rc-color-surface: #ffffff;
    --rc-color-surface-soft: #f8f9fa;
    --rc-color-text: #212529;
    --rc-color-text-muted: #6c757d;

    --rc-radius-sm: 8px;
    --rc-radius-md: 12px;
    --rc-radius-lg: 16px;
    --rc-radius-pill: 999px;

    --rc-space-1: 4px;
    --rc-space-2: 8px;
    --rc-space-3: 12px;
    --rc-space-4: 16px;
    --rc-space-5: 24px;
    --rc-space-6: 32px;

    --rc-ease-standard: 180ms ease;
    --rc-shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
    --rc-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] {
    --rc-color-border: #373b3e;
    --rc-color-surface: #2b3035;
    --rc-color-surface-soft: #212529;
    --rc-color-text: #f8f9fa;
    --rc-color-text-muted: #adb5bd;
}

body {
    font-family: var(--rc-font-family);
    font-size: var(--rc-fs-300);
    line-height: var(--rc-lh-body);
    color: var(--rc-color-text);
}

h1, h2, h3, h4, h5, h6 {
    line-height: var(--rc-lh-tight);
    letter-spacing: -0.01em;
}

.small,
small {
    font-size: var(--rc-fs-200);
    line-height: var(--rc-lh-body);
}

.text-muted {
    color: var(--rc-color-text-muted) !important;
}

a {
    transition: color var(--rc-ease-standard), opacity var(--rc-ease-standard);
}

a,
button,
.btn,
.card,
.deal-card,
.modal,
.modal-dialog,
.modal-content {
    transition: all 0.2s ease-in-out;
}

a.text-primary,
.text-primary {
    color: var(--rc-color-primary) !important;
}

.bg-primary,
.btn-primary {
    background-color: var(--rc-color-primary) !important;
    border-color: var(--rc-color-primary) !important;
}

.btn {
    border-radius: var(--rc-radius-sm);
    font-weight: var(--rc-fw-medium);
    transition: transform var(--rc-ease-standard), box-shadow var(--rc-ease-standard), background-color var(--rc-ease-standard), border-color var(--rc-ease-standard);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--rc-color-primary-hover) !important;
    border-color: var(--rc-color-primary-hover) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.18);
}

.btn-outline-primary {
    color: var(--rc-color-primary);
    border-color: var(--rc-color-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--rc-color-primary-soft);
    color: var(--rc-color-primary);
}

.btn-sm {
    border-radius: var(--rc-radius-sm);
    font-size: var(--rc-fs-200);
}

.btn-lg {
    border-radius: var(--rc-radius-md);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    transform: none;
    cursor: not-allowed;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: var(--rc-radius-sm);
    border: 1px solid var(--rc-color-border);
    min-height: 40px;
    transition: border-color var(--rc-ease-standard), box-shadow var(--rc-ease-standard), background-color var(--rc-ease-standard);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(13, 110, 253, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.14);
}

.input-group-text {
    border-color: var(--rc-color-border);
}

.card {
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-sm);
}

.card-header {
    padding: var(--rc-space-4) var(--rc-space-5);
}

.card-body {
    padding: var(--rc-space-5);
}

.table th {
    font-size: var(--rc-fs-100);
    letter-spacing: 0.06em;
    font-weight: var(--rc-fw-semibold);
}

.table td,
.table th {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.table-responsive {
    border-radius: var(--rc-radius-sm);
    overflow-x: auto;
}

.modal-content {
    border-radius: var(--rc-radius-lg);
    border: 1px solid var(--rc-color-border);
    box-shadow: var(--rc-shadow-md);
}

.modal-header,
.modal-footer {
    padding-left: var(--rc-space-5);
    padding-right: var(--rc-space-5);
}

.toast {
    border-radius: var(--rc-radius-sm);
}

.spinner-border {
    width: 1rem;
    height: 1rem;
}

.rc-empty-state {
    border: 1px dashed var(--rc-color-border);
    border-radius: var(--rc-radius-md);
    background: var(--rc-color-surface-soft);
    padding: var(--rc-space-6) var(--rc-space-5);
    text-align: center;
}

.rc-empty-state .bi {
    font-size: 2rem;
    opacity: 0.45;
    margin-bottom: var(--rc-space-2);
}

.rc-empty-state-title {
    font-weight: var(--rc-fw-semibold);
    margin-bottom: var(--rc-space-1);
}

.rc-empty-state-copy {
    color: var(--rc-color-text-muted);
    margin-bottom: var(--rc-space-3);
}

/* Admin metric + worker status utilities */
.metric-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.metric-icon i {
    line-height: 1;
}

.metric-icon-primary {
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.metric-icon-success {
    background: rgba(var(--bs-success-rgb), 0.12);
    color: var(--bs-success);
}

.metric-icon-warning {
    background: rgba(var(--bs-warning-rgb), 0.14);
    color: #b88300;
}

.metric-icon-danger {
    background: rgba(var(--bs-danger-rgb), 0.12);
    color: var(--bs-danger);
}

.metric-icon-info {
    background: rgba(var(--bs-info-rgb), 0.14);
    color: var(--bs-info);
}

.metric-icon-lg {
    width: 80px;
    height: 80px;
    border-radius: 999px;
}

.org-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.org-icon-badge i {
    font-size: 0.95rem;
    line-height: 1;
}

.identity-badge {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.identity-badge-primary {
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.identity-badge-muted {
    background: rgba(var(--bs-secondary-rgb), 0.12);
    color: var(--bs-secondary);
}

.worker-backend-pill {
    background: rgba(var(--bs-secondary-rgb), 0.12);
    color: var(--bs-secondary);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
    font-weight: 600;
}

.worker-backend-pill.is-dramatiq {
    background: rgba(var(--bs-success-rgb), 0.14);
    color: var(--bs-success);
    border-color: rgba(var(--bs-success-rgb), 0.26);
}

.worker-backend-pill.is-inline {
    background: rgba(var(--bs-warning-rgb), 0.16);
    color: #916300;
    border-color: rgba(var(--bs-warning-rgb), 0.32);
}

.worker-backend-pill.is-error {
    background: rgba(var(--bs-danger-rgb), 0.14);
    color: var(--bs-danger);
    border-color: rgba(var(--bs-danger-rgb), 0.26);
}

.worker-task-breakdown {
    line-height: 1.35;
}

.admin-kpi-card .card-body {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 992px) {
    .content-body {
        padding: var(--rc-space-4);
    }

    .card-header,
    .card-body,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: var(--rc-space-4);
        padding-right: var(--rc-space-4);
    }
}

@media (max-width: 576px) {
    .content-body {
        padding: var(--rc-space-3);
    }

    .table td,
    .table th {
        white-space: nowrap;
    }

    .btn {
        min-height: 38px;
    }
}

.rc-global-search-results {
    z-index: 1050;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.rc-nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
}

.rc-sovereign-core-label {
    letter-spacing: 0.1em;
    font-size: 0.65rem;
}

.rc-search-subtitle {
    font-size: 0.7rem;
}

.rc-flash-toast-container {
    z-index: 1100;
}

.rc-max-w-200 {
    max-width: 200px;
}

.rc-cursor-pointer {
    cursor: pointer;
}

.chat-upload-image {
    max-width: 200px;
    border-radius: 8px;
}

.agent-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--rc-font-family);
}

.agent-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    transition: transform var(--rc-ease-standard), box-shadow var(--rc-ease-standard);
}

.agent-chat-close-icon {
    display: none;
}

.agent-chat-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.agent-chat-window {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    flex-direction: column;
}

.agent-chat-window-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-chat-header-title {
    font-weight: 700;
    font-size: 16px;
}

.agent-chat-status {
    font-size: 12px;
    opacity: 0.85;
}

.agent-chat-expand-link {
    color: #fff;
    opacity: 0.8;
    font-size: 12px;
    text-decoration: none;
}

.agent-chat-sessions {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
    display: block;
}

.agent-chat-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.agent-chat-empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.agent-chat-empty-copy {
    margin: 12px 0 0;
}

.agent-chat-empty-waiting {
    margin: 4px 0 0;
    font-size: 12px;
}

.agent-chat-active {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.agent-chat-active-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-chat-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #64748b;
}

.agent-chat-active-main {
    flex: 1;
}

.agent-chat-active-name {
    font-weight: 600;
    font-size: 14px;
}

.agent-chat-active-meta {
    font-size: 11px;
    color: #94a3b8;
}

.agent-chat-profile-link {
    font-size: 12px;
    color: #4f46e5;
    text-decoration: none;
    display: none;
}

.agent-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.agent-chat-input-row {
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    gap: 8px;
}

.agent-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.agent-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-session-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.agent-session-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.agent-session-unread {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.agent-session-preview {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-session-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

#marketplaceMap {
    max-width: 100%;
}

.rc-marketplace-map {
    height: 100%;
    min-height: 620px;
    flex: 1 1 auto;
    border-radius: 12px;
}

.rc-marketplace-map-card .card-body {
    display: flex;
    padding: 0 !important;
}

.rc-map-popup {
    min-width: 200px;
}

.hover-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.rc-unassigned-avatar-sm {
    width: 34px;
    height: 34px;
}

.rc-unassigned-avatar-md {
    width: 36px;
    height: 36px;
}

.rc-unassigned-contact-truncate {
    max-width: 320px;
}

.rc-row-fade-out {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.rc-ui-polish-marketplace .card {
    border-radius: var(--rc-radius-md);
}

.rc-ui-polish-marketplace .row.g-3.mb-4 .card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--rc-color-border);
    background: var(--rc-color-surface);
    box-shadow: var(--rc-shadow-sm);
}

.rc-ui-polish-marketplace .row.g-3.mb-4 .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rc-color-primary);
    opacity: 0.85;
}

.rc-ui-polish-marketplace .row.g-3.mb-4 .card .card-body {
    padding: 18px;
}

.rc-ui-polish-marketplace .row.g-3.mb-4 .card h3 {
    font-weight: var(--rc-fw-bold);
    letter-spacing: -0.01em;
}

.rc-ui-polish-marketplace .hover-card {
    box-shadow: var(--rc-shadow-sm);
}

.rc-ui-polish-marketplace .hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rc-shadow-md) !important;
}

.rc-ui-polish-marketplace .rc-marketplace-map {
    border: 1px solid var(--rc-color-border);
}

.rc-ui-polish-deals .pipeline-stage {
    border-radius: var(--rc-radius-md);
}

.rc-ui-polish-deals .deal-card {
    border-radius: var(--rc-radius-sm);
    transition: transform var(--rc-ease-standard), box-shadow var(--rc-ease-standard), border-color var(--rc-ease-standard);
}

.rc-ui-polish-deals .deal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--rc-shadow-md);
}

@media (max-width: 768px) {
    #marketplaceMap {
        min-height: 360px;
        height: 52vh !important;
    }

    .rc-marketplace-map {
        min-height: 360px;
    }

    .rc-marketplace-map-card .card-body,
    #leadBoard .card .card-body,
    .pipeline-stage .deals-list,
    .pipeline-stage .deal-card,
    .rc-crm-pipeline-card .card-body {
        padding: 16px !important;
    }

    .table-responsive .table {
        min-width: 640px;
    }

    .rc-ui-polish-marketplace .card-body,
    .rc-ui-polish-deals .deals-list,
    .rc-ui-polish-deals .deal-card {
        padding: 16px !important;
    }
}

/* --- Premium Uniform Layer (system-wide) --- */
:root {
    --rc-page-bg: #f4f6fb;
    --rc-surface-elevated: #ffffff;
    --rc-border-subtle: #e6ebf2;
    --rc-shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.06);
    --rc-shadow-soft-hover: 0 12px 28px rgba(15, 23, 42, 0.10);
}

[data-bs-theme="dark"] {
    --rc-page-bg: #181b20;
    --rc-surface-elevated: #242a31;
    --rc-border-subtle: #303640;
    --rc-shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.28);
    --rc-shadow-soft-hover: 0 14px 30px rgba(0, 0, 0, 0.35);
}

body {
    background: var(--rc-page-bg);
}

.main-content-wrapper,
.content-body {
    background: transparent;
}

.top-navbar {
    background: color-mix(in srgb, var(--rc-surface-elevated) 90%, transparent) !important;
    border-bottom: 1px solid var(--rc-border-subtle);
    backdrop-filter: blur(8px);
}

.sidebar {
    border-right: 1px solid var(--rc-border-subtle);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.nav-link {
    border-radius: 10px;
    margin: 2px 8px;
    padding: 0.55rem 0.8rem;
    font-weight: 500;
}

.nav-link.active {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc-color-primary) 35%, transparent);
}

.card,
.modal-content,
.dropdown-menu {
    border: 1px solid var(--rc-border-subtle);
    background: var(--rc-surface-elevated);
    box-shadow: var(--rc-shadow-soft);
}

.card:hover {
    box-shadow: var(--rc-shadow-soft-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--rc-border-subtle);
}

.table {
    --bs-table-hover-bg: color-mix(in srgb, var(--rc-color-primary) 6%, transparent);
}

.table thead th,
.table-light th {
    border-bottom: 1px solid var(--rc-border-subtle);
    background: color-mix(in srgb, var(--rc-color-surface-soft) 88%, white 12%);
}

.table td,
.table th {
    border-color: var(--rc-border-subtle);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-secondary,
.btn-light {
    border-color: var(--rc-border-subtle);
}

.form-control,
.form-select,
.input-group-text,
textarea.form-control {
    border-color: var(--rc-border-subtle);
    background: var(--rc-surface-elevated);
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: color-mix(in srgb, var(--rc-color-text-muted) 85%, #9ca3af 15%);
}

.alert {
    border-radius: 12px;
    border-width: 1px;
}

@media (max-width: 768px) {
    .nav-link {
        margin-left: 4px;
        margin-right: 4px;
    }
}

/* --- Premium Interaction Layer (micro-UX) --- */
:root {
    --rc-focus-ring-color: rgba(13, 110, 253, 0.28);
    --rc-focus-ring: 0 0 0 0.22rem var(--rc-focus-ring-color);
    --rc-press-scale: 0.99;
}

button,
.btn,
a,
.nav-link,
.card,
.dropdown-item,
.form-control,
.form-select,
.input-group-text,
.table-hover tbody tr,
.badge {
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

.btn:hover,
.dropdown-item:hover {
    transform: translateY(-1px);
}

.btn:active,
.nav-link:active,
.dropdown-item:active {
    transform: scale(var(--rc-press-scale));
}

.card:hover {
    transform: translateY(-2px);
}

.table-hover tbody tr:hover {
    transform: translateX(1px);
}

.nav-link:hover {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc-color-primary) 22%, transparent);
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
textarea.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none !important;
    box-shadow: var(--rc-focus-ring) !important;
}

.btn:focus,
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: color-mix(in srgb, var(--rc-color-primary) 45%, var(--rc-border-subtle)) !important;
}

.btn-primary {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.22);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.30) !important;
}

.dropdown-menu {
    animation: rcFadeSlideIn 140ms ease;
    transform-origin: top right;
}

@keyframes rcFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

    .card:hover,
    .btn:hover,
    .dropdown-item:hover,
    .table-hover tbody tr:hover,
    .btn:active,
    .nav-link:active,
    .dropdown-item:active {
        transform: none !important;
    }
}

/* --- Premium Density Layer (desktop + mobile rhythm) --- */
:root {
    --rc-density-content-pad: 1.25rem;
    --rc-density-card-header-y: 0.85rem;
    --rc-density-card-header-x: 1.05rem;
    --rc-density-card-body-y: 1rem;
    --rc-density-card-body-x: 1.05rem;
    --rc-density-table-cell-y: 0.72rem;
    --rc-density-table-cell-x: 0.8rem;
    --rc-density-control-min-h: 40px;
    --rc-density-btn-y: 0.5rem;
    --rc-density-btn-x: 0.9rem;
}

.content-body {
    padding: var(--rc-density-content-pad) !important;
}

.card-header {
    padding: var(--rc-density-card-header-y) var(--rc-density-card-header-x) !important;
}

.card-body {
    padding: var(--rc-density-card-body-y) var(--rc-density-card-body-x) !important;
}

.table td,
.table th {
    padding: var(--rc-density-table-cell-y) var(--rc-density-table-cell-x);
}

.btn {
    padding: var(--rc-density-btn-y) var(--rc-density-btn-x);
}

.form-control,
.form-select,
textarea.form-control {
    min-height: var(--rc-density-control-min-h);
}

@media (min-width: 1200px) {
    :root {
        --rc-density-content-pad: 1.35rem;
        --rc-density-card-header-y: 0.8rem;
        --rc-density-card-header-x: 1rem;
        --rc-density-card-body-y: 0.95rem;
        --rc-density-card-body-x: 1rem;
        --rc-density-table-cell-y: 0.68rem;
        --rc-density-table-cell-x: 0.75rem;
        --rc-density-control-min-h: 38px;
        --rc-density-btn-y: 0.45rem;
        --rc-density-btn-x: 0.85rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --rc-density-content-pad: 1rem;
        --rc-density-card-header-y: 0.85rem;
        --rc-density-card-header-x: 0.95rem;
        --rc-density-card-body-y: 0.95rem;
        --rc-density-card-body-x: 0.95rem;
        --rc-density-table-cell-y: 0.7rem;
        --rc-density-table-cell-x: 0.7rem;
        --rc-density-control-min-h: 40px;
        --rc-density-btn-y: 0.48rem;
        --rc-density-btn-x: 0.82rem;
    }
}

@media (max-width: 575.98px) {
    :root {
        --rc-density-content-pad: 0.85rem;
        --rc-density-card-header-y: 0.82rem;
        --rc-density-card-header-x: 0.85rem;
        --rc-density-card-body-y: 0.9rem;
        --rc-density-card-body-x: 0.85rem;
        --rc-density-table-cell-y: 0.65rem;
        --rc-density-table-cell-x: 0.62rem;
        --rc-density-control-min-h: 42px;
        --rc-density-btn-y: 0.52rem;
        --rc-density-btn-x: 0.8rem;
    }
}

/* --- Page-level outlier polish (QA pass) --- */
.rc-ui-polish-dashboard .d-flex.gap-2 .btn.btn-white {
    background: var(--rc-surface-elevated);
    border-color: var(--rc-border-subtle);
    color: var(--rc-color-text);
}

.rc-ui-polish-people .card-body.bg-light.rounded {
    background: var(--rc-surface-elevated) !important;
    border: 1px solid var(--rc-border-subtle);
}

.rc-ui-polish-people .btn-group .btn {
    border-color: var(--rc-border-subtle);
}

.rc-ui-polish-team .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--rc-border-subtle) !important;
}

.rc-ui-polish-marketplace .form-control.bg-light,
.rc-ui-polish-marketplace .form-select.bg-light {
    background: var(--rc-surface-elevated) !important;
    border: 1px solid var(--rc-border-subtle) !important;
}

.rc-ui-polish-deals .pipeline-stage {
    background: color-mix(in srgb, var(--rc-surface-elevated) 92%, var(--rc-color-surface-soft) 8%);
    border-color: var(--rc-border-subtle);
    box-shadow: var(--rc-shadow-soft);
}

.rc-ui-polish-deals .stage-header {
    background: color-mix(in srgb, var(--rc-color-surface-soft) 78%, white 22%);
    border-bottom: 1px solid var(--rc-border-subtle);
}

.rc-ui-polish-deals .deal-card {
    border-color: var(--rc-border-subtle);
    box-shadow: var(--rc-shadow-soft);
}

.rc-ui-polish-deals .deal-card:hover {
    box-shadow: var(--rc-shadow-soft-hover);
}

/* --- Typography refinement layer (system-wide) --- */
:root {
    --rc-heading-1: clamp(1.55rem, 1.25rem + 0.9vw, 2rem);
    --rc-heading-2: clamp(1.35rem, 1.15rem + 0.7vw, 1.65rem);
    --rc-heading-3: clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
    --rc-heading-4: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
    --rc-text-body: 0.95rem;
    --rc-text-small: 0.83rem;
    --rc-text-muted-tone: color-mix(in srgb, var(--rc-color-text) 52%, #7b8794 48%);
}

body {
    font-size: var(--rc-text-body);
    letter-spacing: 0.002em;
}

h1, .h1 { font-size: var(--rc-heading-1); }
h2, .h2 { font-size: var(--rc-heading-2); }
h3, .h3 { font-size: var(--rc-heading-3); }
h4, .h4 { font-size: var(--rc-heading-4); }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.012em;
}

p,
.form-label,
.table td,
.list-group-item,
.dropdown-item {
    line-height: 1.5;
}

.small,
small,
.text-muted.small {
    font-size: var(--rc-text-small) !important;
}

.text-muted,
.form-text,
.table thead th,
.dropdown-item.text-muted {
    color: var(--rc-text-muted-tone) !important;
}

.card-title,
.modal-title,
.page-title,
.fw-bold {
    letter-spacing: -0.01em;
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.94rem;
    }

    .table td,
    .table th {
        line-height: 1.38;
    }
}

/* --- Standalone page harmonization layer --- */
.rc-standalone-shell {
    min-height: 100vh;
    background: linear-gradient(145deg, #f5f8ff 0%, #eef3ff 55%, #f8fafd 100%);
    color: var(--rc-color-text);
}

.rc-standalone-shell--marketing .page-shell {
    min-height: 100vh;
    background: linear-gradient(145deg, #f5f8ff 0%, #eef3ff 55%, #f8fafd 100%);
}

.rc-standalone-shell--marketing .navbar {
    backdrop-filter: blur(8px);
    border-bottom: 1px solid color-mix(in srgb, var(--rc-color-border) 75%, transparent 25%);
}

.rc-auth-content-wrap {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 60px;
}

.rc-standalone-shell .text-primary-custom {
    color: color-mix(in srgb, var(--rc-color-primary) 84%, #16213f 16%) !important;
}

.rc-standalone-shell .btn-accent {
    background: linear-gradient(135deg, color-mix(in srgb, var(--rc-color-primary) 72%, #7c3aed 28%), color-mix(in srgb, var(--rc-color-primary) 62%, #4f46e5 38%));
    color: #fff;
    padding: 0.7rem 1.35rem;
    border-radius: var(--rc-radius-pill);
    border: 1px solid transparent;
    font-weight: var(--rc-fw-bold);
}

.rc-standalone-shell .btn-accent:hover,
.rc-standalone-shell .btn-accent:focus {
    color: #fff;
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.24);
}

.rc-standalone-shell .btn-outline-rc {
    border: 1px solid color-mix(in srgb, var(--rc-color-text) 24%, transparent 76%);
    color: var(--rc-color-text);
    padding: 0.7rem 1.25rem;
    border-radius: var(--rc-radius-pill);
    font-weight: var(--rc-fw-semibold);
    background: #fff;
}

.rc-standalone-shell .btn-outline-rc:hover,
.rc-standalone-shell .btn-outline-rc:focus {
    color: var(--rc-color-text);
    background: color-mix(in srgb, #fff 84%, var(--rc-color-surface-soft) 16%);
}

.rc-standalone-shell .auth-card,
.rc-auth-page-card,
.rc-verify-card,
.rc-error-card,
.rc-maintenance-card {
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--rc-color-border) 75%, transparent 25%);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
    background: #fff;
}

.rc-standalone-shell .auth-card {
    width: 100%;
    max-width: 520px;
    color: #1b1f2a;
}

.rc-standalone-shell .auth-card .form-control,
.rc-standalone-shell .auth-card .form-select {
    background-color: #fff;
    color: #1b1f2a;
    border-color: #dfe3f0;
}

.rc-standalone-shell .auth-card .form-control::placeholder {
    color: #98a1b3;
}

.rc-auth-page-wrap {
    max-width: 460px;
    margin: 0 auto;
    padding-top: 9vh;
    padding-bottom: 9vh;
}

.rc-auth-page-card {
    padding: 2rem 1.8rem;
}

.rc-auth-page-card h2,
.rc-auth-page-card p {
    text-align: center;
}

.rc-auth-page-card h2 {
    margin-bottom: 0.8rem;
}

.rc-auth-page-card p {
    color: var(--rc-color-text-muted);
    margin-bottom: 1.25rem;
}

.rc-auth-page-card label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--rc-color-text);
    font-weight: var(--rc-fw-semibold);
}

.rc-verify-card {
    max-width: 520px;
    width: 100%;
}

.rc-error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.rc-error-card {
    text-align: center;
    max-width: 560px;
    width: 100%;
    padding: 2.1rem;
}

.rc-error-card .display-1 {
    font-size: clamp(4rem, 2.5rem + 4vw, 6rem);
    font-weight: 800;
    color: color-mix(in srgb, var(--rc-color-primary) 24%, #ced4da 76%);
}

.rc-maintenance-page {
    background: linear-gradient(145deg, #121b2d 0%, #0f172a 60%, #172238 100%);
    color: #e6edf3;
}

.rc-maintenance-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 64px 20px;
}

.rc-maintenance-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 24px;
}

.rc-maintenance-card h1 {
    margin: 0 0 10px;
}

.rc-maintenance-card p {
    margin: 8px 0;
    line-height: 1.45;
    color: rgba(230, 237, 243, 0.92);
}

.rc-maintenance-card .muted {
    color: rgba(230, 237, 243, 0.72);
    font-size: 0.82rem;
    margin-top: 14px;
}

.rc-maintenance-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 69, 58, 0.18);
    border: 1px solid rgba(255, 69, 58, 0.35);
    color: #ffb4ae;
    font-weight: 600;
    font-size: 0.78rem;
}

.rc-maintenance-page code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    color: #f8fafc;
}

@media (max-width: 575.98px) {
    .rc-auth-content-wrap {
        padding-top: 110px;
        padding-bottom: 42px;
    }

    .rc-auth-page-wrap {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .rc-auth-page-card,
    .rc-error-card {
        padding: 1.35rem 1rem;
    }
}

.rc-plans-page .hero-section {
    padding: 140px 0 100px;
}

.rc-plans-page .badge-soft {
    background: color-mix(in srgb, var(--rc-color-primary) 12%, transparent 88%);
    color: color-mix(in srgb, var(--rc-color-primary) 82%, #1d2d61 18%);
    font-weight: 700;
}

.rc-plans-page .plan-card {
    border: 1px solid color-mix(in srgb, var(--rc-color-border) 70%, transparent 30%);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    height: 100%;
}

.rc-plans-page .plan-header {
    border-bottom: 1px solid color-mix(in srgb, var(--rc-color-border) 72%, transparent 28%);
    padding: 20px 22px;
}

.rc-plans-page .plan-body {
    padding: 22px;
}

.rc-plans-page .price {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.rc-plans-page .subprice {
    color: var(--rc-color-text-muted);
}

.rc-plans-page .plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.rc-support-auth-page {
    background: linear-gradient(145deg, #111c31 0%, #0f172a 55%, #17263f 100%);
    color: #f8fafc;
}

.rc-support-auth-page .text-muted {
    color: #9fb0c5 !important;
}

.rc-support-auth-page .text-primary {
    color: #93c5fd !important;
}

.rc-support-auth-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: color-mix(in srgb, #1e293b 90%, #172033 10%);
    box-shadow: 0 22px 40px rgba(2, 6, 23, 0.45);
    color: #f8fafc;
}

.rc-support-auth-card .form-control {
    background-color: #334155;
    border-color: #4e627f;
    color: #f8fafc;
}

.rc-support-auth-card .form-control::placeholder {
    color: #9fb0c5;
}

.rc-support-auth-card .form-control:focus {
    background-color: #334155;
    border-color: #60a5fa;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.24);
}

.rc-support-auth-card .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
}

.rc-support-auth-card .btn-primary:hover,
.rc-support-auth-card .btn-primary:focus {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
}

.rc-legal-page,
.rc-contact-page,
.rc-email-compose-page,
.rc-edit-client-page,
.rc-booking-page,
.rc-thanks-page,
.rc-flyer-public-page,
.rc-landing-public-page,
.rc-builder-custom-page,
.rc-home-landing-page,
.rc-landing-page {
    background: linear-gradient(145deg, #f5f8ff 0%, #eef3ff 55%, #f8fafd 100%);
}

.rc-legal-page .navbar,
.rc-contact-page .navbar {
    backdrop-filter: blur(8px);
    border-bottom: 1px solid color-mix(in srgb, var(--rc-color-border) 75%, transparent 25%);
}

.rc-legal-page .card,
.rc-contact-page .card,
.rc-thanks-page .card,
.rc-email-compose-page .container {
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.rc-booking-page .booking-card,
.rc-booking-success-card,
.rc-flyer-public-page .container-fluid.p-0,
.rc-landing-public-page .container-fluid.p-0 {
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}

.rc-booking-page .booking-card,
.rc-booking-success-card {
    background: #fff;
}

.rc-security-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.rc-security-auth-card {
    width: 100%;
    max-width: 520px;
    border: 1px solid color-mix(in srgb, var(--rc-color-border) 72%, transparent 28%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.rc-security-auth-card code {
    font-size: 0.9em;
}

/* ========================================================================= */
/* REALTY CRUISER GLOBAL SANITIZATION & OVERRIDES
/* ========================================================================= */

/* 1. Autofill Anti-Yellowing (Mandate: Slate-50/White only) */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 50px white inset !important;
    -webkit-text-fill-color: #0f172a !important; /* text-slate-900 */
    transition: background-color 5000s ease-in-out 0s;
    background-clip: content-box !important;
}

/* 2. Global Tap Highlight Nullification (Mobile App Feel) */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 3. Modern Scrollbars (Discrete & Premium) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* text-slate-300 */
    border-radius: 9999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8; /* text-slate-400 */
}

/* 4. Enforce Indigo Glow instead of Hard Outlines on Focus */
input:focus, textarea:focus, select:focus, button:focus {
    outline: none !important;
}
