:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-2: #eef3eb;
  --text: #1c2a20;
  --muted: #6d7c71;
  --border: #dce6da;
  --primary: #2d6a3f;
  --primary-strong: #1f4d2e;
  --shadow: 0 18px 50px rgba(26, 57, 35, .09);
}

html[data-theme="dark"] {
  --bg: #111713;
  --surface: #18201b;
  --surface-2: #202a23;
  --text: #edf6ef;
  --muted: #a9b7ac;
  --border: #2c3930;
  --primary: #69b77c;
  --primary-strong: #8bd29b;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: #173d25;
  color: #fff;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 26px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  font-weight: 800;
}
.brand strong { display: block; font-size: 1.1rem; }
.brand small { display: block; margin-top: 3px; opacity: .7; }
.nav { display: grid; gap: 7px; }
.nav a {
  color: rgba(255,255,255,.78);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.13); }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; padding: 12px 8px 2px; }
.sidebar-footer button {
  border: 1px solid rgba(255,255,255,.2);
  background: transparent;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.sidebar-footer span { font-size: .8rem; opacity: .6; }

.main { margin-left: 270px; padding: 36px; max-width: 1700px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { margin-bottom: 0; }
.eyebrow { margin-bottom: 6px; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.subtitle { margin-bottom: 0; color: var(--muted); }
.header-actions { display: flex; gap: 10px; }
.button { border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 700; }
.button-primary { background: var(--primary); color: white; }
.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-card { border-radius: 18px; padding: 20px; }
.stat-card span { display: block; color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 2rem; }
.panel { border-radius: 22px; padding: 22px; margin-bottom: 22px; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search {
  width: min(760px, 100%);
  display: block;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.tree-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tree-card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.tree-image-placeholder { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); font-size: 2rem; font-weight: 900; }
.tree-card-body { padding: 14px; display: grid; gap: 4px; }
.tree-card-body span { color: var(--muted); font-size: .9rem; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 24px; background: var(--surface-2); color: var(--primary); font-weight: 900; }

@media (max-width: 1150px) {
  .stats-grid, .tree-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; min-height: auto; }
  .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; padding: 20px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .stats-grid, .tree-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .stats-grid, .tree-grid { grid-template-columns: 1fr; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
}

/* Sprint 1.2 – Sortenverwaltung */
.page-header-actions { align-items: flex-start; }
.lead { color: var(--muted); margin-bottom: 0; max-width: 760px; line-height: 1.6; }
.header-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.button-small { padding: 8px 11px; border-radius: 10px; font-size: .86rem; }
.button-danger { background: #b42318; color: #fff; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.alert { border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; font-weight: 700; }
.alert-success { background: #e9f8ef; color: #176b3a; border: 1px solid #b9e7c9; }
.alert-error { background: #fff0ee; color: #9b251c; border: 1px solid #f3c4bd; }
[data-theme="dark"] .alert-success { background: #173827; color: #b8ebca; border-color: #286244; }
[data-theme="dark"] .alert-error { background: #3e1d1a; color: #ffc2bb; border-color: #73342d; }
.search-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.search-row input { width: min(720px, 100%); padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--text); font: inherit; }
.search-row input:focus, .form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 22px 22px 0; }
.table-panel .panel-heading p { margin: 5px 0 0; color: var(--muted); }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-top: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.table-link { color: var(--primary); font-weight: 800; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.table-actions { white-space: nowrap; }
.table-actions .button + .button { margin-left: 5px; }
.form-card { max-width: 980px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.form-field { display: grid; gap: 8px; }
.form-field-wide { grid-column: span 1; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { font-weight: 800; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 13px; padding: 13px 14px; background: var(--surface-2); color: var(--text); font: inherit; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; }
.info-label { display: block; color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.info-card strong { font-size: 1.12rem; }
.detail-description { max-width: 1100px; }
.preserve-lines { white-space: pre-wrap; line-height: 1.7; margin-bottom: 0; }
.muted { color: var(--muted); }
.danger-zone { max-width: 1100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: color-mix(in srgb, #b42318 35%, var(--border)); }
.danger-zone h2 { margin-bottom: 6px; }
.danger-zone p { margin-bottom: 0; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-field-wide, .form-field-full { grid-column: 1; }
  .form-actions, .danger-zone { align-items: stretch; flex-direction: column; }
  .form-actions .button, .danger-zone .button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-buttons { width: 100%; }
  .header-buttons .button { flex: 1; }
  .search-row input { width: 100%; }
}

/* Sprint 1.3 – Baumverwaltung */
select { font: inherit; }
.form-field select, .filter-row select {
  width: 100%; border: 1px solid var(--border); border-radius: 13px;
  padding: 13px 14px; background: var(--surface-2); color: var(--text);
}
.form-field select:focus, .filter-row select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.filter-row { display: grid; grid-template-columns: minmax(280px, 1fr) 220px auto auto; gap: 10px; align-items: center; }
.filter-row input { width: 100%; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--text); font: inherit; }
.form-card-wide { max-width: 1180px; }
.form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-hint { color: var(--muted); line-height: 1.4; }
.status-pill { display: inline-flex; align-items: center; min-width: 54px; justify-content: center; padding: 5px 9px; border-radius: 999px; font-weight: 800; font-size: .82rem; }
.status-0 { background: var(--surface-2); color: var(--muted); }
.status-1 { background: #e7f5ec; color: #246a3b; }
.status-2 { background: #d6f0df; color: #174d2a; }
[data-theme="dark"] .status-1 { background: #244533; color: #c5efd2; }
[data-theme="dark"] .status-2 { background: #285b3b; color: #dcf8e4; }
.tree-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info-card small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.4; }
.accent-card { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.inline-link { display: inline-block; margin-top: 8px; color: var(--primary); font-weight: 750; text-decoration: none; font-size: .9rem; }
.inline-link:hover { text-decoration: underline; }
.tree-card-link { color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.tree-card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
@media (max-width: 1050px) {
  .form-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: 1fr 210px; }
  .filter-row .button { width: 100%; }
  .tree-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .form-grid-three, .filter-row, .tree-detail-grid { grid-template-columns: 1fr; }
}

/* Sprint 1.4 – Fotoverwaltung */
.tree-card-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--surface-2); }
.photo-upload-panel, .gallery-panel { max-width: 1200px; }
.photo-upload-form { display: grid; gap: 14px; }
.photo-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-choice {
  min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 20px; border: 2px dashed var(--border); border-radius: 18px;
  background: var(--surface-2); cursor: pointer; text-align: center; transition: .16s ease;
}
.upload-choice:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface-2)); transform: translateY(-1px); }
.upload-choice:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.upload-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-choice-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--surface); color: var(--primary); font-size: 1.45rem; box-shadow: var(--shadow); }
.upload-choice small { color: var(--muted); line-height: 1.4; }
.photo-selection { min-height: 24px; text-align: center; }
.photo-actions { margin-top: 0; }
.photo-count { align-self: flex-start; padding: 7px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: .84rem; }
.photo-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.photo-tile { overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.photo-open { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: var(--surface-2); }
.photo-open img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .2s ease; }
.photo-open:hover img { transform: scale(1.025); }
.photo-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; }
.photo-meta strong, .photo-meta small { display: block; }
.photo-meta small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.icon-danger { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #fff0ee; color: #a92920; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.icon-danger:hover { background: #b42318; color: white; }
[data-theme="dark"] .icon-danger { background: #3e1d1a; color: #ffc2bb; }
.compact-empty { padding: 28px 20px; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 28px; background: rgba(6, 14, 10, .92); backdrop-filter: blur(5px); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 94vw); max-height: 92vh; display: grid; gap: 12px; justify-items: center; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.48); }
.lightbox figcaption { color: #fff; font-weight: 700; text-align: center; }
.lightbox-close { position: fixed; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.35); color: #fff; font-size: 1.9rem; cursor: pointer; }
@media (max-width: 1000px) { .photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .photo-input-grid { grid-template-columns: 1fr; } .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .photo-gallery { grid-template-columns: 1fr; } .lightbox { padding: 12px; } }

/* Sprint 1.5 – Dashboard */
.dashboard-header { margin-bottom: 22px; }
.stat-link { color: inherit; text-decoration: none; transition: transform .16s ease, border-color .16s ease; }
.stat-link:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.stat-card small { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.dashboard-insights { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin: -6px 0 22px; }
.mini-insight { min-height: 88px; display: flex; flex-direction: column; justify-content: center; padding: 17px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.mini-insight span { color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.mini-insight strong { margin-top: 5px; font-size: 1.3rem; }
.mini-insight a { display: flex; align-items: baseline; gap: 10px; color: var(--text); text-decoration: none; }
.mini-insight a:hover strong { color: var(--primary); }
.mini-insight small { color: var(--muted); }
.dashboard-search-panel { max-width: none; }
.dashboard-panel-heading { align-items: center; }
.dashboard-panel-heading p { margin: 5px 0 0; }
.dashboard-filter { display: grid; grid-template-columns: minmax(300px, 1fr) 220px 190px auto auto; gap: 10px; margin-bottom: 20px; }
.dashboard-filter input, .dashboard-filter select { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; }
.dashboard-filter input:focus, .dashboard-filter select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.dashboard-tree-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-tree-card { min-width: 0; }
.tree-card-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tree-card-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; }
.pagination span { color: var(--muted); font-weight: 750; }
.dashboard-photo-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.dashboard-photo { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.dashboard-photo img { width: 100%; aspect-ratio: 1/1; display: block; object-fit: cover; }
.dashboard-photo span, .dashboard-photo small { display: block; padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-photo span { padding-top: 8px; font-weight: 800; font-size: .82rem; }
.dashboard-photo small { padding-top: 2px; padding-bottom: 9px; color: var(--muted); font-size: .72rem; }
.dashboard-photo:hover { border-color: var(--primary); }
@media (max-width: 1300px) { .dashboard-filter { grid-template-columns: minmax(260px, 1fr) 200px 180px; } .dashboard-filter .button { width: 100%; } .dashboard-photo-strip { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 1150px) { .dashboard-tree-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 850px) { .dashboard-insights { grid-template-columns: repeat(2, minmax(0,1fr)); } .mini-insight-wide { grid-column: 1 / -1; } .dashboard-filter { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .dashboard-insights, .dashboard-filter { grid-template-columns: 1fr; } .mini-insight-wide { grid-column: auto; } .dashboard-tree-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .dashboard-photo-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } .pagination { flex-wrap: wrap; } }
@media (max-width: 420px) { .dashboard-tree-grid { grid-template-columns: 1fr; } }


/* Sprint 2.1 – Grundstücksverwaltung */
.centered-search-panel { display:flex; justify-content:center; }
.property-search { width:min(900px,100%); display:flex; gap:10px; }
.property-search input { flex:1; min-width:220px; padding:13px 15px; border:1px solid var(--border); border-radius:13px; background:var(--surface-2); color:var(--text); font:inherit; }
.property-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.property-card { display:grid; grid-template-columns:auto 1fr; gap:14px; padding:20px; border:1px solid var(--border); border-radius:18px; background:var(--surface); color:var(--text); text-decoration:none; box-shadow:0 8px 24px rgba(20,50,30,.04); transition:.16s ease; }
.property-card:hover { transform:translateY(-3px); border-color:var(--primary); box-shadow:var(--shadow); }
.property-card h2 { margin:0 0 5px; font-size:1.18rem; }
.property-card p { margin:0; color:var(--muted); }
.property-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; background:color-mix(in srgb,var(--primary) 12%,var(--surface-2)); color:var(--primary); font-size:1.5rem; }
.property-metrics { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding-top:12px; border-top:1px solid var(--border); }
.property-metrics span { color:var(--muted); font-size:.75rem; text-align:center; }
.property-metrics strong { display:block; color:var(--text); font-size:1.15rem; }
.property-detail-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
.two-column-panels { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.filter-row:has(#property_id) { grid-template-columns:minmax(260px,1fr) 190px 220px auto auto; }
@media(max-width:1150px){.property-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.property-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.filter-row:has(#property_id){grid-template-columns:1fr 1fr}}
@media(max-width:700px){.property-grid,.property-detail-grid,.two-column-panels{grid-template-columns:1fr}.property-search{flex-direction:column}.filter-row:has(#property_id){grid-template-columns:1fr}}

/* Sprint 2.2 – Karten */
.map-large{height:68vh;min-height:520px;border-radius:18px;overflow:hidden;border:1px solid var(--border)}
.map-picker{height:420px;border-radius:16px;overflow:hidden;border:1px solid var(--border)}
.map-detail{height:380px;border-radius:16px;overflow:hidden;border:1px solid var(--border)}
.coordinate-row{display:grid;grid-template-columns:1fr 1fr auto auto;gap:10px;margin-top:12px;align-items:center}
.map-hint{margin:.8rem 0 0;color:var(--muted)}
.map-filter-panel{padding:14px 18px}.filter-bar{display:flex;gap:12px;align-items:center;justify-content:center}.filter-bar select{min-width:260px}
@media(max-width:850px){.coordinate-row{grid-template-columns:1fr 1fr}.map-large{height:60vh;min-height:420px}.map-picker{height:280px}}

/* Sprint 2.3 – Galerie und Stecklinge */
.gallery-filter { grid-template-columns: minmax(280px, 1fr) 180px auto auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.gallery-card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.gallery-open { width: 100%; border: 0; padding: 0; background: var(--surface-2); cursor: zoom-in; display: block; }
.gallery-open img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .2s ease; }
.gallery-open:hover img { transform: scale(1.025); }
.gallery-meta { display: grid; gap: 4px; padding: 13px; }
.gallery-meta span, .gallery-meta small { color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 48px 24px 78px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 95vw); max-height: 80vh; object-fit: contain; border-radius: 12px; box-shadow: 0 22px 80px rgba(0,0,0,.45); }
.lightbox-close { position: absolute; top: 18px; right: 24px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.25); color: white; font-size: 2rem; cursor: pointer; }
.lightbox-caption { position: absolute; bottom: 24px; color: white; display: grid; gap: 4px; text-align: center; }
.cutting-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-weight: 800; font-size: .8rem; background: var(--surface-2); color: var(--muted); }
.status-bewurzelt, .status-umgetopft { background: #dff3e5; color: #1f6337; }
.status-abgegeben { background: #e8eefb; color: #34538a; }
.status-fehlgeschlagen { background: #fae5e2; color: #8f2d25; }
[data-theme="dark"] .status-bewurzelt, [data-theme="dark"] .status-umgetopft { background: #244b31; color: #c8efd4; }
[data-theme="dark"] .status-abgegeben { background: #253657; color: #d3dfff; }
[data-theme="dark"] .status-fehlgeschlagen { background: #542b27; color: #ffd0ca; }
@media (max-width: 1150px) { .gallery-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .gallery-filter { grid-template-columns: 1fr; } }
@media (max-width: 470px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Sprint 3.1 – QR, Etiketten, Scanner und Statistik */
.qr-card-panel{max-width:1100px}.qr-card-content{display:flex;align-items:center;justify-content:space-between;gap:28px}.qr-preview{width:180px;height:180px;background:white;border-radius:18px;padding:10px;border:1px solid var(--border)}.qr-table{width:68px;height:68px;background:#fff;padding:4px;border-radius:8px}.label-tools{padding:16px 18px}.label-filter{grid-template-columns:minmax(280px,1fr) 230px auto auto}.label-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}.scanner-panel{max-width:900px}.scanner-controls{display:flex;justify-content:center;gap:10px;margin-top:18px}#qrReader{max-width:680px;margin:auto;border-radius:16px;overflow:hidden}.statistics-kpis{grid-template-columns:repeat(6,minmax(0,1fr))}.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.chart-card{min-height:390px}.chart-card h2{margin-top:0}.chart-card canvas{width:100%!important;height:320px!important}
@media(max-width:1200px){.statistics-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){.qr-card-content{align-items:flex-start}.label-filter{grid-template-columns:1fr 1fr}.chart-grid{grid-template-columns:1fr}.label-heading{align-items:stretch;flex-direction:column}}
@media(max-width:600px){.qr-card-content{flex-direction:column-reverse}.qr-preview{width:150px;height:150px}.label-filter,.statistics-kpis{grid-template-columns:1fr}.scanner-controls{flex-direction:column}.scanner-controls .button{width:100%}}
.scan-file{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:14px}

/* Sprint 3.2 – Einstellungen */
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.settings-card{margin-bottom:0}.settings-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:20px}.settings-kpis div{padding:16px;border-radius:14px;background:var(--surface-2);text-align:center}.settings-kpis span{display:block;color:var(--muted);font-size:.82rem}.settings-kpis strong{display:block;margin-top:5px;font-size:1.5rem}.system-list{display:grid;gap:0;margin:0}.system-list div{display:grid;grid-template-columns:130px 1fr;gap:14px;padding:11px 0;border-top:1px solid var(--border)}.system-list dt{font-weight:800}.system-list dd{margin:0;color:var(--muted);overflow-wrap:anywhere}.check-row{display:flex!important;align-items:center;gap:10px}.check-row input{width:18px;height:18px}.backup-actions,.inline-actions{display:flex;gap:10px;flex-wrap:wrap}.backup-list{display:grid;gap:10px;margin-top:18px}.backup-row{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:13px;border:1px solid var(--border);border-radius:13px}.backup-row small{display:block;color:var(--muted);margin-top:3px}.button-danger{background:#8f2d25;color:#fff}.data-transfer{display:grid;gap:16px}.data-transfer form{display:grid;gap:10px}.upload-box{display:grid;gap:8px;padding:18px;border:1px dashed var(--border);border-radius:14px;background:var(--surface-2)}.help-text{color:var(--muted);font-size:.9rem}.notice{padding:14px 16px;border-radius:13px;margin-bottom:18px;font-weight:700}.notice-success{background:#dff3e5;color:#1f6337}.notice-error{background:#fae5e2;color:#8f2d25}
@media(max-width:1000px){.settings-grid{grid-template-columns:1fr}.settings-kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.settings-kpis{grid-template-columns:1fr}.backup-row,.backup-actions{align-items:stretch;flex-direction:column}.inline-actions{width:100%}.inline-actions .button,.inline-actions form,.inline-actions button{width:100%}.system-list div{grid-template-columns:1fr}}

.brand-logo{width:52px;height:52px;border-radius:50%;object-fit:cover;background:#fff;border:2px solid rgba(255,255,255,.85);flex:0 0 auto}.brand{gap:12px;align-items:center}.brand>strong{font-size:1.15rem}.checkbox-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.check-card{display:flex!important;align-items:flex-start;gap:12px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);cursor:pointer}.check-card input{width:20px;height:20px;margin-top:2px}.check-card span{display:flex;flex-direction:column;gap:4px}.check-card small{color:var(--muted)}.conversion-panel{display:flex;align-items:center;justify-content:space-between;gap:20px}@media(max-width:700px){.checkbox-row{grid-template-columns:1fr}.conversion-panel{align-items:stretch;flex-direction:column}}

/* =========================================================
   FeigenGlück V1.0 – modernes App-Design
   ========================================================= */
:root {
  --topbar-height: 74px;
  --sidebar-width: 280px;
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface-2: #f4f6f3;
  --text: #171b18;
  --muted: #69716b;
  --border: #e2e7e2;
  --primary: #2f7a36;
  --primary-strong: #205e27;
  --shadow: 0 10px 34px rgba(32, 54, 37, .07);
}
html[data-theme="dark"] {
  --bg:#111412; --surface:#191d1a; --surface-2:#222723; --text:#f3f6f3;
  --muted:#aab3ac; --border:#303732; --primary:#7bc683; --primary-strong:#9bdd9f;
  --shadow:0 12px 36px rgba(0,0,0,.28);
}
body.app-shell { background:var(--bg); }
.topbar {
  position:fixed; z-index:300; inset:0 0 auto 0; height:var(--topbar-height);
  display:flex; align-items:center; gap:22px; padding:0 26px;
  background:color-mix(in srgb,var(--surface) 96%,transparent); border-bottom:1px solid var(--border);
  box-shadow:0 2px 12px rgba(20,30,22,.04); backdrop-filter:blur(14px);
}
.topbar-brand { display:flex; align-items:center; gap:10px; color:var(--text); text-decoration:none; white-space:nowrap; }
.topbar-brand img { width:36px; height:36px; object-fit:cover; border-radius:50%; border:1px solid var(--border); }
.topbar-brand strong { font-size:1.32rem; letter-spacing:-.025em; }
.topbar-spacer { flex:1; }
.icon-button { width:42px; height:42px; display:grid; place-items:center; border:0; border-radius:12px; background:transparent; color:var(--text); cursor:pointer; }
.icon-button:hover { background:var(--surface-2); }
.icon-button svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
.menu-button { gap:4px; }
.menu-button span { width:22px; height:2px; display:block; background:currentColor; border-radius:2px; }
.topbar-version { font-size:.76rem; color:var(--muted); padding:7px 10px; border-radius:999px; background:var(--surface-2); }
.sidebar {
  position:fixed; z-index:250; inset:var(--topbar-height) auto 0 0; width:var(--sidebar-width);
  padding:22px 16px 18px; background:var(--surface); color:var(--text); border-right:1px solid var(--border);
  box-shadow:none; overflow-y:auto;
}
.sidebar .nav { display:flex; flex-direction:column; gap:5px; }
.sidebar .nav a { display:flex; align-items:center; gap:14px; padding:13px 14px; border-radius:11px; color:var(--text); font-weight:590; }
.sidebar .nav a:hover { background:var(--surface-2); color:var(--primary); }
.sidebar .nav a.active { background:color-mix(in srgb,var(--primary) 10%,var(--surface)); color:var(--primary-strong); }
.nav-icon { width:25px; display:grid; place-items:center; font-size:1.35rem; line-height:1; }
.sidebar-footer { margin-top:auto; padding:20px 14px 4px; border-top:1px solid var(--border); color:var(--muted); display:grid; gap:6px; }
.sidebar-footer small { font-size:.75rem; }
.main { margin-left:var(--sidebar-width); padding:calc(var(--topbar-height) + 28px) 38px 44px; max-width:none; min-height:100vh; }
.sidebar-backdrop { position:fixed; z-index:240; inset:var(--topbar-height) 0 0; border:0; background:rgba(0,0,0,.32); }
.modern-page-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:28px; }
.modern-page-heading h1 { margin:0; font-size:2rem; letter-spacing:-.04em; }
.modern-page-heading p { margin:7px 0 0; color:var(--muted); }
.modern-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:22px; margin-bottom:24px; }
.modern-stat-card { min-height:158px; display:flex; align-items:center; gap:24px; padding:28px; border:1px solid var(--border); border-radius:20px; background:var(--surface); color:var(--text); text-decoration:none; box-shadow:var(--shadow); transition:.18s ease; }
.modern-stat-card:hover { transform:translateY(-3px); border-color:color-mix(in srgb,var(--primary) 32%,var(--border)); }
.modern-stat-icon { width:90px; height:90px; display:grid; place-items:center; flex:0 0 auto; border-radius:22px; font-size:2.5rem; }
.stat-green .modern-stat-icon { background:#e8f4e4; color:#2b7b26; }
.stat-purple .modern-stat-icon { background:#f0e5f7; color:#6f2da1; }
.stat-orange .modern-stat-icon { background:#fff0d8; color:#c37800; }
.stat-blue .modern-stat-icon { background:#e3efff; color:#2369c8; }
html[data-theme="dark"] .modern-stat-icon { filter:saturate(.85) brightness(.78); }
.modern-stat-copy { display:grid; gap:3px; }
.modern-stat-copy small { font-size:1rem; color:var(--text); }
.modern-stat-copy strong { font-size:2.25rem; line-height:1.1; color:var(--primary-strong); }
.stat-purple strong { color:#6f2da1; }.stat-orange strong { color:#d38200; }.stat-blue strong { color:#2369c8; }
.modern-stat-copy em { font-size:.86rem; color:var(--muted); font-style:normal; }
.dashboard-columns { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); gap:24px; margin-bottom:24px; }
.modern-panel { padding:28px; border:1px solid var(--border); border-radius:20px; background:var(--surface); box-shadow:var(--shadow); }
.modern-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:18px; }
.modern-panel-heading h2 { margin:0; font-size:1.25rem; }
.modern-panel-heading p { margin:5px 0 0; color:var(--muted); font-size:.88rem; }
.outline-link { padding:9px 14px; border:1px solid var(--primary); border-radius:9px; color:var(--primary-strong); text-decoration:none; font-size:.83rem; font-weight:700; }
.outline-link:hover { background:color-mix(in srgb,var(--primary) 9%,transparent); }
.recent-list,.activity-list { display:grid; }
.recent-row,.activity-row { display:flex; align-items:center; gap:16px; min-height:82px; padding:12px 2px; border-bottom:1px solid var(--border); color:var(--text); text-decoration:none; }
.recent-row:last-child,.activity-row:last-child { border-bottom:0; }
.recent-row:hover strong,.activity-row:hover strong { color:var(--primary); }
.recent-row img,.recent-placeholder { width:70px; height:58px; flex:0 0 auto; border-radius:10px; object-fit:cover; }
.recent-placeholder { display:grid; place-items:center; background:var(--surface-2); color:var(--primary); font-weight:800; }
.recent-main,.activity-main { min-width:0; display:grid; gap:5px; flex:1; }
.recent-main strong,.activity-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-main small,.activity-main small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-row time,.activity-row time { color:var(--muted); font-size:.78rem; white-space:nowrap; }
.activity-icon { width:56px; height:56px; display:grid; place-items:center; flex:0 0 auto; border-radius:50%; font-size:1.35rem; }
.activity-tree { background:#e5f2e1; color:#33752c; }.activity-variety { background:#efe5f6; color:#70319b; }.activity-cutting { background:#fff0d9; color:#c47a00; }.activity-photo { background:#e3efff; color:#2467bf; }
.quick-search-panel { margin-bottom:30px; }
.modern-search { display:grid; grid-template-columns:minmax(260px,1fr) 210px 180px auto auto; gap:10px; }
.modern-search input,.modern-search select { width:100%; min-height:46px; padding:11px 13px; border:1px solid var(--border); border-radius:11px; background:var(--surface-2); color:var(--text); }
.modern-search input:focus,.modern-search select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 14%,transparent); }
.compact-results { margin-top:20px; padding-top:18px; border-top:1px solid var(--border); }
.compact-results p { color:var(--muted); }
.compact-tree-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.compact-tree-grid a { display:grid; gap:3px; padding:13px; border:1px solid var(--border); border-radius:11px; background:var(--surface-2); color:var(--text); text-decoration:none; }
.compact-tree-grid span { color:var(--muted); font-size:.8rem; }
.modern-empty { padding:34px; text-align:center; color:var(--muted); }
/* Bestehende Seiten modernisieren */
.page-header { margin-bottom:24px; }
.panel,.form-card,.detail-card,.table-card { border-radius:18px; box-shadow:var(--shadow); }
.button { border-radius:10px; }
input,select,textarea { border-radius:10px !important; }
.table-wrap table { border-collapse:separate; border-spacing:0; }
@media(max-width:1250px){.modern-stat-grid{grid-template-columns:repeat(2,1fr)}.modern-search{grid-template-columns:1fr 1fr 1fr}.compact-tree-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){
  .topbar-version{display:none}.sidebar{transform:translateX(-105%);transition:transform .2s ease}.sidebar.open{transform:translateX(0)}
  .main{margin-left:0;padding:calc(var(--topbar-height) + 24px) 22px 36px}.dashboard-columns{grid-template-columns:1fr}
  .modern-page-heading{align-items:flex-start;flex-direction:column}.modern-search{grid-template-columns:1fr 1fr}
}
@media(min-width:901px){.menu-button{display:none!important}}
@media(max-width:620px){
  .topbar{padding:0 14px;gap:12px}.topbar-brand img{width:32px;height:32px}.topbar-brand strong{font-size:1.12rem}
  .main{padding-left:14px;padding-right:14px}.modern-stat-grid{grid-template-columns:1fr}.modern-stat-card{min-height:125px;padding:20px}.modern-stat-icon{width:70px;height:70px}
  .modern-search{grid-template-columns:1fr}.compact-tree-grid{grid-template-columns:1fr}.modern-panel{padding:20px}.recent-row time,.activity-row time{display:none}
}

/* Version 1.0.3 */
.chart-description{color:var(--muted);font-size:.9rem;margin:-4px 0 10px}.settings-maintenance-grid{margin-top:20px}.factory-reset-card{border-color:color-mix(in srgb,#b42318 40%,var(--border))}.factory-warning{padding:14px 16px;margin-bottom:16px;border-radius:14px;background:color-mix(in srgb,#b42318 10%,var(--surface));color:var(--text)}.factory-warning strong{color:#b42318}.factory-warning p{margin:6px 0 0;color:var(--muted)}.factory-reset-card form{display:grid;gap:14px}.factory-actions{display:flex;gap:10px;flex-wrap:wrap}@media(max-width:700px){.factory-actions{flex-direction:column}.factory-actions .button{width:100%}}

/* Version 1.0.3 */
.chart-description{color:var(--muted);font-size:.9rem;margin:-4px 0 10px}.settings-maintenance-grid{margin-top:20px}.factory-reset-card{border-color:color-mix(in srgb,#b42318 40%,var(--border))}.factory-warning{padding:14px 16px;margin-bottom:16px;border-radius:14px;background:color-mix(in srgb,#b42318 10%,var(--surface));color:var(--text)}.factory-warning strong{color:#b42318}.factory-warning p{margin:6px 0 0;color:var(--muted)}.factory-reset-card form{display:grid;gap:14px}.factory-actions{display:flex;gap:10px;flex-wrap:wrap}@media(max-width:700px){.factory-actions{flex-direction:column}.factory-actions .button{width:100%}}
.favorite-star{color:#d99a00;font-size:1.15rem}.archived-row{opacity:.68;background:color-mix(in srgb,var(--surface-2) 70%,transparent)}.archive-card{border-color:#8b8b8b}.favorite-card{border-color:#d99a00;background:color-mix(in srgb,#ffd66b 12%,var(--surface))}.header-buttons form{display:inline-flex}.mobile-install-note{display:none}@media(max-width:700px){.topbar-brand img{width:30px!important;height:30px!important}.topbar-brand strong{font-size:1rem}.main{padding:16px 12px 90px}.page-header-actions{align-items:stretch}.header-buttons{width:100%;display:grid;grid-template-columns:1fr 1fr}.header-buttons form,.header-buttons .button{width:100%}.responsive-table{overflow-x:auto;-webkit-overflow-scrolling:touch}.filter-row{grid-template-columns:1fr!important}.mobile-install-note{display:block}}
.button-favorite{background:#fff7db;color:#8a5b00;border:1px solid #e7bd4d}.button-favorite:hover{background:#ffefb2}.header-buttons form{margin:0}.header-buttons{align-items:center}

/* V1.2.1: sichtbare Baumaktionen und Werkseinstellungen */
.tree-action-panel{border-color:color-mix(in srgb,#d99a00 35%,var(--border));margin-bottom:20px}.tree-action-buttons{display:flex;gap:12px;flex-wrap:wrap}.tree-action-buttons form{margin:0}.button-reset-prominent{font-size:1rem;padding:13px 20px;min-width:190px}.factory-reset-card{box-shadow:0 0 0 2px color-mix(in srgb,#b42318 12%,transparent)}@media(max-width:700px){.tree-action-buttons{display:grid;grid-template-columns:1fr}.tree-action-buttons form,.tree-action-buttons .button{width:100%}}

/* V1.2.3 – Favoriten direkt in Übersicht und Bearbeiten */
.favorite-inline-form{display:inline;margin:0}.favorite-toggle{appearance:none;border:0;background:transparent;color:#9aa09c;font-size:1.45rem;line-height:1;cursor:pointer;padding:5px 7px;border-radius:9px;transition:transform .15s ease,background .15s ease,color .15s ease}.favorite-toggle:hover{transform:scale(1.12);background:#fff5cf;color:#b47b00}.favorite-toggle.is-active{color:#d99a00}.favorite-edit-row{grid-template-columns:1fr}.favorite-check-card{border-color:#e7bd4d;background:color-mix(in srgb,#ffd66b 12%,var(--surface))}


/* V1.3.0 gemeinsame Anpassungen */
.tree-filter-row{grid-template-columns:minmax(220px,360px) auto 170px 190px 155px 170px auto;justify-content:start;align-items:center}
.tree-search-field{max-width:360px}
.tree-filter-submit{white-space:nowrap;min-width:110px;justify-content:center}
.csv-export-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0 16px}
.leaflet-control-layers{font:inherit;border:1px solid var(--border)!important;border-radius:12px!important;box-shadow:0 8px 24px rgba(0,0,0,.12)!important}
@media(max-width:1150px){.tree-filter-row{grid-template-columns:1fr 1fr 1fr}.tree-search-field{max-width:none}}
@media(max-width:700px){.tree-filter-row,.csv-export-grid{grid-template-columns:1fr}.tree-search-field{max-width:none}}


/* V1.3.0 Design: Modern */
:root{--primary:#2f7d4a;--primary-strong:#205f36;--accent:#6b3f75;--bg:#f4f7f5;--surface:#ffffff;--surface-2:#f7faf8;--text:#172019;--muted:#657168;--border:#dbe4de;--shadow:0 12px 34px rgba(22,53,32,.08)}
.topbar{backdrop-filter:blur(16px);background:color-mix(in srgb,var(--surface) 92%,transparent)}
.panel,.modern-panel,.stat-card,.tree-card{box-shadow:var(--shadow);border:1px solid var(--border)}
.button{border-radius:10px}.nav a{border-radius:10px}.page-header h1{letter-spacing:-.035em}


.map-picker-tall{height:600px;min-height:520px}.path-picker-row{display:flex;gap:10px;align-items:center}.path-picker-row input{flex:1}@media(max-width:850px){.map-picker-tall{height:480px;min-height:420px}.path-picker-row{align-items:stretch;flex-direction:column}}

/* V1.4.1: Baumfilter auf Desktop vollständig in einer Zeile */
.tree-filter-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 118px 175px 205px 165px 185px auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.tree-filter-row > * { min-width: 0; }
.tree-filter-row .tree-search-field {
  width: 100%;
  max-width: none;
}
.tree-filter-row .tree-filter-submit {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.tree-filter-row select,
.tree-filter-row .button { width: 100%; }
@media (max-width: 1280px) {
  .tree-filter-row {
    grid-template-columns: minmax(260px, 1fr) 110px 160px 185px 150px 165px;
  }
  .tree-filter-row > .button:last-child { grid-column: 1 / -1; width: max-content; }
}
@media (max-width: 980px) {
  .tree-filter-row { grid-template-columns: 1fr 130px 1fr; }
  .tree-filter-row > .button:last-child { grid-column: auto; width: 100%; }
}
@media (max-width: 700px) {
  .tree-filter-row { grid-template-columns: 1fr; }
}


/* V1.4.2: Filterknopf im Suchfeld; Aktive Bäume an vorheriger Filterposition */
.tree-filter-row {
  grid-template-columns: minmax(390px, 1.35fr) 185px 175px 205px 165px auto;
}
.tree-search-combo {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-2);
}
.tree-search-combo .tree-search-field {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tree-search-combo .tree-search-field:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--primary) 22%,transparent);
}
.tree-search-filter-button {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--border);
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.tree-search-filter-button:hover { background: var(--primary-strong); }
@media (max-width:1280px) {
  .tree-filter-row { grid-template-columns:minmax(300px,1fr) 165px 160px 185px 150px; }
  .tree-filter-row > .button:last-child { grid-column:1 / -1; width:max-content; }
}
@media (max-width:980px) {
  .tree-filter-row { grid-template-columns:1fr 1fr; }
}
@media (max-width:700px) {
  .tree-filter-row { grid-template-columns:1fr; }
  .tree-search-filter-button { padding:0 14px; }
}


/* V1.5.0 – Accounts & Administration */
.account-menu{display:flex;align-items:center;gap:10px;margin-right:8px}.account-name{font-size:13px;font-weight:700}.account-link{font:inherit;font-size:13px;color:var(--muted);text-decoration:none;background:none;border:0;padding:6px;cursor:pointer}.account-link:hover{color:var(--text)}.inline-form{display:inline;margin:0}.auth-page{min-height:calc(100vh - 130px);display:flex;align-items:center;justify-content:center;padding:30px 16px}.auth-card{width:min(440px,100%);background:var(--card);border:1px solid var(--line);border-radius:22px;padding:28px}.auth-card-wide{width:min(650px,100%)}.auth-logo{width:62px;height:62px;object-fit:cover;border-radius:50%;margin-bottom:14px}.auth-card h1{margin:0 0 6px}.auth-note,.security-hint{margin-top:18px;color:var(--muted);font-size:13px}.stack-form{display:grid;gap:15px;margin-top:20px}.stack-form label{display:grid;gap:6px;font-weight:650}.stack-form input,.stack-form select{width:100%;box-sizing:border-box;border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:12px;padding:11px 12px;font:inherit}.check-row{display:flex!important;align-items:center;gap:9px}.check-row input{width:auto}.field-check{align-self:end;min-height:43px}.alert{padding:12px 14px;border-radius:12px;background:var(--accent-soft);border:1px solid var(--line);margin:12px 0}.alert-error{background:#fff0f0;border-color:#e4b6b6;color:#8b2020}.narrow-panel{max-width:720px}.admin-stats{max-width:480px}.actions-cell{white-space:nowrap}.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:7px;background:#8b8b8b}.status-dot.ok{background:#2f7d4a}.status-dot.off{background:#a95b5b}.info-block{margin-top:18px}.small{font-size:12px}@media(max-width:760px){.account-name{display:none}.account-menu{gap:2px}.auth-page{padding:18px 0}.auth-card{border-radius:16px;padding:20px}.actions-cell{white-space:normal}.actions-cell .button{margin:2px 0}}

.auth-main{margin-left:0!important;padding-top:calc(var(--topbar-height) + 20px)!important}.auth-shell .menu-button{display:none}

/* V1.5.1 Benutzerbestände */
.owner-filter-form{display:grid;gap:.4rem;margin-bottom:.8rem;padding:.7rem;border:1px solid var(--line,#d9e2dc);border-radius:12px;background:rgba(255,255,255,.04)}
.owner-filter-form label{font-size:.78rem;font-weight:700}
.owner-filter-form select{width:100%;min-width:0;border:1px solid var(--line,#cfd9d2);border-radius:9px;padding:.45rem .55rem;background:var(--surface,#fff);color:inherit}
.ownership-warning{margin:0 0 1rem}
