:root {
    --bg-main: #0a0e17;
    --sidebar-bg: #111827;
    --card-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary: #38bdf8;
    --primary-hover: #0284c7;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --accent: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: radial-gradient(circle at 10% 20%, #171f38, var(--bg-main) 90%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* سایدبار ناوبری مدرن */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    box-shadow: 4px 0 25px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 35px;
    padding: 0 8px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #0b0f19;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.brand-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.nav-item a:hover, .nav-item.active a {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    transform: translateX(-4px);
}

.user-profile {
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* محتوای اصلی */
.main-content {
    flex: 1;
    padding: 35px;
    overflow-y: auto;
    max-width: 1600px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 800;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0; height: 3px;
    background: var(--primary-gradient);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

/* جداول هوشمند و شیک */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 24px;
    overflow-x: auto;
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

th {
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.93rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

/* بج‌ها */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-primary { background: rgba(129, 140, 248, 0.15); color: #818cf8; border: 1px solid rgba(129, 140, 248, 0.3); }

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #0b0f19;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

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

/* فرم‌ها و اینپوت‌ها */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-card);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(11, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 0.94rem;
    margin-top: 6px;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 110px;
}

/* نوار جستجو و فیلتر */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.filter-input {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0 !important;
}

@media(max-width: 900px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; position: static; }
    .main-content { padding: 20px; }
}
