/* ============================================================
   Lexware Office – Shared Section Styles
   ============================================================ */

.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}

.cardHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.cardTitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lexwareLogo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: #0066cc;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Status badge */
.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.statusLinked {
  background: #d1fae5;
  color: #065f46;
}

.statusNotLinked {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

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

/* Sync info */
.syncInfo {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Action buttons row */
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.actionBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: border-color 0.15s, color 0.15s;
}

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

.actionBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actionBtnDanger {
  composes: actionBtn;
  border-color: #fecaca;
  color: var(--color-error);
}

.actionBtnDanger:hover {
  border-color: var(--color-error);
}

.actionBtnPrimary {
  composes: actionBtn;
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.actionBtnPrimary:hover {
  opacity: 0.9;
}

/* Voucher table */
.voucherTable {
  width: 100%;
  border-collapse: collapse;
}

.voucherTable th {
  padding: 0.5rem 0.5rem 0.5rem 0;
  text-align: left;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}

.voucherTable th:last-child {
  text-align: right;
  padding-right: 0;
}

.voucherTable td {
  padding: 0.5rem 0.5rem 0.5rem 0;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.voucherTable td:last-child {
  text-align: right;
  padding-right: 0;
}

.voucherTable tbody tr:last-child td {
  border-bottom: none;
}

.voucherTypeBadge {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.typeQuotation {
  background: #dbeafe;
  color: #1e40af;
}

.typeOrderConfirmation {
  background: #e0e7ff;
  color: #3730a3;
}

.typeInvoice {
  background: #d1fae5;
  color: #065f46;
}

.typeCreditNote {
  background: #fef3c7;
  color: #92400e;
}

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

:global([data-theme='dark']) .typeOrderConfirmation {
  background: #312e81;
  color: #a5b4fc;
}

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

:global([data-theme='dark']) .typeCreditNote {
  background: #78350f;
  color: #fde68a;
}

.voucherLink {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.75rem;
}

.voucherLink:hover {
  text-decoration: underline;
}

.statusOpen {
  color: var(--color-primary);
}

.statusPaid {
  color: var(--color-success);
}

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

/* Empty state */
.emptyText {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Filter row for vouchers */
.filterRow {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

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

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

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

.searchResults {
  margin-top: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.searchResultItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
  cursor: default;
}

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

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

.searchResultName {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.searchResultMeta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}

.searchResultBtn {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.searchResultBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loadingText {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding: 1rem 0;
  text-align: center;
}

/* ERP Tag highlight */
.erpTag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: #0066cc;
  border: none;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: white;
  font-weight: 600;
}

:global([data-theme='dark']) .erpTag {
  background: #2563eb;
}
