:root {
    --primary: #2563eb;
    --secondary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --tamam-green: #22c55e;
    --tamam-dark: #1e293b;
}

/* إصلاح هيكل الصفحة */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* تخصيص الفوتر */
footer {
    margin-top: auto !important;
    background: var(--tamam-dark) !important;
}

/* شعار تمام */
.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    color: white;
}

/* التصميم العام */
.sidebar {
    background: var(--tamam-dark);
    color: white;
    min-height: 100vh;
    background-image: linear-gradient(135deg, var(--tamam-dark) 0%, #334155 100%);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin: 4px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: var(--primary);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.card-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
}

.stat-card .card-body {
    padding: 1.5rem;
}

/* تخصيص Bootstrap */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

.bg-primary {
    background: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.alert-sm {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
}

.alert-sm .alert-heading {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    background: #f8fafc;
    color: var(--tamam-dark);
}

.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.form-control, .form-select {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.badge {
    font-size: 0.75em;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* تخصيص DataTables */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px;
    padding: 8px 15px;
    border: 1px solid #e2e8f0;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 10px;
    padding: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px;
}

/* تخصيص responsive */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        z-index: 1000;
        transition: right 0.3s ease;
    }
    
    .sidebar.show {
        right: 0;
    }
    
    .card-custom {
        margin-bottom: 1rem;
    }
    
    .stat-card .card-body {
        padding: 1rem;
    }
}

/* تخصيص الشريط العلوي */
.navbar-brand {
    font-size: 1.5rem;
}

/* تخصيص الأيقونات */
.bi-check-circle-fill {
    color: var(--tamam-green);
}

/* تخصيص الحالة */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--tamam-green);
}

.status-expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* تخصيص القائمة المنسدلة للإشعارات */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none;
}

.dropdown-item {
    padding: 10px 15px;
    border-radius: 5px;
    margin: 2px 5px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--primary);
    color: white;
}

/* تخصيص badge في الـ header */
.navbar .badge {
    font-size: 0.6rem;
    position: relative;
    top: -8px;
    right: -5px;
}

/* تحسين القائمة الجانبية */
.sidebar .nav-link {
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* تحسين responsive */
@media (max-width: 768px) {
    .navbar-brand small {
        display: none;
    }
    
    .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
}

/* تخصيص عناصر البحث في الخرائط */
.search-result-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

/* تخصيص الخرائط المصغرة */
#mini_map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#mini_map .display-6 {
    font-size: 2.5rem;
}

/* تخصيص القائمة الجانبية للتجاوب */
.sidebar {
background: var(--tamam-dark) !important;
min-height: 100vh;
transition: all 0.3s ease;
}
@media (max-width: 767.98px) {
.sidebar {
min-height: auto;
position: fixed;
top: 0;
right: 0;
width: 280px;
height: 100vh;
z-index: 1050;
transform: translateX(100%);
transition: transform 0.3s ease;
overflow-y: auto;
}

.sidebar.show {
transform: translateX(0);
}

/* إضافة overlay عند فتح القائمة */
.sidebar-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 1040;
display: none;
}

.sidebar-overlay.show {
display: block;
}

/* تعديل الـ main content */
main {
margin-right: 0 !important;
}
}
/* تحسين مظهر زر القائمة */
.sidebar-toggle {
position: fixed;
top: 15px;
right: 15px;
z-index: 1060;
background: var(--primary);
border: none;
border-radius: 50%;
width: 50px;
height: 50px;
display: none;
align-items: center;
justify-content: center;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
@media (max-width: 767.98px) {
.sidebar-toggle {
display: flex;
}
}
/* تحسين القائمة المنسدلة */
.collapse:not(.show) {
display: none;
}
.collapsing {
height: 0;
overflow: hidden;
transition: height 0.35s ease;
}