﻿@media (max-width: 820px){
  .table--time-grouped .table__row > div:nth-child(3)::before{ content: "Projekt"; }
  .table--time-grouped .table__row > div:nth-child(4)::before{ content: "Start"; }
  .table--time-grouped .table__row > div:nth-child(5)::before{ content: "Ende"; }
  .table--time-grouped .table__row > div:nth-child(6)::before{ content: "Pause"; }
  .table--time-grouped .table__row > div:nth-child(7)::before{ content: "Netto"; }
  .table--time-grouped .table__row > div:nth-child(8)::before{ content: "Aktionen"; }
  .table--time-grouped .table__row > div:last-child::before{ content: ""; }
}

.vacation-request{
  align-items: stretch;
}
.vacation-request__main{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vacation-request__header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.vacation-request__title{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vacation-request__headline{
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.vacation-request__date{
  white-space: nowrap;
}
.vacation-request__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vacation-request__aside{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}
.vacation-request__aside .cell-pills{
  flex-wrap: nowrap;
}
.vacation-request__actions{
  display: flex;
  gap: 8px;
}
/* Vacation: Mobile Layout (nicht gequetscht) */
@media (max-width: 520px){
  .vacation .row.row-between.row-wrap{ gap: 10px; }
  .vacation .row.row-between.row-wrap .row.row-gap{
    width: 100%;
    justify-content: flex-start;
    align-items: stretch;
  }
  .vacation .row.row-between.row-wrap .btn{
    flex: 1 1 100%;
    min-width: 0;
    height: auto;
    min-height: 44px;
    white-space: normal;
    line-height: 1.25;
  }
  .vacation .list__item{ flex-direction: column; align-items: stretch; }
  .vacation-request__header{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .vacation-request__date{
    white-space: normal;
  }
  .vacation-request__aside{
    width: 100%;
    justify-content: space-between;
    white-space: normal;
    flex-wrap: wrap;
  }
  .vacation-request__actions{
    width: 100%;
  }
  .vacation-request__actions .btn{
    flex: 1 1 0;
  }
}

/* ---------------- Admin: Urlaubsanträge (kompakt) ---------------- */
.table--admin-leaves{
  min-width: 1060px;
}
.table--admin-leaves .table__head,
.table--admin-leaves .table__row{
  grid-template-columns:
    minmax(170px, 1fr)    /* User + Status */
    minmax(225px, 1.15fr) /* Zeitraum */
    70px                  /* Tage */
    minmax(230px, 1.15fr) /* Typ + Notizen */
    minmax(280px, 1.35fr);/* Aktion */
  align-items: center;
}
.table--admin-leaves .table__head > div:nth-child(3),
.table--admin-leaves .table__row > div:nth-child(3){
  text-align: center;
}
.table--admin-leaves .admin-leaves-actions{
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-items: center;
}
.table--admin-leaves .admin-leaves-actions .btn{
  flex: 0 0 auto;
}

.table--admin-leaves .table__head > div:last-child,
.table--admin-leaves .table__row > div:last-child,
.table--loans-admin .table__head > div:last-child,
.table--loans-admin .table__row > div:last-child{
  justify-self: end;
}
.table--admin-leaves .table__row > div:nth-child(2),
.table--admin-leaves .table__row > div:nth-child(3),
.table--loans-admin .table__row > div:nth-child(2),
.table--loans-admin .table__row > div:nth-child(3),
.table--loans-admin .table__row > div:nth-child(4),
.table--loans-admin .table__row > div:nth-child(6){
  white-space: nowrap;
}
.table--admin-leaves .row.row-gap.row-end,
.table--loans-admin .row.row-gap.row-wrap,
.table--tools-admin .row.row-gap.row-wrap{
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.table--admin-leaves .cell-pills{
  width: 100%;
  gap: 8px;
}
.table--admin-leaves .cell-pills > span:first-child,
.table--admin-leaves .cell-pills > b:first-child{
  margin-right: auto;
}
.table--admin-leaves .cell-pills,
.table--loans-admin .cell-pills{
  width: 100%;
}
.table--admin-leaves .pill-note,
.table--loans-admin .pill-note{
  max-width: 100%;
}
.table--admin-leaves .btn,
.table--loans-admin .btn,
.table--tools-admin .btn{
  width: auto;
}


/* 0.15.4 - Mobile Feinschliff Admin Urlaub */
#view-admin .card--admin-subsection.mt-16{
  margin-top: 28px;
}

.table--admin-leaves .table__row > div,
.table--vacation-overview .table__row > div{
  min-width: 0;
}

@media (max-width: 900px){
  #view-admin .card--admin-subsection.mt-16{
    margin-top: 18px;
  }

  .table--admin-leaves{
    min-width: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .table--admin-leaves .table__body,
  .table--vacation-overview .table__body{
    display:flex;
    flex-direction:column;
    gap: 12px;
  }
  .table--admin-leaves .table__row,
  .table--vacation-overview .table__row{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }
  .table--admin-leaves .table__row > div,
  .table--vacation-overview .table__row > div{
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    white-space: normal !important;
  }
  .table--admin-leaves .table__row > div:last-child,
  .table--vacation-overview .table__row > div:last-child{
    justify-content: flex-start;
  }
  .table--admin-leaves .table__row > div::before,
  .table--vacation-overview .table__row > div::before{
    min-width: 78px;
  }
  .table--admin-leaves .table__row > div:nth-child(1)::before{ content: "User"; }
  .table--admin-leaves .table__row > div:nth-child(2)::before{ content: "Zeitraum"; }
  .table--admin-leaves .table__row > div:nth-child(3)::before{ content: "Tage"; }
  .table--admin-leaves .table__row > div:nth-child(4)::before{ content: "Typ"; }
  .table--admin-leaves .table__row > div:nth-child(5)::before{ content: "Aktion"; }

  .table--vacation-overview .table__row > div:nth-child(1)::before{ content: "Benutzer"; }
  .table--vacation-overview .table__row > div:nth-child(2)::before{ content: "Kontingent"; }
  .table--vacation-overview .table__row > div:nth-child(3)::before{ content: "Stand 01.01."; }
  .table--vacation-overview .table__row > div:nth-child(4)::before{ content: "Genehmigt"; }
  .table--vacation-overview .table__row > div:nth-child(5)::before{ content: "Offen"; }
  .table--vacation-overview .table__row > div:nth-child(6)::before{ content: "Rest"; }

  .table--admin-leaves .cell-pills,
  .table--vacation-overview .cell-pills{
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .table--admin-leaves .cell-pills > span:first-child,
  .table--admin-leaves .cell-pills > b:first-child{
    margin-right: 0;
  }
  .table--admin-leaves .admin-leaves-actions{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }
  .table--admin-leaves .admin-leaves-actions .btn{
    min-width: 0;
  }
  .table--admin-leaves .pill-note{
    max-width: none;
  }
  #view-admin .card--admin-subsection summary{
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

@media (max-width: 560px){
  .table--admin-leaves .table__row > div,
  .table--vacation-overview .table__row > div{
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .table--admin-leaves .table__row > div::before,
  .table--vacation-overview .table__row > div::before{
    min-width: 0;
    padding-right: 0;
  }
  .table--admin-leaves .cell-pills,
  .table--vacation-overview .cell-pills,
  .table--admin-leaves .admin-leaves-actions{
    justify-content: flex-start;
  }
}
