/* Lexware Sync Page */

.backLink {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.backLink:hover {
  color: var(--color-text);
}

.header {
  margin-bottom: 1.5rem;
}

.title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.lxBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Tab Bar */
.tabBar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--color-text);
}

.tabActive {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Card (tab content wrapper) */
.card {
  background: var(--color-bg-card);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  border-top: none;
  padding: 1.5rem;
}

.tabDesc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

/* Search input */
.searchInput {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.searchInput:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.searchInput::placeholder {
  color: var(--color-text-muted);
}

/* Results list */
.resultsList {
  margin-top: 1rem;
}

.hint {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  padding: 1.5rem 0;
  margin: 0;
}

/* Result card — column layout for expandable Ansprechpartner */
.resultCard {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--color-border);
}

.resultCard:last-child {
  border-bottom: none;
}

.resultCardMain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.resultInfo {
  flex: 1;
  min-width: 0;
}

.resultName {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resultMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}

.roleBadge {
  display: inline-block;
  padding: 0 0.375rem;
  border-radius: 4px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

:global([data-theme='dark']) .roleBadge {
  background: #4c1d95;
  color: #c4b5fd;
}

.resultActions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Import buttons */
.importBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  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-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.importBtn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg, #eff6ff);
}

.importBtn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Success / Error banners */
.successBanner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.75rem;
}

:global([data-theme='dark']) .successBanner {
  background: #064e3b;
  border-color: #065f46;
  color: #a7f3d0;
}

.errorBanner {
  padding: 0.625rem 0.875rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.75rem;
}

:global([data-theme='dark']) .errorBanner {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fecaca;
}

/* Filter tabs (Export) */
.filterTabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filterTab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.filterTab:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.filterTabActive {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.filterTabActive:hover {
  color: white;
  border-color: var(--color-primary);
}

.countBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
  font-weight: 600;
}

.filterTabActive .countBadge {
  background: rgba(255, 255, 255, 0.2);
}

/* Export sections */
.exportSection {
  margin-bottom: 1.5rem;
}

.exportSection:last-child {
  margin-bottom: 0;
}

.exportSectionTitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.linkedDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  display: inline-block;
}

.exportList {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exportItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}

.exportItem:last-child {
  border-bottom: none;
}

.exportItemLinked {
  opacity: 0.75;
}

.exportItemInfo {
  flex: 1;
  min-width: 0;
}

.exportItemName {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exportItemMeta {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Export button */
.exportBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.exportBtn:hover:not(:disabled) {
  opacity: 0.85;
}

.exportBtn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.exportBtnSecondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  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-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.exportBtnSecondary:hover:not(:disabled) {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.exportBtnSecondary:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Expand button for Ansprechpartner */
.expandBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.expandBtn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.expandBtnActive {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-bg, #eff6ff);
}

/* Ansprechpartner (Contact Persons) section */
.cpSection {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.cpTitle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cpRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.cpRow:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.cpInfo {
  flex: 1;
  min-width: 0;
}

.cpName {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.cpMeta {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}

.cpPrimary {
  display: inline-block;
  padding: 0 0.375rem;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

:global([data-theme='dark']) .cpPrimary {
  background: #1e3a5f;
  color: #93c5fd;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 0;
  margin-top: 0.5rem;
}

.pageBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}

.pageBtn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.pageInfo {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Linked (already imported) indicator */
.resultCardLinked {
  background: rgba(5, 150, 105, 0.04);
  border-radius: var(--radius-sm);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

:global([data-theme='dark']) .resultCardLinked {
  background: rgba(5, 150, 105, 0.08);
}

.linkedBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.0625rem 0.5rem;
  border-radius: 9999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.6875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  transition: background 0.15s;
}

.linkedBadge:hover {
  background: #a7f3d0;
  color: #064e3b;
}

:global([data-theme='dark']) .linkedBadge {
  background: #064e3b;
  color: #a7f3d0;
}

:global([data-theme='dark']) .linkedBadge:hover {
  background: #065f46;
  color: #d1fae5;
}

.importBtnLinked {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  color: #059669;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.importBtnLinked:hover {
  background: #d1fae5;
  border-color: #059669;
  color: #047857;
}

:global([data-theme='dark']) .importBtnLinked {
  background: #064e3b;
  border-color: #065f46;
  color: #6ee7b7;
}

:global([data-theme='dark']) .importBtnLinked:hover {
  background: #065f46;
  border-color: #059669;
  color: #a7f3d0;
}
