/* Shared trader portal — fixed sidebar + fixed top bar, scrollable page content only */

body.portal-app {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body.portal-app > .flex.flex-1,
body.portal-app > div.flex.flex-1 {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

body.portal-app .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 120;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0;
}

body.portal-app .portal-content-area {
    margin-left: 260px;
    width: calc(100% - 260px);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-content-area {
    flex-grow: 1;
    background: #f8fafc;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.portal-scroll-main,
body.portal-app .portal-content-area > main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.portal-floating-header {
    flex-shrink: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.75rem 1rem 0;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 12px 28px -8px rgba(79, 70, 229, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.portal-floating-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    transition: opacity 0.2s ease;
}

.portal-floating-logo:hover {
    opacity: 0.88;
}

.portal-floating-logo img {
    height: 2.25rem;
    width: auto;
    max-width: min(280px, 42vw);
    object-fit: contain;
    object-position: left center;
}

@media (min-width: 768px) {
    .portal-floating-logo img {
        height: 2.75rem;
        max-width: 320px;
    }
}

.portal-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
    .portal-header-title {
        font-size: 1.125rem;
    }
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.portal-header-actions .user-greeting {
    color: #64748b;
    font-size: 0.875rem;
}

.portal-logout-btn {
    background: #dc2626;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.portal-logout-btn:hover {
    background: #b91c1c;
}

/* Footer sits outside scroll on portal pages — hide to keep fixed chrome */
body.portal-app > footer,
body.portal-app #shared-footer-container {
    display: none;
}

@media (max-width: 767px) {
    body.portal-app .portal-content-area {
        margin-left: 0;
        width: 100%;
    }

    body.portal-app .sidebar {
        z-index: 130;
    }

    body.portal-app .sidebar.hidden {
        transform: translateX(-100%);
    }

    .portal-floating-header {
        margin: 0.5rem 0.5rem 0;
        padding: 0.625rem 0.875rem;
    }

    .portal-floating-logo img {
        height: 1.75rem;
        max-width: 160px;
    }

    .portal-header-title {
        display: none;
    }

    .portal-header-actions .user-greeting {
        display: none;
    }
}

/* Standout daily EOD sync notice — dashboard + chart pages */
.eod-sync-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    border: 2px solid #f59e0b;
    border-left-width: 5px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

.eod-sync-notice i {
    color: #d97706;
    font-size: 1.125rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.eod-sync-notice strong {
    color: #78350f;
    font-weight: 700;
}
