/* ==========================================================================
   1. STYL OGÓLNY I RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    padding-bottom: 50px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   2. NAGŁÓWEK I PANEL UŻYTKOWNIKA
   ========================================================================== */
header {
    background-color: #1e3d59;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ==========================================================================
   3. PRZYCISKI I FORMULARZE OGÓLNE
   ========================================================================== */
button, .btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary {
    background-color: #ff6e40;
    color: white;
}

.btn-primary:hover {
    background-color: #e65c00;
}

.btn-secondary {
    background-color: #ffc107;
    color: #222;
}

.btn-small {
    margin-bottom: 10px;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-text-small {
    font-size: 13px;
    padding: 6px 12px;
}

.btn-full-width {
    width: 100%;
    font-size: 13px;
    padding: 7px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.form-actions-small {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.vertical-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

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

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.label-bold { font-size: 13px; font-weight: bold; }
.margin-top-10 { margin-top: 10px; }

/* ==========================================================================
   4. AUTENTYKACJA (LOGOWANIE / REJESTRACJA)
   ========================================================================== */
.auth-card {
    background: #fff;
    max-width: 400px;
    margin: 80px auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.auth-card h2 {
    margin-bottom: 20px;
    color: #1e3d59;
}

.auth-toggle {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

.auth-toggle a {
    color: #ff6e40;
    text-decoration: none;
    font-weight: bold;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}
.message.error { background-color: #ffebee; color: #c62828; }
.message.success { background-color: #e8f5e9; color: #2e7d32; }

/* ==========================================================================
   5. PANEL GŁÓWNY (DASHBOARD) I POLA WYJAZDÓW
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#add-trip-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-bottom: 25px;
    max-width: none !important;
    margin: 0 0 25px 0 !important;
    box-shadow: none !important;
}

.empty-state {
    text-align: center;
    color: #777;
    font-style: italic;
    padding: 40px;
}

/* Zaproszenia */
.invitations-container {
    margin-bottom: 30px;
    background: #fffde7;
    padding: 15px;
    border: 1px solid #fff59d;
    border-radius: 6px;
}

.invitations-heading {
    color: #f57f17;
    margin-bottom: 10px;
    font-size: 16px;
}

.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   6. SZCZEGÓŁY WYJAZDU & EKIPA
   ========================================================================== */
.trip-summary-card {
    margin-bottom: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.trip-summary-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

#current-trip-title {
    color: #1e3d59;
}

.trip-subtext {
    color: #555;
    font-size: 14px;
    margin-top: 4px;
}

.trip-members-text {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
}

#trip-members-inline-list {
    font-weight: bold;
    color: #1e3d59;
}

.trip-action-group {
    display: flex;
    gap: 6px;
}

.btn-action-edit {
    font-size: 12px;
    padding: 5px 10px;
    background: #f0f0f0;
}

.btn-action-delete {
    font-size: 12px;
    padding: 5px 10px;
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.trip-edit-container {
    margin-bottom: 20px;
    background: #eef5f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #1e3d59;
}

.trip-edit-container h3 {
    color: #1e3d59;
    margin-bottom: 12px;
}

.invite-member-box {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

.invite-member-box h4 {
    margin-bottom: 6px;
    color: #1e3d59;
    font-size: 13px;
}

.input-small {
    padding: 6px;
    font-size: 13px;
}

.btn-invite {
    padding: 6px 12px;
    font-size: 12px;
    background: #1e3d59;
}

/* ==========================================================================
   7. MODUŁY: SIATKA, PLAN I WSPÓLNY PORTFEL
   ========================================================================== */
.trip-modules-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.module-card {
    flex: 1;
    min-width: 320px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.inner-form {
    background: #fdfdfd;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 20px;
}

.input-styled, .select-styled {
    width: 100%;
    padding: 6px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Moduł: Plan */
.module-title-plan {
    color: #1e3d59;
    margin-bottom: 12px;
    border-bottom: 2px solid #1e3d59;
    padding-bottom: 5px;
}

.module-title-plan h4 {
    color: #ff6e40;
    margin: 18px 0 8px 0;
    border-bottom: 2px dashed #e8e8e8;
    padding-bottom: 4px;
    font-size: 14px;
}

/* Moduł: Portfel */
.module-title-wallet {
    color: #ff6e40;
    margin-bottom: 12px;
    border-bottom: 2px solid #ff6e40;
    padding-bottom: 5px;
}

.total-expenses-banner {
    background: #1e3d59;
    color: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.total-expenses-banner strong {
    font-size: 18px;
    color: #ff6e40;
}

/* Struktura nowych ujednoliconych pól portfela */
.form-row-spaced {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.vertical-flex {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-wallet {
    font-size: 13px;
    font-weight: bold;
    color: #1e3d59;
}

.input-wallet {
    padding: 8px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.section-label-wallet {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #1e3d59;
    font-size: 12px;
}

.checkboxes-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkboxes-inner-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.font-size-12 {
    font-size: 12px;
}

/* Rozliczenia na dole portfela */
.finance-summary-layout {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.finance-column {
    flex: 1;
    min-width: 280px;
}

.balance-box {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eaeaea;
}

.finance-subtitle-blue {
    font-size: 13px;
    color: #1e3d59;
}

.finance-subtitle-orange {
    font-size: 13px;
    color: #ff6e40;
}