
/* ── Account card (shared pattern) ───────────────────────── */
.account-card {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  margin-bottom: 20px;
  overflow: hidden;
}
.account-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
}
.account-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.account-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Connections table ────────────────────────────────────── */
.conn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.conn-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 10px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
}
.conn-table td {
  padding: 12px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.05);
  vertical-align: middle;
}
.conn-table tbody tr:last-child td { border-bottom: none; }
.conn-table tbody tr:hover td { background: rgba(var(--ink-rgb),0.018); }

/* Platform logo — uses global .platform-tile from styles.css */

/* Platform + connection name */
.conn-platform {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.conn-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conn-name-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.conn-name-edit-btn {
  opacity: 0;
  transition: opacity 120ms;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  line-height: 0;
  border-radius: 3px;
}
.conn-table tr:hover .conn-name-edit-btn { opacity: 1; }
.conn-name-edit-btn:hover { color: var(--text-primary); }

.conn-name-input {
  background: var(--navy-deepest);
  border: 1px solid var(--orange);
  border-radius: var(--r-control);
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  width: 200px;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-badge.active   { background: rgba(var(--status-ok-rgb),0.12);  color: var(--status-ok); }
.status-badge.active::before  { background: var(--status-ok); }
/* Warn tokens, not brand orange: a status indicator in the brand colour is indistinguishable
   from primary UI accents, and brand orange is only 3.2:1 as text on the light theme. */
.status-badge.failing  { background: rgba(var(--status-warn-rgb),0.15); color: var(--warn-text); }
.status-badge.failing::before { background: var(--status-warn); }
.status-badge.inactive { background: rgba(var(--ink-rgb),0.06); color: var(--text-muted); }
.status-badge.inactive::before { background: var(--text-muted); }

.conn-failure-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Actions column */
.conn-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.btn-update-warn { color: var(--orange) !important; }

/* Kebab menu */
.kebab-wrap { position: relative; }
.kebab-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  z-index: 200;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.kebab-dropdown[hidden] { display: none; }
.kebab-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background 100ms, color 100ms;
}
.kebab-item:hover { background: rgba(var(--ink-rgb),0.06); color: var(--text-primary); }
.kebab-item.destructive { color: var(--danger-text); }
.kebab-item:disabled { opacity: 0.45; cursor: not-allowed; }
.kebab-item:disabled:hover { background: none; color: inherit; }
.kebab-item.destructive:hover { background: rgba(248,113,113,0.08); }

/* ── Add Connection modal ─────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-card);
  width: 560px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}
.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  flex-shrink: 0;
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(var(--ink-rgb),0.07);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Platform picker */
.platform-search {
  width: 100%;
  background: var(--navy-deepest);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 14px;
  transition: border-color 120ms;
}
.platform-search:focus { border-color: var(--orange); }
.platform-search::placeholder { color: var(--text-muted); }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-control);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  background: var(--navy-mid);
  font-family: inherit;
}
.platform-card:hover { border-color: rgba(var(--orange-rgb),0.45); background: rgba(var(--orange-rgb),0.05); }
.platform-card.is-selected { border-color: var(--orange); background: rgba(var(--orange-rgb),0.1); }
.platform-card[hidden] { display: none; }
.platform-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.platform-card-logo img { width: 22px; height: 22px; object-fit: contain; display: block; }
.platform-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  text-align: center;
}
.platform-no-results {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

/* Credential form (step 2) */
.cred-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
}
.field-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  background: var(--navy-deepest);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 14px;
  transition: border-color 120ms;
}
.field-input:focus { border-color: var(--orange); }
.field-input::placeholder { color: var(--text-muted); }
/* ── Credential form — redesigned 2026-10 (RetailExpress mockup), applies to every ───────────
   manifest-driven platform's modal, not just RetailExpress. Dedicated `cred-*` classes
   throughout so this doesn't touch `.field-label`/`.field-input`, which the Team/Billing/Remove
   Record/Reports-Duplicates pages also rely on. */
.cred-device { display: flex; align-items: center; margin-bottom: 14px; }
.cred-node { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.cred-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cred-dot-o { background: var(--orange); box-shadow: 0 0 0 4px rgba(var(--orange-rgb),0.16); }
.cred-dot-t { background: var(--accent-teal); box-shadow: 0 0 0 4px rgba(var(--accent-teal-rgb),0.16); }
.cred-wire { width: 44px; height: 2px; margin: 0 10px; background: linear-gradient(90deg, var(--orange), var(--accent-teal)); }
.cred-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-teal); margin-bottom: 4px; }
.cred-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.cred-desc { margin-top: 5px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; max-width: 44ch; }

.cred-steps { display: flex; gap: 8px; margin-top: 16px; }
.cred-step { flex: 1; }
.cred-step i { display: block; height: 4px; border-radius: 9999px; background: var(--navy-mid); }
.cred-step.on i { background: var(--orange); }
.cred-step span { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.cred-step.on span { color: var(--text-primary); font-weight: 600; }

.cred-group-title {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 2px;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
}
.cred-group-title::after { content: ''; flex: 1; height: 1px; background: rgba(var(--ink-rgb),0.08); }
.cred-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cred-field { margin-bottom: 14px; }
.cred-field-label {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px;
}
.cred-field .req { color: var(--orange); }
.cred-input-wrap { position: relative; }
.cred-field-input {
  width: 100%; height: 42px; padding: 0 14px; border: 1px solid rgba(var(--ink-rgb),0.12);
  border-radius: 10px; background: var(--navy-deepest); font-size: 14px; color: var(--text-primary);
  font-family: inherit; outline: none; box-sizing: border-box; transition: border-color 120ms, box-shadow 120ms;
}
.cred-field-input::placeholder { color: var(--text-muted); }
.cred-field-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(var(--orange-rgb),0.22); }
.cred-input-wrap.has-btn .cred-field-input { padding-right: 44px; }
.cred-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
}
.cred-eye:hover { background: var(--navy-mid); color: var(--text-primary); }
.cred-hint { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }
.cred-field.err .cred-field-input { border-color: var(--status-error); }
.cred-field.err .cred-hint { color: var(--danger-text); }

.cred-secure {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; margin-top: 4px;
  border-radius: 14px; background: rgba(var(--accent-teal-rgb),0.12); color: var(--text-secondary); font-size: 12.5px; line-height: 1.45;
}
.cred-secure svg { color: var(--accent-teal); flex-shrink: 0; margin-top: 1px; }

/* ── IFS-1585: Simpro funnel connect screens (SimproConnectCard.tsx) ──────────────────────────
   Reuses every `cred-*` token/class above (built for the modal credential form) rather than a
   second parallel design language - these are just the additional pieces that design needed and
   the modal variant never did: a teal info banner, a login/connected status card, a company
   combobox, and red alert cards for the two distinct instance-fetch failure states. */

.cred-note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(var(--accent-teal-rgb),0.12); color: var(--text-secondary);
  font-size: 12.5px; line-height: 1.45;
}
.cred-note svg { color: var(--accent-teal); flex-shrink: 0; margin-top: 1px; }
.cred-static-hint { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }

.cred-login-card {
  border: 1px solid rgba(var(--ink-rgb),0.1); border-radius: var(--r-card); padding: 18px;
}
.cred-login-card.is-connected {
  border-color: rgba(var(--accent-teal-rgb),0.4); background: rgba(var(--accent-teal-rgb),0.05);
}
.cred-login-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cred-login-card:not(.is-connected) .cred-login-row { margin-bottom: 18px; }
.cred-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: rgba(var(--accent-teal-rgb),0.14); color: var(--accent-teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.cred-login-text { min-width: 0; }
.cred-login-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.cred-login-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.cred-connected-pill {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 5px 12px; border-radius: 9999px;
  background: rgba(var(--accent-teal-rgb),0.16); color: var(--accent-teal);
  font-size: 12px; font-weight: 700;
}
.cred-connected-pill svg { width: 11px; height: 11px; }

.cred-combo { position: relative; }
.cred-combo-trigger {
  width: 100%; height: 42px; padding: 0 14px; border: 1px solid rgba(var(--ink-rgb),0.12);
  border-radius: 10px; background: var(--navy-deepest); font-size: 14px; color: var(--text-primary);
  font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; transition: border-color 120ms;
}
.cred-combo-trigger:hover { border-color: rgba(var(--ink-rgb),0.25); }
.cred-combo-trigger span.is-placeholder { color: var(--text-muted); }
.cred-combo-trigger svg { color: var(--text-muted); flex-shrink: 0; }
.cred-combo-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
  background: var(--navy-dark); border: 1px solid rgba(var(--ink-rgb),0.12); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(var(--ink-rgb),0.16); max-height: 240px; overflow-y: auto; padding: 4px;
}
.cred-combo-option {
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-primary); cursor: pointer;
}
.cred-combo-option:hover, .cred-combo-option.is-active { background: rgba(var(--orange-rgb),0.10); }
.cred-combo-option.is-selected { background: rgba(var(--orange-rgb),0.14); }
.cred-combo-option.is-placeholder { color: var(--text-muted); cursor: default; }
.cred-combo-option.is-placeholder:hover { background: none; }

.cred-alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid rgba(var(--status-error-rgb),0.35); border-radius: 12px;
  background: rgba(var(--status-error-rgb),0.06);
}
.cred-alert svg { color: var(--status-error); flex-shrink: 0; margin-top: 1px; }
.cred-alert-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.cred-alert-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }

/* flex:1 (not just width:100%) - this is the second child of ConnectSide's `.funnel-actions`
   (itself `display:flex; justify-content:space-between`) alongside an always-empty `<span/>`
   placeholder; without flex:1 this would only shrink-wrap its own content, leaving the "Step X of
   Y" / buttons space-between with no real width to spread across. */
.cred-footer-row { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 12px; }
.cred-footer-left { font-size: 12px; color: var(--text-muted); }
.cred-footer-btns { display: flex; align-items: center; gap: 10px; }

.cred-steps .cred-step span svg { color: var(--status-ok); vertical-align: -1px; margin-right: 1px; }

/* a failing connection that a published integration relies on */
.conn-attention-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  background: rgba(var(--orange-rgb), 0.08);
  font-size: 13px;
  color: var(--text-primary);
}
.conn-table tr.conn-attention td { background: rgba(var(--orange-rgb), 0.05); }

/* group headings: connections published integrations use, then the rest */
.conn-table tr.conn-group td {
  padding: 8px 24px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(var(--ink-rgb), 0.03);
}

/* Check now result dialog */
.check-modal { width: 520px; }
.check-result { display: flex; gap: 14px; align-items: flex-start; }
.check-result-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.check-result.success .check-result-icon { background: rgba(var(--status-ok-rgb),0.15); color: var(--status-ok); }
.check-result.failure .check-result-icon { background: rgba(var(--status-error-rgb),0.12); color: var(--status-error); }
.check-result.pending .check-result-icon,
.check-result.wait .check-result-icon { background: rgba(var(--status-warn-rgb),0.15); color: var(--warn-text); }
.check-result-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.check-result-conn { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.check-result-msg { font-size: 13px; color: var(--text-primary); margin-top: 10px; line-height: 1.5; }
/* the user log's monospace box (.log-detail-pre) with a lighter tint: its own dark translucent fill measures 3.75:1
   against the text colour in the light theme, this one is above 4.5:1 */
.check-result-detail { margin-top: 14px; max-height: 180px; background: rgba(var(--ink-rgb), 0.06); }
