:root {
    --primary: #4361ee;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --info: #118ab2;
}

.sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: #cbd5e1;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(67, 97, 238, 0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.main-content {
    padding: 20px;
    width: 100%;
    margin-left: 0;
}
        
.stats-card {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.stats-card .card-body {
    padding: 20px;
}

.table-container {
    max-height: 600px;
    overflow-y: auto;
}

.months-0 { background-color: rgba(6, 214, 160, 0.1); }
.months-1 { background-color: rgba(255, 209, 102, 0.1); }
.months-2 { background-color: rgba(239, 71, 111, 0.1); }
.months-3plus { background-color: rgba(128, 128, 128, 0.1); height: 250px;}

.badge-months {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-0 { background: #06d6a0; color: white; }
.badge-1 { background: #ffd166; color: #333; }
.badge-2 { background: #ef476f; color: white; }
.badge-3plus { background: #64748b; color: white; }

.payment-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.payment-income { background: #06d6a0; color: white; }
.payment-expense { background: #ef476f; color: white; }

.empty-table {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.lead-detail-row {
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 0;
}

.lead-detail-row:last-child {
    border-bottom: none;
}

.trend-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}
.total_pay{
    display: block;
    font-size: 20px;
    color: #06d6a0;
}

.trend-up { background: #06d6a0; }
.trend-down { background: #ef476f; }
.trend-stable { background: #64748b; }

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    .main-content {
        margin-left: 0;
    }
}

.payment_action_btn{
    display: flex;
    gap: 3px;
}
.payment_action_btn > button{
    padding: 5px;
}

/* Строка-аккордеон для оплат */
.payment-history-row {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.payment-history-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.payment-history-content.show {
    max-height: 500px; /* Достаточно для ~15-20 оплат */
    transition: max-height 0.3s ease-in;
}

/* Компактная таблица оплат */
.payment-history-table {
    font-size: 11px;
    width: 100%;
}

.payment-history-table td {
    padding: 4px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.payment-history-table .amount {
    font-weight: 600;
    white-space: nowrap;
}

.payment-history-table .amount.income { color: #198754; }
.payment-history-table .amount.expense { color: #dc3545; }

.payment-history-table .date { 
    color: #6c757d; 
    white-space: nowrap;
    font-size: 10px;
}

.payment-history-table .desc {
    color: #495057;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-toggle-payments.active {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
}
.edit-payment{
    cursor: pointer;
}