/* Monitoring Page Styles */

:root {
    --gold: #FBBF24;
    --gold-dark: #D97706;
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #FFFFFF;
    --text-secondary: #8b949e;
    --positive: #22c55e;
    --negative: #ef4444;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    line-height: 1.4;
}

.main-header,
.main-header * {
    line-height: 1;
}

/* Tooltip Icon Styles */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: help;
    position: relative;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    color: var(--gold);
    background: rgba(251, 191, 36, 0.2);
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #2a2a2a;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 8px;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2a2a2a;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Header Updates */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 100;
    cursor: pointer;
}

.logo-wordmark {
    display: inline-block;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 700;
}

.chat-toggle-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.forum-nav-link {
    text-decoration: none;
}

.header-auth-link {
    text-decoration: none;
    white-space: nowrap;
}

.chat-toggle-btn:hover {
    color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
}

.chat-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.chat-badge {
    background: var(--gold);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    display: none;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    margin-left: 0;
    margin-right: 0;
}

.lang-text {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-left: 0 !important;
}

.lang-text:hover,
.lang-text.active {
    color: var(--gold);
}

.divider {
    color: #4b5563;
}

/* User Profile Widget (Unified) */
.user-profile-widget {
    position: relative;
    margin-left: 0;
    z-index: 1001;
}

@media (max-width: 900px) {
    .user-profile-widget {
        margin-left: 0;
    }
}

/* Avatar Button */
.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.profile-avatar svg {
    width: 24px;
    height: 24px;
    color: #1a1a1a;
}

.profile-fallback-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    user-select: none;
}

/* Dropdown */
.profile-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    text-transform: uppercase;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logout-text-btn {
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.logout-text-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Mobile User Avatar Dropdown */
.user-avatar-mobile {
    position: relative;
}

.avatar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    overflow: hidden;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-circle svg {
    width: 20px;
    height: 20px;
}

.avatar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-width: 180px;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.avatar-dropdown.show {
    display: block;
}

.dropdown-user-info {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.dropdown-logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Tabs Updates */
.detail-header {
    margin-top: 10px;
    padding-top: 0;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.account-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tabs-label {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-right: 5px;
}

.account-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.account-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.account-tab .tab-number {
    /* Account number text */
}

.account-tab .tab-eye {
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.account-tab .tab-eye:hover {
    opacity: 1;
}

.account-tab .tab-eye svg {
    width: 12px;
    height: 12px;
}

.account-tab:hover {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
    color: var(--gold);
}

/* Followed account tab - blue border */
.account-tab.followed {
    border-color: #38bdf8;
}

.account-tab.followed:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.account-tab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

/* Active followed tab - keep gold background but add blue shadow */
.account-tab.active.followed {
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.add-tab-circle {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.add-tab-circle:hover {
    background: rgba(251, 191, 36, 0.1);
}

/* Stats Colors Updates */
.stat-value.gold {
    color: var(--gold);
}

.mini-value.gold {
    color: var(--gold);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

/* Chart Title */
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Summary Box */
.summary-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.report-btn {
    margin-top: 20px;
    border-radius: 8px;
    font-weight: 700;
}

/* Header Alignment Fixes */
.main-header .container {
    width: calc(100% - 40px);
    max-width: 1100px;
    margin: 0 auto;
    justify-content: flex-start !important;
    gap: 14px;
}

@media (max-width: 900px) {
    .main-header .container {
        position: relative;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        justify-content: initial !important;
        gap: 8px !important;
    }
}

.logo {
    margin-right: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.main-nav > * {
    margin-left: 0 !important;
}

.auth-container-new {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* ========== Auth / Welcome Screen Redesign ========== */
/* Main Layout Container */
.monitoring-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 168px 20px 40px 20px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start !important;
    /* Top align enforced */
    box-sizing: border-box;
    transition: padding-top 0.3s ease;
}

/* Detail View via JS toggle */
/* Detail View via JS toggle */
.monitoring-section.mode-auth {
    justify-content: center !important;
    align-items: center !important;
    margin-top: 0;
    min-height: 100vh;
    padding: 60px 20px 40px !important;
    box-sizing: border-box;
}

/* Detail View via JS toggle */
.monitoring-section.mode-detail {
    padding-top: 84px !important;
}

/* Cleanup old :has override */
@media (min-width: 901px) {
    .monitoring-section:has(.detail-container[style*="block"]) {
        padding-top: 84px !important;
        justify-content: flex-start !important;
    }

    .monitoring-section:has(.accounts-container[style*="block"]) {
        padding-top: 64px !important;
    }
}

@media (max-width: 900px) {

    .monitoring-section,
    .monitoring-section.mode-detail,
    .monitoring-section.mode-auth {
        padding-top: 8px !important;
        /* Verified fix: override specificity of .mode-desktop rule */
        /* Verified fix: override specificity of .mode-desktop rule */
        justify-content: flex-start;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
        width: 100vw;
        /* Ensure matches viewport */
        box-sizing: border-box;
    }

    .monitoring-section.mode-detail {
        padding: 8px 6px 24px !important;
        align-items: stretch !important;
    }

    .monitoring-section.mode-auth {
        margin-top: 0;
        padding-bottom: 12px !important;
        align-items: center !important;
    }

    .lang-switcher {
        display: flex !important;
        margin: 0 !important;
        flex: 0 0 auto;
        position: relative;
        z-index: 3;
        justify-self: end;
    }

    .lang-switcher-mobile {
        display: none !important;
        margin: 0 !important;
    }

    .main-nav {
        display: inline-flex !important;
        position: relative;
        flex: 0 1 auto;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin: 0;
        max-width: none;
        min-width: 0;
        width: 100%;
        z-index: 2;
        overflow: hidden;
    }

    .user-profile-widget {
        position: relative;
        margin: 0;
        z-index: 3;
        justify-self: center;
    }

    .profile-dropdown {
        top: calc(100% + 10px);
        right: auto;
        left: 50%;
        transform: translate(-50%, -10px);
        transform-origin: top center;
    }

    .profile-dropdown.show {
        transform: translate(-50%, 0);
    }

    .logo {
        margin-right: 0;
        flex: 0 0 auto;
    }

    .chat-toggle-btn {
        padding: 6px 6px;
        gap: 4px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .header-api-key-chip {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        padding: 8px 10px !important;
        gap: 5px !important;
        border-radius: 12px !important;
        white-space: nowrap;
        min-height: 34px;
    }

    .header-api-key-label {
        display: inline !important;
        font-size: 10px !important;
        line-height: 1.1;
    }

    .header-api-key-value {
        font-size: 11px !important;
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.1;
    }

    .header-api-key-icon svg {
        width: 14px;
        height: 14px;
    }

    .accounts-container,
    .accounts-grid {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .auth-container-new {
        margin-top: 0;
    }

    .hamburger-menu {
        justify-self: end;
    }
}

@media (max-width: 480px) {
    .main-header .container {
        gap: 6px !important;
    }

    .logo {
        gap: 6px;
        font-size: 1rem;
        letter-spacing: 0;
    }

    .logo-wordmark {
        display: none;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.72rem;
    }

    .main-nav {
        gap: 4px;
        width: 100%;
    }

    .chat-toggle-btn {
        padding: 6px 4px;
        gap: 4px;
        font-size: 13px;
        line-height: 1;
    }

    .chat-toggle-btn svg {
        width: 18px;
        height: 18px;
    }

    .header-api-key-chip {
        padding: 7px 10px !important;
        gap: 5px !important;
        min-height: 32px;
    }

    .header-api-key-label {
        display: inline !important;
        font-size: 10px !important;
        line-height: 1.1;
    }

    .header-api-key-value {
        font-size: 10px !important;
        max-width: 60px;
        line-height: 1.1;
    }

    .profile-avatar {
        width: 34px;
        height: 34px;
    }

    .profile-avatar svg {
        width: 18px;
        height: 18px;
    }

    .profile-fallback-letter {
        font-size: 15px;
    }

    .lang-switcher {
        gap: 4px;
        margin-right: 0 !important;
    }

    .lang-text,
    .divider {
        font-size: 0.82rem;
    }
}

.auth-wrapper-redesign {
    display: flex;
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    min-height: 600px;
}

/* Left Side: Visuals */
.auth-visual-side {
    flex: 0.9;
    background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.08), transparent 70%);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.visual-header h1 {
    font-family: 'Times New Roman', serif;
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 15px;
    color: white;
}

.visual-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 400px;
    /* Increased from 300px */
    line-height: 1.5;
}

/* Lift phone to center/top */
.visual-phone {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center in the available space */
    flex-grow: 1;
    /* Take remaining height */
    margin-top: 20px;
    /* Space from header */
    margin-bottom: 0;
}

.visual-phone img {
    width: 100%;
    max-width: 320px;
    transform: rotate(-5deg);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
    transition: transform 0.5s ease;
}

.auth-wrapper-redesign:hover .visual-phone img {
    transform: rotate(0deg) scale(1.05);
    /* Slight zoom instead of lift */
}

/* Right Side: Content */
.auth-content-side {
    flex: 1.1;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 35px;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.step-box {
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
}

.step-box h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 8px;
}

.step-box p,
.setup-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.setup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.setup-list li {
    margin-bottom: 5px;
    position: relative;
}

.text-warning {
    color: #ffcc00;
    /* Warning yellow */
}

.login-area {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-top: 10px;
}

.login-explanation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.login-explanation strong {
    color: white;
}

.telegram-login-wrapper-center {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

/* Fix button width */
.downloads-area.single-btn {
    display: block;
    /* Take full width */
    width: 100%;
}

.dl-btn.primary {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 100%;
    /* Force full width */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    justify-content: center;
    font-size: 1rem;
    /* Restore size if needed */
    padding: 16px;
    /* Meatier button */
}

.dl-btn.primary:hover {
    background: var(--gold);
    color: #000;
}

.dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 991px) {
    .auth-wrapper-redesign {
        flex-direction: column;
    }

    .auth-visual-side {
        padding: 40px 30px 40px;
        /* Adjusted padding */
        align-items: center;
        text-align: center;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Hiding phone on mobile as requested */
    .visual-phone {
        display: none !important;
    }

    .auth-content-side {
        padding: 40px 30px;
    }
}


.telegram-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0088cc, #0099dd);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #0099dd, #00aaee);
    transform: translateY(-2px);
}

.telegram-btn svg {
    width: 24px;
    height: 24px;
}

.telegram-btn.secondary {
    background: transparent;
    border: 1px solid #0088cc;
    padding: 12px 20px;
    font-size: 0.95rem;
    box-shadow: none;
}


/* Auth states */
.auth-loading,
.auth-waiting,
.auth-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-error {
    color: var(--negative);
}

.retry-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: rgba(251, 191, 36, 0.1);
}

/* ========== Accounts List Screen ========== */
.accounts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 0;
    /* Fix overlap with header line */
}

/* Page Header */
.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-family: 'Times New Roman', serif;
    /* Classy serif look */
    font-weight: 400;
    font-size: 2.5rem;
    color: var(--text-primary);
}

/* Year selector options */
.year-selector option {
    background-color: #1F2937;
    /* Dark background matches card */
    color: var(--text-primary);
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    /* Wider for landscape layout */
    gap: 30px;
    /* increased gap */
    margin-bottom: 40px;
}

.market-sessions-strip {
    margin-bottom: 26px;
    padding: 0 0 4px;
}

.market-sessions-strip__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.market-sessions-strip__headline {
    min-width: 0;
}

.market-sessions-strip__title {
    color: #fbbf24;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.market-sessions-strip__summary {
    margin-top: 8px;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
}

.market-sessions-strip__meta {
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.market-sessions-strip__next {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.9rem;
    line-height: 1.35;
    text-align: right;
}

.market-sessions-strip__timezone {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.market-sessions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.market-session-pill {
    min-height: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.market-session-pill.is-open {
    border-color: rgba(52, 211, 153, 0.42);
    background: transparent;
}

.market-session-pill__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.market-session-pill__name {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
}

.market-session-pill__state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
}

.market-session-pill__state::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.36);
}

.market-session-pill.is-open .market-session-pill__state {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.market-session-pill.is-open .market-session-pill__state::before {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.market-session-pill__hours {
    color: #fbbf24;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.market-session-pill__countdown {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    line-height: 1.4;
}

@media (max-width: 1120px) {
    .market-sessions-strip__header {
        flex-direction: column;
    }

    .market-sessions-strip__meta {
        min-width: 0;
        align-items: flex-start;
    }

    .market-sessions-strip__next,
    .market-sessions-strip__timezone {
        text-align: left;
    }

    .market-sessions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .market-sessions-strip {
        margin-bottom: 22px;
    }

    .market-sessions-strip__summary {
        font-size: 0.98rem;
    }

    .market-sessions-grid {
        grid-template-columns: 1fr;
    }

    .market-session-pill {
        min-height: 0;
    }
}

.account-card {
    background: #0a0a0a;
    /* Darker black */
    border: 1px solid #222;
    /* Subtle border */
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    /* Rectangular aspect ratio */
    position: relative;
    /* For absolute positioned action buttons */
}

/* Action Buttons - Vertical Right Stack */
.account-actions-row {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(-2px);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.account-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.account-card.is-dragging {
    opacity: 1;
    transform: rotate(1.2deg) scale(1.01);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.drag-proxy {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 5000;
    pointer-events: none;
    will-change: transform;
    transition: none !important;
}

.account-card.drop-ready {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45), 0 12px 28px rgba(52, 211, 153, 0.12);
}

/* Followed accounts (not owned) */
.account-card.followed {
    border-color: #38bdf8;
    border-width: 2px;
}

.account-card.followed:hover {
    border-color: #38bdf8;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

.group-card {
    border: 1px solid rgba(251, 191, 36, 0.45);
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.08), transparent 48%),
        linear-gradient(160deg, rgba(17, 24, 39, 0.96), rgba(10, 10, 10, 0.98));
}

.group-card:hover {
    border-color: rgba(251, 191, 36, 0.75);
    box-shadow: 0 12px 34px rgba(251, 191, 36, 0.08);
}

.group-category-badge {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.group-category-badge::before {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
}

.group-count-badge {
    margin-left: auto;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
}

.group-card-body {
    margin-top: 8px;
}

.group-card-title {
    font-size: 1.45rem;
    line-height: 1.22;
    font-weight: 800;
    color: #fff7db;
    margin-bottom: 16px;
}

.group-card-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-preview-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-preview-pill--muted {
    color: rgba(255, 255, 255, 0.7);
}

.group-member-card {
    min-height: 200px;
    padding-right: 72px;
}

.group-member-card .account-card-header {
    padding-right: 8px;
}

.followed-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.account-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.header-spacer {
    flex-grow: 1;
}

.account-icon {
    width: 40px;
    height: 40px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.account-number-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-number-wrapper:hover {
    background: rgba(251, 191, 36, 0.25);
}

.account-number-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
}

.account-number-wrapper.has-marquee {
    max-width: 220px;
}

.fx-marquee {
    display: block;
    overflow: hidden;
}

.fx-marquee__inner {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: fx-marquee var(--fx-marquee-duration, 12s) linear infinite;
    will-change: transform;
}

@keyframes fx-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-marquee__inner {
        animation: none;
        padding-left: 0;
    }
}

@media (max-width: 900px) {
    .account-number-wrapper.has-marquee {
        max-width: 170px;
    }
}

.account-number-eye {
    display: flex;
    align-items: center;
    opacity: 0.7;
}

.account-number-eye:hover {
    opacity: 1;
}

.account-number-eye svg {
    width: 12px;
    height: 12px;
}

/* Status badge with colored dot */
.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.online {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.status-badge.online::before {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.status-badge.offline {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.status-badge.offline::before {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.status-badge.market-closed {
    color: #eab308;
    background: rgba(234, 179, 8, 0.1);
}

.status-badge.market-closed::before {
    background: #eab308;
    box-shadow: 0 0 6px #eab308;
}

.delete-account-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
    /* Ensure it doesn't shrink */
    flex-shrink: 0;
}

.delete-account-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    opacity: 1;
}

/* Share button same style as delete */
.share-account-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.share-account-btn:hover {
    color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
    opacity: 1;
}

.account-equity {
    font-size: 1.9rem;
    font-weight: 400;
    /* Thinner font like screenshot */
    margin-bottom: 6px;
    line-height: 1.08;
    color: white;
    font-family: 'Manrope', sans-serif;
    /* Keep Manrope for numbers */
}

.account-equity-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.2;
    margin-bottom: 18px;
}

.account-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two columns like screenshot */
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 20px;
}

.account-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
    min-height: 1.8em;
}

.account-stat-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.account-stat-value.positive {
    color: var(--positive);
}

.account-stat-value.negative {
    color: var(--negative);
}

/* Add account card */
.add-account-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 24px;
    border: 1px dashed var(--gold);
    /* Gold dashed border like screenshot */
    border-radius: 12px;
    color: var(--gold);
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 200px;
    background: rgba(251, 191, 36, 0.02);
    /* Very subtle fill */
    opacity: 0.7;
    cursor: pointer;
}

.add-account-card:hover {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    opacity: 1;
}

.group-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(12px);
}

.group-modal.is-visible {
    display: flex;
}

.group-modal__dialog {
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(10, 10, 10, 0.98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.group-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.group-modal__label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.9);
    margin-bottom: 6px;
}

.group-modal__title {
    font-size: clamp(1.4rem, 2vw, 2rem);
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
}

.group-modal__meta {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.group-modal__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.group-modal__btn,
.group-modal__close {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.group-modal__btn:hover,
.group-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.group-modal__btn--danger {
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.group-modal__btn--danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.group-modal__close {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.6rem;
    line-height: 1;
}

.group-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.add-icon {
    font-size: 2.5rem;
    font-weight: 300;
}

/* ========== Account Detail Screen ========== */
.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 18px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

/* Header border */
.main-header {
    border-bottom: 1px solid var(--border-color);
    padding: 9px 0 !important;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    /* Center horizontally */
    text-align: center;
    /* Center text */
    min-height: 120px;
}

.stat-card:hover {
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.positive {
    color: var(--positive);
}

.stat-value.negative {
    color: var(--negative);
}

/* Detail layout */
.detail-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

/* Assign grid areas */
.chart-card {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    /* Ensure good height for full-width chart */
}

/* Summary removed - no longer needed */

/* Responsive: stack everything on mobile */
@media (max-width: 991px) {
    .detail-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "summary"
            "chart"
            "monthly";
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
}

/* Period summary table */
.period-table-wrap {
    overflow-x: auto;
}

.period-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 6px;
}

.period-table th,
.period-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    white-space: nowrap;
}

.period-table th {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.period-table .period-label {
    text-align: left;
    color: #c9d1d9;
    font-weight: 600;
}

.period-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.period-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.period-table .positive {
    color: var(--positive);
}

.period-table .negative {
    color: var(--negative);
}

.period-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
}

/* Deals & Assets cards */
.assets-card, .deals-card {
    overflow-x: auto;
}
.assets-card .period-table th,
.deals-card .period-table th {
    white-space: nowrap;
}
.btn-small {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.btn-small:hover {
    background: var(--gold-dark);
}
.asset-row:hover {
    background: rgba(251, 191, 36, 0.08);
}
.asset-row {
    transition: opacity 0.2s;
}
.assets-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--gold) !important;
    box-shadow: 0 -1px 0 0 var(--gold);
}
.deals-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 0 4px;
}
.deals-page-info {
    color: #aaa;
    font-size: 13px;
    min-width: 120px;
    text-align: center;
}
.btn-small:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.card:hover {
    border-color: rgba(251, 191, 36, 0.2);
}

.card-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.3px;
}

/* Chart */
.chart-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-canvas-wrapper {
    flex: 1;
    height: 100%;
    min-height: 500px;
    position: relative;
    width: 100%;
    margin-top: 10px;
}

/* Bottom stats */
.bottom-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.mini-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Center flex items */
    min-height: 120px;
}

.mini-stat:hover {
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mini-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.mini-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.mini-value.positive {
    color: var(--positive);
}

/* Summary card */
.summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value.positive {
    color: var(--positive);
}

.summary-value.negative {
    color: var(--negative);
}

.report-btn {
    width: 100%;
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.report-btn:hover {
    background: var(--gold-dark);
}

/* Year selector */
.year-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.year-selector:hover {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
}

.year-selector:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Monthly grid */
.monthly-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.monthly-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.monthly-cell:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(251, 191, 36, 0.2);
    transform: translateY(-2px);
}

.monthly-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.monthly-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.monthly-value.positive {
    color: var(--positive);
}

.monthly-value.negative {
    color: var(--negative);
}

/* API Key card */
.api-key-card {
    margin-top: 30px;
}

.api-key-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.api-key-value {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--gold);
    word-break: break-all;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.copy-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

.copy-btn.copied {
    border-color: var(--positive);
    color: var(--positive);
}

.api-key-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Loader */
.loader {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.no-data {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .detail-container {
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 900px) {
    .detail-container {
        width: 100%;
        max-width: none;
        align-self: stretch;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .detail-layout {
        gap: 15px;
    }

    .detail-header {
        margin-top: 0 !important;
        /* Remove gap on mobile */
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 10px;
        padding-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    /* =========================================
       ACCOUNT TABS (Verified Desktop + Mobile) 
       ========================================= */

    /* DESKTOP DEFAULT (Grid/List View) */
    .tabs-carousel-layout {
        display: flex;
        flex-wrap: wrap;
        /* Standard wrapping list */
        align-items: center;
        width: 100%;
        gap: 10px;
        position: relative;
    }

    .tabs-label {
        width: 100%;
        margin-bottom: 8px;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    /* Hide Arrows on Desktop */
    .tab-nav-arrow {
        display: none !important;
    }

    .tabs-scroll-container {
        display: flex;
        flex-wrap: wrap;
        /* Allow wrapping on desktop */
        gap: 10px;
        width: 100%;
        padding: 0;
        align-items: center;
    }

    .tabs-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .account-tab {
        flex: 0 0 auto;
        /* Natural width */
        white-space: nowrap;
        justify-content: center;
        align-items: center;
        display: flex;
        gap: 8px;
        margin: 0;

        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        border-radius: 50px;
        /* Standard pill */
        padding: 10px 20px;
        height: auto;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s;
    }

    .account-tab:hover {
        border-color: var(--gold);
        background: rgba(251, 191, 36, 0.05);
    }

    .account-tab.active {
        border-color: var(--gold);
        background: rgba(251, 191, 36, 0.1);
        color: var(--gold);
    }

    .account-tab .tab-number {
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .add-tab-circle {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        border: 1px dashed var(--border-color);
        border-radius: 50%;
        color: var(--text-secondary);
        transition: all 0.2s;
        text-decoration: none;
    }

    .add-tab-circle:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: rgba(251, 191, 36, 0.1);
    }

    /* =========================================
       MOBILE OVERRIDES (Carousel Mode)
       ========================================= */
    @media (max-width: 900px) {
        .tabs-carousel-layout {
            display: grid;
            grid-template-columns: 46px 1fr 46px;
            /* Explicit arrow space */
            grid-template-areas:
                "label label label"
                "left cont right";
            align-items: center;
            width: 100%;
            gap: 0;
            margin-bottom: 5px;
        }

        .tabs-label {
            grid-area: label;
            padding-left: 5px;
        }

        /* Show Arrows on Mobile */
        .tab-nav-arrow {
            display: flex !important;
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--gold);
            border-radius: 50%;
            width: 36px;
            height: 36px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 5;
            margin: auto;
        }

        .tabs-carousel-layout .tab-nav-arrow:nth-of-type(1) {
            grid-area: left;
        }

        .tabs-carousel-layout .tab-nav-arrow:nth-last-of-type(1) {
            grid-area: right;
        }

        .tabs-scroll-container {
            grid-area: cont;
            display: flex;
            flex-wrap: nowrap;
            /* Force single row */
            overflow-x: auto;
            scroll-behavior: smooth;
            min-width: 0;
            /* CRITICAL */
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
        }

        .account-tab {
            flex: 0 0 calc(100% - 20px);
            /* Mobile sized */
            scroll-snap-align: center;
            scroll-snap-stop: always;
            margin: 0 10px;
            padding: 10px 10px;
            box-sizing: border-box;
            border-radius: 100px;
        }

        .add-tab-circle {
            display: none !important;
            /* Hide add button on mobile */
        }


        /* Hide legacy wrappers if any remain */
        .account-tabs,
        .account-tabs-wrapper {
            border: none;
            padding: 0;
            display: block;
            /* Let js render inside */
        }

        /* SQUARE STATS (2 Columns) - Unified Grid */
        .stats-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            /* 2 equal columns */
            gap: 8px;
            margin-bottom: 15px;
            width: 100%;
            /* Ensure full width */
            box-sizing: border-box;
        }

        .detail-layout {
            width: 100%;
            box-sizing: border-box;
        }

        .bottom-stats {
            display: none;
        }

        /* Make them look like uniform squares but slightly squashed */
        .stat-card,
        .mini-stat {
            padding: 12px 5px;
            /* Reduced vertical padding */
            aspect-ratio: auto;
            /* Remove square lock */
            height: auto;
            min-height: 90px;
            /* Reduced height (squashed) */
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .stat-value,
        .mini-value {
            font-size: 1.3rem;
            margin-top: 5px;
        }

        .stat-label,
        .mini-label {
            font-size: 0.7rem;
            margin-bottom: 0;
        }

        .user-menu {
            display: none;
        }

        .chart-canvas-wrapper {
            min-height: 300px;
            /* Slightly smaller chart on mobile */
        }
    }

@media (max-width: 600px) {
    .monitoring-section.mode-detail {
        padding: 8px 4px 20px !important;
    }

    .detail-container {
        padding: 0;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        }

        .account-tabs-wrapper {
            width: 100%;
            overflow-x: auto;
        }

        .monthly-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }

    .stat-card,
    .mini-stat {
        padding: 16px 12px;
        min-height: 100px;
    }

    .card {
        padding: 16px;
    }
}

}

/* ========== API Key Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 35px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: white;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.api-key-box {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.api-key-box code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    word-break: break-all;
    color: var(--gold);
    background: transparent;
}

.copy-btn {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.modal-content .setup-instructions {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.modal-content .setup-instructions h4 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.modal-content .setup-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.modal-content .setup-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.modal-content .setup-instructions code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.modal-download-btn {
    display: block;
    width: 100%;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.modal-download-btn:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* Fix for accounts section vertical position */
@media (max-width: 900px) {
    .accounts-container {
        width: 100%;
        padding-top: 0;
        /* Move content higher */
        margin-top: -24px;
        align-self: flex-start;
        /* Override centering */
    }

    .accounts-container .page-header {
        margin-bottom: 30px;
    }

    /* When accounts are shown, adjust section alignment */
    /* Desktop Only Alignment Fixes */
    @media (min-width: 901px) {
        .monitoring-section:has(.accounts-container[style*="block"]) {
            align-items: flex-start;
            justify-content: flex-start;
        }

        .monitoring-section:has(.detail-container[style*="block"]) {
            padding-top: 120px !important;
            justify-content: flex-start;
        }

        .monitoring-section:has(.auth-card) {
            padding-top: 130px !important;
        }
    }

    /* Screenshot Preview Modal */
    .image-preview-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        z-index: 10000;
        justify-content: center;
        align-items: center;
        padding: 20px;
    }

    .preview-content {
        background: #1f1f1f;
        padding: 20px;
        border-radius: 16px;
        width: 100%;
        max-width: 400px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
        position: relative;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .preview-image {
        width: 100%;
        height: auto;
        border-radius: 8px;
        object-fit: contain;
        border: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 60vh;
    }

    .preview-actions {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .preview-btn {
        flex: 1;
        padding: 12px;
        border-radius: 8px;
        border: none;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 1rem;
        transition: transform 0.1s;
    }

    .preview-btn:active {
        transform: scale(0.98);
    }

    .btn-download {
        background: var(--gold);
        color: #000;
    }

    .btn-close-modal {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    @media (max-width: 900px) {
        .group-modal {
            padding: 14px;
        }

        .group-modal__dialog {
            padding: 18px;
            max-height: calc(100vh - 28px);
            border-radius: 18px;
        }

        .group-modal__header {
            flex-direction: column;
            align-items: stretch;
        }

        .group-modal__actions {
            width: 100%;
        }

        .group-modal__btn {
            flex: 1 1 0;
            justify-content: center;
        }

        .group-modal__grid {
            grid-template-columns: 1fr;
            gap: 16px;
        }

        .group-card-title {
            font-size: 1.2rem;
        }
    }
