.client-table .thead,
.client-row {
  grid-template-columns: 1.8fr 1.45fr 1.2fr .7fr .8fr minmax(92px, auto);
}

.client-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.client-edit-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--panel);
  color: var(--pink);
  font: 600 10px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.client-edit-button:hover {
  transform: translateY(-1px);
  border-color: #d783a2;
  background: var(--soft);
}

.client-actions .table-delete {
  position: static;
  flex: 0 0 auto;
}

body[data-theme="blush"] .client-edit-button { color: #b77af2; }
body[data-theme="lavender"] .client-edit-button { color: #62b9df; }

@media (max-width: 760px) {
  #clients .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  #clients .table-tools { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
  .client-table { min-width: 0; display: grid; gap: 10px; }
  .client-table .thead { display: none; }
  .client-row {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
      "name actions"
      "phone phone"
      "last visits"
      "spent spent";
    gap: 11px 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .client-row .client-name { grid-area: name; min-width: 0; }
  .client-row .client-name > div:last-child { min-width: 0; }
  .client-row .client-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .client-row > a { grid-area: phone; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; background: var(--soft); }
  .client-row > a::before { content: "Kontakt"; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
  .client-row > span:nth-of-type(1) { grid-area: last; }
  .client-row > span:nth-of-type(2) { grid-area: visits; text-align: right; }
  .client-row > span:nth-of-type(1)::before { content: "Ostatnia wizyta"; }
  .client-row > span:nth-of-type(2)::before { content: "Wizyty"; }
  .client-row > span::before,.client-row > strong::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
  .client-row > strong { grid-area: spent; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); }
  .client-row > strong::before { content: "Łączne wydatki"; margin: 0; }
  .client-actions { grid-area: actions; align-self: start; }
  .client-edit-button { min-height: 32px; padding: 7px 10px; }
  .client-actions .table-delete { width: 32px; height: 32px; }
}

@media (max-width: 520px) {
  .modal {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }
}
