/* Redesign 2026-11: Kopfleiste, Navigation und App-Layout mit einzeln scrollenden Spalten. */

/* Kopfleiste: eine Zeile */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  min-height: 64px;
  margin-bottom: 16px;
  padding: 10px 20px;
  border-radius: 14px;
  border-top: 3px solid var(--brand);
}
.page-header .welcome {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.page-header .brand-logo {
  width: 108px;
  margin: 0;
  padding-right: 16px;
  border-right: 1px solid #3a3735;
}
.page-header .eyebrow {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.page-header h1 {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  white-space: nowrap;
}
.page-header .lead {
  margin: 0;
  color: #d7d3cf;
  font-size: .85rem;
}
.page-header .welcome > h1::after { content: " ·"; color: #8a837c; font-weight: 400; }

/* Umschalter Meine Aufgaben | Geteilt */
.page-header .task-views {
  margin: 0;
  padding: 3px;
  gap: 2px;
  border: 0;
  border-radius: 10px;
  background: #2a2826;
}
.page-header .task-views button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  font-size: .82rem;
}
.page-header .task-views button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.page-header .task-views button[aria-pressed="false"] { background: transparent; color: #d7d3cf; }
.page-header .task-views button[aria-pressed="false"]:hover { background: #3a3734; color: #fff; }
.page-header .task-views .count { color: #8a837c; }

/* Werkzeuge rechts */
.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-tools .section-nav {
  margin: 0;
  padding: 0;
  gap: 2px;
  border: 0;
  background: transparent;
}
.page-header .icon-button,
.page-header .icon-button.secondary {
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7d3cf;
}
.page-header .icon-button:hover { background: #2e2c2a; color: #fff; }
.page-header #settings-toggle[aria-expanded="true"] { background: #3a3734; color: #fff; }
main:has(> #workspace-content[hidden]) #settings-toggle { display: none; }

/* Verlauf als Panel unter dem Button */
.header-dashboard {
  position: relative;
  flex-shrink: 0;
  grid-column: auto;
  color: #fff;
}
.header-dashboard .activity-chart { margin: 0; padding: 0; border: 0; }
.header-dashboard .activity-chart > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #d7d3cf;
  font-size: .82rem;
  font-weight: 500;
  list-style: none;
}
.header-dashboard .activity-chart > summary::-webkit-details-marker { display: none; }
.header-dashboard .activity-chart > summary::before {
  content: "";
  width: 18px;
  height: 14px;
  background:
    linear-gradient(var(--brand), var(--brand)) right bottom / 4px 14px no-repeat,
    linear-gradient(#55504c, #55504c) 7px bottom / 4px 6px no-repeat,
    linear-gradient(#55504c, #55504c) left bottom / 4px 9px no-repeat;
}
.header-dashboard .activity-chart > summary:hover,
.header-dashboard .activity-chart[open] > summary { background: #2e2c2a; color: #fff; }
.header-dashboard .chart-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(440px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  border: 1px solid #3a3735;
  border-radius: 12px;
  background: #1c1b1a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.header-dashboard .chart-panel .chart-range { margin-top: 0; font-size: .78rem; }
.header-dashboard .chart-panel select { min-height: 32px; font-size: .82rem; }

/* Konto: Status-Punkt und Abmelden */
.page-header .identity,
.page-header .identity.is-authenticated {
  max-width: none;
  margin: 0 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-header .identity.is-authenticated::before {
  width: 8px;
  height: 8px;
  background: #7fd1a8;
  box-shadow: 0 0 0 3px #2a3a32;
}
.page-header .identity.is-authenticated #identity {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.page-header .identity p { margin: 0; color: #d7d3cf; font-size: .82rem; }
.page-header .identity #entra-login { min-height: 34px; background: #fff; border-color: #fff; color: var(--ink); }
.page-header #logout {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #d7d3cf;
  font-size: .82rem;
}
.page-header #logout:hover { background: #2e2c2a; color: #fff; }

/* Status-Zeile kompakt */
#status { min-height: 0; margin: 0 2px 8px; font-size: .78rem; }
#status:empty { display: none; }

/* Ab 1201 px: Seite in Fensterhöhe, jede Spalte scrollt für sich */
@media (min-width: 1201px) {
  main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .page-header { flex: none; }
  #workspace-content:not([hidden]) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .columns {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }
  .columns > section,
  #briefing-view,
  #meetings-view {
    position: static;
    max-height: none;
    min-height: 0;
    margin-bottom: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #tasks-view { padding-top: 0; }
  #tasks-view > .section-heading { padding-top: 20px; }
  #tasks-view .task-toolbar { top: 0; }
}

/* Schmal (Handy, Tablet): kompakte Kopfleiste in drei Zeilen – Logo/Gruß, Umschalter, Werkzeuge in
   einer Reihe. Hebt die alten Regeln aus style.css auf (Spalten mit 24px Abstand, .section-nav als
   2-Spalten-Raster), die die Symbole über die ganze Breite verteilt haben. */
@media (max-width: 850px) {
  .page-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    /* Bezug für das Verlauf-Panel (siehe .chart-panel unten). */
    position: relative;
  }
  .page-header .lead { display: none; }
  .page-header .welcome > h1::after { content: none; }
  .page-header .welcome { flex: 1 1 auto; gap: 12px; }
  .page-header .brand-logo { width: 92px; padding-right: 12px; }
  .page-header .task-views { flex: 1 1 100%; display: flex; }
  .page-header .task-views button { flex: 1 1 0; }
  /* Umbrechende Zeile statt Scrollzeile: overflow-x:auto macht auch overflow-y zu auto und
     würde das Verlauf-Panel auf die 36px der Zeile zuschneiden. */
  .header-tools {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2px;
    margin-left: 0;
    width: 100%;
  }
  .header-tools .section-nav { display: flex; width: auto; grid-template-columns: none; }
  .header-tools > * { flex: 0 0 auto; }
  /* Verlauf-Panel: nicht am Button verankern (der sitzt links, rechtsbündig ragt es aus dem Bild),
     sondern über die Breite der Kopfleiste direkt darunter; bei wenig Höhe scrollt es selbst. */
  .header-dashboard { position: static; margin-right: 0; }
  .header-dashboard .chart-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: 480px;
    max-height: min(70vh, 520px);
    max-height: min(70dvh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .page-header .identity,
  .page-header .identity.is-authenticated { margin-left: auto; align-self: center; }
}
/* iOS zoomt beim Antippen in Felder unter 16px Schriftgröße (auch auf dem iPad über 850px). */
@media (pointer: coarse) {
  /* !important nötig: spezifischere Feldregeln in redesign-dialogs.css und style.css setzen kleinere
     Schriftgrößen (Dialoge, Aufgabenformulare) und würden diese Regel sonst überstimmen. */
  input, select, textarea { font-size: 16px !important; }
}
@media (max-width: 420px) {
  .header-dashboard .activity-chart > summary { padding: 0 8px; font-size: 0; gap: 0; }
  .header-dashboard .activity-chart > summary::before { margin: 0; }
  .page-header .jour-fixe-beta { display: none; }
  .page-header #logout { padding: 0 6px; }
  .page-header .identity, .page-header .identity.is-authenticated { gap: 4px; }
}
