/* fit4school Zeiterfassung – Blau #015694 / Grün #bccf02 */
:root {
  --blau: #015694;
  --blau-dunkel: #01446f;
  --gruen: #bccf02;
  --gruen-dunkel: #a5b600;
  --grau-bg: #f2f5f8;
  --grau-linie: #dde3ea;
  --text: #1d2733;
  --text-leise: #5f6b7a;
  --rot: #c23b3b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--grau-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Kopfbereich ---------- */
.topbar { background: #fff; border-bottom: 3px solid var(--gruen); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marke-claim { color: var(--text-leise); font-size: 13px; border-left: 2px solid var(--grau-linie); padding-left: 10px; margin-top: 4px; }
.nav-knopf { display: none; margin-left: auto; background: none; border: 1px solid var(--grau-linie); border-radius: 8px; font-size: 20px; padding: 4px 12px; cursor: pointer; color: var(--blau); }
.hauptnav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.hauptnav a { color: var(--blau); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.hauptnav a:hover { background: var(--grau-bg); }
.hauptnav a.aktiv { background: var(--blau); color: #fff; }
.badge { background: var(--gruen); color: var(--blau); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
/* Unternavigation innerhalb einer Seite (z.B. Einstellungen) */
.unternav { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 20px;
  background: #fff; border: 1px solid var(--grau-linie); border-radius: 999px; padding: 5px;
  box-shadow: 0 1px 3px rgba(1, 86, 148, .06); }
.unternav a { display: inline-flex; align-items: center; gap: 7px; color: var(--blau); text-decoration: none;
  padding: 9px 18px; font-weight: 600; font-size: 14px; border-radius: 999px; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s; }
.unternav a:hover { background: var(--grau-bg); }
.unternav a.aktiv { background: var(--blau); color: #fff; box-shadow: 0 2px 6px rgba(1, 86, 148, .25); }
.unternav a.aktiv:hover { background: var(--blau-dunkel); }
.unternav .symbol { font-size: 15px; line-height: 1; opacity: .85; }
@media (max-width: 700px) {
  .unternav { display: flex; width: 100%; border-radius: var(--radius); }
  .unternav a { flex: 1 1 auto; justify-content: center; padding: 9px 12px; }
}
.nav-benutzer { display: flex; align-items: center; gap: 8px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--grau-linie); }
.nav-name { color: var(--text-leise); font-size: 13px; }
.nav-abmelden { font-size: 13px; color: var(--text-leise) !important; }

@media (max-width: 900px) {
  .nav-knopf { display: block; }
  .hauptnav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .hauptnav.offen { display: flex; }
  .nav-benutzer { margin-left: 0; padding-left: 0; border-left: none; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--grau-linie); }
}

/* ---------- Inhalt ---------- */
.inhalt { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 20px 16px 40px; }
.fussbereich { text-align: center; color: var(--text-leise); font-size: 12px; padding: 16px; }

h1 { font-size: 22px; color: var(--blau); margin: 6px 0 16px; }
h2 { font-size: 17px; color: var(--blau); margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

.karte { background: #fff; border: 1px solid var(--grau-linie); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.karten-reihe { display: grid; gap: 14px; margin-bottom: 16px; }
.karten-reihe.k2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.karten-reihe.k3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.karten-reihe.k4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.kennzahl { text-align: center; padding: 20px 12px; }
.kennzahl .wert { font-size: 28px; font-weight: 700; color: var(--blau); }
.kennzahl .wert.positiv { color: #4a8a1c; }
.kennzahl .wert.negativ { color: #c23b3b; }
.kennzahl .label { color: var(--text-leise); font-size: 13px; margin-top: 2px; }

/* ---------- Formulare ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-leise); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--grau-linie); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(1, 86, 148, .15);
}
/* Suchfeld: Lupe links, natives Kreuz aufgeräumt */
input[type=search] {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6b7a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px 50%; background-size: 16px 16px;
}
input[type=search]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; height: 14px; width: 14px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%235f6b7a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 12px 12px;
}
.formzeile { display: grid; gap: 12px; margin-bottom: 12px; }
.formzeile.f2 { grid-template-columns: 1fr 1fr; }
.formzeile.f3 { grid-template-columns: 1fr 1fr 1fr; }
.formzeile.f4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .formzeile.f2, .formzeile.f3, .formzeile.f4 { grid-template-columns: 1fr; } }
.feld { margin-bottom: 12px; }

.knopf {
  display: inline-block; background: var(--blau); color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.knopf:hover { background: var(--blau-dunkel); }
.knopf.gruen { background: var(--gruen); color: var(--blau); }
.knopf.gruen:hover { background: var(--gruen-dunkel); }
.knopf.leise { background: #fff; color: var(--blau); border: 1px solid var(--grau-linie); }
.knopf.leise:hover { background: var(--grau-bg); }
.knopf.gefahr { background: #fff; color: #c23b3b; border: 1px solid #e6c3c3; }
.knopf.gefahr:hover { background: #fbeeee; }
.knopf.klein { padding: 5px 10px; font-size: 13px; }
.knopf.gross { padding: 14px 28px; font-size: 17px; }
.knopf.breit { width: 100%; }

/* ---------- Tabellen ---------- */
.tabelle-umbruch { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
table.liste th { text-align: left; color: var(--text-leise); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 2px solid var(--grau-linie); white-space: nowrap; }
table.liste td { padding: 9px 10px; border-bottom: 1px solid var(--grau-linie); vertical-align: middle; }
table.liste tr:hover td { background: #f8fafc; }
table.liste td.zahl, table.liste th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.wochenende td { background: #fafbfc; color: var(--text-leise); }
tr.heute td { background: #f4f8e9; }

/* ---------- Status & Etiketten ---------- */
.etikett { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etikett.offen { background: #fff4d6; color: #8a6d1a; }
.etikett.genehmigt { background: #e7f0d3; color: #4a6b12; }
.etikett.abgelehnt { background: #fbe4e4; color: #a33030; }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- Flash ---------- */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-weight: 500; }
.flash-ok { background: #e7f0d3; color: #3d5a0e; border: 1px solid #cfe0a5; }
.flash-fehler { background: #fbe4e4; color: #8f2626; border: 1px solid #eec6c6; }
.flash-info { background: #e2edf6; color: #16466e; border: 1px solid #c4d9ea; }

/* ---------- Timer ---------- */
/* ---------- Stempeluhr: ein grosser Knopf ---------- */
.stempel-karte { text-align: center; padding: 28px 18px 22px; }
.stempel-status { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: var(--text-leise); }
.stempel-uhr {
  font-size: 40px; font-weight: 700; color: var(--blau);
  font-variant-numeric: tabular-nums; line-height: 1.1; margin: 2px 0 2px;
}
.stempel-detail { margin: 0 0 4px; font-size: 13px; color: var(--text-leise); }
.stempel-form { margin: 14px 0 8px; }

.stempel-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  min-width: min(420px, 100%); padding: 20px 46px; border: none; border-radius: 999px;
  font-size: 27px; font-weight: 700; color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  transition: filter .12s, transform .08s, box-shadow .12s;
}
.stempel-knopf svg { width: 34px; height: 34px; flex: 0 0 auto; }
.stempel-knopf.ein { background: #62a94a; }
.stempel-knopf.aus { background: #d1742f; }
.stempel-knopf:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.stempel-knopf:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.stempel-knopf:focus-visible { outline: 3px solid rgba(1, 86, 148, .35); outline-offset: 3px; }

.stempel-zusatz {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 16px auto 0; max-width: 460px; text-align: left;
}
.stempel-zusatz label { display: block; flex: 0 1 120px; font-size: 12px; }
.stempel-zusatz input, .stempel-zusatz select { margin-top: 3px; }
.stempel-zusatz .dehnen { flex: 1 1 200px; }

@media (max-width: 560px) {
  .stempel-knopf { width: 100%; font-size: 23px; padding: 18px 24px; gap: 12px; }
  .stempel-knopf svg { width: 28px; height: 28px; }
  .stempel-uhr { font-size: 34px; }
}

/* ---------- Kalender ---------- */
.kal-tabelle { border-collapse: collapse; width: 100%; font-size: 12px; }
.kal-tabelle th, .kal-tabelle td { border: 1px solid var(--grau-linie); padding: 3px 4px; text-align: center; min-width: 26px; }
.kal-tabelle th.name-spalte, .kal-tabelle td.name-spalte { text-align: left; white-space: nowrap; padding: 4px 8px; min-width: 140px; position: sticky; left: 0; background: #fff; }
.kal-tabelle td.we, .kal-tabelle th.we { background: #eef1f5; }
.kal-tabelle td.ft, .kal-tabelle th.ft { background: #e2edf6; }
/* Feiertag, der nur einen Teil der angezeigten Personen betrifft */
.kal-tabelle th.ft-teil { background: linear-gradient(#e2edf6 55%, #fff 55%); }
.kal-tabelle td.bf, .kal-tabelle th.bf { background: #f0f5d8; }
.kal-tabelle th.heute-spalte { background: var(--gruen); color: var(--blau); }
.kal-zelle { border-radius: 4px; display: block; height: 18px; line-height: 18px; font-size: 10px; font-weight: 700; color: #fff; overflow: hidden; }
.kal-legende { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--text-leise); }

.hinweis { color: var(--text-leise); font-size: 13px; }
.abstand-oben { margin-top: 16px; }
.rechts { text-align: right; }
.zeile-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zeile-flex .dehnen { flex: 1; }

/* ---------- Login ---------- */
.login-seite { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.login-karte { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--grau-linie); border-radius: 16px; padding: 32px; }
.login-karte .logo-mitte { text-align: center; margin-bottom: 8px; }
.login-karte .untertitel { text-align: center; color: var(--text-leise); margin: 0 0 22px; font-size: 14px; }

/* ---------- Klickbare Zeilen & Sprungziel ---------- */
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: #e9f1f8; }
tr:target td { background: #f4f8e9; }

/* ---------- Modal / Popup ---------- */
.modal-hintergrund {
  display: none; position: fixed; inset: 0; background: rgba(20, 32, 45, .5);
  z-index: 200; padding: 40px 16px; overflow: auto;
}
.modal-hintergrund.offen { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: modal-auf .15s ease-out;
}
@keyframes modal-auf { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-schliessen {
  background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer;
  color: var(--text-leise); padding: 0 4px;
}
.modal-schliessen:hover { color: var(--text); }

/* Druck */
@media print {
  .topbar, .fussbereich, .kein-druck { display: none !important; }
  body { background: #fff; }
  .karte { border: none; padding: 0; }
}

/* Sortierbare Spaltentitel */
table.liste th.sortbar { cursor: pointer; user-select: none; padding-right: 18px; position: relative; }
table.liste th.sortbar:hover { color: var(--blau); }
table.liste th.sortbar::after { content: '⇅'; position: absolute; right: 4px; opacity: .35; font-size: 11px; }
table.liste th.sortbar.sort-auf::after { content: '▲'; opacity: .9; color: var(--blau); }
table.liste th.sortbar.sort-ab::after { content: '▼'; opacity: .9; color: var(--blau); }

/* ---------- Hilfe / Anleitung ---------- */
.hilfe-suchzeile { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; flex-wrap: wrap; }
.hilfe-suchzeile input[type=search] { flex: 1 1 320px; max-width: 520px; font-size: 15px; padding: 12px 14px 12px 38px; }
.hilfe-suchzeile .hinweis { white-space: nowrap; }

.hilfe-kacheln { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.hilfe-kachel {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  background: #f7fafc; border: 1px solid var(--grau-linie); border-radius: 12px;
  padding: 12px 14px; color: var(--blau); font-weight: 600; font-size: 14px; line-height: 1.35;
  transition: background .12s, border-color .12s, transform .12s;
}
.hilfe-kachel:hover { background: #fff; border-color: var(--blau); transform: translateY(-1px); }
.hilfe-kachel-symbol {
  flex: 0 0 34px; height: 34px; border-radius: 9px; background: #fff;
  border: 1px solid var(--grau-linie); display: flex; align-items: center; justify-content: center;
}
.hilfe-kachel:hover .hilfe-kachel-symbol { background: var(--gruen); border-color: var(--gruen); }
.hilfe-kachel-symbol svg { width: 18px; height: 18px; }
.hilfe-kachel-titel { min-width: 0; }
@media (max-width: 560px) { .hilfe-kacheln { grid-template-columns: 1fr 1fr; } }

mark.hilfe-treffer { background: #fbf1a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.hilfe-leer { margin: 16px 0 0; }
.hilfe-kapitel { scroll-margin-top: 84px; }

.hilfe-text { margin: 0 0 12px; line-height: 1.6; max-width: 92ch; }
.hilfe-liste { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; max-width: 92ch; }
.hilfe-liste li { margin-bottom: 5px; }
.hilfe-hinweis {
  background: #f6f9fb; border-left: 3px solid var(--gruen); border-radius: 8px;
  padding: 12px 14px; margin: 0 0 14px; max-width: 92ch;
}
.hilfe-hinweis strong { color: var(--blau); display: block; margin-bottom: 6px; }
.hilfe-hinweis .hilfe-liste { margin-bottom: 0; }
.hilfe-tabelle td { vertical-align: top; line-height: 1.55; }
.hilfe-tabelle td:first-child { white-space: normal; width: 26%; color: var(--blau); }
.karte h2 .etikett { margin-left: 8px; vertical-align: 3px; }

/* Abwesenheiten, Feiertage und Betriebsferien in der Wochenübersicht */
.abwesenheit-zeile { align-items: center; gap: 8px; }
.abwesenheit-zeile.offen { opacity: .8; }
.abwesenheit-zeile.offen strong { font-weight: 600; }
