.crm-workspace {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.crm-list-panel,
.crm-detail-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  background: #fff;
}

.crm-panel-head,
.crm-detail-head,
.crm-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.crm-panel-head h2,
.crm-detail-head h2,
.crm-section h3 {
  margin: 0;
}

.crm-panel-head > span,
.crm-section-head > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.crm-search {
  min-height: 42px;
  border-radius: 8px;
}

.crm-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px);
  gap: 10px;
  align-items: end;
}

.crm-filter-row .crm-search {
  min-width: 0;
}

.crm-filter-row .crm-tag-filter {
  min-width: 0;
}

.crm-client-table .notion-row {
  grid-template-columns: minmax(140px, 1.05fr) minmax(150px, 1fr) minmax(130px, 0.9fr) minmax(95px, 0.62fr) minmax(100px, 0.66fr);
}

.crm-asset-table .notion-row {
  grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1fr) minmax(110px, 0.62fr) 70px;
}

.crm-client-row,
.crm-asset-row {
  width: 100%;
  border: 0;
  background: #fff;
  color: inherit;
  text-align: left;
}

.crm-client-row.active {
  background: var(--panel-soft);
}

.crm-client-row strong,
.crm-asset-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-contact-cell {
  display: grid;
  gap: 2px;
}

.crm-contact-cell b,
.crm-contact-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-contact-cell small {
  color: var(--muted);
  font-size: 0.74rem;
}

.crm-empty-row,
.crm-empty-detail {
  padding: 22px;
  color: var(--muted);
}

.crm-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.crm-info-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.crm-info-item span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-info-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-target-policy {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 12px;
  padding: 13px;
  background: var(--panel-soft);
}

.crm-target-policy p {
  margin: 2px 0 0;
  color: var(--muted);
}

.asset-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-block;
  background: var(--primary);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.asset-icon.pet {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='black' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6.6' cy='9' r='2.1'/%3E%3Ccircle cx='10' cy='6.4' r='2.1'/%3E%3Ccircle cx='14' cy='6.4' r='2.1'/%3E%3Ccircle cx='17.4' cy='9' r='2.1'/%3E%3Cpath d='M6.8 16.7c0-3.2 2.5-5.7 5.2-5.7s5.2 2.5 5.2 5.7c0 1.9-1.3 3.1-3 2.6-.8-.2-1.4-.5-2.2-.5s-1.4.3-2.2.5c-1.7.5-3-.7-3-2.6Z'/%3E%3C/svg%3E");
}

.asset-icon.vehicle {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='black' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 11l1.6-4.2A2.4 2.4 0 0 1 8.8 5h6.4a2.4 2.4 0 0 1 2.2 1.8L19 11v6h-2v-1H7v1H5v-6Zm2.2-1h9.6l-.9-2.4a.8.8 0 0 0-.8-.6H8.9a.8.8 0 0 0-.8.6L7.2 10ZM8 13.5A1.5 1.5 0 1 0 8 16a1.5 1.5 0 0 0 0-2.5Zm8 0A1.5 1.5 0 1 0 16 16a1.5 1.5 0 0 0 0-2.5Z'/%3E%3C/svg%3E");
}

.asset-icon.asset {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='black' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 5.8C5 4.8 5.8 4 6.8 4h10.4c1 0 1.8.8 1.8 1.8v12.4c0 1-.8 1.8-1.8 1.8H6.8c-1 0-1.8-.8-1.8-1.8V5.8Zm3 2.2v2h8V8H8Zm0 4v2h8v-2H8Zm0 4v1.5h5V16H8Z'/%3E%3C/svg%3E");
}

.salon-model-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.salon-model-panel h3,
.salon-model-note {
  margin: 0;
}

.salon-model-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.salon-settings-panel select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

@media (max-width: 980px) {
  .crm-workspace,
  .crm-contact-grid,
  .salon-model-fields {
    grid-template-columns: 1fr;
  }

  .crm-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .crm-client-table,
  .crm-asset-table {
    overflow-x: auto;
  }

  .crm-client-table .notion-row {
    min-width: 860px;
  }

  .crm-asset-table .notion-row {
    min-width: 660px;
  }
}
