:root {
    --primary: #2c3e50; /* رنگ سرمه‌ای */
    --primary-light: #34495e;
    --secondary: #1abc9c;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
}


body {
    font-family: 'Vazir', sans-serif;
    background-color: #f8f9fa;
    color: var(--dark);
}

/* نوار ناوبری */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.navbar {
    background: var(--primary) !important;
}

/* کارت‌ها */
.card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

/* دکمه‌ها */
.btn {
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #5649d2;
    border-color: #5649d2;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* جداول */
.table {
    --bs-table-bg: transparent;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(108, 92, 231, 0.05);
}

/* فرم‌ها */
.form-control, .form-select {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(108, 92, 231, 0.25);
}

/* تقویم شمسی */
.persian-datepicker {
    background-image: none;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate {
    animation: fadeIn 0.6s ease-out;
}

/* وضعیت‌ها */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 50px;
}

.bg-success-light {
    background-color: rgba(0, 184, 148, 0.1);
    color: var(--secondary);
}

.bg-danger-light {
    background-color: rgba(214, 48, 49, 0.1);
    color: var(--danger);
}

.navbar-nav .nav-link {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: scale(1.05);
}

/* رسپانسیو */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .card {
        border-radius: 10px;
    }
}

/* استایل دکمه‌های عمل */
.btn-action {
    min-width: 120px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* استایل جدول گردش حساب */
.table-transactions tbody tr {
    transition: background-color 0.2s ease;
}

.table-transactions tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* استایل کارت مانده حساب */
.balance-card {
    border-left: 4px solid;
    border-radius: 8px;
}

.balance-card.positive {
    border-left-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
}

.balance-card.negative {
    border-left-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.badge-payer {
    padding: 0.35em 0.65em;
    border-radius: 50rem;
    font-size: 0.875em;
    font-weight: 500;
}


/* استایل‌های بهبود یافته برای جدول‌های رسپانسیو */
.table-responsive {
    width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    /* استایل کلی برای تمام جدول‌ها در موبایل */
    .table {
        width: 100%;
        min-width: 100% !important; /* تغییر مهم: عرض حداقل 100% */
        display: block;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        width: 100%;
        display: block;
    }

    .table tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 0.5rem;
        padding: 0.75rem;
        position: relative;
        box-sizing: border-box;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f5f5f5;
        text-align: right !important;
        box-sizing: border-box;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    .table tbody td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary);
        min-width: 40%;
        text-align: right;
        padding-left: 0.5rem;
    }

    /* بهبود استایل دکمه‌ها در موبایل */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    /* استایل مخصوص عملیات در جدول افراد */
    .table-people td[data-label="عملیات"] .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    /* استایل مخصوص وضعیت در جدول بدهی‌ها */
    .table-debts td[data-label="وضعیت"] {
        justify-content: flex-end;
    }

    .table-debts td[data-label="وضعیت"] .badge {
        width: 100%;
        text-align: center;
    }
}


/* استایل کارت شرکت‌کنندگان */
.participant-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.participant-card:hover {
    background-color: rgba(108, 92, 231, 0.05);
    border-color: rgba(108, 92, 231, 0.2);
}

/* استایل دکمه‌های انتخاب/لغو انتخاب */
#select-all, #deselect-all {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}