:root {
  --bg: #f4f5f7; --karte: #ffffff; --text: #1c2430; --leise: #6b7280;
  --rand: #e2e5ea; --akzent: #1f6f43; --akzent-hell: #e8f4ed;
  --rot: #b42318; --rot-hell: #fdecea; --orange: #b54708; --orange-hell: #fff3e4;
  --blau: #175cd3; --blau-hell: #eaf1fd; --gelb-hell: #fef7e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c; --karte: #1a212c; --text: #e7ebf1; --leise: #9aa4b2;
    --rand: #2a3342; --akzent-hell: #15301f; --rot-hell: #3a1715;
    --orange-hell: #3a2a12; --blau-hell: #16243d; --gelb-hell: #33301a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 12px 0 16px; }
h2 { font-size: 1.15rem; margin: 8px 0; }
a { color: var(--blau); }

.topbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  background: var(--karte); border-bottom: 1px solid var(--rand); padding: 10px 16px; position: sticky; top: 0; z-index: 5; }
.brand { color: var(--text); text-decoration: none; font-size: 1.05rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--text); padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.topbar nav a.aktiv, .topbar nav a:hover { background: var(--akzent-hell); color: var(--akzent); }
.topbar nav a.leise { color: var(--leise); font-weight: 400; }

.banner { max-width: 980px; margin: 12px auto 0; padding: 10px 14px; border-radius: 10px; }
.banner.warn { background: var(--gelb-hell); border: 1px solid #d8c25a; }
.banner.fehler { background: var(--rot-hell); border: 1px solid var(--rot); }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 16px;
  text-decoration: none; color: var(--text); transition: transform .06s; }
.karte:hover { transform: translateY(-2px); }
.karte h2 { margin-top: 0; }
.zahlen { display: flex; flex-direction: column; gap: 4px; }
.zahl b { font-size: 1.2rem; }
.zahl.rot b { color: var(--rot); } .zahl.gruen b { color: var(--akzent); } .zahl.orange b { color: var(--orange); }

.hilfe { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 6px 18px 12px; margin-top: 20px; }
.leise { color: var(--leise); } .klein { font-size: .85rem; }
.leer { color: var(--leise); padding: 8px 2px; }
.abschnitt { margin-top: 26px; border-bottom: 2px solid var(--rand); padding-bottom: 6px; }
.abschnitt.inline { display: inline; border: 0; }
.rot-text { color: var(--rot); } .orange-text { color: var(--orange); }
.anzahl { background: var(--rand); border-radius: 99px; padding: 2px 10px; font-size: .9rem; vertical-align: middle; }

.paket { background: var(--karte); border: 1px solid var(--rand); border-left: 5px solid var(--rand);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.paket.p-todo { border-left-color: var(--rot); }
.paket.p-problem { border-left-color: var(--orange); }
.paket-kopf { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

.status { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .82rem; font-weight: 700; }
.s-Zugestellt { background: var(--akzent-hell); color: var(--akzent); }
.s-In-Transit, .s-Im-Paketzentrum, .s-Registriert { background: var(--blau-hell); color: var(--blau); }
.s-Problematisch, .s-Nicht-im-System, .s-Unbekannt { background: var(--orange-hell); color: var(--orange); }
.s-Reklamiert { background: var(--rot-hell); color: var(--rot); }

.artikel-tabelle { width: 100%; border-collapse: collapse; }
.artikel-tabelle td { padding: 6px 8px 6px 0; border-top: 1px dashed var(--rand); vertical-align: top; }
.artikel-tabelle tr:first-child td { border-top: 0; }
td.menge { white-space: nowrap; font-weight: 700; width: 3.2em; }
td.artnr { white-space: nowrap; width: 11em; }

.kopier { font: inherit; cursor: pointer; border: 1px dashed var(--blau); background: var(--blau-hell);
  color: var(--blau); border-radius: 8px; padding: 4px 8px; font-weight: 700; letter-spacing: .03em; text-align: left; }
.kopier.still { border-color: transparent; background: transparent; color: var(--text); font-weight: 500; }
.kopier.still:hover { border-color: var(--blau); color: var(--blau); }
.kopier.gross { font-size: 1.05rem; }
.kopier.kopiert { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent) !important; }

.neu-badge { background: var(--rot); color: #fff; font-size: .7rem; font-weight: 800;
  border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

.paket-aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.aktion { font: inherit; cursor: pointer; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--rand); background: var(--bg); font-weight: 700; min-height: 44px; }
.aktion:hover { border-color: var(--akzent); }
.aktion.ok { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent); }
.aktion.leise-btn { font-weight: 400; color: var(--leise); }

.neu-tabelle { width: 100%; border-collapse: collapse; background: var(--karte);
  border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; }
.neu-tabelle th { text-align: left; padding: 10px; background: var(--bg); border-bottom: 1px solid var(--rand); }
.neu-tabelle td { padding: 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
.rechts { text-align: right; }

.suche { display: flex; gap: 8px; margin: 10px 0; }
.suche input { flex: 1; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rand);
  background: var(--bg); color: var(--text); }
.suche button { font: inherit; padding: 10px 18px; border-radius: 10px; border: 0;
  background: var(--akzent); color: #fff; font-weight: 700; cursor: pointer; }

.erledigt-block summary { cursor: pointer; margin-top: 26px; list-style: none; }
.erledigt-block summary::before { content: "▸ "; }
.erledigt-block[open] summary::before { content: "▾ "; }

footer { max-width: 980px; margin: 30px auto 16px; padding: 0 16px; color: var(--leise); font-size: .85rem; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 700; z-index: 50; }

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px;
  padding: 36px 32px; width: 100%; max-width: 380px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.login-marke { margin-bottom: 26px; }
.login-raute { color: #b08d3f; font-size: 1.6rem; display: block; margin-bottom: 4px; }
.login-box h1 { margin: 0; letter-spacing: .35em; text-indent: .35em; font-size: 1.7rem; }
.login-sub { margin: 4px 0 0; color: var(--leise); letter-spacing: .08em; }
.sso-button { display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 10px; padding: 14px; border-radius: 12px; box-sizing: border-box;
  background: var(--akzent); color: #fff; font-weight: 700; font-size: 1.05rem;
  text-decoration: none; transition: filter .12s; }
.sso-button:hover { filter: brightness(1.08); }
.login-fuss { margin-top: 16px; }

@media (max-width: 640px) {
  td.artnr { width: auto; }
  .artikel-tabelle td.name { min-width: 12em; }
  .neu-tabelle th:nth-child(4), .neu-tabelle td:nth-child(4) { display: none; }
}
