/* TP-Retail Intranet — mobil zuerst, Desktop ab 900px */

:root {
  --rot: #e30613;
  --rot-dunkel: #b3040f;
  --anthrazit: #2f3640;
  --anthrazit-hell: #3d4552;
  --text: #22262c;
  --text-leise: #6b7280;
  --linie: #dfe3e8;
  --flaeche: #f4f6f8;
  --weiss: #fff;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--flaeche);
  color: var(--text);
  font: 16px/1.55 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
a { color: var(--rot-dunkel); }
a:hover { color: var(--rot); }

:focus-visible { outline: 3px solid var(--rot); outline-offset: 2px; }

/* ---------------------------------------------------------------- Kopfbereich */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1rem;
  background: var(--weiss); border-bottom: 3px solid var(--rot);
}

.brand {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: .04em;
  color: var(--text); text-decoration: none;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 1.9em; height: 1.9em; border-radius: 50%;
  background: var(--rot); color: #fff; font-size: .72em; letter-spacing: 0;
}
.brand-lg { font-size: 1.5rem; margin-bottom: 1.5rem; }

.topbar-user { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.topbar-name { color: var(--text-leise); }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--rot-dunkel); font: inherit; text-decoration: underline;
}

/* ---------------------------------------------------------------- Navigation */

/* Kopf und Navigation bleiben beim Scrollen stehen, sonst verliert man auf
   langen Seiten den Weg zurück. */
.topbar { position: sticky; top: 0; z-index: 20; }

.mainnav {
  position: sticky; top: 3.1rem; z-index: 19;
  display: flex; gap: .15rem; overflow-x: auto;
  background: var(--anthrazit); padding: 0 .35rem;
  scrollbar-width: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.mainnav::-webkit-scrollbar { display: none; }

.mainnav a {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  min-width: 4.4rem; padding: .5rem .45rem .45rem;
  color: #aab3bf; text-decoration: none;
  font-size: .72rem; line-height: 1.2; text-align: center; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.mainnav svg {
  width: 21px; height: 21px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.mainnav a:hover { color: #fff; background: var(--anthrazit-hell); }
.mainnav a.is-active {
  color: #fff; background: var(--anthrazit-hell);
  border-bottom-color: var(--rot);
}
.mainnav a.is-active svg { stroke: var(--rot); stroke-width: 2; }

/* ------------------------------------------------------------------- Flächen */

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.panel {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.panel-alert { border-left: 4px solid var(--rot); }

.grid { display: grid; gap: 1rem; }

.card {
  max-width: 26rem; margin: 3rem auto; padding: 1.75rem;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
}
body.plain { display: block; padding: 0 1rem; }

/* ------------------------------------------------------------------ Formulare */

.stack { display: grid; gap: .9rem; }
.stack label { display: grid; gap: .3rem; font-size: .875rem; color: var(--text-leise); }
.row { display: grid; gap: .9rem; }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text);
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { border-color: var(--rot); }

.check { display: flex !important; flex-direction: row; align-items: center; gap: .5rem; }
.check input[type=checkbox], .check input[type=radio] { width: auto; flex: 0 0 auto; }

.btn {
  display: inline-block; padding: .6rem 1.1rem; font: inherit; cursor: pointer;
  text-align: center; text-decoration: none;
  color: var(--text); background: var(--weiss);
  border: 1px solid var(--linie); border-radius: var(--radius);
}
.btn:hover { border-color: var(--text-leise); color: var(--text); }
.btn-primary { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn-primary:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); color: #fff; }
.btn-small { padding: .35rem .7rem; font-size: .8rem; }

.filters { display: grid; gap: .5rem; margin-bottom: 1rem; }

/* -------------------------------------------------------------------- Inhalte */

.muted { color: var(--text-leise); font-size: .875rem; }
.hint { color: var(--text-leise); font-size: .8rem; margin: -.4rem 0 0; }
.date { color: var(--text-leise); font-variant-numeric: tabular-nums; margin-right: .4rem; white-space: nowrap; }

.tag {
  display: inline-block; padding: .1rem .45rem; border-radius: 3px;
  background: var(--flaeche); border: 1px solid var(--linie);
  font-size: .75rem; color: var(--text-leise);
}

.list { margin: 0; padding-left: 1.1rem; }
.list li + li { margin-top: .5rem; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.people li { display: flex; align-items: center; gap: .6rem; }
.people img { border-radius: 50%; object-fit: cover; }

.preview { border-radius: var(--radius); border: 1px solid var(--linie); }

.notice { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; font-size: .9rem; }
.notice-error { background: #fdecee; border: 1px solid #f5c2c7; color: #8a1220; }
.notice-warn  { background: #fff7e6; border: 1px solid #f2d492; color: #7a5600; }
.notice-info  { background: #eef4fb; border: 1px solid #c7dbf2; color: #1d4771; }

/* --------------------------------------------------------------------- Tabelle */

.table { width: 100%; border-collapse: collapse; background: var(--weiss); font-size: .9rem; }
.table th, .table td {
  padding: .6rem .5rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--linie);
}
.table th { font-size: .78rem; text-transform: none; color: var(--text-leise); font-weight: 600; }
.table tbody tr:hover { background: #fafbfc; }
.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-right: .25rem; }

.table-scroll { overflow-x: auto; }

.foot {
  padding: 1.5rem 1rem; text-align: center;
  color: var(--text-leise); font-size: .8rem;
}

/* --------------------------------------------------------------------- Desktop */

@media (min-width: 700px) {
  .row { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 2fr 1fr 1fr auto auto; align-items: center; }
  .form-wide { max-width: 44rem; }
}

@media (min-width: 900px) {
  h1 { font-size: 1.85rem; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------- Footer mit Kontakten */

.siteinfo {
  margin-top: 2rem;
  background: var(--anthrazit);
  color: #c9cfd8;
  font-size: .85rem;
}
.siteinfo-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; gap: 1.5rem;
  padding: 2rem 1rem;
}
.siteinfo h2 {
  margin: 0 0 .75rem;
  font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: #fff;
}
.siteinfo h2::after {
  content: ""; display: block; width: 2rem; height: 2px;
  margin-top: .4rem; background: var(--rot);
}
.siteinfo p { margin: 0 0 1rem; line-height: 1.7; }
.siteinfo .contact strong { color: #fff; font-weight: 600; }
.siteinfo a { color: #c9cfd8; text-decoration: none; }
.siteinfo a:hover { color: #fff; text-decoration: underline; }

.siteinfo-bottom {
  margin: 0; padding: .9rem 1rem;
  border-top: 3px solid var(--rot);
  text-align: center; font-size: .8rem; color: #98a2b0;
}

@media (min-width: 700px) {
  .siteinfo-inner { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
}

/* ------------------------------------------------------------------ Teamseite */

.teamfilter { display: grid; gap: .5rem; margin-bottom: 1rem; }
.filterrow { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.filterlabel {
  width: 100%; font-size: .78rem; color: var(--text-leise);
  text-transform: uppercase; letter-spacing: .04em;
}
.chip {
  padding: .35rem .75rem; font: inherit; font-size: .82rem; cursor: pointer;
  background: var(--weiss); color: var(--text);
  border: 1px solid var(--linie); border-radius: 999px;
}
.chip:hover { border-color: var(--text-leise); }
.chip.is-active { background: var(--anthrazit); border-color: var(--anthrazit); color: #fff; }

.teamgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.teamcard a {
  display: block; height: 100%; text-decoration: none; color: inherit;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  overflow: hidden;
}
.teamcard a:hover { border-color: var(--rot); }
.teamcard img {
  display: block; width: 100%;
  height: auto;
  /* Quadratisch und mittig wie im alten Intranet. Neun Fotos liegen bereits
     quadratisch vor und bleiben damit unangetastet. */
  aspect-ratio: 1 / 1; object-fit: cover; object-position: center;
  background: var(--flaeche);
}
.initials {
  display: grid; place-items: center; align-content: center; gap: .25rem;
  width: 100%; aspect-ratio: 1 / 1;
  background: var(--flaeche);
}
.initials-text {
  color: var(--anthrazit); font-size: 2rem; font-weight: 700; letter-spacing: .05em;
}
.initials-note {
  color: var(--rot); font-size: .7rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.teamcard-body { display: block; padding: .6rem .7rem; }
.teamcard-body strong { display: block; font-size: .92rem; }
.teamcard-body .muted { display: block; font-size: .78rem; line-height: 1.35; }
.teamcard-body .tag { margin-top: .3rem; }

/* ---------------------------------------------------------------- Einzelprofil */

.profile { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
.profile-photo {
  display: grid; place-items: center;
  max-width: 300px; padding: .4rem;
  background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius);
}
/* Auf der Profilseite wird nicht zugeschnitten: das Bild wird vollständig
   gezeigt, egal welches Seitenverhältnis es mitbringt. */
.profile-photo img {
  display: block; max-width: 100%; max-height: 420px;
  width: auto; height: auto;
  border-radius: 3px;
}
.profile-photo .initials-lg { width: 100%; aspect-ratio: 1 / 1; border-radius: 3px; }
.initials-lg { gap: .5rem; }
.initials-lg .initials-text { font-size: 3.5rem; }
.initials-lg .initials-note { font-size: .85rem; }
.profile-text h1 { margin-bottom: .2rem; }
.profile-role {
  margin: 0 0 1rem; color: var(--rot-dunkel);
  font-size: .9rem; text-transform: uppercase; letter-spacing: .04em;
}
.contactlist { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .92rem; }
.contactlist dt { color: var(--text-leise); }
.contactlist dd { margin: 0; }

@media (min-width: 700px) {
  .teamgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .profile { grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }
}

/* ----------------------------------------------------------------- Dokumente */

.docgroup { margin-bottom: 1.5rem; }
.docgroup h2 {
  padding-bottom: .4rem; border-bottom: 2px solid var(--rot);
  font-size: 1rem; text-transform: uppercase; letter-spacing: .03em;
}

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { border-bottom: 1px solid var(--linie); }
.doclist li:last-child { border-bottom: 0; }
.doclist a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem;
  padding: .7rem .25rem; text-decoration: none; color: var(--text);
}
.doclist a:hover { background: var(--weiss); color: var(--rot-dunkel); }
.doc-title { flex: 1 1 14rem; font-size: .95rem; }
.doc-meta { color: var(--text-leise); font-size: .78rem; white-space: nowrap; }
.doclist p { margin: 0 0 .5rem .25rem; }

.scopes { border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; }
.scopes legend { padding: 0 .4rem; font-size: .875rem; color: var(--text-leise); }
.scopegrid { display: grid; gap: 1rem; margin-top: .5rem; }
.scopegrid strong { display: block; margin-bottom: .4rem; font-size: .85rem; }
.scopegrid .check { font-size: .85rem; margin-bottom: .2rem; }
form.inline { display: inline; }

@media (min-width: 700px) {
  .scopegrid { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ Kalender */

.calhead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: .75rem;
}
.calhead strong { font-size: 1.05rem; }

.calendar { width: 100%; min-width: 620px; border-collapse: collapse; background: var(--weiss); }
.calendar th {
  padding: .45rem .3rem; background: var(--rot); color: #fff;
  font-size: .78rem; font-weight: 600;
}
.calendar td {
  width: 14.28%; height: 5.5rem; padding: .3rem; vertical-align: top;
  border: 1px solid var(--linie);
}
.calendar .daynum { display: block; font-size: .78rem; color: var(--text-leise); }
.calendar .is-other { background: #fafbfc; }
.calendar .is-other .daynum { opacity: .45; }
.calendar .is-weekend { background: #fcfcfd; }
.calendar .is-today { outline: 2px solid var(--rot); outline-offset: -2px; }
.calendar .is-today .daynum { color: var(--rot); font-weight: 700; }

.event {
  display: block; margin-top: .2rem; padding: .15rem .35rem; border-radius: 3px;
  font-size: .72rem; line-height: 1.3; color: #fff; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.event:hover { color: #fff; filter: brightness(1.1); }
.event-rot { background: var(--rot); }
.event-blau { background: #2563a8; }
.event-gruen { background: #3d8b45; }
.event-orange { background: #c2680c; }
.event-grau { background: #5a6472; }

tr.is-past td { color: var(--text-leise); }
textarea { min-height: 6rem; resize: vertical; }

/* ------------------------------------------------------------------- Galerie */

.albumgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.albumgrid a {
  display: block; text-decoration: none; color: inherit; overflow: hidden;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
}
.albumgrid a:hover { border-color: var(--rot); }
.albumgrid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.albumcard-body { display: block; padding: .7rem .8rem; }
.albumcard-body strong { display: block; }
.albumcard-body .muted { font-size: .8rem; }

.photogrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.photogrid img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 3px; background: var(--flaeche);
}
.photogrid a { display: block; }
.photogrid a:hover img { opacity: .85; }
.photogrid-admin li { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .3rem; }
.photoactions { display: flex; justify-content: space-between; gap: .3rem; font-size: .72rem; padding: .25rem .1rem 0; }
.photoactions button[disabled] { color: var(--text-leise); text-decoration: none; cursor: default; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 3rem 1rem; background: rgba(20, 22, 26, .92);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer;
  color: #fff; font-size: 2.5rem; line-height: 1; padding: .5rem 1rem;
}
.lb-close { top: .25rem; right: .5rem; }
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.lb-download { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); }

@media (min-width: 700px) {
  .photogrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
}

/* ---------------------------------------------------------------- Belehrungen */

.pdfrahmen {
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--weiss); overflow: hidden; margin-bottom: 1rem;
}
.pdfrahmen object { display: block; width: 100%; height: 60vh; min-height: 320px; }
.pdfrahmen p { padding: 1rem; margin: 0; }

.scopes .check input[type=radio] { flex: 0 0 auto; }
.scopes .check + .check { margin-top: .35rem; }
code { font-size: .85em; background: var(--flaeche); padding: .1rem .3rem; border-radius: 3px; }

/* --------------------------------------------------------- Untermenü Verwaltung */

.subnav {
  position: sticky; top: 6.9rem; z-index: 18;
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none;
  padding: 0 .5rem; background: var(--weiss); border-bottom: 1px solid var(--linie);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: 0 0 auto; padding: .7rem .8rem; white-space: nowrap;
  color: var(--text-leise); text-decoration: none; font-size: .88rem;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--text); }
.subnav a.is-active { color: var(--text); border-bottom-color: var(--rot); font-weight: 600; }

/* ------------------------------------------------------- Hintergrundaufgaben */

.fortschritt { display: grid; gap: .4rem; }
.balken {
  display: block; height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(29, 71, 113, .15);
}
.balken span { display: block; height: 100%; width: 0; background: #2563a8; transition: width .4s ease; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------- Fragen bearbeiten */

.frage { display: grid; gap: .75rem; }
.frage textarea { min-height: 0; resize: vertical; }
.antworten { display: grid; gap: .5rem; }
.antwort {
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem .5rem; border: 1px solid var(--linie); border-radius: var(--radius);
}
.antwort input[type=radio] { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; accent-color: #3d8b45; }
.antwort input[type=text], .antwort input:not([type]) { flex: 1 1 auto; border: 0; padding: .35rem .25rem; }
.antwort:has(input[type=radio]:checked) { border-color: #3d8b45; background: #f1f8f2; }
.frage-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.frage-fuss form { margin: 0; }

/* --------------------------------------------------------------- Geburtstage */

.panel-geburtstag { border-left: 4px solid #3d8b45; background: #f4faf5; }
.panel-geburtstag h2 { color: #2c6b33; }
.people .muted { margin-left: auto; font-size: .8rem; }

/* ----------------------------------------------------------------- Umfragen */

.ergebniszeile {
  display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto;
  align-items: center; gap: .75rem; margin-bottom: .5rem; font-size: .9rem;
}
.ergebniszeile .balken { height: 10px; }
.balken-wert { display: block; height: 100%; width: 0; background: var(--rot); border-radius: 3px; }
/* .stack label setzt display:grid und ist spezifischer als .antwort allein.
   Deshalb hier ausdrücklich nachziehen, sonst rutscht die Antwort unter den Punkt. */
.stack .antwort, .antworten .antwort {
  display: flex; flex-direction: row; align-items: center; gap: .6rem;
}
.antwort > span { flex: 1 1 auto; }

.umbruch { white-space: pre-wrap; }

/* --------------------------------------------------- Suche, Shops, Störungen */

.topsuche { margin-left: auto; }
.topsuche input {
  width: 8rem; padding: .35rem .6rem; font-size: .85rem;
  border: 1px solid var(--linie); border-radius: 999px;
}
.topsuche input:focus { width: 12rem; }

.shopgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.shopgrid a {
  display: grid; gap: .15rem; padding: .9rem 1rem; height: 100%;
  background: var(--weiss); border: 1px solid var(--linie);
  border-left: 3px solid var(--rot); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.shopgrid a:hover { border-color: var(--rot); }
.shopgrid .muted { font-size: .82rem; }

.panel-stoerung { border-left: 4px solid #c2680c; background: #fffaf3; }
.panel-stoerung h2 { color: #8a4a06; }

@media (min-width: 700px) {
  .topsuche input { width: 11rem; }
  .topsuche input:focus { width: 16rem; }
}

/* Datumsangaben hervorheben, wo sie die eigentliche Information sind */
.date-fett { font-weight: 600; color: var(--text); }

@media (min-width: 900px) {
  /* Auf breiten Bildschirmen Symbol und Beschriftung nebeneinander */
  .mainnav { gap: .1rem; padding: 0 .75rem; }
  .mainnav a {
    flex-direction: row; gap: .45rem; min-width: 0;
    padding: .7rem .85rem; font-size: .88rem;
  }
}
