/* Airtime-Manager - schlichtes, ruhiges Layout */
:root {
  --text: #1c2429;
  --leise: #6b767e;
  --linie: #dde3e7;
  --flaeche: #ffffff;
  --hintergrund: #f4f6f8;
  --akzent: #17527d;
  --fehler: #b3261e;
  --warnung: #b06b00;
  --gut: #2e7d46;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--hintergrund);
}

/* ------------------------------------------------------------------ Kopf */
.kopf {
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 56px;
  background: var(--akzent); color: #fff;
}
.marke { font-weight: 600; font-size: 17px; letter-spacing: .2px; }
.marke span { opacity: .65; font-weight: 400; }
.kopf nav { display: flex; gap: 22px; flex: 1; }
.kopf nav a { color: #fff; text-decoration: none; opacity: .85; padding: 4px 0; }
.kopf nav a:hover { opacity: 1; box-shadow: inset 0 -2px 0 #fff; }
.benutzer { font-size: 13px; opacity: .9; display: flex; align-items: center; gap: 10px; }
.benutzer a { color: #fff; }
.rolle {
  background: rgba(255,255,255,.18); border-radius: 10px;
  padding: 1px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
}

main { max-width: 1180px; margin: 26px auto 60px; padding: 0 28px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 20px; }
h2 { font-size: 16px; font-weight: 600; margin: 34px 0 12px; }
footer {
  max-width: 1180px; margin: 0 auto; padding: 0 28px 40px;
  color: var(--leise); font-size: 12px;
}

/* --------------------------------------------------------------- Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kachel {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 18px 20px;
}
.kachel.gross { grid-row: span 1; }
.kachel-titel { font-size: 12px; color: var(--leise); text-transform: uppercase; letter-spacing: .5px; }
.kachel-unter { font-size: 13px; color: var(--leise); margin-top: 8px; }
.grosszahl { font-size: 44px; font-weight: 300; line-height: 1.1; margin: 6px 0 0; }
.grosszahl.klein { font-size: 30px; }
.stufe {
  display: inline-block; color: #fff; font-weight: 600; letter-spacing: .5px;
  padding: 7px 16px; border-radius: 4px; margin: 10px 0 2px;
}
.balken {
  height: 7px; background: #e9edf0; border-radius: 4px; overflow: hidden; margin: 14px 0 0;
}
.balken span { display: block; height: 100%; }

table.mini { width: 100%; font-size: 13px; margin-top: 8px; }
table.mini td { padding: 3px 0; }
table.mini td:nth-child(2) { text-align: right; font-weight: 600; }
table.mini td:nth-child(3) { text-align: right; width: 48px; }
.gut { color: var(--gut); } .schlecht { color: var(--fehler); }

/* --------------------------------------------------------------- Tabellen */
table.liste {
  width: 100%; border-collapse: collapse; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; font-size: 14px;
}
table.liste th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--leise); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--linie);
  background: #fafbfc;
}
table.liste td { padding: 9px 12px; border-bottom: 1px solid #eef2f4; vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste .r, th.r { text-align: right; }
table.liste small { color: var(--leise); }
tr.blass td { color: #9aa3ab; }
tr.blass td strong { color: #9aa3ab; }

.pille {
  display: inline-block; color: #fff; border-radius: 10px; padding: 2px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; background: #9aa3ab;
}
.pille.klein { background: #e3e8ec; color: #4a555d; font-weight: 500; }
.pille.grau { background: #cfd6db; color: #3d474e; }

/* ---------------------------------------------------------------- Meldung */
.hinweis, .warnung, .fehler, .erfolg {
  padding: 12px 16px; border-radius: 6px; margin: 14px 0; font-size: 14px;
}
.hinweis { background: #eef2f5; color: var(--leise); }
.warnung { background: #fff5e5; border-left: 3px solid var(--warnung); }
.fehler  { background: #fdecea; border-left: 3px solid var(--fehler); }
.erfolg  { background: #eaf5ec; border-left: 3px solid var(--gut); }
.fussnote { color: var(--leise); font-size: 12.5px; margin-top: 10px; }

/* --------------------------------------------------------------- Formular */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 22px 24px;
}
.karte.schmal { max-width: 360px; }
fieldset { border: 0; border-top: 1px solid var(--linie); margin: 0 0 18px; padding: 16px 0 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--leise); padding: 0 8px 0 0; }
.reihe { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.reihe > label { flex: 1 1 180px; }
.reihe > label.w2 { flex: 2 1 380px; }
label { display: block; font-size: 13px; color: var(--leise); margin-bottom: 12px; }
label.hervor { background: #fffaf0; border: 1px solid #f0e0c0; border-radius: 6px; padding: 8px 10px; }
label.kasten { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
label small { display: block; font-size: 11.5px; color: var(--leise); margin-top: 3px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--linie); border-radius: 5px;
  font: inherit; font-size: 14px; color: var(--text); background: #fff; margin-top: 4px;
}
label.kasten input { width: auto; margin: 0; }
input:focus, select:focus { outline: 2px solid #b6d0e4; border-color: var(--akzent); }

button, .knopf {
  display: inline-block; background: var(--akzent); color: #fff; border: 0; border-radius: 5px;
  padding: 8px 18px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
}
button:hover, .knopf:hover { background: #10405f; }
.knopf.hell { background: #e3e8ec; color: var(--text); }
.knopf.hell:hover { background: #d5dce1; }
.knopf.rechts { margin-left: auto; }
.knopfreihe { display: flex; gap: 10px; align-items: center; }

.filter { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter input, .filter select { margin: 0; width: auto; }
.filter input[type=search] { min-width: 260px; }

/* ---------------------------------------------------------------- Befunde */
.reiter { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.reiter a {
  padding: 6px 14px; border-radius: 5px; text-decoration: none; color: var(--leise);
  background: #e9edf0; font-size: 13px;
}
.reiter a.aktiv { background: var(--akzent); color: #fff; }

.befund {
  background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid #9aa3ab;
  border-radius: 6px; padding: 14px 18px; margin-bottom: 12px;
}
.befund.schwere-fehler  { border-left-color: var(--fehler); }
.befund.schwere-warnung { border-left-color: var(--warnung); }
.befund.schwere-info    { border-left-color: #8aa0b0; }
.befund header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.befund .regel { background: #eef2f5; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.befund .quartal { color: var(--leise); font-size: 13px; }
.befund .betrag { margin-left: auto; font-weight: 600; }
.befund .bezug { color: var(--leise); font-size: 13px; margin: 0 0 6px; }
.befund p { margin: 0 0 8px; }
.befund-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.befund-form select, .befund-form input { margin: 0; width: auto; }
.befund-form input[type=text] { flex: 1; }

tr.schwere-fehler td:first-child  { border-left: 3px solid var(--fehler); }
tr.schwere-warnung td:first-child { border-left: 3px solid var(--warnung); }

code { font: 12.5px/1.4 ui-monospace, Consolas, monospace; }

@media (max-width: 900px) {
  .kacheln { grid-template-columns: 1fr 1fr; }
  .kopf { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 14px; }
  main { padding: 0 16px; }
}

/* ----------------------------------------------------------------- Import */
input[type=file] {
  width: 100%; padding: 8px; margin-top: 4px; font: inherit; font-size: 14px;
  border: 1px dashed var(--linie); border-radius: 5px; background: #fafbfc;
}
pre.protokoll {
  margin: 8px 0 0; padding: 10px 12px; background: rgba(255,255,255,.65);
  border-radius: 5px; font: 12.5px/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; color: #3d474e;
}

/* ----------------------------------------------------------------- Export */
.export {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  padding: 14px 18px; margin: 14px 0 20px;
}
.export > strong { display: block; font-size: 13px; margin-bottom: 10px; }
.exportquartal {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 18px 8px 0; font-size: 13px; color: var(--leise);
}
.knopf.klein { padding: 5px 12px; font-size: 13px; }
.export .fussnote { margin-top: 6px; }

/* ------------------------------------------- Umschaltbare Kontexthilfe */
.helpbtn {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.42);
  color: #fff; border-radius: 8px; padding: 4px 10px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.helpbtn:hover { background: rgba(255,255,255,.26); }
.helpbtn.active { background: #f0a92b; border-color: #f0a92b; color: #241500; font-weight: 700; }

.fieldhelp {
  display: none; margin: 6px 0 0; padding: 9px 12px;
  background: #eef4f8; border-left: 3px solid var(--akzent); border-radius: 6px;
  color: #35505c; font-size: 13px; line-height: 1.45; font-weight: 400;
}
html.help-on .fieldhelp { display: block; }

.helpbanner {
  display: none; margin-bottom: 18px; padding: 10px 15px; border-radius: 6px;
  background: #fff7ec; border: 1px solid #f3d19a; color: #8a5a12; font-size: 14px;
}
html.help-on.has-fieldhelp .helpbanner { display: block; }
.helpbanner a { color: #6b450e; }

/* ---------------------------------------------------------- Hilfeseite */
.hilfe { max-width: 820px; }
.hilfe h2 {
  margin: 34px 0 10px; padding-top: 10px; border-top: 1px solid var(--linie);
  font-size: 18px;
}
.hilfe h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.hilfe h3 { font-size: 15px; margin: 22px 0 6px; }
.hilfe p, .hilfe li { line-height: 1.62; }
.hilfe ul, .hilfe ol { padding-left: 22px; }
.hilfe li { margin-bottom: 5px; }
.hilfe table.liste { margin: 12px 0; }
.hilfe .merksatz {
  margin: 14px 0; padding: 12px 16px; border-left: 3px solid var(--akzent);
  background: #eef4f8; border-radius: 0 6px 6px 0;
}
.hilfe .beispiel {
  margin: 14px 0; padding: 12px 16px; background: #fafbfc;
  border: 1px solid var(--linie); border-radius: 6px; font-size: 14px;
}
.hilfe .beispiel strong { display: block; margin-bottom: 4px; }

.inhalt {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  padding: 16px 20px; margin-bottom: 26px;
}
.inhalt strong { display: block; margin-bottom: 8px; font-size: 13px; }
.inhalt ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.inhalt li { margin-bottom: 4px; }

dl.glossar { margin: 12px 0; }
dl.glossar dt { font-weight: 600; margin-top: 12px; }
dl.glossar dd { margin: 2px 0 0; padding-left: 0; color: #3d474e; }

@media print {
  .helpbanner, .helpbtn { display: none !important; }
}
@media (max-width: 700px) {
  .inhalt ol { columns: 1; }
}

/* ------------------------------------------------- Einstiegshinweis */
.einstieg {
  display: flex; align-items: flex-start; gap: 18px;
  margin: 0 0 18px; padding: 14px 18px;
  background: #eef4f8; border: 1px solid #cfe0ea; border-left: 3px solid var(--akzent);
  border-radius: 6px; font-size: 14px; line-height: 1.55;
}
.einstieg[hidden] { display: none; }
.einstieg-text { flex: 1; color: #35505c; }
.einstieg-text strong { color: var(--akzent); }
.einstieg-zu {
  flex: none; background: transparent; border: 1px solid #a9c4d4; color: #35505c;
  border-radius: 5px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.einstieg-zu:hover { background: #dce9f1; }
@media print { .einstieg { display: none !important; } }
