
/* CSS العام للتطبيق */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    direction: ltr; /* Important for charts to render correctly in RTL layout */
}







.edit-btn{
    display: none !important;
}



header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    background-color: #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 1rem;
    display: block;
    transition: all 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    background-color: #4CAF50;
}

nav ul li a i {
    margin-left: 5px;
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* أنماط الأقسام */
.section-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    padding: 20px;
    flex: 1;
    min-width: 300px;
}

.section-title {
    color: #4CAF50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-left: 10px;
}

/* أنماط الجدول والعقود */
.contracts-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 60px;
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #4CAF50;
    color: white;
    position: sticky;
    top: 60px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* أنماط الأزرار */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-left: 5px;
}

.btn-primary {
    background-color: #4CAF50;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

.btn-danger {
    background-color: #f44336;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-warning {
    background-color: #ff9800;
}

.btn-warning:hover {
    background-color: #e68a00;
}

#installmentsTableContainer{
    overflow: auto;
}


#dueTodayContainer{
    overflow: auto;
}

.swal2-confirm{
    margin: 5px 10px;

}


.mark-paid-btn{
    background: black;
}

.btn-sm {
    padding: 9px 10px 6px 7px;
    font-size: 0.8rem;
    margin: 4px;
}

.search-section {
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 10px;
    display: block;
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 500;
    padding: 9px 10px;
    border-radius: 10px;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}

input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    border-color: #ddd;
}

@media print {
    body * {
        visibility: hidden;
    }
    .print-content, .print-content * {
        visibility: visible;
    }
    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
    table {
        width: 100%;
        border-collapse: collapse;
    }
    th, td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: right;
    }
    th {
        background-color: #f2f2f2;
    }
}




.filter-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#showUnpaidOnly {
    min-width: 20px !important;
}


@media (max-width: 768px) {
    .search-section {
        overflow: scroll;
    }
}


.search-section input {
    flex: 1;
    min-width: 100px;
    max-width: 250px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}


/* أنماط البحث بالفترة التاريخية */
.date-range-search {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.date-range-search input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Cairo', sans-serif;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.installments-table {
    overflow-x: auto;
}

.installments-table table {
    width: 100%;
    border-collapse: collapse;
}

.installments-table th, 
.installments-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.installments-table th {
    /* background-color: #f5f5f5; */
    font-weight: 600;
}



/* أنماط ترقيم الصفحات */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.page-number {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.page-number.active {
    background-color: #4CAF50;
    color: white;
}

/* أنماط Modal */
.modal {
    display: none;
    position: fixed;
    /* position: relative; */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    position: absolute;
    left: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

/* أنماط النماذج */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* أنماط لوحة التحكم */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 1rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.chart-container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    position: relative;
    height: 300px;
}

/* أنماط ربط الواتساب */
.whatsapp-section {
    text-align: center;
}

#qrCode {
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.status-text {
    margin: 15px 0;
    font-size: 1.1rem;
}

/* تبويب الواجهة */
.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom: 3px solid #4CAF50;
    color: #4CAF50;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {


    /* body{
        min-width: 1000px;
        overflow: scroll;
    } */


/* 
    .modal {
        position: absolute;
        z-index: 1000;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    } */




/* 


    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .section {
        min-width: 100%;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 10px;
    } */
}
