/* Dashboard Layout */

.dashboard-page {
    display: flex;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(5, 5, 5, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.dashboard-main {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 280px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #00FF88;
}

/* Service Tabs */
.service-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
}

.tab-icon {
    font-size: 1.25rem;
}

/* Billing Summary */
.billing-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.summary-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.month-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.month-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.current-month {
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.payment-breakdown {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.payment-total {
    padding: 2rem;
    background: var(--gradient-primary);
    border-radius: 16px;
    text-align: center;
}

.total-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.total-amount {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.total-change {
    font-size: 1rem;
    font-weight: 600;
}

.total-change.positive {
    color: rgba(255, 255, 255, 0.9);
}

.payment-components {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.component-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.component-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 136, 0.3);
}

.component-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.component-info {
    flex: 1;
}

.component-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.component-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.component-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Metrics Grid */
.metrics-grid {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.metric-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.metric-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-badge.live {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
    border: 1px solid rgba(0, 255, 136, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.metric-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-item .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-baseline {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.stat-improvement {
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-improvement.positive {
    color: #00FF88;
}

.metric-chart {
    height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

/* Payment History */
.payment-history {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.history-table {
    overflow-x: auto;
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.total-cell {
    font-weight: 700;
    font-size: 1.125rem;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.paid {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
    border: 1px solid rgba(0, 255, 136, 0.3);
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.invoice-link:hover {
    color: var(--primary-light);
}

/* Insights */
.insights {
    margin-bottom: 2rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.insight-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 136, 0.3);
}

.insight-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.insight-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.insight-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.insight-content strong {
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-logo .logo-text,
    .nav-label,
    .user-info {
        display: none;
    }

    .sidebar-header,
    .sidebar-nav,
    .sidebar-footer {
        padding: 1rem;
    }

    .nav-item {
        justify-content: center;
    }

    .user-profile {
        justify-content: center;
    }

    .dashboard-main {
        margin-left: 80px;
        max-width: calc(100vw - 80px);
    }

    .payment-breakdown {
        grid-template-columns: 1fr;
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .dashboard-main {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }

    .metric-stats {
        grid-template-columns: 1fr;
    }

    .service-tabs {
        flex-direction: column;
    }
}

/* News Sidebar */
#news-feed-container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.news-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-source {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-bottom: 0.25rem;
}

.news-title {
    font-size: 0.9rem;
    color: #E2E8F0;
    line-height: 1.4;
}

/* Verified Badge */
.status-badge.verified {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* Sticky Ticker Override */
.crypto-ticker-banner {
    background: #0B1221;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 40px;
}