/* ============================================================
   Auswertung: Mitarbeiter- und Projekttabelle als CSS-Grid statt
   <table>, analog zur Tagansicht. 14 Spalten passen auf keinen
   Bildschirm - deshalb ein Umschalter zwischen "Stunden" und
   "Abwesenheiten" statt einer einzigen breiten Tabelle. Eigenes
   rpt-Präfix, weil Namen wie .tr/.td/.person in einem so großen
   Stylesheet sonst leicht mit künftigen, unabhängigen Klassen
   kollidieren - genau das Muster, das an drei Stellen in dieser
   Datei schon zu ungewollten Kaskadentreffern geführt hat.
   ============================================================ */

.rpt-segmented {
  display: flex;
  border: 1px solid var(--border-strong);
  flex: 0 0 auto;
}

.rpt-seg {
  background: #fff;
  border: 0;
  padding: 9px 16px;
  min-height: var(--touch);
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.rpt-seg + .rpt-seg {
  border-left: 1px solid var(--border-strong);
}

.rpt-seg.is-on {
  background: var(--taupe-dark);
  color: #fff;
}

/* Zeitraum-Presets: feste Auswahl statt frei verschiebbarer Monats-
   navigation, damit Werte immer auf nachvollziehbare, wiederkehrende
   Zeitraeume fallen - siehe Brief "Auswertung". Buttons sind echte Links
   (volle Seitenladung), teilen sich aber die .rpt-segmented/.rseg-Optik
   mit dem Stunden/Abwesenheiten-Umschalter. */
.range-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.rseg {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 0;
  padding: 9px 16px;
  min-height: var(--touch);
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}

.rseg + .rseg {
  border-left: 1px solid var(--border-strong);
}

.rseg.is-on {
  background: var(--taupe-dark);
  color: #fff;
}

.range-custom {
  display: flex;
  gap: 16px;
  margin: 0;
}

.range-custom label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--f-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.range-custom input[type="month"] {
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 0;
  padding: 7px 10px;
  min-height: 38px;
}

.rpt-tbl-wrap {
  overflow-x: auto;
}

.rpt-tbl {
  min-width: 100%;
}

.rpt-tr {
  display: grid;
  grid-template-columns:
    minmax(180px, 250px) minmax(132px, 1fr) minmax(116px, 1fr) minmax(92px, 1fr)
    minmax(92px, 1fr) minmax(112px, 1fr) minmax(98px, 1fr) minmax(124px, 1.1fr);
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.rpt-tbl.is-absence .rpt-tr {
  grid-template-columns:
    minmax(180px, 250px) minmax(88px, 1fr) minmax(88px, 1fr) minmax(128px, 1fr)
    minmax(142px, 1fr) minmax(120px, 1fr) minmax(112px, 1fr);
}

.rpt-tr:last-child {
  border-bottom: 0;
}

.rpt-tr-head {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border-strong);
  align-items: end;
}

/* Zweistufiger Kopf: "Fortbildung" steht einmal über beiden
   Unterspalten, spart Kopfhöhe und Wortlänge. */
.rpt-tr-group {
  background: var(--surface-soft);
  border-bottom: 0;
}

.rpt-tr-group .rpt-th {
  padding-bottom: 2px;
  cursor: default;
}

.rpt-gh-span {
  grid-column: span 2;
  text-align: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 5px;
}

.rpt-tr-body:hover {
  background: var(--taupe-wash);
}

.rpt-tr-total {
  background: var(--surface-soft);
  border-top: 2px solid var(--text);
  border-bottom: 0;
}

.rpt-th {
  padding: 10px 12px;
  font-family: var(--f-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  line-height: 1.25;
  border: 0;
  background: none;
}

.rpt-th:first-child {
  text-align: left;
  justify-content: flex-start;
}

.rpt-th:hover {
  color: var(--taupe-dark);
}

.rpt-th .rpt-ind {
  opacity: 0;
  font-size: 0.85em;
}

.rpt-th.is-sorted .rpt-ind {
  opacity: 1;
  color: var(--taupe-dark);
}

.rpt-th.is-sorted {
  color: var(--text);
}

.rpt-td {
  padding: 9px 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.93rem;
}

.rpt-td:first-child {
  text-align: left;
}

.rpt-td-name strong {
  font-family: var(--f-ui);
  font-weight: normal;
  display: block;
}

.rpt-td-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.rpt-td-strong {
  font-family: var(--f-bold);
}

.rpt-td.is-pos {
  color: var(--pos);
}

.rpt-td.is-neg {
  color: var(--neg);
}

/* Nullwerte treten über die Schriftstärke zurück, nicht über eine
   noch hellere Farbe: --muted ist bereits der hellste Ton, der
   überall über 4,5:1 Kontrast bleibt. */
.rpt-td.td-zero {
  color: var(--muted);
  font-family: var(--f-body);
}

.rpt-td.td-filled {
  font-family: var(--f-bold);
  color: var(--text);
}

/* Balken macht Ausreißer bei Stundenstand auf einen Blick sichtbar */
.rpt-bar {
  position: relative;
  display: block;
  height: 4px;
  background: var(--surface-soft);
  margin-top: 5px;
  overflow: hidden;
}

.rpt-bar-mid {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border-strong);
}

.rpt-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
}

.rpt-bar-fill.is-pos {
  background: var(--pos);
  left: 50%;
}

.rpt-bar-fill.is-neg {
  background: var(--neg);
  right: 50%;
}

/* ---------- Projekte und Leistungsphasen ---------- */
.rpt-proj {
  border-bottom: 1px solid var(--border);
}

.rpt-proj:last-child {
  border-bottom: 0;
}

/* Projektzeile trägt die Fläche, Leistungsphasen darunter sind hell -
   umgekehrt hätte die Gliederung auf dem Kopf gestanden. Jetzt ein
   <summary> (Projekt und Leistungsphasen sind aufklappbar, siehe Brief),
   deshalb Cursor/Hover und die eigene Markierung entfernt. */
.rpt-proj-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--taupe-wash);
  border-bottom: 1px solid var(--border-strong);
  cursor: pointer;
  list-style: none;
}

.rpt-proj-head::-webkit-details-marker {
  display: none;
}

.rpt-proj-head:hover {
  background: #e2ded6;
}

.rpt-proj-chev {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.rpt-proj[open] > .rpt-proj-head .rpt-proj-chev {
  transform: rotate(90deg);
}

.rpt-proj-num {
  font-family: var(--f-bold);
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.rpt-proj-name {
  flex: 1;
  min-width: 0;
}

.rpt-proj-share {
  flex: 0 0 200px;
  height: 6px;
  background: #fff;
  position: relative;
}

.rpt-proj-share span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--taupe);
}

.rpt-proj-pct {
  flex: 0 0 46px;
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rpt-proj-hours {
  flex: 0 0 96px;
  text-align: right;
  font-family: var(--f-bold);
  font-variant-numeric: tabular-nums;
}

/* Monatsblock: nur sichtbar (und nur einer), wenn der Zeitraum genau
   einen Monat umfasst - siehe Brief. Blendet die Wiederholung von z.B.
   "Juli 2026" bei einmonatigen Zeitraeumen konsequent aus. */
.rpt-proj-month + .rpt-proj-month {
  border-top: 1px solid var(--border-strong);
}

.rpt-proj-month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 24px 9px calc(24px + 20px);
  background: var(--surface-soft);
}

.rpt-proj-month-head strong {
  font-family: var(--f-ui);
  font-weight: normal;
  font-size: 0.82rem;
}

.rpt-proj-month-head span {
  font-family: var(--f-bold);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.rpt-phase {
  display: grid;
  grid-template-columns: 150px 96px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 10px 24px 10px calc(24px + 20px);
  border-top: 1px solid var(--border);
  background: #fff;
}

.rpt-phase-code {
  font-family: var(--f-ui);
}

.rpt-phase-code em {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}

.rpt-phase-h {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--f-bold);
  white-space: nowrap;
}

.rpt-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rpt-person {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.rpt-person b {
  font-family: var(--f-bold);
  font-weight: normal;
  font-variant-numeric: tabular-nums;
}

.head-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.head-total span {
  font-family: var(--f-ui);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.head-total strong {
  font-family: var(--f-bold);
  font-size: 1.16rem;
  font-weight: normal;
  font-variant-numeric: tabular-nums;
}

/* ---------- Hinweis ---------- */
.rpt-note-card {
  border-top: 1px solid var(--border);
  padding: 34px 0 0;
  margin-top: 54px;
}

.rpt-note-card h2 {
  font-family: var(--f-ui);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.rpt-note-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  columns: 2;
  column-gap: 32px;
}

.rpt-note-list li {
  margin-bottom: 3px;
  break-inside: avoid;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mobil: Karten je Person statt gequetschter Tabelle.
   Bewusst bei 900px statt der sonst 760px der App - 14 Spalten
   mal 13 Mitarbeitende brauchen mehr Luft als das übliche Raster. --- */
@media (max-width: 900px) {
  .rpt-tbl-wrap {
    overflow: visible;
  }

  .rpt-tr-head,
  .rpt-tr-group,
  .rpt-tr-total {
    display: none;
  }

  .rpt-tr {
    display: block;
    border: 1px solid var(--border);
    margin: 12px 0 0;
    padding: 12px;
  }

  .rpt-td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    text-align: right;
    border-bottom: 1px solid var(--border);
  }

  .rpt-td:last-child {
    border-bottom: 0;
  }

  .rpt-td::before {
    content: attr(data-label);
    font-family: var(--f-ui);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    flex: 1 1 auto;
  }

  .rpt-td-name {
    display: block;
    padding: 0 0 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: 8px;
  }

  .rpt-td-name::before {
    content: none;
  }

  .rpt-bar {
    display: none;
  }

  .rpt-m-total {
    border: 2px solid var(--text);
    margin: 12px 0 0;
    padding: 12px;
  }

  .rpt-m-total-head {
    font-family: var(--f-ui);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .rpt-m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
  }

  .rpt-m-item {
    display: flex;
    flex-direction: column;
  }

  .rpt-m-item span {
    font-size: 0.74rem;
    color: var(--muted);
  }

  .rpt-m-item strong {
    font-family: var(--f-bold);
    font-weight: normal;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
  }

  .rpt-m-pick {
    margin: 12px 0 0;
  }

  .rpt-m-pick select {
    width: 100%;
    min-height: var(--touch);
    font-size: 16px;
    font-family: var(--f-body);
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: 0;
  }

  .rpt-proj-head {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px;
  }

  .rpt-proj-name {
    flex: 1 1 100%;
    order: 1;
  }

  .rpt-proj-num {
    order: 0;
  }

  .rpt-proj-hours {
    order: 0;
    flex: 1;
    text-align: right;
  }

  .rpt-proj-share {
    order: 2;
    flex: 1 1 100%;
  }

  .rpt-proj-pct {
    order: 3;
  }

  .rpt-phase {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    gap: 8px 12px;
  }

  .rpt-people {
    grid-column: 1 / -1;
  }

  .rpt-note-list {
    columns: 1;
  }

  .rpt-segmented {
    width: 100%;
  }

  .rpt-seg {
    flex: 1;
    min-height: var(--touch);
  }

  .range-pick {
    align-items: stretch;
    width: 100%;
  }

  .range-pick .rpt-segmented {
    width: 100%;
  }

  .range-pick .rseg {
    flex: 1;
    min-height: var(--touch);
  }

  .range-custom {
    width: 100%;
  }

  .range-custom label {
    flex: 1;
  }

  .range-custom input {
    width: 100%;
    min-height: var(--touch);
  }

  .rpt-proj-month-head {
    padding: 8px 16px;
  }
}

/* Responsive */
@media (max-width: 1200px) {

  .report-summary-grid .calendar-kpi {
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .report-summary-grid .calendar-kpi:nth-child(2n) {
    border-right: 0 !important;
  }

  .report-summary-grid .calendar-kpi:last-child {
    border-bottom: 0 !important;
  }
}

@media (max-width: 900px) {
  .report-summary-grid {
    grid-template-columns: 1fr;
  }

  .report-summary-grid .calendar-kpi,
  .report-summary-grid .calendar-kpi:nth-child(2n) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .report-summary-grid .calendar-kpi:last-child {
    border-bottom: 0 !important;
  }

}


/* Nach Entfernen des Monatsfilters rücken die Kennzahlen sauber nach oben */
.dashboard-header + .report-summary-grid {
  margin-top: 6px;
}

/* Die vierte und fünfte Kennzahl bleiben darunter, aber im gleichen Raster */
.report-summary-grid .calendar-kpi {
  border-right: 1px solid var(--agsta-border) !important;
  border-bottom: 1px solid var(--agsta-border) !important;
}

.report-summary-grid .calendar-kpi:nth-child(3n) {
  border-right: 0 !important;
}

/* Bei fünf Elementen: letzte Zeile unten sauber abschließen */
.report-summary-grid .calendar-kpi:nth-child(4),
.report-summary-grid .calendar-kpi:nth-child(5) {
  border-bottom: 0 !important;
}

.report-summary-grid .calendar-kpi:nth-child(5) {
  border-right: 0 !important;
}

/* Alte 2-Spalten-Umschaltung überschreiben, damit Differenz nicht nach unten rutscht */
@media (max-width: 1200px) {

  .report-summary-grid .calendar-kpi {
    border-right: 1px solid var(--agsta-border) !important;
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .report-summary-grid .calendar-kpi:nth-child(3n) {
    border-right: 0 !important;
  }

  .report-summary-grid .calendar-kpi:nth-child(4),
  .report-summary-grid .calendar-kpi:nth-child(5) {
    border-bottom: 0 !important;
  }

  .report-summary-grid .calendar-kpi:nth-child(5) {
    border-right: 0 !important;
  }
}

.report-summary-grid {
  display: grid;
  gap: 0 !important;
  margin: 0 0 54px;
  border-top: 1px solid var(--agsta-border);
  border-bottom: 1px solid var(--agsta-border);
  background: #ffffff;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 1180px;
}

@media (max-width: 1200px) {
  .report-summary-grid {
    display: grid;
    gap: 0 !important;
    margin: 0 0 54px;
    border-top: 1px solid var(--agsta-border);
    border-bottom: 1px solid var(--agsta-border);
    background: #ffffff;
    max-width: 1180px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Erst auf schmalen Mobilbreiten stapeln */
@media (max-width: 760px) {
  .report-summary-grid {
    grid-template-columns: 1fr !important;
  }

  .report-summary-grid .calendar-kpi,
  .report-summary-grid .calendar-kpi:nth-child(3n),
  .report-summary-grid .calendar-kpi:nth-child(4),
  .report-summary-grid .calendar-kpi:nth-child(5) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .report-summary-grid .calendar-kpi:last-child {
    border-bottom: 0 !important;
  }
}

/* Verwaltungsseiten insgesamt ruhiger */

.admin-create-card {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  max-width: 1040px;
  margin-bottom: 58px;
}

.admin-create-card h2,
.admin-table-card h2 {
  margin-bottom: 24px;
}

.admin-form-grid button[type="submit"] {
  justify-self: start;
  width: auto !important;
  min-height: 48px;
  padding: 13px 22px;
}

/* Bearbeitungstabellen */

.admin-table-card {
  box-shadow: none !important;
  overflow: visible !important;
  margin-top: 0;
  padding: 34px 36px !important;
  border: 1px solid var(--agsta-border) !important;
  overflow-x: auto !important;
}

.admin-edit-table {
  width: 100%;
  min-width: 940px;
}

.admin-edit-table th,
.admin-edit-table td,
.admin-audit-table th,
.admin-audit-table td {
  vertical-align: middle !important;
}

.admin-edit-table input:not([type="checkbox"]):not([type="radio"]),
.admin-edit-table select {
  min-height: 42px !important;
  height: 42px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--agsta-border) !important;
  background: #ffffff !important;
  width: 100%;
}

.admin-edit-table input[type="number"] {
  width: 96px !important;
  min-width: 96px !important;
}

.admin-edit-table button {
  min-height: 42px !important;
  height: 42px !important;
  padding: 9px 14px !important;
  white-space: nowrap;
}

/* Aktiv-Häkchen klein, eckig, schwarzweiß */
.inline-check {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  color: var(--agsta-text);
  font-weight: 600;
  line-height: 1;
}

.inline-check input[type="checkbox"] {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  border-radius: 0 !important;
  accent-color: var(--agsta-text);
}

.admin-user-table .inline-form input[name="password"] {
  min-width: 170px;
  width: 170px !important;
}

/* Leistungsphasen etwas kompakter */
.admin-category-table {
  min-width: 720px;
}

.admin-category-table td:first-child {
  font-weight: 700;
}

/* Änderungsprotokoll */

.admin-audit-card {
  box-shadow: none !important;
  overflow: visible !important;
  padding: 34px 36px !important;
  border: 1px solid var(--agsta-border) !important;
  overflow-x: auto !important;
}

.admin-audit-table {
  min-width: 980px;
}

.admin-audit-table td:first-child {
  white-space: nowrap;
  color: var(--agsta-muted);
  font-variant-numeric: tabular-nums;
}

.admin-audit-table td:nth-child(2),
.admin-audit-table td:nth-child(3) {
  white-space: nowrap;
  font-weight: 700;
}

.admin-audit-table .small {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--agsta-muted);
  word-break: break-word;
  white-space: normal;
}

/* Mobile */
@media (max-width: 900px) {

  .admin-form-grid button[type="submit"] {
    width: 100% !important;
    margin-top: 18px;
  }

  .admin-table-card,
  .admin-audit-card {
    padding: 24px !important;
  }
}

.day-entry-title h1 {
  margin: 0.15rem 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.day-today-link {
  font-size: 0.95rem;
}






.compact-button {
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.autosave-status {
  font-size: 0.9rem;
}

.autosave-status.is-error,
#month-entry-save-status.is-error {
  color: var(--neg) !important;
  font-weight: 700;
}

.day-arrow:hover {
  text-decoration: none;
  transform: scale(1.06);
}




/* Tagesmaske: Kopfbereich und Pfeile verfeinern */


.day-heading-left h2 {
  margin-bottom: 0;
}


/* Tagesmaske: weitere Verfeinerung */
.day-entry-title .period-label {
  display: none !important;
}








/* Tagesmaske: Drag-Sortierung wie Listen-Griff */


@media (max-width: 760px) {
  .day-entry-table .drag-column,
  .day-entry-table .drag-cell,
  .day-entry-table .remove-column,
  .day-entry-table .remove-cell,
  .day-entry-table .project-column,
  .day-entry-table .project-cell,
  .day-entry-table .category-column,
  .day-entry-table .category-cell,
  .day-entry-table .hours-column,
  .day-entry-table .hours-cell,
  .day-entry-table .note-column,
  .day-entry-table .note-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

.remove-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0 !important;
  border-radius: 999px;
  background: var(--neg) !important;
  color: #fff !important;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none !important;
}

.remove-row:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}




.day-entry-table .hours-column,
.day-entry-table .hours-cell {
  width: 8rem !important;
}



.day-static-value {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  line-height: 1.3;
  justify-content: flex-start;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

@media (max-width: 760px) {
  .day-entry-table .drag-column,
  .day-entry-table .drag-cell,
  .day-entry-table .remove-column,
  .day-entry-table .remove-cell,
  .day-entry-table .project-column,
  .day-entry-table .project-cell,
  .day-entry-table .category-column,
  .day-entry-table .category-cell,
  .day-entry-table .hours-column,
  .day-entry-table .hours-cell,
  .day-entry-table .note-column,
  .day-entry-table .note-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}




.absence-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.absence-day-table .day-static-value {
  min-height: 2.6rem;
}







.remove-absence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0 !important;
  border-radius: 999px;
  background: var(--neg) !important;
  color: #fff !important;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none !important;
}

.absence-row-new select:disabled,
.absence-row-new input:disabled,
.absence-row select:disabled,
.absence-row input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}


/* Tagesansicht: Arbeitszeiten bei Abwesenheit deutlich markieren */






/* Abwesenheiten: Gespeichert-Status rechts unten wie bei Arbeitszeiten */
.absence-day-form .day-bottom-bar {
  justify-content: space-between !important;
}

.absence-day-form .autosave-status {
  margin-left: auto;
  text-align: right;
}

/* Tagesansicht: Arbeitszeiten bei Abwesenheit oder Wochenende markieren */






/* Hauptnavigation sauber ausrichten */

.main-nav > a,
.nav-dropdown > summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  line-height: 1;
}

.nav-dropdown > summary {
  cursor: pointer;
}

.nav-dropdown > summary::after {
  line-height: 1;
}

.nav-dropdown > summary::after {
  width: 0;
  height: 0;
  margin-left: 0.25rem;
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.36rem solid currentColor;
  opacity: 0.6;
  transform: none;
}

.nav-dropdown[open] > summary::after {
  transform: rotate(180deg);
}

/* Tageskopf: Datum bleibt mittig, Pfeile springen nicht mit der Textlänge */

.day-entry-title h1 {
  white-space: nowrap;
}


@media (max-width: 760px) {

  .day-entry-title h1 {
    white-space: normal;
  }

}

/* Navigation: nativen details-Marker vollständig ausblenden und eigenes Chevron nutzen */
.nav-dropdown > summary {
  list-style: none !important;
  list-style-type: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
}

.nav-dropdown > summary::marker {
  content: "" !important;
  display: none !important;
}

.nav-dropdown > summary::after {
  content: none !important;
  display: none !important;
}

.nav-chevron {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.08rem);
  opacity: 0.55;
}

.nav-dropdown[open] .nav-chevron {
  transform: rotate(225deg) translateY(-0.02rem);
}

/* Klassische Zeiterfassung: Mitarbeiter als reines Anzeigefeld */
.readonly-field {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.035);
  color: inherit;
}

/* admin users final compact layout */

.user-hero-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.role-chip,
.self-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface-soft);
}

.new-user-form {
  display: block;
}

.user-panel h3,
.new-user-panel h2 {
  margin: 0;
}

.user-field-grid label,
.schedule-form label {
  min-width: 0;
}

.user-field-grid label,
.schedule-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.user-weekday-field {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.schedule-button-field {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.user-field-grid input,
.user-field-grid select,
.schedule-form input,
.password-form input {
  min-width: 0;
}

.user-checkbox-box .inline-check {
  margin: 0;
}

.user-weekday-box label {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.user-save-field button,
.schedule-button-field button,
.password-form button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.schedule-existing-list {
  display: grid;
  gap: 0.55rem;
}

.schedule-existing {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.schedule-existing > div {
  display: grid;
  gap: 0.15rem;
}

.schedule-existing span,
.schedule-existing small {
  color: var(--muted);
  font-size: 0.86rem;
}

.compact-note {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.user-add-row {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-start;
}

.new-user-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
  margin-top: 0.8rem;
}

.danger-button {
  color: var(--neg);
}

@media (max-width: 1300px) {

  .user-main-grid > :last-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 800px) {
  .user-field-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .schedule-existing {
    grid-template-columns: 1fr;
  }

  .user-save-field button,
  .schedule-button-field button,
  .password-form button {
    width: 100%;
  }
}

.user-card > .user-panel-wide:last-child {
  margin-bottom: 1rem !important;
}

.user-field-grid label {
  align-self: end !important;
}

.user-checkbox-field {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  align-self: end !important;
}

.user-active-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.7rem !important;
  justify-content: flex-start !important;
}

.user-delete-button {
  min-height: 42px !important;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.85rem !important;
}

.user-save-field button {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.user-save-field {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  align-self: end !important;
}

@media (min-width: 1301px) {
  .user-main-grid {
    grid-template-columns: 1.25fr 0.95fr 1fr !important;
  }

  .user-main-grid > :last-child {
    grid-column: auto !important;
  }
}

/* admin users collapsible final */

.user-card[open] {
  margin-bottom: 1rem !important;
}

.user-card[open] > .user-hero {
  border-bottom: 1px solid var(--border) !important;
}

.user-hero::-webkit-details-marker {
  display: none !important;
}

.user-hero::after {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.user-hero-main {
  min-width: 0 !important;
}

.user-hero h2 {
  font-size: 1.7rem !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

.user-hero p {
  margin: 0.15rem 0 0 !important;
  color: var(--muted) !important;
}

.user-card-body {
  display: grid !important;
  gap: 0.85rem !important;
  padding: 0.85rem 1rem 1rem !important;
}

.user-main-form {
  display: block;
  padding: 0 !important;
}

.user-main-grid > .user-panel {
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  align-self: stretch !important;
}

.user-panel {
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  padding: 0.85rem !important;
  display: grid !important;
  gap: 0.65rem !important;
  align-content: start !important;
  min-width: 0 !important;
}

.user-panel-wide {
  width: 100%;
  margin: 0 !important;
}

.user-field-grid.two-cols {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.7rem !important;
  align-items: end !important;
}

.user-field-grid {
  display: grid !important;
  gap: 0.7rem !important;
  align-items: end !important;
}

.user-field-grid input,
.user-field-grid select,
.schedule-form input,
.password-form input {
  min-height: 42px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.user-checkbox-box {
  display: flex;
  align-items: center;
  min-height: 42px !important;
}

.user-weekday-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--border);
  box-sizing: border-box;
  background: #ffffff;
  padding-right: 0.65rem !important;
  width: fit-content !important;
  max-width: 100% !important;
  padding: 0.45rem 0.55rem !important;
  gap: 0.3rem 0.55rem !important;
  border-radius: 8px !important;
}

.user-weekday-box label {
  font-size: 0.85rem !important;
}

.user-save-field button {
  min-height: 42px !important;
}

.hidden-delete-form {
  display: none !important;
}

.user-main-grid {
  display: grid !important;
  grid-template-columns: 1.25fr 0.95fr 1fr !important;
  gap: 0.85rem !important;
  align-items: stretch !important;
}

@media (max-width: 1300px) {
  .user-main-grid {
    display: grid !important;
    gap: 0.85rem !important;
    align-items: stretch !important;
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 800px) {
  .user-main-grid {
    display: grid !important;
    gap: 0.85rem !important;
    align-items: stretch !important;
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 800px) {

  .user-field-grid.two-cols {
    grid-template-columns: 1fr !important;
  }
}

.user-hero {
  list-style: none !important;
  cursor: pointer !important;
  border: none !important;
  border-radius: 0 !important;
  border-bottom: 0 !important;
  padding: 0.85rem 1rem !important;
  background: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.8rem !important;
}

@media (max-width: 800px) {
  .user-hero {
    list-style: none !important;
    cursor: pointer !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 0 !important;
    padding: 0.85rem 1rem !important;
    background: #ffffff !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 0.8rem !important;
    align-items: flex-start !important;
  }
}

.schedule-form {
  display: grid !important;
  grid-template-columns: 0.8fr 0.8fr 0.8fr 1.2fr 1fr 170px !important;
  gap: 0.7rem !important;
  align-items: end !important;
}

@media (max-width: 1300px) {
  .schedule-form {
    display: grid !important;
    gap: 0.7rem !important;
    align-items: end !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 800px) {
  .schedule-form {
    display: grid !important;
    gap: 0.7rem !important;
    align-items: end !important;
    grid-template-columns: 1fr !important;
  }
}

.password-form {
  min-width: 0;
  align-items: end;
  margin-top: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 150px !important;
  gap: 0.7rem !important;
}

@media (max-width: 800px) {
  .password-form {
    min-width: 0;
    align-items: end;
    margin-top: 0 !important;
    display: grid !important;
    gap: 0.7rem !important;
    grid-template-columns: 1fr !important;
  }
}

/* admin users collapse/list cleanup */

.user-card-list {
  margin-top: 0.5rem;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  display: grid !important;
  gap: 0.8rem !important;
}

.user-card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.user-card:not([open]) {
  border-radius: 0 !important;
}

.user-card + .user-card {
  margin-top: 0 !important;
}

#new-user-card.is-hidden,
.new-user-panel.is-hidden,
.user-panel.new-user-panel.is-hidden {
  display: none !important;
}

#new-user-card:not(.is-hidden) {
  display: grid !important;
}

/* admin users remove open pill and move role to right */
.user-hero::after,
.user-card[open] > .user-hero::after {
  content: none !important;
  display: none !important;
}

.user-hero .role-chip {
  margin-left: auto !important;
}

.user-hero-title-row .role-chip {
  display: none !important;
}

/* calendar non-working day refinement */
.calendar-day.is-weekend,
.calendar-day.is-regular-offday {
  background: var(--border) !important;
}

.calendar-day.is-weekend:hover,
.calendar-day.is-regular-offday:hover {
  background: var(--border-strong) !important;
}

.calendar-day.is-weekend .calendar-day-number,
.calendar-day.is-regular-offday .calendar-day-number {
  color: var(--muted) !important;
}

.calendar-day.is-regular-offday::after {
  position: absolute;
  right: 0.35rem;
  bottom: 0.25rem;
  font-size: 0.68rem;
  color: var(--muted);
}


/* holidays same color as weekends */
.calendar-day.is-holiday {
  background: var(--border) !important;
}

.calendar-day.is-holiday:hover {
  background: var(--border-strong) !important;
}

.calendar-day.is-holiday .calendar-day-number {
  color: var(--muted) !important;
}


/* remove tiny free-day label in month calendar */
.calendar-day.is-regular-offday::after {
  content: none !important;
  display: none !important;
}

/* overtime reduction absence */
.calendar-day.absence-overtime-reduction {
  background: var(--border) !important;
}

.calendar-day.absence-overtime-reduction:hover {
  background: var(--border-strong) !important;
}

.calendar-day.absence-overtime-reduction .calendar-day-number {
  color: var(--muted) !important;
}

.absence-type-badge.absence-type-overtime-reduction {
  background: var(--surface-soft);
  color: var(--muted);
}

/* month overview today link and today marker */
.month-nav-center {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}

.month-today-link {
  font-size: 0.9rem;
  text-decoration: none;
}

.month-today-link:hover {
  text-decoration: underline;
}

/* Heute-Markierung bewusst rot statt in der Hausfarbe, siehe --today
   im :root. Konsolidiert aus zwei Regeln, die dieselbe Border-Deklaration
   wiederholten. */
.calendar-day.is-today,
.calendar-day.is-today:focus,
.calendar-day.is-today:focus-visible,
.calendar-day.is-today:active {
  border: 3px solid var(--today) !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.calendar-day.is-today .calendar-day-number {
  color: var(--today) !important;
}

/* month entries table */
/* Ueberschreibt table { min-width: max-content } aus
   03-layout-und-komponenten.css: bei dieser text- und spaltenreichen
   Tabelle berechnet Firefox die intrinsische max-content-Breite anders
   als Chrome/Safari und lässt dabei alle Spalten ausser der ersten
   (Datum) kollabieren - nur in Firefox sichtbar, sonst unauffaellig.
   Die Tabelle hat ohnehin ihr eigenes Mobil-Kartenlayout (siehe unten),
   braucht also kein max-content-Scrollen wie die breiten Admin-Tabellen. */
.month-entries-table {
  min-width: 0;
}

.month-entries-table input,
.month-entries-table select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.month-entries-table .month-entry-select {
  width: auto;
  min-width: 0;
}

.month-entries-table .month-entry-hours {
  max-width: 120px;
}

.sort-link {
  color: inherit;
  text-decoration: none;
}

.sort-link:hover {
  text-decoration: underline;
}

.sort-link.is-active {
  font-weight: 800;
}

/* month entries polish */
.month-entries-table .sort-link,
.month-entries-table .sort-link:focus,
.month-entries-table .sort-link:focus-visible,
.month-entries-table .sort-link:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  text-decoration: none;
}

.month-entries-table .sort-link:hover {
  text-decoration: underline;
}

.month-entry-add-row {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-start;
}

/* Sammelleiste: Mehrfachauswahl + Leistungsphase fuer alle ausgewaehlten Zeilen setzen */
.month-entry-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 1rem;
  padding: 12px 14px;
  border: 1px solid var(--agsta-border);
  background: var(--agsta-surface-soft);
}

.month-entry-bulk-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.month-entry-bulk-count {
  white-space: nowrap;
}

.month-entry-bulk-bar select {
  min-height: 38px;
  height: 38px;
}

.month-entry-bulk-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.month-entry-select-label {
  display: inline-flex;
  vertical-align: middle;
}

.month-entry-date-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-entry-date-edit .month-entry-date {
  flex: 1;
  min-width: 0;
}

.month-entry-row-new {
  background: var(--surface-soft);
}

/* month entry sort polish */
.month-entries-table th a.sort-link,
.month-entries-table th a.sort-link:visited,
.month-entries-table th a.sort-link:focus,
.month-entries-table th a.sort-link:focus-visible,
.month-entries-table th a.sort-link:active {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  color: inherit;
  text-decoration: none;
}

.month-entries-table th a.sort-link:hover {
  text-decoration: underline;
}

.month-entries-table th:nth-child(4),
.month-entries-table td:nth-child(4) {
  white-space: nowrap;
}

.month-entries-table .sort-link {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
}

.month-entries-table .sort-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  opacity: 0.55;
}

.month-entries-table .sort-chevron.sort-asc {
  transform: rotate(225deg);
  margin-top: 0.25rem;
}

.month-entries-table .sort-chevron.sort-desc {
  transform: rotate(45deg);
  margin-bottom: 0.2rem;
}

.month-entries-table .sort-link.is-active .sort-chevron {
  opacity: 0.75;
}

.month-entries-table tr.month-entry-group-start td:first-child {
  position: relative;
}

/* visible group spacing for sorted month entries */
.month-entries-table tr.month-entry-group-divider td {
  height: 0.85rem;
  padding: 0 !important;
  border: none !important;
  background: var(--surface-soft) !important;
}

.month-entries-table tr.month-entry-group-start td {
  border-top: none !important;
}

/* real blank row between sorted month entry groups */
.month-entries-table tr.month-entry-group-gap td {
  height: 1.35rem !important;
  line-height: 1.35rem !important;
  padding: 0 !important;
  border: none !important;
  background: #ffffff !important;
}

/* Zwischensumme je Gruppe (Sortierung nach Projekt/Leistungsphase) */
.month-entries-table tr.month-entry-subtotal td {
  height: auto !important;
  line-height: 1.4 !important;
  padding: 10px 12px !important;
  border: none !important;
  border-top: 1px solid var(--agsta-border) !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  background: var(--agsta-surface-soft) !important;
}

.month-entries-table tr.month-entry-subtotal .month-entry-subtotal-label {
  font-weight: 700;
}

.month-entries-table tr.month-entry-subtotal .month-entry-group-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  font-weight: 400;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
}

.month-entries-table tr.month-entry-row.is-locked td {
  opacity: 0.6;
}

.month-entries-table tr.month-entry-subtotal .month-entry-subtotal-hours {
  font-weight: 700;
}

.month-entries-table tr.month-entry-subtotal + tr td {
  border-top: none !important;
}

.month-entries-table tr.month-entry-group-gap + tr td {
  border-top: 1px solid var(--border) !important;
}

