/* استایل‌های اصلی پروژه */
body {
    background-color: #f0f2f5;
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

.form-container { 
    max-width: 800px; 
    margin: 2rem auto; 
    padding: 0 15px;
}

.card-header { 
    background-color: #0d6efd; 
    color: white; 
}

.btn-edit-mode { 
    background-color: #dc3545; 
    color: white; 
    border-color: #dc3545;
}

.btn-edit-mode:hover { 
    background-color: #c82333; 
    color: white; 
    border-color: #bd2130;
}

.form-title-edit { 
    color: #dc3545; 
}

.input-edit-mode {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.input-filled-for-edit { 
    background-color: #fffacd !important; 
}

.formatted-number-group .input-group-text,
.formatted-number-group .form-control { 
    font-size: 0.7rem; 
    font-weight: 800; 
}

.table-wrapper { 
    max-height: 280px; 
    overflow-y: auto; 
    border: 1px solid #dee2e6; 
    border-radius: 0.375rem; 
    margin-top: 20px;
}

.table thead th { 
    position: sticky; 
    top: 0; 
    z-index: 1; 
    background-color: #e9ecef; 
    font-weight: 700;
}

th, td { 
    white-space: nowrap; 
    vertical-align: middle; 
    text-align: center;
    padding: 8px 12px;
}

table.table-bordered td:nth-child(2),
table.table-bordered th:nth-child(2),
table.table-bordered td:nth-child(9),
table.table-bordered th:nth-child(9) { 
    display: none; 
}

tbody tr:hover { 
    background-color: #e9ecef; 
    cursor: pointer; 
}

.selected-row { 
    background-color: #fffacd !important; 
    color: #212529 !important; 
    font-weight: bold; 
}

.disabled-row { 
    pointer-events: none; 
    opacity: 0.6; 
}

.hidden-box { 
    display: none; 
}

.disabled-input { 
    background-color: #e9ecef; 
    cursor: not-allowed; 
    opacity: 0.7;
}

/* استایل برای تقویم شمسی */
.expiry-date-container .input-group-text {
    font-size: 0.8rem;
}

.pdatepicker-input {
    cursor: pointer;
}

/* استایل‌های برای بهینه‌سازی موبایل */
.controls-row > div:nth-child(1) { 
    flex: 0 0 100px; 
}

.controls-row > div:nth-child(2) { 
    flex: 0 0 160px; 
}

.controls-row > .input-group { 
    flex: 1 1 auto; 
}

@media (max-width: 767px) {
    .form-container {
        margin: 1rem auto;
        padding: 0 10px;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .controls-row {
        flex-wrap: wrap;
        gap: 10px !important;
    }
    
    .controls-row > div, 
    .controls-row > .input-group {
        flex-basis: 100%;
    }
    
    #psar, #engheza, .formatted-number-group .form-control {
        font-size: 0.8rem !important;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    .formatted-number-group .input-group-text {
        font-size: 0.75rem !important;
    }
    
    .btn {
        padding: 0.375rem 1rem;
        font-size: 0.9rem;
    }
    
    .table-wrapper {
        max-height: 200px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .form-container {
        margin: 0.5rem auto;
    }
    
    .card-header h3 {
        font-size: 1.25rem;
    }
    
    .d-flex.gap-3.mb-4 {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .d-flex.gap-3.mb-4 > .flex-fill {
        width: 100%;
    }
}