/* ============================================
   PANEL CSS - استایل پنل کاربری
   ============================================ */

/* ====== ریست ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111118;
    --bg-card: #1a1a24;
    --bg-sidebar: #12121a;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #666680;
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --secondary: #3b82f6;
    --accent: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(139, 92, 246, 0.1);
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====== اسکرول‌بار ====== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* ============================================
   صفحه ورود و ثبت‌نام
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.08), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.08), transparent 50%),
        var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: linear-gradient(160deg, rgba(30, 27, 40, 0.9), rgba(15, 15, 25, 0.95));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #6366f1);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo .logo-icon {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.auth-logo h1 span {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 5px;
}

/* ====== فرم‌ها ====== */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: rgba(139, 92, 246, 0.05);
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    background: rgba(139, 92, 246, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ====== دکمه‌ها ====== */
.btn {
    padding: 13px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: #fff;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
}

/* ====== پیام‌ها ====== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

/* ====== لینک‌ها ====== */
.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-links a {
    color: #a78bfa;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #fff;
}

/* ============================================
   داشبورد - سایدبار
   ============================================ */
.panel-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar-logo {
    font-size: 28px;
    display: block;
    margin-bottom: 5px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.sidebar-title span {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 5px;
}

.sidebar-nav a:hover {
    background: rgba(139, 92, 246, 0.08);
    color: #fff;
    transform: translateX(-5px);
}

.sidebar-nav a.active {
    background: rgba(139, 92, 246, 0.12);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.1);
}

.sidebar-nav a .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: #a78bfa;
    font-weight: 600;
}

/* ====== محتوای اصلی ====== */
.main-content {
    flex: 1;
    margin-right: 260px;
    padding: 25px 30px;
    min-height: 100vh;
}

/* ====== هدر داشبورد ====== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.panel-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ====== کارت‌های آمار ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(160deg, rgba(30, 27, 40, 0.8), rgba(15, 15, 25, 0.9));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.1);
}

.stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ====== جدول‌ها ====== */
.table-wrapper {
    background: linear-gradient(160deg, rgba(30, 27, 40, 0.8), rgba(15, 15, 25, 0.9));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.table thead {
    background: rgba(139, 92, 246, 0.08);
}

.table thead th {
    padding: 15px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.table tbody td {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table tbody tr {
    transition: background 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ====== بج‌ها ====== */
.badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ====== منوی موبایل ====== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* ====== ریسپانسیو ====== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-right: 0;
        padding: 20px 15px;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .table-wrapper {
        overflow-x: auto;
    }
    .table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }
    .main-content {
        padding: 15px 10px;
    }
    .panel-header h1 {
        font-size: 20px;
    }
}