* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    direction: rtl;
}

/* شريط التنقل العلوي */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #1f8138 0% ,  #173878 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    font-size: 1.5em;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.btn-language {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
    font-weight: bold;
    font-size: 0.9em;
}

.btn-language:hover {
    background: rgba(255,255,255,0.3);
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* التخطيط الرئيسي */
.main-layout {
    display: flex;
    max-width: 1400px;
    max-width: 100vw;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* القائمة الجانبية */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding: 20px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li.menu-section {
    padding: 15px 20px 10px;
    font-weight: bold;
    color: #999;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a span {
    font-size: 1.3em;
}

.sidebar-menu li a:hover {
    background: #f5f7fa;
    color: #667eea;
    
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #173878 0%, #1f8138 100%);
    color: white;
    border-right: 4px solid #764ba2;
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    padding: 30px;
    background: #f5f7fa;
}

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

.page-header h1 {
    color: #333;
    font-size: 2em;
    margin: 0;
}

/* بطاقات الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 3em;
    opacity: 0.8;
}

.stat-details {
    flex: 1;
}

.stat-details h3 {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 8px;
    font-weight: normal;
}

.stat-number {
    font-size: 2.2em;
    font-weight: bold;
    color: #333;
}

/* ألوان البطاقات */
.stat-primary { border-right: 4px solid #667eea; }
.stat-primary .stat-number { color: #667eea; }

.stat-success { border-right: 4px solid #28a745; }
.stat-success .stat-number { color: #28a745; }

.stat-warning { border-right: 4px solid #ffc107; }
.stat-warning .stat-number { color: #ffc107; }

.stat-info { border-right: 4px solid #17a2b8; }
.stat-info .stat-number { color: #17a2b8; }

.stat-secondary { border-right: 4px solid #6c757d; }
.stat-secondary .stat-number { color: #6c757d; }

.stat-purple { border-right: 4px solid #764ba2; }
.stat-purple .stat-number { color: #764ba2; }

/* الرسائل */
.alert 
{
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success 
{
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger 
{
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning 
{
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info 
{
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* البطاقات */
.card 
{
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 25px;
    margin-bottom: 20px;
}

/* الأزرار */
.btn 
{
    display:  block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
}

.btn-sm 
{
    padding: 6px 12px;
    font-size: 0.85em;
    margin: 5px;
    display: block;
    width: fit-content;
    width: -webkit-fill-available;
    border: solid 1px #bdbdbd;
}

.btn-primary 
{
    background: #667eea;
    color: white;
    display: block;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
    display: block;
    margin: 5px;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #333;
    margin: 5px;
    display: block;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
    margin: 5px;
    display: block;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    display: block;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* View / Print custom button */
.btn-light-custom {
    background: #f9ead6;
    color: #333;
    border: 1px solid rgba(0,0,0,0.06);
    display: block;
}

.btn-light-custom:hover {
    background: #f1e2c8;
    transform: translateY(-2px);
}

/* Actions column: vertical stacking */
.actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end; /* keep aligned to right for RTL layouts */
        display: block;
}

/* الشارات */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-primary {
    background: #e7eaff;
    color: #667eea;
}

.badge-success {
    background: #d4edda;
    color: #28a745;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #dc3545;
}

/* الجداول */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

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

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center !important;
}

/* النماذج */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
}

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

/* قسم الفلترة */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}
