/* Dashboard Wrapper - Modern Full Width Layout */
.codereyes-dashboard-wrapper {
    display: flex;
    min-height: 80vh;
    /* Takes up most of the viewport height */
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-family: 'Inter', sans-serif;
    margin: 0;
    /* Full width means no margin constraint from wrapper itself if parent allows */
    width: 100%;
    max-width: 1600px;
    /* Max constraint for ultra-wide screens */
    margin: 2rem auto;
    /* Center with some margin on large screens */
    border-radius: 1.5rem;
    overflow: hidden;
}

/* Sidebar - Enhanced */
.codereyes-dashboard-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    /* Deep gradient */
    color: white;
    padding: 2.5rem 2rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-user-profile {
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
}

.user-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.user-info span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Sidebar Nav */
.codereyes-dashboard-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: none;
    margin: 0;
}

.tab-link {
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #cbd5e1;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab-link.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.logout-link {
    margin-top: auto;
    /* Push to bottom if container allows */
    color: #f87171;
    /* Red-400 */
    text-decoration: none;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Main Content Area */
.codereyes-dashboard-main {
    flex-grow: 1;
    padding: 2.5rem;
    background: #f8fafc;
    overflow-y: auto;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.section-header p {
    color: #64748b;
    margin-top: 0.5rem;
}

/* Tab Content Animation */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards (Services) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.service-icon {
    width: 50px;
    height: 50px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}

.service-icon i,
.service-icon span {
    font-size: 24px;
}

.service-details h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.purchase-date {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
    margin-bottom: 1.5rem;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.completed,
.status-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.status-badge.processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.pending,
.status-badge.on-hold {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.cancelled,
.status-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.new {
    background: #e0f2fe;
    color: #075985;
}

/* Invoices Table */
.table-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

.invoices-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    color: #334155;
}

.invoices-table tr:hover td {
    background: #f8fafc;
}

/* Buttons */
.btn-view {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-view:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1e293b;
}

.btn-pay {
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 0.5rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-pay:hover {
    background: #059669;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

/* Support Tickets */
.support-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-new-ticket {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
}

.btn-new-ticket:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.5);
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.ticket-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ticket-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-id {
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.9rem;
}

.ticket-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.ticket-preview {
    flex: 1;
    margin: 0 2rem;
    color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
    .codereyes-dashboard-wrapper {
        flex-direction: column;
        margin: 20px;
    }

    .codereyes-dashboard-sidebar {
        width: 100%;
        padding: 1.5rem;
    }

    .codereyes-dashboard-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .tab-link {
        white-space: nowrap;
    }

    .codereyes-dashboard-main {
        padding: 1.5rem;
    }
}