/* CSL Projekt Journal – Testseite nach dem Handoff vom 18.11.2026 (Startseite «Projekte» und Projektansicht).
   Tokens, Masse und Klassen folgen der Web-Verwaltung der CSL Planplattform (verwaltung/app.css).
   Neu gegenüber der Planplattform sind nur die drei Statusfarben Blau, Ocker und Grün. */

:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --sunken: #F5F5F7;
  --line: #E5E5EA;
  --line2: #D1D1D6;
  --label: #1D1D1F;
  --sec: #6E6E73;
  --tert: #8E8E93;
  --ph: #AEAEB2;
  --field: #FFFFFF;
  --fieldEdge: #D1D1D6;
  --hover: #F5F5F7;
  --focus: rgba(0, 0, 0, 0.07);
  --primary: #2C2C2E;
  --primaryHover: #1D1D1F;
  --onPrimary: #FFFFFF;
  --red: #D70015;
  --redSoft: #FDECEC;
  --toastBg: #1D1D1F;
  --toastText: #FFFFFF;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* Statusfarben: sRGB-Näherung als Rückfall, darunter die genauen Werte */
  --blue: #005BB5;
  --ochre: #845011;
  --green: #196632;
  --fold: .32s cubic-bezier(.4, 0, .2, 1);
}
@supports (color: oklch(0 0 0)) {
  :root {
    --blue: oklch(0.48 0.16 255);
    --ochre: oklch(0.48 0.1 65);
    --green: oklch(0.45 0.11 150);
  }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Gescrollt wird im Container .scroller, nicht in html oder body. Seine Bildlaufleiste ist immer da,
   damit der zentrierte Inhalt beim Wechsel zwischen kurzen und langen Projekten nicht springt. */
html, body { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; text-decoration: underline; }
input, select, button { font-family: inherit; }
input::placeholder { color: var(--ph); }
input:focus, select:focus { outline: none; }
button { font-size: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }

.scroller { height: 100vh; overflow-y: scroll; box-sizing: border-box; padding-left: 14px; background: var(--bg); } /* links 14px gleichen die Leiste aus */
/* Gestaltung der Leiste wie im Prototyp nur für WebKit und Chromium; andere Browser sind nicht entworfen */
.scroller::-webkit-scrollbar { width: 14px; background: #fff; }
.scroller::-webkit-scrollbar-track { background: #fff; }
.scroller::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 7px; border: 4px solid #fff; min-height: 40px; }
.scroller::-webkit-scrollbar-thumb:hover { background: var(--ph); }
.page { max-width: 1440px; margin: 0 auto; }

/* Kopfzeile */
.header { padding: 28px 40px 0; display: flex; align-items: center; gap: 32px; }
.brand { flex: none; display: flex; align-items: center; gap: 16px; border: 0; background: transparent; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.brand__logo { height: 60px; display: block; }
.brand__slash { font-size: 28px; font-weight: 300; color: var(--line2); line-height: 1; }
.brand__name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
/* Konto-Knopf und sein Menü, wie in der Planplattform. Masse des Knopfs wie im Handoff des Journals. */
.account { margin-left: auto; position: relative; }
.account__button, .account__label {
  height: 36px; border: 0; border-radius: 8px; background: transparent; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  color: var(--label); font-size: 15px; font-weight: 500; max-width: 320px;
}
.account__button { cursor: pointer; transition: background .15s; }
.account__button:hover { background: var(--hover); }
.account__email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__button svg, .account__label svg { color: var(--sec); }
.account-menu {
  position: absolute; right: 0; top: 44px; width: 320px; z-index: 30; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-sizing: border-box; padding: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .10); display: flex;
  flex-direction: column; text-align: left; cursor: default;
}
.account-menu__head { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.account-menu__email { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu__org { font-size: 13px; color: var(--sec); }
.account-menu__item {
  height: 40px; margin-top: 6px; border: 0; border-radius: 8px; background: transparent; padding: 0 12px; display: flex; align-items: center;
  gap: 10px; font-size: 15px; font-weight: 500; color: var(--label); cursor: pointer; text-align: left;
}
.account-menu__item:hover { background: var(--hover); }
.account-menu__item--danger { color: var(--red); }
.account-menu__item--danger:hover { background: var(--redSoft); }

/* Inhalt und Fusszeile */
.main { padding: 56px 40px 80px; }
.footer { padding: 0 40px 40px; }
.footer__inner { border-top: 1px solid var(--line); padding-top: 22px; font-size: 13px; color: var(--sec); display: flex; flex-wrap: wrap; gap: 6px; }
.h1 { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.022em; }

/* Knöpfe */
.btn {
  height: 40px; border-radius: 8px; border: 0; background: var(--primary); color: var(--onPrimary); font-size: 15px; font-weight: 600;
  padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background .15s, transform .1s; box-sizing: border-box; flex: none;
}
.btn:hover { background: var(--primaryHover); }
.btn:active { transform: scale(.97); }
.btn--secondary { border: 1px solid var(--line2); background: var(--surface); color: var(--label); font-weight: 500; padding: 0 16px; }
.btn--secondary:hover { background: var(--hover); }
.btn--mid { height: 36px; font-size: 13px; padding: 0 14px; }
.btn--secondary.btn--mid { padding: 0 12px; }
.btn--small { height: 30px; border-radius: 7px; font-size: 13px; padding: 0 12px; gap: 6px; }
.btn--block { width: 100%; }
.btn--mt { margin-top: 6px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--onPrimary); border-top-color: transparent; animation: spin .8s linear infinite; }
.textlink { border: 0; background: transparent; padding: 0; font-size: 13px; color: var(--sec); cursor: pointer; flex: none; }
.textlink:hover { color: var(--label); }
.icon-btn {
  width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; padding: 0; cursor: pointer; color: var(--tert);
  display: flex; align-items: center; justify-content: center; flex: none; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--label); }

/* Felder. Fokus wie in der Planplattform (dunkler Rahmen), dazu der Ring aus dem Handoff. */
.field {
  height: 30px; border-radius: 7px; border: 1px solid var(--fieldEdge); background: var(--field); padding: 0 6px; font-size: 13px;
  color: var(--label); box-sizing: border-box; transition: border-color .15s;
}
.field:focus { border-color: var(--label); box-shadow: 0 0 0 3px var(--focus); }

/* Menüs (Art, Status) */
.menu {
  position: absolute; top: 26px; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; box-sizing: border-box; box-shadow: 0 12px 32px rgba(0, 0, 0, .10); display: flex; flex-direction: column;
}
.menu--type { left: 0; width: 156px; }
.menu--status { right: 0; width: 168px; }
.menu__item {
  height: 36px; border: 0; border-radius: 8px; background: transparent; padding: 0 10px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 400; color: var(--label); cursor: pointer; text-align: left;
}
.menu__item:hover { background: var(--hover); }
.menu__item--current { font-weight: 600; }
.menu__letter { width: 12px; flex: none; font-size: 12px; font-weight: 600; color: var(--sec); text-align: center; }
.menu__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.dot--offen { background: var(--sec); }
.dot--arbeit { background: var(--blue); }
.dot--klaerung { background: var(--ochre); }
.dot--erledigt { background: var(--green); }


/* ===== Anmeldung (aus der Web-Verwaltung der Planplattform übernommen) ===== */

/* Auf der Anmeldeseite füllt die Seite das Fenster, das Formular steht in der Mitte, die Fusszeile unten. */
.page--center { min-height: 100%; display: flex; flex-direction: column; }
.page--center .main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 24px; }
.login { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; animation: fadeUp .5s var(--ease) backwards; }
.login__fields { display: flex; flex-direction: column; gap: 16px; }
.login__group { display: flex; flex-direction: column; gap: 6px; }
.login__label { font-size: 13px; font-weight: 500; color: var(--sec); }
.login-field {
  height: 40px; border-radius: 8px; border: 1px solid var(--fieldEdge); background: var(--field); padding: 0 12px; font-size: 15px;
  color: var(--label); box-sizing: border-box; width: 100%; transition: border-color .15s;
}
.login-field:focus { border-color: var(--label); }
.login__pw { position: relative; display: flex; align-items: center; }
.login__pw .login-field { padding-right: 42px; }
.login__toggle { position: absolute; right: 6px; color: var(--sec); }
.login__error { font-size: 14px; color: var(--red); }
.login__link { border: 0; background: transparent; padding: 0; font-size: 14px; color: var(--sec); cursor: pointer; align-self: flex-start; }
.login__link:hover { color: var(--label); }

/* Hinweistext unter einem Titel (z. B. «Kein Zugriff») */
.notice { margin: 14px 0 0; max-width: 620px; font-size: 15px; line-height: 1.5; color: var(--sec); }

/* Meldung */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); animation: toastIn .3s var(--ease) backwards; padding: 11px 16px;
  border-radius: 8px; background: var(--toastBg); color: var(--toastText); font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16); z-index: 50; white-space: nowrap; max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis;
}


/* ===== Ansicht 1: Startseite «Projekte» ==================================== */

.tiles { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile-wrap { position: relative; display: flex; }
.tile {
  flex: 1; min-width: 0; min-height: 148px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 18px;
  display: flex; flex-direction: column; align-items: stretch; gap: 14px; cursor: pointer; text-align: left; color: var(--label);
  transition: background .15s;
}
.tile:hover { background: var(--hover); }
.tile__name { padding-right: 34px; font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; } /* rechts Platz für den Stern */
.tile__foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.tile__count { flex: 1; min-width: 0; font-size: 14px; color: var(--sec); }
.tile__foot svg { color: var(--tert); }
.tile__star {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; padding: 0;
  cursor: pointer; color: var(--tert); display: flex; align-items: center; justify-content: center;
}
.tile__star:hover { background: rgba(0, 0, 0, .06); }
.tile__star--on { color: var(--label); }
.tile__star--on svg { fill: var(--label); }
.tile--new {
  min-height: 148px; border-radius: 10px; border: 1px dashed var(--line2); background: transparent; color: var(--sec); font-size: 15px;
  font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: color .15s;
}
.tile--new:hover { color: var(--label); }
.tile-form {
  min-height: 148px; border: 1px solid var(--label); border-radius: 10px; background: var(--surface); padding: 18px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 0 0 3px var(--focus);
}
.tile-form__name { width: 100%; height: 30px; border: 0; background: transparent; padding: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--label); box-sizing: border-box; }
.tile-form__actions { margin-top: auto; display: flex; gap: 8px; }


/* ===== Ansicht 2: Projekt ================================================== */

/* Favoritenleiste: sitzt im oberen Innenabstand, direkt über dem Titel */
.favbar { margin-top: -38px; height: 38px; display: flex; align-items: flex-start; }
.favbar__row { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 4px; }
.favbar__home {
  flex: none; height: 28px; border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--sec); cursor: pointer;
}
.favbar__home:hover { color: var(--label); }
.favbar__sep { flex: none; width: 1px; height: 16px; background: var(--line2); margin: 0 10px; }
.favbar__item {
  flex: 0 1 auto; min-width: 0; height: 28px; border: 0; background: transparent; padding: 0; margin: 0 10px; font-size: 13px; font-weight: 500;
  color: var(--sec); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s;
}
.favbar__item:hover { color: var(--label); }
.favbar__none { font-size: 13px; color: var(--sec); white-space: nowrap; }

/* Ordner-Überschrift: keine Nummer, kein Zähler, kein Einzug. Die Ebene zeigt sich über Grösse und Abstand. */
.f-head { display: flex; align-items: baseline; gap: 14px; padding: 6px 0; cursor: pointer; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.f-head--1 { font-size: 20px; margin-top: 34px; }
.f-head--2 { font-size: 17px; margin-top: 20px; }
.f-head--3 { font-size: 15px; margin-top: 12px; }
.f-head__chevron { align-self: center; color: var(--tert); transition: transform var(--fold); }
.f-head--open .f-head__chevron { transform: rotate(90deg); }

/* Auf- und Zuklappen von Ordnern und Unteraufgaben: der Inhalt fährt als ein Block, rekursiv für alle Ebenen.
   visibility greift erst nach dem Zuklappen und nimmt die Felder aus der Tab-Reihenfolge. Offene Hüllen setzen
   visibility bewusst nicht selbst, damit offene Unterordner das «hidden» eines zugeklappten Elternordners erben.
   overflow ist nur während der Bewegung und im zugeklappten Zustand «hidden», sonst würden Menüs abgeschnitten. */
.fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--fold), visibility 0s linear 0s; }
.fold--closed { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--fold), visibility 0s linear .32s; }
.fold > div { min-height: 0; }
.fold--closed > div, .fold--moving > div { overflow: hidden; }

/* Eintragszeile */
.e-row { display: flex; align-items: flex-start; gap: 14px; padding: 7px 0; }
.e-lead { width: 58px; flex: none; display: flex; align-items: flex-start; justify-content: space-between; } /* Nummer links, Kästchen rechts */
.e-nr { font-size: 13px; line-height: 22px; color: var(--sec); font-variant-numeric: tabular-nums; }
.check {
  width: 18px; height: 18px; margin-top: 2px; flex: none; box-sizing: border-box; border-radius: 5px; border: 1.5px solid var(--tert);
  background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.check--done { border-color: var(--label); background: var(--label); }
.check--hidden { visibility: hidden; } /* Entscheid und Info: Kästchen behält seinen Platz, damit die Spalten fluchten */
.check svg { color: #fff; }
.type { width: 18px; flex: none; position: relative; display: flex; }
.type__btn {
  width: 18px; height: 22px; flex: none; border: 0; border-radius: 5px; background: transparent; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; color: var(--label);
}
.type__btn--pendenz { color: var(--sec); }
.type__btn:hover { background: var(--hover); }
.e-text { flex: 1; min-width: 0; font-size: 15px; line-height: 22px; cursor: default; text-wrap: pretty; overflow-wrap: break-word; }
.e-text--toggle { cursor: pointer; }
.e-row--done .e-title { color: var(--tert); text-decoration: line-through; }
.e-add {
  float: right; width: 22px; height: 22px; margin-left: 8px; border: 0; border-radius: 6px; background: transparent; padding: 0; cursor: pointer;
  color: var(--sec); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s;
}
.e-row:hover .e-add, .e-add:focus { opacity: 1; }
.e-add:hover { background: var(--hover); color: var(--label); }
.e-subs { white-space: nowrap; margin-left: 10px; font-size: 13px; color: var(--sec); }
.e-subs svg { margin-left: 8px; vertical-align: -2px; color: var(--tert); transition: transform var(--fold); }
.e-row--open .e-subs svg { transform: rotate(90deg); }
.e-who { width: 120px; flex: none; font-size: 14px; line-height: 22px; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-date { width: 84px; flex: none; font-size: 14px; line-height: 22px; color: var(--sec); font-variant-numeric: tabular-nums; }
.e-prio { width: 46px; flex: none; font-size: 14px; line-height: 22px; color: var(--sec); font-weight: 400; }
.e-prio--hoch { color: var(--red); font-weight: 600; }
.e-status { width: 104px; flex: none; position: relative; display: flex; }
.e-status__none { font-size: 14px; line-height: 22px; color: var(--sec); }
.status-word { border: 0; background: transparent; padding: 0; cursor: pointer; font-size: 14px; line-height: 22px; color: var(--sec); white-space: nowrap; text-align: left; }
.status-word:hover { text-decoration: underline; }
.status-word--arbeit { color: var(--blue); }
.status-word--klaerung { color: var(--ochre); }
.status-word--erledigt { color: var(--green); }

/* Unteraufgaben-Zeile: Nummer 58px, dann Kästchen, Art und Text. Das rückt sie gegenüber dem Haupteintrag um 32px ein. */
.e-row--sub { padding: 5px 0; }
.e-row--sub > .e-nr { width: 58px; flex: none; }
.e-row--sub .e-text { font-size: 14px; cursor: auto; }

/* Neuer Eintrag: leere Zeile am Ende jedes Ordners. Neue Unteraufgabe: gleiche Zeile, eingerückt. */
.new { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.new--sub { padding: 2px 0 6px; }
.new__lead { width: 58px; flex: none; display: flex; justify-content: flex-end; }
.new__spacer { width: 58px; flex: none; }
.box-empty { width: 18px; height: 18px; flex: none; box-sizing: border-box; border-radius: 5px; border: 1.5px dashed var(--line2); }
.new__text { flex: 1; min-width: 0; height: 30px; border: 0; background: transparent; padding: 0; font-size: 15px; color: var(--label); }
.new--sub .new__text { font-size: 14px; }
.new__who { width: 130px; flex: none; }
.new__due { width: 118px; flex: none; padding: 0 4px; font-size: 12px; }
.new__prio { width: 74px; flex: none; }
/* Felder erscheinen, sobald getippt oder eine Art gewählt ist, und richten sich nach der Art */
.new:not(.new--active) .new__extra { display: none; }
.new--info .new__who, .new--info .new__due { display: none; }
.new--entscheid .new__prio, .new--info .new__prio { display: none; }
.new--active .new__folder { display: none; }
.new__folder { opacity: 0; transition: opacity .15s; }
.new:hover .new__folder, .new__folder:focus-visible { opacity: 1; }

/* Neuer Unterordner */
.sub-draft { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.sub-draft__name { width: 320px; height: 34px; border: 0; border-bottom: 1px solid var(--label); border-radius: 0; background: transparent; padding: 0; font-size: 15px; font-weight: 600; color: var(--label); }
.sub-draft__cancel { padding: 0 6px; }

/* Neuer Ordner auf oberster Ebene: bündig am linken Rand */
.top-folder { display: flex; align-items: center; gap: 14px; margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); }
.top-folder__name { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; padding: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--label); }

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