:root {
  --bg: #f5f3ef;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --border: #ded8cf;
  --accent: #6f4e37;
  --accent-dark: #523724;
  --error-bg: #ffe8e8;
  --success-bg: #e8f6ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: #222;
  color: white;
  padding: 14px 22px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}

nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px 50px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin: 18px 0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.04);
}

.login-card {
  max-width: 420px;
  margin: 60px auto;
}

h1,
h2 {
  margin-top: 0;
}

label {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  background: white;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #555;
}

.form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 18px 0;
}

.filter input,
.filter select {
  min-width: 180px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 14px;
}

.right {
  text-align: right;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.messages {
  margin-bottom: 18px;
}

.message {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.message.error {
  background: var(--error-bg);
}

.message.success {
  background: var(--success-bg);
}

@media (max-width: 760px) {
  .topbar,
  .page-head {
    display: block;
  }

  nav {
    margin-top: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 14px;
  }
}

/* Schnelle Zeiterfassung */
.entry-card {
  max-width: 980px;
}

.entry-form .entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.entry-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entry-form .field-wide {
  grid-column: 1 / -1;
}


.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
}

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

.muted {
  opacity: 0.65;
  font-weight: normal;
}

@media (max-width: 760px) {
  .entry-form .entry-grid {
    grid-template-columns: 1fr;
  }

  .button-row button,
  .button-row .secondary-button {
    width: 100%;
  }
}

/* Monatsübersicht als Kalender */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button-like,
.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.calendar-card {
  overflow: hidden;
}

.calendar-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-title {
  text-align: center;
}

.calendar-title h2 {
  margin-bottom: 0.25rem;
}

.calendar-summary {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-nav:first-child {
  justify-self: start;
}

.calendar-nav:last-child {
  justify-self: end;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  font-weight: 600;
  opacity: 0.75;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.calendar-weekdays div {
  padding: 0.5rem;
  text-align: center;
}

.calendar-day {
  min-height: 96px;
  padding: 0.65rem;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.5);
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calendar-day-number {
  font-weight: 700;
}

.calendar-check {
  font-weight: 700;
}

.calendar-day.has-entries {
  background: rgba(35, 134, 74, 0.11);
}

.calendar-day.has-entries .calendar-day-number,
.calendar-day.has-entries .calendar-check {
  color: #23864a;
}

.calendar-day.is-today {
  outline: 2px solid rgba(0, 0, 0, 0.25);
  outline-offset: -2px;
}

.calendar-day.is-weekend {
  background-image: linear-gradient(rgba(0, 0, 0, 0.025), rgba(0, 0, 0, 0.025));
}

.calendar-day.is-outside {
  opacity: 0.35;
}

.calendar-hours {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.calendar-entry-count,
.calendar-empty {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

@media (max-width: 850px) {
  .dashboard-header,
  .calendar-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-title {
    order: -1;
  }

  .calendar-nav,
  .dashboard-actions a {
    width: 100%;
  }

  .calendar-day {
    min-height: 78px;
    padding: 0.45rem;
  }

  .calendar-entry-count {
    display: none;
  }
}

/* Anpassungen Monatsübersicht */
.dashboard-actions .button-like,
.button-like.primary-action,
.button-like.secondary-action {
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0.45rem;
  padding: 0.65rem 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.9);
}

.button-like.primary-action {
  background: rgba(0, 0, 0, 0.9);
  color: white;
}

.button-like.secondary-action {
  color: inherit;
}

.calendar-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  margin-bottom: 1rem;
}

.calendar-title {
  text-align: center;
}

.calendar-title h2 {
  margin-top: 0;
}

.calendar-nav-left {
  justify-self: start;
}

.calendar-nav-right {
  justify-self: end;
}

.calendar-check,
.calendar-entry-count {
  display: none;
}

.calendar-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1.05rem;
}

.calendar-total strong {
  font-size: 1.35rem;
}

@media (max-width: 850px) {
  .calendar-topbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .calendar-title {
    grid-column: 1 / -1;
    order: -1;
  }

  .calendar-nav-left,
  .calendar-nav-right {
    justify-self: stretch;
  }

  .calendar-total {
    justify-content: space-between;
  }
}

/* Anklickbare Kalendertage und Tabellenkopf */
.calendar-day {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.16);
}

.table-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.table-heading h2 {
  margin-bottom: 0;
}

/* Tages-/Monatskontext in der Zeitenliste */
.entries-header {
  align-items: flex-start;
}

.period-focus {
  margin-top: 0.65rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: rgba(35, 134, 74, 0.11);
  border: 1px solid rgba(35, 134, 74, 0.25);
}

.period-focus-month {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

.period-label {
  font-size: 0.82rem;
  opacity: 0.7;
  font-weight: 600;
}

.period-focus strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

/* Kompakte Filterleiste */
.filter-strip {
  margin: 0 0 1rem 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.filter-strip-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.filter-item label {
  font-size: 0.78rem;
  opacity: 0.7;
  font-weight: 600;
}

.filter-strip input,
.filter-strip select {
  min-height: 2.25rem;
}

.filter-strip button {
  min-height: 2.25rem;
  padding: 0.4rem 0.8rem;
}

.filter-reset {
  align-self: center;
  font-size: 0.9rem;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .period-focus {
    display: flex;
  }

  .filter-strip-form {
    align-items: stretch;
  }

  .filter-item,
  .filter-strip button,
  .filter-reset {
    width: 100%;
  }
}

/* Aufgeräumte Tages-/Monatsansicht */
.period-hero {
  text-align: center;
  margin: 0 auto 1rem auto;
  padding: 1.25rem 1rem;
  max-width: 760px;
}

.period-hero .period-label {
  display: block;
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.period-hero strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.period-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-line {
  margin: 0 auto 1rem auto;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 980px;
}

.filter-line-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.filter-line label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.filter-line label span {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.7;
}

.filter-line input,
.filter-line select {
  min-height: 2.1rem;
  height: 2.1rem;
  padding: 0.25rem 0.45rem;
}

.filter-line input[name="filter_day"] {
  width: 4.4rem;
}

.filter-line input[name="filter_year"] {
  width: 5.8rem;
}

.filter-line select[name="filter_month"] {
  min-width: 8rem;
}

.filter-line .filter-employee select {
  min-width: 10rem;
}

.filter-line button {
  min-height: 2.1rem;
  height: 2.1rem;
  padding: 0.25rem 0.75rem;
}

.filter-line .filter-reset {
  white-space: nowrap;
  font-size: 0.9rem;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .period-hero {
    padding-top: 0.5rem;
  }

  .period-actions .button-like {
    width: 100%;
  }

  .filter-line {
    border-radius: 0.75rem;
  }

  .filter-line-form {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .filter-line label,
  .filter-line button,
  .filter-line .filter-reset {
    width: 100%;
  }

  .filter-line input,
  .filter-line select,
  .filter-line input[name="filter_day"],
  .filter-line input[name="filter_year"],
  .filter-line select[name="filter_month"],
  .filter-line .filter-employee select {
    width: 100%;
  }
}

/* Feinschliff Zeitenansicht */
.filter-line-top {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.period-actions-vertical {
  flex-direction: column;
  align-items: center;
}

.period-actions-vertical .button-like {
  min-width: 220px;
}

/* Filterleiste: auch auf schmalen Fenstern kompakt in einer Zeile */
.filter-line,
.filter-line-top {
  max-width: 980px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.filter-line-form,
.filter-line .filter-line-form {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: max-content;
}

.filter-line label,
.filter-line-form label,
.filter-line button,
.filter-line .filter-reset {
  width: auto !important;
  flex: 0 0 auto;
  margin: 0;
}

.filter-line label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}

.filter-line label span {
  font-size: 0.78rem;
}

.filter-line input,
.filter-line select,
.filter-line input[name="filter_day"],
.filter-line input[name="filter_year"],
.filter-line select[name="filter_month"],
.filter-line .filter-employee select {
  width: auto !important;
  min-height: 2rem;
  height: 2rem;
  font-size: 0.95rem;
  padding: 0.2rem 0.45rem;
}

.filter-line input[name="filter_day"] {
  width: 3.7rem !important;
}

.filter-line input[name="filter_year"] {
  width: 5.1rem !important;
}

.filter-line select[name="filter_month"] {
  min-width: 6.6rem;
}

.filter-line .filter-employee select {
  min-width: 9rem;
}

.filter-line button {
  min-height: 2rem;
  height: 2rem;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}

.filter-line .filter-reset {
  align-self: center;
  white-space: nowrap;
  font-size: 0.9rem;
}

/* Alte Mobile-Regeln für diese Filterleiste gezielt neutralisieren */
@media (max-width: 760px) {
  .filter-line,
  .filter-line-top {
    border-radius: 999px;
    margin-left: 0;
    margin-right: 0;
  }

  .filter-line-form {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
  }

  .filter-line label,
  .filter-line button,
  .filter-line .filter-reset {
    width: auto !important;
  }

  .filter-line input,
  .filter-line select,
  .filter-line input[name="filter_day"],
  .filter-line input[name="filter_year"],
  .filter-line select[name="filter_month"],
  .filter-line .filter-employee select {
    width: auto !important;
  }
}

/* Kleine Kalenderansicht in der Tagesliste */
.mini-calendar-card {
  max-width: 760px;
  margin: 0 auto 1.25rem auto;
  padding: 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mini-calendar-title {
  text-align: center;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.mini-calendar-weekdays,
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.mini-calendar-weekdays {
  margin-bottom: 0.25rem;
}

.mini-calendar-weekdays div {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.55;
}

.mini-calendar-day {
  min-height: 3.2rem;
  border-radius: 0.65rem;
  padding: 0.35rem 0.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid transparent;
}

.mini-calendar-day span {
  font-weight: 800;
}

.mini-calendar-day small {
  font-size: 0.72rem;
  opacity: 0.8;
}

.mini-calendar-day.has-entries {
  background: rgba(35, 134, 74, 0.13);
}

.mini-calendar-day.has-entries span {
  color: #23864a;
}

.mini-calendar-day.is-selected {
  background: rgba(0, 0, 0, 0.92);
  color: white;
  border-color: rgba(0, 0, 0, 0.92);
}

.mini-calendar-day.is-selected span,
.mini-calendar-day.is-selected small {
  color: white;
}

.mini-calendar-day.is-today:not(.is-selected) {
  border-color: rgba(0, 0, 0, 0.35);
}

.mini-calendar-day.is-weekend:not(.is-selected) {
  opacity: 0.78;
}

.mini-calendar-day.is-outside {
  opacity: 0.28;
}

.mini-calendar-day:hover {
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.16);
}

@media (max-width: 760px) {
  .mini-calendar-card {
    margin-left: 0;
    margin-right: 0;
    padding: 0.65rem;
  }

  .mini-calendar-day {
    min-height: 2.8rem;
  }

  .mini-calendar-day small {
    display: none;
  }
}

/* Datumsfeld im kompakten Filter */
.filter-line input[type="date"] {
  width: 8.8rem !important;
  min-width: 8.8rem;
}

.filter-line input[name="filter_year"] {
  width: 5.2rem !important;
}

/* Tag im Filter nur als TT anzeigen, Kalender-Picker bleibt nativ */
.date-picker-label {
  position: relative;
}

.date-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.7rem;
  height: 2rem;
  border-radius: 0.42rem;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.date-day-display {
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.date-picker-native {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  opacity: 0;
  cursor: pointer;
  padding: 0 !important;
}

.filter-line input[type="date"].date-picker-native {
  width: 100% !important;
  min-width: 0 !important;
}

/* Soll/Ist-Kennzahlen Monatsübersicht */
.calendar-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.calendar-kpi {
  padding: 0.85rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.07);
}

.calendar-kpi span {
  display: block;
  font-size: 0.82rem;
  opacity: 0.7;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.calendar-kpi strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
}

.calendar-kpi.delta-positive {
  background: rgba(35, 134, 74, 0.11);
  border-color: rgba(35, 134, 74, 0.22);
}

.calendar-kpi.delta-positive strong {
  color: #23864a;
}

.calendar-kpi.delta-negative {
  background: rgba(180, 60, 45, 0.09);
  border-color: rgba(180, 60, 45, 0.18);
}

.calendar-kpi.delta-negative strong {
  color: #b43c2d;
}

.calendar-note {
  margin: 0.85rem 0 0 0;
  font-size: 0.88rem;
  opacity: 0.65;
}

@media (max-width: 850px) {
  .calendar-kpis {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 520px) {
  .calendar-kpis {
    grid-template-columns: 1fr;
  }
}

/* Feiertage Niedersachsen */
.calendar-day.is-holiday:not(.has-entries) {
  background: rgba(70, 105, 160, 0.11);
}

.calendar-day.is-holiday.has-entries {
  background: linear-gradient(
    135deg,
    rgba(35, 134, 74, 0.13),
    rgba(70, 105, 160, 0.12)
  );
}

.calendar-holiday {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
  opacity: 0.75;
}

.calendar-kpis {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

@media (max-width: 980px) {
  .calendar-kpis {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 620px) {
  .calendar-kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* Erweiterte Kennzahlen für Urlaub und Stundenstand */
.calendar-kpis {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Urlaub */
.calendar-day.is-vacation:not(.has-entries) {
  background: rgba(185, 145, 45, 0.13);
}

.calendar-day.is-vacation.has-entries {
  background: linear-gradient(
    135deg,
    rgba(35, 134, 74, 0.13),
    rgba(185, 145, 45, 0.14)
  );
}

.calendar-vacation {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 800;
  opacity: 0.8;
}

tr.is-cancelled {
  opacity: 0.55;
}

tr.is-cancelled td {
  text-decoration: line-through;
}

/* Aufgeräumte Urlaubsseite */
.vacation-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.1rem 0 1.3rem;
}

.vacation-summary-card {
  background: white;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

.vacation-summary-name {
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.vacation-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem;
  border-radius: 0.8rem;
  background: rgba(185, 145, 45, 0.11);
  margin-bottom: 0.8rem;
}

.vacation-summary-main span {
  font-size: 0.82rem;
  opacity: 0.72;
  font-weight: 700;
}

.vacation-summary-main strong {
  font-size: 1.45rem;
}

.vacation-summary-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.vacation-summary-details div {
  padding: 0.55rem;
  border-radius: 0.65rem;
  background: rgba(0,0,0,0.035);
}

.vacation-summary-details dt {
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 700;
}

.vacation-summary-details dd {
  margin: 0.15rem 0 0;
  font-weight: 800;
}

.compact-card {
  margin-top: 1rem;
}

.vacation-entry-form {
  margin-top: 1rem;
}

.vacation-filter {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.8rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-active {
  background: rgba(35, 134, 74, 0.12);
}

.status-cancelled {
  background: rgba(160, 70, 70, 0.12);
}

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

  .vacation-summary-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Abwesenheiten */
.calendar-day.is-absence:not(.has-entries) {
  background: rgba(185, 145, 45, 0.13);
}

.calendar-day.absence-sick:not(.has-entries) {
  background: rgba(170, 80, 80, 0.12);
}

.calendar-day.absence-special-leave:not(.has-entries) {
  background: rgba(100, 100, 160, 0.12);
}

.calendar-day.absence-training:not(.has-entries) {
  background: rgba(80, 135, 160, 0.12);
}

.absence-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.8rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(185, 145, 45, 0.13);
}

.absence-type-sick {
  background: rgba(170, 80, 80, 0.12);
}

.absence-type-special-leave {
  background: rgba(100, 100, 160, 0.12);
}

.absence-type-training {
  background: rgba(80, 135, 160, 0.12);
}

.small-muted {
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

/* Admin-Auswertung */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.2rem;
}

.report-filter {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.report-table {
  min-width: 1250px;
}

.report-table th,
.report-table td {
  white-space: nowrap;
}

.report-note-card {
  margin-top: 1rem;
}

.delta-positive {
  color: #1f7a3a;
}

.delta-negative {
  color: #a23b3b;
}

.delta-neutral {
  color: inherit;
}

/* Projekt-/Leistungsphasen-Auswertung */
.report-total-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.055);
  font-weight: 800;
  white-space: nowrap;
}

.project-report-block {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 1rem;
  padding: 1rem;
  margin-top: 1rem;
  background: rgba(255,255,255,0.72);
}

.project-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.project-report-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.project-report-head strong {
  font-size: 1.05rem;
  white-space: nowrap;
}

.project-report-table {
  min-width: 760px;
}

.project-report-table th,
.project-report-table td {
  vertical-align: top;
}

.person-hours-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.person-hours {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.055);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .project-report-head {
    flex-direction: column;
  }
}


/* ============================================================
   agsta Designbasis: Halcom + Grundfarben
   ============================================================ */

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom Bold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Halcom";
  src: url("/static/fonts/halcom/The Northern Block - Halcom ExtraBold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --agsta-font: "Halcom", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --agsta-bg: #f4f2ed;
  --agsta-surface: #ffffff;
  --agsta-surface-soft: #f7f5f1;
  --agsta-text: #202020;
  --agsta-muted: #6f6f6f;
  --agsta-border: #ded9d1;

  --agsta-black: #202020;
  --agsta-black-hover: #000000;
  --agsta-brown: #7b553d;
  --agsta-brown-hover: #684630;
  --agsta-brown-soft: #eee5db;

  --agsta-danger: #b43b32;
  --agsta-danger-soft: #f2ded9;

  --agsta-radius-sm: 8px;
  --agsta-radius-md: 14px;
  --agsta-radius-lg: 18px;
}

html {
  font-family: var(--agsta-font);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--agsta-font);
  background: var(--agsta-bg);
  color: var(--agsta-text);
}

button,
input,
select,
textarea {
  font-family: var(--agsta-font);
}

h1,
h2,
h3,
h4 {
  font-family: var(--agsta-font);
  letter-spacing: -0.035em;
}

p,
label,
td,
th,
input,
select,
textarea,
button,
a {
  letter-spacing: -0.01em;
}


/* ============================================================
   agsta Navigation + Buttons
   ============================================================ */

/* Kopfzeile ruhiger und klarer */
nav,
.navbar,
.topbar,
header {
  font-family: var(--agsta-font);
}

nav,
.navbar,
.topbar {
  background: var(--agsta-black);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

nav a,
.navbar a,
.topbar a,
header a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.015em;
}

nav a:hover,
.navbar a:hover,
.topbar a:hover,
header a:hover {
  color: #ffffff;
}

/* App-Titel links etwas prägnanter */
nav strong,
.navbar strong,
.topbar strong,
.brand,
.logo {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Allgemeine Links außerhalb der Navigation */
main a,
.container a,
.card a,
.content a {
  color: var(--agsta-black);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

main a:hover,
.container a:hover,
.card a:hover,
.content a:hover {
  color: var(--agsta-brown);
}

/* Der primäre Arbeitsbutton: Zeit erfassen */
a[href="/zeiten/neu"],
a[href*="/zeiten/neu"] {
  text-decoration: none;
}

/* Buttons grundsätzlich vereinheitlichen */
button,
.button,
.btn,
input[type="submit"],
input[type="button"],
a.button,
a.btn {
  font-family: var(--agsta-font);
  border-radius: 8px;
  border: 1px solid var(--agsta-black);
  background: var(--agsta-black);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.015em;
  box-shadow: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

button:hover,
.button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover,
a.btn:hover {
  background: var(--agsta-black-hover);
  border-color: var(--agsta-black-hover);
  color: #ffffff;
}

/* Sekundäre Buttons / Navigationsbuttons */
.button.secondary,
.btn.secondary,
a.secondary,
a[href*="month="],
a[href*="date="],
a[href*="prev"],
a[href*="next"] {
  background: #ffffff;
  color: var(--agsta-black);
  border: 1px solid var(--agsta-border);
  text-decoration: none;
}

.button.secondary:hover,
.btn.secondary:hover,
a.secondary:hover,
a[href*="month="]:hover,
a[href*="date="]:hover,
a[href*="prev"]:hover,
a[href*="next"]:hover {
  background: var(--agsta-surface-soft);
  color: var(--agsta-black);
  border-color: var(--agsta-black);
}

/* Monatsnavigation: violett entfernen */
.calendar-nav a,
.month-nav a,
.month-navigation a,
a[href*="month="] {
  color: var(--agsta-black) !important;
  font-weight: 600;
}

.calendar-nav a:hover,
.month-nav a:hover,
.month-navigation a:hover,
a[href*="month="]:hover {
  color: var(--agsta-brown) !important;
}

/* Formularbuttons etwas wertiger */
form button,
form input[type="submit"] {
  min-height: 44px;
}

/* Fokus sichtbar, aber ruhiger */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--agsta-brown);
  outline-offset: 3px;
}

/* Kleine optische Korrektur: nicht alles zu rund und weich */
.card,
.panel,
.box,
section,
table,
input,
select,
textarea {
  border-color: var(--agsta-border);
}


/* ============================================================
   agsta Clean Layout: weiße Navigation, weißer Hintergrund
   ============================================================ */

:root {
  --agsta-bg: #ffffff;
  --agsta-surface: #ffffff;
  --agsta-surface-soft: #f6f6f6;
  --agsta-text: #202020;
  --agsta-muted: #6b6b6b;
  --agsta-border: #d9d9d9;
  --agsta-brown: #6f513c;
  --agsta-brown-hover: #4f3828;

  --agsta-radius-sm: 0;
  --agsta-radius-md: 0;
  --agsta-radius-lg: 0;
}

html,
body {
  background: #ffffff !important;
}

body {
  color: var(--agsta-text);
}

/* Obere schwarze Leiste entfernen */
.topbar,
header.topbar {
  background: #ffffff !important;
  color: var(--agsta-text) !important;
  border-bottom: 1px solid var(--agsta-border);
  box-shadow: none;
}

/* Navigation als ruhige Website-Navigation */
.topbar {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 64px;
  padding: 0 32px;
}

.topbar .brand {
  color: var(--agsta-text) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent !important;
  color: var(--agsta-text) !important;
  border: 0;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a,
.nav-dropdown summary {
  color: var(--agsta-text) !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
}

.main-nav a:hover,
.nav-dropdown summary:hover {
  color: var(--agsta-brown) !important;
}

.nav-right a {
  color: var(--agsta-muted) !important;
}

/* Dropdown Verwaltung */
.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: " ↓";
  font-size: 0.85em;
  color: var(--agsta-muted);
}

.nav-dropdown[open] summary::after {
  content: " ↑";
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  min-width: 220px;
  z-index: 20;
  display: grid;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--agsta-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.nav-dropdown-menu a {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--agsta-border);
  white-space: nowrap;
}

.nav-dropdown-menu a:last-child {
  border-bottom: 0;
}

/* Hauptbereich: weiß und ohne beige Grundfläche */
.container,
main.container {
  background: #ffffff !important;
}

/* Runde Rahmen zurücknehmen */
.card,
.panel,
.box,
.stat-card,
.metric-card,
.calendar-card,
.report-card,
section,
table,
input,
select,
textarea,
button,
.button,
.btn,
.secondary-button,
a.button,
a.btn {
  border-radius: 0 !important;
}

/* Karten/Boxen ruhiger: keine weichen beige Flächen */
.card,
.panel,
.box,
.stat-card,
.metric-card,
.calendar-card,
.report-card,
section {
  background: #ffffff;
  border-color: var(--agsta-border);
  box-shadow: none;
}

/* Buttons eckiger und klarer */
button,
.button,
.btn,
input[type="submit"],
input[type="button"],
a.button,
a.btn,
.secondary-button {
  border-radius: 0 !important;
}

/* Sekundäre Buttons weiß statt beige */
.secondary-button,
button.secondary,
.button.secondary,
.btn.secondary,
a.secondary {
  background: #ffffff !important;
  color: var(--agsta-text) !important;
  border: 1px solid var(--agsta-border) !important;
}

.secondary-button:hover,
button.secondary:hover,
.button.secondary:hover,
.btn.secondary:hover,
a.secondary:hover {
  background: #f6f6f6 !important;
  border-color: var(--agsta-text) !important;
}

/* Mobile Navigation */
@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
  }

  .main-nav {
    width: 100%;
    align-items: flex-start;
    gap: 18px;
  }

  .nav-left {
    flex-wrap: wrap;
    gap: 14px 18px;
  }

  .nav-dropdown-menu {
    position: absolute;
  }
}


/* ============================================================
   agsta Navigation rechts + minimalistischer Dropdown-Pfeil
   ============================================================ */

.topbar {
  justify-content: space-between;
  gap: 40px;
}

.main-nav {
  flex: 0 0 auto;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
}

.main-nav > a,
.main-nav > .nav-dropdown {
  display: inline-flex;
  align-items: center;
}

.main-nav a,
.nav-dropdown summary {
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Logout bleibt rechts, aber nicht lauter als die übrige Navigation */
.logout-link {
  color: var(--agsta-muted) !important;
}

/* alten Textpfeil überschreiben */
.nav-dropdown summary::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 12px;
  margin-bottom: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.55;
}

.nav-dropdown[open] summary::after {
  margin-bottom: -2px;
  transform: rotate(-135deg);
}

.nav-dropdown summary:hover::after {
  opacity: 0.85;
}

/* Dropdown rechts sauber unter Verwaltung ausrichten */
.nav-dropdown-menu {
  right: 0;
  left: auto;
  top: calc(100% + 18px);
}

/* Falls alte Hilfscontainer noch irgendwo greifen */
.nav-left,
.nav-right {
  display: contents;
}

/* Mobile: Navigation darf umbrechen, bleibt aber unter dem Logo */
@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px 22px;
  }

  .nav-dropdown-menu {
    left: 0;
    right: auto;
  }
}


/* ============================================================
   agsta Navigation ohne Trennlinie
   ============================================================ */

.topbar,
header.topbar {
  border-bottom: 0 !important;
  box-shadow: none !important;
}


/* ============================================================
   agsta Content Layout: Abstände, Karten, Tabellen, Formulare
   ============================================================ */

/* Grundfläche */
body {
  background: #ffffff !important;
  color: var(--agsta-text);
}

/* Seitenbreite und vertikaler Rhythmus */
.container,
main.container {
  width: min(100% - 64px, 1440px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 44px 0 72px;
}

/* Seitenkopf */
main h1,
.container h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.055em;
}

main h2,
.container h2 {
  margin: 0 0 18px;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.045em;
}

main h3,
.container h3 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  line-height: 1.15;
  font-weight: 700;
}

.muted,
.help-text,
small,
.subtitle,
.description {
  color: var(--agsta-muted);
}

/* Absätze unter Überschriften ruhiger */
main h1 + p,
main h2 + p,
.page-intro,
.muted {
  max-width: 900px;
  font-size: 1.08rem;
  line-height: 1.45;
  margin-top: 0;
  margin-bottom: 34px;
}

/* Karten und Inhaltsblöcke */
.card,
.panel,
.box,
.form-card,
.report-card,
.calendar-card,
.project-card,
.user-card,
.vacation-card,
.summary-card,
.stat-card,
.metric-card,
[class*="card"],
[class*="panel"] {
  background: #ffffff !important;
  border: 1px solid var(--agsta-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Größere Inhaltskarten */
.card,
.panel,
.box,
.form-card,
.report-card,
.calendar-card {
  padding: clamp(22px, 3vw, 34px);
}

/* Karten-Abstände vereinheitlichen */
.card + .card,
.panel + .panel,
.box + .box,
.report-card + .report-card,
.calendar-card + .calendar-card,
section + section {
  margin-top: 28px;
}

/* Kennzahlenkarten klarer und flacher */
.stat-card,
.metric-card,
.summary-card,
[class*="stat"],
[class*="metric"] {
  padding: 18px 20px;
  background: #ffffff !important;
  border: 1px solid var(--agsta-border) !important;
  border-radius: 0 !important;
}

.stat-card strong,
.metric-card strong,
.summary-card strong,
[class*="stat"] strong,
[class*="metric"] strong {
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* Warn-/Negativwerte weiterhin sichtbar, aber nicht knallig */
.danger,
.negative,
.error,
.text-danger,
[style*="red"] {
  color: var(--agsta-danger) !important;
}

/* Tabellen */
.table-wrap,
.table-scroll,
.overflow-x,
[class*="table"] {
  scrollbar-color: #9d9d9d #f0f0f0;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 0 !important;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--agsta-border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--agsta-muted);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

td {
  font-size: 1rem;
  line-height: 1.35;
}

tbody tr:hover {
  background: #fafafa;
}

/* Letzte Tabellenzeile ohne doppelten Abschluss */
tbody tr:last-child td {
  border-bottom-color: var(--agsta-border);
}

/* Formulare */
form {
  margin: 0;
}

label {
  color: var(--agsta-muted);
  font-weight: 700;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--agsta-border) !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: var(--agsta-text);
  font-size: 1rem;
  line-height: 1.35;
  box-shadow: none !important;
}

input,
select {
  padding: 9px 12px;
}

textarea {
  padding: 12px;
  min-height: 110px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a2a2a2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--agsta-text) !important;
  outline: none;
}

/* Formularraster harmonisieren */
.form-grid,
.grid,
.filters,
.filter-row {
  gap: 18px;
}

/* Buttons */
button,
.button,
.btn,
input[type="submit"],
input[type="button"],
a.button,
a.btn,
.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 0 !important;
  font-weight: 700;
  box-shadow: none !important;
}

button,
.button,
.btn,
input[type="submit"],
input[type="button"],
a.button,
a.btn,
.primary-button {
  background: var(--agsta-text) !important;
  border: 1px solid var(--agsta-text) !important;
  color: #ffffff !important;
}

button:hover,
.button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover,
a.btn:hover,
.primary-button:hover {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

.secondary-button,
button.secondary,
.button.secondary,
.btn.secondary,
a.secondary {
  background: #ffffff !important;
  border: 1px solid var(--agsta-border) !important;
  color: var(--agsta-text) !important;
}

.secondary-button:hover,
button.secondary:hover,
.button.secondary:hover,
.btn.secondary:hover,
a.secondary:hover {
  background: #f6f6f6 !important;
  border-color: var(--agsta-text) !important;
  color: var(--agsta-text) !important;
}

/* Kleine Badges / Statusanzeigen */
.badge,
.status,
.tag,
.pill,
[class*="badge"],
[class*="status"],
[class*="pill"] {
  border-radius: 0 !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Meldungen */
.messages {
  margin-bottom: 28px;
}

.message {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid var(--agsta-border);
}

/* Kalender und helle Zusatzflächen vom beige lösen */
.calendar,
.month-calendar,
.calendar-grid,
.calendar-day,
.day-cell,
.summary-grid,
.stats-grid,
.metrics-grid {
  border-radius: 0 !important;
}

/* Sehr helle beigefarbene Flächen neutralisieren */
[style*="#f4f2ed"],
[style*="#f7f5f1"],
[style*="#eee5db"] {
  background: #ffffff !important;
}

/* Mobile Abstände */
@media (max-width: 900px) {
  .container,
  main.container {
    width: min(100% - 36px, 1440px);
    padding: 30px 0 56px;
  }

  main h1,
  .container h1 {
    font-size: clamp(2rem, 11vw, 3.3rem);
  }

  .card,
  .panel,
  .box,
  .form-card,
  .report-card,
  .calendar-card {
    padding: 20px;
  }

  th,
  td {
    padding: 12px 10px;
  }
}


/* ============================================================
   agsta Checkbox-Fix: kompakt, eckig, schwarzweiß
   ============================================================ */

/* Checkboxen und Radios nicht wie normale Textfelder behandeln */
input[type="checkbox"],
input[type="radio"] {
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 1px solid var(--agsta-text) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  accent-color: var(--agsta-text);
  vertical-align: middle;
  cursor: pointer;
}

/* Zeilen mit Checkboxen etwas sauberer ausrichten */
td input[type="checkbox"],
td input[type="radio"],
label input[type="checkbox"],
label input[type="radio"] {
  display: inline-block;
}

/* Falls Status-Text unter dem Häkchen sitzt, etwas ruhiger */
td .muted,
td small {
  display: block;
  margin-top: 8px;
}

/* ============================================================
   agsta Admin-Tabellen: Felder in Zeilen harmonisieren
   ============================================================ */

/* Tabellen mit Eingabefeldern sollen wie echte Bearbeitungszeilen wirken */
table th,
table td {
  vertical-align: middle !important;
}

/* Formulare innerhalb von Tabellen kompakt in einer Zeile */
table td form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  width: auto;
}

/* Eingabefelder in Tabellen nicht unnötig auf volle Breite ziehen */
table td input:not([type="checkbox"]):not([type="radio"]),
table td select,
table td textarea {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  height: 44px;
  margin: 0;
}

/* Textfelder in Tabellen etwas ruhiger dimensionieren */
table td input[type="text"],
table td input[type="email"],
table td input[type="password"],
table td input[type="number"] {
  min-width: 120px;
}

/* Passwort-Spalte: Feld und Button sollen nebeneinander stehen */
table td input[type="password"] {
  min-width: 150px;
}

/* Buttons in Tabellen auf gleiche Höhe bringen */
table td button,
table td .button,
table td .btn,
table td input[type="submit"] {
  min-height: 44px;
  height: 44px;
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Checkbox-Zellen nicht wie große Formularfelder wirken lassen */
table td input[type="checkbox"],
table td input[type="radio"] {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  flex: 0 0 22px;
}

/* Labels mit Checkboxen horizontal und mittig ausrichten */
table td label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.1;
}

/* Falls aktiv/deaktiviert unter dem Haken steht, dichter und ruhiger */
table td label br {
  display: none;
}

/* Rechte Spalten mit Aktionen etwas kompakter */
table th:last-child,
table td:last-child {
  white-space: nowrap;
}

/* Bei sehr breiten Admin-Tabellen lieber sauber horizontal scrollen als zusammendrücken */
table {
  min-width: max-content;
}

.card,
.panel,
.box,
section {
  overflow-x: auto;
}

/* ============================================================
   agsta Dashboard: Monatsübersicht und Kalender
   ============================================================ */

/* Kopfbereich der Monatsübersicht */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.dashboard-header h1 {
  margin-bottom: 14px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.button-like,
.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 12px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  text-decoration: none !important;
  font-weight: 700;
  line-height: 1;
}

.primary-action {
  background: var(--agsta-text) !important;
  border: 1px solid var(--agsta-text) !important;
  color: #ffffff !important;
}

.primary-action:hover {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

.secondary-action {
  background: #ffffff !important;
  border: 1px solid var(--agsta-border) !important;
  color: var(--agsta-text) !important;
}

.secondary-action:hover {
  background: #f6f6f6 !important;
  border-color: var(--agsta-text) !important;
  color: var(--agsta-text) !important;
}

/* Kalenderkarte flacher und großzügiger */
.calendar-card {
  border: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Monat oben wie eine ruhige Planungsüberschrift */
.calendar-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 34px;
}

.calendar-title {
  text-align: center;
}

.calendar-title h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.3vw, 2.35rem);
}

.calendar-nav {
  color: var(--agsta-text) !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 1rem;
}

.calendar-nav:hover {
  color: var(--agsta-brown) !important;
}

.calendar-nav-left {
  justify-self: start;
}

.calendar-nav-right {
  justify-self: end;
}

/* Wochentage */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--agsta-border);
}

.calendar-weekdays div {
  padding: 0 14px 14px;
  color: var(--agsta-muted);
  font-weight: 700;
  text-align: left;
}

/* Kalender als klare Planungsfläche */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 0 !important;
  border-top: 0 !important;
  background: #ffffff !important;
}

.calendar-day {
  min-height: 126px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--agsta-text) !important;
  text-decoration: none !important;
  background: #ffffff !important;
  border-right: 1px solid var(--agsta-border);
  border-bottom: 1px solid var(--agsta-border);
  border-radius: 0 !important;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:hover {
  background: #fafafa !important;
  box-shadow: inset 0 0 0 1px var(--agsta-text);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-day-number {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1;
}

.calendar-hours {
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.calendar-empty {
  color: #a6a6a6;
}

/* Tage außerhalb des Monats und Wochenenden zurücknehmen */
.calendar-day.is-outside {
  color: #b8b8b8 !important;
  background: #ffffff !important;
}

.calendar-day.is-weekend {
  background: #fbfbfb !important;
}

.calendar-day.is-outside .calendar-day-number,
.calendar-day.is-outside .calendar-empty {
  color: #b8b8b8 !important;
}

/* Heute klar markieren, aber nicht laut */
.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px var(--agsta-text);
}

/* Einträge dezent grünlich, ohne App-Kachelwirkung */
.calendar-day.has-entries {
  background: #f1f6f2 !important;
}

.calendar-day.has-entries:hover {
  background: #edf3ee !important;
}

/* Feiertage */
.calendar-day.is-holiday {
  background: #f7f7f7 !important;
}

.calendar-holiday {
  color: var(--agsta-muted);
  font-size: 0.86rem;
  line-height: 1.2;
  font-weight: 600;
}

/* Abwesenheiten / Urlaub ruhig, aber sichtbar */
.calendar-day.is-absence,
.calendar-day.is-vacation {
  background: #f5f1e8 !important;
}

.calendar-day.absence-sick {
  background: #f3eeee !important;
}

.calendar-day.absence-special-leave {
  background: #f1f1f1 !important;
}

.calendar-day.absence-training {
  background: #eef2f3 !important;
}

.calendar-vacation {
  color: var(--agsta-text);
  font-size: 0.92rem;
  line-height: 1.2;
  font-weight: 700;
}

/* Kombination Eintrag + Abwesenheit */
.calendar-day.has-entries.is-absence,
.calendar-day.has-entries.is-vacation {
  background: linear-gradient(135deg, #f1f6f2 0%, #f1f6f2 50%, #f5f1e8 50%, #f5f1e8 100%) !important;
}

/* Kennzahlen unter dem Kalender */
.calendar-kpis {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--agsta-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.calendar-kpi {
  min-height: 92px;
  padding: 18px 20px;
  border: 0 !important;
  border-right: 1px solid var(--agsta-border) !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  background: #ffffff !important;
}

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

.calendar-kpi span {
  display: block;
  color: var(--agsta-muted);
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 8px;
}

.calendar-kpi strong {
  display: block;
  color: var(--agsta-text);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.calendar-kpi.delta-negative strong {
  color: var(--agsta-danger);
}

.calendar-kpi.delta-positive strong {
  color: #2d6a3e;
}

/* Erläuterung unten kleiner und ruhiger */
.calendar-note {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--agsta-border);
  color: var(--agsta-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Letzte Einträge näher an Dashboard-Stil */
.calendar-card + .card {
  margin-top: 54px;
}

/* Responsive */
@media (max-width: 1100px) {
  .calendar-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-kpi:nth-child(3n) {
    border-right: 1px solid var(--agsta-border) !important;
  }

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

@media (max-width: 800px) {
  .dashboard-header {
    flex-direction: column;
    margin-bottom: 32px;
  }

  .dashboard-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .button-like,
  .primary-action,
  .secondary-action {
    flex: 1 1 180px;
  }

  .calendar-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }

  .calendar-title {
    text-align: left;
    order: -1;
  }

  .calendar-nav-left,
  .calendar-nav-right {
    justify-self: start;
  }

  .calendar-grid,
  .calendar-weekdays {
    min-width: 760px;
  }

  .calendar-card {
    overflow-x: auto !important;
  }

  .calendar-kpis {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n) {
    border-right: 0 !important;
  }
}

/* ============================================================
   agsta Dashboard: Monatslinks ohne Buttonrahmen, KPI-Grid ruhiger
   ============================================================ */

/* Monatsnavigation darf nicht wie ein Button aussehen */
.calendar-topbar .calendar-nav,
.calendar-topbar a.calendar-nav,
.calendar-topbar a[href*="month="] {
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--agsta-text) !important;
  text-decoration: none !important;
  font-weight: 500;
}

.calendar-topbar .calendar-nav:hover,
.calendar-topbar a.calendar-nav:hover,
.calendar-topbar a[href*="month="]:hover {
  background: transparent !important;
  border: 0 !important;
  color: var(--agsta-brown) !important;
}

/* Kennzahlen nicht als Einzelkarten, sondern als klares Linienraster */
.calendar-kpis {
  margin-top: 34px;
  padding-top: 0 !important;
  border-top: 1px solid var(--agsta-border) !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  background: #ffffff !important;
  gap: 0 !important;
}

.calendar-kpi {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 94px;
  padding: 20px 22px;
}

/* Grid-Linien: innen, nicht jede Kennzahl als eigene Box */
.calendar-kpi {
  border-right: 1px solid var(--agsta-border) !important;
  border-bottom: 1px solid var(--agsta-border) !important;
}

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

/* Bei 9 Kennzahlen keine untere Linie in der letzten Reihe */
.calendar-kpi:nth-last-child(-n+3) {
  border-bottom: 0 !important;
}

/* Falls alte Kartenregeln noch greifen */
.calendar-kpi[class*="card"],
.calendar-kpi[class*="stat"],
.calendar-kpi[class*="metric"] {
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Tablet: zweispaltiges Grid sauber abschließen */
@media (max-width: 1100px) {
  .calendar-kpi {
    border-right: 1px solid var(--agsta-border) !important;
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .calendar-kpi:nth-child(3n) {
    border-right: 1px solid var(--agsta-border) !important;
  }

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

  .calendar-kpi:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--agsta-border) !important;
  }

  .calendar-kpi:nth-last-child(-n+1) {
    border-bottom: 0 !important;
  }
}

/* Mobil: einspaltig nur horizontale Linien */
@media (max-width: 800px) {
  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--agsta-border) !important;
  }

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

/* ============================================================
   agsta Arbeitszeiten: Zeit erfassen und Zeitenliste
   ============================================================ */

/* Zeit-erfassen-Seite */
.entry-card {
  max-width: 980px;
  border: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.entry-form {
  margin-top: 24px;
}

.entry-form .entry-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 26px 24px;
}

.entry-form .field {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-form .field-hours {
  grid-column: span 3;
}

.entry-form .field-wide {
  grid-column: 1 / -1;
}

.entry-form label {
  color: var(--agsta-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  min-height: 52px;
  font-size: 1.06rem;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  padding-left: 0;
  padding-right: 0;
  background: #ffffff !important;
}

.entry-form textarea {
  min-height: 130px;
  padding-top: 14px;
}

.entry-form input:focus,
.entry-form select:focus,
.entry-form textarea:focus {
  border-bottom-color: var(--agsta-text) !important;
}

.entry-form .button-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--agsta-border);
}

.entry-form .button-row button,
.entry-form .button-row .secondary-button {
  min-height: 48px;
  padding: 13px 22px;
}

/* Arbeitszeiten: Filterzeile */
.filter-line {
  margin-bottom: 34px;
}

.filter-line-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 22px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--agsta-border);
}

.filter-line-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 150px;
}

.filter-line-form label > span:first-child {
  color: var(--agsta-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-line-form input,
.filter-line-form select {
  min-height: 44px;
  width: 100%;
}

.filter-line-form button {
  min-height: 44px;
  margin-top: 0;
}

.filter-reset {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--agsta-muted) !important;
  text-decoration: none !important;
  font-weight: 600;
}

.filter-reset:hover {
  color: var(--agsta-text) !important;
}

/* Der Tagespicker bleibt kompakt */
.date-picker-label {
  min-width: 96px !important;
}

.date-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.date-day-display {
  min-width: 48px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--agsta-border);
  font-weight: 700;
  color: var(--agsta-text);
  background: #ffffff;
}

.date-picker-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Zeitraum-Hero */
.period-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 42px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--agsta-border);
}

.period-label {
  display: block;
  color: var(--agsta-muted);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.period-hero > strong {
  display: block;
  font-size: clamp(2.2rem, 4vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.period-actions,
.period-actions-vertical {
  display: flex;
  align-items: center;
  gap: 14px;
}

.period-actions .button-like {
  white-space: nowrap;
}

/* Tabelle Arbeitszeiten */
.table-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.table-heading h2 {
  margin: 0;
}

.table-heading strong {
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.table-heading + table {
  margin-top: 12px;
}

td a[href*="/zeiten/"],
td a[href*="edit"] {
  font-weight: 700;
  text-decoration: none !important;
  color: var(--agsta-text) !important;
}

td a[href*="/zeiten/"]:hover,
td a[href*="edit"]:hover {
  color: var(--agsta-brown) !important;
}

/* Stunden-Spalte optisch etwas stabilisieren */
table th:nth-child(5),
table td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Wenn kein Mitarbeiterfilter aktiv ist, ist Stunden evtl. die 4. Spalte */
table th:nth-child(4):last-child,
table td:nth-child(4):last-child {
  font-variant-numeric: tabular-nums;
}

/* Mobile */
@media (max-width: 900px) {
  .entry-form .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-form .field,
  .entry-form .field-hours,
  .entry-form .field-wide {
    grid-column: 1 / -1;
  }

  .entry-form .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-line-form {
    align-items: stretch;
  }

  .filter-line-form label,
  .filter-line-form button,
  .filter-reset {
    width: 100%;
  }

  .period-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .period-actions,
  .period-actions-vertical {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   agsta Arbeitszeiten: Korrektur Liste / Zeitraum / Filter
   ============================================================ */

/* Filter oben nicht als große Box, sondern als ruhige Werkzeugzeile */
.filter-line,
.filter-line-top {
  max-width: 1180px;
  margin: 0 auto 46px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.filter-line-form,
.filter-line .filter-line-form {
  display: flex;
  justify-content: center;
  align-items: end;
  flex-wrap: wrap;
  gap: 18px 26px;
  padding: 0 0 22px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  background: transparent !important;
}

.filter-line-form label {
  min-width: 120px;
  max-width: 210px;
}

.filter-line-form .filter-employee {
  min-width: 210px;
}

.filter-line-form label > span:first-child {
  text-align: center;
}

.filter-line-form input,
.filter-line-form select {
  min-height: 42px;
  height: 42px;
  font-size: 1rem;
}

.filter-line-form button {
  min-height: 42px;
  height: 42px;
  padding: 9px 18px;
}

/* Tagesfeld kleiner und weniger dominant */
.date-picker-label {
  min-width: 80px !important;
  max-width: 90px !important;
}

.date-picker-wrapper,
.date-day-display {
  min-height: 42px;
  height: 42px;
}

.date-day-display {
  min-width: 58px;
}

/* Zeitraum wieder horizontal und kompakt */
.period-hero {
  max-width: 1180px;
  margin: 0 auto 48px;
  padding: 0 0 34px !important;
  border-bottom: 1px solid var(--agsta-border);
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 36px;
  text-align: left !important;
}

.period-hero > strong {
  order: 0;
  display: block;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
  text-align: left !important;
}

.period-label {
  display: block;
  margin-bottom: 12px;
  text-align: left !important;
}

/* Actions rechts wieder als normale Buttons */
.period-actions,
.period-actions-vertical {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  flex: 0 0 auto;
}

.period-actions .button-like,
.period-actions-vertical .button-like,
.period-actions .primary-action,
.period-actions .secondary-action,
.period-actions-vertical .primary-action,
.period-actions-vertical .secondary-action {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 46px !important;
  height: 46px !important;
  padding: 12px 20px !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: center;
  font-size: 1rem !important;
  line-height: 1 !important;
  white-space: nowrap;
}

/* Tabelle darunter wieder näher und ruhiger */
.period-hero + .card {
  margin-top: 0 !important;
}

/* Eintragskarte nicht übertrieben eingerahmt */
.period-hero + .card,
section.card:has(.table-heading) {
  max-width: none;
  padding: 34px 36px !important;
}

/* Mobile: erst auf kleinen Breiten stapeln */
@media (max-width: 850px) {
  .filter-line-form,
  .filter-line .filter-line-form {
    justify-content: flex-start;
  }

  .filter-line-form label,
  .filter-line-form .filter-employee,
  .filter-line-form button,
  .filter-reset {
    max-width: none;
    width: 100%;
  }

  .filter-line-form label > span:first-child {
    text-align: left;
  }

  .period-hero {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: start !important;
  }

  .period-actions,
  .period-actions-vertical {
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }
}

/* ============================================================
   agsta Abwesenheiten: Resturlaub, Formular, Filter, Tabelle
   ============================================================ */

/* Resturlaubskarten als ruhiges Datenraster */
.vacation-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin: 0 0 54px;
}

.vacation-summary-card {
  background: #ffffff !important;
  border: 1px solid var(--agsta-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 28px 30px !important;
}

.vacation-summary-name {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.vacation-summary-main {
  padding: 0 0 24px !important;
  margin: 0 0 22px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--agsta-border);
}

.vacation-summary-main span {
  display: block;
  color: var(--agsta-muted);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.vacation-summary-main strong {
  display: block;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.vacation-summary-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 !important;
  margin: 0 !important;
}

.vacation-summary-details div {
  padding: 16px 0;
  border-bottom: 1px solid var(--agsta-border);
}

.vacation-summary-details div:nth-child(odd) {
  padding-right: 18px;
  border-right: 1px solid var(--agsta-border);
}

.vacation-summary-details div:nth-child(even) {
  padding-left: 18px;
}

.vacation-summary-details div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.vacation-summary-details dt {
  color: var(--agsta-muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.vacation-summary-details dd {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Formular wie Zeit erfassen: ohne schwere Box */
.compact-card:has(.vacation-entry-form) {
  max-width: 1040px;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
  margin-bottom: 56px;
}

.compact-card:has(.vacation-entry-form) .table-heading {
  margin-bottom: 28px;
}

.compact-card:has(.vacation-entry-form) .table-heading h2 {
  margin-bottom: 12px;
}

.compact-card:has(.vacation-entry-form) .muted {
  margin-bottom: 0;
}

/* Das Template ist Label/Feld/Label/Feld aufgebaut */
.vacation-entry-form {
  display: grid !important;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px 26px !important;
  align-items: end;
  margin-top: 26px !important;
  padding-top: 28px;
  border-top: 1px solid var(--agsta-border);
}

.vacation-entry-form label {
  align-self: center;
  color: var(--agsta-muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.vacation-entry-form input,
.vacation-entry-form select {
  min-height: 50px;
  height: 50px;
  font-size: 1.04rem;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  padding-left: 0;
  padding-right: 0;
  background: #ffffff !important;
}

.vacation-entry-form input:focus,
.vacation-entry-form select:focus {
  border-bottom-color: var(--agsta-text) !important;
}

/* Button im Formular rechts unter den Feldern */
.vacation-entry-form button[type="submit"] {
  width: auto !important;
  justify-self: start;
  min-height: 48px;
  padding: 13px 22px;
}

/* Leere Platzhalterzelle vor dem Button bleibt unsichtbar */
.vacation-entry-form > div:empty {
  display: block;
}

/* Abwesenheiten-Filter kompakt wie Arbeitszeiten, aber nicht zu breit */
.vacation-filter,
.filter-line.vacation-filter {
  max-width: 1040px;
  margin: 0 0 46px;
}

.vacation-filter .filter-line-form {
  justify-content: flex-start;
}

.vacation-filter .filter-line-form label > span:first-child {
  text-align: left;
}

.vacation-filter .filter-line-form label {
  min-width: 150px;
}

.vacation-filter .filter-line-form .filter-employee {
  min-width: 220px;
}

/* Tabelle Abwesenheiten */
.vacation-filter + .card {
  padding: 34px 36px !important;
}

.vacation-filter + .card .table-heading {
  margin-bottom: 22px;
}

.vacation-filter + .card .table-heading h2 {
  margin-bottom: 10px;
}

/* Status und Art als dezente schwarzweiße Badges */
.status-badge,
.absence-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 0 !important;
  border: 1px solid var(--agsta-border);
  background: #ffffff !important;
  color: var(--agsta-text) !important;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-active {
  border-color: var(--agsta-text);
}

.status-cancelled {
  color: var(--agsta-muted) !important;
  border-color: var(--agsta-border);
  text-decoration: line-through;
}

.absence-type-vacation {
  border-color: var(--agsta-text);
}

.absence-type-sick,
.absence-type-special-leave,
.absence-type-training {
  border-color: var(--agsta-border);
  background: #f7f7f7 !important;
}

/* Fortbildungs-Unterzeile und kleine Hinweise */
.small-muted,
td .small-muted {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.25;
}

/* Stornierte Zeilen ruhiger anzeigen */
tr.is-cancelled {
  color: var(--agsta-muted);
}

tr.is-cancelled td {
  background: #fafafa;
}

/* Stornieren nicht wie Hauptaktion wirken lassen */
.inline-form button,
td form.inline-form button {
  background: #ffffff !important;
  color: var(--agsta-text) !important;
  border: 1px solid var(--agsta-border) !important;
}

.inline-form button:hover,
td form.inline-form button:hover {
  border-color: var(--agsta-text) !important;
  background: #f6f6f6 !important;
}

/* Mobile */
@media (max-width: 900px) {
  .vacation-summary-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .vacation-summary-card {
    padding: 24px !important;
  }

  .vacation-entry-form {
    grid-template-columns: 1fr;
    gap: 9px 0 !important;
  }

  .vacation-entry-form label {
    align-self: end;
    margin-top: 14px;
  }

  .vacation-entry-form > div:empty {
    display: none;
  }

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

  .vacation-filter,
  .filter-line.vacation-filter {
    max-width: none;
  }
}

/* ============================================================
   agsta Auswertung: Monatsfilter, Kennzahlen, Tabellen, Projekte
   ============================================================ */

/* Monatsnavigation oben nicht als große Buttonreihe */
.dashboard-header .month-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-top: 8px;
}

.dashboard-header .month-nav strong {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.dashboard-header .month-nav .button-like,
.dashboard-header .month-nav .secondary-action,
.dashboard-header .month-nav a[href*="month="] {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--agsta-text) !important;
  font-weight: 500;
  text-decoration: none !important;
}

.dashboard-header .month-nav .button-like:hover,
.dashboard-header .month-nav .secondary-action:hover,
.dashboard-header .month-nav a[href*="month="]:hover {
  color: var(--agsta-brown) !important;
}

/* Report-Filter kompakt und linksbündig */
.report-filter,
.filter-line.report-filter {
  max-width: 1040px;
  margin: 0 0 42px;
}

.report-filter .filter-line-form {
  justify-content: flex-start;
  padding-bottom: 22px !important;
}

.report-filter .filter-line-form label > span:first-child {
  text-align: left;
}

.report-filter input[type="month"] {
  min-width: 190px;
}

/* Summen-Kennzahlen als ruhiges Linienraster */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 !important;
  margin: 0 0 54px;
  border-top: 1px solid var(--agsta-border);
  border-bottom: 1px solid var(--agsta-border);
  background: #ffffff;
}

.report-summary-grid .calendar-kpi {
  min-height: 112px;
  padding: 22px 24px;
  border: 0 !important;
  border-right: 1px solid var(--agsta-border) !important;
  background: #ffffff !important;
}

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

.report-summary-grid .calendar-kpi span {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.report-summary-grid .calendar-kpi strong {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

/* Karten der Auswertung flacher */
.report-summary-grid + .card,
.report-summary-grid + .card + .card,
.report-note-card {
  padding: 34px 36px !important;
}

.report-table,
.project-report-table {
  min-width: 100%;
}

/* Mitarbeiterübersicht: Zahlen stabiler lesbar */
.report-table th,
.report-table td {
  white-space: nowrap;
}

.report-table td {
  font-variant-numeric: tabular-nums;
}

.report-table td:first-child,
.report-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  min-width: 220px;
}

.report-table tbody tr:hover td:first-child {
  background: #fafafa;
}

.report-table td:first-child {
  font-variant-numeric: normal;
}

/* Positive/negative Werte reduziert, aber sichtbar */
.delta-positive strong,
.delta-positive {
  color: #2d6a3e !important;
}

.delta-negative strong,
.delta-negative {
  color: var(--agsta-danger) !important;
}

/* Gesamt-Pill rechts oben */
.report-total-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--agsta-text);
  background: #ffffff;
  color: var(--agsta-text);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}

/* Projektblöcke: klare Abschnitte statt Kartenstapel */
.project-report-block {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--agsta-border);
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.project-report-block:first-of-type {
  margin-top: 18px;
}

.project-report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.project-report-head h3 {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.project-report-head strong {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Projekt-Tabellen etwas kompakter als Mitarbeiterübersicht */
.project-report-table th,
.project-report-table td {
  padding-top: 13px;
  padding-bottom: 13px;
}

.project-report-table th:nth-child(2),
.project-report-table td:nth-child(2) {
  width: 120px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Mitarbeiterstunden als dezente Tags */
.person-hours-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.person-hours {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--agsta-border);
  background: #ffffff;
  color: var(--agsta-text);
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

/* Hinweis unten weniger dominant */
.report-note-card {
  margin-top: 54px;
  border-top: 1px solid var(--agsta-border) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .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) {
  .dashboard-header .month-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .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;
  }

  .project-report-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .report-total-pill {
    margin-top: 12px;
  }
}

/* ============================================================
   agsta Auswertung: Filter entfernt, Kennzahlen stabilisieren
   ============================================================ */

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

/* Erste Report-Zeile: Ist / Soll / Differenz nebeneinander */
.report-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 1180px;
}

/* 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 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .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;
  }
}

/* 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;
  }
}

/* ============================================================
   agsta Verwaltung: Projekte, Leistungsphasen, Benutzer, Protokoll
   ============================================================ */

/* Verwaltungsseiten insgesamt ruhiger */
.admin-create-card,
.admin-table-card,
.admin-audit-card {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.admin-create-card {
  max-width: 1040px;
  margin-bottom: 58px;
}

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

/* Anlegen-Formulare wie Abwesenheiten: Label links, Feld rechts */
.admin-form-grid {
  display: grid !important;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px 26px !important;
  align-items: end;
  margin-top: 26px !important;
  padding-top: 28px;
  border-top: 1px solid var(--agsta-border);
}

.admin-form-grid label {
  align-self: center;
  color: var(--agsta-muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.admin-form-grid input,
.admin-form-grid select {
  min-height: 50px;
  height: 50px;
  font-size: 1.04rem;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--agsta-border) !important;
  padding-left: 0;
  padding-right: 0;
  background: #ffffff !important;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus {
  border-bottom-color: var(--agsta-text) !important;
}

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

.admin-form-grid > div:empty {
  display: block;
}

/* Bearbeitungstabellen */
.admin-table-card {
  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);
}

/* Benutzer-Tabelle ist breit: Spalten etwas ordnen */
.admin-user-table {
  min-width: 1320px;
}

.admin-user-table td:nth-child(1) input {
  min-width: 160px;
}

.admin-user-table td:nth-child(2) input {
  min-width: 210px;
}

.admin-user-table td:nth-child(3) select {
  min-width: 140px;
}

.admin-user-table td:nth-child(9),
.admin-user-table td:nth-child(10) {
  white-space: nowrap;
}

/* "du"-Hinweis dezent */
.admin-user-table small {
  display: block;
  margin-top: 6px;
  color: var(--agsta-muted);
  font-weight: 700;
}

/* Passwort neu setzen harmonischer */
.admin-user-table .inline-form {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  width: auto;
}

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

.admin-user-table .inline-form button {
  background: #ffffff !important;
  color: var(--agsta-text) !important;
  border: 1px solid var(--agsta-border) !important;
}

.admin-user-table .inline-form button:hover {
  background: #f6f6f6 !important;
  border-color: var(--agsta-text) !important;
}

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

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

/* Projekte */
.admin-project-table td:nth-child(1) input {
  min-width: 110px;
}

.admin-project-table td:nth-child(2) input {
  min-width: 280px;
}

.admin-project-table td:nth-child(3) input {
  min-width: 220px;
}

/* Änderungsprotokoll */
.admin-audit-card {
  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 {
    grid-template-columns: 1fr;
    gap: 9px 0 !important;
  }

  .admin-form-grid label {
    align-self: end;
    margin-top: 14px;
  }

  .admin-form-grid > div:empty {
    display: none;
  }

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

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

.day-entry-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 1rem 0 1.5rem;
  text-align: center;
}

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

.day-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 2.6rem;
  line-height: 1;
  background: var(--card-bg, #fff);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

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

.day-entry-table-wrap {
  overflow-x: auto;
}

.day-entry-table {
  width: 100%;
}

.day-entry-table select,
.day-entry-table input {
  width: 100%;
  box-sizing: border-box;
}

.day-entry-table td {
  vertical-align: middle;
}

.day-hours-input {
  max-width: 7rem;
}

.day-note-input {
  min-width: 18rem;
}

.day-entry-hint {
  margin-top: 0.75rem;
}

@media (max-width: 760px) {
  .day-entry-hero {
    gap: 0.6rem;
  }

  .day-arrow {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 2rem;
  }

  .day-entry-table thead {
    display: none;
  }

  .day-entry-table tr {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  }

  .day-entry-table td {
    display: block;
    padding: 0.35rem 0;
  }

  .day-entry-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.65;
  }

  .day-hours-input,
  .day-note-input {
    max-width: none;
    min-width: 0;
  }
}

.day-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}

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

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

.day-entry-hero {
  position: relative;
}

.day-arrow {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 0.35rem;
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: inherit;
}

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

.day-edit-column {
  width: 5.5rem;
}

.day-row-actions {
  white-space: nowrap;
  text-align: center;
}

.mini-button {
  border: 0;
  border-radius: 0.45rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.mini-button.danger {
  font-size: 1rem;
}

.add-row-button {
  margin-top: 0.9rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.day-entry-table select,
.day-entry-table input {
  min-height: 2.6rem;
}

.day-hours-input {
  max-width: 8rem;
}

@media (max-width: 760px) {
  .day-page-toolbar {
    align-items: flex-start;
  }

  .day-row-actions {
    text-align: left;
  }

  .add-row-button {
    width: 100%;
  }
}

/* Tagesmaske: Kopfbereich und Pfeile verfeinern */
.day-entry-hero .day-arrow {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  text-decoration: none !important;
}

.day-entry-hero .day-arrow::before,
.day-entry-hero .day-arrow::after {
  display: none !important;
}

.day-table-heading {
  align-items: flex-start;
}

.day-heading-left,
.day-heading-right {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.day-heading-left {
  align-items: flex-start;
}

.day-heading-right {
  align-items: flex-end;
}

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

.day-static-value {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  line-height: 1.3;
}

.day-entry-row-new select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .day-table-heading {
    gap: 1rem;
  }

  .day-heading-right {
    align-items: flex-start;
  }
}

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

.day-entry-table {
  table-layout: fixed;
}

.day-entry-table th,
.day-entry-table td {
  text-align: left;
}

.day-entry-table th:nth-child(1),
.day-entry-table td:nth-child(1) {
  width: 36%;
}

.day-entry-table th:nth-child(2),
.day-entry-table td:nth-child(2) {
  width: 28%;
}

.day-entry-table th:nth-child(3),
.day-entry-table td:nth-child(3) {
  width: 10rem;
}

.day-entry-table th:nth-child(4),
.day-entry-table td:nth-child(4) {
  width: auto;
}

.day-static-value {
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.45);
}

.day-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}

.day-bottom-bar .add-row-button {
  margin-top: 0;
}

.day-bottom-bar .autosave-status {
  text-align: right;
}

@media (max-width: 760px) {
  .day-entry-table {
    table-layout: auto;
  }

  .day-entry-table th,
  .day-entry-table td {
    width: auto !important;
  }

  .day-bottom-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .day-bottom-bar .autosave-status {
    text-align: left;
  }
}

/* Tagesmaske: Drag-Sortierung wie Listen-Griff */
.day-entry-table {
  table-layout: fixed;
}

.day-entry-table th,
.day-entry-table td {
  text-align: left;
}

.day-entry-table .drag-column,
.day-entry-table .drag-cell {
  width: 2.4rem !important;
  min-width: 2.4rem !important;
  max-width: 2.4rem !important;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}

.day-entry-table .remove-column,
.day-entry-table .remove-cell {
  width: 3rem !important;
  min-width: 3rem !important;
  max-width: 3rem !important;
  text-align: center;
}

.day-entry-table .project-column,
.day-entry-table .project-cell {
  width: 34%;
}

.day-entry-table .category-column,
.day-entry-table .category-cell {
  width: 28%;
}

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

.day-entry-table .note-column,
.day-entry-table .note-cell {
  width: auto;
}

.drag-handle {
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  cursor: grab;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem 0.15rem;
}

.drag-handle:active {
  cursor: grabbing;
}

.day-entry-row.is-dragging {
  opacity: 0.45;
}

@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;
  }
}

/* Tagesmaske: Sortiergriff und Entfernen wie native Listen */
.day-entry-table .drag-column,
.day-entry-table .drag-cell {
  width: 2.2rem !important;
  min-width: 2.2rem !important;
  max-width: 2.2rem !important;
  padding-left: 0 !important;
  padding-right: 0.35rem !important;
  text-align: left !important;
}

.drag-handle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 1.6rem;
  height: 2.4rem;
  padding: 0;
  margin: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: grab;
  touch-action: none;
}

.drag-handle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background: #111;
}

.drag-handle:active {
  cursor: grabbing;
}

.day-entry-row.is-dragging {
  opacity: 0.45;
}

.remove-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0 !important;
  border-radius: 999px;
  background: #d93636 !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 .remove-column,
.day-entry-table .remove-cell {
  width: 3rem !important;
  min-width: 3rem !important;
  max-width: 3rem !important;
  text-align: right !important;
}

.day-entry-table .project-column,
.day-entry-table .project-cell {
  width: 34% !important;
}

.day-entry-table .category-column,
.day-entry-table .category-cell {
  width: 28% !important;
}

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

.day-entry-table .note-column,
.day-entry-table .note-cell {
  width: auto !important;
}

.day-static-value,
.day-entry-table select {
  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;
  }
}

/* Tagesmaske: zuverlässige Sortierung mit kleinen Pfeilen */
.drag-handle {
  display: none !important;
}

.day-entry-table .drag-column,
.day-entry-table .drag-cell {
  width: 3.3rem !important;
  min-width: 3.3rem !important;
  max-width: 3.3rem !important;
  padding-left: 0 !important;
  padding-right: 0.35rem !important;
  text-align: left !important;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 0.1rem 0 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0.35rem;
  background: transparent !important;
  box-shadow: none !important;
  color: #111 !important;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.sort-button:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}

/* Tagesansicht: Abwesenheiten */
.absence-day-card {
  margin-top: 1.5rem;
}

.absence-day-table {
  table-layout: fixed;
}

.absence-day-table .absence-type-column {
  width: 24%;
}

.absence-day-table .absence-date-column {
  width: 16%;
}

.absence-day-table .absence-note-column {
  width: auto;
}

.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;
}

@media (max-width: 760px) {
  .absence-day-table .absence-type-column,
  .absence-day-table .absence-date-column,
  .absence-day-table .absence-note-column {
    width: auto !important;
  }
}

/* Tagesansicht: Arbeitszeiten bei Abwesenheit markieren */
.work-day-card.has-day-absence {
  background: rgba(0, 0, 0, 0.045);
}

/* Tagesansicht: direkte Abwesenheitserfassung */
.absence-day-card {
  margin-top: 1.5rem;
}

.absence-day-form .day-bottom-bar {
  justify-content: flex-start;
}

.absence-day-table {
  table-layout: fixed;
}

.absence-day-table .absence-type-column {
  width: 26%;
}

.absence-day-table .absence-date-column {
  width: 14%;
}

.absence-day-table .absence-note-column {
  width: auto;
}

.absence-day-table select,
.absence-day-table input {
  width: 100%;
  box-sizing: border-box;
  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: #d93636 !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;
}

@media (max-width: 760px) {
  .absence-day-table .absence-type-column,
  .absence-day-table .absence-date-column,
  .absence-day-table .absence-note-column {
    width: auto !important;
  }
}

/* Tagesansicht: Arbeitszeiten bei Abwesenheit deutlich markieren */
.work-day-card.has-day-absence {
  background: #e7e7e7 !important;
  border-color: #c9c9c9 !important;
}

.work-day-card.has-day-absence .day-entry-table-wrap,
.work-day-card.has-day-absence .day-entry-table,
.work-day-card.has-day-absence .day-entry-table tbody,
.work-day-card.has-day-absence .day-entry-table tr,
.work-day-card.has-day-absence .day-entry-table td {
  background: #e7e7e7 !important;
}

.work-day-card.has-day-absence .day-static-value {
  background: #dcdcdc !important;
  border-color: #c4c4c4 !important;
}

.work-day-card.has-day-absence input,
.work-day-card.has-day-absence select {
  background: #f1f1f1 !important;
  border-color: #bfbfbf !important;
}

.work-day-card.has-day-absence .table-heading,
.work-day-card.has-day-absence .day-bottom-bar {
  background: transparent !important;
}

.work-day-card.has-day-absence::before {
  content: "Abwesenheit an diesem Tag eingetragen";
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #cfcfcf;
  color: #333;
  font-size: 0.85rem;
  font-weight: 700;
}

/* 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 */
.work-day-card.has-day-notice {
  background: #e7e7e7 !important;
  border-color: #c9c9c9 !important;
}

.work-day-card.has-day-notice .day-entry-table-wrap,
.work-day-card.has-day-notice .day-entry-table,
.work-day-card.has-day-notice .day-entry-table tbody,
.work-day-card.has-day-notice .day-entry-table tr,
.work-day-card.has-day-notice .day-entry-table td {
  background: #e7e7e7 !important;
}

.work-day-card.has-day-notice .day-static-value {
  background: #dcdcdc !important;
  border-color: #c4c4c4 !important;
}

.work-day-card.has-day-notice input,
.work-day-card.has-day-notice select {
  background: #f1f1f1 !important;
  border-color: #bfbfbf !important;
}

.work-day-card.has-day-notice .table-heading,
.work-day-card.has-day-notice .day-bottom-bar {
  background: transparent !important;
}

.work-day-card.has-day-notice::before {
  content: attr(data-work-day-notice);
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #cfcfcf;
  color: #333;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Hauptnavigation sauber ausrichten */
.topbar,
.main-nav {
  display: flex;
  align-items: center;
}

.main-nav {
  gap: 1.25rem;
}

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

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

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

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "⌄";
  display: inline-block;
  margin-left: 0.35rem;
  line-height: 1;
  transform: translateY(-0.03rem);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
}

/* Navigation: sauberen Dropdown-Pfeil darstellen */
.nav-dropdown > summary {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "";
  display: inline-block;
  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-hero {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.day-entry-title {
  width: clamp(22rem, 48vw, 42rem);
  text-align: center;
}

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

.day-entry-hero .day-arrow {
  flex: 0 0 3rem;
  text-align: center;
}

@media (max-width: 760px) {
  .day-entry-hero {
    gap: 0.5rem;
  }

  .day-entry-title {
    width: min(70vw, 24rem);
  }

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

  .day-entry-hero .day-arrow {
    flex-basis: 2rem;
  }
}

/* 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::-webkit-details-marker {
  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;
}


.weekday-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
}

.weekday-checkboxes label {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  white-space: nowrap;
  font-size: 0.9rem;
}

.weekday-checkboxes.compact {
  min-width: 150px;
}


.admin-users-card {
  overflow: visible;
}

.admin-user-card-list {
  display: grid;
  gap: 1rem;
}

.admin-user-edit-card {
  border: 1px solid #dddddd;
  border-radius: 12px;
  padding: 1rem;
  background: #ffffff;
}

.admin-user-edit-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.4fr) minmax(130px, 0.8fr) minmax(100px, 0.7fr);
  gap: 0.85rem 1rem;
  align-items: end;
}

.admin-user-field {
  display: grid;
  gap: 0.25rem;
}

.admin-user-field label,
.admin-user-password-form > label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #666666;
}

.admin-user-field input,
.admin-user-field select,
.admin-user-password-form input {
  width: 100%;
  min-width: 0;
}

.admin-user-name-field small {
  font-size: 0.75rem;
  color: #777777;
}

.admin-user-workdays-field {
  min-width: 210px;
}

.admin-user-workdays-field .weekday-checkboxes {
  min-height: 46px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #dddddd;
  border-radius: 8px;
}

.admin-user-active-field .inline-check {
  min-height: 46px;
  align-items: center;
}

.admin-user-save {
  display: flex;
  align-items: end;
}

.admin-user-save button {
  width: 100%;
}

.admin-user-password-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eeeeee;
  display: grid;
  gap: 0.35rem;
}

.admin-user-password-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 1100px) {
  .admin-user-edit-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-user-edit-form,
  .admin-user-password-row {
    grid-template-columns: 1fr;
  }

  .admin-user-save button {
    width: auto;
  }
}


.admin-user-schedules {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eeeeee;
  display: grid;
  gap: 0.7rem;
}

.admin-user-schedules h3 {
  margin: 0;
  font-size: 1rem;
}

.compact-note {
  margin: 0;
}

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

.work-schedule-existing {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #fafafa;
}

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

.work-schedule-existing span,
.work-schedule-existing small {
  color: #666666;
  font-size: 0.85rem;
}

.work-schedule-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(220px, 1.3fr) minmax(180px, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

.work-schedule-create-form > label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666666;
}

.work-schedule-create-form input {
  width: 100%;
  min-width: 0;
}

.work-schedule-days {
  min-width: 220px;
}

.danger-button {
  color: #8a1f1f;
}

@media (max-width: 1200px) {
  .work-schedule-create-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 700px) {
  .work-schedule-existing,
  .work-schedule-create-form {
    grid-template-columns: 1fr;
  }
}



/* admin users refined layout start */
.admin-user-card-list {
  display: grid;
  gap: 1.1rem;
}

.admin-user-edit-card,
.admin-new-user-card {
  display: grid;
  gap: 1rem;
}

.admin-user-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eeeeee;
}

.admin-user-card-header h2 {
  margin: 0;
}

.admin-user-card-header p {
  margin: 0.2rem 0 0;
  color: #666666;
}

.user-role-badge {
  white-space: nowrap;
  border: 1px solid #dddddd;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  color: #555555;
  background: #fafafa;
}

.admin-user-edit-form {
  display: grid;
  gap: 0.9rem;
}

.admin-user-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  background: #fcfcfc;
}

.admin-user-section h3 {
  margin: 0;
  font-size: 0.98rem;
}

.admin-user-field-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(220px, 1.4fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr);
  gap: 0.75rem;
  align-items: end;
}

.admin-user-field-grid.compact-grid {
  grid-template-columns: minmax(150px, 0.6fr) minmax(240px, 1fr) minmax(150px, 0.6fr);
}

.admin-user-field-grid label,
.admin-user-check-field,
.admin-user-workdays-field,
.work-schedule-days,
.work-schedule-create-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666666;
}

.admin-user-field-grid input,
.admin-user-field-grid select,
.work-schedule-create-form input,
.admin-user-password-form input {
  width: 100%;
  min-width: 0;
}

.admin-user-check-field .inline-check {
  min-height: 42px;
  align-items: center;
}

.admin-user-workdays-field .weekday-checkboxes,
.work-schedule-days .weekday-checkboxes {
  min-height: 42px;
  padding: 0.4rem 0.55rem;
  border: 1px solid #dddddd;
  border-radius: 8px;
  background: #ffffff;
}

.admin-user-save-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.2rem;
}

.admin-user-save-row button {
  min-width: 190px;
}

.admin-user-schedules,
.admin-user-password-section {
  margin-top: 0;
}

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

.work-schedule-existing {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #ffffff;
}

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

.work-schedule-existing span,
.work-schedule-existing small,
.compact-note {
  color: #666666;
  font-size: 0.85rem;
}

.compact-note {
  margin: 0;
}

.work-schedule-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 0.7fr)) minmax(230px, 1.1fr) minmax(170px, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.admin-user-password-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

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

.admin-new-user-card {
  margin-top: 0.8rem;
}

.admin-new-user-card.is-hidden {
  display: none;
}

.danger-button {
  color: #8a1f1f;
}

@media (max-width: 1200px) {
  .admin-user-field-grid,
  .admin-user-field-grid.compact-grid,
  .work-schedule-create-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-user-card-header,
  .work-schedule-existing {
    grid-template-columns: 1fr;
  }

  .admin-user-field-grid,
  .admin-user-field-grid.compact-grid,
  .work-schedule-create-form,
  .admin-user-password-form {
    grid-template-columns: 1fr;
  }

  .admin-user-save-row {
    justify-content: flex-start;
  }

  .admin-user-save-row button {
    width: 100%;
  }
}
/* admin users refined layout end */


/* admin users scrollbar cleanup */
.admin-user-edit-card {
  overflow: visible !important;
}

.admin-user-edit-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1rem !important;
  overflow: visible !important;
}

.admin-user-section {
  overflow: visible !important;
  min-width: 0 !important;
}

.admin-user-field-grid,
.admin-user-field-grid.compact-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.8rem !important;
  align-items: end !important;
  overflow: visible !important;
}

.admin-user-field-grid > *,
.admin-user-section > *,
.admin-user-edit-form > * {
  min-width: 0 !important;
}

.admin-user-field-grid input,
.admin-user-field-grid select,
.admin-user-password-form input,
.work-schedule-create-form input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.admin-user-workdays-field .weekday-checkboxes,
.work-schedule-days .weekday-checkboxes {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.admin-user-save-row {
  justify-content: flex-end !important;
  margin-top: 0.4rem !important;
}

.admin-user-save-row button {
  min-width: 220px !important;
}

.work-schedule-create-form {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 0.7rem !important;
  align-items: end !important;
  overflow: visible !important;
}

.work-schedule-days {
  grid-column: span 2;
}

.admin-user-password-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 0.7rem !important;
}

@media (max-width: 1100px) {
  .admin-user-field-grid,
  .admin-user-field-grid.compact-grid,
  .work-schedule-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .work-schedule-days {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .admin-user-field-grid,
  .admin-user-field-grid.compact-grid,
  .work-schedule-create-form,
  .admin-user-password-form {
    grid-template-columns: 1fr !important;
  }

  .admin-user-save-row {
    justify-content: stretch !important;
  }

  .admin-user-save-row button {
    width: 100% !important;
  }
}

/* admin users compact override */
.admin-user-edit-card {
  gap: 0.75rem !important;
  padding: 0.9rem !important;
}

.admin-user-card-header {
  padding: 0.55rem 0.7rem !important;
  align-items: center !important;
}

.admin-user-card-header h2 {
  font-size: 1.8rem !important;
  line-height: 1.1 !important;
}

.admin-user-card-header p {
  font-size: 0.95rem !important;
}

.admin-user-edit-form {
  display: grid !important;
  grid-template-columns: 1.25fr 0.95fr 1.05fr !important;
  gap: 0.75rem !important;
  align-items: stretch !important;
}

.admin-user-section {
  padding: 0.65rem !important;
  gap: 0.45rem !important;
}

.admin-user-section h3 {
  font-size: 0.9rem !important;
  margin-bottom: 0.1rem !important;
}

.admin-user-field-grid,
.admin-user-field-grid.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.5rem 0.6rem !important;
}

.admin-user-field-grid label,
.admin-user-check-field,
.admin-user-workdays-field,
.work-schedule-days,
.work-schedule-create-form label {
  font-size: 0.72rem !important;
}

.admin-user-field-grid input,
.admin-user-field-grid select {
  min-height: 36px !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
}

.admin-user-workdays-field {
  grid-column: span 2;
}

.admin-user-workdays-field .weekday-checkboxes,
.work-schedule-days .weekday-checkboxes {
  min-height: 36px !important;
  padding: 0.3rem 0.45rem !important;
}

.weekday-checkboxes {
  gap: 0.25rem 0.45rem !important;
}

.weekday-checkboxes label {
  font-size: 0.78rem !important;
}

.admin-user-save-row {
  grid-column: 1 / -1 !important;
  justify-content: flex-end !important;
  margin-top: -0.25rem !important;
  padding-top: 0 !important;
}

.admin-user-save-row button {
  min-width: 190px !important;
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}

.admin-user-schedules {
  padding: 0.65rem !important;
}

.work-schedule-create-form {
  grid-template-columns: 0.75fr 0.75fr 0.75fr 1.35fr 1fr auto !important;
  gap: 0.5rem !important;
}

.work-schedule-create-form input {
  min-height: 36px !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
}

.work-schedule-days {
  grid-column: auto !important;
}

.work-schedule-existing {
  padding: 0.45rem 0.6rem !important;
}

.admin-user-password-section {
  padding: 0.65rem !important;
}

.admin-user-password-form {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.admin-user-password-form input {
  min-height: 36px !important;
}

.admin-user-password-form button,
.work-schedule-create-form button {
  min-height: 36px !important;
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
}

@media (max-width: 1200px) {
  .admin-user-edit-form {
    grid-template-columns: 1fr 1fr !important;
  }

  .admin-user-save-row {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 800px) {
  .admin-user-edit-form,
  .work-schedule-create-form,
  .admin-user-password-form {
    grid-template-columns: 1fr !important;
  }

  .admin-user-workdays-field {
    grid-column: auto !important;
  }
}

/* admin users final compact layout */
.user-card-list {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.user-card {
  display: grid;
  gap: 0.9rem;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.user-hero,
.user-panel,
.new-user-panel {
  background: #ffffff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
}

.user-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

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

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

.user-hero h2 {
  margin: 0;
  line-height: 1.05;
}

.user-hero p {
  margin: 0.2rem 0 0;
  color: #666666;
}

.role-chip,
.self-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid #dddddd;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  color: #555555;
  background: #fafafa;
}

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

.user-main-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr 1fr;
  gap: 0.9rem;
  align-items: stretch;
}

.user-panel,
.new-user-panel {
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
}

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

.user-field-grid {
  display: grid;
  gap: 0.75rem;
}

.user-field-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-field-grid label,
.user-checkbox-field,
.user-weekday-field,
.schedule-form label,
.schedule-button-field,
.password-form,
.user-save-field {
  min-width: 0;
}

.user-field-grid label,
.user-checkbox-field,
.user-weekday-field,
.schedule-form label,
.schedule-button-field,
.user-save-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #666666;
}

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

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

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

.user-weekday-box {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #dddddd;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  box-sizing: border-box;
  background: #ffffff;
}

.user-weekday-box label {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: #555555;
  white-space: nowrap;
}

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

.password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 0.75rem;
  align-items: end;
}

.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 #e7e7e7;
  border-radius: 10px;
  background: #fafafa;
}

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

.schedule-existing span,
.schedule-existing small,
.compact-note {
  color: #666666;
  font-size: 0.86rem;
}

.compact-note {
  margin: 0;
}

.schedule-form {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 0.8fr 1.25fr 1fr 180px;
  gap: 0.75rem;
  align-items: end;
}

.user-panel-wide {
  width: 100%;
}

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

.new-user-panel {
  margin-top: 0.8rem;
}

.new-user-panel.is-hidden {
  display: none;
}

.danger-button {
  color: #8a1f1f;
}

@media (max-width: 1300px) {
  .user-main-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .schedule-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

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

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


/* admin users final polish */
.user-card {
  border: 1px solid #e2e2e2 !important;
  background: #ffffff !important;
  padding: 0 !important;
  gap: 0 !important;
  box-shadow: none !important;
}

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

.user-hero {
  border: none !important;
  border-bottom: 1px solid #e7e7e7 !important;
  border-radius: 0 !important;
  padding: 0.9rem 1rem !important;
}

.user-hero h2 {
  font-size: 1.9rem !important;
}

.user-main-form {
  padding: 0.9rem 1rem 0 !important;
}

.user-main-grid {
  align-items: stretch !important;
}

.user-main-grid > .user-panel {
  height: 100% !important;
  box-sizing: border-box !important;
}

.user-panel {
  border-radius: 0 !important;
}

.user-panel-wide {
  margin: 0.9rem 1rem 0 !important;
}

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

.user-field-grid.two-cols {
  align-items: end !important;
}

.user-field-grid input,
.user-field-grid select {
  min-height: 42px !important;
}

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

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

.user-checkbox-box {
  min-height: 42px !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-weekday-box {
  width: auto !important;
  max-width: fit-content !important;
  padding-right: 0.65rem !important;
}

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

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

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

.password-form {
  margin-top: 0 !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-list {
  display: grid !important;
  gap: 0.7rem !important;
}

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

.user-card[open] {
  margin-bottom: 1rem !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;
}

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

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

.user-hero::after {
  content: "öffnen";
  margin-left: auto;
  font-size: 0.8rem;
  color: #777777;
  border: 1px solid #dddddd;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.user-card[open] > .user-hero::after {
  content: "schließen";
}

.user-hero {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.8rem !important;
}

.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: #666666 !important;
}

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

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

.user-main-grid {
  display: grid !important;
  grid-template-columns: 1.25fr 0.95fr 1fr !important;
  gap: 0.85rem !important;
  align-items: stretch !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 #e2e2e2 !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 {
  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 {
  min-height: 42px !important;
}

.user-weekday-box {
  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;
}

.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;
}

.password-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 150px !important;
  gap: 0.7rem !important;
}

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

@media (max-width: 1300px) {
  .user-main-grid {
    grid-template-columns: 1fr !important;
  }

  .schedule-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 800px) {
  .user-hero {
    align-items: flex-start !important;
  }

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

/* admin users collapse/list cleanup */
.user-card-list {
  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 {
  border: 1px solid #e2e2e2 !important;
  background: #ffffff !important;
  margin: 0 !important;
  box-shadow: none !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: #e2e2e2 !important;
}

.calendar-day.is-weekend:hover,
.calendar-day.is-regular-offday:hover {
  background: #d8d8d8 !important;
}

.calendar-day.is-weekend .calendar-day-number,
.calendar-day.is-regular-offday .calendar-day-number {
  color: #555555 !important;
}

.calendar-day.is-regular-offday::after {
  content: "frei";
  position: absolute;
  right: 0.35rem;
  bottom: 0.25rem;
  font-size: 0.68rem;
  color: #777777;
}

.day-entry-card.is-weekend,
.day-entry-card.is-regular-offday,
.work-day-card.is-weekend,
.work-day-card.is-regular-offday {
  background: #eeeeee !important;
}

/* holidays same color as weekends */
.calendar-day.is-holiday {
  background: #e2e2e2 !important;
}

.calendar-day.is-holiday:hover {
  background: #d8d8d8 !important;
}

.calendar-day.is-holiday .calendar-day-number {
  color: #555555 !important;
}

.day-entry-card.is-holiday,
.work-day-card.is-holiday {
  background: #eeeeee !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: #e2e2e2 !important;
}

.calendar-day.absence-overtime-reduction:hover {
  background: #d8d8d8 !important;
}

.calendar-day.absence-overtime-reduction .calendar-day-number {
  color: #555555 !important;
}

.absence-type-badge.absence-type-overtime-reduction {
  background: #eeeeee;
  color: #555555;
}


/* 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;
}

.calendar-day.is-today {
  border: 3px solid #c0392b !important;
  box-sizing: border-box;
}

.calendar-day.is-today .calendar-day-number {
  color: #c0392b !important;
}

/* today marker only red, no black focus frame */
.calendar-day.is-today,
.calendar-day.is-today:focus,
.calendar-day.is-today:focus-visible,
.calendar-day.is-today:active {
  border: 3px solid #c0392b !important;
  outline: none !important;
  box-shadow: none !important;
}


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

.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;
}

.month-entry-row-new {
  background: #fafafa;
}


/* 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;
}

.sort-direction {
  font-size: 0.9em;
  line-height: 1;
  opacity: 0.8;
}


/* month entries header polish */
.month-entries-table {
  table-layout: fixed;
  width: 100%;
}

.month-entries-table th:nth-child(1),
.month-entries-table td:nth-child(1) {
  width: 12%;
}

.month-entries-table th:nth-child(2),
.month-entries-table td:nth-child(2) {
  width: 27%;
}

.month-entries-table th:nth-child(3),
.month-entries-table td:nth-child(3) {
  width: 22%;
}

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

.month-entries-table th:nth-child(5),
.month-entries-table td:nth-child(5) {
  width: 31%;
}

.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;
}


/* grouped month entry sorting */
.month-entries-table tr.month-entry-group-start td {
  border-top: 0.75rem solid #f6f6f6 !important;
}

.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: #f5f5f5 !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;
}

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

/* ============================================================
   Mobile Optimierung: Basislayout iPhone / kleine Displays
   ============================================================ */

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    margin: 14px auto;
    padding: 0 10px 32px;
  }

  .card,
  .calendar-card,
  .month-entries-card,
  .work-day-card,
  .absence-day-card {
    border-radius: 14px;
    padding: 14px;
    margin: 12px 0;
  }

  .topbar,
  header.topbar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .topbar .brand,
  .brand {
    display: block;
    font-size: 17px;
    line-height: 1.2;
    text-align: center;
  }

  .main-nav {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .main-nav > a,
  .main-nav > .nav-dropdown,
  .main-nav summary {
    width: 100%;
  }

  .main-nav a,
  .main-nav summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    padding: 10px 12px;
    text-align: center;
  }

  .nav-dropdown-menu {
    position: static !important;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .dashboard-header,
  .table-heading,
  .day-table-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dashboard-header h1,
  .day-entry-title h1,
  .calendar-title h2,
  .table-heading h2 {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .compact-button,
  .secondary-button,
  .add-row-button,
  button {
    min-height: 44px;
  }
}

/* ============================================================
   Mobile Optimierung: Tagesansicht
   ============================================================ */

@media (max-width: 760px) {
  .day-entry-hero {
    display: grid !important;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
  }

  .day-entry-title {
    min-width: 0;
    text-align: center;
  }

  .day-entry-title h1 {
    margin-bottom: 4px;
    word-break: normal;
  }

  .day-entry-hero .day-arrow {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .day-heading-left,
  .day-heading-right {
    width: 100%;
  }

  .day-heading-left {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .day-heading-right {
    text-align: left;
    font-size: 1.05rem;
  }

  .day-entry-table-wrap {
    overflow: visible !important;
  }

  .day-entry-table,
  .day-entry-table tbody,
  .day-entry-table tr,
  .day-entry-table td {
    display: block !important;
    width: 100% !important;
  }

  .day-entry-table thead {
    display: none !important;
  }

  .day-entry-table tr {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fff;
  }

  .day-entry-table td {
    border-bottom: 0;
    padding: 7px 0 !important;
  }

  .day-entry-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .day-entry-table input,
  .day-entry-table select {
    width: 100% !important;
    max-width: none !important;
    min-height: 44px;
    font-size: 16px;
  }

  .day-entry-table .drag-cell {
    display: flex !important;
    gap: 8px;
  }

  .day-entry-table .drag-cell::before,
  .day-entry-table .remove-cell::before {
    width: 100%;
  }

  .sort-button,
  .remove-row,
  .remove-absence {
    min-width: 44px;
    min-height: 44px;
  }

  .day-bottom-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .day-bottom-bar .add-row-button {
    width: 100%;
  }
}

/* ============================================================
   Mobile Optimierung: Monatsübersicht / Kalender
   ============================================================ */

@media (max-width: 760px) {
  .calendar-topbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .calendar-title {
  }

  .calendar-nav-left,
  .calendar-nav-right {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .calendar-weekdays,
  .calendar-grid {
  }

  .calendar-weekdays div {
  }

  .calendar-day {
  }

  .calendar-day-number {
  }

  .calendar-hours {
    font-size: 11px;
    line-height: 1.15;
  }

  .calendar-empty {
    font-size: 11px;
  }

  .calendar-holiday,
  .calendar-vacation {
  }

  .calendar-kpis {
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n),
  .calendar-kpi:last-child {
  }

  .calendar-note {
    font-size: 12px;
    line-height: 1.45;
  }
}

@media (max-width: 390px) {
  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr)) !important;
  }

  .calendar-day {
  }

  .calendar-hours,
  .calendar-empty {
    font-size: 10px;
  }

  .calendar-holiday,
  .calendar-vacation {
  }
}

/* ============================================================
   Mobile Optimierung: Alle Arbeitszeiteinträge im Monat
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-table,
  .month-entries-table tbody,
  .month-entries-table tr,
  .month-entries-table td {
    display: block !important;
    width: 100% !important;
  }

  .month-entries-table thead {
  }

  .month-entries-table tr.month-entry-row {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fff;
  }

  .month-entries-table tr.month-entry-group-gap {
  }

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

  .month-entries-table td {
    border-bottom: 0 !important;
    padding: 7px 0 !important;
  }

  .month-entries-table td:nth-child(1)::before {
    content: "Datum";
  }

  .month-entries-table td:nth-child(2)::before {
    content: "Projekt";
  }

  .month-entries-table td:nth-child(3)::before {
    content: "Leistungsphase / Bereich";
  }

  .month-entries-table td:nth-child(4)::before {
    content: "Stunden";
  }

  .month-entries-table td:nth-child(5)::before {
    content: "Notiz";
  }

  .month-entries-table td::before {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .month-entries-table input,
  .month-entries-table select,
  .month-entries-table .month-entry-hours {
    width: 100% !important;
    max-width: none !important;
  }

  .month-entry-add-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .month-entry-add-row button {
    width: 100%;
  }
}

/* ============================================================
   Mobile Optimierung: Benutzerverwaltung / Formulare
   ============================================================ */

@media (max-width: 760px) {
  .admin-user-card-header {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-user-edit-card,
  .admin-user-section,
  .admin-user-schedules,
  .admin-user-password-section {
    padding: 12px !important;
  }

  .admin-user-edit-form,
  .admin-user-field-grid,
  .admin-user-field-grid.compact-grid,
  .admin-user-password-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .admin-user-field-grid input,
  .admin-user-field-grid select,
  .admin-user-password-form input {
    width: 100% !important;
    max-width: none !important;
    min-height: 44px;
    font-size: 16px;
  }

  .admin-user-workdays-field .weekday-checkboxes {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-user-save-row,
  .admin-user-add-row {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .admin-user-save-row button,
  .admin-user-add-row button {
    width: 100%;
  }
}



/* ============================================================
   Mobile Feinschliff Navigation / Tag / Dashboard
   ============================================================ */

.mobile-nav-checkbox,
.mobile-nav-toggle {
  display: none;
}

.mobile-nav-toggle {
  cursor: pointer;
}

.mobile-nav-toggle span {
  display: block;
  width: 30px;
  height: 2px;
  margin: 5px 0;
  background: #1f1f1f;
  border-radius: 2px;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

@media (min-width: 761px) {
  .main-nav {
    display: flex !important;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    margin: 16px auto;
    padding: 0 8px 32px !important;
  }

  header.topbar,
  .topbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 18px !important;
    background: #ffffff !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border);
  }

  .topbar .brand,
  .brand {
    flex: 1 1 auto;
    color: var(--text) !important;
    text-align: left !important;
    font-size: 18px;
    line-height: 1.2;
    text-decoration: none;
  }

  .mobile-nav-toggle {
    display: flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-left: auto;
  }

  .mobile-nav-checkbox:not(:checked) ~ .main-nav {
    display: none !important;
  }

  .mobile-nav-checkbox:checked ~ .main-nav {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .main-nav > a,
  .main-nav > .nav-dropdown {
    width: 100%;
  }

  .main-nav a,
  .nav-dropdown > summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 12px;
    color: var(--text) !important;
    background: #f7f6f4;
    border: 1px solid var(--border);
    text-align: left;
    text-decoration: none;
  }

  .nav-dropdown {
  }

  .nav-dropdown > summary {
    color: var(--accent) !important;
    font-weight: 700;
  }

  .nav-dropdown-menu {
    margin-top: 8px;
    gap: 8px;
  }

  .nav-dropdown-menu a {
    background: #ffffff;
  }

  .card,
  .calendar-card,
  .month-entries-card,
  .work-day-card,
  .absence-day-card {
    padding: 12px !important;
    margin: 12px 0 !important;
  }

  /* Tagesansicht: Kopf kompakter */
  .day-table-heading {
    display: grid !important;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .day-heading-left {
    min-width: 0;
  }

  .day-heading-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }

  .day-heading-main h2 {
    margin: 0;
  }

  .day-total-inline {
    font-size: 1.3rem;
    line-height: 1;
    white-space: nowrap;
  }

  .day-heading-right {
    text-align: right;
  }

  .day-table-heading .compact-button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 6px 11px !important;
    font-size: 14px !important;
  }

  /* Monatsübersicht: Monat mit Pfeilen links/rechts */
  .calendar-topbar {
    display: grid !important;
    gap: 6px;
    align-items: center;
  }

  .calendar-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    order: 0 !important;
    text-align: center;
    min-width: 0;
  }

  .calendar-title h2 {
  }

  .calendar-nav-left {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .calendar-nav-right {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .calendar-nav-left,
  .calendar-nav-right,
  .calendar-nav {
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* Kalender muss vollständig in die Bildschirmbreite passen */
  .calendar-card {
    overflow: hidden !important;
    padding: 10px 5px 12px !important;
  }

  .calendar-weekdays,
  .calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .calendar-weekdays div {
    min-width: 0 !important;
    font-size: 10px !important;
    padding: 3px 0 !important;
    text-align: center;
  }

  .calendar-day {
    min-width: 0 !important;
    width: auto !important;
    padding: 4px 2px !important;
  }

  .calendar-day-number {
    font-size: 12px !important;
  }

  .calendar-hours,
  .calendar-empty {
    font-size: 10px !important;
    line-height: 1.1;
  }

  .calendar-holiday,
  .calendar-vacation {
    font-size: 9px !important;
    line-height: 1.05;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 390px) {
  .calendar-card {
    padding: 8px 3px 10px !important;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 2px !important;
  }

  .calendar-day {
    padding: 3px 2px !important;
  }

  .calendar-holiday,
  .calendar-vacation {
    display: none;
  }
}

/* ============================================================
   Mobile Feinschliff: Navigation ohne Rahmen, Verwaltung untereinander
   ============================================================ */

@media (max-width: 760px) {
  .mobile-nav-checkbox:checked ~ .main-nav {
    display: block !important;
    width: 100%;
    margin-top: 14px;
  }

  .main-nav {
    gap: 0 !important;
  }

  .main-nav > a,
  .main-nav > .nav-dropdown,
  .nav-dropdown > summary {
    width: 100% !important;
  }

  .main-nav a,
  .nav-dropdown > summary,
  .nav-dropdown-menu a {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--text) !important;
    min-height: 0 !important;
    padding: 10px 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
    font-weight: 650;
  }

  .main-nav a:hover,
  .nav-dropdown > summary:hover,
  .nav-dropdown-menu a:hover {
    background: transparent !important;
    text-decoration: underline;
  }

  .nav-dropdown {
    display: block !important;
    width: 100% !important;
  }

  .nav-dropdown > summary {
    display: flex !important;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
  }

  .nav-dropdown > summary::-webkit-details-marker {
    display: none;
  }

  .nav-dropdown-menu {
    position: static !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 0 0 0 18px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .nav-dropdown-menu a {
    display: block !important;
    width: 100% !important;
    padding: 8px 0 !important;
    color: var(--muted) !important;
    font-weight: 600;
  }

  .logout-link {
    margin-top: 4px;
  }
}


/* ============================================================
   Mobile Feinschliff: Kalender eckig und KPI-Raster kompakt
   ============================================================ */

@media (max-width: 760px) {
  /* Kalender-Tageskacheln wie Desktop: eckig statt rund */
  .calendar-day {
    border-radius: 0 !important;
  }

  .calendar-day:hover,
  .calendar-day.is-today,
  .calendar-day.is-weekend,
  .calendar-day.is-regular-offday,
  .calendar-day.is-holiday,
  .calendar-day.is-absence,
  .calendar-day.is-vacation {
    border-radius: 0 !important;
  }

  /* Werte unter dem Kalender wieder als 3x3 Raster */
  .calendar-kpis {
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n),
  .calendar-kpi:last-child {
    border-right: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .calendar-kpi span {
    letter-spacing: 0 !important;
    overflow-wrap: anywhere;
  }

  .calendar-kpi strong {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 390px) {
  .calendar-kpi {
    padding: 7px 4px !important;
  }

  .calendar-kpi span {
  }

  .calendar-kpi strong {
  }
}


/* ============================================================
   Mobile Feinschliff: Kalender kompakter, KPI-Gitter, Monatsliste als Tabelle
   ============================================================ */

@media (max-width: 760px) {
  /* Weniger Leerraum rund um Monatstitel */
  .dashboard-header {
    margin-bottom: 4px !important;
  }

  .calendar-card {
    margin-top: 6px !important;
    padding-top: 6px !important;
  }

  .calendar-topbar {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
  }

  .calendar-title h2 {
    margin: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
  }

  .month-today-link {
    display: inline-block;
    font-size: 11px !important;
    line-height: 1.1 !important;
  }

  .calendar-nav-left,
  .calendar-nav-right,
  .calendar-nav {
    min-width: 34px !important;
    min-height: 34px !important;
    height: 34px !important;
    font-size: 1.4rem !important;
  }

  /* Kalender ohne Zwischenabstände */
  .calendar-weekdays,
  .calendar-grid {
    gap: 0 !important;
  }

  .calendar-day {
    border-radius: 0 !important;
  }

  /* KPI-Raster wie Hashtag-Gitter: keine Außenumrandung */
  .calendar-kpis {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border: 0 !important;
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n),
  .calendar-kpi:last-child {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-width: 0 !important;
    width: auto !important;
    grid-column: auto !important;
  }

  .calendar-kpi:not(:nth-child(3n)) {
    border-right: 1px solid var(--border) !important;
  }

  .calendar-kpi:nth-child(-n+6) {
    border-bottom: 1px solid var(--border) !important;
  }

  .calendar-kpi span {
  }

  .calendar-kpi strong {
  }

  /* Monats-Einträge mobil wieder als kompakte Tabelle */
  .month-entries-card {
    overflow-x: hidden !important;
  }

  .month-entries-table {
  }

  .month-entries-table thead {
  }

  .month-entries-table tbody {
  }

  .month-entries-table tr,
  .month-entries-table tr.month-entry-row {
  }

  .month-entries-table th,
  .month-entries-table td {
  }

  .month-entries-table td::before {
  }

  .month-entries-table th {
  }

  .month-entries-table td {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
  }

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

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
  }

  .month-entries-table input,
  .month-entries-table select,
  .month-entries-table .month-entry-hours {
  }

  .month-entries-table .sort-link {
  }

  .month-entries-table .sort-chevron {
  }

  .month-entries-table tr.month-entry-group-gap {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .month-entries-table {
    font-size: 9px !important;
  }

  .month-entries-table th,
  .month-entries-table td {
  }

  .month-entries-table th {
  }

  .month-entries-table td {
    font-size: 9px !important;
  }

  .month-entries-table input,
  .month-entries-table select,
  .month-entries-table .month-entry-hours {
    font-size: 9px !important;
    padding: 3px 2px !important;
  }
}



/* ============================================================
   Mobile Feinschliff: Kalenderhöhe, KPI-Raster, Monatsliste
   ============================================================ */

@media (max-width: 760px) {
  /* Weniger Luft um den Monatsnamen */
  .calendar-topbar {
    margin-bottom: 4px !important;
  }

  .calendar-title {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .calendar-title h2 {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
  }

  .month-today-link {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Erste Kalenderzeile soll nicht höher als die anderen sein */
  .calendar-grid {
    grid-auto-rows: 60px !important;
  }

  .calendar-day {
    min-height: 60px !important;
    height: 60px !important;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
  }

  .calendar-day-head {
    margin-bottom: 2px !important;
  }

  .calendar-hours,
  .calendar-empty,
  .calendar-holiday,
  .calendar-vacation {
    margin-top: 0 !important;
  }

  /* KPI-Raster kompakter */
  .calendar-kpis {
    margin-top: 10px !important;
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n),
  .calendar-kpi:last-child {
    padding: 6px 6px 5px 6px !important;
    min-height: 54px !important;
    height: 54px !important;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
  }

  .calendar-kpi span {
    font-size: 8.5px !important;
    line-height: 1.1 !important;
    margin-bottom: 3px !important;
  }

  .calendar-kpi strong {
    font-size: 11px !important;
    line-height: 1.1 !important;
    margin-top: 0 !important;
  }

  /* Unerwünschte Linie unter der letzten Reihe entfernen */
  .calendar-kpi:nth-child(n+7) {
    border-bottom: 0 !important;
  }

  /* Monatsliste: Datum mobil nur TT */
  .month-entry-date-mobile {
    display: inline;
  }

  .month-entry-date-desktop {
    display: none;
  }

  /* Status "Bereit" kleiner unten rechts */
  .month-entries-card {
    position: relative;
    padding-bottom: 34px !important;
  }

  #month-entry-save-status {
    text-align: right;
  }

  /* Kopfbereich der Monatseinträge kompakter */
  .month-entries-card .table-heading {
    padding-right: 0 !important;
  }

  .month-entries-card .table-heading .compact-button {
    max-width: 140px;
  }
}

@media (min-width: 761px) {
  .month-entry-date-mobile {
    display: none;
  }

  .month-entry-date-desktop {
    display: inline;
  }
}

@media (max-width: 390px) {
  .calendar-grid {
    grid-auto-rows: 56px !important;
  }

  .calendar-day {
    min-height: 56px !important;
    height: 56px !important;
  }

  .calendar-kpi,
  .calendar-kpi:nth-child(2n),
  .calendar-kpi:nth-child(3n),
  .calendar-kpi:last-child {
    min-height: 50px !important;
    height: 50px !important;
    padding: 5px 4px !important;
  }

  .calendar-kpi span {
    font-size: 8px !important;
  }

  .calendar-kpi strong {
    font-size: 10.5px !important;
  }
}


/* ============================================================
   Mobile Feinschliff: Monatseinträge sauber und vollbreit
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-card,
  .month-entries-card.card {
    width: 100% !important;
    max-width: none !important;
    margin: 28px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .month-entries-card .table-heading,
  .month-entries-card .day-heading-left,
  .month-entries-card h2,
  .month-entries-card table,
  .month-entries-card .month-entries-table {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .month-entries-card .table-heading {
    position: relative !important;
    padding: 0 !important;
    margin: 0 0 14px 0 !important;
  }

  .month-entries-card .day-heading-left {
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
    align-items: center;
  }

  .month-entries-card h2 {
  }

  .month-entries-card .compact-button,
  .month-entries-card .secondary-button.compact-button {
  }

  #month-entry-save-status {
    right: 0 !important;
    bottom: 7px !important;
    opacity: 0.85;
  }

  .month-entry-date-desktop,
  .month-entry-category-label-desktop {
    display: none !important;
  }

  .month-entry-date-mobile,
  .month-entry-category-label-mobile,
  .month-entry-date-label-mobile {
    display: inline !important;
  }

  .month-entry-date-label-desktop {
    display: none !important;
  }

  .month-entries-table {
    display: table !important;
    width: 100% !important;
    max-width: none !important;
    font-size: 11px !important;
  }

  .month-entries-table thead {
    display: table-header-group !important;
  }

  .month-entries-table tbody {
    display: table-row-group !important;
  }

  .month-entries-table tr,
  .month-entries-table tr.month-entry-row {
    display: table-row !important;
    width: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .month-entries-table th,
  .month-entries-table td {
    display: table-cell !important;
    width: auto !important;
    border-bottom: 1px solid var(--border) !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .month-entries-table td::before {
    display: none !important;
    content: none !important;
  }

  .month-entries-table th {
    line-height: 1.1 !important;
  }

  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
  }

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

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
  }

  .month-entries-table .sort-link {
    font-size: 10px !important;
    line-height: 1.1 !important;
  }

  .month-entries-table .sort-chevron {
  }

  .month-entries-table input,
  .month-entries-table select,
  .month-entries-table .month-entry-hours {
    min-height: 30px !important;
    height: 30px !important;
    padding: 4px 3px !important;
    font-size: 10px !important;
    border-radius: 0 !important;
  }
}

@media (min-width: 761px) {
  .month-entry-date-mobile,
  .month-entry-date-label-mobile,
  .month-entry-category-label-mobile {
    display: none !important;
  }

  .month-entry-date-desktop,
  .month-entry-date-label-desktop,
  .month-entry-category-label-desktop {
    display: inline !important;
  }
}

@media (max-width: 390px) {
  .month-entries-card h2 {
  }

  .month-entries-table th,
  .month-entries-table td {
  }

  .month-entries-table th {
  }
}

/* ============================================================
   Mobile Korrektur: Monatseinträge exakt auf Inhaltsbreite ziehen
   ============================================================ */

@media (max-width: 760px) {
  /*
    Die Card selbst wird von älteren Regeln weiterhin zu schmal gehalten.
    Deshalb ziehen wir die sichtbaren Inhalte direkt auf Viewport-Breite
    und zentrieren sie wie den Erklärungstext darüber.
  */

  .month-entries-card {
    width: 100% !important;
    max-width: none !important;
    margin-top: 32px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .month-entries-card .table-heading,
  .month-entries-table {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 64px) !important;
    max-width: calc(100vw - 64px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .month-entries-card .table-heading {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: end !important;
    column-gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .month-entries-card .day-heading-left {
    display: contents !important;
  }

  .month-entries-card h2 {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    font-size: 1.42rem !important;
    line-height: 1.12 !important;
  }

  .month-entries-card .compact-button,
  .month-entries-card .secondary-button.compact-button {
    grid-column: 1 !important;
    width: auto !important;
    min-width: 82px !important;
    max-width: 104px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  #month-entry-save-status {
    grid-column: 3 !important;
    position: static !important;
    align-self: center !important;
    justify-self: end !important;
    font-size: 10px !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted) !important;
  }

  .month-entries-table {
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .month-entries-table th,
  .month-entries-table td {
    padding: 6px 5px !important;
    font-size: 11px !important;
    line-height: 1.16 !important;
    vertical-align: top !important;
  }

  .month-entries-table th {
    font-size: 10px !important;
  }

  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
  }

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

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
  }

  .month-entries-table .sort-chevron {
    margin-left: 1px !important;
    width: 7px !important;
    height: 7px !important;
  }
}

@media (max-width: 390px) {
  .month-entries-card .table-heading,
  .month-entries-table {
    width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;
  }

  .month-entries-card h2 {
    font-size: 1.32rem !important;
  }

  .month-entries-table th,
  .month-entries-table td {
    padding: 5px 4px !important;
    font-size: 10px !important;
  }

  .month-entries-table th {
    font-size: 9px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Monatseinträge-Tabelle breiter ziehen
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-card table.month-entries-table,
  table.month-entries-table {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;

    width: calc(100vw - 48px) !important;
    min-width: calc(100vw - 48px) !important;
    max-width: calc(100vw - 48px) !important;

    margin-left: calc(50% - 50vw + 24px) !important;
    margin-right: 0 !important;

    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .month-entries-table th,
  .month-entries-table td {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
    width: 8% !important;
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
  }

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

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
  }

  .month-entries-table th {
    white-space: nowrap !important;
  }

  .month-entries-table .sort-link {
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  .month-entries-card table.month-entries-table,
  table.month-entries-table {
    width: calc(100vw - 36px) !important;
    min-width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin-left: calc(50% - 50vw + 18px) !important;
  }

  .month-entries-table th,
  .month-entries-table td {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }
}


/* ============================================================
   Korrektur: Arbeitszeiten-Kopf Desktop und mobil
   ============================================================ */

/* Nur Arbeitszeiten-Karte, nicht Abwesenheiten */
.work-day-card .day-table-heading {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-rows: auto auto !important;
  column-gap: 16px !important;
  row-gap: 8px !important;
  align-items: start !important;
}

/* Verschachtelung auflösen, damit h2, Summe und Button sauber ins Grid können */
.work-day-card .day-heading-left,
.work-day-card .day-heading-main {
  display: contents !important;
}

.work-day-card .day-heading-main h2 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  margin: 0 !important;
}

.work-day-card .day-total-inline {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: start !important;
  margin: 0 !important;
  text-align: right !important;
  white-space: nowrap !important;
  font-size: 1.45rem !important;
  line-height: 1.1 !important;
}

.work-day-card .day-heading-right {
  grid-column: 1 !important;
  grid-row: 2 !important;
  justify-self: start !important;
  align-self: start !important;
  text-align: left !important;
  width: auto !important;
}

.work-day-card .day-heading-right .compact-button {
  width: auto !important;
  min-width: 96px !important;
  max-width: 130px !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 7px 12px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* Auf kleinen Bildschirmen genauso: Summe rechts oben */
@media (max-width: 760px) {
  .work-day-card .day-table-heading {
    grid-template-columns: 1fr auto !important;
    column-gap: 12px !important;
    row-gap: 8px !important;
  }

  .work-day-card .day-heading-main h2 {
    font-size: 1.35rem !important;
  }

  .work-day-card .day-total-inline {
    font-size: 1.35rem !important;
  }

  .work-day-card .day-heading-right .compact-button {
    min-width: 92px !important;
    max-width: 120px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 6px 11px !important;
    font-size: 13px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Monatseinträge im Bearbeiten-Modus als Karten
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-card[data-edit-mode="1"] table.month-entries-table,
  .month-entries-card[data-edit-mode="1"] .month-entries-table {
    position: static !important;
    left: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    table-layout: auto !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table thead {
    display: none !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table tbody {
    display: block !important;
    width: 100% !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table tr.month-entry-row {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 10px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: #fff !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td {
    display: block !important;
    width: 100% !important;
    padding: 6px 0 !important;
    border-bottom: 0 !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td::before {
    display: block !important;
    margin-bottom: 4px !important;
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:nth-child(1)::before {
    content: "Datum" !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:nth-child(2)::before {
    content: "Projekt" !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:nth-child(3)::before {
    content: "LPH / Bereich" !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:nth-child(4)::before {
    content: "Stunden" !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:nth-child(5)::before {
    content: "Notiz" !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table input,
  .month-entries-card[data-edit-mode="1"] .month-entries-table select,
  .month-entries-card[data-edit-mode="1"] .month-entries-table .month-entry-hours {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 7px 9px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    border-radius: 0 !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entry-add-row {
    width: 100% !important;
    margin-top: 14px !important;
  }

  .month-entries-card[data-edit-mode="1"] #add-month-entry-row {
    width: 100% !important;
    min-height: 44px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Datumsfeld in Monatseinträge-Bearbeitung
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-card[data-edit-mode="1"] .month-entry-date {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 7px 9px !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    text-align: left !important;
    border-radius: 0 !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
  }

  .month-entries-card[data-edit-mode="1"] .month-entries-table td:first-child {
    overflow: hidden !important;
  }
}


/* ============================================================
   Mobile Korrektur: Sortierpfeil bei Tag überlappt Projekt nicht
   ============================================================ */

@media (max-width: 760px) {
  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
    width: 12% !important;
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
    width: 31% !important;
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
    width: 25% !important;
  }

  .month-entries-table th:nth-child(4),
  .month-entries-table td:nth-child(4) {
    width: 16% !important;
  }

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
    width: 16% !important;
  }

  .month-entries-table th:nth-child(1) .sort-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding-right: 6px !important;
    white-space: nowrap !important;
  }

  .month-entries-table th:nth-child(1) .sort-chevron {
    flex: 0 0 auto !important;
    margin-left: 2px !important;
    margin-right: 0 !important;
    position: static !important;
    transform-origin: center !important;
  }
}

@media (max-width: 390px) {
  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
    width: 13% !important;
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
    width: 30% !important;
  }
}


/* ============================================================
   Mobile Test: Tagesansicht kompakter nebeneinander
   ============================================================ */

@media (max-width: 760px) {
  /* Nur Arbeitszeiten, nicht Abwesenheiten */
  .work-day-card .day-entry-table,
  .work-day-card .day-entry-table tbody,
  .work-day-card .day-entry-table tr,
  .work-day-card .day-entry-table td {
    display: block !important;
  }

  .work-day-card .day-entry-table thead {
    display: none !important;
  }

  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
    margin-bottom: 10px !important;
  }

  .work-day-card .day-entry-table td {
    width: auto !important;
  }

  .work-day-card .day-entry-table td::before {
  }

  .work-day-card .project-cell {
  }

  .work-day-card .category-cell {
  }

  .work-day-card .hours-cell {
  }

  .work-day-card .note-cell {
  }

  .work-day-card .day-entry-table input,
  .work-day-card .day-entry-table select {
  }

  .work-day-card .day-entry-table .row-project,
  .work-day-card .day-entry-table .row-category,
  .work-day-card .day-entry-table .day-static-value {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .work-day-card .day-entry-table .row-hours,
  .work-day-card .day-entry-table .day-hours-input {
    text-align: right !important;
  }

  .work-day-card .note-cell input {
  }

  .work-day-card .day-bottom-bar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .work-day-card .day-bottom-bar .add-row-button {
    width: 100% !important;
    min-height: 42px !important;
  }

  .work-day-card #autosave-status {
    font-size: 11px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
  }

  .work-day-card .day-entry-table td::before {
    font-size: 9.5px !important;
  }

  .work-day-card .day-entry-table input,
  .work-day-card .day-entry-table select {
  }
}


/* ============================================================
   Mobile Korrektur: Tagesansicht ohne Rahmen und ohne horizontales Scrollen
   ============================================================ */

@media (max-width: 760px) {
  /* Tageskarten ohne äußeren Rahmen, damit mehr Breite bleibt */
  .work-day-card,
  .absence-day-card {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 18px 0 26px 0 !important;
    overflow: visible !important;
  }

  .work-day-card .day-entry-form,
  .absence-day-card .absence-day-form {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .work-day-card .day-entry-table-wrap,
  .absence-day-card .day-entry-table-wrap {
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
  }

  .work-day-card .day-entry-table,
  .absence-day-card .day-entry-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Arbeitszeiten: kompakte Eingabe ohne Seitenscrollen */
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 82px !important;
    gap: 7px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 9px !important;
    margin: 0 0 10px 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  .work-day-card .day-entry-table td {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .work-day-card .project-cell {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .work-day-card .category-cell {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .work-day-card .hours-cell {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
  }

  .work-day-card .note-cell {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
  }

  .work-day-card .day-entry-table td::before {
    display: block !important;
    margin-bottom: 3px !important;
    color: var(--muted) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  .work-day-card .day-entry-table input,
  .work-day-card .day-entry-table select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 6px 7px !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  .work-day-card .row-project,
  .work-day-card .row-category,
  .work-day-card .day-static-value {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .work-day-card .hours-cell input,
  .work-day-card .row-hours,
  .work-day-card .day-hours-input {
  }

  .work-day-card .hours-cell {
  }

  .work-day-card .hours-cell input {
    height: calc(100% - 14px) !important;
    min-height: 74px !important;
    font-weight: 700 !important;
  }

  .work-day-card .note-cell input {
    height: 34px !important;
  }

  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
  }

  .work-day-card .day-bottom-bar .add-row-button,
  .absence-day-card .day-bottom-bar .add-row-button {
    min-height: 42px !important;
  }

  .work-day-card #autosave-status,
  .absence-day-card #absence-autosave-status {
    font-size: 11px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted) !important;
  }

  /* Abwesenheiten ebenfalls ohne seitliches Überlaufen */
  .absence-day-card .day-entry-table tr {
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
    gap: 6px !important;
    padding: 8px !important;
  }

  .work-day-card .day-entry-table input,
  .work-day-card .day-entry-table select {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .work-day-card .hours-cell input {
    min-height: 72px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Tagesansicht volle nutzbare Breite
   ============================================================ */

@media (max-width: 760px) {
  /* Tagesansicht breiter ziehen */
  .work-day-card,
  .absence-day-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: calc(50% - 50vw + 12px) !important;
    margin-right: calc(50% - 50vw + 12px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .work-day-card .day-entry-form,
  .absence-day-card .absence-day-form,
  .work-day-card .day-table-heading,
  .absence-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .absence-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Inhalt etwas näher an den Rand, aber nicht direkt kleben */
  .work-day-card .day-table-heading,
  .absence-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .absence-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
  }

  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new,
  .absence-day-card .day-entry-table tr {
  }

  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
  }
}

@media (max-width: 390px) {
  .work-day-card,
  .absence-day-card {
  }

  .work-day-card .day-table-heading,
  .absence-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .absence-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Tageskopf ohne horizontales Scrollen, Stunden zentriert
   ============================================================ */

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .container {
    overflow-x: hidden !important;
  }

  /* Datum mit Pfeilen darf nie breiter als der Bildschirm werden */
  .day-entry-hero {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: grid !important;
    gap: 6px !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  .day-entry-title {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  .day-entry-title h1 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(1.35rem, 5.4vw, 1.75rem) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .day-today-link {
    display: inline-block !important;
    max-width: 100% !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  .day-entry-hero .day-arrow {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  /* Tageskarten nicht über den Viewport hinausschieben */
  .work-day-card,
  .absence-day-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Stundenfeld: Zahl mittig im Feld */
  .work-day-card .hours-cell {
  }

  .work-day-card .hours-cell input,
  .work-day-card .row-hours,
  .work-day-card .day-hours-input {
    height: 100% !important;
    min-height: 76px !important;
    padding: 0 6px !important;
    text-align: center !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: normal !important;
  }

  .work-day-card .hours-cell input::placeholder {
  }
}

@media (max-width: 390px) {
  .day-entry-hero {
    gap: 4px !important;
  }

  .day-entry-hero .day-arrow {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
  }

  .day-entry-title h1 {
    font-size: clamp(1.2rem, 5.1vw, 1.55rem) !important;
  }
}


/* ============================================================
   Mobile Korrektur: Tagesansicht linke Felder breiter, Stunden mittig
   ============================================================ */

@media (max-width: 760px) {
  /* Linke Spalte breiter, Stundenfeld schmaler */
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
    grid-template-columns: minmax(0, 1fr) 96px !important;
    gap: 7px 8px !important;
  }

  /* Linke Felder wirklich volle Breite innerhalb der linken Spalte */
  .work-day-card .project-cell,
  .work-day-card .category-cell,
  .work-day-card .note-cell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .work-day-card .project-cell select,
  .work-day-card .category-cell select,
  .work-day-card .project-cell input,
  .work-day-card .category-cell input,
  .work-day-card .note-cell input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Stundenfeld sauber mittig */
  .work-day-card .hours-cell {
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    align-self: stretch !important;
  }

  .work-day-card .hours-cell input,
  .work-day-card .hours-cell .day-hours-input,
  .work-day-card .hours-cell .row-hours {
    width: 100% !important;
    box-sizing: border-box !important;
    text-indent: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums !important;
    appearance: textfield !important;
    -webkit-appearance: none !important;
  }

  .work-day-card .hours-cell input::placeholder {
    opacity: 1 !important;
  }

  /* Safari-Spinbuttons weg */
  .work-day-card .hours-cell input::-webkit-outer-spin-button,
  .work-day-card .hours-cell input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new {
    grid-template-columns: minmax(0, 1fr) 88px !important;
  }

  .work-day-card .hours-cell input,
  .work-day-card .hours-cell .day-hours-input,
  .work-day-card .hours-cell .row-hours {
    min-height: 74px !important;
    font-size: 17px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Tages-Eintragskarten bis fast zur Pfeilbreite
   ============================================================ */

@media (max-width: 760px) {
  /* Arbeitszeiten / Abwesenheiten selbst breiter ziehen */
  .work-day-card,
  .absence-day-card {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    margin-left: calc(50% - 50vw + 16px) !important;
    margin-right: calc(50% - 50vw + 16px) !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Kopf + Inhalte auf volle Breite */
  .work-day-card .day-table-heading,
  .absence-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .absence-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* DIESE Karten meintest du: die weißen Eingabeblöcke */
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new,
  .absence-day-card .day-entry-table tr {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Notiz darf volle Breite nutzen */
  .work-day-card .note-cell,
  .work-day-card .note-cell input {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Buttonzeile ebenfalls breit */
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
    width: 100% !important;
  }

  .work-day-card .day-bottom-bar .add-row-button,
  .absence-day-card .day-bottom-bar .add-row-button {
    width: 100% !important;
  }
}

@media (max-width: 390px) {
  .work-day-card,
  .absence-day-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: calc(50% - 50vw + 12px) !important;
    margin-right: calc(50% - 50vw + 12px) !important;
  }
}



/* ============================================================
   Mobile Korrektur: Stundenfeld Rahmen und Zwei-Komma-Darstellung
   ============================================================ */

@media (max-width: 760px) {
  .work-day-card .hours-cell input,
  .work-day-card .hours-cell .day-hours-input,
  .work-day-card .hours-cell .row-hours {
    border: 1px solid var(--border) !important;
    box-shadow: inset 0 0 0 1px var(--border) !important;
    outline: 0 !important;
    text-align: center !important;
    text-indent: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  .work-day-card .hours-cell input::placeholder {
    text-align: center !important;
  }

  .work-day-card .hours-cell {
    overflow: visible !important;
  }
}


/* ============================================================
   Mobile Korrektur: Stundenfeld-Rahmen über Zelle zeichnen
   ============================================================ */

@media (max-width: 760px) {
  .work-day-card .hours-cell {
    position: relative !important;
    overflow: visible !important;
  }

  .work-day-card .hours-cell::after {
    content: "" !important;
    position: absolute !important;
    pointer-events: none !important;
    z-index: 2 !important;
  }

  .work-day-card .hours-cell input,
  .work-day-card .hours-cell .day-hours-input,
  .work-day-card .hours-cell .row-hours {
    position: relative !important;
    z-index: 1 !important;
    outline: 0 !important;
    padding: 0 !important;
  }

  .work-day-card .hours-cell input:focus,
  .work-day-card .hours-cell .day-hours-input:focus,
  .work-day-card .hours-cell .row-hours:focus {
    outline: 2px solid rgba(0,0,0,0.18) !important;
    outline-offset: -2px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Stundenrahmen oben bündig mit Projektfeld
   ============================================================ */

@media (max-width: 760px) {
  .work-day-card .hours-cell {
    position: relative !important;
    overflow: visible !important;
  }

  /* Rahmen des Stundenfelds exakt unterhalb des Labels starten lassen */
  .work-day-card .hours-cell::after {
    top: 19px !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border: 1px solid var(--border) !important;
    box-sizing: border-box !important;
  }

  .work-day-card .hours-cell input,
  .work-day-card .hours-cell .day-hours-input,
  .work-day-card .hours-cell .row-hours {
    margin-top: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 100% !important;
    min-height: 78px !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .hours-cell::after {
  }
}


/* ============================================================
   Mobile Korrektur: Stundenrahmen minimal höher ausrichten
   ============================================================ */

@media (max-width: 760px) {
  .work-day-card .hours-cell::after {
    top: 15px !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .hours-cell::after {
    top: 15px !important;
  }
}


/* ============================================================
   Mobile Feinschliff: Abwesenheiten in Tagesansicht
   ============================================================ */

@media (max-width: 760px) {
  /* Abwesenheiten optisch wie Arbeitszeiten, aber ruhiger */
  .absence-day-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 34px 0 28px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .absence-day-card .absence-day-form {
    width: 100% !important;
    max-width: none !important;
  }

  .absence-day-card .day-table-heading {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
    align-items: start !important;
    padding: 0 !important;
    margin: 0 0 14px 0 !important;
  }

  .absence-day-card .day-heading-left {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: auto !important;
  }

  .absence-day-card h2 {
    margin: 0 !important;
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
  }

  .absence-day-card .compact-button {
    width: auto !important;
    min-width: 96px !important;
    max-width: 128px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 6px 11px !important;
    font-size: 13px !important;
    line-height: 1 !important;
  }

  .absence-day-card .day-entry-table-wrap {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .absence-day-card .absence-day-table,
  .absence-day-card .absence-day-table tbody {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
  }

  .absence-day-card .absence-day-table thead {
    display: none !important;
  }

  /* Leerer Zustand ohne riesige Tabellenoptik */
  .absence-day-card #empty-absence-message {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 14px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: #fff !important;
  }

  .absence-day-card #empty-absence-message td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
  }

  /* Eingetragene / neue Abwesenheiten als Karten */
  .absence-day-card .absence-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 10px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  .absence-day-card .absence-row td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .absence-day-card .absence-row td::before {
    display: block !important;
    margin-bottom: 4px !important;
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  .absence-day-card .absence-row td:nth-child(1) {
    grid-column: 1 / -1 !important;
  }

  .absence-day-card .absence-row td:nth-child(2) {
    grid-column: 1 !important;
  }

  .absence-day-card .absence-row td:nth-child(3) {
    grid-column: 2 !important;
  }

  .absence-day-card .absence-row td:nth-child(4) {
    grid-column: 1 / -1 !important;
  }

  .absence-day-card .absence-row .remove-cell {
    grid-column: 1 / -1 !important;
    text-align: right !important;
  }

  .absence-day-card .absence-row input,
  .absence-day-card .absence-row select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  .absence-day-card .day-static-value {
    display: block !important;
    width: 100% !important;
    padding: 8px 0 !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  .absence-day-card .day-bottom-bar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding: 0 !important;
  }

  .absence-day-card #add-absence-row {
    width: 100% !important;
    min-height: 42px !important;
  }

  .absence-day-card #absence-autosave-status {
    font-size: 11px !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--muted) !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  .absence-day-card .absence-row {
    gap: 7px !important;
    padding: 9px !important;
  }

  .absence-day-card .absence-row input,
  .absence-day-card .absence-row select {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}


/* ============================================================
   Mobile Korrektur: Arbeitszeiten und Abwesenheiten gleiche Flucht
   ============================================================ */

@media (max-width: 760px) {
  /* Gemeinsame Breite für Tages-Inhalte */
  .work-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-table-heading,
  .absence-day-card .day-entry-table-wrap,
  .absence-day-card .day-bottom-bar {
    width: calc(100vw - 96px) !important;
    max-width: calc(100vw - 96px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Grauer Hinweisbereich soll nicht die optische Flucht sprengen */
  .work-day-card.has-day-notice,
  .work-day-card.has-day-absence {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  .work-day-card.has-day-notice .day-table-heading,
  .work-day-card.has-day-notice .day-entry-table-wrap,
  .work-day-card.has-day-notice .day-bottom-bar,
  .work-day-card.has-day-absence .day-table-heading,
  .work-day-card.has-day-absence .day-entry-table-wrap,
  .work-day-card.has-day-absence .day-bottom-bar {
    width: calc(100vw - 96px) !important;
    max-width: calc(100vw - 96px) !important;
  }

  /* Die eigentlichen Karten und Tabellen immer volle gemeinsame Breite */
  .work-day-card .day-entry-table tr.day-entry-row,
  .work-day-card .day-entry-table tr.day-entry-row-new,
  .absence-day-card .absence-row,
  .absence-day-card #empty-absence-message {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Buttons links gleich breit und Status rechts bündig */
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-bottom-bar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .work-day-card .add-row-button,
  .absence-day-card .add-row-button {
    width: 100% !important;
  }

  .work-day-card #autosave-status,
  .absence-day-card #absence-autosave-status {
    justify-self: end !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  .work-day-card .day-table-heading,
  .work-day-card .day-entry-table-wrap,
  .work-day-card .day-bottom-bar,
  .absence-day-card .day-table-heading,
  .absence-day-card .day-entry-table-wrap,
  .absence-day-card .day-bottom-bar,
  .work-day-card.has-day-notice .day-table-heading,
  .work-day-card.has-day-notice .day-entry-table-wrap,
  .work-day-card.has-day-notice .day-bottom-bar,
  .work-day-card.has-day-absence .day-table-heading,
  .work-day-card.has-day-absence .day-entry-table-wrap,
  .work-day-card.has-day-absence .day-bottom-bar {
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }
}


/* ============================================================
   Mobile Korrektur: Tageskarten Arbeitszeiten/Abwesenheiten bündig
   ============================================================ */

@media (max-width: 760px) {
  :root {
    --mobile-day-content-width: calc(100vw - 112px);
  }

  /* Überschriftenbereiche gleich breit und gleich zentriert */
  body .container .work-day-card .day-table-heading,
  body .container .absence-day-card .day-table-heading {
    width: var(--mobile-day-content-width) !important;
    max-width: var(--mobile-day-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Tabellen-/Kartenbereiche gleich breit und gleich zentriert */
  body .container .work-day-card .day-entry-table-wrap,
  body .container .absence-day-card .day-entry-table-wrap {
    width: var(--mobile-day-content-width) !important;
    max-width: var(--mobile-day-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
  }

  /* Die sichtbaren weißen Karten selbst bündig setzen */
  body .container .work-day-card .day-entry-table tr.day-entry-row,
  body .container .work-day-card .day-entry-table tr.day-entry-row-new,
  body .container .absence-day-card .absence-row,
  body .container .absence-day-card #empty-absence-message {
    width: var(--mobile-day-content-width) !important;
    max-width: var(--mobile-day-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Buttonzeilen ebenfalls gleiche Flucht */
  body .container .work-day-card .day-bottom-bar,
  body .container .absence-day-card .day-bottom-bar {
    width: var(--mobile-day-content-width) !important;
    max-width: var(--mobile-day-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    align-items: center !important;
  }

  body .container .work-day-card .add-row-button,
  body .container .absence-day-card .add-row-button {
    width: 100% !important;
  }

  body .container .work-day-card #autosave-status,
  body .container .absence-day-card #absence-autosave-status {
    justify-self: end !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  /* Der graue Hinweisblock bleibt breit, aber sein Inhalt folgt derselben Flucht */
  body .container .work-day-card.has-day-notice,
  body .container .work-day-card.has-day-absence {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }
}

@media (max-width: 390px) {
  :root {
    --mobile-day-content-width: calc(100vw - 88px);
  }
}



/* ============================================================
   Desktop/Mobile Korrektur: Monatsnavigation und Tagesdatum
   ============================================================ */

/* Desktop: Monatsnavigation mit Text */
.calendar-nav {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35em !important;
}

.calendar-nav-label {
  display: inline !important;
}

.calendar-nav-arrow {
  display: inline !important;
}

/* Desktop: Tagesdatum sauber mittig zwischen Pfeilen */
.day-entry-hero {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) 64px !important;
  align-items: center !important;
  width: 100% !important;
}

.day-entry-hero .day-arrow:first-child {
  grid-column: 1 !important;
  justify-self: start !important;
}

.day-entry-title {
  grid-column: 2 !important;
  justify-self: center !important;
  text-align: center !important;
  min-width: 0 !important;
}

.day-entry-hero .day-arrow:last-child {
  grid-column: 3 !important;
  justify-self: end !important;
}

/* Mobil: Monatsnavigation nur als Pfeile */
@media (max-width: 760px) {
  .calendar-nav-label {
    display: none !important;
  }

  .calendar-nav {
    gap: 0 !important;
  }

  .calendar-nav-arrow {
    display: inline !important;
  }

  .day-entry-hero {
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
  }
}

@media (max-width: 390px) {
  .day-entry-hero {
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
  }
}



/* ============================================================
   Seitenabschluss mit agsta Backdrop
   ============================================================ */

.site-endcap {
  width: 100%;
  margin-top: 72px;
}

.site-endcap-image {
  width: 100%;
  height: 360px;
  background-color: #918a82;
  background-image: url("/static/img/agsta-backdrop.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

@media (max-width: 1024px) {
  .site-endcap {
    margin-top: 56px;
  }

  .site-endcap-image {
    height: 280px;
  }
}

@media (max-width: 760px) {
  .site-endcap {
    margin-top: 44px;
  }

  .site-endcap-image {
    height: 190px;
  }
}

@media (max-width: 390px) {
  .site-endcap-image {
    height: 165px;
  }
}

/* ============================================================
   Easter Egg: versteckte Footer-Meldung
   ============================================================ */

.easter-egg-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  color: #111;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.easter-egg-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.easter-egg-spark {
  font-size: 16px;
  line-height: 1;
}

.site-endcap.easter-egg-pulse .site-endcap-image,
[data-easter-target="site-endcap-easter"].easter-egg-pulse .site-endcap-image {
  animation: agsta-easter-pulse 700ms ease-out;
}

@keyframes agsta-easter-pulse {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }

  35% {
    filter: brightness(1.08) contrast(1.02);
    transform: scale(1.002);
  }

  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .easter-egg-toast {
    right: 16px;
    bottom: 18px;
    left: 16px;
    justify-content: center;
    text-align: center;
  }
}



/* Projektverwaltung: projektbezogene Leistungsphasen */
.project-category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  max-width: 680px;
}

.project-category-check {
  white-space: nowrap;
  font-size: 0.9rem;
}

.project-category-cell {
  min-width: 360px;
}


/* Projektverwaltung: übersichtliche Projektkarten */
.project-admin-list {
  display: grid;
  gap: 1rem;
}

.project-admin-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.project-admin-card.is-inactive {
  opacity: 0.62;
}

.project-admin-form {
  display: grid;
  gap: 1rem;
}

.project-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.project-admin-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.project-admin-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.project-active-check {
  white-space: nowrap;
  margin-top: 0.1rem;
}

.project-admin-fields {
  display: grid;
  grid-template-columns: minmax(90px, 0.6fr) minmax(220px, 1.4fr) minmax(220px, 1.1fr);
  gap: 0.75rem;
}

.project-admin-fields label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--muted);
}

.project-phase-groups {
  display: grid;
  gap: 0.85rem;
}

.project-phase-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
}

.project-phase-group h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.project-category-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.45rem 0.9rem;
}

.project-category-checks.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.project-category-check {
  align-items: flex-start;
  line-height: 1.25;
}

.project-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.project-readonly-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

@media (max-width: 760px) {
  .project-admin-head,
  .project-admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .project-admin-fields {
    grid-template-columns: 1fr;
  }

  .project-category-checks,
  .project-category-checks.compact {
    grid-template-columns: 1fr;
  }
}


.project-default-phase {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
}

.project-default-phase label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--muted);
}

.project-default-phase p {
  margin: 0.45rem 0 0;
}


/* Mobile Kurzbezeichnungen für Leistungsphasen */
.phase-label-short {
  display: none;
}

@media (max-width: 760px) {
  .phase-label-full {
    display: none;
  }

  .phase-label-short {
    display: inline;
  }
}


/* Export-Seite */
.export-card {
  max-width: 760px;
}

.export-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.export-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--muted);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 760px) {
  .export-actions {
    flex-direction: column;
  }

  .export-actions button,
  .export-actions .secondary-button {
    width: 100%;
  }
}


.export-date-selects {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 0.75rem;
}

@media (max-width: 760px) {
  .export-date-selects {
    grid-template-columns: 1fr;
  }
}


/* Sonderstunden-Häkchen */
.special-hours-column {
  width: 7.5rem;
  text-align: center;
}

.special-hours-cell {
  text-align: center;
  vertical-align: middle;
}

.special-hours-checkbox {
  width: 18px;
  height: 18px;
  margin: 0 auto;
  display: inline-block;
  vertical-align: middle;
  accent-color: var(--text);
}

.special-hours-label-short {
  display: none;
}

.entry-hours-special-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 760px) {
  .special-hours-label-full {
    display: none;
  }

  .special-hours-label-short {
    display: inline;
  }

  .special-hours-column {
    width: auto;
  }
}


/* Sonderstunden Layout-Korrektur */
.entry-hours-special-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  gap: 0.75rem;
  align-items: end;
}

.entry-hours-special-head label {
  margin: 0;
}

.entry-hours-special-row {
  grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.entry-hours-special-row .special-hours-checkbox {
  justify-self: start;
  align-self: center;
}

/* Tagesansicht: Sonderstd. schmal, Notiz breiter */
.work-day-card .day-entry-table {
  width: 100%;
  table-layout: fixed;
}

.work-day-card .day-entry-table .project-column {
  width: 31%;
}

.work-day-card .day-entry-table .category-column {
  width: 27%;
}

.work-day-card .day-entry-table .hours-column {
  width: 9%;
}

.work-day-card .day-entry-table .special-hours-column {
  width: 7.5%;
  min-width: 6.25rem;
  text-align: center;
  white-space: nowrap;
}

.work-day-card .day-entry-table .note-column {
  width: 25.5%;
}

.work-day-card .special-hours-cell {
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.work-day-card .note-cell input,
.work-day-card .day-note-input {
  width: 100%;
}

/* Monatsansicht: keine horizontale Scrollleiste, Notiz wieder nutzbar */
.month-entries-card {
  overflow-x: visible;
}

.month-entries-table {
  width: 100%;
  table-layout: fixed;
}

.month-entries-table th,
.month-entries-table td {
  overflow-wrap: anywhere;
}

.month-entries-table th:nth-child(1),
.month-entries-table td:nth-child(1) {
  width: 11%;
}

.month-entries-table th:nth-child(2),
.month-entries-table td:nth-child(2) {
  width: 24%;
}

.month-entries-table th:nth-child(3),
.month-entries-table td:nth-child(3) {
  width: 22%;
}

.month-entries-table th:nth-child(4),
.month-entries-table td:nth-child(4) {
  width: 8%;
}

.month-entries-table th:nth-child(5),
.month-entries-table td:nth-child(5) {
  width: 8%;
  text-align: center;
  white-space: nowrap;
}

.month-entries-table th:nth-child(6),
.month-entries-table td:nth-child(6) {
  width: 27%;
}

.month-entries-table .month-entry-note {
  width: 100%;
}

.month-entries-table .special-hours-checkbox {
  margin-left: auto;
  margin-right: auto;
}

/* bestehende breite Sonderstunden-Regel hier bewusst übersteuern */
.special-hours-column {
  text-align: center;
}

.special-hours-checkbox {
  width: 18px;
  height: 18px;
}

@media (max-width: 760px) {
  .entry-hours-special-head,
  .entry-hours-special-row {
    grid-template-columns: minmax(0, 1fr) 6.75rem;
  }

  .month-entries-table {
    table-layout: auto;
  }

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
    width: auto;
  }
}


/* Sonderstunden Layout Feinschliff nach Praxistest */

/* Tageskopf darf niemals horizontal scrollen */
.day-entry-hero {
  max-width: 100%;
  overflow-x: hidden;
}

.day-entry-title {
  min-width: 0;
}

.day-entry-title h1 {
  max-width: calc(100vw - 8rem);
  overflow-wrap: anywhere;
}

.day-arrow {
  flex: 0 0 auto;
}

/* Tagesansicht Desktop: Spalten sauberer aufteilen */
.work-day-card .day-entry-table-wrap {
  max-width: 100%;
  overflow-x: visible;
}

.work-day-card .day-entry-table {
  width: 100%;
  table-layout: fixed;
}

.work-day-card .day-entry-table .project-column {
  width: 32%;
}

.work-day-card .day-entry-table .category-column {
  width: 27%;
}

.work-day-card .day-entry-table .hours-column {
  width: 9%;
}

.work-day-card .day-entry-table .special-hours-column {
  width: 8%;
  min-width: 5.5rem;
  text-align: center;
  white-space: nowrap;
}

.work-day-card .day-entry-table .note-column {
  width: 24%;
}

.work-day-card .special-hours-cell {
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.work-day-card .note-cell {
  padding-left: 0.75rem;
}

.work-day-card .note-cell input,
.work-day-card .day-note-input {
  width: 100%;
}

/* Monatsansicht Desktop: kein horizontaler Scroll, aber saubere Abstände */
.month-entries-card {
  overflow-x: hidden;
}

.month-entries-table {
  width: 100%;
  table-layout: fixed;
}

.month-entries-table th:nth-child(1),
.month-entries-table td:nth-child(1) {
  width: 11%;
}

.month-entries-table th:nth-child(2),
.month-entries-table td:nth-child(2) {
  width: 24%;
}

.month-entries-table th:nth-child(3),
.month-entries-table td:nth-child(3) {
  width: 22%;
}

.month-entries-table th:nth-child(4),
.month-entries-table td:nth-child(4) {
  width: 8%;
}

.month-entries-table th:nth-child(5),
.month-entries-table td:nth-child(5) {
  width: 10%;
  text-align: right;
  white-space: nowrap;
  padding-right: 1.25rem;
}

.month-entries-table th:nth-child(6),
.month-entries-table td:nth-child(6) {
  width: 25%;
  padding-left: 1rem;
}

.month-entries-table .month-entry-note {
  width: 100%;
}

.month-entries-table .special-hours-checkbox {
  margin-left: auto;
  margin-right: 0;
}

/* Mobil: Monatsliste darf horizontal scrollen, damit Notiz erreichbar bleibt */
@media (max-width: 760px) {
  .month-entries-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .month-entries-table {
    min-width: 760px;
    table-layout: fixed;
  }

  .month-entries-table th:nth-child(1),
  .month-entries-table td:nth-child(1) {
    width: 12%;
  }

  .month-entries-table th:nth-child(2),
  .month-entries-table td:nth-child(2) {
    width: 25%;
  }

  .month-entries-table th:nth-child(3),
  .month-entries-table td:nth-child(3) {
    width: 20%;
  }

  .month-entries-table th:nth-child(4),
  .month-entries-table td:nth-child(4) {
    width: 13%;
  }

  .month-entries-table th:nth-child(5),
  .month-entries-table td:nth-child(5) {
    width: 14%;
    text-align: center;
    padding-right: 0.5rem;
  }

  .month-entries-table th:nth-child(6),
  .month-entries-table td:nth-child(6) {
    width: 16%;
    padding-left: 0.75rem;
  }

  .work-day-card .day-entry-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .work-day-card .day-entry-table {
    min-width: 760px;
  }
}
