/* Farben aus dem LFV-Logo: Grün #5DA442, Hellblau #9ACCE4, Lindgrün #CCD328.
   --accent ist ein dunkleres Logo-Grün, damit weiße Schrift auf Buttons gut lesbar bleibt. */
:root {
  --bg: #f3f6f4; --card: #fff; --text: #1c2620; --muted: #5f6b64; --line: #dde3df; --line-strong: #c4cdc7;
  --accent: #3d7f2a; --accent-hover: #336d23; --accent-soft: #eaf4e5; --logo-green: #5da442;
  --blue: #9acce4; --blue-soft: #eef7fb; --lime: #ccd328;
  --danger: #c0392b; --err-bg: #fdf0ee; --ok-bg: #e9f5e3;
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 2px 8px rgba(20, 40, 25, .05);
  --focus: 0 0 0 3px rgba(93, 164, 66, .28);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
       padding: .55rem clamp(1rem, 3vw, 2rem); background: var(--card); border-bottom: 3px solid var(--logo-green);
       box-shadow: 0 2px 10px rgba(20, 40, 25, .06); }
.top .brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.top .brand img { height: 58px; width: auto; display: block; }
.menu { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.menu a, .menu button.link { padding: .45rem .8rem; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .93rem; }
.menu a:hover, .menu button.link:hover { background: var(--accent-soft); color: var(--accent); }
.menu a.active { background: var(--accent); color: #fff; }
.menu .who { color: var(--muted); font-size: .85rem; padding: 0 .4rem 0 .9rem; margin-left: .4rem; border-left: 1px solid var(--line); }

/* ---------------------------------------------------------------- Grundlayout */
main { max-width: 1080px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; margin: .4rem 0 1.2rem; }
h2 { font-size: 1.2rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: .95rem; font-weight: 600; margin: 1.1rem 0 .3rem; }
.count { color: var(--muted); font-weight: normal; }
code { font-size: .8rem; color: var(--muted); background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }

.flash, .error-box { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: var(--radius-sm); border-left: 4px solid; }
.flash { background: var(--ok-bg); border-color: var(--logo-green); }
.flash::before { content: "✓"; color: var(--accent); font-weight: 700; }
.error-box { background: var(--err-bg); color: var(--danger); border-color: var(--danger); }

/* ---------------------------------------------------------------- Karten / Abschnitte */
fieldset { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1.2rem;
           padding: 1.1rem 1.3rem 1.3rem; box-shadow: var(--shadow); min-width: 0; }
legend { float: left; width: 100%; padding: 0 0 .8rem; margin-bottom: .2rem; font-weight: 650; font-size: 1.02rem; }
legend + * { clear: both; }
fieldset.teil { border-top: 4px solid var(--logo-green); }
fieldset.teil > legend { color: var(--accent); }
fieldset.sub { background: var(--blue-soft); border-color: #d5e9f3; box-shadow: none; margin: 1rem 0 0; }
fieldset.gruppe { background: #fafcfb; border-left: 4px solid var(--blue); box-shadow: none; margin: 1rem 0; }
fieldset.einsatz { border-left-color: var(--lime); }
fieldset.gruppe > legend { font-size: .95rem; color: var(--muted); }

.row, .fang { display: flex; flex-wrap: wrap; gap: .9rem 1rem; align-items: flex-end; }
.row + .row { margin-top: .9rem; }
.faenge { margin: .6rem 0 .8rem; }
.fang { padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--bg); }
.fang + .fang { margin-top: .5rem; }

/* ---------------------------------------------------------------- Formularfelder */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
label.wide { margin-top: .2rem; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 500; color: var(--text);
              padding: .55rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; }
label.check:has(input:checked) { border-color: var(--logo-green); background: var(--accent-soft); }

input, select, textarea { font: inherit; font-size: .95rem; font-weight: 400; color: var(--text); min-width: 0;
                          padding: .55rem .75rem; min-height: 2.6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
                          background: #fff; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #a9b5ad; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--logo-green); box-shadow: var(--focus); }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
input[type=checkbox] { min-height: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
         background: #fff url("chevron.svg") no-repeat right .8rem center; }
textarea { width: 100%; resize: vertical; min-height: 5rem; }
::placeholder { color: #9aa59e; }
input.narrow, .narrow-label input { width: 8rem; }
.wide-input input { width: 24rem; max-width: 100%; }

.invalid, .invalid:hover { border-color: var(--danger); background-color: var(--err-bg); }
.invalid:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, .2); }
.err { color: var(--danger); font-size: .78rem; font-weight: 500; }
.warn { color: var(--danger); font-size: .85rem; }

dl.stamm { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem 1rem; margin: 1rem 0 0;
           padding: .8rem 1rem; background: var(--blue-soft); border-radius: var(--radius-sm); font-size: .92rem; }
dl.stamm dt { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
dl.stamm dd { margin: .1rem 0 0; }

/* ---------------------------------------------------------------- Buttons */
button, .button { font: inherit; font-size: .93rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
                  padding: .55rem 1.05rem; min-height: 2.6rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
                  background: #fff; color: var(--text); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover, .button:hover { border-color: #a9b5ad; background: #f8faf9; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
button.primary, .button { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.add { border-style: dashed; border-color: var(--logo-green); color: var(--accent); background: transparent; }
button.add:hover { background: var(--accent-soft); }
button.danger { color: var(--danger); border-color: #e5b4ad; background: #fff; }
button.danger:hover { background: var(--err-bg); border-color: var(--danger); }
button.remove { color: var(--danger); border-color: transparent; background: transparent; min-width: 2.6rem; }
button.remove:hover { background: var(--err-bg); border-color: #e5b4ad; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; }
form.inline { display: inline; }

.submit { display: flex; gap: 1.2rem; align-items: center; position: sticky; bottom: 0; z-index: 5; margin: 1.5rem 0 0;
          padding: .9rem 1.3rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
          border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -2px 12px rgba(20, 40, 25, .07); }
.submit button.primary { min-width: 9rem; }

/* ---------------------------------------------------------------- Übersicht */
.toolbar { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
form.filter { display: flex; flex-wrap: wrap; gap: .9rem 1rem; align-items: flex-end; background: var(--card); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
form.filter input[type=search] { width: 17rem; max-width: 100%; }
.treffer { color: var(--muted); font-size: .9rem; }

table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line);
             border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.list th { text-align: left; padding: .7rem .8rem; background: #f7f9f8; font-size: .78rem; font-weight: 650; text-transform: uppercase;
                letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
table.list td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #f7faf6; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.actions { white-space: nowrap; text-align: right; }
table.list .actions > * + * { margin-left: .4rem; }
table.list .actions a, table.list .actions button.danger { display: inline-flex; align-items: center; min-height: 2.2rem; padding: .35rem .8rem;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600; text-decoration: none; vertical-align: middle; }
table.list .actions a:hover { background: var(--accent-soft); border-color: var(--logo-green); }
table.list .actions button.danger { border-color: #e5b4ad; }
tr.inaktiv td { color: var(--muted); }

/* ---------------------------------------------------------------- Login */
form.login { display: flex; flex-direction: column; gap: 1rem; max-width: 360px; background: var(--card); padding: 1.6rem;
             border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
form.login input { width: 100%; }
form.login button { margin-top: .3rem; }

/* ---------------------------------------------------------------- Handy */
@media (max-width: 760px) {
  .top { flex-wrap: wrap; position: static; }
  .top .brand img { height: 44px; }
  .menu { width: 100%; justify-content: flex-start; gap: .1rem; }
  .menu a, .menu button.link { padding: .4rem .65rem; font-size: .88rem; }
  form.filter > label { flex: 1 1 9rem; }
  form.filter input, form.filter select, form.filter input[type=search] { width: 100%; }
  .menu .who { margin-left: auto; }
  h1 { font-size: 1.35rem; }
  fieldset { padding: .9rem 1rem 1rem; }
  .row > label, .fang > label { flex: 1 1 9rem; }
  .row > label input, .row > label select, .fang > label input, .fang > label select, .wide-input input { width: 100%; }
  table.list, table.list tbody { display: block; border: 0; box-shadow: none; background: none; }
  table.list thead { display: none; }
  table.list tr { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .2rem; margin-bottom: .7rem; box-shadow: var(--shadow); }
  table.list td { display: block; border: 0; padding: .2rem .8rem; }
  table.list td.actions, table.list td.num { text-align: left; }
  table.list td.actions { padding-top: .5rem; }
}
.hinweis { color: var(--muted); font-size: .85rem; margin: .8rem 0 0; }
