:root {
    --primary-color: #4CAF50; --client-color: #2196F3; --danger-color: #ff4c4c;
    --bg-color: #f4f7f6; --card-bg: #ffffff; --text-color: #333; --border-color: #dcdde1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { font-family: 'Segoe UI', system-ui, sans-serif; background-color: var(--bg-color); margin: 0; padding: 10px; color: var(--text-color); overflow-x: hidden; -webkit-user-select: none; user-select: none; }
/* Ukrycie systemowego suwaka dla całej strony */
html, body {
    -ms-overflow-style: none;  /* IE oraz Edge */
    scrollbar-width: none;  /* Firefox */
}

html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge, Opera */
}
input, textarea, #fullEntryDescContent, .entry-item { -webkit-user-select: text; user-select: text; }

#mainLoginOverlay, #blockedScreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); display: flex; justify-content: center; align-items: center; z-index: 9999; flex-direction: column; padding: 20px; text-align: center;}
#appContent, #adminDashboard, #blockedScreen { display: none; }

#blockedScreen h1 { color: var(--danger-color); margin-bottom: 10px; font-size: 2em; }
#blockedScreen p { color: #666; font-size: 1.1em; max-width: 400px; }

.container { display: flex; gap: 20px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; align-items: stretch; }

/* --- GŁÓWNY BANER --- */
.main-banner { 
    position: relative; width: 100%; background-color: #1a1a1a; color: #ffffff; 
    text-align: center; padding: 8px 40px; border-radius: 16px; margin-bottom: 5px; 
    font-size: 1.5em; font-weight: bold; letter-spacing: 2px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; justify-content: center; align-items: center;
    min-height: 10px;
	margin-top: -40px;
}

#bannerTextTitle { text-transform: uppercase; max-width: 80%; line-height: 1.2; word-wrap: break-word; }

#backToDashBtn { position: absolute; left: 15px; background: #ff4c4c; color: white; border: none; padding: 8px 12px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 0.6em; display: none; }

/* --- PASKI I OGŁOSZENIA --- */
#subscriptionWarningBanner {
    background: #fff3e0; color: #d35400; padding: 12px 20px; border-radius: 12px; 
    border: 1px solid #fbd38d; margin-bottom: 15px; display: flex; justify-content: space-between; 
    align-items: center; font-weight: 600; font-size: 0.9em; width: 100%;
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.1); animation: slideDown 0.4s ease-out;
}
#subscriptionWarningBanner button {
    background: #d35400; color: white; border: none; padding: 8px 15px; 
    border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s;
}
#subscriptionWarningBanner button:hover { background: #e67e22; transform: translateY(-2px); }

.warning-trial { background: #eff6ff !important; color: #1e3a8a !important; border-color: #bfdbfe !important; }
.warning-trial button { background: #3b82f6 !important; }
.warning-trial button:hover { background: #2563eb !important; }

#announcementBanner { 
    display: none; background: #fff3e0; color: #e65100; padding: 12px; border-radius: 12px; 
    margin-bottom: 15px; text-align: center; font-weight: bold; border: 1px solid #ffe0b2; 
    width: 100%; font-size: 0.9em; box-shadow: 0 2px 8px rgba(230, 81, 0, 0.1); 
}

/* --- PANEL SZEFA --- */
.admin-dashboard-container { max-width: 1000px; margin: 20px auto; display: flex; flex-direction: column; gap: 20px; }
.admin-card { background: var(--card-bg); padding: 30px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.admin-grid { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.admin-col { flex: 1; min-width: 320px; }
.dash-btn { color: white; border: none; padding: 15px; border-radius: 10px; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: 0.2s; width: 100%; text-align: left; }
.dash-btn:hover { transform: scale(1.01); }
.delete-company-btn { position: absolute; top: -10px; right: -10px; background: #e74c3c; color: white; border: none; border-radius: 50%; width: 28px; height: 28px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 3px 6px rgba(0,0,0,0.3); transition: 0.2s; z-index: 10; font-size: 14px; padding: 0; }
.delete-company-btn:hover { transform: scale(1.15); background: #c0392b; }
.action-btn { padding: 8px 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; font-size: 0.8em; flex: 1; text-align: center; }
.add-company-box { background: #f9f9f9; border: 2px dashed #ccc; padding: 20px; border-radius: 15px; margin-bottom: 20px; }
.add-company-box input[type="text"], .add-company-box input[type="password"], .add-company-box textarea, .add-company-box select { margin-bottom: 10px; width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; resize: vertical; }
.premium-options-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.premium-option-label { display: flex; align-items: center; padding: 12px 15px; background: #ffffff; border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; transition: all 0.2s ease; font-size: 0.95em; color: #444; font-weight: 500; }
.premium-option-label:hover { border-color: var(--primary-color); background: #f0fdf4; }
.premium-option-label input[type="checkbox"] { margin: 0 15px 0 0 !important; width: 20px !important; height: 20px !important; cursor: pointer; accent-color: var(--primary-color); }
.profit-card { background: linear-gradient(135deg, var(--primary-color), #2ecc71); color: white; padding: 20px; border-radius: 15px; text-align: center; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); cursor: pointer; transition: transform 0.2s; }
.profit-card:hover { transform: scale(1.02); }

/* --- WYSZUKIWARKA I LISTA FIRM --- */
#searchCompanyInput:focus { border-color: var(--primary-color) !important; box-shadow: 0 0 8px rgba(76, 175, 80, 0.3); }
.company-scroll-container { max-height: 550px !important; overflow-y: auto !important; overflow-x: hidden !important; padding-right: 10px; scrollbar-width: thin; scrollbar-color: #bbb #f9f9f9; }
.company-scroll-container::-webkit-scrollbar { width: 8px; }
.company-scroll-container::-webkit-scrollbar-track { background: #f9f9f9; border-radius: 10px; }
.company-scroll-container::-webkit-scrollbar-thumb { background: #bbb; border-radius: 10px; }
.company-scroll-container::-webkit-scrollbar-thumb:hover { background: #888; }

/* --- KALENDARZ --- */
.calendar-section { flex: 1.5; min-width: 0; width: 100%; background: var(--card-bg); padding: 15px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.header h2 { font-size: 1.1em; text-transform: capitalize; margin: 0; flex-grow: 1; text-align: center; }
.header button { background: #fff; border: 1px solid var(--border-color); padding: 8px; border-radius: 8px; cursor: pointer; width: 40px; }
#workerCsvBtn { display:none; background:#00b894; color:white; font-weight:bold; font-size:0.8em; padding:8px 15px !important; width:auto !important; margin-left:10px; border: none; }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: bold; color: #888; margin-bottom: 8px; font-size: 0.75em; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); gap: 4px; width: 100%; margin-bottom: 20px; }
.day { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 6px; aspect-ratio: 1 / 1.1; padding: 4px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative;}
.day.empty { background: transparent; border: none; cursor: default; }
.day.today { border: 2px solid #ff9800; background: #fff3e0; }
.day.selected { border: 2px solid var(--primary-color); background: #f0fdf4; }
.day-number { font-weight: bold; font-size: 0.85em; }
.day-info { font-size: 0.65em; text-align: right; line-height: 1.1; word-break: break-all; }
.sum-label { color: var(--primary-color); font-weight: bold; display: block; }
.client-label { color: var(--client-color); font-weight: bold; }
.crown-icon { position: absolute; top: -5px; right: -5px; font-size: 1.3em; background: white; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3); padding: 2px; line-height: 1; z-index: 10; animation: pop 0.3s ease-out; }

/* --- PRAWY PANEL --- */
.right-column { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 20px; }
.panel-section { background: var(--card-bg); padding: 20px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
#entriesList { max-height: 220px; overflow-y: auto; padding-right: 5px; margin-bottom: 10px; transition: max-height 0.2s ease; }
#entriesList::-webkit-scrollbar { width: 4px; }
#entriesList::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
#entriesList::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.entry-item { background: #f8f9fa; padding: 10px; border-radius: 10px; margin-bottom: 8px; border-left: 5px solid #ccc; display: flex; justify-content: space-between; align-items: center; }
.entry-item.paid { border-left-color: var(--primary-color); }
.entry-item.unpaid { border-left-color: var(--client-color); background: #f0f7ff; }
.progress-container { margin-top: 15px; background: #e0e0e0; border-radius: 10px; height: 12px; overflow: hidden; position: relative; }
.progress-fill { background: linear-gradient(90deg, var(--primary-color), #81C784); height: 100%; width: 0%; transition: width 0.4s ease-out; }
.progress-fill.success { background: linear-gradient(90deg, #f39c12, #f1c40f); } 
.progress-text { font-size: 0.75em; color: #888; text-align: right; margin-top: 5px; font-weight: bold; }

input { width: 100%; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; }
.btn-add { width: 100%; padding: 14px; border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; margin-bottom: 8px; }
.btn-earning { background: var(--primary-color); }
.btn-client { background: var(--client-color); }
.btn-pay { background: var(--primary-color); color: white; border: none; padding: 6px 10px; border-radius: 5px; cursor: pointer; }

#adminStats { margin-top: auto; padding: 15px; background: #2d3436; color: white; border-radius: 12px; display: none; width: 100%; }
.stat-val { font-weight: bold; }
#fomoPanel { margin-top: auto; padding: 18px; background: #1a1a1a; border-radius: 12px; display: none; border: 1px solid #333; width: 100%; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.fomo-grid { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: center; overflow-x: auto; padding-bottom: 5px; margin-top: 10px; }
.fomo-grid::-webkit-scrollbar { height: 4px; }
.fomo-grid::-webkit-scrollbar-thumb { background: #555; border-radius: 10px; }
.fomo-item { background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 8px; font-size: 0.8em; color: #999; border: 1px solid #444; white-space: nowrap; flex-shrink: 0; }
.fomo-item b { color: #ccc; }

/* --- MODALE (OKIENKA) --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 2000; }
.modal { background: white; padding: 25px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: pop 0.25s ease-out; max-height: 90vh; overflow-y: auto; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-btn { padding: 12px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; flex: 1; margin-top: 10px; }
.btn-confirm { background: var(--primary-color); color: white; width: 100%; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-cancel { background: #eee; color: #666; }
.btn-premium-action { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; border: none; padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-premium-action:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4); }

#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999999; pointer-events: none; }
.toast { background: #333; color: white; padding: 10px 20px; border-radius: 30px; margin-bottom: 8px; animation: slideDown 0.3s, fadeOut 0.3s 2.5s; font-size: 0.85em; text-align: center; }
@keyframes slideDown { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }
.hidden { display: none; }

/* --- FLATPICKR --- */
.flatpickr-calendar.inline { box-shadow: none; border: 1px solid #eee; border-radius: 12px; margin: 0 auto; width: 100%; max-width: 340px; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: #00b894 !important; border-color: #00b894 !important; color: white !important;
}

#exportModal { align-items: flex-start; overflow-y: auto; padding: 40px 10px; }
.export-wrapper { display: flex; gap: 15px; margin: auto; max-width: 900px; justify-content: center; }
.export-wrapper .modal { width: 380px !important; max-width: 100%; margin: 0; display: flex; flex-direction: column; box-sizing: border-box; }

/* --- PANEL BOCZNY LOGOWANIA --- */
.main-login-sidebar { position: absolute; top: 0; left: 0; width: 350px; height: 100%; background: linear-gradient(135deg, #151515 0%, #2a2d34 100%); box-shadow: 4px 0 30px rgba(0,0,0,0.3); border-right: 1px solid #333; display: flex; justify-content: center; align-items: center; padding: 0 35px; z-index: 1;}
.sidebar-content-wrapper { width: 100%; display: flex; flex-direction: column; gap: 25px; }
.sidebar-brand { color: #fff; font-size: 1.8em; margin: 0 0 10px 0; line-height: 1.2; font-weight: 900; }
.sidebar-promo-text { color: #aaa; font-size: 0.9em; line-height: 1.5; margin: 0 0 10px 0; }
.sidebar-contact-group { display: flex; flex-direction: column; gap: 5px; }
.sidebar-label { font-size: 0.75em; color: #666; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; }
.sidebar-info { color: #ffffff; text-decoration: none; transition: color 0.2s ease, transform 0.2s ease; transform-origin: left; }
.sidebar-info:hover { color: var(--primary-color); transform: scale(1.02); }
.sidebar-phone { font-size: 2.1em; font-weight: 900; letter-spacing: 1px; white-space: nowrap; }
.sidebar-email { font-size: 1.05em; color: #ccc; font-weight: 500; line-height: 1.3; }
.sidebar-ig-btn { display: inline-block; background: rgba(76, 175, 80, 0.15); color: var(--primary-color); padding: 12px 20px; border-radius: 12px; font-weight: bold; text-decoration: none; transition: all 0.2s; text-align: center; border: 1px solid rgba(76, 175, 80, 0.3); }
.sidebar-ig-btn:hover { background: var(--primary-color); color: #fff; transform: translateY(-3px); box-shadow: 0 8px 15px rgba(76, 175, 80, 0.3); }
.sidebar-footer-note { margin-top: 30px; font-size: 0.75em; color: #555; text-align: left; border-top: 1px solid #333; padding-top: 15px; }

/* --- NOWY WYGLĄD SKLEPU (MODAL ZAKUPU PREMIUM) --- */
.store-modal { 
    position: relative; padding: 0 !important; max-width: 850px !important; width: 95%; 
    background: #f8fafc !important; 
    border-radius: 20px !important; 
    max-height: 96vh; 
    display: flex; flex-direction: column; 
    overflow: hidden !important; 
}

.close-modal-x { position: absolute; top: 12px; right: 20px; font-size: 28px; color: rgba(255,255,255,0.7); background: transparent; border: none; cursor: pointer; transition: 0.2s; font-weight: bold; z-index: 10; line-height: 1; padding: 0; }
.close-modal-x:hover { color: #ff4c4c; transform: scale(1.15); }

.store-title { background: linear-gradient(135deg, #0f172a, #1e293b); color: white; margin: 0 !important; padding: 15px 30px; font-size: 1.5em; text-align: center; letter-spacing: 1px; border-bottom: 3px solid var(--primary-color); flex-shrink: 0; }

.split-modal-container { 
    display: flex; gap: 15px; text-align: left; padding: 20px; 
    align-items: stretch; flex-wrap: wrap; overflow-y: auto; flex-grow: 1; 
}
.split-left, .split-right { flex: 1; min-width: 250px; background: white; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); padding: 20px; display: flex; flex-direction: column; border: 1px solid #e2e8f0; }
.store-modal h4 { 
    color: #334155; border-bottom: 2px solid #f1f5f9; padding-bottom: 8px; 
    font-size: 1.1em; text-transform: uppercase; margin-bottom: 10px; margin-top: 0; font-weight: 800; 
}

/* Pola tekstowe: mniejszy padding i własny, mniejszy margines na dole */
.store-inputs input { 
    background: #f8fafc; border: 1px solid #cbd5e1; transition: 0.2s; 
    font-size: 1em; padding: 10px 12px; margin-bottom: 8px; 
}
.store-inputs input:focus { border-color: var(--client-color); background: white; box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15); outline: none; }

.store-base-price { margin-top: auto; background: linear-gradient(135deg, #2196F3, #1976D2); color: white; padding: 15px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 1.1em; box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3); }
.store-base-price strong { font-size: 1.3em; }
.store-base-price small { font-size: 0.6em; opacity: 0.8; }

.store-upgrade-info { background: #eff6ff; border: 1px solid #bfdbfe; padding: 15px; border-radius: 12px; text-align: center; }
.store-upgrade-info p { margin: 0 0 5px 0; color: #64748b; font-size: 0.9em; }
.store-upgrade-info strong { color: #1d4ed8; font-size: 1.2em; text-transform: uppercase; }

/* SUWAK TYLKO DLA DODATKÓW */
.store-addons { 
    display: flex; flex-direction: column; gap: 6px; 
    max-height: 190px; 
    overflow-y: auto; padding-right: 5px; 
}
.store-addons::-webkit-scrollbar { width: 6px; }
.store-addons::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 8px; }
.store-addons::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.store-addons::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.store-modal .premium-option-label { 
    background: #fff; border: 2px solid #e2e8f0; padding: 8px 12px; margin: 0; 
    border-radius: 10px; display: flex; align-items: center; justify-content: space-between; 
    cursor: pointer; transition: all 0.2s ease; 
}
.store-modal .premium-option-label:hover { border-color: #94a3b8; transform: translateX(2px); }
.store-modal .premium-option-label:has(input:checked) { border-color: #10b981; background: #f0fdf4; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1); }
.store-modal .premium-option-label input[type="checkbox"] { margin: 0 12px 0 0 !important; width: 20px !important; height: 20px !important; accent-color: #10b981; cursor: pointer; }
.addon-name { 
    flex-grow: 1; 
    font-weight: 600; 
    color: #475569; 
    font-size: 0.9em; 
    margin-right: 10px; 
    line-height: 1.3; 
}

.addon-price { 
    background: #f1f5f9; 
    padding: 4px 8px; 
    border-radius: 6px; 
    font-size: 0.85em; 
    font-weight: bold; 
    color: #64748b; 
    transition: 0.2s; 
    white-space: nowrap; 
    flex-shrink: 0; 
}
.store-modal .premium-option-label:has(input:checked) .addon-price { background: #d1fae5; color: #059669; }
.addon-featured { border-color: #cbd5e1; }
.addon-featured .addon-price { background: #e0e7ff; color: #2563eb; }

.store-total { margin-top: auto; background: #0f172a; color: white; padding: 15px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 8px 20px rgba(15,23,42,0.3); }
.store-total > span { font-size: 1em; color: #94a3b8; font-weight: 600; }
.store-total-price { font-size: 1.6em; font-weight: 900; color: #10b981; }
.store-total-price small { font-size: 0.5em; color: #64748b; font-weight: normal;}

/* PRZYCISK ZAWSZE NA DOLE */
.store-actions { padding: 8px 25px; background: #f1f5f9; border-top: 1px solid #e2e8f0; display: flex; justify-content: center; flex-shrink: 0; }
.btn-stripe-checkout { 
    background: linear-gradient(135deg, var(--primary-color), #27ae60); 
    color: white; font-size: 1.05em; font-weight: 900; padding: 12px 25px; 
    border-radius: 50px; 
    border: none; cursor: pointer; 
    width: 100%; max-width: 350px; 
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.3); transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px;
}
.btn-stripe-checkout:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4); }

/* --- REGULAMIN MODAL NOWY WYGLĄD --- */
.terms-scroll-box {
    max-height: 200px; /* Okno zajmuje mniej miejsca na ekranie */
    overflow-y: auto;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.85em;
    color: #475569;
    margin-bottom: 15px;
    line-height: 1.5;
    padding-right: 15px;
}
.terms-scroll-box h4 { color: #1e293b; }
.terms-scroll-box::-webkit-scrollbar { width: 6px; }
.terms-scroll-box::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 8px; }
.terms-scroll-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.terms-scroll-box::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.terms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-size: 0.85em;
    margin-bottom: 20px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 2px solid #e2e8f0;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.2s ease;
}
.terms-checkbox-label:hover { border-color: #94a3b8; transform: translateY(-1px); }
.terms-checkbox-label:has(input:checked) { border-color: var(--primary-color); background: #f0fdf4; box-shadow: 0 4px 10px rgba(76, 175, 80, 0.1); }
.terms-checkbox-label input { width: 22px !important; height: 22px !important; margin: 0 !important; accent-color: var(--primary-color); flex-shrink: 0; cursor: pointer; }

/* --- UKRYWANIE SYSTEMOWYCH PASKÓW PRZEWIJANIA (W OKNACH) --- */
.modal, .split-modal-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE i Edge */
}
.modal::-webkit-scrollbar, .split-modal-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* DOMYŚLNIE UKRYTE PASKI MOBILNE (PC) */
.mobile-top-bar, .mobile-bottom-bar { 
    display: none !important; 
}

/* --- PRZYCISK BACKUPU --- */
.btn-backup {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.85em;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-backup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-backup:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    background: linear-gradient(135deg, #219653, #27ae60);
}

/* --- PWA INSTALL BUTTON (PULSUJĄCY WYGLĄD PREMIUM) --- */
.pwa-install-btn {
    display: none; /* Ukryty domyślnie, pokaże go JS */
    position: fixed;
    bottom: 40px; 
    left: 51%;
	transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), #27ae60); /* Soczysty zielony gradient */
    color: white;
    border: 2px solid #ffffff; /* Biała, elegancka ramka */
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 900;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.5); /* Mocny, zielony cień */
    z-index: 100001;
    font-size: 1.05em;
    cursor: pointer;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pwa-install-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* --- RESPONSYWNOŚĆ TELEFONY --- */
@media (max-width: 768px) { 
    .main-login-sidebar { display: none !important; }
    
    /* Dodajemy padding góra/dół żeby modale nie chowały się pod paskami */
    #mainLoginOverlay { padding: 60px 10px 50px 10px !important; overflow-y: auto; }

    /* Paski mobilne na ekranie logowania */
    .mobile-top-bar {
        display: block !important;
        position: fixed;
        top: 0; left: 0; width: 100%;
        background: #151515;
        color: white;
        text-align: center;
        padding: 12px 0;
        font-size: 1.2em;
        font-weight: 900;
        border-bottom: 2px solid var(--primary-color);
        z-index: 10000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    
    .mobile-bottom-bar {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; width: 100%;
        background: #151515;
        padding: 8px 5px;
        justify-content: center;
        gap: 15px;
        align-items: center;
        z-index: 10000;
        border-top: 1px solid #333;
        flex-wrap: wrap; /* Gdyby ekran był baaaardzo wąski */
    }
    .mobile-bottom-bar a {
        color: #ccc;
        text-decoration: none;
        font-size: 0.75em;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .mobile-bottom-bar a:hover { color: var(--primary-color); }

    .container { flex-direction: column; padding: 5px; } 

    .main-banner { 
        padding: 12px 10px; 
        font-size: 1.1em; 
        min-height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #bannerTextTitle { font-size: 1em; max-width: 70%; line-height: 1.2; word-wrap: break-word; }

    .calendar-section { padding: 10px; width: 100%; flex: none; } 
    .days { gap: 2px; }
    .day { min-height: 50px; }
    .day-number { font-size: 0.7em; }
    .day-info { font-size: 0.55em; }

    .right-column { width: 100%; min-width: 0; }
    
    #adminStats > div { justify-content: center; gap: 5px; }
    #adminStats div[id^="stat"] { padding: 4px 8px; font-size: 0.8em; }

    .export-wrapper { flex-direction: column; align-items: center; width: 100%; }
    .export-wrapper .modal { width: 100% !important; max-width: 400px; margin-bottom: 15px; }
    .flatpickr-calendar.inline { max-width: 100%; }

    .split-modal-container { 
        flex-direction: column !important; 
        flex-wrap: nowrap !important;
        padding: 15px !important; 
    }
    
    .terms-scroll-box { max-height: 25vh; padding: 10px; font-size: 0.75em; margin-bottom: 10px; }
    .terms-checkbox-label { align-items: flex-start; font-size: 0.75em; padding: 10px; margin-bottom: 10px; }

    /* =========================================================================
       POPRAWKI DLA NOWEGO OKNA (SŁOWNIK + FORMULARZ) NA TELEFONIE
       ========================================================================= */
    #advancedEntryModal .modal {
        max-height: 96vh !important; /* Prawie cały ekran na wysokość */
        display: flex;
        flex-direction: column;
        padding: 0 !important; /* Usuwamy padding zew., zawartość i tak ma własny */
    }
    
    /* Środkowa sekcja: Słownik + Formularz -> Musi dać się przewijać (scroll) */
    #advancedEntryModal > div > div:nth-child(2) {
        padding: 15px !important;
        gap: 15px !important;
        overflow-y: auto !important; /* KLUCZOWE - płynne przewijanie na telefonie! */
        flex-wrap: nowrap !important;
        flex-direction: column !important; /* Wymusza jedno pod drugim */
        flex: 1; /* Wypełnia całą dostępną wolną przestrzeń */
    }

    /* Kafelki Słownika i Formularza */
    #advancedEntryModal > div > div:nth-child(2) > div {
        min-width: 100% !important; /* Na 100% szerokości ekranu telefonu */
        padding: 15px !important;
    }

    /* Lista Słownika - Zabezpieczenie przed nieskończonym wydłużaniem */
    #customServicesList {
        height: auto !important;
        max-height: 180px !important; 
    }

    /* Wyszukiwarka w słowniku */
    #serviceSearchInput {
        max-width: 130px !important;
        margin-top: 0 !important;
    }

    /* Dolny pasek z trzema przyciskami zapisu */
    #advancedEntryModal > div > div:last-child {
        padding: 15px !important;
        justify-content: center !important;
        background: #fff;
        z-index: 10; /* Zapobiega znikaniu pod formularzem */
    }

    /* Ułożenie przycisków na dole (Wpisz do pola na 100%, Oczekuje/Rozliczone po 50%) */
    #advancedEntryModal > div > div:last-child button {
        min-width: 45% !important; 
        font-size: 0.85em;
        padding: 12px 10px !important;
    }
    /* ========================================================================= */
}

/* --- DUŻE EKRANY --- */
@media (min-width: 769px) {
    #mainLoginOverlay { 
        /* Padding z obu stron wypycha formularz idealnie na środek wolnego miejsca */
        padding-left: 350px; /* Szerokość lewego panelu */
        padding-right: 320px; /* Szerokość panelu "Zaufali nam" */
        align-items: center;  /* Zmiana z flex-start na center dla pionowego wyśrodkowania */
        justify-content: center; 
    }
    .main-login-sidebar { display: flex !important; }
}

/* Zabezpieczenie dla średnich ekranów (między 769px a 1200px), gdy znika prawy panel */
@media (min-width: 769px) and (max-width: 1200px) {
    #mainLoginOverlay {
        padding-right: 0px; 
    }
}

/* --- MAŁE TELEFONY --- */
@media (max-width: 400px) {
    .weekdays div { font-size: 0.6em; }
    .main-banner { font-size: 1em; }
}

/* ==========================================================================
   PANEL: ZAUFALI NAM (Siatka logotypów - Desktop)
   ========================================================================== */
.trusted-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Układamy od samej góry! */
    align-items: center;
    padding: 60px 30px; /* Margines górny, żeby nie przyklejało się do krawędzi okna */
    background: linear-gradient(to left, rgba(0,0,0,0.02), transparent);
    border-left: 1px dashed rgba(0,0,0,0.1);
    z-index: 5;
    overflow-y: auto; /* Jeśli dodasz 100 firm, panel będzie można scrollować */
}

/* Ukrywamy scrollbar w panelu bocznym dla czystego wyglądu */
.trusted-sidebar::-webkit-scrollbar { width: 0px; }

.trusted-title {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #94a3b8;
    margin-bottom: 30px;
    font-weight: 800;
    text-align: center;
    width: 100%;
}

.trusted-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Dokładnie 3 kwadraciki w jednym rzędzie */
    gap: 15px; /* Odstęp między kwadracikami */
    width: 100%;
}

.trusted-square {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    aspect-ratio: 1 / 1; /* Wymusza idealny kwadrat bez względu na rozdzielczość */
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.trusted-square:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-color); 
}

/* Ustawienia dla emotek */
.trusted-emoji {
    font-size: 2.2em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Ustawienia dla prawdziwych obrazków (np. PNG z logiem) */
.trusted-logo-img {
    width: 80%;
    height: 80%;
    object-fit: contain; /* Obrazek dopasuje się do środka bez zniekształceń */
}

/* Ukrywanie na mniejszych ekranach */
@media (max-width: 1200px) {
    .trusted-sidebar {
        display: none !important;
    }
}

/* ========================================= */
/* 🔍 WIDŻET WYSZUKIWARKI KLIENTÓW (CRM)     */
/* ========================================= */
.client-search-widget {
    flex: 1;
    min-width: 300px;
    height: 550px; /* 👈 STAŁA WYSOKOŚĆ KAFELKA */
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
	text-align: left; 
}

.search-header { border-bottom: 2px solid #f1f5f9; padding-bottom: 12px; margin-bottom: 16px; }
.search-header h3 { margin: 0; color: #1e293b; font-size: 1.2em; display: flex; align-items: center; gap: 8px; }

.search-input-group { display: flex; gap: 10px; margin-bottom: 16px; position: relative; }
.search-input { flex: 1; padding: 12px 16px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 0.95em; transition: 0.2s; outline: none; margin-bottom: 0 !important; }
.search-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15); }
.search-btn { padding: 12px 20px !important; border-radius: 10px !important; font-weight: bold; margin: 0 !important; width: auto !important; }

.search-results-container { 
    flex: 1; /* 👈 KAŻE WYNIKOM ZAJĄĆ RESZTĘ MIEJSCA W KAFELKU */
    overflow-y: auto; /* 👈 POKAZUJE SUWAK TYLKO W ŚRODKU KAFELKA */
    padding-right: 8px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.search-results-container::-webkit-scrollbar { width: 6px; }
.search-results-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.result-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; transition: 0.2s; }
.result-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); transform: translateY(-2px); }

.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-date { font-weight: 700; color: #334155; font-size: 0.95em; }

.result-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-paid { background: #dcfce7; color: #16a34a; }
.badge-unpaid { background: #fee2e2; color: #ef4444; }

.result-desc { font-size: 0.95em; color: #475569; margin-bottom: 12px; line-height: 1.5; font-weight: 500; }
.result-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed #cbd5e1; padding-top: 12px; }

.result-actions { display: flex; gap: 8px; align-items: center; }
.action-icon { background: #eff6ff; color: #3b82f6; width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: 0.2s; border: 1px solid #bfdbfe; }
.action-icon:hover { background: #3b82f6; color: white; transform: scale(1.05); }

.result-amount { font-size: 1.15em; font-weight: 800; }

.summary-banner { background: linear-gradient(135deg, #eff6ff, #e0e7ff); border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.summary-stat { display: flex; flex-direction: column; }
.summary-label { font-size: 0.75em; color: #64748b; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.summary-val { font-size: 1.3em; font-weight: 800; color: #1e3a8a; }

/* ==========================================================================
   POPRAWKI POZYCJI PRZYCISKU PWA (Brak luki w pobranej aplikacji!)
   ========================================================================== */

/* KOMPUTERY: Przycisk wraca na środek! */
@media (min-width: 769px) {
    .pwa-install-btn {
        left: 51% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        bottom: 40px !important;
    }

    /* Robimy miejsce w oknie "Moje Konto" na komputerze, żeby wyśrodkowany przycisk go nie zasłaniał */
    body.has-pwa-btn #accountModal .modal {
        padding-bottom: 90px !important;
    }
}

/* TELEFONY: Dodajemy przestrzeń w ŚRODKU modala (padding-bottom) TYLKO, gdy 
   przycisk PWA jest widoczny. Dzięki temu możesz przewinąć zawartość 
   i kliknąć "Wyloguj" tuż nad zielonym przyciskiem. Gdy zainstalujesz apkę, luka zniknie. */
@media (max-width: 768px) {
    body.has-pwa-btn #accountModal .modal,
    body.has-pwa-btn #loginFormBlock {
        padding-bottom: 50px !important;
    }
}

@media (max-width: 768px) {
	/* Wyrównanie pól kalkulatora do lewej na telefonach */
    #calcHeaderControls {
        justify-content: flex-start !important;
    }
    
    #calcHeaderControls > div {
        max-width: 100% !important; /* Pozwala polom zająć całą szerokość, jeśli ułożą się jedno pod drugim */
    }

	/* Kalkulator - Formularz dodawania na 100% szerokości na telefonie */
    #calcManageArea {
        max-width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 10px !important;
    }
}

/* ==========================================================================
   WYSUWANY PANEL BOCZNY (SIDEBAR)
   ========================================================================== */

/* Przycisk Hamburgera (zawsze w lewym górnym rogu) */
.hamburger-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: #1a1a1a;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    font-size: 22px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hamburger-btn:hover { 
    transform: scale(1.05); 
    background: var(--primary-color); 
}

/* Ciemne tło przykrywające kalendarz */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px);
    z-index: 100000; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* Boczny panel Drawer */
.side-menu {
    position: fixed; top: 0; left: -320px; width: 300px; height: 100vh;
    background: #f8fafc; z-index: 100001; box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    transition: 0.3s ease-in-out; display: flex; flex-direction: column;
}
.side-menu.active { left: 0; }

/* Nagłówek Menu */
.side-menu-header {
    background: #1a1a1a; color: white; padding: 25px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.side-menu-header h3 { margin: 0; font-size: 1.1em; text-transform: uppercase; letter-spacing: 1px; color: #f1f5f9; }
.side-menu-header button {
    background: none; border: none; color: #94a3b8; font-size: 32px;
    cursor: pointer; line-height: 1; padding: 0; transition: 0.2s;
}
.side-menu-header button:hover { color: #ff4c4c; transform: scale(1.1); }

/* Przyciski wewnątrz Menu */
/* Zawartość menu z własnym scrollem */
.side-menu-content { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    overflow-y: auto; /* Pozwala na scrollowanie w środku */
    flex-grow: 1; /* Rozciąga pojemnik do samego dołu ekranu */
}

/* Własny, elegancki suwak dla menu (tylko dla estetyki) */
.side-menu-content::-webkit-scrollbar { width: 6px; }
.side-menu-content::-webkit-scrollbar-track { background: transparent; }
.side-menu-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Klasa blokująca scrollowanie tła */
body.no-scroll {
    overflow: hidden;
}
.side-menu-item {
    background: white; border: 1px solid #e2e8f0; padding: 16px; border-radius: 12px;
    display: flex; align-items: center; gap: 15px; font-size: 1.05em; font-weight: bold;
    color: #334155; cursor: pointer; transition: 0.2s; text-align: left; position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.side-menu-item:hover { background: #f1f5f9; border-color: #cbd5e1; transform: translateX(5px); }
.side-menu-item .icon { font-size: 1.3em; }

/* Kółko z licznikiem SMS */
.side-menu-item .badge {
    margin-left: auto; background: #f39c12; color: white; padding: 6px 12px;
    border-radius: 20px; font-size: 0.85em; font-weight: 900;
}

/* Responsywność dla telefonów - ukrywamy hamburgera gdy otwiera się modal logowania/rejestracji */
@media (max-width: 768px) {
    .hamburger-btn { top: 10px; left: 10px; width: 40px; height: 40px; font-size: 18px; }
    .side-menu { width: 280px; }
}

/* ==========================================================================
   AKORDEON MODUŁÓW W SIDEBARZE
   ========================================================================== */
.sidebar-modules-section {
    margin-top: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.modules-title {
    font-size: 0.8em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px 10px;
    font-weight: 800;
}

.module-accordion {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden; /* Kluczowe dla animacji zwijania */
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05em;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.accordion-header:hover { background: #f8fafc; }

/* Animacja strzałki */
.accordion-header .arrow {
    margin-left: auto;
    color: #94a3b8;
    transition: transform 0.3s ease;
}
.accordion-header.active .arrow { transform: rotate(180deg); color: var(--primary-color); }

/* Pudełko na treść z płynnym wysuwaniem */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f8fafc;
}

.accordion-content-inner {
    padding: 5px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px dashed #e2e8f0;
}

/* Wygląd samych checkboxów */
.module-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}
.module-checkbox:hover { color: var(--primary-color); }

.module-checkbox input[type="checkbox"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ==========================================================================
   KARTA ODBIORU POJAZDU - Kapsułki 
   ========================================================================== */
.car-part-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.car-part-chip:hover {
    background: #e2e8f0;
}

.car-part-chip input[type="checkbox"] {
    margin: 0;
    accent-color: #3b82f6;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Magia nowoczesnego CSS: Zmienia wygląd całego przycisku, gdy checkbox jest zaznaczony! */
.car-part-chip:has(input:checked) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   BAZA POWŁOK - Pulsująca dioda alarmowa
   ========================================================================== */
@keyframes alert-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   USTAWIENIA DLA GENERATORA PDF (Natywny mechanizm)
   ========================================================================== */
@media print {
    /* 1. Wymuszamy absolutnie śnieżnobiałe tło dla całej struktury dokumentu */
    html, body {
        background-color: #ffffff !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body > * {
        display: none !important;
    }
    
    #pdf-preview-overlay {
        display: block !important;
        position: absolute !important; 
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-color: #ffffff !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .no-print-bar {
        display: none !important;
    }
    
    #pdf-print-target {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: #ffffff !important;
    }

    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}