body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f6f9; margin: 0; color: #333; }
#app { max-width: 1200px; margin: 0 auto; padding: 20px; }
.screen { display: none; }
.screen.active { display: block; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin: 0 auto 20px auto; }
h1, h2, h3, h4, h5 { color: #2c3e50; }
input, select, textarea { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
input[type="file"] { border: none; padding: 5px 0; }
.btn { padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; text-align: center; }
.btn.primary { background: #3498db; color: white; }
.btn.primary:hover { background: #2980b9; }
.btn.secondary { background: #2ecc71; color: white; }
.btn.secondary:hover { background: #27ae60; }
.btn.small { padding: 5px 10px; font-size: 0.8em; }
.actions a { color: #3498db; text-decoration: none; font-size: 0.9em; }
header { display: flex; justify-content: space-between; align-items: center; background: white; padding: 15px 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.nav-container { display: flex; flex-wrap: wrap; gap: 5px; }
.nav-btn { background: transparent; color: #555; border: 1px solid #eee; }
.nav-btn:hover { background: #f1f1f1; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; padding: 20px; box-sizing: border-box; }
.modal-content { width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #ddd; text-align: left; }
th { background: #f8f9fa; }

/* V19 FIX: Checkboxy w filtrach */
input[type="checkbox"], input[type="radio"] { width: auto; margin-bottom: 0; display: inline-block; }
.filter-checkbox-label { display: flex; align-items: center; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; border-radius: 6px; transition: background 0.2s; }
.filter-checkbox-label:hover { background: #f1f2f6; }
.filter-checkbox-label input[type="checkbox"] { width: 18px; height: 18px; margin: 0 10px 0 0; cursor: pointer; flex-shrink: 0; }
.filter-checkbox-label span { font-size: 0.95em; color: #2c3e50; font-weight: normal; }

/* Drzewo katalogów - nowa wersja V18 z poprawkami mobilnymi V26 */
.tree-view ul { list-style: none; padding-left: 20px; margin: 0; }
.loc-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 6px; background: #fff; border: 1px solid #eaeaea; transition: all 0.2s ease; }
.loc-row:hover { background: #f8f9fa; border-color: #d1d8e0; box-shadow: 0 2px 5px rgba(0,0,0,0.04); }
.tree-toggle, .tree-toggle-all { cursor: pointer; color: #4b6584; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: #f1f2f6; border-radius: 4px; border: 1px solid #d1d8e0; user-select: none; transition: 0.2s; margin-right: 5px; flex-shrink:0; }
.tree-toggle:hover, .tree-toggle-all:hover { background: #dfe4ea; color: #2c3e50; border-color: #a5b1c2; }
.tree-spacer { width: 24px; margin-right: 5px; display: inline-block; flex-shrink:0; }

.loc-info { display: flex; align-items: center; flex: 1; overflow: hidden; min-width: 0; }
.loc-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.loc-name { font-weight: 600; cursor: pointer; color: #2c3e50; display:flex; align-items:center; font-size: 1.05em; transition: color 0.2s; user-select:none; overflow: hidden; flex: 1; min-width: 0; }
.loc-name:hover { color: #3498db; }
.loc-name small { color: #95a5a6; margin-left: 5px; font-weight: normal; flex-shrink: 0; }
.loc-actions { display: flex; gap: 5px; align-items: center; padding-left: 10px; flex-shrink: 0; }

.loc-add-btn, .loc-menu-btn { background: #f1f2f6; border: 1px solid #d1d8e0; border-radius:4px; cursor: pointer; font-size: 0.9em; padding: 4px 8px; transition: 0.2s; display:inline-flex; align-items:center; justify-content:center;}
.loc-add-btn:hover, .loc-menu-btn:hover { background: #dfe4ea; border-color:#a5b1c2;}
.tree-children { margin-top: 0; }

/* V26: Responsywność dla drzewa na urządzeniach mobilnych */
@media (max-width: 600px) {
    .loc-row { flex-direction: column; align-items: stretch; padding: 10px 8px; }
    .loc-actions { padding-left: 0; justify-content: flex-end; border-top: 1px dashed #eaeaea; padding-top: 8px; margin-top: 6px; }
    .loc-picker-row { flex-direction: row; align-items: center; padding: 6px 10px; }
}
