/* the list of the contacts and the page of one contact */
/* One file for one part of the application: a change of that part touches only this file. */

/* the list of the contacts in two sections (companies, persons) and the page of one contact */
.contact-section + .contact-section {
  margin-top: 22px;
}
.contact-section h3 {
  margin: 8px 0;
}
.detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-head h2 {
  margin: 0;
}
.kvlist {
  display: grid;
  gap: 8px;
  margin: 0;
}
.kvlist .kv {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr;
  gap: 12px;
}
.kvlist dt {
  color: var(--muted);
  font-weight: 600;
}
.kvlist dd {
  margin: 0;
}
@media (max-width: 620px) {
  .kvlist .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* the first contact person written together with a new company */
fieldset.cp-new {
  margin: 14px 0 0;
  padding: 10px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
fieldset.cp-new legend {
  padding: 0 6px;
  font-weight: 700;
}
fieldset.cp-new .hint {
  margin: 0 0 8px;
}

/* the IČO field with its ARES button: the empty status line takes no room, so IČO and DIČ stand on one line */
[data-ares-status]:empty {
  display: none;
}
.withbtn input {
  flex: 1;
  min-width: 0;
}

/* the flag of the country: the first column of the lists, beside the name in the page of a contact */
td.flag,
th.c:first-child {
  width: 1%;
  white-space: nowrap;
}
.flag-img {
  display: inline-block;
  vertical-align: middle;
  width: 26px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.detail-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
/* on a phone the flag stands in the corner of the card, the name stays the heading of the card */
@media (max-width: 640px) {
  table.cards tr {
    position: relative;
  }
  table.cards td.flag {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    min-height: 0;
    padding: 0;
  }
  table.cards td.flag::before {
    display: none;
  }
  table.cards td.flag + td {
    justify-content: flex-start;
    flex-wrap: wrap;
    text-align: left;
    font-weight: 700;
    padding-right: 44px;
  }
  table.cards td.flag + td::before {
    display: none;
  }
}

/* the button of the contracts in the list of the companies: the picture of a document, the number of the contracts on it */
.ct-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #6a5acd 10%, var(--card));
  text-decoration: none;
}
.ct-link:hover {
  border-color: #6a5acd;
}
.ct-link .ct-count {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
