/* Zeiterfassung Förde Baumarkt — eigenes, leichtes CSS ohne Framework.
   Mobile first (Abschnitt 10): Tab-Leiste unten, große Touch-Ziele. */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #5b6b7b;
  --line: #dbe2e8;
  --accent: #dd1818;        /* Hausfarbe Förde Baumarkt */
  --accent-ink: #ffffff;    /* Weiß auf Hausfarbe: Kontrast 4,98:1 (WCAG AA) */
  --accent-soft: #fdeaea;   /* heller Ton der Hausfarbe: „heute“, „ungelesen“ */
  --warn: #b7791f;
  --error: #b23232;
  --gruen: #d7efdc;
  --gelb: #fdeec8;
  --rot: #f6d3d3;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  padding-bottom: 76px; /* Platz für die Tab-Leiste */
}

/* --- Kopfzeile --- */
.topbar { background: var(--accent); color: #fff; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.mainnav { display: flex; gap: 6px 4px; flex-wrap: wrap; }
.mainnav a {
  color: #ffe6e6; text-decoration: none; padding: 8px 10px;
  border-radius: 8px; font-size: .95rem;
}
.mainnav a:hover { background: rgba(255,255,255,.15); }
.nav-sep { width: 1px; background: rgba(255,255,255,.4); margin: 4px 6px; }
.cheflink { font-weight: 600; }
.badge {
  /* Bernstein statt Rot: der Zähler sitzt sowohl auf der roten Kopfzeile als
     auch auf der weißen Tab-Leiste und muss auf beidem auffallen. */
  background: #ffb300; color: #1c2733; font-weight: 700; border-radius: 10px;
  padding: 1px 7px; font-size: .75rem; margin-left: 4px;
}
.topright { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.logout { display: flex; align-items: center; gap: 8px; }

/* --- Benachrichtigungsglocke --- */
.notif { position: relative; }
.notif-bell { color: #fff; text-decoration: none; font-size: 1.25rem; position: relative; }
.notif-bell .badge { position: absolute; top: -6px; right: -10px; }
.notif-menu {
  display: none; position: absolute; right: 0; top: 34px; width: 320px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 50;
  overflow: hidden;
}
.notif:hover .notif-menu, .notif:focus-within .notif-menu { display: block; }
.notif-item {
  display: flex; gap: 10px; padding: 10px 12px; text-decoration: none;
  color: var(--ink); border-bottom: 1px solid var(--line);
}
.notif-item:hover { background: #f0f4f7; }
.notif-item.unread { background: var(--accent-soft); }
.notif-ico { font-size: 1.2rem; }
.notif-all { display: block; text-align: center; padding: 10px; font-weight: 600;
  color: var(--accent); text-decoration: none; }
.notif-enable {
  position: fixed; left: 12px; bottom: 88px; z-index: 60;
  background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 999px;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.2); font-size: .9rem;
}
.tab-notif { position: relative; }
.tab-badge { position: absolute; top: 2px; right: 24px; }

/* --- Fußzeile mit Notfallnummern --- */
.sitefooter { background: #263238; color: #cfd8dc; margin-top: 24px; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 16px;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center; font-size: .95rem;
}
.footer-inner a { color: #ffd54f; text-decoration: none; font-weight: 600; }

/* --- gemeinsame Statusfarben (Team, Wochenplan, Matrix) --- */
.status-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; font-size: .9rem; }
.status-legend span.item { display: inline-flex; align-items: center; gap: 6px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .88rem; }
.chip-schicht { background: #eef7f1; }
.chip-springer { background: #dceaf8; font-weight: 600; }
.chip-frei { background: var(--gruen); font-weight: 700; }
.chip-urlaub { background: #cfe3f8; }
.chip-abwesend { background: var(--rot); }
.chip-leer { background: #eee; color: var(--muted); }
.username { opacity: .9; }
.linkbtn {
  background: none; border: 1px solid rgba(255,255,255,.5); color: #fff;
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}

/* --- Inhalt --- */
.content { max-width: 1200px; margin: 0 auto; padding: 28px 16px 24px; }
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpi { font-size: 1.7rem; font-weight: 700; }
.kpi small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); }
.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; }
.msg-success { background: var(--gruen); }
.msg-warning { background: var(--gelb); }
.msg-error { background: var(--rot); }
.msg-info { background: #dbeafe; }

/* --- Tabellen --- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: .92rem; }
th { background: #eef2f5; }
tr.inactive { opacity: .5; }

/* --- Abstand beim Zeilenumbruch ------------------------------------------
   Buttons, Pillen und Chips sind inline-block. Stehen mehrere nebeneinander
   und brechen auf schmalen Schirmen um, liegen die Zeilen ohne senkrechten
   Aussenabstand direkt aufeinander — die einzelnen Elemente sind dann nicht
   mehr voneinander zu unterscheiden. Deshalb hier zentral statt an jeder
   Einzelstelle. Der grosse Stempel-Button ist ausgenommen, er bleibt mittig.
   Behaelter mit "display: flex" brauchen das nicht, die haben "gap". */
.btn:not(.btn-big), .pill, .chip { margin: 6px 8px 6px 0; }

/* --- Buttons & Formulare --- */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 10px; padding: 12px 20px;
  font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.08); }
.btn-secondary { background: #63707d; }
/* Dunkler als die Hausfarbe — sonst sähe „Deaktivieren“ aus wie ein
   gewöhnlicher Button, seit die Hausfarbe selbst rot ist. */
.btn-danger { background: #8a1010; }
.btn-big {
  width: 100%; max-width: 420px; padding: 26px; font-size: 1.5rem;
  border-radius: 16px; display: block; margin: 0 auto;
}
form.inline { display: inline; }
label { display: block; margin: 10px 0 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; max-width: 420px; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 1rem; background: #fff;
}
input[type="checkbox"] { width: auto; }
ul.checkboxlist { list-style: none; padding: 0; margin: 4px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.helptext { color: var(--muted); font-size: .85rem; display: block; }
.errorlist { color: #b32; margin: 4px 0; padding-left: 18px; }

/* --- Stempeluhr --- */
.clockstate { text-align: center; font-size: 1.1rem; margin: 10px 0; }
.stempel-extra { text-align: center; margin-top: 14px; }

/* --- Plan-Liste --- */
.dayrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-bottom: 1px solid var(--line);
}
.dayrow:last-child { border-bottom: none; }
.dayrow.today { background: var(--accent-soft); border-radius: 8px; }
.dayrow .daydate { min-width: 110px; font-weight: 600; }
.pill {
  border-radius: 999px; padding: 4px 12px; font-size: .9rem;
  background: #e8edf1; display: inline-block;
}
.pill.frei { background: var(--gruen); font-weight: 700; }
.pill.urlaub { background: #cfe3f8; }
.pill.krank { background: var(--rot); }
.pill.zu { background: #e3e3e3; color: var(--muted); }
.longweekend {
  background: linear-gradient(120deg, #d7efdc, #eaf5ee);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px; font-size: 1.05rem;
}

/* --- Urlaubskalender-Ampel --- */
.calmonth { display: inline-block; vertical-align: top; margin: 0 16px 16px 0; }
.calmonth table { width: auto; }
.calmonth td { width: 44px; height: 44px; text-align: center; padding: 2px; }
.cal-gruen { background: var(--gruen); }
.cal-gelb { background: var(--gelb); }
.cal-rot { background: var(--rot); }
.cal-zu { background: #ececec; color: #aaa; }
.cal-blocked {
  background: repeating-linear-gradient(45deg,#d9d9d9,#d9d9d9 3px,#bcbcbc 3px,#bcbcbc 6px);
  color: #555;
}
.cal-past { opacity: .45; }
.cal-ferien { outline: 2px dashed #7aa7d9; outline-offset: -3px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; font-size: .9rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* --- Dienstplan-Raster / Matrix --- */
.grid td { text-align: center; min-width: 130px; padding: 4px; }
.grid td.rotfrei { background: var(--gruen); }
.grid td.springer { background: #dceaf8; }
/* Uhrzeiten müssen vollständig lesbar sein — feste Breite statt Abschneiden */
.grid select {
  width: 122px; max-width: none; padding: 5px 4px;
  font-size: .84rem; font-variant-numeric: tabular-nums;
}

/* Gesund-melden-Formular in der Abwesenheitenliste */
.gesundform { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.gesundform input[type="date"] { width: auto; min-width: 140px; padding: 6px; }
.krankliste .btn { white-space: nowrap; padding: 8px 12px; }

/* Formular für eigene Uhrzeiten */
.zeitform { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.zeitfeld { display: flex; flex-direction: column; }
.zeitfeld label { margin: 0 0 4px; font-size: .85rem; }
.zeitfeld input, .zeitfeld select { width: auto; min-width: 130px; }
.zeitfeld input[type="time"] { min-width: 110px; }
.springer-tag { display: block; color: #17558c; font-weight: 700; }
.matrix td { padding: 2px; min-width: 24px; text-align: center; font-size: .72rem; }
.matrix .m-zeit { display: block; font-size: .62rem; line-height: 1.15; white-space: nowrap; }
.matrix .m-schicht { background: #eef7f1; font-weight: 700; }
.matrix .m-frei { background: var(--gruen); }
.matrix .m-urlaub { background: #cfe3f8; }
.matrix .m-krank { background: var(--rot); }
.matrix .m-zu { background: #ececec; }
.matrix .m-we { box-shadow: inset 0 0 0 99px rgba(0,0,0,.03); }
.matrix .m-we-h { background: #e3e9ee; }

/* --- Team-Wochenplan --- */
.teamweek td { text-align: center; min-width: 96px; white-space: nowrap; }
.teamweek .tw-schicht { background: #eef7f1; }
.teamweek .tw-springer { background: #dceaf8; }
.teamweek .tw-frei { background: var(--gruen); }
.teamweek .tw-urlaub { background: #cfe3f8; }
.teamweek .tw-abwesend { background: #eee; color: var(--muted); }
.teamweek .today-col { background: #d9ead3; }
tr.merow td { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }

@media print {
  .topbar, .tabbar, .noprint, .helptext, .msg, .notif-enable { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { border: none; box-shadow: none; page-break-inside: avoid; }
  .sitefooter { background: #fff !important; color: #000 !important; margin-top: 12px;
    border-top: 1px solid #000; }
  .sitefooter a { color: #000 !important; }
}

/* --- Untere Tab-Leiste (mobil) --- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 4px 10px;
  text-decoration: none; color: var(--ink); font-size: .8rem; min-height: 44px;
  /* Bis zu sechs Einträge (mit Chef-Zugang) müssen nebeneinander passen,
     ohne dass Beschriftungen umbrechen. */
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab-ico { display: block; font-size: 1.3rem; }

@media (max-width: 400px) {
  .tabbar a { font-size: .7rem; padding-left: 2px; padding-right: 2px; }
  .tab-badge { right: 12px; }
}

@media (min-width: 1024px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 1023px) {
  .mainnav { display: none; }   /* mobil: Tab-Leiste statt Seitenmenü */
  .logout { margin-left: auto; }
}
