/* =========================================================
   INTEGRATIONS
   One card per system: what it is, whether it is configured, where the
   credentials came from, and what the last connection test said.
========================================================= */

.int-summary { font-size: 12px; font-weight: 700; color: var(--text-2); }

.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.int-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), transform var(--transition);
}

.int-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.int-card-top { display: flex; align-items: center; gap: 10px; }

.int-mark {
    flex: 0 0 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--ink, #0e1b28);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .02em;
}

.int-card h3 { margin: 0; flex: 1; min-width: 0; font-size: 14.5px; font-weight: 800; color: var(--text); }
.int-card-cat { font-size: 10.5px; font-weight: 700; color: var(--text-3); }
.int-blurb { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }

.int-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
}

.int-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.int-state.is-connected { background: var(--success-soft); color: var(--success); }
.int-state.is-available { background: var(--surface-soft); color: var(--text-3); }

.int-meta { display: flex; flex-wrap: wrap; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.int-meta span { padding: 2px 8px; border-radius: 999px; background: var(--surface-soft); }
.int-meta .is-ok { background: var(--success-soft); color: var(--success); }
.int-meta .is-bad { background: var(--danger-soft); color: var(--danger); }

.int-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.int-card-actions .btn { padding: 5px 11px; font-size: 11.5px; }

.int-section { margin-top: 26px; }
.int-section-head { margin-bottom: 10px; }
.int-section-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.int-section-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-2); }

.int-grid.is-soon .int-card { opacity: .72; background: var(--surface-soft); box-shadow: none; }
/* A brand's own colour carries the mark; the inline style sets it. */
.int-mark.is-brand svg { display: block; }

/* Coming-soon cards stay quiet — except a real brand keeps its colour, so the
   row still reads as "this is Meta Ads" rather than a row of grey tiles. */
.int-grid.is-soon .int-mark:not(.is-brand) { background: var(--border-strong); color: var(--text-2); }
.int-grid.is-soon .int-mark.is-brand { opacity: .65; }
.int-grid.is-soon .int-card:hover { transform: none; }
.int-soon-tag { padding: 2px 8px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 10px; font-weight: 800; }

/* ---------- configure ---------- */

.modal-overlay .int-modal { width: min(560px, 100%); max-width: none; }
.int-modal-sub { margin-top: 3px; font-size: 11px; color: var(--text-3); }
.int-fields { display: flex; flex-direction: column; gap: 12px; }

.int-field { display: flex; flex-direction: column; gap: 5px; }
.int-field span { font-size: 12px; font-weight: 700; color: var(--text); }
.int-field small { font-size: 11px; color: var(--text-3); }
.int-field .lab-input { width: 100%; }
.int-field .is-secret { font-family: var(--mono, ui-monospace, monospace); }

.int-note { margin: 12px 0 0; padding: 9px 11px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.int-note:empty { display: none; }
.int-note.is-ok { background: var(--success-soft); color: var(--success); }
.int-note.is-bad { background: var(--danger-soft); color: var(--danger); }
.int-note.is-plain { background: var(--surface-soft); color: var(--text-2); }

.int-spacer { flex: 1; }
.int-modal .modal-footer { align-items: center; }
.int-modal .btn-ghost { color: var(--danger); }
