/* Importujemy ładną czcionkę */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    /* Ważne dla zachowania paddingu */
}

.btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.form-toggle {
    margin-top: 1.5rem;
}

.form-toggle a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.form-toggle a:hover {
    text-decoration: underline;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.navbar {
    background-color: #fff;
    padding: 1rem 2.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.navbar .user-info {
    font-size: 0.9rem;
}

.navbar .user-info a {
    color: #dc3545;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.navbar .user-info a:hover {
    text-decoration: underline;
}

.dashboard-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2.5rem;
}

.dashboard-container h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

/* Stylowanie tabeli */
.table-wrapper {
    overflow-x: auto;
    /* Dla responsywności na małych ekranach */
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    /* Dla zaokrąglonych rogów */
}

.items-table th,
.items-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}

.items-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #444;
}

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

.items-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Przycisk akcji w tabeli */
.action-btn {
    padding: 8px 14px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background-color: #218838;
}

/* "Plusik w kółku" (Floating Action Button) */
.add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.add-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/*
================================
Style dla Okna Modalnego
================================
*/
.modal {
    display: none;
    /* Ukryty domyślnie */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    /* Półprzezroczyste tło */
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    animation: slideDown 0.4s;
}

/* Animacje dla modala */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #333;
    text-decoration: none;
}

.modal-content h2 {
    margin-top: 0;
}

/* Poprawki dla formularza w modalu */
.modal-content .form-group input,
.modal-content .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.modal-content .btn {
    margin-top: 1rem;
}
/*
================================
Style dla Salda i Logów (Etap 3)
================================
*/

/* Kontener na saldo */
.saldo-container {
    display: flex;
    gap: 20px;
    /* Odstęp między okienkami */
    margin-bottom: 2rem;
}

.saldo-box {
    flex: 1;
    /* Równy podział przestrzeni */
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.saldo-title {
    font-size: 1rem;
    color: #555;
    margin-bottom: 8px;
}

.saldo-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

/* Kolor czerwony dla wydatków */
.saldo-value.error {
    color: #dc3545;
}

/* Styl dla klikalnej nazwy przedmiotu w tabeli */
.clickable-item {
    cursor: pointer;
    color: #007bff;
    font-weight: 500;
}

.clickable-item:hover {
    text-decoration: underline;
    color: #0056b3;
}

.icon-log {
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.6;
}

/* Styl dla modala logów (listy) */
#log-modal-body ul {
    list-style-type: none;
    padding-left: 0;
    max-height: 400px;
    /* Maksymalna wysokość, gdyby logów było dużo */
    overflow-y: auto;
    /* Scrollbar */
}

#log-modal-body li {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

#log-modal-body li:last-child {
    border-bottom: none;
}

#log-modal-body li strong {
    color: #333;
}
/*
================================
Style dla Akcji (Etap 4)
================================
*/
.actions-cell {
    display: flex;
    gap: 8px;
    /* Odstęp między przyciskami */
    justify-content: center;
    align-items: center;
}

/* Wspólne style dla małych przycisków akcji */
.actions-cell .action-btn,
.actions-cell .action-btn-edit,
.actions-cell .action-btn-delete {
    width: 40px;
    height: 40px;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Okrągłe przyciski */
}

/* Przycisk Edycji (Niebieski/Pomarańczowy) */
.actions-cell .action-btn-edit {
    background-color: #ffc107;
    /* Pomarańczowy */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.actions-cell .action-btn-edit:hover {
    background-color: #e0a800;
}

/* Przycisk Usuwania (Czerwony) */
.actions-cell .action-btn-delete {
    background-color: #dc3545;
    /* Czerwony */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.actions-cell .action-btn-delete:hover {
    background-color: #c82333;
}
/*
================================
Style dla Logów (Etap 4)
================================
*/
#log-modal-body li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.log-date {
    font-size: 0.9em;
    color: #666;
    flex-basis: 100%;
    /* Data zawsze na górze */
    margin-bottom: 5px;
}

.log-type {
    font-weight: bold;
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
}

.log-type.platnosc {
    background-color: #28a745;
}

.log-type.edycja {
    background-color: #ffc107;
    color: #333;
}

.log-type.utworzenie {
    background-color: #007bff;
}

.log-type.usuniecie {
    background-color: #dc3545;
}
/*
================================
Style dla Podsumowania w Logach
================================
*/
.log-summary {
    padding: 0 10px 15px 10px;
    /* Odstępy */
    margin: -10px 0 15px 0;
    /* Margines ujemny aby przysunąć do tytułu */
    border-bottom: 1px solid #eee;
    /* Linia oddzielająca */
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.log-summary strong {
    color: #28a745;
    /* Zielony kolor dla kwoty */
    font-weight: 700;
}