/* «Обратная связь» (/feedback): таблица консультаций и касаний, на телефоне карточки. */
.fb-page {
  --fb-soft: #f1f3f6;
  --fb-line: #e3e7ee;
  --fb-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.fb-page .page-head {
  margin-bottom: 18px;
}
.fb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.fb-presets,
.fb-services {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fb-toolbar .chip {
  min-height: 36px;
  padding: 6px 14px;
  transition:
    background 0.2s var(--fb-ease),
    border-color 0.2s var(--fb-ease);
}
.fb-toolbar .chip:active,
.fb-tile:active,
.fb-add:active {
  transform: scale(0.97);
}
.fb-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}
.fb-dates input {
  border: 0;
  background: none;
  min-height: 30px;
  padding: 0 4px;
}
.fb-search {
  flex: 1 1 220px;
  max-width: 320px;
  margin: 0;
}
.fb-search input {
  background: #fff;
  min-height: 40px;
  border-radius: 999px;
  padding-left: 16px;
}

/* Плашки-итоги: они же быстрые фильтры. */
.fb-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 18px;
}
.fb-tile {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--fb-soft);
  transition:
    background 0.25s var(--fb-ease),
    border-color 0.25s var(--fb-ease),
    transform 0.2s var(--fb-ease);
}
.fb-tile b {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.fb-tile span {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.fb-tile:hover {
  background: #e9edf2;
}
.fb-tile.active {
  background: #fff;
  border-color: #1f55d8;
  box-shadow: 0 6px 20px rgba(31, 85, 216, 0.1);
}
.fb-tile.tone-stale b {
  color: var(--red);
}
.fb-tile.tone-paid b {
  color: #22744f;
}
.fb-tile.tone-no_show {
  background: transparent;
  border: 1px dashed #cfd5dd;
}
.fb-tile.tone-no_show b {
  color: var(--muted);
}

/* Таблица */
.fb-table-wrap {
  border: 1px solid var(--fb-line);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}
.fb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.fb-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  padding: 12px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--fb-line);
}
.fb-table th:nth-child(1) { width: 112px; }
.fb-table th:nth-child(2) { width: 15%; }
.fb-table th:nth-child(3) { width: 17%; }
.fb-table th:nth-child(4) { width: 20%; }
.fb-table th:nth-child(6) { width: 150px; }
.fb-table td {
  vertical-align: top;
  padding: 14px;
  border-bottom: 1px solid #eef1f5;
}
.fb-table tr:last-child td {
  border-bottom: 0;
}
.fb-row {
  transition: background 0.2s var(--fb-ease);
}
.fb-row:hover {
  background: #fbfcfd;
}
.fb-row.stale td:first-child {
  box-shadow: inset 3px 0 0 #e7a3a3;
}
.fb-row.paid td:first-child {
  box-shadow: inset 3px 0 0 #6cc196;
}
.fb-when strong {
  display: block;
  font-size: 15px;
}
.fb-when small {
  display: block;
  color: var(--muted);
}
.fb-expert {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--fb-soft);
  font-size: 12.5px;
  font-weight: 600;
}
.fb-client strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.fb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}
.fb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #2456d7;
  text-decoration: none;
  white-space: nowrap;
}
.fb-link svg {
  width: 13px;
}
.fb-link.wa,
.fb-link.amo {
  padding: 1px 8px;
  border-radius: 999px;
  background: #eaf0ff;
  font-weight: 600;
}
.fb-link.wa {
  background: #e3f5ea;
  color: #1d7a48;
}
.fb-link:hover {
  text-decoration: underline;
}
.fb-clamp {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.fb-src,
.fb-sheet {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}
.fb-agree {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin: 0 -10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  font-size: 14px;
  transition: background 0.2s var(--fb-ease);
}
.fb-agree:hover {
  background: var(--fb-soft);
}
.fb-marks {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.fb-ready {
  font-size: 12.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fb-soft);
}
.fb-ready.high { background: #e2f3e8; color: #22744f; }
.fb-ready.mid { background: #fff1d1; color: #8a5f08; }
.fb-ready.low { background: #fdebea; color: #ac3947; }
.fb-nosum,
.fb-none {
  margin: 0 0 6px;
  font-size: 13.5px;
}

/* Касания: лента */
.fb-touches {
  list-style: none;
  margin: 0 0 8px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--fb-line);
  display: grid;
  gap: 8px;
}
.fb-touch {
  position: relative;
  animation: fb-in 0.35s var(--fb-ease) both;
}
.fb-touch::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #9aa6b8;
}
.fb-touch.manual::before { border-color: var(--blue); }
.fb-touch.amo::before { border-color: #7c69c9; }
.fb-touch.booking::before { border-color: #36995b; }
.fb-touch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 12.5px;
}
.fb-touch-head time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.fb-ch {
  color: var(--muted);
  font-weight: 600;
}
.fb-touch p {
  margin: 1px 0 0;
  overflow-wrap: anywhere;
}
.fb-touch small {
  color: var(--muted);
  font-size: 12px;
}
.fb-touch-src {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--fb-soft);
  color: var(--muted);
  font-size: 11.5px;
}
.fb-touch-src.amo { background: #efecfb; color: #5a48a8; }
.fb-touch-src.booking { background: #e3f5ea; color: #1d7a48; }
.fb-result {
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--fb-soft);
}
.fb-result.agreed, .fb-result.paid { background: #e2f3e8; color: #22744f; }
.fb-result.thinking { background: #fff1d1; color: #8a5f08; }
.fb-result.refused, .fb-result.no_answer { background: #fdebea; color: #ac3947; }
.fb-touch-tools {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s var(--fb-ease);
}
.fb-touch:hover .fb-touch-tools,
.fb-touch-tools:focus-within {
  opacity: 1;
}
.fb-touch-tools .icon-button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--fb-soft);
}
.fb-touch-tools .icon-button svg {
  width: 13px;
}
.fb-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  border: 1px dashed #c5ccd8;
  border-radius: 999px;
  background: #fff;
  color: #2456d7;
  font-size: 13px;
  font-weight: 650;
  transition:
    background 0.2s var(--fb-ease),
    border-color 0.2s var(--fb-ease);
}
.fb-add svg {
  width: 15px;
}
.fb-add:hover {
  border-style: solid;
  border-color: #2456d7;
  background: #f3f6ff;
}

/* Статус */
.fb-stage {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #efecfb;
  color: #5a48a8;
  font-size: 12.5px;
  font-weight: 650;
  margin-bottom: 4px;
}
.fb-ago {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}
.fb-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.fb-flag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}
.fb-flag.bad { background: #fdebea; color: #a93535; }
.fb-flag.warm { background: #fff1d1; color: #8a5f08; }
.fb-flag.good { background: #e2f3e8; color: #22744f; }
.fb-flag.muted { background: var(--fb-soft); color: var(--muted); }

/* Форма касания */
.fb-form-row td {
  padding: 0 14px 16px;
  background: #fbfcfd;
}
.fb-row.has-form td {
  background: #fbfcfd;
  border-bottom-color: transparent;
}
.fb-touch.is-editing p {
  background: #fff6d8;
  border-radius: 6px;
}
.fb-form {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--fb-line);
  box-shadow: 0 10px 30px rgba(28, 39, 59, 0.07);
  animation: fb-in 0.3s var(--fb-ease) both;
}
.fb-form-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fb-form-title strong {
  font-size: 15px;
}
.fb-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 14px 20px;
}
.fb-form-col {
  display: grid;
  align-content: start;
  gap: 6px;
}
.fb-form-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.fb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.fb-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fb-pill span {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--fb-soft);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--fb-ease),
    border-color 0.15s var(--fb-ease);
}
.fb-pill span:hover {
  background: #e7ebf0;
}
.fb-pills.small .fb-pill span {
  padding: 4px 11px;
  font-size: 13px;
}
.fb-pill input:checked + span {
  background: #eaf0ff;
  border-color: #1f55d8;
  color: #1849bd;
}
.fb-pill input:focus-visible + span {
  outline: 3px solid rgba(40, 93, 229, 0.35);
}
.fb-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.fb-date input {
  min-height: 34px;
  border: 1px solid var(--fb-line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}
.fb-text {
  display: grid;
  gap: 6px;
  margin: 0;
}
.fb-text textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--fb-line);
  border-radius: 14px;
  background: #fff;
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.45;
  resize: vertical;
}
.fb-text textarea:focus {
  border-color: #9db5f2;
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 93, 229, 0.12);
}
.fb-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fb-form-foot .form-error {
  margin: 0;
}
.fb-form-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.fb-form-actions .button {
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 999px;
}
.fb-touch.editing::before {
  display: none;
}

@keyframes fb-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1280px) {
  .fb-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .fb-table th:nth-child(6) { width: 120px; }
  .fb-table td { padding: 12px 10px; }
}

/* Телефон: карточки */
@media (max-width: 700px) {
  .fb-page .page-head {
    margin-bottom: 6px;
  }
  .fb-page .head-actions .button {
    min-height: 38px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
  }
  .fb-dates {
    width: 100%;
    justify-content: space-between;
  }
  /* Плашки-итоги: сеткой 3×2, без прокрутки вбок. */
  .fb-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 2px 0 14px;
  }
  .fb-tile {
    align-content: start;
    padding: 9px 10px;
    border-radius: 14px;
  }
  .fb-tile b {
    font-size: 20px;
  }
  .fb-tile span {
    font-size: 11.5px;
    line-height: 1.25;
  }
  .fb-toolbar {
    gap: 8px;
  }
  /* Периоды и услуги тянутся на всю ширину; на узком экране переносятся. */
  .fb-presets,
  .fb-services {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .fb-toolbar .fb-presets .chip,
  .fb-toolbar .fb-services .chip {
    flex: 1 1 auto;
    padding: 6px 8px;
    font-size: 14px;
    justify-content: center;
    white-space: nowrap;
  }
  .fb-dates input {
    flex: 1 1 0;
    min-width: 0;
  }
  .fb-search {
    max-width: none;
    flex-basis: 100%;
  }
  .fb-cards {
    display: grid;
    gap: 10px;
  }
  .fb-card {
    padding: 14px 14px 4px;
    border: 1px solid var(--fb-line);
    border-radius: 20px;
    background: #fff;
    display: grid;
    gap: 10px;
    min-width: 0;
    animation: fb-in 0.35s var(--fb-ease) both;
  }
  .fb-card.stale {
    border-left: 3px solid #e7a3a3;
  }
  .fb-card.paid {
    border-left: 3px solid #6cc196;
  }
  .fb-card header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .fb-card-name {
    min-width: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }
  .fb-card-date {
    flex: none;
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .fb-card-meta {
    margin: -8px 0 0;
    color: var(--muted);
    font-size: 13px;
  }
  .fb-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }
  .fb-card-tags .fb-stage {
    margin: 0;
  }
  .fb-card-agree .fb-agree {
    margin: -6px -10px;
    width: calc(100% + 20px);
    padding: 6px 10px;
  }
  .fb-card-agree .fb-clamp {
    -webkit-line-clamp: 3;
  }
  .fb-card-agree .fb-nosum {
    margin: 0;
  }
  .fb-last {
    padding: 9px 11px;
    border-radius: 12px;
    background: var(--fb-soft);
    font-size: 13.5px;
  }
  .fb-last .fb-clamp {
    -webkit-line-clamp: 2;
    margin-top: 2px;
  }
  .fb-card > .fb-none {
    margin: 0;
  }
  .fb-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .fb-card-actions .fb-links {
    margin: 0;
    gap: 6px;
  }
  .fb-card-actions .fb-link {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eaf0ff;
    font-weight: 600;
  }
  .fb-card-actions .fb-link.wa {
    background: #e3f5ea;
  }
  .fb-card-actions .fb-call {
    justify-content: center;
    width: 32px;
    padding: 0;
  }
  .fb-card-actions .fb-call svg {
    width: 16px;
  }
  .fb-card-actions .fb-links {
    flex-wrap: nowrap;
  }
  .fb-card-actions .fb-add {
    flex: none;
  }
  .fb-more {
    margin: 0 -14px;
    padding: 10px 14px 12px;
    border: 0;
    border-top: 1px solid var(--fb-line);
    background: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
  }
  .fb-card-more {
    display: grid;
    gap: 12px;
    padding-top: 2px;
  }
  .fb-field p {
    margin: 0;
  }
  .fb-field h3 {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }
  .fb-field .fb-clamp {
    -webkit-line-clamp: 6;
  }
  .fb-touch-tools {
    opacity: 1;
  }
  .fb-form {
    padding: 12px;
    box-shadow: none;
  }
  .fb-form-grid {
    grid-template-columns: 1fr;
  }
  .fb-form-actions {
    width: 100%;
  }
  .fb-form-actions .button {
    flex: 1;
  }
}
