/* 
 * NEXUS PRIME DASHBOARD ECOSYSTEM STYLESHEET
 * v1.0.0 - Centralized Dashboard Styling
 */

:root {
    --dashboard-accent: var(--accent-gold);
    --dashboard-bg-card: hsla(230, 40%, 4%, 0.45);
    /* Profondo e Sobrio (Dark) */
    --dashboard-border: hsla(var(--h-accent), 90%, 60%, 0.15);
}

[data-theme="light"] {
    --dashboard-accent: hsl(38, 85%, 45%);
    /* Oro più saturo per visibilità su bianco */
    --dashboard-bg-card: hsla(0, 0%, 100%, 0.65);
    /* Cristallino traslucido (Light) */
    --dashboard-border: hsla(38, 80%, 50%, 0.2);
}

/* Tab Management */
.dash-tab-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.dash-tab-section.is-active,
.nx-tab-content.is-active {
    display: block;
}

.nx-role-selector {
    width: 100%;
}

/* Identity Verification Badges */
.nx-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nx-badge-error {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.border-error {
    border-color: #ef4444 !important;
}

@keyframes nx-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.animate-pulse {
    animation: nx-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Dashboard Profile Upload */
.profile-avatar-upload {
    display: flex;
    border: 2px dashed var(--glass-border);
    padding: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
}

.profile-avatar-upload:hover {
    border-color: var(--accent-gold);
    background: var(--bg-accent);
}

.profile-avatar-upload i {
    font-size: 24px;
    color: var(--text-light);
    display: block;
    margin-bottom: 5px;
}

#avatar-filename {
    font-size: 12px;
    color: var(--text-light);
}

.hidden-file-input {
    display: none;
}

/* Admin Dashboard Notifications */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    justify-content: flex-start;
}

.notification-item {
    background: var(--bg-card);
    border: 1px solid var(--border-vibrant);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 20px;
    position: relative;
    transition: all 0.3s ease;
    align-items: flex-start;
}

.notification-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.notification-item.is-unread {
    border-left: 4px solid var(--accent-primary);
}

.notification-item.is-read {
    opacity: 0.6;
}

.notification-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.notification-content {
    flex: 1;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    margin-right: 2rem;
    border-bottom: 1px dashed var(--accent-emerald);
    border-right: 1px dashed var(--accent-emerald);
    padding-right: 9px;
    border-bottom-right-radius: 10px;
}

.notification-title {
    margin: 0;
    font-size: 1rem;
}

.notification-message {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mark-read-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

.mark-read-btn:hover {
    background: var(--accent-success);
    color: white;
}

/* Admin Invitations */
.invite-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    max-width: 600px;
}

.ref-badge {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 800;
    font-size: 1.2rem;
    margin: 20px 0;
    border-radius: var(--radius-md);
}

.copy-link-container {
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
}

/* --- HEALING HUB SEMANTICS --- */
.nx-protocol-healing {
    background: var(--dashboard-bg-card);
    border: 1px dashed var(--dashboard-border);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    margin-bottom: var(--gap-md);
    position: relative;
    overflow: hidden;
}

.nx-protocol-healing-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-lg);
}

.nx-protocol-healing-info {
    flex: 1;
}

.nx-protocol-healing-title {
    color: var(--accent-gold);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.nx-protocol-healing-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.nx-protocol-healing-action {
    padding: 12px 24px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    white-space: nowrap;
}

.nx-flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-compact {
    padding: 10px !important;
    font-size: 0.8rem !important;
}

.admin-table-thumb {
    width: 60px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.empty-state-icon {
    font-size: 3rem;
}

.btn-compact {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

.text-truncate-sm {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invite-icon {
    font-size: 2.5rem;
}

.dashboard-hero-icon {
    font-size: 3rem;
    color: var(--text-muted);
}

/* --- EXECUTIVE HEADER BAR REFINEMENT (Sober Platinum) --- */
.nx-app-header-bar {
    background: var(--bg-glass-heavy) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 28px 28px !important;
    min-height: 75px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.nx-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nx-header-left .title-header {
    font-size: 1.25rem !important;
    font-weight: 850 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
}

.nx-header-left .small-label {
    font-size: 0.65rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: var(--text-dim) !important;
    opacity: 0.8;
}

.nx-header-left .small-label span {
    color: var(--accent-gold) !important;
    margin-left: 8px !important;
}

.nx-user-executive-panel {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.nx-app-indicator a {
    line-height: 0;
}

.nx-app-indicator {
    position: relative;
    background: var(--bg-surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    justify-content: center;
    align-items: center;
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
}

.nx-app-indicator:hover {
    background: var(--bg-surface-glass-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.nx-app-indicator i,
.nx-app-indicator svg {
    width: 20px !important;
    height: 20px !important;
    color: var(--text-primary) !important;
    stroke-width: 2px !important;
}

/* Specific for Profile with Name */
.nx-profile-indicator {
    width: auto !important;
    padding: 1px 11px 1px 12px;
    gap: 9px;
}

.nx-avatar-wrapper {
    display: flex;
    width: 20px;
    border-radius: 50%;
}

.nx-avatar-xs {
    width: -webkit-fill-available;
    height: -webkit-fill-available;
    border-radius: 50%;
}

/* --- UI TEMPLATE HIDING (NPSP Stealth Protocol) --- */
.nx-hidden-template {
    display: none !important;
}

/* --- TABS NAV STEALTH SCROLL --- */
.dash-tabs {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.dash-tabs::-webkit-scrollbar {
    display: none !important;
}

.nx-indicator-label {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: var(--text-primary) !important;
}

.nx-indicator-badge {
    position: absolute;
    top: -20px;
    right: -10px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 900;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

/* --- NEXUS PREMIUM TOOLTIP (Sober Notification Style) --- */
.tippy-box[data-theme~='nexus-premium-tooltip'] {
    background: var(--bg-surface-glass-heavy);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 999999 !important;
}

.tippy-box[data-theme~='nexus-premium-tooltip'] .tippy-content {
    padding: 6px 12px;
}

.nx-indicator-badge.is-gold {
    background: linear-gradient(135deg, hsl(198.67deg 54.14% 40.08%), #03A9F4);
    color: var(--text-light);
}

.nx-indicator-badge.is-accent {
    background: var(--accent-secondary);
    color: #fff;
}

.tippy-box[data-theme~='nexus-popover'] {
    background: var(--bg-glass-heavy) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid var(--glass-border-vibrant) !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(246, 177, 34, 0.15) !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
}

.tippy-box[data-theme~='nexus-popover'] .tippy-content {
    padding: 0 !important;
    overflow: hidden !important;
}

.tippy-box[data-theme~='nexus-popover'] .tippy-arrow {
    color: var(--bg-glass-heavy) !important;
}

/* POPOVER STYLES (Elite Reprise) */
.nx-exec-popover {
    padding: 0;
    min-width: 280px;
}

.nx-popover-header {
    margin-bottom: 0;
    border-bottom: 1px solid var(--glass-border);
    padding: 24px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
}

.nx-popover-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.nx-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
    gap: 20px;
    padding: 1px 0;
    border-bottom: 1px dashed var(--accent-gold);
}

.nx-stat-row span:last-child {
    font-weight: 800;
    color: var(--accent-gold);
}

.nx-popover-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    border-radius: 0 0 15px 15px;
}

.nx-btn-action {
    background: var(--bg-glass-hover);
    border: 1px solid var(--glass-border);
    color: var(--accent-gold);
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nx-btn-action:hover {
    background: var(--accent-gold);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(246, 177, 34, 0.3);
}

.nx-fuel-gauge {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0;
}

.nx-fuel-level {
    height: 100%;
    background: linear-gradient(90deg, var(--token-accent), var(--accent-primary));
    box-shadow: 0 0 10px var(--token-accent);
}

.nx-btn-profile i {
    width: 16px !important;
    height: 16px !important;
}

.nx-btn-profile:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* --- SOBER TABLE SYSTEM (NPSP v9.5) --- */
.sober-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.sober-table thead th {
    background: transparent !important;
    border: none !important;
    font-size: 0.65rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: var(--text-dim) !important;
    padding: 0 18px !important;
    font-weight: 800 !important;
}

.sober-table tbody tr {
    background: var(--dashboard-bg-card) !important;
    transition: all 0.3s ease;
}

.sober-table tbody tr:hover {
    background: var(--bg-surface-glass-hover, rgba(255, 255, 255, 0.05)) !important;
    transform: translateX(4px);
}

.sober-table td {
    padding: 18px !important;
    border-top: 1px solid var(--dashboard-border) !important;
    border-bottom: 1px solid var(--dashboard-border) !important;
}

.sober-table td:first-child {
    border-left: 1px solid var(--dashboard-border) !important;
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.sober-table td:last-child {
    border-right: 1px solid var(--dashboard-border) !important;
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.nx-status-pill {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: inline-block;
}

.nx-status-pill.is-success {
    background: var(--bg-success, rgba(16, 185, 129, 0.1));
    color: var(--text-success, #10b981);
    border: 1px solid var(--border-success, rgba(16, 185, 129, 0.2));
}

.nx-status-pill.is-warning {
    background: var(--bg-warning, rgba(245, 158, 11, 0.1));
    color: var(--text-warning, #f59e0b);
    border: 1px solid var(--border-warning, rgba(245, 158, 11, 0.2));
}

.nx-status-pill.is-gold {
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.1), rgba(255, 128, 0, 0.1));
    color: #ffbf00;
    border: 1px solid rgba(255, 191, 0, 0.3);
}

.nx-status-pill.is-dim {
    background: var(--bg-tertiary);
    color: var(--text-dim);
    border: 1px solid var(--dashboard-border);
}

.nx-btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-surface-glass);
    border: 1px solid var(--dashboard-border);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.nx-btn-icon:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

/* --- ELITE MODAL PROTOCOL --- */
.nx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background: var(--modal-bg-glass, rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.nx-modal-container {
    background: var(--bg-secondary);
    background-image: radial-gradient(circle at top right, var(--bg-surface-glass), transparent);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.nx-modal-container.nx-modal-large {
    max-width: 800px;
}

.nx-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(5px);
    border-radius: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nx-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nx-modal-close {
    background: var(--bg-primary);
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.nx-modal-close:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    transform: rotate(90deg);
}

.nx-modal-body {
    padding: 0;
    /* Let inner containers handle padding for better layout */
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.btn-royal {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--area-impact-border);
    background: var(--bg-hover);
}

.btn-royal:hover {
    border: 1px solid var(--area-impact-border);
    background: var(--node-bg);
}

.nx-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* --- CONTRACT VIEWER --- */
.nx-contract-viewer {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 40px 60px;
    min-height: 100%;
}

.nx-contract-content {
    max-width: 700px;
    margin: 0 auto;
}

.nx-contract-content h2 {
    margin-bottom: 12px;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}

.nx-contract-content h4 {
    margin-top: 2px;
    margin-bottom: 12px;
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 0.95rem;
    letter-spacing: 0.1px;
}

.nx-contract-content p {
    line-height: 1.8;
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 0.95rem;
}

.nx-contract-content hr {
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--glass-border);
}

/* --- SIGNATURE BOX --- */
.nx-signature-box {
    margin: 20px 0;
    background: var(--bg-tertiary);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.nx-avatar-sm {
    width: 48px;
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

#signature-canvas {
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =============================================
 * CONTRACT CARD COMPONENT (nx-contract-card)
 * Scoped to the Elite Electronic Contract area.
 * NPSP: No shared utility classes allowed here.
 * =============================================*/

.nx-app-card-body {
    display: flex;
    gap: 15px;
    margin-top: 16px;
    height: -webkit-fill-available;
    flex-direction: column;
}

.nx-contract-card__desc {
    color: inherit;
    margin-bottom: 1rem;
    font-size: 13px;
    line-height: 20px;
}

.nx-contract-card__compliance {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nx-contract-card__actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 11px;
    align-items: center;
}

/* Contract card action buttons — scoped, no shared utility classes */
.nx-contract-card__btn-view,
.nx-contract-card__btn-sign {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.nx-contract-card__btn-view {
    background: var(--bg-accent);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.nx-contract-card__btn-view:hover {
    background: var(--accent-gold);
    color: var(--bg-base);
}

.nx-contract-card__btn-sign {
    background: var(--accent-gold);
    color: var(--text-light);
}

.nx-contract-card__btn-sign:hover {
    background: var(--accent-gold-dark, hsl(38, 80%, 42%));
    transform: translateY(-1px);
}

/* =============================================
 * COMPLIANCE MATRIX COMPONENT
 * Scoped to the Compliance Matrix card.
 * NPSP: No shared utility classes allowed here.
 * =============================================*/

.nx-compliance-matrix__features {
    flex: 1;
    list-style: none;
    padding: 2px 15px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nx-compliance-matrix__features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.nx-compliance-matrix__cta {
    flex: 1;
    margin-top: 11px;
}

.nx-compliance-matrix__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    /* inherits visual style from nx-btn-sober token pattern */
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nx-compliance-matrix__link:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: var(--bg-accent);
}

/* --- IDENTITY & SOCIAL SEMANTIC HUB (NPSP v9.8) --- */
.identity-social-hub {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.identity-social-hub.is-active {
    display: flex !important;
}

.identity-grid-layout {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
}

@media (max-width: 991px) {
    .identity-grid-layout {
        grid-template-columns: 1fr !important;
    }
}

.identity-card,
.social-card,
.identity-document-vault {
    background: var(--dashboard-bg-card) !important;
    border: 1px solid var(--dashboard-border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 24px !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.identity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.identity-card-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
}

.identity-card-title svg {
    color: var(--accent-gold) !important;
    width: 20px !important;
    height: 20px !important;
}

/* Semantic Component Sovereignty (NPSP v9.8) */
.identity-form-unit {
    margin-bottom: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.identity-input,
.identity-select-container .nx-elite-select,
.identity-select-container .nx-elite-input {
    background: var(--bg-input) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 10px 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
    font-family: inherit;
    transition: var(--transition-base);
    height: 42px !important;
    width: 100% !important;
    outline: none;
}

.identity-input:focus,
.identity-select-container .nx-elite-input:focus {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.identity-select-container {
    width: 100% !important;
    position: relative;
}

.identity-select-container .nx-elite-select-container {
    min-width: 0 !important;
    width: 100% !important;
}

.identity-select-container.is-compact {
    width: 150px !important;
}

.identity-label-sovereign {
    display: flex;
    align-items: center !important;
    gap: 6px;
    margin-bottom: 6px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    letter-spacing: 1px !important;
    color: var(--accent-info);
    text-transform: uppercase !important;
    margin-left: 4px;
    padding: 1px 0;
    cursor: help !important;
    width: fit-content;
    max-width: 180px;
}

.identity-label-sovereign span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-label-sovereign svg {
    flex-shrink: 0 !important;
    color: var(--accent-gold) !important;
    width: 14px !important;
    height: 14px !important;
    opacity: 0.8 !important;
}

.animation-fade-in {
    animation: nxFadeIn 0.6s ease-out forwards;
}

.animation-fade-in-delayed {
    animation: nxFadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

@keyframes nxFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- NX APP UI SYSTEM (NPSP v14.2) --- */
.nx-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.nx-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nx-form-field label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.nx-app-input {
    background: var(--bg-surface-glass, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid var(--dashboard-border, rgba(212, 175, 55, 0.2)) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: -webkit-fill-available;
    /* padding: 1px 20px !important; */
}

.nx-app-select {
    background: var(--bg-surface-glass, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid var(--dashboard-border, rgba(212, 175, 55, 0.2)) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: -webkit-fill-available;
    padding: 1px 20px !important;
    min-height: 43px;
}

.nx-app-input:focus,
.nx-app-select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15) !important;
    background: rgba(var(--h-accent-rgb, 212, 175, 55), 0.05) !important;
    outline: none !important;
}

.color-pick {
    grid-column: span 2;
    display: flex;
    gap: 20px;
}

.color-pick .nx-form-field {
    flex: 1;
}

.nx-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.nx-mt-xs {
    margin-top: 4px;
}

.nx-mt-md {
    margin-top: 24px;
}

.nx-mb-md {
    margin-bottom: 24px;
}

/* Desktop optimization */
@media (min-width: 1024px) {
    .nx-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .color-pick {
        grid-column: span 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* --- NEXUS VITALIS SEMANTIC COMPONENT SYSTEM (NPSP v17.1) --- */
.vitalis-tab-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    animation: nxFadeIn 0.5s ease-out forwards;
}

.vitalis-header-group {
    border-bottom: 1px solid var(--dashboard-border);
    padding-bottom: 16px;
    margin-bottom: 8px;
}

.vitalis-metrics-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 21px;
}

.vitalis-areas-wrap {
    margin-top: 32px;
}

.vitalis-score-card {
    background: var(--dashboard-bg-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 12px;
    padding: 14px 14px 0px 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.vitalis-score-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    background: var(--bg-surface-glass-hover);
}

.vitalis-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.vitalis-main-metric {
    font-size: 20px;
    font-weight: 900;
    margin: 0;
    padding-left: 7px;
    padding-bottom: unset;
    letter-spacing: 0px;
    color: var(--text-primary);
}

.vitalis-progress-rail {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin: 12px 0;
    overflow: hidden;
}

.vitalis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-secondary));
    border-radius: 3px;
    transition: width 1s ease-out;
}

.vitalis-history-wrap {
    margin-top: 32px;
    background: var(--dashboard-bg-card);
    border: 1px solid var(--dashboard-border);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.nx-stats-grid {
    margin-top: 16px;
    padding: 16px 24px;
}

.nx-area-stat-item {
    margin-bottom: 24px;
}

.nx-area-stat-item:last-child {
    margin-bottom: 0;
}

.nx-pill-new {
    background: linear-gradient(135deg, #ffbf00, #ff8c00);
    color: #000;
    font-size: 0.6rem;
    font-weight: 1000;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(255, 191, 0, 0.3);
    text-transform: uppercase;
}

.vitalis-table-elite {
    width: 100%;
    border-collapse: collapse;
}

.vitalis-table-elite th {
    text-align: left;
    padding: 16px 24px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--dashboard-border);
    background: rgba(255, 255, 255, 0.02);
}

.vitalis-table-elite td {
    padding: 18px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--dashboard-border);
    color: var(--text-secondary);
}

.vitalis-table-elite tr:last-child td {
    border-bottom: none;
}

.vitalis-insight-panel {
    background: var(--area-product-bg);
    border-left: 4px solid var(--accent-gold);
    padding: 24px;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.vitalis-insight-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-gold);
    flex-shrink: 0;
}

.vitalis-insight-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

@media (max-width: 992px) {
    .vitalis-metrics-layout {
        grid-template-columns: 1fr;
    }
}

/* --- SPA TAB VISIBILITY PROTOCOL --- */
.nexus-tab-content {
    display: none;
    margin-top: 30px;
    animation: fadeIn 0.4s ease-out;
}

.nexus-tab-content.is-active {
    display: block !important;
}

.nexus-tab-btn {
    position: relative;
    transition: all 0.3s ease;
}

.nexus-tab-btn.is-active {
    color: var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
}

.dash-nav-item.is-active {
    background: var(--bg-hover);
}

/* --- TACTICAL TABLE ENHANCEMENT --- */
.tactical-table-row td {
    padding: 20px 15px !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--dashboard-border);
}

.tactical-cell-price {
    font-family: 'Outfit', sans-serif;
    font-weight: 850;
    color: var(--accent-gold);
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.tactical-cell-identity {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tactical-cell-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    display: block;
}

.tactical-cell-actions {
    text-align: right;
}

/* --- STATS PREMIUM GRID --- */
.dash-management .stat-card {
    display: flex;
    flex-direction: column;
    margin: unset;
}

.dash-management .stat-card-header {
    margin: unset;
    padding: unset;
}

.stats-premium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.portal-stats-grid {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px 20px 19px 21px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.chart-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.stat-card-header i {
    font-size: 1.2rem;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.chart-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.asset-bar-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.asset-label {
    width: 80px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bar-bg {
    flex: 1;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 5px;
}

.asset-count {
    width: 30px;
    text-align: right;
    font-weight: bold;
    font-size: 0.9rem;
}



.nx-journal-timeline {
    position: relative;
    padding-left: 20px;
}

.timeline-entry {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
}

.timeline-marker {
    flex-shrink: 0;
    width: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-dot {
    width: 12px;
    height: 12px;
    background: var(--text-dim);
    border-radius: 50%;
    z-index: 2;
    border: 2px solid var(--bg-surface);
    transition: all 0.3s ease;
}

.timeline-entry.latest .marker-dot {
    background: var(--accent-gold);
    box-shadow: 0 0 15px var(--accent-gold);
    transform: scale(1.2);
}

.marker-line {
    width: 2px;
    flex-grow: 1;
    background: var(--glass-border);
    margin: 5px 0;
}

.timeline-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: var(--radius-lg);
    flex-grow: 1;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.timeline-card:hover {
    transform: translateX(10px);
    border-color: var(--accent-gold);
}

.timeline-header {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.timeline-list {
    padding-left: 20px;
    list-style: none;
}

.timeline-list li {
    position: relative;
    margin-bottom: 8px;
    line-height: 1.5;
}

.timeline-list li::before {
    content: "▹";
    position: absolute;
    left: -20px;
    color: var(--accent-gold);
}

/* Portfolio Node States */
.portfolio-item.is-draft-node {
    opacity: 0.85;
    background: var(--bg-hover) !important;
    border-style: dashed !important;
    transition: var(--transition-base);
}

.portfolio-item.is-draft-node .nx-list-thumb img {
    filter: grayscale(0.6) sepia(0.2);
    opacity: 0.7;
}

.portfolio-item.is-draft-node .nx-list-title {
    color: var(--text-dim);
}

/* Admin Marketplace Table States (NPSP v6.2) */
.tactical-table-row.is-row-draft {
    opacity: 0.8;
    background: var(--area-warning-bg) !important;
}

.tactical-table-row.is-row-draft .admin-table-thumb {
    filter: grayscale(0.7) opacity(0.6);
}

/* Supplemental Badges & States */
.nx-app-badge--danger {
    background: var(--area-danger-bg);
    color: var(--accent-error);
    border: 1px solid var(--area-danger-border);
}

.nx-app-badge--amber {
    background: var(--area-warning-bg);
    color: var(--accent-gold);
    border: 1px solid var(--area-warning-border);
}

.is-status-draft {
    border: 1px dashed var(--area-warning-border);
}

.tactical-cell-instruments {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* Nexus Dropdown Protocol (NPSP v6.2 Semantic) */
.nx-dropdown {
    position: relative;
    display: inline-block;
}

.nx-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    min-width: 160px;
    background: var(--dropdown-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--dropdown-border);
    border-radius: var(--dropdown-border-radius);
    box-shadow: var(--dropdown-shadow);
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
    transform-origin: top right;
}

/* Interaction Protocol: Toggle & State Management */
.nx-dropdown.is-open .nx-dropdown-content,
.nx-dropdown:hover .nx-dropdown-content {
    display: block;
    animation: nxFadeScale 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nx-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-base);
    width: 100%;
    border-bottom: 1px solid var(--dropdown-divider);
}

.nx-dropdown-content a:last-child {
    border-bottom: none;
}

.nx-dropdown-content a:hover {
    background: var(--dropdown-item-hover);
    color: var(--accent-primary);
}

.nx-dropdown-content a svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

@keyframes nxFadeScale {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}