.customers-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem 2rem;
  min-height: 100%;
  box-sizing: border-box;
}

.customers-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.customers-workspace-heading h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--text-primary, #0f172a);
}

.customers-workspace-heading p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.92rem;
}

.customers-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  background: var(--accent, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.customers-add-btn svg {
  width: 1rem;
  height: 1rem;
}

.customers-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.customers-tab {
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
}

.customers-tab.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.customers-tab-count {
  margin-left: 0.35rem;
  opacity: 0.85;
  font-weight: 500;
}

.customers-party-hint {
  margin: -0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
}

.customers-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.customers-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 280px;
  max-width: 420px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  background: #fff;
}

.customers-search-wrap svg {
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.customers-search-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  background: transparent;
}

.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.customers-card {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  background: #fff;
  padding: 0.85rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 180px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.customers-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.customers-card--clickable:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.customers-card--clickable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.customers-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.customers-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.customers-card-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.customers-card-titles {
  flex: 1;
  min-width: 0;
}

.customers-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-primary, #0f172a);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customers-card-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customers-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.customers-card-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

.customers-card-chip--muted {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
}

.customers-card-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.customers-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.customers-card-meta-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.customers-card-meta-label {
  color: #94a3b8;
  min-width: 5.5rem;
  flex-shrink: 0;
}

.customers-card-meta-value {
  color: #334155;
  word-break: break-word;
}

.customers-card-address {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customers-state {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

.customers-state--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.customers-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.customers-page-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.customers-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.customers-page-info {
  font-size: 0.85rem;
  color: #64748b;
}

.customer-detail-modal {
  width: min(920px, calc(100vw - 2.5rem));
  max-width: min(920px, calc(100vw - 2.5rem));
  max-height: min(94vh, 900px);
  display: flex;
  flex-direction: column;
}

.customer-detail-modal .new-case-modal-header {
  padding: 1.5rem 2rem 0;
}

.customer-detail-modal-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 1.25rem 2rem 2rem;
}

.customer-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.customer-detail-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.customer-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.customer-detail-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.35rem 0;
}

.customer-detail-label {
  color: #94a3b8;
  font-weight: 500;
}

.customer-detail-value {
  color: #0f172a;
  word-break: break-word;
}

.customer-detail-all-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem 1.25rem;
}

.customer-detail-field-count {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.customer-detail-empty {
  color: #cbd5e1;
}

.customer-detail-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
}

.customer-detail-state--error {
  color: #b91c1c;
}

.customer-detail-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: customer-detail-spin 0.8s linear infinite;
}

@keyframes customer-detail-spin {
  to {
    transform: rotate(360deg);
  }
}
