    :root {
        --portal-nav-h: 60px; /* fixed navbar height; layout-full.html keeps it equal to the real one */
    }

    /* Body & Background */
    body {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        min-height: 100vh;
        min-height: 100dvh;
        padding-bottom: 70px; /* Space for mobile bottom nav */
        overflow: hidden; /* Prevent body scroll */
    }

    @media (min-width: 768px) {
        body {
            padding-bottom: 0;
        }
    }

    /* Navbar Styles - Fixed at Top */
    .navbar {
        background: var(--brand-gradient);
        box-shadow: 0 2px 20px rgba(101, 37, 131, 0.3);
        animation: slideDown 0.5s ease-out;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1030;
    }

    .portal-nav-user {
        min-width: 0;
    }

    .portal-nav-user .navbar-nav > .nav-item {
        flex: none;
    }

    .portal-nav-user .navbar-nav > .portal-nav-name {
        flex: 0 1 auto;
        min-width: 0;
    }

    .portal-nav-name .nav-link {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    @media (max-width: 991.98px) {
        .portal-nav-name {
            max-width: 24rem;
        }
    }

    .navbar-brand:hover {
        transform: translateX(5px);
    }

    /* Logo Styling - Convert to white/monochrome for dark navbar */
    .navbar-brand img {
        filter: brightness(0) invert(1); /* Pure white logo */
        transition: filter 0.3s ease;
    }

    .navbar-brand:hover img {
        filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255,255,255,0.5)); /* Glow effect on hover */
    }

    .navbar-brand i {
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }

    @keyframes slideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Sidebar Styles - Fixed on Desktop */
    .sidebar {
        background: white;
        box-shadow: 2px 0 20px rgba(0,0,0,0.08);
        padding: 20px 0;
        animation: slideRight 0.6s ease-out;
    }

    @media (min-width: 768px) {
        .sidebar {
            position: fixed;
            top: var(--portal-nav-h); /* Below navbar */
            left: 0;
            height: calc(100vh - var(--portal-nav-h));
            height: calc(100dvh - var(--portal-nav-h));
            overflow: hidden; /* Non-scrollable as requested */
            width: 16.666667%; /* col-md-2 width */
            z-index: 1020;
        }
    }

    @keyframes slideRight {
        from {
            transform: translateX(-100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .sidebar .nav-link {
        color: #333;
        padding: 10px 20px;
        margin: 2px 0;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        position: relative;
        overflow: hidden;
    }

    .sidebar .nav-link:before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 0;
        background: linear-gradient(90deg, rgba(101, 37, 131, 0.1) 0%, rgba(163, 115, 188, 0.1) 100%);
        transition: width 0.4s ease;
    }

    .sidebar .nav-link:hover {
        background: #f8f9fa;
        color: var(--bs-primary);
        border-left: 3px solid var(--bs-primary);
        padding-left: 25px;
    }

    .sidebar .nav-link:hover:before {
        width: 100%;
    }

    .sidebar .nav-link:hover i {
        animation: iconBounce 0.4s;
    }

    @keyframes iconBounce {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(3px); }
    }

    .sidebar .nav-link.active {
        background: linear-gradient(90deg, rgba(101, 37, 131, 0.1) 0%, rgba(163, 115, 188, 0.05) 100%);
        color: var(--bs-primary);
        border-left: 3px solid var(--bs-primary);
        font-weight: 500;
    }

    .sidebar .nav-link i {
        transition: transform 0.3s ease;
        display: inline-block;
        width: 20px;
        text-align: center;
        margin-right: 8px;
    }

    /* Dropdown Menu Styles */
    .dropdown-menu {
        animation: fadeIn 0.3s ease;
        border: none;
        box-shadow: 0 5px 25px rgba(0,0,0,0.15);
        z-index: 1040 !important; /* Above navbar (1030) */
    }

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

    /* UCN Dropdown Styling */
    .ucn-dropdown {
        min-width: 320px;
    }

    .ucn-dropdown .dropdown-header {
        font-weight: 600;
        color: var(--bs-primary);
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9ecef;
    }

    .ucn-dropdown .ucn-item {
        padding: 0.75rem 1rem;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
        color: #333;
    }

    .ucn-dropdown .ucn-item:hover {
        background: linear-gradient(90deg, rgba(102,126,234,0.15) 0%, transparent 100%);
        border-left-color: #667eea;
        color: #333;
    }

    .ucn-dropdown .ucn-item.active {
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-left-color: #667eea;
        color: white !important;
    }

    .ucn-dropdown .ucn-item.active .text-muted {
        color: rgba(255, 255, 255, 0.85) !important;
    }

    .ucn-dropdown .ucn-item.active .text-primary,
    .ucn-dropdown .ucn-item.active .text-info {
        color: white !important;
    }

    .ucn-dropdown .ucn-icon i {
        font-size: 1.8rem;
    }

    .ucn-dropdown .ucn-item-name {
        max-width: 200px;
    }

    .ucn-dropdown .ucn-item-details {
        font-size: 0.75rem;
    }

    /* UCN Chevron Icon */
    .ucn-chevron {
        font-size: 0.75em;
    }

    /* UCN Dropdown Nav Item - Keep elements on same line */
    .nav-item.dropdown {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        margin-right: 15px;
    }

    /* UCN Copy Icon Styling */
    .ucn-copy-icon {
        cursor: pointer;
        color: rgba(255, 255, 255, 0.8);
        margin-left: 4px;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
    }

    .ucn-copy-icon:hover {
        color: rgba(255, 255, 255, 1);
        transform: scale(1.1);
    }

    .ucn-copy-icon-inner {
        font-size: 0.9em;
    }

    /* UCN Select Dropdown Styling */
    .mobile-ucn-select,
    .ucn-select-link {
        background-color: rgba(255, 255, 255, 0.95) !important;
        color: #333 !important;
        border: 1px solid rgba(0, 0, 0, 0.15) !important;
        border-radius: 6px !important;
        padding: 0.5rem 0.85rem !important;
        font-size: 0.875rem;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Hide Bootstrap's default dropdown caret/triangle - we use our own chevron */
    .ucn-select-link.dropdown-toggle::after {
        display: none !important;
    }

    .mobile-ucn-select:hover,
    .mobile-ucn-select:focus,
    .ucn-select-link:hover,
    .ucn-select-link:focus {
        background-color: white !important;
        border-color: #667eea !important;
        box-shadow: 0 3px 8px rgba(102, 126, 234, 0.25) !important;
        transform: translateY(-1px);
        color: #333 !important;
    }

    .mobile-ucn-select .ucn-label,
    .ucn-select-link .ucn-label {
        color: #666;
        font-size: 0.8rem;
        font-weight: 500;
    }

    .mobile-ucn-select .ucn-value,
    .ucn-select-link .ucn-value {
        color: var(--bs-primary);
        font-weight: 700;
        font-size: 0.9rem;
    }

    .mobile-ucn-select .fa-chevron-down,
    .ucn-select-link .fa-chevron-down {
        color: #999;
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }

    .mobile-ucn-select:hover .fa-chevron-down,
    .ucn-select-link:hover .fa-chevron-down {
        transform: translateY(2px);
    }

    .mobile-ucn-select[aria-expanded="true"] .fa-chevron-down,
    .ucn-select-link[aria-expanded="true"] .fa-chevron-down {
        transform: rotate(180deg);
    }

    /* Mobile Account Dropdown */
    .mobile-account-dropdown {
        min-width: 280px;
        max-width: 90vw;
        margin-top: 0.5rem !important;
    }

    .mobile-account-dropdown .dropdown-header {
        font-weight: 600;
        color: var(--bs-primary);
        padding: 0.75rem 1rem;
        background: #f8f9fa;
    }

    .mobile-account-dropdown .dropdown-item {
        padding: 0.75rem 1rem;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }

    .mobile-account-dropdown .dropdown-item:hover {
        background: linear-gradient(90deg, rgba(102,126,234,0.1) 0%, transparent 100%);
        border-left-color: #667eea;
    }

    .mobile-account-dropdown .dropdown-item.active {
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-left-color: #667eea;
        color: white !important;
    }

    .mobile-account-dropdown .dropdown-item.active .text-muted {
        color: rgba(255, 255, 255, 0.85) !important;
    }

    .mobile-account-dropdown .dropdown-item.active .text-primary,
    .mobile-account-dropdown .dropdown-item.active .text-info {
        color: white !important;
    }

    /* UCN Copy Interaction Styling */
    .ucn-copy-link {
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .ucn-copy-link:hover {
        background-color: rgba(255, 255, 255, 0.15) !important;
        border-radius: 4px;
    }

    .ucn-copy-link i.fa-copy {
        transition: transform 0.2s ease;
        font-size: 0.85em;
    }

    .ucn-copy-link:hover i.fa-copy {
        transform: scale(1.1);
    }

    .ucn-copyable {
        display: inline-block;
        padding: 2px 6px;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

    .ucn-copyable:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .ucn-copyable i.fa-copy {
        transition: transform 0.2s ease;
    }

    .ucn-copyable:hover i.fa-copy {
        transform: scale(1.15);
    }

    .ucn-copyable:active {
        transform: scale(0.95);
    }

    /* Alert Animations */
    .alert {
        animation: slideInAlert 0.5s ease-out;
    }

    @keyframes slideInAlert {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    /* Main Content Area - Scrollable */
    @media (min-width: 768px) {
        .container-fluid.p-0 {
            padding-top: var(--portal-nav-h) !important; /* Start below navbar */
        }

        .col-md-10 {
            margin-left: 16.666667%; /* Width of col-md-2 sidebar */
            width: 83.333333%; /* Remaining width */
            max-width: 83.333333%;
            flex: 0 0 83.333333%;
        }

        #main-content {
            height: calc(100vh - var(--portal-nav-h)); /* Full viewport height minus navbar */
            height: calc(100dvh - var(--portal-nav-h));
            overflow-y: auto; /* Enable vertical scrolling */
            overflow-x: hidden;
            padding: 1.5rem !important; /* Compact padding */
        }
    }

    /* Content area animation */
    .col-md-10 > .p-4 {
        animation: fadeInUp 0.7s ease-out;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Hover effects for nav items */
    .nav-item .nav-link {
        transition: all 0.3s ease;
        position: relative;
    }

    .nav-item .nav-link:after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: white;
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-item .nav-link:hover:after {
        width: 80%;
    }

    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
        z-index: 1030;
        padding: 6px 4px 10px 4px; /* Extra bottom padding for phones with home indicator */
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); /* iOS safe area support */
    }

    @media (max-width: 767px) {
        .mobile-bottom-nav {
            display: flex;
            justify-content: space-around;
            align-items: center;
        }
    }

    .mobile-bottom-nav .nav-item {
        flex: 1;
        text-align: center;
    }

    .mobile-bottom-nav .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #666;
        padding: 8px 4px;
        text-decoration: none;
        font-size: 0.75rem;
        transition: all 0.2s ease;
        min-height: 52px; /* Ensure touch target meets 44px+ minimum */
        min-width: 52px;
        border-radius: 8px;
    }

    .mobile-bottom-nav .nav-link i {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .mobile-bottom-nav .nav-link:active {
        background: rgba(102,126,234,0.15);
        transform: scale(0.95);
    }

    .mobile-bottom-nav .nav-link.active {
        color: var(--bs-primary);
        background: linear-gradient(180deg, rgba(102,126,234,0.1) 0%, transparent 100%);
        border-top: 3px solid #667eea;
        font-weight: 600;
    }

    .mobile-bottom-nav .nav-link:hover {
        color: var(--bs-primary);
        transform: translateY(-2px);
    }

    /* Hamburger Menu Button */
    .hamburger-btn {
        display: none;
        background: transparent;
        border: none;
        color: white;
        font-size: 1.5rem;
        padding: 0.25rem 0.5rem;
    }

    @media (max-width: 767px) {
        .hamburger-btn {
            display: block;
        }
    }

    /* Mobile Sidebar Offcanvas */
    @media (max-width: 767px) {
        .sidebar {
            min-height: auto;
            position: static; /* Reset fixed positioning on mobile */
            width: 100%;
            height: auto;
        }
    }

    /* Desktop Sidebar */
    @media (min-width: 768px) {
        .offcanvas-md {
            --bs-offcanvas-width: auto !important;
            position: static !important;
            transform: none !important;
            visibility: visible !important;
            background-color: transparent !important;
            border: none !important;
        }
        .offcanvas-md .offcanvas-header,
        .offcanvas-md .offcanvas-backdrop {
            display: none !important;
        }
    }

    /* Mobile Content Spacing */
    @media (max-width: 767px) {
        /* Push entire content area below fixed navbar */
        .col-md-10 {
            margin-top: var(--portal-nav-h) !important; /* Height of fixed navbar */
        }

        .container-fluid > .row {
            margin-top: 0;
        }

        #main-content {
            padding: 0.5rem 2px 5rem 2px !important; /* Minimal 2px horizontal padding for edge-to-edge content */
            height: calc(100vh - var(--portal-nav-h) - 80px); /* Viewport minus navbar and taller bottom nav */
            height: calc(100dvh - var(--portal-nav-h) - 80px);
            overflow-y: auto;
            overflow-x: hidden;
        }

        #mainbar-loader {
            margin-top: 0 !important; /* Remove extra margin, rely on parent padding */
        }

        .dashboard-content {
            padding: 0 !important;
            margin-top: 0 !important; /* Remove extra margin */
        }

        .page-title {
            font-size: 1.5rem !important;
            margin-top: 0 !important;
            margin-bottom: 0.25rem !important;
        }

        /* Only reduce spacing on the first page title wrapper to minimize top gap */
        .col-12 > .mb-4:first-of-type {
            margin-bottom: 0.5rem !important; /* Reduce from 1.5rem to 0.5rem */
        }

        /* Keep normal spacing for cards and content elements */
        .card {
            margin-bottom: 1rem !important; /* Normal spacing between cards */
        }
    }

    /* Mobile UCN Modal Styles */
    .ucn-modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .ucn-modal-user-icon {
        font-size: 2rem;
    }

    .ucn-modal-details {
        font-size: 0.85rem;
    }

    /* Fixed Notification Container */
    .portal-notifications-container {
        position: fixed;
        top: 70px;
        right: 20px;
        z-index: 9999;
        max-width: 400px;
        width: calc(100% - 40px);
        pointer-events: none;
    }

    .portal-notification {
        background: white;
        border-radius: 8px;
        padding: 15px 20px;
        margin-bottom: 10px;
        box-shadow: 0 6px 30px rgba(0,0,0,0.25);
        display: flex;
        align-items: flex-start;
        gap: 12px;
        opacity: 0;
        transform: translateX(100%);
        transition: all 0.3s ease;
        pointer-events: auto;
        border-left: 4px solid;
    }

    .portal-notification.show {
        opacity: 1;
        transform: translateX(0);
    }

    .portal-notification.hiding {
        opacity: 0;
        transform: translateX(100%);
    }

    .portal-notification.alert-success {
        border-left-color: #28a745;
        background: linear-gradient(to right, rgba(40, 167, 69, 0.5), #ffffff);
    }

    .portal-notification.alert-danger {
        border-left-color: #dc3545;
        background: linear-gradient(to right, rgba(220, 53, 69, 0.5), #ffffff);
    }

    .portal-notification.alert-warning {
        border-left-color: #ffc107;
        background: linear-gradient(to right, rgba(255, 193, 7, 0.5), #ffffff);
    }

    .portal-notification.alert-info {
        border-left-color: #17a2b8;
        background: linear-gradient(to right, rgba(23, 162, 184, 0.5), #ffffff);
    }

    .portal-notification-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .portal-notification.alert-success .portal-notification-icon {
        color: #28a745;
    }

    .portal-notification.alert-danger .portal-notification-icon {
        color: #dc3545;
    }

    .portal-notification.alert-warning .portal-notification-icon {
        color: #ffc107;
    }

    .portal-notification.alert-info .portal-notification-icon {
        color: #17a2b8;
    }

    .portal-notification-content {
        flex: 1;
    }

    .portal-notification-close {
        cursor: pointer;
        color: #999;
        font-size: 1.2rem;
        padding: 0 5px;
        flex-shrink: 0;
        transition: color 0.2s ease;
    }

    .portal-notification-close:hover {
        color: #333;
    }

    @media (max-width: 767px) {
        .portal-notifications-container {
            top: 60px;
            right: 10px;
            left: 10px;
            max-width: none;
            width: auto;
        }
    }

    /* Loading Overlay */
    #portal-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    #portal-loading-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .loading-spinner-container {
        text-align: center;
        background: white;
        padding: 2rem 3rem;
        border-radius: 10px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        animation: scaleIn 0.3s ease-out;
    }

    @keyframes scaleIn {
        from {
            transform: scale(0.8);
            opacity: 0;
        }
        to {
            transform: scale(1);
            opacity: 1;
        }
    }

    .loading-text {
        color: var(--bs-primary);
        font-weight: 500;
        font-size: 1.1rem;
    }

