/* integrations-admin.css — live data sources panel */

.int-admin {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 920px;
}

/* ── Demo data master card ─────────────────────────────── */
.int-demo-card {
  border: 1px solid #e8e3da;
  background: #fdfaf3;
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.int-demo-card.wiped {
  background: #f4f7f4;
  border-color: #d4ddd4;
}
.int-demo-head {
  display: flex;
  gap: 14px;
  flex: 1;
  min-width: 280px;
}
.int-demo-icon {
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #d8d2c4;
  display: flex; align-items: center; justify-content: center;
  color: #b07d2e;
  flex-shrink: 0;
}
.int-demo-card.wiped .int-demo-icon { color: #2c5d3f; border-color: #c8d6c8; }
.int-demo-title {
  font-size: 15px; font-weight: 600; color: #1f2723; margin-bottom: 4px;
}
.int-demo-sub {
  font-size: 13px; color: #5b5447; line-height: 1.55; max-width: 540px;
}
.int-demo-confirm {
  flex-basis: 100%;
  background: #fff;
  border: 1px solid #e8c89a;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 8px;
}
.int-demo-confirm-text {
  font-size: 13px; color: #3a342a; line-height: 1.55;
}
.int-demo-confirm-text strong { color: #8a3a1f; }
.int-demo-confirm-actions {
  display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.int-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 4px;
  border-bottom: 1px solid #ece7dd;
}
.int-summary {
  font-size: 13px; color: #5b5447;
}
.int-summary strong { color: #1f2723; font-size: 15px; }

/* ── Group header ────────────────────────────────────────── */
.int-group {
  display: flex; flex-direction: column; gap: 12px;
}
.int-group-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8268;
  padding: 0 2px;
}
.int-group-list { display: flex; flex-direction: column; gap: 10px; }

/* ── Integration card ────────────────────────────────────── */
.int-card {
  background: #fff;
  border: 1px solid #ece7dd;
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.int-card-connected { border-color: #d8e2d6; }
.int-card-error     { border-color: #e6c8c0; }

.int-card-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.int-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.int-card-meta { flex: 1; min-width: 0; }
.int-card-name {
  font-size: 14px; font-weight: 600; color: #1f2723;
  display: flex; align-items: center; gap: 8px;
}
.int-cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a8268;
  background: #f5f1e7;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.int-card-tagline {
  font-size: 12.5px; color: #5b5447; margin-top: 3px; line-height: 1.45;
}

/* status pill */
.int-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.int-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #aaa;
}
.int-status-connected   { background: #ecf3eb; color: #2c5d3f; }
.int-status-connected   .int-status-dot { background: #4a9162; }
.int-status-disconnected{ background: #f4f1ea; color: #7a715b; }
.int-status-connecting,
.int-status-syncing     { background: #f0eef9; color: #4f4593; }
.int-status-connecting .int-status-dot,
.int-status-syncing    .int-status-dot { background: #635bff; animation: int-pulse 1s infinite; }
.int-status-error       { background: #f7ece8; color: #8a3a1f; }
.int-status-error       .int-status-dot { background: #c14a26; }

@keyframes int-pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.35; }
}

.int-card-scopes {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 14px;
}
.int-retention-note {
  font-size: 12px;
  color: #4a6b3d;
  background: #f0f6ec;
  border: 1px solid #d8e6cf;
  padding: 7px 10px;
  border-radius: 5px;
  margin: -4px 0 12px;
  line-height: 1.45;
}
.int-scope {
  font-size: 11.5px;
  background: #f5f1e7;
  color: #5b5447;
  padding: 3px 9px;
  border-radius: 4px;
}

.int-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0ebe1;
}
.int-card-meta-line { font-size: 12px; color: #5b5447; }
.int-card-meta-line strong { color: #1f2723; }
.int-card-actions { display: flex; gap: 8px; align-items: center; }

/* buttons */
.int-btn-primary, .int-btn-secondary, .int-btn-danger, .int-btn-ghost {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.1s;
  font-family: inherit;
}
.int-btn-primary { background: #1f3d2c; color: #fff; }
.int-btn-secondary { background: #fff; color: #1f2723; border-color: #d8d2c4; }
.int-btn-danger  { background: #8a3a1f; color: #fff; }
.int-btn-ghost   { background: transparent; color: #5b5447; border-color: #d8d2c4; }
.int-btn-primary:hover, .int-btn-secondary:hover, .int-btn-danger:hover, .int-btn-ghost:hover {
  filter: brightness(0.95);
}
.int-btn-primary:disabled, .int-btn-secondary:disabled {
  opacity: 0.5; cursor: not-allowed;
}

.int-link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #5b5447; text-decoration: underline;
  font-family: inherit;
}
.int-link:hover { color: #1f2723; }
.int-link-danger { color: #8a3a1f; }

/* sync result toast */
.int-sync-result {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12.5px;
}
.int-sync-result.good { background: #ecf3eb; color: #2c5d3f; }
.int-sync-result.bad  { background: #f7ece8; color: #8a3a1f; }

/* mapping panel */
.int-mapping {
  margin-top: 12px;
  background: #faf7f0;
  border: 1px solid #ece7dd;
  border-radius: 6px;
  padding: 12px 14px;
}
.int-mapping-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a8268;
  margin-bottom: 10px;
}
.int-mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.int-mapping-table th {
  text-align: left;
  font-weight: 500;
  color: #5b5447;
  padding: 5px 0;
  border-bottom: 1px solid #ece7dd;
}
.int-mapping-table td {
  padding: 5px 0;
  border-bottom: 1px solid #f4efe5;
  vertical-align: top;
  color: #1f2723;
  font-size: 11.5px;
  line-height: 1.5;
}
.int-mapping-table td.mono, .int-mapping-table th {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.int-arrow { color: #8a8268; margin-right: 4px; }
.int-mapping-writes {
  margin-top: 10px;
  font-size: 11.5px;
  color: #5b5447;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.int-mapping-writes code {
  background: #fff;
  border: 1px solid #ece7dd;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
}

.int-footer-note {
  font-size: 12.5px;
  color: #5b5447;
  background: #faf7f0;
  border: 1px solid #ece7dd;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.55;
}
.int-footer-note strong { color: #1f2723; }
.int-footer-note code {
  background: #fff;
  border: 1px solid #ece7dd;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Credential modal (CredentialsModal + PlaidCredsModal) ───────────────
   These classes were referenced by the JSX but never styled, so the modal
   rendered as unstyled, near-invisible divs. Explicit colors below (light
   panel, dark text) so it is readable as an overlay on the dark app shell. */
.int-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.int-modal {
  background: #fff; color: #1f2723;
  border: 1px solid #ece7dd; border-radius: 12px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.int-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid #ece7dd;
}
.int-modal-title { font-size: 16px; font-weight: 700; color: #1f2723; }
.int-modal-sub { font-size: 12.5px; color: #5b5447; margin-top: 2px; line-height: 1.45; }
.int-modal-sub a { color: #1f3d2c; font-weight: 600; }
.int-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.int-modal-field { display: flex; flex-direction: column; gap: 5px; }
.int-modal-field > span { font-size: 12.5px; font-weight: 600; color: #1f2723; }
.int-modal-field input,
.int-modal-field select {
  width: 100%; box-sizing: border-box;
  padding: 9px 11px; font-size: 14px;
  border: 1px solid #d8d2c4; border-radius: 8px;
  background: #fff; color: #1f2723;
}
.int-modal-field input:focus,
.int-modal-field select:focus { outline: none; border-color: #1f3d2c; }
.int-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid #ece7dd;
}

/* ── Plaid linked-accounts picker ─────────────────────────────────────── */
.int-plaid-accts { margin-top: 12px; border-top: 1px solid #ece7dd; padding-top: 12px; }
.int-plaid-accts-head {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px;
  font-size: 12.5px; color: #5b5447; margin-bottom: 8px;
}
.int-plaid-cash { color: #1f2723; }
.int-plaid-cash strong { color: #1f3d2c; }
.int-plaid-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid #f2eee6;
}
.int-plaid-acct-name { font-size: 13px; color: #1f2723; font-weight: 600; }
.int-plaid-official { font-weight: 400; color: #8a8272; font-size: 12px; }
.int-plaid-acct-bal { font-size: 13px; color: #1f2723; font-variant-numeric: tabular-nums; }
.int-plaid-acct-ctl { min-width: 130px; text-align: right; }
.int-plaid-check { font-size: 12.5px; color: #1f2723; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.int-plaid-check input { width: 15px; height: 15px; accent-color: #1f3d2c; cursor: pointer; }
.int-plaid-debt { font-size: 11.5px; color: #8a3a1f; background: #f6ede8; border-radius: 999px; padding: 2px 9px; }
.int-plaid-note { font-size: 11.5px; color: #8a8272; margin-top: 8px; line-height: 1.5; }

/* ── Plaid bank activity (cash in/out) ────────────────────────────────── */
.int-plaid-activity { margin-top: 14px; border-top: 1px solid #ece7dd; padding-top: 12px; }
.int-days-wrap { display: inline-flex; gap: 4px; }
.int-days { font-size: 11.5px; border: 1px solid #d8d2c4; background: #fff; color: #5b5447; border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.int-days.on { background: #1f3d2c; color: #fff; border-color: #1f3d2c; }
.int-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
.int-flow-cell { background: #faf8f4; border: 1px solid #ece7dd; border-radius: 8px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.int-flow-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #8a8272; }
.int-flow-in { font-size: 16px; font-weight: 700; color: #1f7a4d; font-variant-numeric: tabular-nums; }
.int-flow-out { font-size: 16px; font-weight: 700; color: #8a3a1f; font-variant-numeric: tabular-nums; }
.int-txns { display: flex; flex-direction: column; }
.int-txn { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f4f0e8; font-size: 12.5px; }
.int-txn-date { color: #8a8272; font-variant-numeric: tabular-nums; }
.int-txn-descr { color: #1f2723; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-txn-in { color: #1f7a4d; font-weight: 600; font-variant-numeric: tabular-nums; }
.int-txn-out { color: #5b5447; font-variant-numeric: tabular-nums; }
