body {
  background: #f4f6f9;
  padding-bottom: env(safe-area-inset-bottom);
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: .2px;
}

.week-table .day-row td {
  background: #eef2f7;
  border-top: 2px solid #d7dee8;
  padding-top: .55rem;
  padding-bottom: .55rem;
}

.week-table .day-today td {
  background: #e3edfb;
}

.week-table .empty-row td {
  font-style: italic;
  padding-top: .3rem;
  padding-bottom: .3rem;
}

.week-table .desc-cell {
  max-width: 28rem;
}

.week-table td form {
  margin: 0;
}

.week-table .btn-sm {
  padding: .15rem .4rem;
}

.copy-row .form-label {
  color: #6c757d;
}

/* ---------- Mobil: Tabelle wird zu Karten ---------- */
@media (max-width: 767.98px) {
  main.container-xl {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  .week-table thead {
    display: none;
  }

  .week-table,
  .week-table tbody,
  .week-table tfoot,
  .week-table tr,
  .week-table td,
  .week-table th {
    display: block;
    width: 100%;
  }

  .week-table tr.day-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: #eef2f7;
    border-top: 2px solid #d7dee8;
  }

  .week-table tr.day-today {
    background: #e3edfb;
  }

  .week-table tr.day-row td {
    border-top: 0;
  }

  .toolbar .ms-auto .btn {
    flex: 0 0 auto;
  }

  .toolbar .ms-auto .btn-primary {
    flex: 1 1 auto;
    white-space: nowrap;
  }

  .week-table tr.day-row td {
    display: inline-block;
    width: auto;
    border: 0;
    padding: .5rem .75rem;
  }

  .week-table tr.day-row td:first-child {
    flex: 1;
  }

  .week-table tr.day-row td.c-daytotal {
    white-space: nowrap;
  }

  .week-table tr.entry-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .1rem .75rem;
    padding: .55rem .75rem;
    border-bottom: 1px solid #dee2e6;
  }

  .week-table tr.entry-row td {
    border: 0;
    padding: 0;
    max-width: none !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .week-table tr.entry-row td.c-time {
    font-weight: 600;
    grid-column: 1;
    grid-row: 1;
    padding-left: 0 !important;
  }

  .week-table tr.entry-row td.c-dur {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .week-table tr.entry-row td.c-act {
    grid-column: 1;
    grid-row: 2;
  }

  .week-table tr.entry-row td.c-loc {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
    color: #6c757d;
  }

  .week-table tr.entry-row td.c-desc {
    grid-column: 1 / -1;
    grid-row: 3;
    color: #6c757d;
    font-size: .875rem;
  }

  .week-table tr.entry-row td.c-desc:empty {
    display: none;
  }

  .week-table tr.entry-row td.c-status {
    grid-column: 1;
    grid-row: 4;
    align-self: center;
  }

  .week-table tr.entry-row td.c-actions {
    grid-column: 2;
    grid-row: 4;
    text-align: right;
  }

  .week-table tr.entry-row td.c-actions .btn-sm {
    padding: .35rem .6rem;
    font-size: 1rem;
  }

  .week-table tr.empty-row td {
    padding: .3rem .75rem .6rem;
    border: 0;
  }

  .week-table tfoot tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
    padding: .6rem .75rem;
  }

  .week-table tfoot th {
    display: inline;
    width: auto;
    border: 0;
    padding: 0;
  }

  .week-table tfoot th.c-note {
    flex-basis: 100%;
  }

  .toolbar .btn-text {
    display: none;
  }

  .toolbar .ms-auto {
    margin-left: 0 !important;
    width: 100%;
  }

  .toolbar .ms-auto .btn {
    flex: 1;
  }
}
