/* ═══════════════════════════════════════════════════════════
   Meine Schichten (my_activities.html)
   Ist/Soll + Balken, Schichten nach Tag gruppiert, aufklappbar
   mit Zeitstrahl und Zeile zum Stundenzettel
   ═══════════════════════════════════════════════════════════ */

body[data-page="my_activities"] {
  margin: 0;
  /* Kein padding:0 — die Seite hat den echten Fixed-Header (#mainHeader),
     die globale body-Regel braucht das reservierte padding-top. */
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  background: var(--color-background);
  font-family: var(--font-main);
}

.mha-page {
  /* Unten Luft, damit der KI-Button die letzte (aufgeklappte) Schicht nicht verdeckt */
  padding: 0 16px 180px;
  margin: 0;
  max-width: 100%;
}

/* Page-Header: Back-Button + Titel, ohne Box */
.mha-pageheader {
  display: flex;
  align-items: center;
  gap: var(--space-s, 10px);
  padding: 16px 0 0;
  margin: 0 0 16px;
}
.mha-pageheader__text { flex: 1; min-width: 0; }
.mha-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-black, #0f172a);
  line-height: 1.2;
}

/* Zeitraum: Segment-Schalter */
.mha-periods {
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 12px;
}
.mha-period {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}
.mha-period.is-active { background: var(--color-accent); color: #fff; }

/* Ist/Soll + Balken */
.mha-sum {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px 12px;
}
.mha-sum:empty { display: none; }
.mha-sum__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.mha-sum__ist { flex: 1; min-width: 0; }
.mha-sum__big { font-size: 24px; font-weight: 700; color: var(--color-black, #0f172a); }
.mha-sum__big span { font-size: 12px; font-weight: 500; color: #6b7280; }
.mha-sum__bar {
  height: 6px;
  max-width: 180px;
  margin-top: 6px;
  border-radius: 3px;
  background: #eef2f7;
  overflow: hidden;
}
.mha-sum__bar i { display: block; height: 100%; background: var(--color-accent); border-radius: 3px; }
.mha-sum__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}
.mha-sum__arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.mha-sum__arrow svg { width: 14px; height: 14px; }
.mha-sum__arrow:disabled { opacity: 0.35; cursor: default; }

.mha-bars {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 110px;
  margin-top: 14px;
}
.mha-bars__col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  position: relative;
  z-index: 1;
}
.mha-bars__col i {
  width: 100%;
  min-height: 3px;
  border-radius: 6px;
  background: var(--color-accent-light, #e3eefb);
}
.mha-bars__col.has-value i { background: color-mix(in srgb, var(--color-accent) 45%, #fff); }
.mha-bars__col.is-current i { background: var(--color-accent); }
.mha-bars__col em { font-style: normal; font-size: 10px; font-weight: 700; color: #6b7280; min-height: 12px; }
.mha-bars__col.is-current em { color: var(--color-accent); }
.mha-bars__col span { font-size: 10px; font-weight: 600; color: #6b7280; white-space: nowrap; }
.mha-bars__col.is-current span { color: var(--color-accent); }
.mha-bars__soll {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px dashed #94a3b8;
  pointer-events: none;
  z-index: 2;
}

/* Liste: Tages-Gruppen */
.mha-list { display: flex; flex-direction: column; }
.mha-day__title {
  display: flex;
  justify-content: space-between;
  margin: 18px 4px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}
.mha-day__card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

/* Schicht-Zeile */
.mha-shift { --mha-ease: cubic-bezier(0.4, 0, 0.2, 1); }
.mha-shift + .mha-shift { border-top: 1px solid #eef1f5; }
.mha-shift__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.mha-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mha-tile svg { width: 18px; height: 18px; }
.mha-tile--neutral { background: var(--color-accent-light, #e3eefb); color: var(--color-accent); }
.mha-tile--green { background: #dcfce7; color: #15803d; }
.mha-tile--amber { background: #fef3c7; color: #b45309; }
.mha-tile--red { background: #fee2e2; color: #b91c1c; }
.mha-shift__body { flex: 1; min-width: 0; }
.mha-shift__times { font-size: 14px; font-weight: 700; color: var(--color-black, #0f172a); }
.mha-shift__sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mha-todo { font-weight: 600; }
.mha-todo--amber { color: #b45309; }
.mha-todo--red { color: #b91c1c; }
.mha-live {
  font-size: 9px;
  font-weight: 800;
  color: #059669;
  background: #d1fae5;
  padding: 1px 6px;
  border-radius: 5px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.mha-shift__hours { font-size: 14px; font-weight: 700; color: var(--color-black, #0f172a); white-space: nowrap; }
.mha-shift__chevron { width: 20px; height: 20px; color: #94a3b8; transition: transform var(--mha-dur, 0.3s) var(--mha-ease); flex-shrink: 0; }
.mha-shift.is-open .mha-shift__chevron { transform: rotate(180deg); }

/* Aufgeklappt: Höhe über grid-rows 0fr → 1fr animiert, Inhalt blendet mit ein */
.mha-shift__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--mha-dur, 0.3s) var(--mha-ease);
}
.mha-shift.is-open .mha-shift__detail { grid-template-rows: 1fr; }
.mha-shift__inner {
  min-height: 0;
  overflow: hidden;
  box-shadow: inset 0 1px 0 transparent;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity calc(var(--mha-dur, 0.3s) * 0.8) ease, transform var(--mha-dur, 0.3s) var(--mha-ease), box-shadow 0.2s;
}
.mha-shift.is-open .mha-shift__inner {
  box-shadow: inset 0 1px 0 #eef1f5;
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--mha-dur, 0.3s) * 0.15);
}
@media (prefers-reduced-motion: reduce) {
  .mha-shift__detail, .mha-shift__inner, .mha-shift__chevron { transition: none; }
}

/* Zeitstrahl: Icons sitzen auf der Linie */
.mha-tl { position: relative; padding: 8px 14px 6px; }
.mha-tl::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 26px;
  bottom: 26px;
  width: 2px;
  background: #dbe4ef;
}
.mha-tl__item { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.mha-tl__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #fff;
  position: relative;
  z-index: 1;
}
.mha-tl__icon svg { width: 14px; height: 14px; }
.mha-tl__icon--shift { background: var(--color-accent-light, #e3eefb); color: var(--color-accent); }
.mha-tl__icon--break { background: #fef3c7; color: #d97706; }
.mha-tl__icon--project { background: #d1fae5; color: #059669; }
.mha-tl__main { flex: 1; min-width: 0; }
.mha-tl__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-black, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mha-tl__time { font-size: 12px; font-weight: 500; color: #6b7280; }
.mha-tl__dur { font-size: 12px; font-weight: 700; color: var(--color-black, #0f172a); white-space: nowrap; }
.mha-tl__dur--break { color: #d97706; }
.mha-tl__dur--project { color: #059669; }
.mha-tl__gap { font-size: 11px; color: #94a3b8; padding-left: 44px; }

/* Zeile zum Stundenzettel */
.mha-sheet {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 28px);
  margin: 4px 14px 14px;
  padding: 10px 12px;
  border: 1px solid #eef1f5;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mha-sheet .mha-tl__icon { box-shadow: none; border-radius: 10px; }
.mha-sheet__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mha-sheet__name { font-size: 12px; font-weight: 700; color: var(--color-black, #0f172a); }
.mha-sheet__status { font-size: 12px; font-weight: 500; color: #6b7280; }
.mha-sheet__status.mha-todo--amber,
.mha-sheet__status.mha-todo--red { font-weight: 600; }
.mha-sheet__arrow { display: flex; color: #94a3b8; }
.mha-sheet__arrow svg { width: 14px; height: 14px; }

/* "+ N kurze Stempelungen" */
.mha-more {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid #eef1f5;
  background: none;
  font: inherit;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  text-align: left;
}
.mha-more span { color: var(--color-accent); font-weight: 600; }

/* Empty / Loading */
.mha-empty {
  margin-top: 16px;
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  background: #fff;
  border-radius: 16px;
}
.mha-empty__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.mha-empty__icon svg { width: 24px; height: 24px; color: #94a3b8; }
.mha-empty__title { font-size: 14px; font-weight: 700; color: #475569; margin-bottom: 4px; }
.mha-empty__sub { font-size: 12px; color: #94a3b8; }

.mha-loading {
  text-align: center;
  padding: 48px 12px;
  color: #64748b;
  font-size: 14px;
}

/* Bearbeitet-Hinweis + gestempelter Wert (durchgestrichen) neben der Zettelzeit */
.mha-edited { color: #b45309; font-weight: 600; }
.mha-tl__was { color: #94a3b8; font-weight: 500; margin-left: 2px; }
