/* Добавьте эти стили в ваш existing CSS файл */

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.grid-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 300px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.card-header button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.card-header button:hover {
    background-color: #0056b3;
}

.totals {
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1.1em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.9em;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #e9ecef;
    font-weight: bold;
}

a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-top: 0;
    color: #333;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content input[type="date"],
.modal-content input[type="number"],
.modal-content input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.modal-content button[type="submit"] {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

.modal-content button[type="submit"]:hover {
    background-color: #218838;
}

.modal-content button[type="button"] {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-top: 10px;
}

.modal-content button[type="button"]:hover {
    background-color: #5a6268;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 90%;
        margin: 15% auto;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 15px;
    }
    
    .grid-item {
        min-width: auto;
    }
}

/* Дополнительные стили для улучшения внешнего вида */
.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header h2 {
    font-size: 1.3em;
}

.totals {
    font-size: 1.1em;
}

.total-summary {
    margin: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.total-summary h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
    font-size: 38px;
}

.expenses-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.expense-item {
    background-color: white;
    padding: 5px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center; /* Центрирование текста */
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Центрирование содержимого */
    border: 2px solid #007bff;
    border-radius: 8px;
    margin-top: 0; /* Убираем верхний отступ */
}

.expense-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.expense-item h4 {
    margin: 0 0 6px 0;
    color: #007bff;
    font-size: 14px;
    font-weight: bold;
}

.expense-item p {
    margin: 1px 0;
    color: #555;
    font-size: 23px;
}

.amount {
    font-weight: bold;
    color: #28a745;
    font-size: 14px;
}

.price {
    color: #6c757d;
    font-size: 13px;
}

.total-container {
    background-color: #007bff;
    color: white;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    margin-top: 6px;
    grid-column: 1 / -1;
    border: 2px solid #0056b3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.total-title {
    margin: 0 0 6px 0;
    font-size: 15px;
}

.total-amount {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .expenses-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .expense-item {
        padding: 8px;
        min-height: 80px;
    }
    
    .expense-item h4 {
        font-size: 13px;
    }
    
    .expense-item p {
        font-size: 12px;
    }
    
    .amount {
        font-size: 13px;
    }
    
    .price {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .expenses-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .total-summary {
        margin: 8px;
        padding: 12px;
    }
    
    .expense-item {
        padding: 6px;
        min-height: 70px;
    }
    
    .total-container {
        padding: 10px;
    }
    
    .total-title {
        font-size: 13px;
    }
    
    .total-amount {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .expenses-container {
        grid-template-columns: 1fr;
    }
    
    .expense-item {
        padding: 8px;
        min-height: 80px;
    }
    
    .total-container {
        margin-top: 8px;
        padding: 8px;
    }
    
    .total-title {
        font-size: 13px;
    }
    
    .total-amount {
        font-size: 15px;
    }
}





