/* ============================================================
   CompaniesPage – Filter & Paginierung
   ============================================================ */

.filterBar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.searchInput {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  background: var(--color-bg-card);
  color: var(--color-text);
}

.searchInput:focus {
  border-color: var(--color-primary);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.paginationButtons {
  display: flex;
  gap: 0.5rem;
}

.paginationBtn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.paginationBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   Expandable Rows — Kontakte als Sub-Rows
   ============================================================ */

/* Expand/Collapse Button */
.expandBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}

.expandBtn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.expandIcon {
  display: inline-block;
  font-size: 0.625rem;
  transition: transform 0.2s ease;
  line-height: 1;
}

/* Company row when expanded */
.expandedRow {
  background: var(--color-bg);
  border-left: 3px solid var(--color-primary);
}

:global([data-theme='dark']) .expandedRow {
  background: rgba(99, 102, 241, 0.04);
}

/* Contact sub-rows */
.subRow {
  background: rgba(99, 102, 241, 0.03);
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: background 0.15s;
}

.subRow:hover {
  background: rgba(99, 102, 241, 0.07);
}

:global([data-theme='dark']) .subRow {
  background: rgba(99, 102, 241, 0.06);
  border-left-color: rgba(129, 140, 248, 0.4);
}

:global([data-theme='dark']) .subRow:hover {
  background: rgba(99, 102, 241, 0.12);
}

.subRowIndent {
  padding: 0.5rem 0.5rem 0.5rem 2rem;
  width: 56px;
  position: relative;
}

.subRowConnector {
  display: block;
  width: 16px;
  height: 1px;
  background: rgba(99, 102, 241, 0.3);
  margin-left: auto;
}

:global([data-theme='dark']) .subRowConnector {
  background: rgba(129, 140, 248, 0.35);
}

.subRowCell {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.subRowLoading,
.subRowError,
.subRowEmpty {
  padding: 0.75rem 1rem 0.75rem 4.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: left;
}

.subRowError {
  color: var(--color-error);
}

/* Typ-Badge in Sub-Rows */
.typeBadge {
  display: inline-block;
  padding: 0.0625rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.typeBadge[data-type='PERSON'] {
  background: #dbeafe;
  color: #1e40af;
}

.typeBadge[data-type='ORGANIZATION'] {
  background: #d1fae5;
  color: #065f46;
}
