/* ==========================================================================
   Clickable Account, Credit Card & Wallet Tiles
   ========================================================================== */

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.95rem;
  margin-bottom: 1.25rem;
}

.account-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

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

.account-card.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.account-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.account-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.account-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.account-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.metric-pair {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric-val {
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.account-summary-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: 0.65rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

/* Collectors, PDF Passwords & Senders — aligned horizontal pill/button bar */
.tx-right .quick-split-row {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.rule-row {
  align-items: center;
  gap: 0.85rem;
}

.rule-row .tx-left {
  flex: 1 1 0%;
  min-width: 0;
}

.rule-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.rule-actions-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  flex-wrap: nowrap;
}

.rule-actions-row .btn-sm,
.rule-actions-row .rule-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  padding: 0 0.62rem;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 0.42rem;
  box-sizing: border-box;
  white-space: nowrap;
}

.rule-actions-row .rule-status-pill {
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.rule-actions-row .rule-password-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  min-width: 3.4rem;
  text-align: center;
}

@media (max-width: 560px) {
  .rule-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .rule-right {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-subtle);
  }
}

/* ==========================================================================
   Consolidated Trusted Domains & Sender Allowlist Card
   ========================================================================== */

.trusted-domains-card {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.75rem !important;
  padding: 0.9rem 1rem !important;
}

.trusted-domains-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.trusted-domains-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

.trusted-domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.trusted-sender-chip {
  font-family: inherit;
  background-color: var(--accent-primary-soft);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--accent-primary);
}

.trusted-domain-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.trusted-domain-chip-remove:hover {
  color: var(--color-danger, #ef4444);
  background-color: rgba(239, 68, 68, 0.14);
}

.trusted-domains-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

.trusted-domains-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 4.5rem;
}
