/* AckerStark – gleicher Stil wie BeerenStark („Hell & klar“): viel Weiß, weiche Schatten, runde Karten,
   Systemschrift; Farben Grün und Weizengelb (Gelb für „Stark“ und Aktions-Knöpfe), dazu Erdbraun für Bodenbearbeitung. */
:root {
  color-scheme: light;
  --font: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --bg: #e2e8e1; --surface: #fff; --surface-2: #f1f5f0; --head-bg: #f8faf7;
  --text: #13251a; --muted: #5b6b60; --faint: #93a297;
  --border: #ccd6cb; --divider: #e3e9e2; --bw: 2px;
  --brand: #1f4b2c; --brand-light: #5f9b50;
  --grad: linear-gradient(135deg, #1f4b2c, #2f6a3c);
  --gelb: #d9a300; --gelb-grad: linear-gradient(135deg, #f7d046, #e2a812); --auf-gelb: #13251a; --gelb-glow: 0 4px 12px -4px rgba(196, 140, 0, .6);
  --accent: #2e6b3a; --accent-soft: #edf5ea;
  --glow: 0 6px 18px -4px rgba(63, 122, 61, .45); --ring: 0 0 0 4px rgba(31, 75, 44, .15);
  --ok: #2f6b33; --ok-bg: #edf6ea; --warn: #b45309; --warn-bg: #fffbeb; --err: #dc2626; --err-bg: #fef2f2; --info: #2563eb; --info-bg: #eff6ff;
  --erde: #8a5a2b; --erde-bg: #f7efe6; --ernte-bg: #fdf2e4;
  --r-xl: 20px; --r-lg: 16px; --r-md: 12px; --r-sm: 10px; --pill: 999px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .10);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .07);
  --glass: rgba(255, 255, 255, .72); --nav-text: #334155; --hover: rgba(15, 23, 42, .05); --field: #fff; --row-hover: #fbfcfa;
  --ease: 180ms ease;
}
/* Dunkel nur, wenn unten „Dunkel“ gewählt ist (Standard: hell) */
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #0e1511; --surface: #16211a; --surface-2: #1b2a20; --head-bg: #131d16; --text: #e4ede5; --muted: #9db0a1; --faint: #6f8475;
  --border: #2c3d31; --divider: #223128; --brand: #8fd19e; --brand-light: #7cc36a; --accent: #5fae6e; --accent-soft: #1d3324;
  --ok: #34d399; --ok-bg: #0f2e22; --warn: #fbbf24; --warn-bg: #33270b; --err: #f87171; --err-bg: #3a1517; --info: #60a5fa; --info-bg: #142338;
  --erde: #d9a571; --erde-bg: #33241a; --ernte-bg: #3a2a14; --gelb: #f2c230; --ring: 0 0 0 4px rgba(143, 209, 158, .18);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45); --shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);
  --glass: rgba(22, 33, 26, .8); --nav-text: #cfdcd1; --hover: rgba(255, 255, 255, .06); --field: #101a14; --row-hover: #1a271e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; font: 400 14.5px/1.5 var(--font); color: var(--text);
  background: radial-gradient(900px 520px at 0% 0%, rgba(63, 122, 61, .06), transparent 70%),
              radial-gradient(900px 520px at 100% 0%, rgba(138, 90, 43, .05), transparent 70%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

/* Kopfleiste */
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 20px; min-height: 60px; padding: 8px 24px;
  background: var(--glass); backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid var(--divider); }
.brand { display: flex; align-items: center; gap: 10px; font: 650 20px/1 var(--font); letter-spacing: -.02em; text-decoration: none; color: var(--text); flex: none; }
.brand .logo { display: block; width: 34px; height: 34px; filter: drop-shadow(0 3px 6px rgba(31, 75, 44, .35)); }
.brand-name { color: var(--brand); font-weight: 750; } .brand-accent { color: var(--gelb); }
nav { display: flex; gap: 2px; overflow-x: auto; min-width: 0; }
nav a { color: var(--nav-text); text-decoration: none; padding: 8px 14px; border-radius: var(--pill); font: 500 14px/1.1 var(--font); white-space: nowrap; transition: background var(--ease); }
nav a:hover { background: var(--hover); }
nav a.active { color: #fff; background: var(--grad); box-shadow: var(--glow); font-weight: 600; }
.nav-badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: var(--pill); background: var(--gelb-grad); color: var(--auf-gelb); font: 700 11px/14px var(--font); }
.wer { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
main { padding: 22px 28px 40px; max-width: 1400px; margin: 0 auto; }

h1 { font: 600 26px/1.15 var(--font); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 .ctx { font-weight: 400; font-size: 18px; color: var(--muted); margin-left: 8px; }
h2 { font: 600 18px/1.25 var(--font); margin: 0; }
h3 { font: 600 14.5px/1.3 var(--font); margin: 18px 0 8px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.spacer { flex: 1; }
.toolbar select, .toolbar input { width: auto; }
.hint { font-size: 13px; color: var(--muted); }
.leer { padding: 28px; text-align: center; color: var(--muted); }

/* Knöpfe, Chips, Felder */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 16px; border: var(--bw) solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 500 14px/1.1 var(--font); cursor: pointer; box-shadow: var(--shadow-sm); text-decoration: none; transition: all var(--ease); }
.btn:hover:not(:disabled) { background: var(--head-bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--gelb-grad); color: var(--auf-gelb); border-color: transparent; font-weight: 650; box-shadow: var(--gelb-glow); }
.btn.primary:hover:not(:disabled) { background: var(--gelb-grad); filter: brightness(1.05) saturate(1.1); }
.btn.small { min-height: 30px; padding: 5px 12px; font-size: 13px; }
.btn.ghost { box-shadow: none; border-color: transparent; background: none; }
.btn.danger { color: var(--err); background: var(--err-bg); border-color: transparent; box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--pill); font: 600 12px/1.3 var(--font); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.info { background: var(--info-bg); color: var(--info); } .chip.erde { background: var(--erde-bg); color: var(--erde); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
input, select, textarea { min-height: 38px; padding: 7px 11px; border: var(--bw) solid var(--border); border-radius: var(--r-sm); font: 400 14.5px/1.3 var(--font); background: var(--field); color: var(--text); width: 100%; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.felder .breit { grid-column: 1 / -1; }

/* Kennzahlen, Karten, Raster */
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kachel { background: var(--surface); border-radius: var(--r-lg); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.kachel .wert { font: 650 26px/1.1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kachel .wert small { font-size: 14px; font-weight: 500; color: var(--muted); }
.kachel .titel { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kachel.warn .wert { color: var(--warn); }
.karte { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.raster { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 18px; align-items: start; }
.raster > * { min-width: 0; }
.raster.erfassen { grid-template-columns: 1fr minmax(300px, 420px); }

/* Begrüßung mit Wetter: dunkelgrünes Feld mit Ackerfurchen, Sonne in Weizengelb */
.hallo { position: relative; overflow: hidden; display: flex; gap: 16px; align-items: center; flex-wrap: nowrap; justify-content: space-between;
  margin-bottom: 14px; padding: 14px 20px; border-radius: var(--r-xl); color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(420px 220px at 92% -20%, rgba(247, 208, 70, .45), transparent 70%),
              repeating-linear-gradient(-62deg, rgba(255, 255, 255, .045) 0 16px, transparent 16px 34px),
              linear-gradient(135deg, #1f4b2c, #2f6a3c 60%, #3d7a45); }
.hallo-text { min-width: 0; flex: 1; }
.wetter { flex: none; }
.hallo-datum { font-size: 12px; opacity: .8; }
.wetter .hallo-datum { font-size: 11px; }
.hallo h1 { font-size: 24px; color: #fff; margin: 0 0 2px; }
.hallo h1 span { color: #f7d046; }
.hallo p { margin: 0; opacity: .92; font-size: 13.5px; }
.hallo p b { color: #f7d046; font-weight: 600; }
.wetter { display: flex; flex-direction: column; gap: 7px; width: 300px; padding: 10px 12px; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); }
.wetter-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wetter-knoepfe { display: flex; gap: 4px; }
.wetter-knoepfe button { width: 26px; height: 26px; border-radius: var(--pill); border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1);
  color: #fff; font: 600 13px/1 var(--font); cursor: pointer; }
.wetter-knoepfe button:hover, .info-knopf:hover { background: rgba(255, 255, 255, .22); }
.info-knopf { width: 20px; height: 20px; margin-left: 2px; border-radius: var(--pill); border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12);
  color: #fff; font: italic 700 12px/1 Georgia, serif; cursor: pointer; flex: none; }
.tage[hidden] { display: none; }
.tag-reihe i.nass { box-shadow: inset 0 -3px 0 #5aa9ff; }
.legende { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10px; opacity: .85; margin-top: 2px; }
.legende span { display: inline-flex; align-items: center; gap: 4px; }
.legende i { width: 9px; height: 7px; border-radius: 2px; }
.legende .regen i { background: transparent; box-shadow: inset 0 -3px 0 #5aa9ff; }
.wetter-jetzt { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.3; }
.wetter-temp { font: 650 28px/1 var(--font); letter-spacing: -.03em; }
.wetter-wind { display: flex; align-items: center; gap: 4px; opacity: .85; font-size: 13px; }
.spritz { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.spritz i, .stunde i { display: block; border-radius: var(--pill); background: #9ca3af; }
.spritz i { width: 10px; height: 10px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.gut i { background: #6fd388; } .mittel i { background: #f7d046; } .schlecht i { background: #f07a7a; }
.fenster { font-size: 12px; line-height: 1.35; opacity: .95; } .fenster b { color: #f7d046; font-weight: 600; white-space: nowrap; }
.tage { display: grid; grid-template-columns: auto 1fr; gap: 3px 6px; align-items: center; font-size: 10.5px; }
.tag-name { opacity: .8; }
.tag-reihe { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1.5px; }
.tag-reihe i { display: block; height: 8px; border-radius: 2px; background: #9ca3af; }
.tag-reihe i.frei { background: rgba(255, 255, 255, .08); }
.tag-reihe i.nacht { opacity: .55; }
.tag-reihe i.gut { background: #6fd388; } .tag-reihe i.mittel { background: #f7d046; } .tag-reihe i.schlecht { background: #f07a7a; }
.tag-uhr { display: flex; justify-content: space-between; font-size: 9.5px; opacity: .7; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .hallo { padding: 12px 14px; flex-wrap: wrap; } .hallo h1 { font-size: 21px; } .wetter { width: 100%; } }

/* Schlagliste */
.schlaege { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; padding: 2px; }
.schlag { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: var(--bw) solid var(--divider);
  border-radius: var(--r-md); cursor: pointer; transition: all var(--ease); background: var(--surface); color: inherit; text-decoration: none; }
.schlag:hover { border-color: var(--border); background: var(--head-bg); }
.schlag.aktiv { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.schlag svg { width: 40px; height: 40px; }
.schlag .name { font-weight: 600; }
.schlag .sub { font-size: 12.5px; color: var(--muted); }
.schlag .ha { font: 650 15px/1 var(--font); text-align: right; font-variant-numeric: tabular-nums; }
.schlag .ha small { display: block; font-size: 11px; color: var(--faint); font-weight: 500; margin-top: 3px; }

/* Karte (Leaflet) */
.map { height: 620px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.map.klein { height: 260px; }
.leaflet-container { font: inherit; }
.schlag-label { background: rgba(255, 255, 255, .85); border: 0; border-radius: var(--pill); padding: 2px 8px; font: 600 12px/1.3 var(--font); color: #13251a; box-shadow: var(--shadow-sm); }
.schlag-label::before { display: none; }

/* Detail */
.eckdaten { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 22px; margin: 14px 0; }
.eckdaten div span { display: block; font-size: 12px; color: var(--muted); }
.eckdaten div b { font-weight: 600; }
.tabs { display: flex; gap: 4px; margin: 18px 0 12px; border-bottom: 1px solid var(--divider); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font: 500 14px/1 var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.aktiv { color: var(--brand); border-bottom-color: var(--accent); font-weight: 600; }
.tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 12px/1.2 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; background: var(--head-bg); border-bottom: 1px solid var(--divider); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--divider); vertical-align: top; }
tr:hover td { background: var(--row-hover); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .klein { display: block; font-size: 12.5px; color: var(--muted); }
.mass { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; flex: none; }
.ico.boden { background: var(--erde-bg); } .ico.aussaat { background: var(--ok-bg); } .ico.duengung { background: var(--info-bg); }
.ico.pflanzenschutz { background: var(--warn-bg); } .ico.ernte { background: var(--ernte-bg); } .ico.sonstiges { background: var(--surface-2); }
.n-balken { height: 10px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.n-balken i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-light), var(--accent)); border-radius: var(--pill); }
.n-balken.ueber i { background: linear-gradient(90deg, var(--warn), var(--err)); }

/* Warnungen */
.meldungen { display: flex; flex-direction: column; gap: 6px; }
.meldung { display: flex; gap: 10px; padding: 9px 13px; border-radius: var(--r-md); font-size: 13.5px; align-items: flex-start; }
.meldung.warn { background: var(--warn-bg); color: var(--warn); }
.meldung.info { background: var(--info-bg); color: var(--info); }
.meldung b { font-weight: 600; }
.fehler { background: var(--err-bg); color: var(--err); padding: 9px 13px; border-radius: var(--r-md); font-size: 13.5px; }

/* Maßnahme erfassen */
.arten { display: flex; flex-wrap: wrap; gap: 8px; }
.arten button { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: var(--bw) solid var(--divider); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: 500 14px/1 var(--font); cursor: pointer; }
.arten button.aktiv { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); font-weight: 600; }
.auswahl-schlaege { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.auswahl-schlaege label { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border: var(--bw) solid var(--divider); border-radius: var(--r-sm); font-size: 14px; color: var(--text); cursor: pointer; }
.auswahl-schlaege label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mittel-zeile { display: grid; grid-template-columns: 1fr 110px 100px auto; gap: 8px; align-items: end; padding: 10px; background: var(--surface-2); border-radius: var(--r-md); }
.treffer { border: var(--bw) solid var(--border); border-radius: var(--r-sm); background: var(--surface); max-height: 280px; overflow-y: auto; margin-top: 4px; box-shadow: var(--shadow); }
.treffer button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--divider); background: none; padding: 8px 12px; cursor: pointer; color: var(--text); font: inherit; }
.treffer button:hover { background: var(--accent-soft); }
.treffer small { display: block; color: var(--muted); font-size: 12px; }

/* Dialog */
dialog { border: 0; border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 20, 14, .45); }
dialog .knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.link-box { display: flex; gap: 8px; margin-top: 8px; }
.link-box input { font: 12.5px/1.3 ui-monospace, Consolas, monospace; }

/* Startbildschirm-Karte und Fußzeile */
.install-karte { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; border: 2px solid var(--gelb); }
.install-karte img { border-radius: 14px; flex: none; }
.install-karte > div:nth-child(2) { flex: 1; min-width: 220px; }
.install-karte p { margin: 4px 0; }
.install-schritte { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; }
.install-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 1400px; margin: 0 auto;
  padding: 10px 28px 28px; font-size: 12px; color: var(--muted); }
.fuss-knoepfe { display: flex; gap: 4px; }

/* Anmelden */
.zentriert { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.anmelde-karte { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.anmelde-karte .brand { justify-content: center; font-size: 26px; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1000px) { .raster, .raster.erfassen { grid-template-columns: 1fr; } .kacheln { grid-template-columns: repeat(2, 1fr); } .map { height: 420px; } }
@media (max-width: 640px) {
  main { padding: 16px; } .top { padding: 8px 16px; gap: 12px; flex-wrap: wrap; } .wer .name { display: none; }
  .mittel-zeile { grid-template-columns: 1fr 1fr; } .mittel-zeile > :first-child { grid-column: 1 / -1; }
}
