﻿/* ═══════════════════════════════════════════════════════
   🎨 VPN Panel - Professional Stylesheet
   ═══════════════════════════════════════════════════════ */

* {
    font-family: 'Vazirmatn', Tahoma, -apple-system, sans-serif;
    box-sizing: border-box;
}

body {
    background: #f1f5f9;
    min-height: 100vh;
    margin: 0;
    color: #1e293b;
    line-height: 1.6;
}

/* ═══════════ Sidebar ═══════════ */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 270px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.sidebar-brand {
    padding: 24px 22px;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand i {
    color: #818cf8;
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.5));
}

.sidebar-user {
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user .avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
}

.sidebar-user .info h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.sidebar-user .info small {
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 12px;
    margin: 0;
}

.sidebar-menu .menu-section {
    padding: 15px 14px 8px;
    font-size: 10.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 11px;
    margin-bottom: 3px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: rgba(129, 140, 248, 0.12);
    color: #fff;
    transform: translateX(-3px);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.sidebar-menu a i {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu a .badge {
    margin-right: auto;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 8px;
}

/* ═══════════ Main Content ═══════════ */
.main-content {
    margin-right: 270px;
    padding: 24px 30px 60px;
    min-height: 100vh;
    transition: margin-right 0.3s;
}

.topbar {
    background: white;
    padding: 20px 28px;
    border-radius: 18px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    border: 1px solid #f1f5f9;
}

.topbar h4 {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
    font-size: 22px;
}

/* ═══════════ Stat Cards ═══════════ */
.stat-pro {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-pro::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-pro:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(102, 126, 234, 0.15);
    border-color: #e0e7ff;
}

.stat-pro:hover::before {
    opacity: 1;
}

.stat-pro .info {
    flex: 1;
}

.stat-pro .info h2 {
    font-size: 34px;
    font-weight: 900;
    margin: 0;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -1px;
}

.stat-pro .info p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-pro .ico {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.ico-purple { background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35); }
.ico-green { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35); }
.ico-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35); }
.ico-blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35); }
.ico-red { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35); }
.ico-yellow { background: linear-gradient(135deg, #eab308, #facc15); box-shadow: 0 8px 20px rgba(234, 179, 8, 0.35); }

/* ═══════════ Chart Cards ═══════════ */
.chart-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    height: 100%;
}

.chart-card h5 {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════════ Timeline ═══════════ */
.timeline-item-pro {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background 0.2s;
    border-radius: 10px;
    padding-right: 8px;
    padding-left: 8px;
}

.timeline-item-pro:hover {
    background: #f8fafc;
}

.timeline-item-pro:last-child {
    border-bottom: none;
}

.timeline-icon-pro {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.timeline-icon-pro.warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.timeline-icon-pro.danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.timeline-content-pro h6 {
    margin: 0 0 4px;
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.timeline-content-pro small {
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ═══════════ Top Resellers ═══════════ */
.top-reseller-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.top-reseller-item:last-child {
    border-bottom: none;
}

.top-reseller-rank {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.rank-3 { background: linear-gradient(135deg, #fb923c, #ea580c); }
.rank-other { background: linear-gradient(135deg, #94a3b8, #64748b); }

/* ═══════════ Badges ═══════════ */
.badge-active {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-blocked {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ═══════════ Tables ═══════════ */
.table {
    margin: 0;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    border: none;
    padding: 16px 14px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 16px 14px;
    vertical-align: middle;
    text-align: center;
    border-color: #f1f5f9;
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* ═══════════ Cards ═══════════ */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 22px;
    border: 1px solid #f1f5f9;
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 26px;
    border-radius: 20px 20px 0 0 !important;
    font-weight: 800;
    color: #0f172a;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 26px;
}

/* ═══════════ Buttons ═══════════ */
.btn {
    border-radius: 11px;
    font-weight: 600;
    padding: 9px 20px;
    transition: all 0.25s;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: 9px;
}

/* ═══════════ Forms ═══════════ */
.form-control, .form-select {
    padding: 12px 16px;
    border-radius: 11px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    font-size: 13.5px;
}

/* ═══════════ Alert ═══════════ */
.alert-pro {
    padding: 15px 22px;
    border-radius: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ═══════════ Login Page ═══════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.login-box {
    background: white;
    padding: 50px 45px;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    max-width: 430px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-box h2 {
    color: #0f172a;
    font-weight: 800;
    text-align: center;
    margin-bottom: 32px;
    font-size: 26px;
}

.login-box .form-control {
    padding: 15px 20px;
    border-radius: 13px;
    border: 2px solid #e2e8f0;
    font-size: 15px;
}

.login-box .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.login-box .btn {
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 13px;
}

/* ═══════════ Mobile ═══════════ */
.mobile-toggle {
    display: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
}

.mobile-toggle:hover {
    transform: scale(1.05);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

@media (max-width: 900px) {
    .sidebar {
        right: -280px;
        box-shadow: none;
    }
    .sidebar.active {
        right: 0;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    }
    .main-content {
        margin-right: 0;
        padding: 16px;
    }
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .topbar {
        padding: 15px 20px;
    }
    .topbar h4 {
        font-size: 18px;
    }
    .stat-pro .info h2 {
        font-size: 26px;
    }
    .stat-pro .ico {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    .stat-pro {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .stat-pro .info h2 {
        font-size: 22px;
    }
    .stat-pro .ico {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    .chart-card {
        padding: 18px;
    }
}

/* ═══════════ Scrollbar ═══════════ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #667eea, #764ba2);
}

/* ═══════════ Animations ═══════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-pro, .chart-card, .card {
    animation: fadeInUp 0.5s ease;
}
