/* =========================================
   Fitpoprawny - Zarządzanie Finansami
   ========================================= */

.fitpoprawny_finances_container {
    padding: 20px;
}

.fitpoprawny_finances_header {
    margin-bottom: 30px;
}

.fitpoprawny_finances_header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #141627;
    margin: 0 0 10px 0;
}

.fitpoprawny_finances_subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 20px 0;
}

/* Przyciski */
.fitpoprawny_btn_add {
    background: #e57c34;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.fitpoprawny_btn_add:hover {
    background: #d66a1f;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(229, 124, 52, 0.3);
}

/* Wiadomości */
.fitpoprawny_payment_message {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    display: none;
    font-weight: 500;
}

.fitpoprawny_payment_message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fitpoprawny_payment_message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal */
/* Zablokuj scroll body gdy modal otwarty */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

.fitpoprawny_modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    margin: 0;
    overflow-y: auto;
}

.fitpoprawny_modal.show {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fitpoprawny_modal_content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    margin: auto;
    position: relative;
}

.fitpoprawny_modal_content::-webkit-scrollbar {
    width: 8px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-thumb {
    background: #e57c34;
    border-radius: 10px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-thumb:hover {
    background: #d66a1f;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fitpoprawny_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fitpoprawny_modal_header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #141627;
    margin: 0;
}

.fitpoprawny_modal_close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.fitpoprawny_modal_close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Formularz */
#fitpoprawny_payment_form {
    padding: 20px;
}

.fitpoprawny_form_group {
    margin-bottom: 18px;
}

.fitpoprawny_form_group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.fitpoprawny_form_group input,
.fitpoprawny_form_group select,
.fitpoprawny_form_group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.fitpoprawny_form_group input:focus,
.fitpoprawny_form_group select:focus,
.fitpoprawny_form_group textarea:focus {
    outline: none;
    border-color: #e57c34;
    box-shadow: 0 0 0 3px rgba(229, 124, 52, 0.1);
}

.fitpoprawny_form_group textarea {
    resize: vertical;
    min-height: 100px;
}

.fitpoprawny_form_error {
    display: block;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Info box */
.fitpoprawny_form_group + .fitpoprawny_form_group {
    margin-top: 5px;
}

/* Akcje */
.fitpoprawny_form_actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.fitpoprawny_btn_save,
.fitpoprawny_btn_cancel {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fitpoprawny_btn_save {
    background: #e57c34;
    color: #fff;
}

.fitpoprawny_btn_save:hover {
    background: #d66a1f;
    transform: translateY(-2px);
}

.fitpoprawny_btn_cancel {
    background: #f0f0f0;
    color: #333;
}

.fitpoprawny_btn_cancel:hover {
    background: #ddd;
}

/* Tabela finansów */
.fitpoprawny_finances_list {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 30px;
}

.fitpoprawny_finances_loading {
    text-align: center;
    padding: 40px 20px;
    color: #e57c34;
    font-weight: 600;
}

.fitpoprawny_finances_table {
    width: 100%;
    border-collapse: collapse;
}

.fitpoprawny_finances_table thead {
    background: #f9f9f9;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.fitpoprawny_finances_table th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: #141627;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.fitpoprawny_finances_table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.95rem;
}

.fitpoprawny_finances_table tbody tr:hover {
    background: #fafafa;
}

.fitpoprawny_payment_status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.fitpoprawny_payment_status_completed {
    background: #d4edda;
    color: #155724;
}

.fitpoprawny_payment_status_pending {
    background: #fff3cd;
    color: #856404;
}

.fitpoprawny_payment_status_cancelled {
    background: #f8d7da;
    color: #721c24;
}

.fitpoprawny_payment_actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fitpoprawny_payment_actions button {
    background: #e57c34;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fitpoprawny_payment_actions button:hover {
    background: #d66a1f;
}

.fitpoprawny_payment_actions button.delete {
    background: #e74c3c;
}

.fitpoprawny_payment_actions button.delete:hover {
    background: #c0392b;
}

/* =========================================
   RESPONSYWNOŚĆ
   ========================================= */

@media (max-width: 768px) {
    .fitpoprawny_finances_container {
        padding: 15px;
    }

    .fitpoprawny_modal_content {
        margin: 20px;
        max-width: none;
    }

    .fitpoprawny_finances_list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fitpoprawny_finances_table {
        min-width: 600px;
    }

    .fitpoprawny_finances_table th,
    .fitpoprawny_finances_table td {
        padding: 10px;
    }

    .fitpoprawny_payment_actions {
        flex-direction: row;
        gap: 5px;
    }

    .fitpoprawny_payment_actions button {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .fitpoprawny_finances_header h2 {
        font-size: 1.4rem;
    }

    .fitpoprawny_btn_add {
        width: 100%;
    }

    .fitpoprawny_form_actions {
        flex-direction: column;
    }

    .fitpoprawny_finances_list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fitpoprawny_finances_table {
        min-width: 500px;
    }

    .fitpoprawny_finances_table th,
    .fitpoprawny_finances_table td {
        padding: 8px;
        font-size: 0.85rem;
    }

    .fitpoprawny_payment_actions button {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}
