.actions {
    display: flex;
    direction: ltr;
    gap: 15px;
}
.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-secondary {
    background: #f1f1f1;
    color: #666;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}
.btn-secondary:hover {
    background: #e0e0e0;
}

/* استایل‌های جدید برای جدول و مدال */
.btn-sm {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-warning {
    background: linear-gradient(to right, #f39c12, #e67e22);
    color: white;
}

.btn-danger {
    background: linear-gradient(to right, #e74c3c, #c0392b);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(to right, #e67e22, #d35400);
}

.btn-danger:hover {
    background: linear-gradient(to right, #c0392b, #a93226);
}

/* استایل‌های جدید برای مدال */
.modal-content {
    border-radius: 12px;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.modal-header {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-title {
    font-weight: 600;
    font-size: 18px;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}
.btn-close {
    filter: invert(1);
    opacity: 0.8;
}
.btn-close:hover {
    opacity: 1;
}
.no-debts {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.no-debts i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #bdc3c7;
}

.debt-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 15px 25px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 150px;
}

.summary-card h3 {
    margin-top: 0;
    color: #7f8c8d;
    font-size: 16px;
}

.summary-card .value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.summary-card .value.success {
    color: #27ae60;
}

.summary-card .value.warning {
    color: #f39c12;
}
/* اصلاح استایل مدال */
.modal.fade.d-none {
    display: none !important;
    opacity: 0;
}
/* استایل‌های اختصاصی مدال */
#editDebtModal .modal-content {
    padding: 0 !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: none;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
}
#editDebtModal .modal-header {
    background-color: var(--primary);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}
#editDebtModal .modal-title {
    color: #fff !important;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
#editDebtModal .modal-title i {
    font-size: 24px;
}
#editDebtModal .btn-close {
    font-size: 12pt;
    color: #fff;
    opacity: 0.8;
    position: absolute;
    left: 20px;
    top: 59%;
    transform: translateY(-50%);
    transition: all 0.3s;
}
#editDebtModal .modal-body {
    background: #f8fafc;
}
#editDebtModal .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-top: 5px;
    display: block;
}
#editDebtModal .form-control {
    width: 100%;
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: white;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}
#editDebtModal .form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}
#editDebtModal .modal-footer {
    margin-top: 23px;
    padding: 10px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: space-between;
}
#editDebtModal .modal-footer .btn {
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#editDebtModal .modal-footer .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #cbd5e0;
}
#editDebtModal .modal-footer .btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
#editDebtModal .modal-footer .btn-primary {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    border: none;
}
#editDebtModal .modal-footer .btn-primary:hover {
    background: linear-gradient(to right, #2980b9, #2573a7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

/* انیمیشن‌های مدال */
@keyframes modalEntrance {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes modalExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}
.modal.fade.show .modal-dialog {
    animation: modalEntrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.modal.fade.hide .modal-dialog {
    animation: modalExit 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}
/* استایل مخصوص تقویم شمسی در مدال */
#editDebtDate {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%233498db" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 20px;
    padding-left: 45px;
    cursor: pointer;
}

/* کل صفحه را به حالت لایه‌ی ثابت و وسط‌چین می‌بریم */
.modal {
  position: fixed;
  inset: 0;                /* top:0; right:0; bottom:0; left:0 */
  display: none;           /* با کلاس .show نمایان می‌شود */
  align-items: center;     /* عمودی وسط */
  justify-content: center; /* افقی وسط */
  z-index: 10050;
}

/* وقتی مدال فعال است */
.modal.show {
  display: flex;
}
.modal-backdrop.show { opacity: 0.5; z-index: 9; }

/* جعبه‌ی پنجره */
#editDebtModal .modal-dialog {
  position: relative;
  width: 92vw;             /* واکنش‌گرا */
  max-width: 720px;        /* اندازه‌ی پنجره روی دسکتاپ */
  margin: 0 auto;
  transform: scale(.9);
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
  z-index: 1051;           /* بالاتر از بک‌دراپ */
}

/* افکت پاپ‌این هنگام نمایش */
.modal.show .modal-dialog {
  transform: scale(1.02);
  animation: modal-pop .22s ease-out forwards;
}
@keyframes modal-pop {
  0%   { transform: scale(1.02); }
  60%  { transform: scale(1.00); }
  100% { transform: scale(1.01); }
}

/* فوکوس زیبا برای دسترسی‌پذیری */
.modal-content :focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 10px;
}
.debt-has-payment {
    background-color: #f8f9fa !important;
    opacity: 0.85;
    cursor: not-allowed;
}
.debt-has-payment td:first-child input {
    cursor: not-allowed;
}

@media (max-width: 1024px) {
    .filter-row {
        font-size: 11px;
    }
    .form-control, .form-select {
        padding: 10px;
    }
    .table{
        font-size: 11px;
    }
    .btn {
        padding: 10px 3px;
    }
    .btn-danger {
        color: red !important;
        background: none !important;
    }
    .btn-warning {
        background: none !important;
        color: #f39c12 !important;
    }
}
/* استایل‌های واکنش‌گرا */
@media (max-width: 768px) {
    #editDebtModal .modal-dialog {
        margin: 15px;
    }
    #editDebtModal .modal-body {
        padding: 20px;
    }
    #editDebtModal .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    #editDebtModal .modal-footer .btn {
        width: 100%;
    }
    .input-container {
        width: 100%;
        margin-bottom: 20px;
    }

    /* استایل‌های موبایل برای مدال */
    .modal-dialog {
        margin: 10px;
    }
    .actions {
        flex-direction: column;
    }
}
/* موبایل: تقریباً فول‌اسکرین ولی همچنان شبیه پنجره */
@media (max-width: 576px) {
    th, td{
        
    }
    th{
        font-size: 9px;
    }
    td{
        font-size: 8px;
    }
    .action-td{
        display: flex;
        gap: 3px;
    }
    .action-td button{
        font-size: 9px;
    }
}
@media (max-width: 468px) {
    th, td{
        padding: 2px !important;
    }   
}