/* Plik: style.css - WERSJA OSTATECZNA I POPRAWNA */

/* --- Globalne Style --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #f0f2f5; color: #333; padding-top: 70px; }
a { color: #007bff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Górny Pasek Nawigacyjny (Header) --- */
.main-header { background-color: #fff; border-bottom: 1px solid #e7e7e7; position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.header-content { display: flex; justify-content: space-between; align-items: center; max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 70px; }
.logo { font-size: 1.5em; font-weight: bold; color: #333; text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 15px; }
.main-nav a { color: #555; font-weight: 500; padding: 10px 15px; border-radius: 6px; transition: background-color 0.2s, color 0.2s; }
.main-nav a:hover { background-color: #f0f2f5; color: #007bff; text-decoration: none; }
.main-nav a.logout-link { color: #dc3545; }
.main-nav a.logout-link:hover { background-color: #f8d7da; }
.mobile-menu-toggle { display: none; background: none; border: none; width: 30px; height: 22px; cursor: pointer; position: relative; }
.mobile-menu-toggle span, .mobile-menu-toggle span::before, .mobile-menu-toggle span::after { content: ''; position: absolute; left: 0; width: 100%; height: 3px; background-color: #333; border-radius: 2px; transition: all 0.3s; }
.mobile-menu-toggle span { top: 9px; }
.mobile-menu-toggle span::before { top: -9px; }
.mobile-menu-toggle span::after { top: 9px; }

/* --- Główny Kontener na Treść (dla podstron) --- */
.main-content { padding: 20px; }
.page-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.centered-layout { margin: 0 auto; }

/* ========================================================================= */
/* --- SEKCJA STYLÓW TYLKO I WYŁĄCZNIE DLA STRONY Z MAPĄ --- */
/* ========================================================================= */
body.map-view-body {
    padding-top: 0;
    overflow: hidden;
}
#map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
}
.map-view-body .main-header {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content h5 { margin: 0 0 5px; font-size: 1.1em; }
.leaflet-popup-content p { margin: 0; font-size: 0.9em; color: #555; }
/* ========================================================================= */

/* Pozostałe style (tabele, formularze, etc.) */
.header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:2rem;border-bottom:1px solid #eee;padding-bottom:1rem}.header h2{margin:0}.header .btn-primary{width:auto;padding:10px 20px}.table-container{overflow-x:auto;width:100%}table{width:100%;border-collapse:collapse}th,td{padding:12px 15px;text-align:left;border-bottom:1px solid #ddd;vertical-align:middle}thead{background-color:#f2f2f2;font-weight:600}tbody tr:hover{background-color:#f5f5f5}.action-btn{display:inline-block;padding:6px 12px;margin:2px;background-color:#007bff;color:#fff!important;border-radius:4px;text-decoration:none;font-size:.9em;transition:background-color .2s}.action-btn:hover{background-color:#0056b3;text-decoration:none}.action-btn.danger{background-color:#dc3545}.action-btn.danger:hover{background-color:#c82333}.summary-box{background-color:#f8f9fa;border:1px solid #e9ecef;border-radius:8px;padding:20px;margin:2rem 0}.summary-box h3{margin-top:0;border-bottom:1px solid #ddd;padding-bottom:10px}.summary-item{display:flex;justify-content:space-between;padding:8px 0;font-size:1.1em}.summary-item span{font-weight:600}.summary-profit{display:flex;justify-content:space-between;padding:12px 0;font-size:1.3em;font-weight:700;border-top:2px solid #ddd;margin-top:10px}.summary-profit.positive{color:#28a745}.summary-profit.negative{color:#dc3545}.details-grid{display:grid;grid-template-columns:2fr 1fr;gap:30px;margin-top:2rem}.grid-section{background-color:#f8f9fa;padding:20px;border-radius:8px;border:1px solid #e9ecef}.grid-section h3,.grid-section h4{margin-top:0;padding-bottom:10px;border-bottom:1px solid #ddd;margin-bottom:15px}.management-box{margin-bottom:2rem}.management-box:last-child{margin-bottom:0}

/* --- SEKCJA RESPONSIVE --- */
@media (max-width: 992px) {
    .details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 70px; left: 0; width: 100%; background-color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); flex-direction: column; align-items: stretch; padding: 10px; gap: 0; }
    .main-nav.is-open { display: flex; }
    .main-nav a { text-align: center; padding: 15px; border-bottom: 1px solid #f0f2f5; }
    .main-nav a:last-child { border-bottom: none; }
    thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr { margin-bottom: 1.5rem; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
    td { padding: 10px 5px; border: none; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; text-align: right; }
    td:last-child { border-bottom: none; }
    td::before { content: attr(data-label); font-weight: bold; text-align: left; padding-right: 1rem; }
    td[data-label="Akcje"] { display: flex; gap: 10px; }
    td[data-label="Akcje"] .action-btn { flex: 1; width: 100%; text-align: center; }
    .map-view-body .main-header { top: 10px; left: 10px; right: 10px; width: auto; transform: translateX(0); }
}
/* ========================================================================= *//* --- SEKCJA STYLÓW DLA STRONY Z HISTORIĄ TRAS (history.php) --- */
/* ========================================================================= */
.floating-panel {
    position: absolute;
    top: 90px; /* Pod "pływającym" headerem */
    left: 20px;
    z-index: 999; /* Nad mapą, ale pod headerem */
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 320px;
    max-width: 90%;
}
.floating-panel .form-group {
    margin-bottom: 1rem;
}
.floating-panel button {
    width: 100%;
}

/* Na małych ekranach panel zajmuje całą szerokość */
@media (max-width: 768px) {
    .floating-panel {
        left: 10px;
        right: 10px;
  z-index: 999; 
        width: auto; /* Szerokość 100% minus padding */
        max-width: none;
    }
}