:root {
    --sidebar-bg: #1a1f36;
    --primary: #5569ff;
    --primary-dark: #3f51b5;
    --text-light: #a3a9c2;
    --bg: #f5f7fa;
    --card: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
}
body { font-family: 'Vazirmatn', sans-serif; background: var(--bg); color: #333; margin:0; direction: rtl; }
.wrapper { display: flex; min-height: 100vh; }

/* سایدبار */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    transition: width 0.3s;
}
.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2 {
    font-size: 1.8rem;
    margin: 0;
}
.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}
.sidebar-menu li {
    margin: 0.5rem 0;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.4rem;
    transition: all 0.25s;
}
.sidebar-menu a:hover, .sidebar-menu .active a {
    background: rgba(255,255,255,0.1);
    color: white;
}
.sidebar-menu i {
    margin-left: 1rem;
    width: 24px;
    text-align: center;
}
.submenu {
    display: none;
    padding-right: 1rem;
}
.submenu.show {
    display: block;
}
.has-submenu > a::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: auto;
    transition: transform 0.3s;
}
.has-submenu.open > a::after {
    transform: rotate(-180deg);
}

/* محتوا */
.content {
    margin-right: 280px;
    flex: 1;
    padding: 2rem;
}
.topbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}
.search-bar input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1.4rem;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.notification, .profile {
    font-size: 1.6rem;
    color: #555;
    cursor: pointer;
}
.profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* کارت‌های آمار */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1a3c6d;
}
.stat-label {
    font-size: 1.4rem;
    color: #777;
}

/* رسپانسیو */
@media (max-width: 992px) {
    .sidebar { width: 80px; }
    .sidebar-header h2, .sidebar-menu span:not(.icon) { display: none; }
    .content { margin-right: 80px; }
}


/* 
    =================================== Show Article List
*/

h1 {
    font-size:2.6rem;
    color:#0066cc;
    margin-bottom:2rem; 
}

table {
    width:100%;
    border-collapse:collapse;
    background:white;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
    border-radius:12px;
    overflow:hidden; 
}

th, td {
    padding:1.4rem;
    text-align:right;
    border-bottom:1px solid #eee;
    font-size:1.5rem; 
}

th {
    background:#0066cc;
    color:white; 
}

tr:hover {
    background:#f0f7ff; 
}

.actions a {
    margin-left:1rem;
    color:#0066cc;
    text-decoration:none; 
}

.actions a:hover {
    text-decoration:underline; 
}


/* ==========================================================================
    Categories Management Page
   ========================================================================== */

.categories-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.categories-table {
    width: 100%;
    border-collapse: collapse;
}

.categories-table th,
.categories-table td {
    padding: 1.4rem 2rem;
    text-align: right;
    border-bottom: 1px solid #eee;
    font-size: 1.5rem;
}

.categories-table th {
    background: #0066cc;
    color: white;
    font-weight: 600;
}

.categories-table tr:hover {
    background: #f8fbff;
}

.actions a {
    margin-left: 1.2rem;
    font-size: 1.4rem;
    text-decoration: none;
}

.edit-cat { color: #0066cc; }
.delete-cat { color: #d32f2f; }

.category-form-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    margin-bottom: 3rem;
}

.category-form .form-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 300px;
}

.form-group.full { flex: 100%; }

.form-group label {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

/* ==========================================================================
   Category Management - فرم ثابت + جدول
   ========================================================================== */

.category-form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    margin-bottom: 3.5rem;
}

.form-title {
    font-size: 2.2rem;
    color: #1a3c6d;
    margin-bottom: 2rem;
    text-align: center;
}

.category-form .form-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 280px;
}

.form-group.full { flex: 100%; }

.form-group label {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.list-title {
    font-size: 2rem;
    color: #1a3c6d;
    margin-bottom: 1.5rem;
}



/* عمومی برای همه صفحات پنل */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 2.6rem;
    color: #0066cc;
}

.btn-primary, .btn-outline {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-size: 1.4rem;
    cursor: pointer;
}

.btn-primary { background: #0066cc; color: white; border: none; }
.btn-outline { background: transparent; border: 2px solid #0066cc; color: #0066cc; }

.btn-primary:hover { background: #004080; }
.btn-outline:hover { background: #0066cc; color: white; }

/* جدول‌ها */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

th, td {
    padding: 1.2rem 1.8rem;
    text-align: right;
}

th { background: #0066cc; color: white; }

tr:hover { background: #f8fbff; }

/* وضعیت‌ها */
.status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 1.3rem;
}
.status.approved { background: #e8f5e9; color: #2e7d32; }
.status.pending { background: #fff3e0; color: #ef6c00; }



/* 
    =================================== User Management
*/

.user-form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    margin-bottom: 3.5rem;
}

.user-form .form-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 280px;
}

/* 
    =================================== comments
*/
.comments-filter-bar {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.filter-list {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0 2rem;
}

.filter-item a {
    font-size: 1.5rem;
    color: #555;
    text-decoration: none;
    padding-bottom: 0.8rem;
    transition: all 0.25s;
}

.filter-item.active a,
.filter-item a:hover {
    color: #0066cc;
    border-bottom: 3px solid #0066cc;
    font-weight: 600;
}

.filter-item .count {
    background: #e0e0e0;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* 
    =================================== Add Article
*/


.add-article-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 300px;
}

.form-group.full { flex: 100%; }

.form-group label {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.5rem;
    font-family: 'Vazirmatn', sans-serif;
}

.form-group textarea {
    resize: vertical;
    min-height: 300px;
}

.required {
    color: #d32f2f;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    margin-top: 3rem;
}

.btn {
    padding: 1rem 2.2rem;
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #004080;
}

.btn-outline {
    background: transparent;
    border: 2px solid #0066cc;
    color: #0066cc;
}

.btn-outline:hover {
    background: #0066cc;
    color: white;
}

.btn-cancel {
    background: #f44336;
    color: white;
}

.btn-cancel:hover {
    background: #d32f2f;
}