/* Nexus Enterprise UI System
   Sections: tokens, base, shell, navigation, shared components, pages, utilities. */

:root {
    --nx-bg: #f5f7fb;
    --nx-surface: #ffffff;
    --nx-surface-muted: #f8fafc;
    --nx-border: #e2e8f0;
    --nx-border-strong: #cbd5e1;
    --nx-text: #172033;
    --nx-text-muted: #64748b;
    --nx-primary: #4f46e5;
    --nx-primary-hover: #4338ca;
    --nx-primary-soft: #eef2ff;
    --nx-success: #15803d;
    --nx-warning: #b45309;
    --nx-danger: #b91c1c;
    --nx-info: #0369a1;

    --nx-space-1: 4px;
    --nx-space-2: 8px;
    --nx-space-3: 12px;
    --nx-space-4: 16px;
    --nx-space-5: 24px;
    --nx-space-6: 32px;

    --nx-radius-sm: 6px;
    --nx-radius-md: 10px;
    --nx-radius-lg: 14px;
    --nx-radius-xl: 20px;

    --nx-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --nx-shadow-md: 0 12px 32px rgba(15, 23, 42, .10);

    --nx-sidebar-width: 264px;
    --nx-topbar-height: 68px;
}

* {
    box-sizing: border-box;
}

html,
body {
    background: var(--nx-bg);
    color: var(--nx-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    height: 100%;
    line-height: 1.45;
    margin: 0;
    overflow: hidden;
}

body > div:first-child {
    height: 100dvh;
    overflow: hidden;
}

a {
    color: var(--nx-primary);
}

a:hover {
    color: var(--nx-primary-hover);
}

:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .28);
    outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
    color: var(--nx-text);
    letter-spacing: -.02em;
}

.nexus-shell {
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .08), transparent 32rem),
        var(--nx-bg);
    display: grid;
    grid-template-columns: var(--nx-sidebar-width) minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
    width: 100vw;
}

.nexus-sidebar {
    background: rgba(255, 255, 255, .92);
    border-right: 1px solid var(--nx-border);
    box-shadow: 1px 0 0 rgba(255, 255, 255, .65) inset;
    color: var(--nx-text);
    display: flex;
    flex-direction: column;
    gap: var(--nx-space-5);
    padding: var(--nx-space-5) var(--nx-space-4);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.nexus-brand {
    align-items: center;
    color: var(--nx-text);
    display: flex;
    gap: var(--nx-space-3);
    text-decoration: none;
}

.nexus-brand:hover {
    color: var(--nx-text);
}

.nexus-brand-mark {
    align-items: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    color: #fff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.nexus-brand strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
}

.nexus-brand small {
    color: var(--nx-text-muted);
    display: block;
    font-size: .76rem;
    font-weight: 500;
    margin-top: 2px;
}

.nexus-main {
    min-width: 0;
    overflow: hidden;
}

.nexus-topbar {
    align-items: center;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, .84);
    border-bottom: 1px solid var(--nx-border);
    display: grid;
    grid-template-columns: minmax(260px, 560px) auto auto;
    gap: var(--nx-space-4);
    height: var(--nx-topbar-height);
    min-height: 0;
    padding: var(--nx-space-3) var(--nx-space-5);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nexus-topbar-search {
    min-width: 0;
}

.nexus-topbar-actions,
.nx-command-actions {
    align-items: center;
    display: flex;
    gap: var(--nx-space-2);
}

.nexus-icon-link {
    align-items: center;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-md);
    color: var(--nx-text-muted);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    text-decoration: none;
    width: 36px;
}

button.nexus-icon-link {
    cursor: pointer;
    padding: 0;
}

.nexus-icon-link:hover {
    background: var(--nx-primary-soft);
    border-color: #c7d2fe;
    color: var(--nx-primary);
}

.nexus-content {
    height: calc(100dvh - var(--nx-topbar-height));
    overflow: auto;
    overflow-x: hidden;
    padding: var(--nx-space-5);
}

.nexus-content-inner {
    margin: 0 auto;
    max-width: 1440px;
}

.nexus-content:has(.sales-workspace-header) .nexus-content-inner {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - var(--nx-topbar-height) - (var(--nx-space-3) * 2));
    max-width: none;
    min-height: 0;
}

.nexus-content:has(.sales-workspace-header) {
    background:
        linear-gradient(135deg, rgba(79, 70, 229, .18), transparent 32%),
        #0b1020;
    overflow: hidden;
    padding: var(--nx-space-3);
}

.nexus-shell:has(.sales-workspace-header) {
    background: #0b1020;
}

.nexus-shell:has(.sales-workspace-header) .nexus-sidebar,
.nexus-shell:has(.sales-workspace-header) .nexus-topbar {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
}

.nexus-shell:has(.sales-workspace-header) .nexus-brand,
.nexus-shell:has(.sales-workspace-header) .nexus-user-copy strong,
.nexus-shell:has(.sales-workspace-header) .nexus-user-copy span,
.nexus-shell:has(.sales-workspace-header) .nexus-user-copy small {
    color: #e5edf8;
}

.nexus-shell:has(.sales-workspace-header) .nexus-brand small,
.nexus-shell:has(.sales-workspace-header) .nexus-nav-heading {
    color: #94a3b8;
}

.nexus-shell:has(.sales-workspace-header) .nexus-nav-link {
    color: #cbd5e1;
}

.nexus-shell:has(.sales-workspace-header) .nexus-nav-link.active,
.nexus-shell:has(.sales-workspace-header) .nexus-nav-link:hover {
    background: #1e293b;
    color: #ffffff;
}

.nexus-shell:has(.sales-workspace-header) .nexus-nav-icon,
.nexus-shell:has(.sales-workspace-header) .nexus-icon-link,
.nexus-shell:has(.sales-workspace-header) .nx-search {
    background: #111827;
    border-color: #273449;
    color: #dbeafe;
}

.nexus-shell:has(.sales-workspace-header) .nx-search input {
    color: #e5edf8;
}

.nexus-shell:has(.sales-workspace-header) .nx-search input::placeholder {
    color: #718096;
}

.nexus-nav {
    display: grid;
    gap: var(--nx-space-1);
}

.nexus-nav-group {
    margin-top: var(--nx-space-4);
}

.nexus-nav-group:first-child {
    margin-top: 0;
}

.nexus-nav-heading {
    color: var(--nx-text-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 var(--nx-space-2);
    padding: 0 var(--nx-space-2);
    text-transform: uppercase;
}

.nexus-nav-link {
    align-items: center;
    border-radius: var(--nx-radius-md);
    color: #475569;
    display: flex;
    gap: var(--nx-space-3);
    min-height: 40px;
    padding: var(--nx-space-2) var(--nx-space-3);
    position: relative;
    text-decoration: none;
}

.nexus-nav-link.active,
.nexus-nav-link:hover {
    background: var(--nx-primary-soft);
    color: var(--nx-primary);
}

.nexus-nav-link.active::before {
    background: var(--nx-primary);
    border-radius: 999px;
    content: "";
    height: 22px;
    left: -6px;
    position: absolute;
    width: 3px;
}

.nexus-nav-icon {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    color: #475569;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.nexus-nav-link.active .nexus-nav-icon,
.nexus-nav-link:hover .nexus-nav-icon {
    background: #fff;
    border-color: #c7d2fe;
    color: var(--nx-primary);
}

.nexus-user-menu {
    align-items: center;
    display: flex;
    gap: var(--nx-space-3);
    justify-content: flex-end;
    min-width: 0;
}

.nexus-user-copy {
    display: grid;
    line-height: 1.2;
    min-width: 0;
}

.nexus-user-copy strong {
    font-size: .88rem;
    font-weight: 650;
}

.nexus-user-copy span,
.nexus-user-copy small {
    color: var(--nx-text-muted);
    font-size: .76rem;
}

.nx-avatar {
    align-items: center;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: var(--nx-primary);
    display: inline-flex;
    font-size: .8rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.nx-search {
    align-items: center;
    background: var(--nx-surface-muted);
    border: 1px solid var(--nx-border);
    border-radius: 999px;
    color: var(--nx-text-muted);
    display: flex;
    gap: var(--nx-space-2);
    min-height: 40px;
    padding: 0 var(--nx-space-3);
}

.nx-search input {
    background: transparent;
    border: 0;
    color: var(--nx-text);
    font: inherit;
    min-width: 0;
    outline: 0;
    width: 100%;
}

.nx-search input::placeholder {
    color: #94a3b8;
}

.ui-page-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: var(--nx-space-4);
    margin-bottom: var(--nx-space-5);
}

.ui-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 var(--nx-space-2);
}

.ui-page-header p {
    color: var(--nx-text-muted);
    font-size: .96rem;
    margin: 0;
    max-width: 760px;
}

.card,
.ui-section-card,
.ui-metric-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
}

.card-header {
    background: linear-gradient(180deg, #fff, var(--nx-surface-muted));
    border-bottom: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg) var(--nx-radius-lg) 0 0;
    padding: var(--nx-space-4);
}

.card-body {
    padding: var(--nx-space-4);
}

.ui-section-card .card-header strong {
    font-size: 1rem;
    font-weight: 650;
}

.ui-section-card .card-header small {
    color: var(--nx-text-muted);
    font-size: .82rem;
    font-weight: 400;
    margin-top: var(--nx-space-1);
}

.ui-metric-card {
    height: 100%;
}

.ui-metric-card .card-body {
    display: grid;
    gap: var(--nx-space-1);
    min-height: 118px;
}

.workspace-count {
    color: var(--nx-text);
    font-size: 2rem;
    font-weight: 750;
    letter-spacing: -.04em;
}

.ui-metric-card strong {
    font-weight: 650;
}

.ui-metric-card small,
.ui-data-table-title,
.text-muted {
    color: var(--nx-text-muted) !important;
}

.ui-metric-icon {
    align-items: center;
    background: var(--nx-primary-soft);
    border-radius: var(--nx-radius-md);
    color: var(--nx-primary);
    display: inline-flex;
    float: right;
    font-size: .8rem;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.ui-empty-state {
    background: linear-gradient(180deg, #fff, var(--nx-surface-muted));
    border: 1px dashed var(--nx-border-strong);
    border-radius: var(--nx-radius-lg);
    padding: var(--nx-space-5);
    text-align: center;
}

.ui-empty-state strong {
    display: block;
    font-size: 1rem;
    margin-bottom: var(--nx-space-1);
}

.ui-empty-state p {
    color: var(--nx-text-muted);
    margin: 0;
}

.nx-command-bar {
    align-items: center;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    display: flex;
    justify-content: space-between;
    gap: var(--nx-space-4);
    margin-bottom: var(--nx-space-4);
    padding: var(--nx-space-3) var(--nx-space-4);
}

.nx-command-bar span {
    color: var(--nx-text-muted);
    display: block;
    font-size: .82rem;
}

.table-responsive {
    border-radius: var(--nx-radius-md);
}

.table {
    color: var(--nx-text);
}

.table th,
.table td {
    border-bottom: 1px solid var(--nx-border);
    padding: .72rem .75rem;
}

.table thead th {
    background: var(--nx-surface-muted);
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.table-hover tbody tr:hover {
    background: #f8fbff;
}

.form-control,
.form-select {
    border-color: var(--nx-border-strong);
    border-radius: var(--nx-radius-md);
    min-height: 38px;
}

.form-control:focus,
.form-select:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
    outline: 0;
}

.btn {
    border-radius: var(--nx-radius-md);
    font-weight: 600;
}

.btn-primary,
.btn-success {
    background: var(--nx-primary);
    border-color: var(--nx-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--nx-primary-hover);
    border-color: var(--nx-primary-hover);
}

.btn-outline-primary {
    border-color: #c7d2fe;
    color: var(--nx-primary);
}

.btn-outline-primary:hover {
    background: var(--nx-primary-soft);
}

.btn-outline-secondary {
    border-color: var(--nx-border-strong);
    color: #475569;
}

.badge {
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    padding: .24rem .55rem;
}

.bg-primary,
.bg-success {
    background: var(--nx-primary) !important;
    color: #fff !important;
}

.bg-secondary {
    background: #64748b !important;
    color: #fff !important;
}

.bg-info {
    background: #e0f2fe !important;
    color: #075985 !important;
}

.bg-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.bg-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-dark {
    background: #1e293b !important;
    color: #fff !important;
}

.alert {
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
}

.workspace-overview {
    display: grid;
    gap: var(--nx-space-4);
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.workspace-list,
.nx-activity-list {
    display: grid;
    gap: var(--nx-space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.workspace-list li,
.nx-activity-item {
    border-bottom: 1px solid var(--nx-border);
    padding-bottom: var(--nx-space-3);
}

.workspace-list li:last-child,
.nx-activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.workspace-list span,
.message-item span {
    color: var(--nx-text-muted);
    display: block;
    font-size: .82rem;
}

.nx-page-grid {
    display: grid;
    gap: var(--nx-space-4);
}

.nx-split {
    display: grid;
    gap: var(--nx-space-4);
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}

.message-conversation-list {
    display: grid;
    gap: var(--nx-space-2);
}

.message-conversation {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    cursor: pointer;
    display: grid;
    gap: var(--nx-space-1);
    padding: var(--nx-space-3);
    text-align: left;
}

.message-conversation.selected,
.message-conversation:hover {
    background: var(--nx-primary-soft);
    border-color: #c7d2fe;
}

.message-list {
    display: grid;
    gap: var(--nx-space-3);
}

.message-item {
    background: var(--nx-surface-muted);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    padding: var(--nx-space-3);
}

.sales-workspace-header {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    display: grid;
    gap: var(--nx-space-2);
    margin-bottom: 0;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.sales-workspace-header h1 {
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.sales-workspace-metrics {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(6, minmax(116px, 1fr));
}

.sales-workspace-metrics div {
    background: #0f172a;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-sm);
    padding: 8px var(--nx-space-3);
}

.sales-workspace-metrics span,
.sales-panel-heading span,
.sales-record-card small,
.sales-task-row small,
.sales-action-heading span,
.sales-timeline-list span,
.sales-notification-list span {
    color: #94a3b8;
    font-size: .78rem;
}

.sales-workspace-metrics strong {
    color: #f8fafc;
    display: block;
    font-size: 1.05rem;
    line-height: 1.1;
    margin-top: var(--nx-space-1);
}

.sales-workspace-grid {
    display: grid;
    gap: var(--nx-space-3);
    grid-template-columns: minmax(230px, 290px) minmax(420px, 1fr) minmax(260px, 330px);
    min-height: 0;
    overflow: hidden;
}

.sales-workspace-panel {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: var(--nx-space-3);
}

.sales-workspace-panel,
.sales-workspace-panel strong,
.sales-workspace-panel h2,
.sales-workspace-panel h3 {
    color: #f8fafc;
}

.sales-record-panel,
.sales-context-panel {
    align-content: start;
    display: grid;
    gap: var(--nx-space-2);
    overflow: hidden;
}

.sales-record-panel {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.sales-context-panel {
    grid-auto-rows: min-content;
}

.sales-context-section {
    border-bottom: 1px solid #25314a;
    display: grid;
    gap: var(--nx-space-1);
    padding-bottom: var(--nx-space-2);
}

.sales-context-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sales-context-section textarea.form-control {
    min-height: 48px;
}

.sales-action-panel {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-rows: auto auto minmax(0, 1fr);
}

.sales-action-panel.no-tasks {
    grid-template-rows: auto minmax(0, 1fr);
}

.sales-panel-heading,
.sales-record-title,
.sales-action-footer {
    align-items: center;
    display: flex;
    gap: var(--nx-space-3);
    justify-content: space-between;
}

.sales-panel-heading h2,
.sales-panel-heading h3,
.sales-record-title h2,
.sales-action-heading h3 {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.sales-panel-heading.compact {
    margin-bottom: var(--nx-space-1);
}

.sales-context-view {
    line-height: 1;
    min-height: 28px;
    padding: 6px 12px;
}

.sales-modal-backdrop {
    align-items: center;
    background: rgba(2, 6, 23, .72);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: var(--nx-space-5);
    position: fixed;
    z-index: 1200;
}

.sales-modal {
    background: #111827;
    border: 1px solid #334155;
    border-radius: var(--nx-radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    color: #f8fafc;
    display: grid;
    gap: var(--nx-space-3);
    max-height: min(720px, calc(100dvh - 64px));
    max-width: 760px;
    overflow: hidden;
    padding: var(--nx-space-4);
    width: min(760px, calc(100vw - 48px));
}

.sales-modal-header {
    align-items: center;
    border-bottom: 1px solid #25314a;
    display: flex;
    justify-content: space-between;
    padding-bottom: var(--nx-space-3);
}

.sales-modal-header span,
.sales-modal-timeline time {
    color: #94a3b8;
    font-size: .78rem;
}

.sales-modal-header h2 {
    color: #f8fafc;
    font-size: 1.1rem;
    margin: var(--nx-space-1) 0 0;
}

.sales-modal-timeline {
    display: grid;
    gap: var(--nx-space-3);
    list-style: none;
    margin: 0;
    overflow: auto;
    padding: 0 var(--nx-space-1) 0 0;
}

.sales-modal-timeline li {
    border-bottom: 1px solid #25314a;
    display: grid;
    gap: var(--nx-space-1);
    padding-bottom: var(--nx-space-3);
}

.sales-modal-timeline li:last-child {
    border-bottom: 0;
}

.sales-modal-timeline strong {
    color: #f8fafc;
}

.sales-modal-timeline span {
    color: #cbd5e1;
}

.sales-record-list,
.sales-task-list,
.sales-action-fields,
.sales-quick-notes,
.sales-conversation-list {
    display: grid;
    gap: var(--nx-space-2);
}

.sales-record-list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-color: #1f2a44 transparent;
    scrollbar-width: thin;
}

.sales-record-list::-webkit-scrollbar {
    width: 4px;
}

.sales-record-list::-webkit-scrollbar-thumb {
    background: #1f2a44;
    border-radius: 999px;
}

.sales-record-list::-webkit-scrollbar-track {
    background: transparent;
}

.sales-record-tabs {
    background: #0b1220;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-1);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: var(--nx-space-3);
    padding: var(--nx-space-1);
}

.sales-record-tabs button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: calc(var(--nx-radius-sm) - 2px);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.sales-record-tabs button.active {
    background: #172554;
    color: #f8fafc;
}

.sales-record-tabs span {
    color: inherit;
    font-size: .78rem;
}

.past-records-page {
    display: grid;
    gap: var(--nx-space-4);
    min-height: 0;
}

.past-records-header,
.past-records-toolbar,
.past-record-day {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-lg);
    box-shadow: var(--nx-shadow-sm);
}

.past-records-header {
    align-items: end;
    display: grid;
    gap: var(--nx-space-4);
    grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
    padding: var(--nx-space-4);
}

.past-records-header span,
.past-records-summary span,
.past-record-day-heading span {
    color: #94a3b8;
}

.past-records-header h1 {
    color: #f8fafc;
    margin: var(--nx-space-1) 0 0;
}

.past-records-summary {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.past-records-summary div {
    background: #0f172a;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-sm);
    padding: var(--nx-space-3);
}

.past-records-summary strong {
    color: #f8fafc;
    display: block;
    font-size: 1.1rem;
    margin-top: var(--nx-space-1);
}

.past-records-toolbar {
    display: grid;
    gap: var(--nx-space-3);
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px) minmax(180px, 240px);
    padding: var(--nx-space-3);
}

.past-records-list {
    display: grid;
    gap: var(--nx-space-3);
}

.past-record-day {
    display: grid;
    gap: var(--nx-space-3);
    padding: var(--nx-space-3);
}

.past-record-day-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.past-record-day-heading h2 {
    color: #f8fafc;
    font-size: 1rem;
    margin: 0;
}

.past-record-row {
    grid-template-columns: 70px 46px minmax(180px, 1.2fr) minmax(130px, .8fr) minmax(140px, .8fr) minmax(120px, .6fr) auto;
}

.sales-record-card,
.sales-task-row {
    background: #0f172a;
    border: 1px solid #273449;
    border-radius: var(--nx-radius-sm);
    color: #e5edf8;
    cursor: pointer;
    display: grid;
    gap: var(--nx-space-1);
    padding: var(--nx-space-3);
    position: relative;
    text-align: left;
    width: 100%;
}

.sales-record-tag {
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    max-width: 92px;
    overflow: hidden;
    padding: 5px 8px;
    position: absolute;
    right: 10px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    top: 10px;
    white-space: nowrap;
}

.sales-record-tag.new {
    background: rgba(34, 197, 94, .16);
    color: #86efac;
}

.sales-record-tag.lead {
    background: rgba(96, 165, 250, .16);
    color: #93c5fd;
}

.sales-record-tag.customer {
    background: rgba(168, 85, 247, .18);
    color: #d8b4fe;
}

.sales-record-tag.done {
    background: rgba(148, 163, 184, .18);
    color: #cbd5e1;
}

.sales-record-card:hover,
.sales-record-card.selected,
.sales-task-row:hover,
.sales-task-row.selected {
    background: #172554;
    border-color: #60a5fa;
}

.sales-record-card strong,
.sales-task-row strong,
.sales-timeline-list strong,
.sales-notification-list strong {
    font-weight: 700;
}

.sales-record-card span {
    color: #93c5fd;
    font-size: .84rem;
}

.sales-record-card .sales-record-tag {
    font-size: .68rem;
}

.sales-record-card .sales-record-tag.new {
    color: #86efac;
}

.sales-record-card .sales-record-tag.lead {
    color: #93c5fd;
}

.sales-record-card .sales-record-tag.customer {
    color: #d8b4fe;
}

.sales-record-card .sales-record-tag.done {
    color: #cbd5e1;
}

.sales-inline-task-list {
    border-left: 1px solid #334155;
    display: grid;
    gap: var(--nx-space-2);
    margin: calc(var(--nx-space-2) * -1) 0 var(--nx-space-2) var(--nx-space-4);
    padding-left: var(--nx-space-3);
}

.sales-inline-task {
    background: #0b1220;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-sm);
    color: #e5edf8;
    cursor: pointer;
    display: grid;
    gap: 2px;
    padding: var(--nx-space-2) var(--nx-space-3);
    text-align: left;
    width: 100%;
}

.sales-inline-task:hover,
.sales-inline-task.selected {
    background: #172554;
    border-color: #60a5fa;
}

.sales-inline-task.locked {
    opacity: .72;
}

.sales-inline-task.manual {
    border-style: dashed;
}

.sales-inline-task.locked:hover,
.sales-inline-task.locked.selected {
    background: #1e293b;
    border-color: #64748b;
}

.sales-inline-task span,
.sales-inline-task small {
    color: #94a3b8;
    font-size: .74rem;
}

.sales-inline-task strong {
    color: #f8fafc;
}

.sales-blocked-notice {
    background: #1e293b;
    border: 1px solid #64748b;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-1);
    padding: var(--nx-space-3);
}

.sales-blocked-notice strong {
    color: #f8fafc;
}

.sales-blocked-notice span {
    color: #cbd5e1;
}

.sales-record-title {
    border-bottom: 1px solid #25314a;
    padding-bottom: var(--nx-space-2);
}

.sales-record-title > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--nx-space-2);
}

.sales-record-title span {
    background: #172033;
    border: 1px solid #334155;
    border-radius: 999px;
    color: #cbd5e1;
    font-size: .76rem;
    padding: 2px 8px;
}

.sales-task-row {
    align-items: center;
    grid-template-columns: 46px minmax(0, 1fr) auto;
}

.sales-task-row > span:first-child {
    align-items: center;
    background: var(--nx-primary-soft);
    border-radius: 999px;
    color: var(--nx-primary);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    width: 38px;
}

.sales-action-workspace {
    background: #151c2e;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-md);
    display: grid;
    gap: var(--nx-space-2);
    min-height: 0;
    overflow: hidden;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.sales-action-workspace,
.sales-action-workspace strong,
.sales-action-workspace h3,
.sales-action-workspace li,
.sales-action-workspace span {
    color: #f8fafc;
}

.sales-action-heading h3 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-top: var(--nx-space-1);
}

.sales-instructions {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    padding: var(--nx-space-2) var(--nx-space-3);
}

.sales-instructions ul {
    margin: var(--nx-space-1) 0 0;
    padding-left: 1.1rem;
}

.contact-task-workspace {
    display: grid;
    gap: var(--nx-space-2);
}

.contact-call-panel,
.contact-recording-card,
.contact-checklist {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
}

.contact-call-panel {
    align-items: center;
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: 1.1fr 1fr auto;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.contact-call-panel > div,
.contact-recording-card {
    display: grid;
    gap: var(--nx-space-1);
}

.contact-call-panel span,
.contact-recording-card span {
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 650;
}

.contact-call-panel small,
.contact-recording-card small {
    color: #94a3b8;
}

.contact-call-button {
    min-height: 36px;
    min-width: 132px;
}

.contact-recording-grid {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-recording-card {
    min-height: 72px;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.contact-checklist {
    display: grid;
    gap: var(--nx-space-1) var(--nx-space-2);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: var(--nx-space-2) var(--nx-space-3);
}

.contact-checklist strong {
    grid-column: 1 / -1;
}

.contact-checklist label {
    align-items: center;
    color: #f8fafc;
    display: flex;
    font-size: .92rem;
    font-weight: 650;
    gap: var(--nx-space-2);
    line-height: 1.25;
}

.sales-action-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sales-action-fields label {
    color: #f8fafc;
    display: grid;
    font-weight: 650;
    gap: var(--nx-space-2);
}

.sales-action-fields .form-control,
.sales-action-fields .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
    min-height: 34px;
}

.sales-action-fields .form-control:focus,
.sales-action-fields .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

.sales-action-fields .form-control::placeholder {
    color: #64748b;
}

.sales-action-fields textarea.form-control {
    min-height: 46px;
}

.sales-checkbox-row {
    align-items: center;
    color: #f8fafc;
    display: flex;
    font-weight: 650;
    gap: var(--nx-space-2);
}

.sales-checkbox-row input {
    margin: 0;
}

.contact-notes-only {
    grid-template-columns: 1fr;
}

.contact-notes-only label {
    grid-column: 1 / -1;
}

.sales-action-fields label:has(textarea),
.sales-action-fields label:has(input[type="file"]),
.sales-contact-strip {
    grid-column: 1 / -1;
}

.sales-contact-strip {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-1);
    padding: var(--nx-space-2) var(--nx-space-3);
}

.sales-contact-strip small,
.sales-timeline-list time {
    color: #94a3b8;
}

.sales-timeline-list,
.sales-notification-list {
    display: grid;
    gap: var(--nx-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.sales-timeline-list li,
.sales-notification-list li {
    border-bottom: 1px solid #25314a;
    display: grid;
    gap: var(--nx-space-1);
    padding-bottom: var(--nx-space-2);
}

.sales-timeline-list li:last-child,
.sales-notification-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sales-conversation-list a {
    background: #0f172a;
    border: 1px solid #273449;
    border-radius: var(--nx-radius-sm);
    color: #e5edf8;
    padding: var(--nx-space-2) var(--nx-space-3);
    text-decoration: none;
}

.sales-quick-notes {
    grid-template-columns: 1fr;
}

.manager-workspace-grid {
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr) minmax(300px, 360px);
}

.manager-task-space-tabs {
    margin-bottom: var(--nx-space-3);
}

.manager-lead-section {
    display: grid;
    gap: var(--nx-space-2);
    min-height: 0;
}

.manager-intake-panel {
    align-content: stretch;
    grid-template-rows: minmax(0, 1.1fr) minmax(0, .9fr);
}

.manager-filter {
    min-height: 34px;
}

.manager-quick-links {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manager-tab-empty {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    color: #cbd5e1;
    display: grid;
    gap: var(--nx-space-2);
    padding: var(--nx-space-3);
}

.manager-tab-empty strong {
    color: #f8fafc;
}

.manager-lead-summary {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manager-lead-summary div {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-1);
    padding: var(--nx-space-3);
}

.manager-lead-summary span {
    color: #94a3b8;
    font-size: .78rem;
}

.manager-lead-summary strong {
    color: #f8fafc;
}

.manager-assignment-desk,
.manager-progress-panel {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-2);
    padding: var(--nx-space-3);
}

.manager-assignment-desk > div {
    display: grid;
    gap: 2px;
}

.manager-assignment-desk > div span {
    color: #94a3b8;
    font-size: .82rem;
}

.manager-assignment-desk label {
    color: #f8fafc;
    display: grid;
    font-weight: 650;
    gap: var(--nx-space-1);
}

.manager-assignment-desk .sales-checkbox-row {
    align-items: center;
    display: flex;
}

.manager-assignment-desk textarea {
    min-height: 52px;
}

.manager-outcome-list {
    gap: var(--nx-space-2);
}

.manager-command-grid {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manager-snapshot-grid {
    display: grid;
    gap: var(--nx-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manager-snapshot-grid div {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: 2px;
    padding: var(--nx-space-2);
}

.manager-snapshot-grid span {
    color: #94a3b8;
    font-size: .76rem;
}

.manager-snapshot-grid strong {
    color: #f8fafc;
    font-size: 1.1rem;
}

.manager-delegate-list {
    display: grid;
    gap: var(--nx-space-2);
}

.manager-delegate-card {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: var(--nx-space-2);
    padding: var(--nx-space-2);
}

.manager-delegate-card > div:first-child {
    align-items: center;
    display: flex;
    gap: var(--nx-space-2);
    justify-content: space-between;
}

.manager-delegate-card span {
    color: #94a3b8;
    font-size: .76rem;
}

.manager-delegate-metrics {
    display: grid;
    gap: var(--nx-space-1);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manager-delegate-metrics span {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: 999px;
    padding: 4px 6px;
    text-align: center;
}

.manager-presence {
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    padding: 4px 8px;
    text-transform: uppercase;
}

.manager-presence.active {
    background: rgba(34, 197, 94, .16);
    color: #86efac;
}

.manager-presence.idle {
    background: rgba(148, 163, 184, .18);
    color: #cbd5e1;
}

.manager-delegate-current {
    display: grid;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.manager-delegate-current li {
    color: #cbd5e1;
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-record-tag.inline {
    display: inline-flex;
    position: static;
}

.business-card-date {
    color: #34d399;
    font-size: .78rem;
    font-weight: 700;
}

.business-card-avatar {
    align-items: center;
    background: #0b2340;
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.business-card-avatar.large {
    background: #2f7d68;
    font-size: 1rem;
    height: 52px;
    width: 52px;
}

.business-card-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.business-card-main small,
.business-card-meta,
.business-card-source {
    color: #94a3b8;
    font-size: .78rem;
}

.business-record-list {
    display: grid;
    gap: var(--nx-space-3);
}

.business-record-row {
    align-items: center;
    background: #111827;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-md);
    color: #f8fafc;
    display: grid;
    gap: var(--nx-space-3);
    grid-template-columns: 96px 42px minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(110px, .8fr) auto;
    padding: var(--nx-space-3);
    text-decoration: none;
}

.business-record-row:hover {
    border-color: #60a5fa;
    color: #ffffff;
}

.business-profile-shell {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: var(--nx-radius-lg);
    color: #e5edf8;
    margin: 0 auto;
    max-width: 100%;
    overflow: hidden;
    width: min(100%, 1480px);
}

.business-profile-topbar,
.business-profile-identity {
    align-items: center;
    border-bottom: 1px solid #25314a;
    display: flex;
    justify-content: space-between;
    padding: var(--nx-space-4);
}

.business-profile-owner {
    display: grid;
    gap: 2px;
}

.business-profile-owner span,
.business-profile-block h2,
.business-profile-field span,
.business-profile-call-card span,
.business-profile-call-due span {
    color: #9ca3af;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.business-profile-actions {
    display: flex;
    gap: var(--nx-space-2);
}

.business-profile-identity {
    gap: var(--nx-space-3);
    justify-content: flex-start;
}

.business-profile-identity h1 {
    color: #f8fafc;
    font-size: 1.25rem;
    margin: 0;
}

.business-profile-tags {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--nx-space-2);
    margin-top: var(--nx-space-1);
}

.business-profile-tags > span:not(.sales-record-tag) {
    color: #6b7280;
    font-size: .82rem;
}

.business-profile-call-due {
    background: rgba(244, 63, 94, .08);
    border: 1px solid rgba(244, 63, 94, .28);
    border-radius: var(--nx-radius-sm);
    display: grid;
    gap: 2px;
    margin-left: auto;
    padding: var(--nx-space-2) var(--nx-space-3);
}

.business-profile-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) minmax(260px, 360px);
    min-height: 520px;
    max-width: 100%;
    overflow: hidden;
}

.business-profile-left,
.business-profile-main,
.business-profile-right {
    display: grid;
    gap: var(--nx-space-4);
    align-content: start;
    padding: var(--nx-space-4);
}

.business-profile-main,
.business-profile-right {
    border-left: 1px solid #25314a;
    min-width: 0;
}

.business-profile-right {
    background: #0f172a;
}

.business-profile-call-card,
.business-profile-block,
.business-profile-field {
    display: grid;
    gap: var(--nx-space-2);
}

.business-profile-call-card {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-md);
    grid-template-columns: 1fr 1fr;
    padding: var(--nx-space-4);
}

.business-profile-call-card > div {
    grid-column: 1 / -1;
}

.business-profile-call-card strong {
    color: #f8fafc;
    display: block;
    font-size: 1.35rem;
    margin-top: var(--nx-space-1);
}

.business-profile-block {
    border-bottom: 1px solid #25314a;
    padding-bottom: var(--nx-space-4);
}

.business-profile-block:last-child {
    border-bottom: 0;
}

.business-profile-block h2 {
    margin: 0;
}

.business-profile-block p {
    margin: 0;
}

.business-contact-card {
    align-items: center;
    border: 1px solid #2b3750;
    border-radius: var(--nx-radius-sm);
    display: flex;
    gap: var(--nx-space-3);
    padding: var(--nx-space-3);
}

.business-contact-card div {
    display: grid;
    gap: 2px;
}

.business-profile-field {
    border-bottom: 1px solid #25314a;
    padding-bottom: var(--nx-space-3);
}

.business-profile-shell ~ .ui-section-card,
.business-profile-shell ~ .row {
    max-width: 100%;
}

.sales-quick-notes .btn-outline-secondary {
    background: #0f172a;
    border-color: #334155;
    color: #e5edf8;
}

.sales-quick-notes .btn-outline-secondary:hover {
    background: #172554;
    border-color: #60a5fa;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #0b1020;
    color: #e5edf8;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: #f8fafc;
}

html[data-theme="dark"] .nexus-shell {
    background:
        linear-gradient(135deg, rgba(79, 70, 229, .18), transparent 32%),
        #0b1020;
}

html[data-theme="dark"] .nexus-sidebar,
html[data-theme="dark"] .nexus-topbar {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
}

html[data-theme="dark"] .nexus-content {
    background: #0b1020;
}

html[data-theme="dark"] .nexus-brand,
html[data-theme="dark"] .nexus-brand:hover,
html[data-theme="dark"] .nexus-user-copy strong,
html[data-theme="dark"] .nexus-user-copy span,
html[data-theme="dark"] .nexus-user-copy small {
    color: #e5edf8;
}

html[data-theme="dark"] .nexus-brand small,
html[data-theme="dark"] .nexus-nav-heading,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .ui-metric-card small,
html[data-theme="dark"] .ui-data-table-title {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .nexus-nav-link {
    color: #cbd5e1;
}

html[data-theme="dark"] .nexus-nav-link.active,
html[data-theme="dark"] .nexus-nav-link:hover {
    background: #1e293b;
    color: #ffffff;
}

html[data-theme="dark"] .nexus-nav-icon,
html[data-theme="dark"] .nexus-icon-link,
html[data-theme="dark"] .nx-search {
    background: #111827;
    border-color: #273449;
    color: #dbeafe;
}

html[data-theme="dark"] .nx-search input {
    color: #e5edf8;
}

html[data-theme="dark"] .nx-search input::placeholder {
    color: #718096;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .ui-section-card,
html[data-theme="dark"] .ui-metric-card,
html[data-theme="dark"] .nx-command-bar,
html[data-theme="dark"] .record-detail-header,
html[data-theme="dark"] .message-conversation,
html[data-theme="dark"] .message-item,
html[data-theme="dark"] .ui-empty-state {
    background: #111827;
    border-color: #25314a;
    box-shadow: none;
    color: #e5edf8;
}

html[data-theme="dark"] .card-header {
    background: #0f172a;
    border-color: #25314a;
}

html[data-theme="dark"] .ui-empty-state {
    border-style: dashed;
}

html[data-theme="dark"] .ui-empty-state strong,
html[data-theme="dark"] .ui-empty-state p {
    color: #e5edf8;
}

html[data-theme="dark"] .workspace-count,
html[data-theme="dark"] .ui-section-card .card-header strong,
html[data-theme="dark"] .ui-metric-card strong,
html[data-theme="dark"] .table {
    color: #f8fafc;
}

html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .workspace-list li,
html[data-theme="dark"] .nx-activity-item {
    border-color: #25314a;
}

html[data-theme="dark"] .table thead th {
    background: #0f172a;
    color: #cbd5e1;
}

html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .message-conversation.selected,
html[data-theme="dark"] .message-conversation:hover {
    background: #172554;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-secondary {
    background: #0f172a;
    border-color: #334155;
    color: #dbeafe;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-secondary:hover {
    background: #172554;
    border-color: #60a5fa;
    color: #ffffff;
}

html[data-theme="dark"] .bg-light {
    background: #111827 !important;
    color: #e5edf8 !important;
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) {
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .08), transparent 32rem),
        var(--nx-bg);
}

html[data-theme="light"] .nexus-content:has(.sales-workspace-header) {
    background: var(--nx-bg);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-sidebar,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-topbar {
    background: rgba(255, 255, 255, .92);
    border-color: var(--nx-border);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-brand,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-user-copy strong {
    color: var(--nx-text);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-user-copy span,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-user-copy small,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-brand small,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-nav-heading {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-nav-link {
    color: #475569;
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-nav-link.active,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-nav-link:hover {
    background: var(--nx-primary-soft);
    color: var(--nx-primary);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-nav-icon,
html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nexus-icon-link {
    background: var(--nx-surface);
    border-color: var(--nx-border);
    color: var(--nx-text-muted);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nx-search {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
    color: var(--nx-text-muted);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nx-search input {
    color: var(--nx-text);
}

html[data-theme="light"] .nexus-shell:has(.sales-workspace-header) .nx-search input::placeholder {
    color: #94a3b8;
}

html[data-theme="light"] .sales-workspace-header,
html[data-theme="light"] .sales-workspace-panel {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-workspace-header h1,
html[data-theme="light"] .sales-workspace-metrics strong,
html[data-theme="light"] .sales-workspace-panel,
html[data-theme="light"] .sales-workspace-panel strong,
html[data-theme="light"] .sales-workspace-panel h2,
html[data-theme="light"] .sales-workspace-panel h3 {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-workspace-metrics div {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-workspace-metrics span,
html[data-theme="light"] .sales-panel-heading span,
html[data-theme="light"] .sales-record-card small,
html[data-theme="light"] .sales-task-row small,
html[data-theme="light"] .sales-action-heading span,
html[data-theme="light"] .sales-timeline-list span,
html[data-theme="light"] .sales-notification-list span,
html[data-theme="light"] .sales-contact-strip small,
html[data-theme="light"] .sales-timeline-list time {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-record-card,
html[data-theme="light"] .sales-task-row {
    background: var(--nx-surface);
    border-color: var(--nx-border);
    color: var(--nx-text);
}

html[data-theme="light"] .sales-record-tabs {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-record-tabs button {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-record-tabs button.active {
    background: var(--nx-surface);
    color: var(--nx-text);
}

html[data-theme="light"] .past-records-header,
html[data-theme="light"] .past-records-toolbar,
html[data-theme="light"] .past-record-day {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

html[data-theme="light"] .past-records-header h1,
html[data-theme="light"] .past-records-summary strong,
html[data-theme="light"] .past-record-day-heading h2 {
    color: var(--nx-text);
}

html[data-theme="light"] .past-records-header span,
html[data-theme="light"] .past-records-summary span,
html[data-theme="light"] .past-record-day-heading span {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .past-records-summary div {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-record-card:hover,
html[data-theme="light"] .sales-record-card.selected,
html[data-theme="light"] .sales-task-row:hover,
html[data-theme="light"] .sales-task-row.selected {
    background: #f8fbff;
    border-color: #93c5fd;
}

html[data-theme="light"] .sales-record-card span {
    color: var(--nx-info);
}

html[data-theme="light"] .sales-record-card .sales-record-tag.new {
    color: #166534;
}

html[data-theme="light"] .sales-record-card .sales-record-tag.lead {
    color: #1d4ed8;
}

html[data-theme="light"] .sales-record-card .sales-record-tag.customer {
    color: #7e22ce;
}

html[data-theme="light"] .sales-record-card .sales-record-tag.done {
    color: #475569;
}

html[data-theme="light"] .business-record-row {
    background: var(--nx-surface);
    border-color: var(--nx-border);
    color: var(--nx-text);
}

html[data-theme="light"] .business-record-row:hover {
    border-color: #93c5fd;
}

html[data-theme="light"] .business-card-main small,
html[data-theme="light"] .business-card-meta,
html[data-theme="light"] .business-card-source {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .business-profile-shell {
    background: #ffffff;
    border-color: #dbe3ef;
    color: #111827;
}

html[data-theme="light"] .business-profile-topbar,
html[data-theme="light"] .business-profile-identity {
    border-bottom-color: #e5e7eb;
}

html[data-theme="light"] .business-profile-identity h1,
html[data-theme="light"] .business-profile-call-card strong {
    color: #111827;
}

html[data-theme="light"] .business-profile-call-due {
    background: #fff1f2;
    border-color: #fecdd3;
}

html[data-theme="light"] .business-profile-main,
html[data-theme="light"] .business-profile-right {
    border-left-color: #e5e7eb;
}

html[data-theme="light"] .business-profile-right,
html[data-theme="light"] .business-profile-call-card {
    background: #f8fafc;
}

html[data-theme="light"] .business-profile-call-card {
    border-color: #e5e7eb;
}

html[data-theme="light"] .business-profile-block,
html[data-theme="light"] .business-profile-field {
    border-bottom-color: #e5e7eb;
}

html[data-theme="light"] .business-contact-card {
    border-color: #111827;
}

html[data-theme="light"] .sales-modal {
    background: var(--nx-surface);
    border-color: var(--nx-border);
    color: var(--nx-text);
}

html[data-theme="light"] .sales-modal-header {
    border-bottom-color: var(--nx-border);
}

html[data-theme="light"] .sales-modal-header h2,
html[data-theme="light"] .sales-modal-timeline strong {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-modal-header span,
html[data-theme="light"] .sales-modal-timeline time,
html[data-theme="light"] .sales-modal-timeline span {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-modal-timeline li {
    border-bottom-color: var(--nx-border);
}

html[data-theme="light"] .sales-inline-task-list {
    border-left-color: var(--nx-border);
}

html[data-theme="light"] .sales-inline-task {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
    color: var(--nx-text);
}

html[data-theme="light"] .sales-inline-task:hover,
html[data-theme="light"] .sales-inline-task.selected {
    background: #f8fbff;
    border-color: #93c5fd;
}

html[data-theme="light"] .sales-inline-task span,
html[data-theme="light"] .sales-inline-task small {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-inline-task strong {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-blocked-notice {
    background: #f8fafc;
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-blocked-notice strong {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-blocked-notice span {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-record-title {
    border-bottom-color: var(--nx-border);
}

html[data-theme="light"] .sales-record-title span {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
    color: var(--nx-text-muted);
}

html[data-theme="light"] .sales-action-workspace {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
}

html[data-theme="light"] .sales-action-workspace,
html[data-theme="light"] .sales-action-workspace strong,
html[data-theme="light"] .sales-action-workspace h3,
html[data-theme="light"] .sales-action-workspace li,
html[data-theme="light"] .sales-action-workspace span,
html[data-theme="light"] .sales-action-fields label {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-instructions,
html[data-theme="light"] .sales-contact-strip,
html[data-theme="light"] .contact-call-panel,
html[data-theme="light"] .contact-recording-card,
html[data-theme="light"] .contact-checklist {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

html[data-theme="light"] .contact-call-panel span,
html[data-theme="light"] .contact-recording-card span,
html[data-theme="light"] .contact-call-panel small,
html[data-theme="light"] .contact-recording-card small {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .contact-checklist label {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-timeline-list li,
html[data-theme="light"] .sales-notification-list li {
    border-bottom-color: var(--nx-border);
}

html[data-theme="light"] .sales-conversation-list a,
html[data-theme="light"] .sales-quick-notes .btn-outline-secondary {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
    color: var(--nx-text);
}

html[data-theme="light"] .manager-lead-summary div {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

html[data-theme="light"] .manager-assignment-desk,
html[data-theme="light"] .manager-progress-panel,
html[data-theme="light"] .manager-delegate-card,
html[data-theme="light"] .manager-snapshot-grid div {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

html[data-theme="light"] .manager-assignment-desk label,
html[data-theme="light"] .manager-assignment-desk strong,
html[data-theme="light"] .manager-delegate-card strong,
html[data-theme="light"] .manager-snapshot-grid strong {
    color: var(--nx-text);
}

html[data-theme="light"] .manager-assignment-desk > div span,
html[data-theme="light"] .manager-delegate-card span,
html[data-theme="light"] .manager-snapshot-grid span {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .manager-delegate-metrics span {
    background: var(--nx-surface-muted);
    border-color: var(--nx-border);
}

html[data-theme="light"] .manager-presence.active {
    color: #166534;
}

html[data-theme="light"] .manager-presence.idle {
    color: #475569;
}

html[data-theme="light"] .manager-delegate-current li {
    color: var(--nx-text);
}

html[data-theme="light"] .manager-lead-summary span {
    color: var(--nx-text-muted);
}

html[data-theme="light"] .manager-lead-summary strong {
    color: var(--nx-text);
}

html[data-theme="light"] .sales-context-section {
    border-bottom-color: var(--nx-border);
}

.record-detail-header {
    background: linear-gradient(135deg, #fff, #f8f7ff);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-xl);
    box-shadow: var(--nx-shadow-sm);
    margin-bottom: var(--nx-space-5);
    padding: var(--nx-space-5);
}

.record-detail-header .ui-page-header {
    margin-bottom: 0;
}

.permission-matrix-table th,
.permission-matrix-table td {
    min-width: 120px;
}

.permission-matrix-role-col {
    min-width: 220px !important;
    position: sticky;
    left: 0;
    z-index: 1;
}

.col-xl-6,
.col-xl-8,
.col-xl-4 {
    flex: 0 0 auto;
    width: 100%;
}

.d-block {
    display: block !important;
}

.gap-2 {
    gap: var(--nx-space-2) !important;
}

.me-2 {
    margin-right: var(--nx-space-2) !important;
}

.mt-3 {
    margin-top: var(--nx-space-3) !important;
}

.mb-4 {
    margin-bottom: var(--nx-space-4) !important;
}

.text-center {
    text-align: center !important;
}

.table-danger {
    background: #fff1f2;
}

.table-warning {
    background: #fffbeb;
}

@media (min-width: 1200px) {
    .col-xl-4 { width: 33.33333333%; }
    .col-xl-6 { width: 50%; }
    .col-xl-8 { width: 66.66666667%; }
}

@media (max-width: 980px) {
    .nexus-shell {
        grid-template-columns: 1fr;
    }

    .nexus-sidebar {
        border-bottom: 1px solid var(--nx-border);
        border-right: 0;
        height: auto;
        position: static;
    }

    .nexus-topbar {
        grid-template-columns: 1fr;
        position: static;
    }

    .nexus-topbar-actions,
    .nexus-user-menu {
        justify-content: flex-start;
    }

    .nx-split {
        grid-template-columns: 1fr;
    }

    .nexus-content {
        padding: var(--nx-space-4);
    }

    .sales-workspace-metrics,
    .sales-workspace-grid,
    .sales-action-fields,
    .contact-call-panel,
    .contact-recording-grid,
    .contact-checklist,
    .past-records-header,
    .past-records-summary,
    .past-records-toolbar {
        grid-template-columns: 1fr;
    }

    .sales-task-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .sales-task-row small {
        grid-column: 2;
    }

    .business-record-row,
    .past-record-row,
    .business-profile-grid {
        grid-template-columns: 1fr;
    }

    .business-profile-main,
    .business-profile-right {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    .business-profile-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .business-profile-call-due {
        margin-left: 0;
        width: 100%;
    }
}

/* =========================================================
   Nexus Work Queue / Task Spaces - Clean Desktop Layout
   Replace old Task Space CSS with this block.
   ========================================================= */

/* Keep work queue as fixed desktop viewport */
.nexus-content:has(.task-space-page) {
    height: calc(100dvh - var(--nx-topbar-height));
    overflow: hidden !important;
    padding: 10px 14px !important;
}

    .nexus-content:has(.task-space-page) .nexus-content-inner {
        display: grid;
        height: 100%;
        max-width: none;
        min-height: 0;
        overflow: hidden;
    }

/* Page root */
.task-space-page {
    display: grid;
    gap: 10px;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    position: relative;
}

/* Old noisy banner hidden */
.task-space-page-top {
    display: none !important;
}

/* Floating alerts instead of page-height alerts */
.task-space-floating-alert {
    max-width: 420px;
    position: absolute;
    right: 16px;
    top: 12px;
    z-index: 50;
}

/* Metrics row */
.task-space-page .workspace-overview {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    margin-bottom: 0 !important;
    min-height: 0;
}

.task-space-page .ui-metric-card {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: 10px;
    box-shadow: none;
    color: #e5edf8;
}

    .task-space-page .ui-metric-card .card-body {
        display: grid;
        gap: 2px;
        min-height: 58px !important;
        padding: 8px 12px !important;
    }

.task-space-page .workspace-count {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
}

.task-space-page .ui-metric-card strong {
    color: #f8fafc;
    font-size: .82rem;
}

/* Main task space shell */
.task-space-page .task-space-shell {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Top task tabs */
.task-space-page .task-space-top-tabs {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    grid-column: 1 / -1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
}

.task-space-page .task-space-tab {
    align-items: center;
    background: #0f172a;
    border: 1px solid #273449;
    border-radius: 7px;
    color: #dbeafe;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 700;
    gap: 10px;
    justify-content: space-between;
    min-height: 32px;
    min-width: 128px;
    padding: 5px 10px;
    text-align: left;
}

    .task-space-page .task-space-tab:hover,
    .task-space-page .task-space-tab.active {
        background: #172554;
        border-color: #3b82f6;
        color: #ffffff;
    }

    .task-space-page .task-space-tab strong {
        background: #111827;
        border: 1px solid #334155;
        border-radius: 999px;
        color: inherit;
        font-size: .72rem;
        min-width: 24px;
        padding: 1px 7px;
        text-align: center;
    }

/* Board and right execution panel */
.task-space-page .task-card-board,
.task-space-page .task-focus-panel {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: 12px;
    box-shadow: none;
    color: #e5edf8;
    min-height: 0;
    min-width: 0;
}

.task-space-page .task-card-board {
    display: grid;
    gap: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
    padding: 10px 12px;
}

.task-space-page .task-focus-panel {
    align-content: start;
    display: grid;
    gap: 10px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px;
}

/* Board toolbar */
.task-space-page .task-board-toolbar {
    align-items: center;
    border-bottom: 1px solid #25314a;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    padding: 4px 0 10px;
}

    .task-space-page .task-board-toolbar span {
        color: #94a3b8;
        font-size: .74rem;
    }

    .task-space-page .task-board-toolbar h2 {
        color: #f8fafc;
        font-size: .95rem;
        font-weight: 800;
        margin: 0;
    }

    .task-space-page .task-board-toolbar .form-control {
        background: #0f172a;
        border-color: #334155;
        color: #f8fafc;
        min-height: 34px;
    }

        .task-space-page .task-board-toolbar .form-control::placeholder {
            color: #64748b;
        }

/* Header row */
.task-space-page .task-row-head {
    align-items: center;
    border-bottom: 1px solid #25314a;
    color: #94a3b8;
    display: grid;
    font-size: .68rem;
    font-weight: 900;
    gap: 12px;
    grid-template-columns: 92px minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(130px, .8fr) minmax(130px, .8fr);
    letter-spacing: .05em;
    padding: 10px 10px 8px;
    text-transform: uppercase;
}

    .task-space-page .task-row-head.manager {
        grid-template-columns: 92px minmax(170px, 1.15fr) minmax(140px, .95fr) minmax(120px, .75fr) minmax(120px, .75fr) minmax(130px, .8fr);
    }

/* Card list */
.task-space-page .task-card-list {
    align-content: start;
    display: grid;
    gap: 0;
    height: 100%;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Slim task row */
.task-space-page .task-row-card {
    align-items: center;
    background: #0f172a;
    border: 0;
    border-bottom: 1px solid #25314a;
    color: #e5edf8;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 92px minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(130px, .8fr) minmax(130px, .8fr);
    min-height: 48px !important;
    padding: 7px 10px !important;
    text-align: left;
    width: 100%;
}

    .task-space-page .task-row-card.manager {
        grid-template-columns: 92px minmax(170px, 1.15fr) minmax(140px, .95fr) minmax(120px, .75fr) minmax(120px, .75fr) minmax(130px, .8fr);
    }

    .task-space-page .task-row-card:hover,
    .task-space-page .task-row-card.selected {
        background: #172554;
        border-color: #3b82f6;
        color: #ffffff;
    }

    .task-space-page .task-row-card.overdue {
        border-left: 3px solid #ef4444;
    }

    /* Hide avatar in slim table row */
    .task-space-page .task-row-card .business-card-avatar {
        display: none !important;
    }

/* Important: task-row-main must be one cell, not display: contents */
.task-space-page .task-row-main,
.task-space-page .task-row-meta {
    display: grid !important;
    gap: 1px;
    min-width: 0;
}

/* Record name and number stay in same record column */
.task-space-page .task-row-main {
    grid-column: auto !important;
}

    .task-space-page .task-row-main strong,
    .task-space-page .task-row-main small,
    .task-space-page .task-row-meta strong {
        grid-column: auto !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .task-space-page .task-row-main strong,
    .task-space-page .task-row-meta strong {
        color: #f8fafc;
        font-size: .86rem;
        font-weight: 800;
        line-height: 1.15;
    }

    .task-space-page .task-row-main small {
        color: #7fa0d8;
        font-size: .7rem;
        line-height: 1.1;
    }

/* Hide repeated small labels like Task / Contact / Phone inside row */
.task-space-page .task-row-meta small {
    display: none !important;
}

.task-space-page .task-row-meta.compact {
    justify-self: start;
}

/* Status pill */
.task-space-page .task-row-status {
    align-items: center;
    align-self: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .68rem;
    font-weight: 900;
    justify-content: center;
    min-height: 24px;
    min-width: 78px;
    padding: 3px 9px;
    text-transform: none;
}

    .task-space-page .task-row-status.ready {
        background: rgba(14, 116, 144, .28);
        color: #67e8f9;
    }

    .task-space-page .task-row-status.active {
        background: rgba(22, 101, 52, .32);
        color: #86efac;
    }

    .task-space-page .task-row-status.overdue {
        background: rgba(153, 27, 27, .32);
        color: #fecaca;
    }

/* Right focus panel */
.task-space-page .task-focus-header {
    border-bottom: 1px solid #25314a;
    display: grid;
    gap: 8px;
    padding-bottom: 10px;
}

    .task-space-page .task-focus-header h2 {
        color: #f8fafc;
        font-size: 1rem;
        font-weight: 800;
        margin: 0;
    }

    .task-space-page .task-focus-header p {
        color: #94a3b8;
        font-size: .78rem;
        margin: 0;
    }

.task-space-page .task-focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .task-space-page .task-focus-actions .btn {
        min-height: 28px;
        padding: 4px 9px;
    }

/* Right panel sections */
.task-space-page .task-focus-section {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 10px;
}

.task-space-page .task-focus-titleline {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

    .task-space-page .task-focus-titleline strong {
        color: #f8fafc;
        font-size: .9rem;
    }

    .task-space-page .task-focus-titleline span {
        color: #94a3b8;
        font-size: .72rem;
    }

.task-space-page .task-detail-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

    .task-space-page .task-detail-grid div {
        background: #111827;
        border: 1px solid #25314a;
        border-radius: 7px;
        display: grid;
        gap: 2px;
        min-width: 0;
        padding: 8px;
    }

    .task-space-page .task-detail-grid span {
        color: #94a3b8;
        font-size: .72rem;
    }

    .task-space-page .task-detail-grid strong {
        color: #f8fafc;
        font-size: .86rem;
        overflow-wrap: anywhere;
    }

/* Contact call execution */
.task-space-page .contact-task-workspace {
    display: grid;
    gap: 10px;
}

.task-space-page .contact-call-panel,
.task-space-page .task-call-execution-panel {
    align-items: center;
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) auto;
    padding: 9px 10px;
}

    .task-space-page .contact-call-panel > div {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .task-space-page .contact-call-panel span {
        color: #94a3b8;
        font-size: .72rem;
        font-weight: 800;
    }

    .task-space-page .contact-call-panel strong {
        color: #f8fafc;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .task-space-page .contact-call-panel small {
        color: #94a3b8;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.task-space-page .contact-call-button {
    min-height: 34px;
    min-width: 124px;
}

/* Call script */
.task-space-page .task-call-script {
    margin: 0;
    padding-left: 1.15rem;
}

    .task-space-page .task-call-script li {
        color: #e5edf8;
        font-size: .82rem;
    }

        .task-space-page .task-call-script li + li {
            margin-top: 4px;
        }

/* Timeline list */
.task-space-page .task-related-list {
    display: grid;
    gap: 8px;
}

    .task-space-page .task-related-list button {
        background: #111827;
        border: 1px solid #25314a;
        border-radius: 7px;
        color: #e5edf8;
        cursor: pointer;
        display: grid;
        gap: 2px;
        padding: 8px;
        text-align: left;
    }

        .task-space-page .task-related-list button:hover {
            border-color: #3b82f6;
        }

    .task-space-page .task-related-list span,
    .task-space-page .task-related-list small {
        color: #94a3b8;
        font-size: .72rem;
    }

    .task-space-page .task-related-list strong {
        color: #f8fafc;
    }

/* Record-only badge */
.task-space-page .task-record-only-note {
    align-items: center;
    background: #172554;
    border: 1px solid #3b82f6;
    border-radius: 999px;
    color: #dbeafe;
    display: inline-flex;
    font-size: .7rem;
    font-weight: 800;
    min-height: 26px;
    padding: 4px 9px;
}

/* Forms inside task panel */
.task-space-page .form-control,
.task-space-page .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
    min-height: 34px;
}

.task-space-page textarea.form-control {
    min-height: 58px;
}

.task-space-page .form-control::placeholder {
    color: #64748b;
}

.task-space-page label {
    color: #f8fafc;
    display: grid;
    font-size: .82rem;
    font-weight: 700;
    gap: 5px;
}

.task-space-page .sales-checkbox-row {
    align-items: center;
    color: #f8fafc;
    display: flex;
    font-weight: 700;
    gap: 8px;
}

/* Legacy workbench compact mode */
.sales-workspace-header[hidden] {
    display: none !important;
}

.nexus-content:has(.sales-workspace-header[hidden]) {
    overflow: hidden;
}

    .nexus-content:has(.sales-workspace-header[hidden]) .nexus-content-inner {
        grid-template-rows: minmax(0, 1fr);
    }

    .nexus-content:has(.sales-workspace-header[hidden]) .manager-task-space-tabs {
        margin-bottom: 0;
    }

    .nexus-content:has(.sales-workspace-header[hidden]):has(.manager-task-space-tabs) .nexus-content-inner {
        grid-template-rows: auto minmax(0, 1fr);
    }

/* Small helper retained from legacy workbench */
.sales-record-title-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--nx-space-2);
    justify-content: flex-end;
}

/* Responsive fallback */
@media (max-width: 1200px) {
    .task-space-page .task-space-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) minmax(320px, .8fr);
    }

    .task-space-page .task-focus-panel {
        grid-column: 1;
    }
}

@media (max-width: 900px) {
    .nexus-content:has(.task-space-page) {
        overflow: auto !important;
        padding: 10px !important;
    }

    .task-space-page {
        height: auto;
        overflow: visible !important;
    }

        .task-space-page .workspace-overview {
            grid-template-columns: 1fr;
        }

        .task-space-page .task-space-shell {
            height: auto !important;
            overflow: visible !important;
        }

        .task-space-page .task-row-head {
            display: none;
        }

        .task-space-page .task-row-card,
        .task-space-page .task-row-card.manager {
            grid-template-columns: 82px minmax(0, 1fr);
            min-height: 58px !important;
        }

        .task-space-page .task-row-main {
            grid-column: 2;
        }

        .task-space-page .task-row-meta {
            display: none !important;
        }

        .task-space-page .contact-call-panel,
        .task-space-page .task-call-execution-panel {
            align-items: stretch;
            grid-template-columns: 1fr;
        }

        .task-space-page .task-detail-grid {
            grid-template-columns: 1fr;
        }
}

/* Right execution panel tabs */
.task-execution-shell {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.task-focus-tabs {
    background: #0f172a;
    border: 1px solid #25314a;
    border-radius: 999px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    position: sticky;
    top: 0;
    z-index: 5;
}

    .task-focus-tabs button {
        align-items: center;
        background: transparent;
        border: 0;
        border-radius: 999px;
        color: #94a3b8;
        cursor: pointer;
        display: flex;
        font-size: .82rem;
        font-weight: 800;
        gap: 6px;
        justify-content: center;
        min-height: 30px;
    }

        .task-focus-tabs button.active {
            background: #172554;
            color: #ffffff;
        }

    .task-focus-tabs span {
        background: #111827;
        border: 1px solid #334155;
        border-radius: 999px;
        color: inherit;
        font-size: .68rem;
        min-width: 22px;
        padding: 1px 6px;
    }

.task-tab-content,
.timeline-tab-content,
.task-operation-panel {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.task-execution-card {
    background: #0f172a;
    border: 1px solid #2b3750;
    border-radius: 10px;
    display: grid;
    gap: 10px;
    padding: 10px;
}

.task-execution-heading {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
}

    .task-execution-heading div {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .task-execution-heading strong {
        color: #f8fafc;
        font-size: .95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .task-execution-heading small {
        color: #94a3b8;
        font-size: .74rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.task-execution-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compact-task-section {
    gap: 8px !important;
}

.task-contact-line {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.task-contact-line div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.task-contact-line span,
.task-contact-line small {
    color: #94a3b8;
    font-size: .74rem;
}

.task-contact-line strong {
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-status-note {
    color: #94a3b8;
    font-size: .8rem;
    margin: 0;
}

.task-check-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
}

.timeline-tab-header {
    align-items: center;
    display: flex !important;
    justify-content: space-between;
}

.timeline-event-list {
    display: grid;
    gap: 8px;
}

.timeline-event-card {
    background: #0f172a;
    border: 1px solid #25314a;
    border-radius: 8px;
    display: grid;
    gap: 3px;
    padding: 9px;
}

.timeline-event-card time {
    color: #94a3b8;
    font-size: .7rem;
}

.timeline-event-card strong {
    color: #f8fafc;
    font-size: .88rem;
}

.timeline-event-card p {
    color: #cbd5e1;
    font-size: .76rem;
    margin: 0;
    overflow-wrap: anywhere;
}

/* Appointment scheduler operation */
.appointment-contact-card {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

    .appointment-contact-card div {
        background: #111827;
        border: 1px solid #25314a;
        border-radius: 7px;
        display: grid;
        gap: 2px;
        min-width: 0;
        padding: 8px;
    }

    .appointment-contact-card span,
    .appointment-mini-list span,
    .appointment-mini-list small {
        color: #94a3b8;
        font-size: .72rem;
    }

    .appointment-contact-card strong {
        color: #f8fafc;
        font-size: .84rem;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.appointment-mini-list {
    background: #111827;
    border: 1px solid #25314a;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 8px;
}

    .appointment-mini-list > strong {
        color: #f8fafc;
        font-size: .82rem;
    }

    .appointment-mini-list div {
        border-top: 1px solid #25314a;
        display: grid;
        gap: 2px;
        padding-top: 6px;
    }

@media (max-width: 900px) {
    .appointment-contact-card {
        grid-template-columns: 1fr;
    }
}
/* C1C5_COMMERCIAL_SIGN_PROVIDER_STATUS */
[data-testid="commercial-sign-status-badge"].bg-success {
    background: #16a34a !important;
    color: #fff !important;
}


/* =========================================================
   Nexus Release UI Foundation
   U1A - Production Authentication Surface
   ========================================================= */

html[data-theme="light"] {
    --nx-auth-page-bg: #f6f8fc;
    --nx-auth-panel-bg: rgba(255, 255, 255, .88);
    --nx-auth-card-bg: rgba(255, 255, 255, .94);
    --nx-auth-card-border: rgba(148, 163, 184, .26);
    --nx-auth-card-shadow: 0 28px 70px rgba(15, 23, 42, .12);
    --nx-auth-text: #172033;
    --nx-auth-muted: #64748b;
    --nx-auth-label: #334155;
    --nx-auth-input-bg: #ffffff;
    --nx-auth-input-border: #cbd5e1;
    --nx-auth-input-hover: #94a3b8;
    --nx-auth-divider: #e2e8f0;
    --nx-auth-error-bg: #fff1f2;
    --nx-auth-error-border: #fecdd3;
    --nx-auth-error-text: #9f1239;
}

html[data-theme="dark"] {
    --nx-auth-page-bg: #080d19;
    --nx-auth-panel-bg: rgba(10, 16, 30, .92);
    --nx-auth-card-bg: rgba(15, 23, 42, .88);
    --nx-auth-card-border: rgba(100, 116, 139, .28);
    --nx-auth-card-shadow: 0 30px 90px rgba(0, 0, 0, .38);
    --nx-auth-text: #f8fafc;
    --nx-auth-muted: #94a3b8;
    --nx-auth-label: #dbe4f0;
    --nx-auth-input-bg: #111827;
    --nx-auth-input-border: #334155;
    --nx-auth-input-hover: #475569;
    --nx-auth-divider: #25314a;
    --nx-auth-error-bg: rgba(127, 29, 29, .26);
    --nx-auth-error-border: rgba(248, 113, 113, .4);
    --nx-auth-error-text: #fecaca;
}

.nx-auth-layout {
    background: var(--nx-auth-page-bg);
    min-height: 100dvh;
    overflow: auto;
    width: 100%;
}

.nx-auth-shell {
    background: var(--nx-auth-page-bg);
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr);
    min-height: 100dvh;
    width: 100%;
}

.nx-auth-story {
    background: radial-gradient( circle at 18% 16%, rgba(129, 140, 248, .28), transparent 28rem), radial-gradient( circle at 82% 78%, rgba(124, 58, 237, .22), transparent 32rem), linear-gradient( 145deg, #111827 0%, #111b38 45%, #171447 100%);
    color: #f8fafc;
    display: flex;
    min-height: 100dvh;
    overflow: hidden;
    padding: clamp(36px, 5vw, 76px);
    position: relative;
}

    .nx-auth-story::before {
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 999px;
        content: "";
        height: 420px;
        position: absolute;
        right: -180px;
        top: -170px;
        width: 420px;
    }

    .nx-auth-story::after {
        background: linear-gradient( 90deg, rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient( rgba(255, 255, 255, .045) 1px, transparent 1px);
        background-size: 44px 44px;
        content: "";
        inset: 0;
        mask-image: linear-gradient( to bottom right, rgba(0, 0, 0, .72), transparent 72%);
        pointer-events: none;
        position: absolute;
    }

.nx-auth-story-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    isolation: isolate;
    justify-content: space-between;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.nx-auth-brand {
    align-items: center;
    color: var(--nx-auth-text);
    display: inline-flex;
    gap: 12px;
    width: fit-content;
}

.nx-auth-brand-inverse {
    color: #ffffff;
}

.nx-auth-brand-mark {
    align-items: center;
    background: linear-gradient( 135deg, #6366f1, #7c3aed);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 13px;
    box-shadow: 0 10px 28px rgba(79, 70, 229, .28);
    color: #ffffff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    letter-spacing: -.03em;
    width: 42px;
}

.nx-auth-brand-copy {
    display: grid;
    gap: 2px;
}

    .nx-auth-brand-copy strong {
        color: inherit;
        font-size: 1.03rem;
        font-weight: 750;
        letter-spacing: -.02em;
        line-height: 1.1;
    }

    .nx-auth-brand-copy small {
        color: inherit;
        font-size: .72rem;
        font-weight: 550;
        opacity: .66;
    }

.nx-auth-story-message {
    display: grid;
    gap: 18px;
    margin: auto 0;
    max-width: 660px;
    padding: 72px 0;
}

.nx-auth-eyebrow {
    color: #818cf8;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nx-auth-story-message h2 {
    color: #ffffff;
    font-size: clamp(2.55rem, 4vw, 4.4rem);
    font-weight: 720;
    letter-spacing: -.055em;
    line-height: .98;
    margin: 0;
    max-width: 680px;
}

.nx-auth-story-message p {
    color: #b8c5d8;
    font-size: clamp(1rem, 1.3vw, 1.16rem);
    line-height: 1.65;
    margin: 0;
    max-width: 600px;
}

.nx-auth-story-footer {
    align-items: center;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    font-size: .75rem;
    font-weight: 650;
    gap: 8px 18px;
}

    .nx-auth-story-footer span {
        align-items: center;
        display: inline-flex;
        gap: 8px;
    }

        .nx-auth-story-footer span::before {
            background: #6366f1;
            border-radius: 999px;
            content: "";
            height: 5px;
            width: 5px;
        }

.nx-auth-panel {
    align-items: center;
    background: radial-gradient( circle at top right, rgba(99, 102, 241, .10), transparent 24rem), var(--nx-auth-panel-bg);
    display: flex;
    justify-content: center;
    min-height: 100dvh;
    padding: clamp(28px, 5vw, 72px);
}

.nx-auth-card {
    background: var(--nx-auth-card-bg);
    border: 1px solid var(--nx-auth-card-border);
    border-radius: 22px;
    box-shadow: var(--nx-auth-card-shadow);
    color: var(--nx-auth-text);
    display: grid;
    gap: 28px;
    max-width: 460px;
    padding: clamp(28px, 4vw, 44px);
    width: 100%;
}

.nx-auth-mobile-brand {
    display: none;
}

.nx-auth-heading {
    display: grid;
    gap: 8px;
}

    .nx-auth-heading h1 {
        color: var(--nx-auth-text);
        font-size: 2rem;
        font-weight: 720;
        letter-spacing: -.04em;
        line-height: 1.08;
        margin: 3px 0 0;
    }

    .nx-auth-heading p {
        color: var(--nx-auth-muted);
        font-size: .94rem;
        margin: 0;
    }

.nx-auth-message:empty {
    display: none;
}

.nx-auth-error {
    background: var(--nx-auth-error-bg);
    border: 1px solid var(--nx-auth-error-border);
    border-radius: 10px;
    color: var(--nx-auth-error-text);
    display: grid;
    font-size: .82rem;
    gap: 3px;
    padding: 11px 12px;
}

    .nx-auth-error strong {
        color: inherit;
        font-size: .84rem;
    }

.nx-auth-form {
    display: grid;
    gap: 18px;
}

.nx-auth-field {
    display: grid;
    gap: 7px;
}

    .nx-auth-field label {
        color: var(--nx-auth-label);
        font-size: .79rem;
        font-weight: 700;
    }

    .nx-auth-field .form-control {
        background: var(--nx-auth-input-bg);
        border: 1px solid var(--nx-auth-input-border);
        border-radius: 10px;
        color: var(--nx-auth-text);
        font-size: .92rem;
        min-height: 46px;
        padding: 10px 12px;
        transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
        width: 100%;
    }

        .nx-auth-field .form-control:hover {
            border-color: var(--nx-auth-input-hover);
        }

        .nx-auth-field .form-control:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
            outline: none;
        }

.nx-auth-submit {
    align-items: center;
    background: linear-gradient( 135deg, #4f46e5, #6d28d9);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .20);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 750;
    justify-content: center;
    min-height: 46px;
    margin-top: 2px;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
    width: 100%;
}

    .nx-auth-submit:hover {
        box-shadow: 0 12px 28px rgba(79, 70, 229, .28);
        filter: brightness(1.06);
        transform: translateY(-1px);
    }

    .nx-auth-submit:active {
        transform: translateY(0);
    }

    .nx-auth-submit:focus-visible {
        outline: 3px solid rgba(99, 102, 241, .30);
        outline-offset: 3px;
    }

.nx-auth-card-footer {
    border-top: 1px solid var(--nx-auth-divider);
    color: var(--nx-auth-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .7rem;
    gap: 6px;
    padding-top: 18px;
}

@media (max-width: 980px) {
    .nx-auth-shell {
        grid-template-columns: 1fr;
    }

    .nx-auth-story {
        display: none;
    }

    .nx-auth-panel {
        min-height: 100dvh;
        padding: 24px;
    }

    .nx-auth-mobile-brand {
        display: block;
    }

    .nx-auth-card {
        max-width: 480px;
    }
}

@media (max-width: 520px) {
    .nx-auth-panel {
        align-items: stretch;
        padding: 0;
    }

    .nx-auth-card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        justify-content: center;
        max-width: none;
        min-height: 100dvh;
        padding: 28px 22px;
    }

    .nx-auth-heading h1 {
        font-size: 1.8rem;
    }
}

/* =========================================================
   Nexus Release UI Foundation
   U1B - Semantic Application Shell + Task Spaces
   ========================================================= */

html[data-theme="light"] {
    --nx-app-bg: #f4f6fa;
    --nx-shell-surface: #ffffff;
    --nx-shell-surface-elevated: rgba(255, 255, 255, .94);
    --nx-panel-bg: #ffffff;
    --nx-panel-bg-subtle: #f8fafc;
    --nx-control-bg: #ffffff;
    --nx-control-border: #d7dfeb;
    --nx-text-primary: #182033;
    --nx-text-secondary: #667085;
    --nx-selected-bg: #eef2ff;
    --nx-selected-border: #6366f1;
    --nx-hover-bg: #f5f7ff;
    --nx-divider: #e4e9f1;
    --nx-shell-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    --nx-panel-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .035);
    --nx-task-canvas: #eef2f7;
    /* Compatibility aliases for existing components. */
    --nx-bg: var(--nx-app-bg);
    --nx-surface: var(--nx-panel-bg);
    --nx-surface-muted: var(--nx-panel-bg-subtle);
    --nx-border: var(--nx-divider);
    --nx-border-strong: var(--nx-control-border);
    --nx-text: var(--nx-text-primary);
    --nx-text-muted: var(--nx-text-secondary);
}

html[data-theme="dark"] {
    --nx-app-bg: #080d19;
    --nx-shell-surface: #0d1424;
    --nx-shell-surface-elevated: rgba(15, 23, 42, .96);
    --nx-panel-bg: #101827;
    --nx-panel-bg-subtle: #0c1423;
    --nx-control-bg: #111b2d;
    --nx-control-border: #29364c;
    --nx-text-primary: #f1f5f9;
    --nx-text-secondary: #93a4bc;
    --nx-selected-bg: #172554;
    --nx-selected-border: #6366f1;
    --nx-hover-bg: #162037;
    --nx-divider: #243047;
    --nx-shell-shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --nx-panel-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 10px 30px rgba(0, 0, 0, .12);
    --nx-task-canvas: #0a1020;
    /* Compatibility aliases for existing components. */
    --nx-bg: var(--nx-app-bg);
    --nx-surface: var(--nx-panel-bg);
    --nx-surface-muted: var(--nx-panel-bg-subtle);
    --nx-border: var(--nx-divider);
    --nx-border-strong: var(--nx-control-border);
    --nx-text: var(--nx-text-primary);
    --nx-text-muted: var(--nx-text-secondary);
}


/* ---------- Base application ---------- */

html,
body {
    background: var(--nx-app-bg);
    color: var(--nx-text-primary);
}

.nexus-shell {
    background: var(--nx-app-bg);
    color: var(--nx-text-primary);
}

.nexus-sidebar {
    background: var(--nx-shell-surface);
    border-right-color: var(--nx-divider);
    box-shadow: var(--nx-shell-shadow);
    color: var(--nx-text-primary);
}

.nexus-main {
    background: var(--nx-app-bg);
}

.nexus-topbar {
    background: var(--nx-shell-surface-elevated);
    border-bottom-color: var(--nx-divider);
    box-shadow: var(--nx-shell-shadow);
}

.nexus-content {
    background: var(--nx-app-bg);
}


/* ---------- Brand ---------- */

.nexus-brand,
.nexus-brand:hover {
    color: var(--nx-text-primary);
}

    .nexus-brand small {
        color: var(--nx-text-secondary);
    }


/* ---------- Navigation ---------- */

.nexus-nav-heading {
    color: var(--nx-text-secondary);
}

.nexus-nav-link {
    color: var(--nx-text-secondary);
}

    .nexus-nav-link:hover {
        background: var(--nx-hover-bg);
        color: var(--nx-text-primary);
    }

    .nexus-nav-link.active {
        background: var(--nx-selected-bg);
        color: var(--nx-text-primary);
    }

.nexus-nav-icon {
    background: var(--nx-panel-bg-subtle);
    border-color: var(--nx-divider);
    color: var(--nx-text-secondary);
}

.nexus-nav-link:hover .nexus-nav-icon,
.nexus-nav-link.active .nexus-nav-icon {
    background: var(--nx-panel-bg);
    border-color: var(--nx-selected-border);
    color: var(--nx-primary);
}


/* ---------- Top bar ---------- */

.nexus-icon-link {
    background: var(--nx-control-bg);
    border-color: var(--nx-control-border);
    color: var(--nx-text-secondary);
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

    .nexus-icon-link:hover {
        background: var(--nx-hover-bg);
        border-color: var(--nx-selected-border);
        color: var(--nx-primary);
        transform: translateY(-1px);
    }

.nexus-theme-toggle span {
    font-size: 1rem;
    line-height: 1;
}

.nx-search {
    background: var(--nx-control-bg);
    border-color: var(--nx-control-border);
    color: var(--nx-text-secondary);
}

    .nx-search input {
        color: var(--nx-text-primary);
    }

        .nx-search input::placeholder {
            color: var(--nx-text-secondary);
            opacity: .72;
        }


/* ---------- User identity ---------- */

.nexus-user-copy strong {
    color: var(--nx-text-primary);
}

.nexus-user-copy span,
.nexus-user-copy small {
    color: var(--nx-text-secondary);
}

.nx-avatar {
    background: var(--nx-selected-bg);
    border-color: var(--nx-selected-border);
}


/* ---------- Generic surfaces ---------- */

.card,
.ui-section-card,
.ui-metric-card {
    background: var(--nx-panel-bg);
    border-color: var(--nx-divider);
    box-shadow: var(--nx-panel-shadow);
    color: var(--nx-text-primary);
}

.card-header {
    background: var(--nx-panel-bg-subtle);
    border-bottom-color: var(--nx-divider);
}

.workspace-count {
    color: var(--nx-text-primary);
}

.ui-metric-card strong {
    color: var(--nx-text-primary);
}

.ui-metric-card small,
.text-muted {
    color: var(--nx-text-secondary) !important;
}

.ui-empty-state {
    background: var(--nx-panel-bg-subtle);
    border-color: var(--nx-control-border);
    color: var(--nx-text-primary);
}

    .ui-empty-state strong {
        color: var(--nx-text-primary);
    }

    .ui-empty-state p {
        color: var(--nx-text-secondary);
    }


/* =========================================================
   Task Spaces
   Same component model in both themes.
   ========================================================= */

.nexus-content:has(.task-space-page) {
    background: var(--nx-task-canvas) !important;
}

.task-space-page {
    color: var(--nx-text-primary);
}


    /* ---------- Metrics ---------- */

    .task-space-page .workspace-overview .ui-metric-card {
        background: var(--nx-panel-bg);
        border-color: var(--nx-divider);
        box-shadow: var(--nx-panel-shadow);
    }

    .task-space-page .workspace-overview .workspace-count,
    .task-space-page .workspace-overview strong {
        color: var(--nx-text-primary);
    }

    .task-space-page .workspace-overview small {
        color: var(--nx-text-secondary);
    }


    /* ---------- Top workflow tabs ---------- */

    .task-space-page .task-space-top-tabs {
        background: var(--nx-panel-bg);
        border-color: var(--nx-divider);
        box-shadow: var(--nx-panel-shadow);
    }

    .task-space-page .task-space-tab {
        background: var(--nx-panel-bg-subtle);
        border-color: var(--nx-divider);
        color: var(--nx-text-secondary);
    }

        .task-space-page .task-space-tab:hover {
            background: var(--nx-hover-bg);
            border-color: var(--nx-selected-border);
            color: var(--nx-text-primary);
        }

        .task-space-page .task-space-tab.active {
            background: var(--nx-selected-bg);
            border-color: var(--nx-selected-border);
            color: var(--nx-text-primary);
        }

        .task-space-page .task-space-tab strong {
            background: var(--nx-panel-bg);
            border-color: var(--nx-control-border);
            color: inherit;
        }


    /* ---------- Main board + focus panel ---------- */

    .task-space-page .task-card-board,
    .task-space-page .task-focus-panel {
        background: var(--nx-panel-bg);
        border-color: var(--nx-divider);
        box-shadow: var(--nx-panel-shadow);
        color: var(--nx-text-primary);
    }

    .task-space-page .task-board-toolbar {
        border-bottom-color: var(--nx-divider);
    }

        .task-space-page .task-board-toolbar span {
            color: var(--nx-text-secondary);
        }

        .task-space-page .task-board-toolbar h2 {
            color: var(--nx-text-primary);
        }

        .task-space-page .task-board-toolbar .form-control {
            background: var(--nx-control-bg);
            border-color: var(--nx-control-border);
            color: var(--nx-text-primary);
        }


    /* ---------- Row headings ---------- */

    .task-space-page .task-row-head {
        border-color: var(--nx-divider);
        color: var(--nx-text-secondary);
    }


    /* ---------- Task cards ---------- */

    .task-space-page .task-row-card {
        background: var(--nx-panel-bg-subtle);
        border-color: var(--nx-divider);
        color: var(--nx-text-primary);
    }

        .task-space-page .task-row-card:hover {
            background: var(--nx-hover-bg);
            border-color: var(--nx-selected-border);
        }

        .task-space-page .task-row-card.selected {
            background: var(--nx-selected-bg);
            border-color: var(--nx-selected-border);
            box-shadow: inset 3px 0 0 var(--nx-selected-border);
        }

    .task-space-page .task-row-main strong,
    .task-space-page .task-row-meta strong {
        color: var(--nx-text-primary);
    }

    .task-space-page .task-row-main small,
    .task-space-page .task-row-meta small {
        color: var(--nx-text-secondary);
    }


    /* ---------- Focus / execution ---------- */

    .task-space-page .task-focus-header {
        border-bottom-color: var(--nx-divider);
    }

        .task-space-page .task-focus-header h2 {
            color: var(--nx-text-primary);
        }

        .task-space-page .task-focus-header p {
            color: var(--nx-text-secondary);
        }

    .task-space-page .task-focus-section,
    .task-space-page .task-execution-card,
    .task-space-page .task-action-workspace,
    .task-space-page .task-detail-grid div,
    .task-space-page .timeline-event-card {
        background: var(--nx-panel-bg-subtle);
        border-color: var(--nx-divider);
        color: var(--nx-text-primary);
    }

        .task-space-page .task-focus-titleline strong,
        .task-space-page .task-detail-grid strong,
        .task-space-page .task-execution-heading strong,
        .task-space-page .task-contact-line strong,
        .task-space-page .timeline-event-card strong {
            color: var(--nx-text-primary);
        }

        .task-space-page .task-focus-titleline span,
        .task-space-page .task-detail-grid span,
        .task-space-page .task-execution-heading small,
        .task-space-page .task-contact-line span,
        .task-space-page .task-contact-line small,
        .task-space-page .timeline-event-card time,
        .task-space-page .task-status-note {
            color: var(--nx-text-secondary);
        }


    /* ---------- Execution tabs ---------- */

    .task-space-page .task-focus-tabs {
        background: var(--nx-panel-bg-subtle);
        border-color: var(--nx-divider);
    }

        .task-space-page .task-focus-tabs button {
            color: var(--nx-text-secondary);
        }

            .task-space-page .task-focus-tabs button:hover {
                color: var(--nx-text-primary);
            }

            .task-space-page .task-focus-tabs button.active {
                background: var(--nx-selected-bg);
                color: var(--nx-text-primary);
            }

        .task-space-page .task-focus-tabs span {
            background: var(--nx-panel-bg);
            border-color: var(--nx-control-border);
            color: inherit;
        }


    /* ---------- Task forms ---------- */

    .task-space-page .form-control,
    .task-space-page .form-select {
        background: var(--nx-control-bg);
        border-color: var(--nx-control-border);
        color: var(--nx-text-primary);
    }

        .task-space-page .form-control:hover,
        .task-space-page .form-select:hover {
            border-color: var(--nx-selected-border);
        }

        .task-space-page .form-control:focus,
        .task-space-page .form-select:focus {
            background: var(--nx-control-bg);
            border-color: var(--nx-selected-border);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
            color: var(--nx-text-primary);
        }

        .task-space-page .form-control::placeholder {
            color: var(--nx-text-secondary);
            opacity: .72;
        }

    .task-space-page label,
    .task-space-page .sales-checkbox-row {
        color: var(--nx-text-primary);
    }


    /* ---------- Empty states ---------- */

    .task-space-page .ui-empty-state {
        background: var(--nx-panel-bg-subtle);
        border-color: var(--nx-control-border);
        color: var(--nx-text-primary);
    }

        .task-space-page .ui-empty-state strong {
            color: var(--nx-text-primary);
        }

        .task-space-page .ui-empty-state p {
            color: var(--nx-text-secondary);
        }


/* ---------- Light theme status refinement ---------- */

html[data-theme="light"]
.task-space-page .task-row-status.ready {
    background: #ecfeff;
    color: #0e7490;
}

html[data-theme="light"]
.task-space-page .task-row-status.active {
    background: #ecfdf3;
    color: #166534;
}

html[data-theme="light"]
.task-space-page .task-row-status.overdue {
    background: #fff1f2;
    color: #b42318;
}


/* ---------- Dark theme status refinement ---------- */

html[data-theme="dark"]
.task-space-page .task-row-status.ready {
    background: rgba(14, 116, 144, .24);
    color: #67e8f9;
}

html[data-theme="dark"]
.task-space-page .task-row-status.active {
    background: rgba(22, 101, 52, .30);
    color: #86efac;
}

html[data-theme="dark"]
.task-space-page .task-row-status.overdue {
    background: rgba(153, 27, 27, .28);
    color: #fecaca;
}


/* =========================================================
   Nexus Release UI Foundation
   U2A - Human-facing Sales task presentation
   ========================================================= */

.task-space-page .task-technical-details {
    border-top: 1px solid var(--nx-divider);
    margin-top: 14px;
    padding-top: 12px;
}

    .task-space-page .task-technical-details summary {
        color: var(--nx-text-secondary);
        cursor: pointer;
        font-size: .72rem;
        font-weight: 700;
        list-style-position: outside;
        user-select: none;
    }

        .task-space-page .task-technical-details summary:hover {
            color: var(--nx-text-primary);
        }

    .task-space-page .task-technical-details[open] summary {
        color: var(--nx-text-primary);
        margin-bottom: 12px;
    }

.task-space-page .task-technical-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

    .task-space-page .task-technical-grid > div {
        background: var(--nx-control-bg);
        border: 1px solid var(--nx-divider);
        border-radius: 8px;
        display: grid;
        gap: 4px;
        min-width: 0;
        padding: 9px 10px;
    }

    .task-space-page .task-technical-grid span {
        color: var(--nx-text-secondary);
        font-size: .67rem;
        font-weight: 650;
    }

    .task-space-page .task-technical-grid code {
        color: var(--nx-text-primary);
        font-size: .68rem;
        overflow-wrap: anywhere;
        white-space: normal;
    }

@media (max-width: 1100px) {
    .task-space-page .task-technical-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Nexus Release UI Foundation
   U2A.2 - Signed-contract automation boundary
   ========================================================= */

.task-space-page .task-signing-automation {
    background: var(--nx-panel-bg-subtle);
    border: 1px solid var(--nx-divider);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 13px 14px;
}

    .task-space-page .task-signing-automation > strong {
        color: var(--nx-text-primary);
        font-size: .82rem;
    }

    .task-space-page .task-signing-automation p {
        color: var(--nx-text-secondary);
        font-size: .75rem;
        line-height: 1.5;
        margin: 0;
    }

.task-space-page .task-signing-no-action {
    color: var(--nx-text-primary);
    font-size: .72rem;
    font-weight: 750;
}

/* =========================================================
   Nexus Release UI Foundation
   U2B - Production Task Stage Navigation
   ========================================================= */

.task-space-stage-navigation {
    grid-column: 1 / -1;
    align-items: center;
    background: var(--nx-panel-bg);
    border: 1px solid var(--nx-divider);
    border-radius: 10px;
    box-shadow: var(--nx-panel-shadow);
    display: grid;
    gap: 6px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    min-width: 0;
    padding: 5px;
}

.task-space-stage-viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

    .task-space-stage-viewport::-webkit-scrollbar {
        display: none;
    }

.task-space-stage-navigation
.task-space-top-tabs {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    gap: 6px;
    margin: 0;
    min-width: max-content;
    overflow: visible;
    padding: 0;
    width: max-content;
}

.task-space-stage-control {
    align-items: center;
    background: var(--nx-control-bg);
    border: 1px solid var(--nx-control-border);
    border-radius: 8px;
    color: var(--nx-text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
    width: 32px;
}

    .task-space-stage-control span {
        font-size: 1.25rem;
        line-height: 1;
        transform: translateY(-1px);
    }

    .task-space-stage-control:hover {
        background: var(--nx-hover-bg);
        border-color: var(--nx-selected-border);
        color: var(--nx-primary);
    }

    .task-space-stage-control:active {
        transform: scale(.96);
    }

    .task-space-stage-control:focus-visible {
        border-color: var(--nx-selected-border);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
        outline: none;
    }

@media (max-width: 720px) {
    .task-space-stage-navigation {
        gap: 4px;
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        padding: 4px;
    }

    .task-space-stage-control {
        height: 30px;
        width: 30px;
    }
}

/* =========================================================
   Nexus Release UI Foundation
   U2C - Execution Context Scroll + Persistent Action Dock
   ========================================================= */

.task-space-page
.task-focus-panel:has(.task-execution-shell) {
    overflow: hidden;
}

.task-space-page .task-execution-shell {
    display: grid;
    gap: 10px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.task-space-page .task-execution-header {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.task-space-page .task-execution-scroll-region {
    display: grid;
    gap: 10px;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: var(--nx-control-border) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

    .task-space-page
    .task-execution-scroll-region::-webkit-scrollbar {
        width: 7px;
    }

    .task-space-page
    .task-execution-scroll-region::-webkit-scrollbar-track {
        background: transparent;
    }

    .task-space-page
    .task-execution-scroll-region::-webkit-scrollbar-thumb {
        background: var(--nx-control-border);
        border-radius: 999px;
    }

        .task-space-page
        .task-execution-scroll-region::-webkit-scrollbar-thumb:hover {
            background: var(--nx-text-secondary);
        }

.task-space-page .task-execution-action-dock {
    background: var(--nx-panel-bg);
    border-top: 1px solid var(--nx-divider);
    min-width: 0;
    padding-top: 10px;
}

    .task-space-page
    .task-execution-action-dock
    .task-focus-section {
        margin: 0;
    }

@media (max-width: 1200px) {
    .task-space-page .task-execution-shell {
        min-height: 520px;
    }
}

/* CONTACT_LEAD outcome menu */
.task-space-page .sales-contact-outcome-menu {
    background: #0f172a;
    border: 1px solid #273449;
    border-radius: 10px;
    overflow: hidden;
}

.task-space-page .sales-contact-outcome-toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 52px;
    padding: 12px 14px;
    user-select: none;
}

    .task-space-page .sales-contact-outcome-toggle:hover {
        background: #111827;
    }

    .task-space-page .sales-contact-outcome-toggle > span:first-child {
        display: grid;
        gap: 2px;
    }

    .task-space-page .sales-contact-outcome-toggle strong {
        color: #f8fafc;
        font-size: .86rem;
        font-weight: 650;
    }

    .task-space-page .sales-contact-outcome-toggle small {
        color: #94a3b8;
        font-size: .72rem;
    }

.task-space-page .sales-contact-outcome-chevron {
    color: #94a3b8;
    font-size: .9rem;
    transition: transform .16s ease;
}

.task-space-page
.sales-contact-outcome-menu[open]
.sales-contact-outcome-chevron {
    transform: rotate(180deg);
}

.task-space-page .sales-contact-outcome-groups {
    border-top: 1px solid #273449;
    display: grid;
    gap: 14px;
    padding: 12px;
}

.task-space-page .sales-contact-outcome-group {
    display: grid;
    gap: 6px;
}

.task-space-page .sales-contact-outcome-group-heading {
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 0 4px;
    text-transform: uppercase;
}

.task-space-page .sales-contact-outcome-options {
    display: grid;
    gap: 5px;
}

.task-space-page .sales-contact-outcome-option {
    background: #111827;
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 44px;
    overflow: hidden;
}

    .task-space-page .sales-contact-outcome-option:hover {
        border-color: #334155;
    }

    .task-space-page .sales-contact-outcome-option.selected-action {
        background: #172036;
        border-color: #4f46e5;
    }

.task-space-page .sales-contact-outcome-row-action,
.task-space-page .sales-contact-outcome-row-static {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 44px;
    padding: 9px 11px;
    text-align: left;
    width: 100%;
}

.task-space-page .sales-contact-outcome-row-action {
    cursor: pointer;
}

    .task-space-page .sales-contact-outcome-row-action:hover {
        background: #172036;
    }

    .task-space-page .sales-contact-outcome-row-action:disabled {
        cursor: default;
        opacity: .55;
    }

    .task-space-page .sales-contact-outcome-row-action:focus-visible {
        outline: 2px solid #6366f1;
        outline-offset: -2px;
    }

.task-space-page .sales-contact-outcome-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

    .task-space-page .sales-contact-outcome-copy strong {
        color: #f8fafc;
        font-size: .78rem;
        font-weight: 600;
    }

    .task-space-page .sales-contact-outcome-copy small {
        color: #94a3b8;
        font-size: .68rem;
    }

.task-space-page .sales-contact-outcome-row-chevron {
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 600;
    transition: color .15s ease, transform .15s ease;
}

.task-space-page
.sales-contact-outcome-row-action:hover
.sales-contact-outcome-row-chevron {
    color: #c7d2fe;
    transform: translateX(2px);
}

@media (max-width: 760px) {
    .task-space-page .sales-contact-outcome-row-action,
    .task-space-page .sales-contact-outcome-row-static {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* Sales Task Space - typed action modal */

.task-action-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(2px);
}

.task-action-modal {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

    .task-action-modal > .task-focus-section {
        margin: 0;
        width: 100%;
        border: 0;
        border-radius: inherit;
    }

@media (max-width: 640px) {
    .task-action-modal-backdrop {
        padding: 12px;
        place-items: stretch;
    }

    .task-action-modal {
        width: 100%;
        max-height: calc(100vh - 24px);
        margin: auto 0;
    }
}

/* Commercial offer wide editor modal */

.commercial-offer-compact-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.commercial-offer-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 18, 0.88);
    backdrop-filter: blur(6px);
}

.commercial-offer-editor-modal {
    width: min(1180px, calc(100vw - 48px));
    height: min(880px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: #0d1424;
    color: var(--bs-body-color);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.60), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.commercial-offer-editor-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: #111a2c;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.commercial-offer-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 22px;
    background: #0d1424;
}

@media (max-width: 720px) {
    .commercial-offer-editor-backdrop {
        padding: 12px;
    }

    .commercial-offer-editor-modal {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
    }

    .commercial-offer-editor-header {
        padding: 14px 16px;
    }

    .commercial-offer-editor-body {
        padding: 16px;
    }

    .commercial-offer-compact-summary {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Nexus visual identity */
img.nexus-brand-mark,
img.nx-auth-brand-mark {
    background: transparent;
    border: 0;
    box-shadow: none;
    object-fit: contain;
    padding: 0;
}
