/* ========================================
 * Shared Trader Portal Stylesheet
 * Sidebar, mobile header, account switcher, unread badges & strength meter
 * ======================================== */

.text-green { color: var(--color-primary, #10b981); }
.text-warning { color: #f59e0b; }
.text-red { color: var(--color-danger, #ef4444); }

.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-sidebar, #0f141e);
    border-bottom: 1px solid var(--border-color, #2a3441);
    position: sticky;
    top: 0;
    z-index: 30;
}
.mobile-header .logo {
    font-size: 20px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}
.menu-toggle {
    background: transparent;
    border: 1px solid var(--border-color, #2a3441);
    border-radius: 8px;
    color: var(--text-main, #f3f4f6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.dashboard-sidebar {
    width: 280px;
    background: var(--bg-sidebar, #0f141e);
    border-right: 1px solid var(--border-color, #2a3441);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.dashboard-sidebar .sidebar-header {
    padding: 0 24px 20px;
    border-bottom: 1px solid var(--border-color, #2a3441);
}
.dashboard-sidebar .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary, #10b981);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-sidebar .user-info { margin-top: 14px; }
.dashboard-sidebar .user-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}
.dashboard-sidebar .user-email {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
    word-break: break-all;
}
.dashboard-sidebar .account-selector {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #2a3441);
}
.dashboard-sidebar .account-label {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.dashboard-sidebar .account-dropdown { position: relative; margin-top: 6px; }
.dashboard-sidebar .account-trigger {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, #2a3441);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.dashboard-sidebar .account-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary, #10b981);
}
.dashboard-sidebar .account-trigger .acc-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}
.dashboard-sidebar .account-trigger .acc-id {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.4px;
}
.dashboard-sidebar .account-trigger .acc-plan {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    font-weight: 500;
    text-transform: uppercase;
}
.dashboard-sidebar .account-trigger .acc-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
}
.dashboard-sidebar .account-trigger .acc-chevron {
    color: var(--text-muted, #9ca3af);
    transition: transform 0.25s ease;
}
.dashboard-sidebar .account-dropdown.open .acc-chevron { transform: rotate(180deg); }
.dashboard-sidebar .account-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #111827;
    border: 1px solid var(--border-color, #2a3441);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    padding: 8px;
}
.dashboard-sidebar .account-dropdown.open .account-menu {
    display: block;
    animation: efSlideDown 0.18s ease-out;
}
@keyframes efSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.dashboard-sidebar .account-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.dashboard-sidebar .account-item:last-child { margin-bottom: 0; }
.dashboard-sidebar .account-item:hover { background: rgba(16, 185, 129, 0.08); }
.dashboard-sidebar .account-item.active {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.dashboard-sidebar .account-item .acc-id { font-size: 13px; font-weight: 700; color: #fff; }
.dashboard-sidebar .account-item .acc-plan { font-size: 11px; color: var(--text-muted, #9ca3af); text-transform: uppercase; }
.dashboard-sidebar .account-item .acc-status { font-size: 10px; font-weight: 700; text-transform: uppercase; }

.dashboard-sidebar .sidebar-nav {
    padding: 14px 0;
    flex: 1;
}
.dashboard-sidebar .nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--text-muted, #9ca3af);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    border-radius: 0;
    margin-bottom: 2px;
}
.dashboard-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main, #f3f4f6);
}
.dashboard-sidebar .nav-item.active {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--color-primary, #10b981);
    color: var(--color-primary, #10b981);
    box-shadow: none;
}
.dashboard-sidebar .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0;
}
.dashboard-sidebar .nav-label {
    font-size: 14.5px;
    font-weight: 500;
    flex: 1;
}
.nav-kyc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}
.nav-kyc-dot.unverified {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}
.nav-unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
}
.dashboard-sidebar .logout-btn {
    margin: 12px 24px 0;
    padding: 12px;
    width: calc(100% - 48px);
    background: transparent;
    border: 1px solid var(--border-color, #2a3441);
    border-radius: 8px;
    color: var(--text-muted, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
}
.dashboard-sidebar .logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger, #ef4444);
    color: var(--color-danger, #ef4444);
}

/* Shared Password Strength Meter */
.pw-strength-meter {
    margin-top: 8px;
}
.pw-strength-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.pw-strength-label {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-top: 5px;
    display: block;
}

@media (max-width: 1024px) {
    .mobile-header { display: flex; }
    .dashboard-sidebar { transform: translateX(-100%); }
    .dashboard-sidebar.open { transform: translateX(0); }
}
