/* Pisma do APP: rejestr, szczegóły i formularz pisma. */
/* Rejestr pism */

.letters-register-title {
  margin-left: 65px;
}

.letters-register-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin: 0 65px 1em;
}

.letters-register-toolbar .letters-register-search,
.letters-register-toolbar .letters-register-filter {
  font-size: 14px;
  font-weight: normal;
}

.letters-register-toolbar .letters-register-search {
  flex: 2 1 300px;
}

.letters-register-toolbar .letters-register-filter {
  background-color: var(--white-color);
  border: 1px solid #ccc;
  border-radius: 5px;
  flex: 1 1 250px;
  height: 30px;
}

.letters-register-filter .search-type-selector {
  background-color: var(--white-color);
}

.letters-register-icon {
  height: 14px;
}

.letters-register-content {
  margin: 0 65px;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.letters-register-table,
.letters-register-table > thead {
  background-color: #ececec;
}

.letters-register-table > thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.letters-register-table .letters-register-actions {
  white-space: nowrap;
  width: 1%;
}

.letters-register-table .letters-register-date {
  white-space: nowrap;
}

.letters-register-table .letters-register-subject {
  word-break: break-word;
}

/* Formularz pisma obywatela */

.letter-citizen-attachments-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 15px;
}

.letter-citizen-actions {
  margin-bottom: 15px;
  text-align: right;
}

/* Szczegóły i formularz pisma */

.parcel-map.letter-parcel-map {
  width: 100%;
}

/*
 * Typeahead przy inicjalizacji kopiuje tło pola
 * do podpowiedzi `.tt-hint` (inline), a pole robi przezroczystym.
 * Pole zainicjowane w zablokowanym fieldsecie zostałoby więc szare
 * także po odblokowaniu.
 */
.letter-parcel-fields .tt-hint {
  background-color: #fff !important;
}

.letter-parcel-fields[disabled] .tt-hint {
  background-color: #eee !important;
}

/* Tabele szczegółowe pisma — jak w dawnych formularzach wniosków i uwag. */
.letter-details-table {
  background-color: #ececec;
}

.letter-details-table > tbody > tr > td {
  vertical-align: middle;
}

.letter-details-table .letter-details-table-key {
  font-weight: bold;
}

.letter-details-table .letter-details-table-radios {
  white-space: nowrap;
}

.letter-details-table .letter-details-col-lp {
  width: 3%;
}

.letter-details-table .letter-details-col-parcel,
.letter-details-table .letter-details-col-whole {
  width: 20%;
}

.letter-details-table .letter-details-col-content {
  width: 57%;
}

.letter-details-table .letter-details-col-land-use {
  width: 21%;
}

.letter-details-table .letter-details-col-parameter {
  width: 12%;
}

@media (min-width: 768px) {
  .letter-account.dl-horizontal dt {
    width: 200px;
  }

  .letter-account.dl-horizontal dd {
    margin-left: 220px;
  }

  /*
   * Sekcja pełnej szerokości: kolumna etykiet ma szerokość najdłuższej etykiety,
   * a nie stałe `col-sm-3`.
   * Pola `.form-group` i `fieldset` przestają być pudełkami,
   * więc ich dzieci trafiają wprost do siatki.
   */
  .letter-section-fit {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    row-gap: 15px;
  }

  .letter-section-fit fieldset,
  .letter-section-fit .form-group {
    display: contents;
  }

  .letter-section-fit .form-group > [class*="col-sm-"] {
    float: none;
    margin-left: 0;
    width: auto;
  }

  .letter-section-fit .form-group > [class*="col-sm-offset-"] {
    grid-column: 2;
  }

  /* Bez żadnej etykiety (same pola wyboru) pierwsza kolumna jest pusta
   * i nie potrzebuje odstępu.
   */
  .letter-section-fit .form-group > .control-label,
  .letter-section-fit:not(:has(.control-label)) .form-group > [class*="col-sm-offset-"] {
    padding-left: 0;
  }

  .letter-section-fit > :not(fieldset):not(.form-group),
  .letter-section-fit > fieldset > :not(.form-group) {
    grid-column: 1 / -1;
  }
}
