/* Zeiterfassung - Gestaltung.
 *
 * Die Sache: ein Arbeitsblatt, kein Dashboard. Zehn Leute bei einem
 * Turbomaschinen-Dienstleister tragen taeglich Stunden ein und verteilen sie
 * vollstaendig auf Projekte. Also ist das Raster der Hauptdarsteller und alles
 * uebrige bleibt still.
 *
 * Eine Farbe. AST-Rot bedeutet genau eines: hier musst du hinsehen - nicht
 * verteilte Stunden, negativer Saldo, der heutige Tag. Bedienelemente stehen in
 * Graphit. Gruen und Orange gibt es nicht; ein Saldo im Plus braucht keine Farbe.
 *
 * Schrift: Public Sans, die Hausschrift von ast-turbo.com, allein.
 * Versalien nur in der Navigation - dort setzt AST sie auch.
 */

/* Schrift Public Sans (SIL Open Font License) vom eigenen Server - keine Anfrage an
   Google, keine Besucherdaten an Dritte. Variable Schrift: eine Datei fuer 400-700. */
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/public-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/public-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root { --scrim: rgba(10, 12, 16, .45); --shadow-c: rgba(0, 0, 0, .18); }
:root[data-theme="dark"], :root[data-skin="aurora"], :root[data-skin="hud"] { --shadow-c: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow-c: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .6); } }
:root {
  /* --- Flaechen: Zeichnungsblatt, kuehl, nicht cremig --- */
  --paper:      #f4f5f6;
  --sheet:      #ffffff;
  --sheet-2:    #fafbfb;
  --ground:     #eceef0;   /* Wochenende */
  --ground-2:   #e2e5e8;   /* Feiertag */

  /* --- Graphit statt Fast-Schwarz; abgeleitet von ast-turbo.com (#33373D) --- */
  --ink:        #2b3038;
  /* Beide Grautoene auf mindestens 4,5 : 1 gegen die hellsten Flaechen
     (Blatt, Papier, Wochenende). Vorher lag die dritte Stufe bei 2,4 : 1 -
     Wochentage, Hinweise und Tagesnummern waren kaum zu lesen. */
  --ink-2:      #595e64;
  --ink-3:      #6c7177;
  --ink-inv:    #f7f8f9;

  --rule:       #dcdfe2;
  --rule-2:     #c1c6cb;   /* schwerer: Wochengrenze, Abschnittskante */

  /* --- Die einzige Farbe --- */
  --signal:     #a21a1e;
  --signal-2:   #7d1417;
  --signal-bg:  #f9eaeb;

  /* Masse. Radien klein und nach Hierarchie verschieden, nicht ueberall gleich. */
  --r-sm:   3px;
  --r:      6px;
  --r-lg:   10px;
  --lift:   0 12px 40px rgba(24, 28, 34, .14), 0 2px 6px rgba(24, 28, 34, .08);
  --lift-2: 0 24px 80px rgba(24, 28, 34, .24);

  --ease: cubic-bezier(.2, .8, .3, 1);
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;

  /* Altnamen, damit die Ansichtsdateien unveraendert weiterlaufen.
     Sie zeigen bewusst auf dieselben wenigen Werte - es gibt keine zweite Farbe. */
  --bg: var(--paper);          --surface: var(--sheet);
  --surface-2: var(--sheet-2); --surface-3: var(--ground);
  --text: var(--ink);          --text-2: var(--ink-2);   --text-3: var(--ink-3);
  --line: var(--rule);         --line-2: var(--rule-2);
  --accent: var(--ink);        --accent-2: #444c57;      --accent-soft: var(--ground);
  --brand: var(--signal);      --brand-soft: var(--signal-bg);
  --ok: var(--ink);            --ok-soft: var(--ground);
  --warn: var(--signal);       --warn-soft: var(--signal-bg);
  --bad: var(--signal);        --bad-soft: var(--signal-bg);
  --info-soft: var(--ground-2);
  --radius: var(--r); --radius-lg: var(--r-lg); --radius-sm: var(--r-sm);
  --shadow: var(--lift);

  color-scheme: light;
}

/* Dunkel: Graphitgrund statt Papier. Das Rot hellt auf, sonst versinkt es. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #16191d;
    --sheet:     #1c2025;
    --sheet-2:   #21252b;
    --ground:    #262b31;
    --ground-2:  #2d333a;
    --ink:       #e9ebee;
    --ink-2:     #a3aab2;
    --ink-3:     #8b929a;
    --ink-inv:   #16191d;
    --rule:      #2c3138;
    --rule-2:    #3f4750;
    --signal:    #e8595e;
    --signal-2:  #ff7b80;
    --signal-bg: #331a1c;
    --accent-2:  #c9cfd6;
    --lift:      0 12px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
    --lift-2:    0 24px 80px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .btn.primary { color: var(--ink-inv); }
}
:root[data-theme="dark"] {
  --paper:     #16191d;
  --sheet:     #1c2025;
  --sheet-2:   #21252b;
  --ground:    #262b31;
  --ground-2:  #2d333a;
  --ink:       #e9ebee;
  --ink-2:     #a3aab2;
  --ink-3:     #8b929a;
  --ink-inv:   #16191d;
  --rule:      #2c3138;
  --rule-2:    #3f4750;
  --signal:    #e8595e;
  --signal-2:  #ff7b80;
  --signal-bg: #331a1c;
  --accent-2:  #c9cfd6;
  --lift:      0 12px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  --lift-2:    0 24px 80px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="dark"] .btn.primary { color: var(--ink-inv); }

/* Schriftwahl in den Einstellungen. "Hausschrift" ist Public Sans. */
:root[data-font="system"]  { --sans: system-ui, "Segoe UI", -apple-system, Roboto, sans-serif; }
:root[data-font="arial"]   { --sans: Arial, Helvetica, sans-serif; }
:root[data-font="verdana"] { --sans: Verdana, Tahoma, "DejaVu Sans", sans-serif; }
:root[data-font="georgia"] { --sans: Georgia, "Times New Roman", serif; }

* { box-sizing: border-box; }
/* Muss nach den Layoutregeln greifen: display:flex/grid wuerde [hidden] sonst ueberstimmen. */
[hidden] { display: none !important; }
/* min-height, nicht height: mit height:100% war der Body genau ein Fenster hoch,
   und die klebende Kopfleiste klebt nur innerhalb ihres Elternelements - wer
   weiter als eine Fensterhoehe scrollte (Jahresansicht), nahm sie mit nach oben. */
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: calc(14px * var(--fs, 1));
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--signal) 22%, transparent); }

/* Tastaturbedienung muss sichtbar sein - Graphit, nicht das Signalrot;
   sonst sieht jedes angetippte Feld nach Fehler aus. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

* { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--rule-2); border-radius: 99px;
  border: 4px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

/* ------------------------------------------------------------- Kopfleiste */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 36px;
  height: 56px; padding: 0 var(--gutter, clamp(16px, 2.2vw, 36px));
  background: var(--paper);
  border-bottom: 1px solid var(--rule-2);
}
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
/* Das Logo ist eine Bildmarke mit eigenen Proportionen - nur die Hoehe wird
   gesetzt, die Breite folgt daraus. Es traegt sein Rot selbst; deshalb steht
   daneben kein zweiter roter Balken mehr. */
.brand img {
  height: 26px; width: auto; display: block; flex: none;
}

/* Bei fuenf Reitern und schmalem Fenster muss die Leiste schieben duerfen,
   sonst drueckt sie die Seite auseinander. Der Balken dazu bleibt unsichtbar. */
.tabs {
  display: flex; gap: 22px; align-items: center;
  flex: 1 1 auto; min-width: 0; overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
.tabs button {
  position: relative;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 500;
  color: var(--ink-2); padding: 18px 0;
  transition: color .15s var(--ease);
}
.tabs { position: relative; }
/* Der Strich unter dem aktiven Reiter ist ein eigenes Element und gleitet. */
.tab-bar {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--signal); border-radius: 2px; pointer-events: none;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 600; }


.topbar-right { display: flex; align-items: center; gap: 16px; flex: none; }
.switcher { display: flex; align-items: center; gap: 8px; }
.switcher label { font-size: calc(12px * var(--fs, 1)); color: var(--ink-3); }
.who { font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); text-align: right; line-height: 1.3; }
.who b { display: block; color: var(--ink); font-weight: 600; font-size: calc(13px * var(--fs, 1)); }

.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 0; background: none; color: var(--ink-2); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--ground); color: var(--ink); }

/* ------------------------------------------------------------- Grundlayout */
.view {
  --gutter: clamp(16px, 2.2vw, 36px);
  padding: 28px var(--gutter) 88px;
  max-width: 2400px; margin: 0 auto;
}

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-2);
}
.page-head h1 {
  margin: 0; font-size: calc(28px * var(--fs, 1)); font-weight: 600;
  letter-spacing: -.018em; line-height: 1.15;
}
.page-head .sub {
  color: var(--ink-2); font-size: calc(13px * var(--fs, 1)); margin-top: 6px; max-width: 74ch;
}
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Monatskopf: Name | Monatsnavigation | Knoepfe in drei festen Spalten - sonst schob der je Monat
   verschiedene Knopf rechts (Einreichen/Eingereicht/Freigeben) die Navigation hin und her (D. Fischer, 17.11.2026). */
@media (min-width: 721px) {
  .page-head.ph3 { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .page-head.ph3 > :last-child { justify-self: end; }
}

/* Kleines Feldlabel. Gemischtschreibung - Versalien an jeder Beschriftung
   waeren Dekoration, keine Information. */
.eyebrow { font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); font-weight: 500; }

/* ---------------------------------------------------------- Bedienelemente */
button.btn, .btn {
  font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 500;
  padding: 7px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              transform .12s var(--ease), box-shadow .16s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.btn.primary:hover:not(:disabled), .btn.brand:hover:not(:disabled) {
  box-shadow: 0 4px 14px var(--shadow-c);
}
.btn:hover { background: var(--ground); border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.brand { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.brand:hover { background: var(--signal-2); border-color: var(--signal-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--ground); color: var(--ink); }
.btn.danger { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 40%, transparent); }
.btn.danger:hover { background: var(--signal-bg); border-color: var(--signal); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
/* Gesperrter Hauptknopf: grau statt halbtransparent schwarz - er sah sonst
   bedienbar aus ("Monat einreichen" bei offenen Tagen). ":root" hebt die Regel ueber
   die Dunkel-Regel ".btn.primary { color: --ink-inv }" und die Skin-Farben (Review 22.10.2026). */
:root .btn.primary:disabled, :root .btn.brand:disabled {
  opacity: 1; background: var(--ground); border-color: var(--rule-2); color: var(--ink-3);
}
.submit-why { font-size: calc(12px * var(--fs, 1)); color: var(--signal); max-width: 220px; line-height: 1.3; }
.btn.sm { padding: 4px 10px; font-size: calc(12px * var(--fs, 1)); }

input, select, textarea {
  font: inherit; font-size: calc(13.5px * var(--fs, 1)); color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule-2);
  border-radius: var(--r-sm); padding: 7px 10px;
  transition: border-color .14s var(--ease);
}
select {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink);
}
input[type="time"], input[type="date"] { font-variant-numeric: tabular-nums; }
input:disabled, select:disabled { background: var(--ground); color: var(--ink-3); cursor: not-allowed; }

label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); font-weight: 500;
  margin-bottom: 5px;
}
label.field > input, label.field > select, label.field > textarea { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check {
  display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs, 1));
  cursor: pointer; padding: 5px 0;
}
input[type="checkbox"] { accent-color: var(--ink); width: 15px; height: 15px; padding: 0; }

/* Zweiwegschalter: eigene oder fremde Ansicht. Ein Auswahlfeld allein sagt
   nicht, in welchem der beiden Zustaende man sich befindet. */
.seg {
  display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  overflow: hidden; flex: none;
}
.seg-b {
  font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 500;
  padding: 6px 14px; border: 0; background: var(--sheet); color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.seg-b + .seg-b { border-left: 1px solid var(--rule-2); }
.seg-b:hover { background: var(--ground); color: var(--ink); }
.seg-b[aria-current="true"] { background: var(--ink); color: var(--sheet); }

/* ------------------------------------------------------------------ Karten */
/* Ein Rahmen, kein Schatten. Der Schatten bleibt dem Dialog vorbehalten -
   nur er liegt wirklich ueber der Seite. */
.card {
  background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden;
}
/* Abstand zwischen gestapelten Karten: eine Variable. Skins setzen nur den Wert,
   Raster-Container (.charts, .db-cols, .fs-two) setzen ihn auf 0 - kein Nachflicken je Fall. */
.card + .card { margin-top: var(--card-gap, 20px); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 18px; border-bottom: 1px solid var(--rule); flex-wrap: wrap;
  min-height: 54px; box-sizing: border-box;      /* gleich hohe Koepfe, egal ob Hinweis, Pille oder Knopf */
}
.card-head h2 { margin: 0; font-size: calc(14px * var(--fs, 1)); font-weight: 600; color: var(--ink); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* Das Raster laeuft bis an den Fensterrand - eine Tabelle mit 31 Spalten
   will die Breite, und Rundungen an den Ecken helfen ihr nicht. */
.bleed { margin-inline: calc(-1 * var(--gutter)); }
.bleed .card, .card.bleed {
  border-radius: 0; border-left: 0; border-right: 0;
}

/* ------------------------------------------- Ableseleiste (frueher Karten) */
/* Kennzahlen sind kein Kartenstapel, sondern eine Skala: eine Zeile,
   durch Striche geteilt, links ausgerichtet. */
.stats {
  display: flex; flex-wrap: wrap;
  gap: 0; margin: 0 0 22px;
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 2px 30px 18px 0; margin-right: 30px;
  border-right: 1px solid var(--rule);
  min-width: 150px;
}
.stat:last-child { border-right: 0; margin-right: 0; }
.stat .k { font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); font-weight: 500; }
.stat .v {
  font-size: calc(27px * var(--fs, 1)); font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin-top: 3px; line-height: 1.1;
  color: var(--ink);
}
.stat .n { font-size: calc(12px * var(--fs, 1)); color: var(--ink-3); margin-top: 2px; }
/* Im Plus zu sein braucht keine Farbe. Im Minus zu sein schon. */
.stat.pos .v { color: var(--ink); }
.stat.neg .v { color: var(--signal); }

/* --------------------------------------------------------------- Abzeichen */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: var(--r-sm);
  font-size: calc(12px * var(--fs, 1)); font-weight: 500; white-space: nowrap;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2);
}
.pill.ok    { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.pill.info  { background: var(--ground); border-color: var(--rule-2); color: var(--ink); }
.pill.warn,
.pill.bad   { background: var(--signal-bg); border-color: color-mix(in srgb, var(--signal) 35%, transparent); color: var(--signal); }
.pill.brand { background: var(--signal); border-color: var(--signal); color: #fff; }

/* --------------------------------------------------------------- Tabellen */
.tw { overflow: auto; max-width: 100%; }
table.grid {
  border-collapse: separate; border-spacing: 0; width: 100%;
  font-variant-numeric: tabular-nums;
}
table.grid th, table.grid td {
  border-bottom: 1px solid var(--rule); padding: 8px 14px;
  text-align: right; white-space: nowrap;
}
table.grid th {
  position: sticky; top: 0; z-index: 2;
  background: var(--sheet-2); color: var(--ink-2);
  font-weight: 500; font-size: calc(12px * var(--fs, 1));
  border-bottom-color: var(--rule-2);
}
table.grid th.l, table.grid td.l { text-align: left; }
table.grid tbody tr:hover td { background: var(--sheet-2); }
table.grid tr.total td {
  font-weight: 600; background: var(--sheet-2);
  border-top: 1px solid var(--rule-2);
}
table.grid .muted { color: var(--ink-3); }
table.grid tbody tr:last-child td { border-bottom: 0; }

/* ----------------------------------------------------- Sortier-/Filterkopf */
table.grid.dt th.dt-sort { cursor: pointer; user-select: none; }
table.grid.dt th.dt-sort:hover { background: var(--ground); color: var(--ink); }
.dt-arrow { font-size: calc(10px * var(--fs, 1)); color: var(--ink-3); }
/* Die Filterzeile klebt unter der Beschriftung, nicht darueber - sonst
   verschwindet beim Scrollen das, wonach gefiltert wird. */
table.grid.dt thead tr.dt-filters th {
  top: 33px; padding: 5px 8px 7px; background: var(--sheet-2);
  border-bottom: 1px solid var(--rule-2);
}
table.grid.dt thead tr.dt-filters input:not([type="checkbox"]),
table.grid.dt thead tr.dt-filters select {
  width: 100%; min-width: 68px; padding: 3px 7px; font-size: calc(12px * var(--fs, 1));
  font-weight: 400; color: var(--ink); background-color: var(--sheet);
}
table.grid.dt thead tr.dt-filters select { padding-right: 22px; }
table.grid.dt thead tr.dt-filters input::-webkit-search-cancel-button { cursor: pointer; }
.dt-count { font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); font-variant-numeric: tabular-nums; }
table.grid tr.row-archived td { color: var(--ink-3); }

/* ------------------------------------------------------------ Monatsraster */
/* Der Rahmen begrenzt die Hoehe und scrollt selbst - in beide Richtungen.
   Solange die Seite scrollte, wanderte der Datumskopf nach oben aus dem Bild
   und der waagrechte Balken sass am Fuss einer sehr langen Tabelle, also dort,
   wo man ihn nicht erreicht. Jetzt bleiben Kopf und linke Spalten stehen. */
/* Die Hoehe setzt das Skript: genau bis zum unteren Fensterrand. Der Rollbalken
   ist hier bewusst breit - er ist die Bedienung, nicht bloss eine Anzeige. */
.grid-scroll {
  overflow: auto;
  height: 60vh;
  scrollbar-width: auto;
  /* Am Ende des Rasters nicht die Seite weiterrollen. Genau das liess den
     feststehenden Kopf "ploetzlich" verschwinden: das Raster war unten
     angekommen, das Rad rollte weiter - und schob die ganze Seite samt Kopf
     nach oben aus dem Bild. */
  overscroll-behavior: contain;
}
.grid-scroll::-webkit-scrollbar { width: 14px; height: 14px; }

/* Breite der drei festen Spalten. Die Projektspalte setzt das Skript nach dem
   laengsten Namen; die beiden anderen wachsen mit der Schrift. */
.month-grid {
  min-width: 100%; font-size: calc(13px * var(--fs, 1)); border-collapse: separate;
  --w-l: 250px;
  --w-p: calc(128px * var(--fs, 1));
  --w-t: calc(66px * var(--fs, 1));
}
.month-grid th, .month-grid td { padding: 5px 8px; }

/* Die drei Spalten links stehen fest: Projekt, Phase, Summe. Die Summe steht
   damit neben dem Namen und nicht hinter einunddreissig Tagesspalten. */
.month-grid th.sticky-l, .month-grid td.sticky-l,
.month-grid th.sticky-p, .month-grid td.sticky-p,
.month-grid th.sticky-t, .month-grid td.sticky-t {
  position: sticky; z-index: 3; background: var(--sheet);
}
.month-grid th.sticky-l, .month-grid td.sticky-l {
  left: 0; text-align: left;
  min-width: var(--w-l); max-width: var(--w-l);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  padding-left: var(--gutter, 24px);
}
.month-grid th.sticky-p, .month-grid td.sticky-p {
  left: var(--w-l); text-align: left;
  min-width: var(--w-p); max-width: var(--w-p);
  overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-2); font-size: calc(12.5px * var(--fs, 1));
}
.month-grid th.sticky-t, .month-grid td.sticky-t {
  left: var(--w-l); min-width: var(--w-t); max-width: var(--w-t); text-align: right;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--rule-2);
}
.month-grid.with-phase th.sticky-t, .month-grid.with-phase td.sticky-t {
  left: calc(var(--w-l) + var(--w-p));
}
/* Nur fuer den Augenblick des Messens: Projektspalte ohne Breitengrenze. */
.month-grid.measuring th.sticky-l, .month-grid.measuring td.sticky-l,
.month-grid.measuring th.sticky-t, .month-grid.measuring td.sticky-t {
  min-width: 0; max-width: none;
}
.month-grid.measuring .pdesc { display: none; }
/* Doppelte Zeile im Tagesdialog */
.brow.dup select { border-color: var(--signal); }
/* Phasenspalte ausgeblendet: die Phase steht dann klein hinter dem Projektnamen. */
.month-grid.phase-off th.sticky-p, .month-grid.phase-off td.sticky-p { display: none; }
.month-grid.phase-off.with-phase th.sticky-t, .month-grid.phase-off.with-phase td.sticky-t { left: var(--w-l); }
.month-grid .pph { display: none; }
.month-grid.phase-off .pph {
  display: inline; margin-left: 8px; font-size: calc(11.5px * var(--fs, 1)); color: var(--ink-3);
}

/* Der Kopf bleibt beim Senkrechtscrollen stehen; die Ecke oben links muss ueber
   beidem liegen, sonst schiebt sich eine Tagesspalte darunter durch. */
.month-grid thead th { position: sticky; top: 0; z-index: 4; background: var(--sheet-2); }
.month-grid thead th.sticky-l, .month-grid thead th.sticky-p, .month-grid thead th.sticky-t {
  z-index: 6; background: var(--sheet-2);
}
.month-grid tbody tr:hover td.sticky-l,
.month-grid tbody tr:hover td.sticky-p,
.month-grid tbody tr:hover td.sticky-t { background: var(--sheet-2); }

/* Projektnummer und Titel ohne Trennzeichen - die Schrift trennt sie. */
.pnum { font-variant-numeric: tabular-nums; }
.ptitle { color: var(--ink-2); margin-left: 9px; }
/* Folgezeile derselben Sache: der Name wird blasser wiederholt, damit man auch
   mitten im Raster weiss, wozu eine Phasenzeile gehoert. */
.month-grid td.sticky-l.contd { color: var(--ink-3); }
.month-grid td.sticky-l.contd .ptitle { color: var(--ink-3); }
.month-grid td.phase-cell { color: var(--ink); }
.month-grid td.d input.cell:disabled { background: none; color: var(--ink-2); cursor: default; }

/* Hinweis, der eine Handlung verlangt (Uhr laeuft noch vom Vortag). */
.card.notice { border-color: color-mix(in srgb, var(--signal) 45%, transparent);
               background: var(--signal-bg); }
.notice-body {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}

.month-grid th.d, .month-grid td.d {
  /* Breit genug fuer zweistellige Stunden mit Vorzeichen ("+10:30", "10,75") - nichts abschneiden. */
  min-width: calc(58px * var(--fs, 1)); white-space: nowrap;
  padding: 4px 2px; text-align: center;
}
.month-grid th.d { line-height: 1.25; font-size: calc(11px * var(--fs, 1)); color: var(--ink-3); font-weight: 500; }
.month-grid th.d .dn {
  font-size: calc(14px * var(--fs, 1)); color: var(--ink); font-weight: 600;
  display: block; font-variant-numeric: tabular-nums;
}
/* Die schwere Linie markiert den Wochenanfang - eine Linie, die etwas sagt. */
.month-grid .wk { border-left: 1px solid var(--rule-2); }
.month-grid .we  { background: var(--ground); color: var(--ink-3); }
.month-grid .hol { background: var(--ground-2); }
.month-grid td.d input.cell {
  width: 100%; border: 1px solid transparent; background: none; padding: 3px 1px;
  text-align: center; font-size: calc(13px * var(--fs, 1)); border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
}
.month-grid td.d input.cell:hover { border-color: var(--rule-2); background: var(--sheet); }
.month-grid td.d input.cell:focus {
  background: var(--sheet); outline: 2px solid var(--ink); outline-offset: -1px;
  border-color: transparent;
}
/* Rueckmeldung auf die eigene Eingabe - Bewegung, die eine Handlung beantwortet. */
.month-grid td.d input.cell.saving { opacity: .4; }
.month-grid td.d input.cell.saved { animation: cellSaved .9s var(--ease); }
@keyframes cellSaved {
  0%   { background: color-mix(in srgb, var(--ink) 16%, transparent); }
  100% { background: transparent; }
}
.month-grid td.d input.cell { transition: background .15s var(--ease), border-color .15s var(--ease); }
.card { transition: border-color .2s var(--ease), box-shadow .25s var(--ease); }
.stat .v { transition: color .3s var(--ease); }

.month-grid tr.sec td {
  background: var(--sheet-2); font-weight: 600; font-size: calc(12px * var(--fs, 1)); color: var(--ink-2);
  padding-top: 11px; padding-bottom: 8px;
  border-top: 1px solid var(--rule-2); border-bottom-color: var(--rule-2);
}
.month-grid tr.sec td.sticky-l, .month-grid tr.sec td.sticky-p,
.month-grid tr.sec td.sticky-t { background: var(--sheet-2); }
.month-grid tr.sec:hover td { background: var(--sheet-2); }
.month-grid tr.calc td { background: var(--sheet-2); font-size: calc(12.5px * var(--fs, 1)); }
.month-grid tr.calc td.sticky-l, .month-grid tr.calc td.sticky-p,
.month-grid tr.calc td.sticky-t { background: var(--sheet-2); color: var(--ink-2); }

/* Die Tagessumme steht jetzt oben, direkt unter den Datumsspalten - sie schliesst
   den Kopf ab und traegt deshalb die schwere Linie unten. */
.month-grid tr.top-total td {
  background: var(--sheet-2); font-weight: 600;
  border-bottom: 1px solid var(--rule-2);
}
.month-grid tr.top-total:hover td { background: var(--sheet-2); }
/* Sie bleibt beim Scrollen unter dem Datumskopf stehen - "oben" soll auch oben
   bleiben, wenn man zu den Projekten weiter unten blaettert. Die Hoehe des
   Kopfes wird im Skript gemessen und hier eingesetzt. */
.month-grid tr.top-net td {
  position: sticky; top: var(--head-h, 40px); z-index: 4;
  background: var(--sheet-2); font-weight: 600;
}
.month-grid tr.top-total td {
  position: sticky; top: var(--row1-h, 70px); z-index: 4;
}
.month-grid tr.top-net td.sticky-l, .month-grid tr.top-net td.sticky-p,
.month-grid tr.top-net td.sticky-t,
.month-grid tr.top-total td.sticky-l,
.month-grid tr.top-total td.sticky-p,
.month-grid tr.top-total td.sticky-t { z-index: 6; }
.month-grid tr.top-net:hover td { background: var(--sheet-2); }

/* Phasenspalte: Auswahl fuer eine noch leere Zeile, "+" fuer weitere Phasen. */
.month-grid td.phase-cell { display: table-cell; }
.month-grid td.phase-cell > span { vertical-align: middle; }
.month-grid select.phase-pick {
  width: 100%; font-size: calc(12px * var(--fs, 1)); padding: 2px 20px 2px 6px;
  border-color: var(--rule-2); background-color: var(--sheet);
}
.month-grid select.phase-add {
  width: 26px; height: 22px; margin-left: 6px; padding: 0; vertical-align: middle;
  font-size: calc(13px * var(--fs, 1)); font-weight: 600; text-align: center; text-align-last: center;
  background-image: none; color: var(--ink-2); border-color: var(--rule-2);
  border-radius: var(--r-sm); cursor: pointer;
}
.month-grid select.phase-add:hover { color: var(--ink); border-color: var(--ink-3); }

/* Die offene Differenz ist die Zeile, die ueber das Einreichen entscheidet.
   Sie schliesst den Rechenteil ab und traegt deshalb die schwere Linie. */
.month-grid tr.open-row td {
  background: var(--sheet-2); font-weight: 600;
  border-bottom: 2px solid var(--ink); padding-bottom: 7px;
}
.month-grid tr.open-row td.sticky-l, .month-grid tr.open-row td.sticky-p,
.month-grid tr.open-row td.sticky-t { background: var(--sheet-2); }
.month-grid tr.open-row:hover td { background: var(--sheet-2); }

.cell-bad  { background: var(--signal-bg) !important; color: var(--signal); font-weight: 600; }
.cell-ok   { color: var(--ink); }
.cell-warn { color: var(--signal); }

th.d.clickable { cursor: pointer; }
th.d.clickable:hover { background: var(--ground); }
/* Heute: die einzige rote Marke im Raster. */
th.d.today { box-shadow: inset 0 3px 0 var(--signal); }
th.d.today .dn { color: var(--signal); }

/* Themen tragen ihre Beschreibung als zweite Zeile - dafuer ist sie da:
   damit auch jemand anders weiss, worum es in dem Thema geht. */
.pdesc {
  display: block; font-size: calc(11.5px * var(--fs, 1)); color: var(--ink-3);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis;
}
.topic-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.topic-row:last-of-type { border-bottom: 0; }
.topic-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.topic-h .pnum { color: var(--ink-2); font-size: calc(12.5px * var(--fs, 1)); }

/* ------------------------------------------------------- Jahres-Tagesraster */
/* Monatszeilen aus sechs Wochenpaketen. Die Pakete stehen in allen Zeilen an
   derselben Stelle, also liegen gleiche Wochentage untereinander. */
.yeargrid {
  display: grid;
  grid-template-columns: 38px repeat(6, minmax(0, 1fr));
  gap: 6px 12px;
  align-items: end;
  min-width: 760px;
}
.yeargrid .ym-label {
  font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--ink-2);
  text-align: right; padding: 0 4px 6px 0;
}
/* Ein Paket ist eine Woche: KW darueber, sieben Tage darunter, eine leichte
   Flaeche dahinter, damit die Woche als Einheit lesbar ist. */
.wk-pkg { display: flex; flex-direction: column; gap: 2px; }
.wk-cap {
  font-size: calc(10px * var(--fs, 1)); color: var(--ink-3); height: 13px; line-height: 13px;
  padding-left: 3px; font-variant-numeric: tabular-nums;
}
.wk-days {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px;
  padding: 3px; border-radius: var(--r);
  background: color-mix(in srgb, var(--ground) 55%, transparent);
}
.wk-pkg.wk-none .wk-days { background: transparent; }
.wk-head .wk-days { background: transparent; padding-top: 0; padding-bottom: 0; }
.yeargrid .dow {
  font-size: calc(10.5px * var(--fs, 1)); color: var(--ink-2); text-align: center; font-weight: 500;
}
.yeargrid .dow.we { color: var(--ink); font-weight: 700; }

.yd {
  position: relative;
  height: 26px; border-radius: 3px;
  background: var(--ground); cursor: pointer;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
}
.yd-n {
  font-size: calc(9.5px * var(--fs, 1)); line-height: 1; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .92); pointer-events: none;
}
.yd-gap { height: 26px; }
/* Wochenende: ein schraffierter Streifen, der durch das ganze Jahr laeuft -
   auch dort, wo das Paket leer ist, damit die Spalte nicht abreisst. */
.yd-gap.we { border-radius: 3px;
  background: repeating-linear-gradient(135deg, transparent 0 3px, var(--rule) 3px 4px); }
.yd.weekend {
  background: repeating-linear-gradient(135deg, var(--ground-2) 0 3px, var(--rule-2) 3px 4px);
  border-color: var(--rule-2);
}
.yd.weekend .yd-n, .yd.off .yd-n, .yd.HOLIDAY .yd-n, .yd.UNPAID .yd-n { color: var(--ink-2); }

/* Hier ist Farbe Information, nicht Schmuck: das Raster ist eine Karte mit
   Legende, und zehn Zustaende lassen sich in Graustufen nicht auseinanderhalten.
   Die Toene sind entsaettigt und unterscheiden sich zusaetzlich in der Helligkeit,
   damit sie auch bei Farbsehschwaeche trennbar bleiben. */
/* Nicht erfasst und Wochenende sind zwei verschiedene Aussagen und sahen beide
   nach nichts aus. Das Wochenende ist jetzt eine ruhige Flaeche - es ist ein
   Zustand -, ein nicht erfasster Arbeitstag ein gestrichelter Umriss: dort
   fehlt etwas. */
.yd.off      { background: transparent; border: 1px dashed var(--rule-2); }
/* Deutlich getrennte Farbtoene UND Helligkeiten: Buero dunkelblau, Homeoffice
   hellblau, Aussendienst orange, Urlaub gruen, Krank rot, Kompensation violett,
   Militaer gelboliv, Feiertag sand. Vorher lagen Buero, Homeoffice und Urlaub
   als drei gedeckte Blaugruen-Toene nebeneinander. */
.yd.work     { background: #1f4e8c; }                       /* Buero      */
.yd.home     { background: #7cc0f0; }                       /* Homeoffice */
.yd.field    { background: #e07b1a; }                       /* Aussendienst */
.yd.mixed    { background: linear-gradient(135deg, #1f4e8c 48%, #7cc0f0 52%); }
.yd.VACATION { background: #2e9e4f; }
.yd.SICK     { background: #d32f2f; }
.yd.ACCIDENT { background: #6a0f14; }
.yd.MILITARY { background: #b5a520; }
.yd.COMP     { background: #8e5bd1; }
.yd.SPECIAL  { background: #0f8a8a; }                       /* Sonderurlaub */
.yd.DOCTOR   { background: #e57373; }                       /* Arztbesuch */
.yd.OTHER_PAID { background: #4f9a9a; }                     /* andere bezahlte Absenz */
.yd.SCHOOL   { background: #5c6bc0; }                       /* Berufsschule */
.yd.SHORT_WORK { background: #9e9e9e; }                     /* Kurzarbeit */
/* Auf hellen Kacheln dunkle Tageszahl */
.yd.home .yd-n, .yd.MILITARY .yd-n { color: #10233a; }
/* Feiertag: Sandflaeche - dunkle Zahl in jedem Modus (im Dunkeln war --ink-2 hell auf Sand, Review 22.10.2026). */
.yd.HOLIDAY .yd-n { color: #3a2e10; }
.yd.UNPAID   { background: repeating-linear-gradient(45deg,
                 transparent, transparent 3px, var(--rule-2) 3px, var(--rule-2) 5px);
               border-color: var(--rule-2); }
.yd.HOLIDAY  { background: #e3cfa8; }
.yd.today    { outline: 2px solid var(--ink); outline-offset: 1px; }
.yd { transition: transform .16s var(--ease), box-shadow .16s var(--ease); }
.yd:hover    { border-color: var(--ink); transform: scale(1.18); z-index: 2;
               box-shadow: 0 3px 10px var(--shadow-c); }

.legend {
  display: flex; flex-wrap: wrap; gap: 7px 20px; margin-top: 16px;
  font-size: calc(12px * var(--fs, 1)); color: var(--ink-2);
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
/* Die Legendenfelder sind Muster, keine Tage - sie duerfen nicht mitwachsen. */
.legend i {
  width: 13px; height: 13px; min-width: 0; max-width: none;
  border-radius: 2px; display: inline-block; flex: none;
  border: 1px solid transparent;
}
.legend i.yd { height: 13px; width: 13px; display: inline-block; }

/* --------------------------------------------------------------- Diagramme */
.charts { display: grid; grid-template-columns: 1fr; gap: 44px; margin-top: 40px; }
.charts.two { grid-template-columns: repeat(auto-fit, minmax(680px, 1fr)); gap: 44px; }
.charts .card-body { padding: 32px 28px 38px; }
.charts { --card-gap: 0px; }
/* Im Dialog stehen die Diagramme untereinander und brauchen dieselbe Luft. */
.dl-sec > .chart-scroll, .dl-sec > div > .chart-scroll { margin-top: 14px; }
.dl-sec > div > .legend { margin-top: 20px; }
.chart { width: 100%; display: block; }
.chart text { font-size: calc(11.5px * var(--fs, 1)); fill: var(--ink-2); font-family: var(--sans); }
.chart .axis { stroke: var(--rule-2); stroke-width: 1; }
.chart .gl { stroke: var(--rule); stroke-width: 1; }
.chart .val { fill: var(--ink); font-size: calc(11px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.chart-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }

/* ---------------------------------------------------------------- Stoppuhr */
/* Die einzige Stelle der Oberflaeche, die sich von selbst bewegt. Das ist hier
   gerechtfertigt: es laeuft tatsaechlich etwas. */
.clock {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.clock-time {
  font-size: calc(58px * var(--fs, 1)); font-weight: 300; letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.clock-sub { font-size: calc(12.5px * var(--fs, 1)); color: var(--ink-2); margin-top: 8px; }
.clock-blocks {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule);
}
.clock-block {
  display: flex; align-items: baseline; gap: 8px;
  font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums;
}
.clock-block .no { color: var(--ink-3); font-size: calc(11px * var(--fs, 1)); }
.clock-block .arr { color: var(--ink-3); }
.clock-block .pl { color: var(--ink-2); font-size: calc(12px * var(--fs, 1)); }
/* Der offene Block ist der, auf den es gerade ankommt. */
.clock-block.live { color: var(--signal); font-weight: 600; }
.clock-block.live .arr, .clock-block.live .no { color: var(--signal); }

/* ----------------------------------------------------------------- Filter */
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 22px;
}
.multi {
  border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  max-height: 250px; overflow: auto; background: var(--sheet); padding: 4px;
}
/* Die drei langen Listen nebeneinander und hoch. */
.filters.big { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.filters.big .multi { height: 400px; max-height: none; }
@media (max-height: 760px) { .filters.big .multi { height: 300px; } }
.multi label {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: calc(13px * var(--fs, 1));
}
.multi label:hover { background: var(--ground); }
.multi input { margin: 0; }
.multi-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 5px;
}
.multi-head .lnk {
  border: 0; background: none; font: inherit; font-size: calc(12px * var(--fs, 1)); cursor: pointer;
  color: var(--ink-2); padding: 0; text-decoration: underline;
  text-underline-offset: 2px;
}
.multi-head .lnk:hover { color: var(--ink); }
/* Zwischenueberschrift in einer Mehrfachauswahl: Projekte, Angebote, Archiv und
   die allgemeinen Quellen sind verschiedene Dinge und stehen deshalb getrennt. */
.multi-group {
  font-size: calc(11px * var(--fs, 1)); font-weight: 600; color: var(--ink-2);
  padding: 10px 8px 4px; border-top: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--sheet);
}
.multi-group:first-child { border-top: 0; padding-top: 4px; }
/* Suche ueber der Liste: ab einem Dutzend Eintraegen ist Scrollen kein Suchen. */
.multi-search {
  width: 100%; margin-bottom: 5px; padding: 5px 9px; font-size: calc(12.5px * var(--fs, 1));
}

/* Vorlagenleiste: die drei Fragen, die ohnehin immer gestellt werden. */
.preset-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--rule);
}
.preset-bar .preset-gap { flex: 1 1 24px; }

/* ---------------------------------------------------------------- Dialog */
/* Der einzige Ort mit Schatten: hier liegt wirklich etwas ueber der Seite.
   Die Bewegung beantwortet eine Handlung, deshalb darf sie sein. */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: var(--scrim);   /* immer abdunkeln - mit --ink wurde es im Dunkelmodus hell (Review 22.10.2026) */
  backdrop-filter: blur(3px);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.sheet {
  position: fixed; z-index: 61;
  top: 50%; left: 50%;
  /* Das Fenster nimmt, was das Browserfenster hergibt. Eine feste Obergrenze
     in Pixeln liess auf einem grossen Schirm die Haelfte der Flaeche ungenutzt,
     waehrend der Tagesdialog innen scrollen musste. */
  width: min(1720px, 95vw); height: auto; max-height: 95vh;
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-2);
  display: flex; flex-direction: column; overflow: hidden;
  /* Ohne diese Verschiebung stuende das Fenster nach der Animation mit seiner
     linken oberen Ecke in der Bildmitte - die Keyframes allein reichen nicht,
     weil ihr Transform am Ende wieder verfaellt. */
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
/* Schmal ist nur ein Formular mit wenigen Feldern; auch das darf mitwachsen. */
.sheet.narrow { width: min(780px, 92vw); }
/* Der Tagesdialog hat zwei volle Spalten. Er nimmt, was das Browserfenster
   hergibt, statt bei einer festen Pixelzahl stehenzubleiben und innen zu scrollen,
   waehrend aussen die Haelfte des Schirms leer ist. */
.sheet.tall { width: min(1560px, 95vw); height: 95vh; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 24px; border-bottom: 1px solid var(--rule-2); flex: none;
}
.sheet-head h2 { margin: 0; font-size: calc(17px * var(--fs, 1)); font-weight: 600; letter-spacing: -.01em; }
.sheet-body { padding: 26px 30px 30px; overflow: auto; flex: 1; min-height: 0; }
.sheet-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule);
}

.dl-sec { margin-bottom: 44px; }
.dl-sec:last-child { margin-bottom: 0; }
.dl-sec > h3 {
  font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--ink);
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2);
}
/* Zwei Spalten mit fester Gewichtung statt gleicher Breite: links wird erfasst,
   rechts verteilt - und rechts steht mehr. Auf schmalen Fenstern stapeln sie. */
.dl-cols {
  display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(340px, 1.15fr);
  gap: 0 48px; align-items: start;
}
/* Die Mindestbreiten muessen samt Spalte passen, bevor der Umbruch greift -
   sonst quillt der Inhalt aus dem Dialog, der schmaler ist als das Fenster. */
@media (max-width: 800px) { .dl-cols { grid-template-columns: 1fr; gap: 0; } }

/* Kopfzeile des Tagesdialogs: Datum und die Kennzahlen des Tages nebeneinander. */
.day-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
  margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--rule-2);
}
.day-date { font-size: calc(15px * var(--fs, 1)); font-weight: 600; }
.day-figs { display: flex; gap: 30px; flex-wrap: wrap; }
.day-figs .k { font-size: calc(11px * var(--fs, 1)); color: var(--ink-2); }
.day-figs .v {
  font-size: calc(17px * var(--fs, 1)); font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* Der Tagesdialog fuellt seine Hoehe; die beiden Spalten laufen bis unten. */
.sheet.tall .sheet-body > div:last-child { min-height: 0; }

/* minmax(0, …) statt blossem fr: eine fr-Spalte wird sonst nie schmaler als ihr
   Inhalt. Die Kopfzeile enthaelt kurze Woerter, die Datenzeile ein Auswahlfeld
   mit langen Projektnamen - dadurch bekamen beide verschiedene Spaltenbreiten
   und die Beschriftung stand neben statt ueber dem Feld. */
.tblock {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) 28px;
  gap: 10px; align-items: center; margin-bottom: 10px;
}
.tblock .no { font-size: calc(12px * var(--fs, 1)); color: var(--ink-3); text-align: right; }
.brow {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) 108px 32px;
  gap: 10px; align-items: center; margin-bottom: 10px;
}
/* Ohne das sprengt ein langer Projektname die Spalte wieder auf. */
.tblock > select, .tblock > input, .brow > select, .brow > input { min-width: 0; width: 100%; }
/* Die Kopfzeile ist eine Beschriftung, keine Zeile mit Feldern - sie bekommt
   denselben Raster, aber kleinere Schrift und etwas Abstand nach unten. */
.brow.brow-head, .tblock.tblock-head { margin-bottom: 6px; }
/* Phasen abgeschaltet: Phasenfeld entfaellt, die Zeile hat drei Spalten. */
.brow.nophase { grid-template-columns: minmax(0, 2.4fr) 108px 32px; }
.sec-pct { font-weight: 400; opacity: .7; margin-left: 4px; }
input.month-pick { width: 100%; min-width: 0; font: inherit; padding: 3px 6px; }
.brow > .brow-note, .brow > .brow-kind { grid-column: 1 / -1; margin-top: -2px; font-size: .9em; }

/* ------------------------------------------------------------------ Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: var(--sheet);
  padding: 9px 18px; border-radius: var(--r-sm); z-index: 80;
  font-size: calc(13px * var(--fs, 1)); box-shadow: var(--lift);
}
.toast.bad { background: var(--signal); color: #fff; }

.empty { padding: 56px 24px; text-align: center; color: var(--ink-3); }
.hint { font-size: calc(12px * var(--fs, 1)); color: var(--ink-3); margin-top: 8px; line-height: 1.55; }
.spin { padding: 72px; text-align: center; color: var(--ink-3); }

/* Bewegung ausgeschaltet: wirklich aus. Die fruehere Regel setzte statt dessen
   jede Dauer auf eine Millisekunde - und legte damit ungewollt auf JEDE
   Eigenschaft jedes Elements einen Uebergang. Bei "reduziert" (Systemvorgabe)
   entscheidet das Skript: weiche Blenden bleiben, nichts wandert. */
.motion-none *, .motion-none *::before, .motion-none *::after {
  animation: none !important;
  transition: none !important;
}
.motion-reduced .btn:active, .motion-reduced .yd:hover, .motion-reduced .btn:hover { transform: none !important; }   /* auch gegen soft.css */

@media (max-width: 900px) {
  .charts.two { grid-template-columns: 1fr; }
}
/* Mittlere Breite, vor allem mit groesserer Schrift: der Schriftzug und die
   Beschriftung "Ansicht als" weichen, damit alle Reiter sichtbar bleiben. */
@media (max-width: 1180px) {
  .topbar { gap: 22px; }
  .switcher label { display: none; }
}
@media (max-width: 720px) {
  .topbar { gap: 16px; padding: 0 14px; height: 52px; }
  .who, .switcher label { display: none; }
  .topbar-right { min-width: 0; }
  #switchUser { max-width: 140px; }
  /* Der Randabstand muss hier mitwandern, sonst zieht .bleed weiter nach aussen
     als das Polster breit ist und die Seite bekommt einen Querbalken. */
  .view { --gutter: 14px; padding: 20px var(--gutter) 64px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .brow, .brow.nophase, .tblock { grid-template-columns: 1fr; }
  .stats { display: block; }
  .stat { border-right: 0; border-bottom: 1px solid var(--rule); margin-right: 0; padding-right: 0; }
  .sheet, .sheet.narrow, .sheet.tall, .sheet.wide, .sheet.tall.wide, [data-skin="soft"] .sheet { width: 100vw; max-height: 100vh; max-height: 100dvh; height: 100%; border-radius: 0; border: 0; }
  .sheet-body, .sheet-head { padding: 16px; }
}


/* ------------------------------------------------------ Auf- und zuklappen */
.card-head.foldable { cursor: pointer; user-select: none; }
.card-head.foldable h2 { flex: 1; }
.fold-btn {
  width: 26px; height: 26px; margin: 0 6px 0 -6px; padding: 0; flex: none;
  border: 0; background: none; border-radius: var(--r-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.fold-btn:hover { background: var(--ground); color: var(--ink); }
.fold-btn .chev {
  width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .25s var(--ease);
}
.card.folded .fold-btn .chev { transform: translateX(-1px) rotate(-45deg); }
.card.folded > :not(.card-head) { display: none !important; }
.card.folded > .card-head { border-bottom-color: transparent; }
.motion-none .fold-btn .chev { transition: none; }

/* Kreuztabelle der Auswertung: eigener Rollbereich mit stehendem Kopf und
   stehender erster Spalte. "Datum x Projekt" ergibt hunderte Zeilen - ohne das
   musste man an allen vorbei, um die Diagramme darunter zu erreichen. */
.pivot-scroll { max-height: 70vh; overflow: auto; overscroll-behavior: contain; }
.pivot-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--sheet-2); }
.pivot-scroll tbody td.l, .pivot-scroll thead th.l {
  position: sticky; left: 0; z-index: 1; background: var(--sheet);
}
.pivot-scroll thead th.l { z-index: 3; background: var(--sheet-2); }
.pivot-scroll tr.total td { position: sticky; bottom: 0; background: var(--sheet-2); z-index: 1; }
.pivot-scroll tr.total td.l { z-index: 2; }

/* Begruendung einer Zurueckweisung unter dem Monatskopf */
.month-reason { margin-top: 6px; color: var(--ink-2); }

/* ------------------------------------------------------------ Organisation */
.org-name { font-weight: 600; font-size: calc(13.5px * var(--fs, 1)); }
.org-pos { font-size: calc(12px * var(--fs, 1)); color: var(--ink-2); line-height: 1.3; }
.org-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.org-chip { font-size: calc(10.5px * var(--fs, 1)); padding: 1px 6px; border-radius: 999px; background: var(--ground); color: var(--ink-2); }
.org-team { font-size: calc(10.5px * var(--fs, 1)); color: var(--ink-3); margin-left: 2px; }
/* Linien: Senkrechte vom Vorgesetzten, Waagrechte ueber den Geschwistern, Senkrechte zu jedem Kind. */
.person-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.person-name { font-size: calc(22px * var(--fs, 1)); font-weight: 600; }
.org-teamlist { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- Forecast */
.fc-chart { width: 100%; }
.fc-chart svg { display: block; }
/* Forecast-Farben: blau = Projekt, orange = Angebot, violett = Allgemein/IT/
   Schulung, gruen gestrichelt = Ferien/Krankheit. Hinten blass, vorne kraeftig. */
:root { --fc-proj: #2f6fd6; --fc-opp: #e0882b; --fc-ovh: #8a63c9; --fc-abs: #2fa36b; }
.fc-soll    { fill: color-mix(in srgb, var(--fc-proj) 16%, transparent); }
.fc-sollopp { fill: color-mix(in srgb, var(--fc-opp) 14%, transparent); stroke: color-mix(in srgb, var(--fc-opp) 45%, transparent); stroke-dasharray: 3 3; }
.fc-absent-bg { fill: color-mix(in srgb, var(--fc-abs) 10%, transparent); }
.fc-hatch { stroke: color-mix(in srgb, var(--fc-abs) 45%, transparent); stroke-width: 2; }
.fc-proj { fill: var(--fc-proj); }
.fc-opp  { fill: var(--fc-opp); }
.fc-ovh  { fill: var(--fc-ovh); }
.fc-hit { fill: transparent; cursor: pointer; }
.fc-hit:hover { fill: color-mix(in srgb, var(--fc-proj) 7%, transparent); }
.chart text.fc-empty { fill: var(--signal); font-weight: 600; }
.chart text.fc-full { fill: #2fa36b; font-weight: 600; }
.chart text.fc-now { fill: var(--signal); font-weight: 700; }
.legend i.fc-l { width: 14px; height: 10px; display: inline-block; border-radius: 2px; }
.fc-l.soll { background: color-mix(in srgb, var(--fc-proj) 16%, transparent); }
.fc-l.sollopp { background: color-mix(in srgb, var(--fc-opp) 14%, transparent); border: 1px dashed color-mix(in srgb, var(--fc-opp) 55%, transparent); }
.fc-l.absent { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--fc-abs) 50%, transparent) 0 2px, transparent 2px 5px); }
.fc-l.proj { background: var(--fc-proj); }
.fc-l.opp { background: var(--fc-opp); }
.fc-l.ovh { background: var(--fc-ovh); }
.fc-table td, .fc-table th { white-space: nowrap; }
table.grid td.neg { color: var(--signal); }
table.grid td.muted { color: var(--ink-3); }
.fc-fixed h3 { margin: 0 0 10px; font-size: calc(13px * var(--fs, 1)); }
.fc-alloc td { padding: 3px 4px; }
.fc-in { width: 62px; text-align: right; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.fc-sub { font-size: calc(10px * var(--fs, 1)); color: var(--ink-3); text-align: right; }
.fc-meter { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--ground); overflow: hidden; vertical-align: middle; }
.fc-meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* Kopfknoepfe im Forecast: mit Symbol; "Saetze & Kapital" farbig hervorgehoben. */
.btn.fc-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.fc-ico { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fc-ico.p { background: var(--fc-proj); }
.fc-ico.c { background: var(--fc-ovh); }
.fc-ico.k { background: #fff; }
.btn.fc-btn.accent { background: linear-gradient(135deg, #2fa36b, #2f6fd6); color: #fff; border-color: transparent; }
.btn.fc-btn.accent:hover { filter: brightness(1.06); }

/* Aufschluesselung: Projektnamen bekommen den Platz, Zahlen stehen daneben */
.fc-detail-proj { width: 100%; }
.fc-detail-proj td.l:first-child { white-space: normal; min-width: 340px; }
.fc-detail-proj td:not(.l), .fc-detail-proj th:not(.l) { width: 90px; }
.fc-mini { width: 180px; }
.fc-meter2 { display: block; width: 160px; }
.fc-meter2 i { display: block; height: 6px; border-radius: 3px; margin: 2px 0; }
.fc-meter2 i.fc.proj { background: var(--fc-proj); }
.fc-meter2 i.fc.opp { background: var(--fc-opp); }
.fc-meter2 i.ist { background: color-mix(in srgb, var(--ink) 35%, transparent); }
.fc-pie-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.fc-pie-wrap table { flex: 1 1 220px; }
.fc-pie svg { display: block; }
.fc-pie-v { font-size: 15px; font-weight: 700; fill: var(--ink); dominant-baseline: middle; }
.fc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: color-mix(in srgb, var(--fc-proj) 7%, var(--sheet)) !important; }
td.pos { color: var(--ok); font-weight: 600; }
.fc-task-head { display: flex; gap: 34px; flex-wrap: wrap; margin-bottom: 18px; }
.fc-task-head .k { font-size: calc(11.5px * var(--fs, 1)); color: var(--ink-3); margin-bottom: 2px; }
.fc-task-head b { font-size: calc(17px * var(--fs, 1)); }
.fc-projects td.l:first-child { white-space: normal; min-width: 300px; }

/* Zurueck im Fenster */
.sheet-tools { display: flex; align-items: center; gap: 10px; flex: none; }

/* Ladebalken: laeuft oben, solange der Server rechnet */
.busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; pointer-events: none; }
.busy i { position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--fc-proj), #2fa36b, transparent);
  animation: busyRun 1.1s ease-in-out infinite; }
@keyframes busyRun { from { left: -40%; } to { left: 100%; } }
body.is-busy, body.is-busy * { cursor: progress !important; }

/* ------------------------------------------------------------ Organigramm 2 */
.org2 { --loc: var(--ink-2); }
.org2-top { display: flex; justify-content: center; margin: 4px 0 0; position: relative; padding-bottom: 28px; }
.org2-top::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 2px; height: 28px; transform: translateX(-50%); background: var(--rule-2); }
.org2-lanes { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(300px, 1fr)); gap: 22px; position: relative; padding-top: 22px; overflow-x: auto; }
/* Querlinie genau von Spaltenmitte zu Spaltenmitte. Vorher fehlte der Spaltenabstand
   in der Rechnung - die Linie begann neben dem senkrechten Strich statt an ihm. */
.org2-top + .org2-lanes::before { content: ''; position: absolute; top: 0; height: 2px; background: var(--rule-2);
  left: calc((100% - (var(--n) - 1) * 22px) / var(--n) / 2 - 1px); right: calc((100% - (var(--n) - 1) * 22px) / var(--n) / 2 - 1px); }
.org2-lanes + .org2-lanes { padding-top: 22px; }
.org2-lane { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--loc); border-radius: var(--r-lg); padding: 14px 14px 18px; min-width: 0; }
.org2-top + .org2-lanes .org2-lane::before { content: ''; position: absolute; left: 50%; top: -26px; width: 2px; height: 22px; transform: translateX(-50%); background: var(--rule-2); }
.org2-lane.loc-ch { --loc: #d52b1e; }
.org2-lane.loc-de { --loc: #e0a800; }
.org2-lane.loc-sa { --loc: #1f8a4c; }
.org2-lane.loc-tx { --loc: #2f6fd6; }
.org2-lhead { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.org2-lhead b { font-size: calc(15px * var(--fs, 1)); }
.org2-lhead .muted { margin-left: auto; font-size: calc(12px * var(--fs, 1)); }
.org2-flag { font-weight: 700; font-size: calc(11px * var(--fs, 1)); line-height: 1; color: #fff; background: var(--loc); border-radius: 6px; padding: 5px 7px; letter-spacing: .04em; }
.org2-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--sheet-2); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 10px 12px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.org2-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.25); border-color: var(--rule-2); }
.org2-card.hero { width: auto; min-width: 300px; padding: 14px 18px; background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.org2-card.hero .org-pos, .org2-card.hero .org-team { color: color-mix(in srgb, var(--sheet) 75%, transparent); }
.org2-card.hero .org-chip { background: color-mix(in srgb, var(--sheet) 16%, transparent); color: var(--sheet); border-color: transparent; }
.org2-card.head { border-left: 4px solid var(--loc); }
.org2-card.lead { background: var(--sheet); border-color: var(--rule-2); }
.org2-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org2-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: calc(12px * var(--fs, 1)); color: #fff; background: var(--loc); }
.org2-card.hero .org2-av { background: var(--sheet); color: var(--ink); width: 42px; height: 42px; }
.org2-av.sm { width: 26px; height: 26px; font-size: calc(10px * var(--fs, 1)); background: color-mix(in srgb, var(--loc) 70%, var(--sheet)); }
.org2-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--loc) 30%, transparent); }
.org2-group { display: flex; flex-direction: column; gap: 6px; }
.org2-gtitle { font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 2px 0; }
.org2-members { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 2px solid var(--rule); margin-left: 16px; }
.org2-members .org2-group { margin: 6px 0; }
.org2-row { display: grid; grid-template-columns: 26px minmax(0, auto) minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  text-align: left; font: inherit; color: inherit; cursor: pointer; background: none; border: 0; border-radius: 8px; padding: 5px 6px; }
.org2-row:hover { background: var(--sheet-2); }
.org2-row .org-name { font-weight: 600; white-space: nowrap; }
.org2-row .org-pos { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: calc(12px * var(--fs, 1)); }
.org-chip.scope { background: color-mix(in srgb, var(--loc) 14%, transparent); border-color: transparent; }
.org2 .hit { outline: 2px solid var(--signal); outline-offset: 2px; }
.org2 .dim { opacity: .35; }
[data-skin="soft"] .org2-lane { border: 0; border-top: 4px solid var(--loc); border-radius: 24px; box-shadow: var(--raise); }
[data-skin="soft"] .org2-card { border: 0; box-shadow: var(--raise-s); border-radius: 16px; }
[data-skin="soft"] .org2-card.head { box-shadow: var(--raise-s), inset 4px 0 0 var(--loc); }
@media (max-width: 900px) {
  .org2-lanes { grid-template-columns: 1fr; }
  .org2-top + .org2-lanes::before, .org2-top + .org2-lanes .org2-lane::before { display: none; }
}

/* ------------------------------------------------------------ Planung */
.pl-avail { fill: color-mix(in srgb, var(--fc-proj) 14%, transparent); stroke: color-mix(in srgb, var(--fc-proj) 30%, transparent); }
.fc-l.pl-avail-l { background: color-mix(in srgb, var(--fc-proj) 14%, transparent); border: 1px solid color-mix(in srgb, var(--fc-proj) 30%, transparent); }
.fc-in.wide { width: 86px; }
.fc-in.manual { border: 2px solid var(--fc-opp); font-weight: 700; }
.pl-table td.l:first-child { min-width: 260px; white-space: normal; }
th.fc-now-th { color: var(--signal); }

/* ------------------------------------------------------------ Uebersicht */
.db-todo { display: flex; flex-direction: column; gap: 10px; }
.db-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--sheet-2); border-left: 4px solid var(--c, var(--ink-3)); }
.db-item.bad { --c: var(--signal); background: color-mix(in srgb, var(--signal) 8%, var(--sheet)); }
.db-item.warn { --c: var(--fc-opp); background: color-mix(in srgb, var(--fc-opp) 9%, var(--sheet)); }
.db-item.info { --c: var(--fc-proj); }
.db-item.ok { --c: var(--fc-abs); background: color-mix(in srgb, var(--fc-abs) 8%, var(--sheet)); }
.db-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--c); }
.db-txt { flex: 1; min-width: 0; }
.db-txt b { font-size: calc(14px * var(--fs, 1)); }
.db-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px; margin-top: 26px; align-items: stretch; }
.db-cols { --card-gap: 0px; }
.db-proj { display: grid; grid-template-columns: minmax(0, 1fr) 160px 90px; gap: 14px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.db-proj:last-child { border-bottom: 0; }
.db-proj-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-proj-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.db-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--fc-proj) 15%, transparent); overflow: hidden; }
.db-bar i { display: block; height: 100%; background: var(--fc-proj); border-radius: 4px; }
[data-skin="soft"] .db-item { border-radius: 18px; box-shadow: var(--raise-s); }
@media (max-width: 900px) { .db-cols { grid-template-columns: 1fr; } .db-proj { grid-template-columns: 1fr 90px; } .db-bar { grid-column: 1 / -1; } }

/* Forecast-Diagramm mit drei Balken je Monat */
.fc-cur { fill: color-mix(in srgb, var(--signal) 6%, transparent); }
.chart text.fc-tiny { font-size: 9px; fill: var(--ink-3); }
.fc-terms { margin-top: 16px; }
.fc-terms summary { cursor: pointer; font-weight: 600; color: var(--fc-proj); }
.fc-terms dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 0; }
.fc-terms dt { font-weight: 700; }
.fc-terms dd { margin: 0; color: var(--ink-2); }
tfoot tr.total td { font-weight: 700; }

/* Ueberlappende Balken: eine feine Kante in Hintergrundfarbe trennt sie */

/* Planung: breiter, mit Zeitraumwahl */
.sheet.tall.wide { width: min(1900px, 98vw); }
.pl-range { margin-bottom: 14px; align-items: center; gap: 10px; }
.pl-range b { min-width: 170px; text-align: center; }

/* Monatsansicht: Projektnummer bleibt, die Bezeichnung kleiner und etwas eingerueckt;
   lange Namen enden mit … (ganzer Name im Tooltip). */
.month-grid td.sticky-l .ptitle { font-size: .84em; margin-left: 12px; color: var(--ink-3); }

/* Balken C6: freie Luecke ueber dem verplanten Balken */
.c6-free { fill: color-mix(in srgb, #d64545 6%, transparent); stroke: #d64545; stroke-width: 1.2; stroke-dasharray: 3 2; }
.c6-free-t { font-size: 10px; font-weight: 700; fill: #d64545; }
.fc-proj.ist, .fc-opp.ist, .fc-ovh.ist { filter: none; opacity: .8; }

/* ------------------------------------------------------------ Anmeldung */
.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 600px at 15% -10%, color-mix(in srgb, var(--signal) 10%, transparent), transparent 60%), var(--paper); }
.auth-card { width: min(400px, 100%); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--lift); padding: 34px 32px 28px; }
.auth-logo { height: 30px; display: block; }
.auth-app { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; margin-top: 10px; }
.auth-card h1 { font-size: 22px; margin: 26px 0 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.auth-form input { width: 100%; padding: 10px 12px; font-size: 15px; }
.auth-go { margin-top: 6px; padding: 11px 15px; font-size: 14px; }
.auth-link { font-size: 13px; color: var(--ink-2); text-align: center; }
.auth-hint { font-size: 13px; color: var(--ink-2); margin: -4px 0 16px; line-height: 1.45; }
.auth-msg { font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--ground); margin-bottom: 14px; }
.auth-msg.bad { background: var(--signal-bg); color: var(--signal); }

/* ------------------------------------------------- Zweifach-Anmeldung */
.auth-card.wide { width: min(560px, 100%); }
.auth-code { font-size: 22px !important; letter-spacing: .25em; font-variant-numeric: tabular-nums; text-align: center; max-width: 220px; }
.tfa-steps { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.45; }
.tfa-qr { margin: 10px 0 4px; }
.tfa-qr svg { width: 200px; height: 200px; display: block; border-radius: 8px; }
.tfa-manual summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.tfa-secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .08em; margin: 8px 0 4px; user-select: all; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 22px; padding: 14px 16px; background: var(--ground); border-radius: var(--r-sm); }
.tfa-codes code { font-size: 15px; letter-spacing: .06em; }
.settings .set-sec { padding: 4px 0 18px; }
.settings .set-sec + .set-sec { border-top: 1px solid var(--rule); padding-top: 16px; }
.settings .set-sec h3 { margin: 0 0 12px; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.settings .set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; }
.settings .set-grid label.field { margin: 0; }
.settings .set-grid .hint { margin-top: 5px; }
.settings .set-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; }
.settings .set-check { display: flex; gap: 8px; align-items: center; font-size: calc(13px * var(--fs, 1)); cursor: pointer; }
.settings .set-check input:disabled + span { color: var(--ink-3); }
.settings-acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.settings-acct .hint { margin: 0; }
.sheet-head-acts { display: flex; gap: 8px; }
.sheet-head-acts:empty { display: none; }
.auth-screen { overflow-y: auto; } .auth-card { margin: auto; }

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-lang { display: inline-flex; }
.auth-lang .seg-b { font-size: 12px; padding: 4px 10px; }
.auth-keep { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 13px; color: var(--ink-2); }
.auth-keep input { width: 15px !important; height: 15px; padding: 0 !important; }

/* Anmeldefenster bleibt beim Sprachwechsel gleich gross: feste Breite, Zeilen ohne Umbruch,
   Mindesthoehe je Ansicht. */
.auth-card { width: 400px; max-width: 100%; min-height: 470px; display: flex; flex-direction: column; }
.auth-card h1, .auth-link, .auth-keep span, .auth-form label > span { white-space: nowrap; }
.auth-lang .seg-b { min-width: 74px; }

/* Zeilen auf- und zuklappen (Monat, Jahr) */
tr.fold-sec, tr.fold-sub { display: none; }
tr.row-foldable > td:first-child { cursor: pointer; user-select: none; }
.row-fold {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin: 0 4px 0 -2px; padding: 0; vertical-align: middle;
  border: 0; border-radius: 4px; background: transparent; color: var(--ink-3); cursor: pointer;
}
.row-fold:hover { background: var(--ground); color: var(--ink); }
.row-fold .chev {
  width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg); transition: transform .18s var(--ease, ease);
}
tr.row-folded .row-fold .chev { transform: translateX(-1px) rotate(-45deg); }
tr.row-folded > td:first-child { font-weight: 600; }

/* Monat: Raster ganz gezeigt - kein eigenes senkrechtes Scrollen, das Mausrad
   rollt die Seite. KW-Marke ueber dem Montag statt Knopfleiste im Kopf. */
.grid-scroll.full { overflow-y: hidden; overscroll-behavior: auto; }
.month-grid th .kw { font-size: 10px; font-weight: 600; color: var(--ink-3); white-space: nowrap; line-height: 1.1; }

/* Tabellenfilter mit Haekchen */
.mf { position: relative; }
.mf-btn { width: 100%; text-align: left; font: inherit; font-size: calc(12px * var(--fs, 1)); padding: 4px 22px 4px 8px;
  border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); color: var(--ink-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; font-weight: 400; }
.mf-btn::after { content: ''; position: absolute; right: 8px; top: 50%; width: 5px; height: 5px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.mf-btn.on { border-color: var(--ink-2); color: var(--ink); font-weight: 600; }
.mf-pop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 220px; max-width: 320px;
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r-lg); box-shadow: 0 10px 30px var(--shadow-c);
  padding: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.mf-pop input[type=search] { width: 100%; margin-bottom: 6px; }
.mf-list { max-height: 260px; overflow: auto; }
.mf-item { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: pointer;
  font-size: calc(13px * var(--fs, 1)); color: var(--ink); white-space: nowrap; }
.mf-item:hover { background: var(--ground); }
.mf-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 6px; }

/* Mitarbeiterformular: breit, zweispaltig */
.sheet.wide { width: min(1080px, 94vw); }
.emp-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; align-items: start; }
.emp-form > .hint, .emp-form > .row2, .emp-form > .row3, .emp-form > .check { grid-column: 1 / -1; }
.emp-form > .hint { margin-top: -6px; }
@media (max-width: 760px) { .emp-form { grid-template-columns: 1fr; } }

/* Tabellen mit festen Spalten (Projekte, Opportunities, Archiv buendig) */
table.dt-fixed { table-layout: fixed; width: 100%; min-width: 1100px; }
table.dt-fixed td, table.dt-fixed th { overflow: hidden; text-overflow: ellipsis; }
table.dt-fixed td:last-child { overflow: visible; white-space: nowrap; }
/* Filterzeile: alles links, Filterfelder buendig */
.dt-filters th { text-align: left; vertical-align: top; }
.dt-filters .mf, .dt-filters input:not([type="checkbox"]), .dt-filters select { width: 100%; }
.mf-list .mf-item { display: flex; width: 100%; }

/* Monat: Zelle aus dem Time Report */
.month-grid td.d input.cell.fs { background: color-mix(in srgb, var(--signal) 7%, transparent); color: var(--ink-2); cursor: not-allowed; }

/* Spesen */
.exp-sum { font-weight: 600; margin: 4px 0 6px; }
.exp-prev { margin: -4px 0 10px; }

/* Time Report */
.fs-check tr.we td { background: var(--sheet-2); }
.fs-check td.fs-c { text-align: center; white-space: nowrap; }
.fs-sub-l .fs-ico { display: inline-block; vertical-align: -2px; margin-right: 5px; color: var(--ink-2); }
.fs-check td.k-travel { background: color-mix(in srgb, #2f6fd6 12%, transparent); }
.fs-check td.k-standby { background: color-mix(in srgb, #e0a800 16%, transparent); }
.fs-check td.k-off { color: var(--ink-3); }
.fs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--ink-inv); border-color: var(--ink); }

/* Time Report: Reiter, Job Card, Crew, Berichte */
.fs-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--rule-2); }
.fs-tab { font: inherit; font-weight: 600; font-size: calc(13px * var(--fs, 1)); padding: 9px 16px; border: 0; border-bottom: 3px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; margin-bottom: -1px; }
.fs-tab:hover { color: var(--ink); }
.fs-tab.on { color: var(--ink); border-bottom-color: var(--signal); }
.fs-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: end; }
.fs-form .fs-wide { grid-column: 1 / -1; }
.fs-crew input { font: inherit; padding: 3px 6px; border: 1px solid var(--rule-2); border-radius: 5px; background: var(--sheet); color: var(--ink); }
.fs-crew td { vertical-align: middle; }
.lead-btn { font: inherit; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink-3); cursor: pointer; }
.lead-btn.on { background: var(--signal); border-color: var(--signal); color: #fff; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; margin-left: 4px; font-size: 13px; line-height: 1; }
.fs-rep { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.fs-rep:last-child { border-bottom: 0; }
.fs-check td.fs-off { background: repeating-linear-gradient(45deg, transparent 0 5px, var(--rule) 5px 6px); }
@media (max-width: 900px) { .fs-form { grid-template-columns: 1fr; } }

/* Live / Demo */


/* =============================================================== Einheitlich
   Hoehe der Bedienelemente: Knopf, Eingabe, Auswahl stehen in einer Zeile gleich hoch. */
:root { --ctl-h: 36px; --ctl-h-sm: 28px; }
button.btn, .btn, :where(input:not([type=checkbox]):not([type=radio])), select { min-height: var(--ctl-h); box-sizing: border-box; }
.btn.sm, .toolbar .btn.sm, table input:not([type=checkbox]), table select, .mf-btn, .fs-crew input,
.month-grid input.cell, .month-grid select { min-height: var(--ctl-h-sm); }
.month-grid input.cell { min-height: 0; }

/* Periodennavigation (Tag, Monat, Jahr, Freigaben, Time Report, Forecast): eine Form */
.period-nav { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
/* Pfeile gross und deutlich - vorher kaum erkennbar (Sven via D. Fischer, 20.11.2026). */
.period-nav > .btn { min-width: 40px; height: 36px; padding: 0 10px; font-size: calc(26px * var(--fs, 1)); font-weight: 700; line-height: 1;
  color: var(--brand); border: 1.5px solid var(--brand); border-radius: 999px; }
/* Monat/Zeitraum deutlich hervorgehoben - man sieht sofort, welcher Monat offen ist (T. Kueng, 06.11.2026). */
/* Feste Mindestbreite fuer den laengsten Monat ("September 2026"), sonst springen die Pfeile je Monat (D. Fischer, 17.11.2026). */
.period-nav .period-label { min-width: 11em; box-sizing: border-box; font-variant-numeric: tabular-nums; text-align: center; font-weight: 700; font-size: calc(17px * var(--fs, 1)); white-space: nowrap;
  color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 4px 14px; }

/* Navigation: zeigt an, dass rechts noch Reiter kommen; auf dem Handy eigene Zeile */
.tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: 8px; row-gap: 0; }
  .tabs { order: 3; flex: 1 0 100%; }
  .tabs button { padding: 12px 0; }
  /* Monat: schmale feste Spalten, damit Tage sichtbar bleiben */
  .month-grid { --w-l: 140px !important; }
  .month-grid th.sticky-p, .month-grid td.sticky-p { display: none; }
  .month-grid.with-phase th.sticky-t, .month-grid.with-phase td.sticky-t { left: var(--w-l); }
  .page-head .toolbar select { min-width: 0; }
}
.page-head .toolbar select { max-width: 100%; }

/* Utility statt Inline-Stil */
.hint.tight { margin: 0; }
.stack-gap { margin-top: var(--card-gap, 20px); }
@media (max-width: 720px) {
  /* Zu erledigen: Knopf unter den Text statt darueber */
  .db-item { flex-wrap: wrap; }
  .db-item .db-txt { flex: 1 1 0; min-width: 0; }
  .db-item > .btn { flex: 1 0 100%; margin-left: 0; white-space: normal; }
}

/* Filter-Aufklappliste: Haekchen links, Text daneben, alles buendig - die Regel
   ".dt-filters input { width:100% }" darf die Haekchen nicht strecken. */
.dt-filters .mf-pop, .mf-pop { text-align: left; }
.dt-filters .mf-pop input[type="checkbox"], .mf-pop input[type="checkbox"] { width: 15px; min-width: 15px; flex: none; margin: 0; }
.mf-pop .mf-item { justify-content: flex-start; text-transform: none; letter-spacing: 0; font-weight: 400; }
.mf-pop .mf-item span { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.mf-pop .mf-foot { justify-content: flex-start; }


/* Organigramm: CFO o. a. neben dem CEO, die Linie nach unten bleibt beim CEO.
   Raster statt absoluter Lage: der CEO bleibt in der Mitte, rechts daneben die
   Geschaeftsleitung mit ihrem Team - nimmt Platz ein und ueberdeckt nichts. */
.org2-hero-wrap { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 40px; width: 100%; align-items: start; }
.org2-ceo { grid-column: 2; align-self: stretch; display: flex; flex-direction: column; align-items: center; }
.org2-ceo::after { content: ''; flex: 1; width: 2px; background: var(--rule-2); }
.org2-exec { display: flex; flex-direction: column; gap: 6px; }
.org2-exec .org2-members { padding-left: 14px; }
.org2-peers { grid-column: 3; justify-self: start; position: relative; display: flex; gap: 16px; align-items: flex-start; }
.org2-peers::before { content: ''; position: absolute; left: -40px; top: 36px; width: 40px; border-top: 2px dashed var(--rule-2); }
@media (max-width: 720px) { .org2-hero-wrap { display: flex; flex-direction: column; align-items: center; } .org2-ceo::after { display: none; }
  .org2-peers { margin-top: 12px; flex-direction: column; } .org2-peers::before { display: none; } }

/* Time Report: Personenauswahl */
.fs-pick-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
.fs-pick-filters .field { margin-bottom: 6px; }
.fs-pick-filters select, .fs-pick-filters input { width: 100%; }
.fs-pick-list { max-height: 52vh; overflow: auto; }
@media (max-width: 720px) { .fs-pick-filters { grid-template-columns: 1fr 1fr; } }

/* Time Report Pruefansicht: klare Spalten je Person, Kopf und Datum bleiben stehen */
/* FS12: so hoch wie der Bildschirm - Kopfzeile bleibt dabei stehen (Angabe D. Fischer, 19.10.2026) */
.fs-check-wrap { max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); }
.fs-check { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.fs-check th, .fs-check td { border-right: 1px solid var(--rule); }
.fs-check th:last-child, .fs-check td:last-child { border-right: 0; }
.fs-check thead th { position: sticky; top: 0; z-index: 2; background: var(--sheet); border-bottom: 2px solid var(--rule-2); vertical-align: bottom; }
.fs-check th.fs-ph { text-align: center; padding: 8px 4px; }
.fs-check th.fs-ph b { display: block; font-size: calc(13px * var(--fs, 1)); }
.fs-check th.fs-ph span { display: block; font-size: 11px; font-weight: 400; color: var(--ink-2); white-space: normal; line-height: 1.25; }
.fs-check th.fs-ph small { display: block; font-size: 10px; font-weight: 400; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-check td.l, .fs-check th.l { position: sticky; left: 0; z-index: 1; background: var(--sheet); white-space: nowrap; }
.fs-check thead th.l { z-index: 3; }
.fs-check tr.we td.l { background: var(--sheet-2); }
.fs-check tr.total td { font-weight: 600; text-align: center; background: var(--sheet-2); }
.fs-check tr.total td.l { text-align: left; }
.fs-check tr.total.first td { border-top: 2px solid var(--rule-2); }

/* Personenauswahl: Filter Standort/Abteilung + Person */
.pp { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pp-scope { max-width: 220px; }
.switcher .pp-scope { max-width: 180px; margin-right: 6px; }

/* Organigramm: Online-Punkt (gruen = in den letzten 5 Minuten aktiv) */
.org2-av { position: relative; }
.org-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: #d64545; border: 2px solid var(--sheet); }
.org-dot.on { background: #2fa36b; }
.org2-av.sm .org-dot { width: 8px; height: 8px; right: -3px; bottom: -3px; }

/* Projekte: Auswahl-Liste */
.pv-list { max-height: 360px; overflow: auto; border-top: 1px solid var(--rule); }
.pv-list tr.sel td { background: color-mix(in srgb, var(--fc-proj, #2f6fd6) 14%, transparent); font-weight: 600; }

/* Projekte: Abstand zwischen Auswahl und Details; Titel + Pille als Gruppe */
.pv-body { margin-top: var(--card-gap, 20px); }
.pv-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; }
.pv-title h2 { margin: 0; }

/* Monat: KW als kleine Marke oben im Kopf - alle Tageszahlen stehen auf derselben Hoehe */
.month-grid thead th.d { padding-top: 17px; }
.month-grid thead th .kw { position: absolute; top: 3px; left: 0; right: 0; text-align: center; display: block; }

/* Projekte: Filter als zweite Kopfzeile, exakt unter den Spalten */
.pv-table { table-layout: fixed; width: 100%; }
.pv-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-list thead { position: sticky; top: 0; z-index: 1; background: var(--sheet); }
.pv-list thead th { position: static; background: var(--sheet); }
.pv-frow th.pv-f { padding-top: 0; padding-bottom: 8px; }
.pv-frow select, .pv-frow input { width: 100%; box-sizing: border-box; }

/* Field Service (FSE): Tagesarten unter dem Projekt in der Monatsansicht - leicht eingerueckt. */
.month-grid tr.fs-sub td.sticky-l .fs-sub-n { padding-left: 18px; font-size: 12px; color: var(--ink-2); }
.month-grid tr.fs-sub td.sticky-l .fs-sub-n::before { content: '\21B3\00A0'; color: var(--ink-3); }
/* Projektmaske: Kommentar des FSE Lead am rechten Rand */
.fs-check td.fs-note { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.fs-check td.fs-note input.fs-note-in { width: 100%; font-size: 12px; }
/* Projektmaske: Daily-Activities-Attribute getrennt vom Kommentar */
.fs-check td.fs-note .fs-attrs:empty { display: none; }
.fs-check td.fs-note .fs-attr { display: inline-block; font-size: 11px; padding: 1px 6px; margin: 1px 4px 2px 0; border-radius: 8px; background: var(--ground); color: var(--ink-2); }
.fs-check td.fs-note .fs-attr.we { background: #fff1d6; color: #7a5200; }
.pv-mask .fs-embed-head { display: flex; justify-content: flex-end; margin: 6px 0 10px; }
/* Projektmaske: gleiche Abstaende zwischen allen Karten (auch vor und nach dem Zweier-Raster) */

/* Kennzahlen zweispaltig (Projektkopf, Projektmaske "Verantwortlich"): Bezeichnung links, Wert rechts. */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.mode-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.mode-row > span { color: var(--ink-3); }
.mode-row > b { text-align: right; }
@media (max-width: 700px) { .mode-grid { grid-template-columns: 1fr; } }

.org2-cflag { display: inline-flex; height: 18px; }
.org2-cflag svg { height: 18px; width: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.month-grid td.sticky-l.clickable { cursor: pointer; }
.month-grid td.sticky-l.clickable:hover .ptitle, .month-grid td.sticky-l.clickable:hover .pnum { text-decoration: underline; }
.topic-month { width: 100%; }
.topic-month td, .topic-month th { padding: 4px 8px; }
/* MO04: Datum, Tag, Phase, Stunden so schmal wie noetig - der Kommentar bekommt den Rest. */
.topic-month td:not(:last-child), .topic-month th:not(:last-child) { width: 1%; white-space: nowrap; }
.topic-month td:last-child { width: auto; }
.topic-month .brow-note { width: 100%; box-sizing: border-box; min-width: 0; }
.topic-month tr.we td, .topic-month tr.hol td { background: var(--ground); }
.topic-month tr.muted td { color: var(--ink-3); }
.fs-rep .toolbar { flex-wrap: nowrap; }
.fs-rep-sel { min-width: 210px; }
/* Freelancer: Nichtverfuegbarkeit (ohne Freigabe) und eingeplante Opportunity im Jahresraster */
.yd.av-vac_flex  { background: repeating-linear-gradient(135deg, #e3a23b 0 4px, #f3d39c 4px 8px); }
.yd.av-vac_fixed { background: #d9822b; }
.yd.av-other     { background: #7a6bd1; }
.yd.av-vac_flex .yd-n { color: #3a2a08; }
.yd.av-vac_fixed .yd-n, .yd.av-other .yd-n { color: #fff; }
/* Einteilung auf ein Projekt: schmale farbige Linie unten im Tag (Farbe je Projekt, Legende darunter). */
.yd .yd-plan { position: absolute; left: 3px; right: 3px; height: 3px; border-radius: 2px; }
.plan-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.util-card { margin-top: var(--card-gap, 20px); }

/* ------------------------------------------------------------------ Finance */
/* Unterreiter: zweite Leiste unter der Kopfleiste, wie in der HTML der Finanzabteilung. */
.fin-subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: -4px 0 18px; overflow-x: auto; }
.fin-subtabs button { font: inherit; font-size: calc(12px * var(--fs, 1)); letter-spacing: .03em; text-transform: uppercase;
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.fin-subtabs button:hover { color: var(--ink); }
.fin-subtabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent, #A63A2B); font-weight: 600; }
.fin-scroll { overflow-x: auto; }
table.fin-tbl td, table.fin-tbl th { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.fin-tbl .fin-sep { border-left: 1px solid var(--rule); }
table.fin-tbl th.fin-grp { text-align: center; }
table.fin-tbl .fin-gt { background: color-mix(in srgb, #2E6B5E 12%, transparent); }
table.fin-tbl .fin-b { font-weight: 600; }
table.fin-tbl .fin-neg { color: #C0392B; }
table.fin-tbl tr.fin-sub td:first-child { padding-left: 24px; color: var(--ink-3); }
table.fin-tbl tr.fin-empty td { color: var(--ink-3); }
table.fin-tbl tr.fin-sel td, table.fin-tbl tr.fin-cur td { background: color-mix(in srgb, #C68A1E 14%, transparent); }
table.fin-tbl td.fin-fx { color: #2E6B5E; }
table.fin-tbl td.fin-input { background: color-mix(in srgb, #F2C94C 16%, transparent); padding: 4px 6px; }
table.fin-tbl input.fin-in { width: 120px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
table.fin-tbl input.fin-in.loan { color: #C0392B; }
/* Dunkel: hellere Toene, sonst unter 3:1 auf dunklem Grund (Review 22.10.2026). */
:root[data-theme="dark"] table.fin-tbl .fin-neg, :root[data-theme="dark"] table.fin-tbl input.fin-in.loan { color: #ff8a80; }
:root[data-theme="dark"] table.fin-tbl td.fin-fx { color: #7fd1bd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) table.fin-tbl .fin-neg, :root:not([data-theme="light"]) table.fin-tbl input.fin-in.loan { color: #ff8a80; }
  :root:not([data-theme="light"]) table.fin-tbl td.fin-fx { color: #7fd1bd; }
}
table.fin-tbl input.fin-cmt { width: 240px; }
.fin-notes { margin: 0; padding-left: 18px; }
.fin-notes li { margin-bottom: 6px; line-height: 1.45; }
.fin-tag { font-size: calc(12px * var(--fs, 1)); color: var(--ink-3); }
.fin-steps { margin: 0; padding-left: 20px; }
.fin-steps li { margin-bottom: 9px; line-height: 1.5; }
.fin-legend { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.fin-legend i { width: 12px; height: 12px; border-radius: 2px; flex: none; }

/* Kopfleiste: Reiter passen nicht in eine Zeile (Zoom, grosse Schrift) - eigene Zeile, umbrechen.
   Der gleitende Strich kennt nur eine Zeile; hier markiert sich der aktive Reiter selbst. */
.topbar.tabs-wrap { flex-wrap: wrap; height: auto; padding-top: 8px; row-gap: 0; }
.topbar.tabs-wrap .topbar-right { margin-left: auto; }
.topbar.tabs-wrap .tabs { order: 3; flex: 1 0 100%; flex-wrap: wrap; overflow: visible; column-gap: 22px; row-gap: 0;
  -webkit-mask-image: none; mask-image: none; }
.topbar.tabs-wrap .tabs button { padding: 10px 0; }
.topbar.tabs-wrap .tab-bar { display: none; }
.topbar.tabs-wrap .tabs button[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--signal); }

/* Mitarbeiter: Arbeitstage mit Tagessoll darunter. */
.wd-days { display: flex; gap: 10px 14px; flex-wrap: wrap; }
.wd-day { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.wd-day .wd-h { width: 64px; text-align: right; font-variant-numeric: tabular-nums; padding: 4px 6px; }
.wd-day .wd-h:disabled { color: var(--ink-3); }

/* Finance: geaendert, noch nicht gespeichert */
.fin-in.fin-dirty, .fin-cmt.fin-dirty { background: #FFF4D6; outline: 1px solid #E0B040; color: #222; }

/* Kuerzel (4 Zeichen) an Ansicht, Karte und Fenster - zum Benennen bei Fehlermeldungen */
.card[data-code] { position: relative; }
.card[data-code]::after, .view-box[data-code]:not([data-code=""])::before, .sheet[data-code]:not([data-code=""])::after {
  content: attr(data-code); position: absolute; pointer-events: none; z-index: 20;
  font: 700 10px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; white-space: nowrap;
  color: var(--ink-2, #555); background: var(--sheet, #fff); padding: 2px 4px; border-radius: 3px;
}
.card[data-code]::after { top: 2px; right: 10px; }
.view-box { position: relative; }
.view-box[data-code]::before { top: -18px; right: 0; }
.sheet[data-code]::after { top: 4px; left: 12px; }
@media print { .card[data-code]::after, .view-box[data-code]::before, .sheet[data-code]::after { display: none; } }

/* Monat (FSE): + = vom Vortag uebernehmen */
.copy-prev { border: 1px dashed var(--accent, #3E5C76); background: transparent; color: var(--accent, #3E5C76); border-radius: 4px; font-weight: 700; padding: 0 6px; cursor: pointer; line-height: 1.4; }
.copy-prev:disabled { opacity: .45; cursor: not-allowed; }
.copy-prev:not(:disabled):hover { background: var(--accent, #3E5C76); color: var(--sheet); }

/* Druck: nur der Inhalt, hell und ohne Scroll-Begrenzung (Review 22.10.2026). */
@media print {
  .topbar, .tabs, .toolbar, .sheet-backdrop, .fold-btn, .mf-pop { display: none !important; }
  .grid-scroll, .tw, .pivot-scroll, .fs-check-wrap, .fin-scroll { max-height: none !important; overflow: visible !important; }
  :root, :root[data-theme], :root[data-skin] { color-scheme: light; --paper: #fff; --sheet: #fff; --sheet-2: #f4f4f4;
    --ground: #eee; --ink: #111; --ink-2: #333; --ink-3: #555; --rule: #ccc; --rule-2: #999; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
}

/* Touch: kleine Knoepfe auf mindestens 36 px Tippflaeche. */
@media (pointer: coarse) {
  .btn.sm, .icon-btn, .fold-btn { min-height: 36px; min-width: 36px; }
}

/* Schmale Schirme: Tabellen direkt in einer Karte scrollen seitlich statt abgeschnitten zu werden. */
.card-body.flush:has(> table.grid), .dl-sec:has(> table.grid) { overflow-x: auto; }

/* Field Service FS12: OJT-Personen leicht hinterlegt (nicht in Timesheets/QR), Standby nur als Bemerkung. */
.fs-check td.fs-c.fs-ojt { background-color: color-mix(in srgb, var(--accent-2) 10%, transparent); color: var(--ink-3); }
.fs-check td.fs-note .fs-attr.sb { background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
/* Eigenes 24-h-Zeitfeld (statt type=time) */
input.time24 { font-variant-numeric: tabular-nums; }
input.time24.bad-time { border-color: var(--bad); }
