.mpay-flow-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 18, .78);
  backdrop-filter: blur(6px);
}

.mpay-flow-dialog {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  color: #eaf2ff;
  background: #071426;
  border: 1px solid #23466f;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.mpay-flow-dialog-head,
.mpay-flow-dialog-actions,
.mpay-section-title-row,
.mpay-linked-bot,
.mpay-add-bot > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mpay-flow-dialog h2,
.mpay-flow-bots-panel h2,
.mpay-flow-bots-panel h3 { margin: 0; letter-spacing: 0; }
.mpay-flow-dialog p,
.mpay-flow-bots-panel p { margin: 4px 0 0; color: #8191a8; }
.mpay-flow-dialog label,
.mpay-cache-grid label { display: grid; gap: 7px; color: #c8d5e7; font-size: 13px; font-weight: 650; }
.mpay-flow-dialog input,
.mpay-flow-dialog select,
.mpay-add-bot select,
.mpay-cache-grid input,
.mpay-cache-grid select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: #eef6ff;
  background: #050d19;
  border: 1px solid #284866;
  border-radius: 7px;
  outline: none;
}
.mpay-flow-dialog input:focus,
.mpay-flow-dialog select:focus,
.mpay-add-bot select:focus,
.mpay-cache-grid input:focus,
.mpay-cache-grid select:focus { border-color: #3797ff; box-shadow: 0 0 0 3px rgba(55,151,255,.12); }
.mpay-flow-dialog button,
.mpay-add-bot button,
.mpay-cache-card > button,
.mpay-empty-bots a {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #2d75c8;
  border-radius: 7px;
  color: #eef7ff;
  background: #2388f4;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.mpay-flow-dialog-actions { justify-content: flex-end; }
.mpay-flow-dialog-actions button:first-child { color: #aebbd0; background: transparent; border-color: #314259; }
.mpay-icon-button { width: 38px; padding: 0 !important; background: transparent !important; border-color: transparent !important; font-size: 24px; }
.mpay-warning-dialog { background: #141414; border-color: #2b2b2b; border-radius: 8px; }
.mpay-warning-content { display: flex; gap: 16px; align-items: flex-start; }
.mpay-warning-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ff3445;
  background: rgba(255, 52, 69, .12);
  border: 1px solid rgba(255, 52, 69, .22);
  border-radius: 8px;
  font-weight: 900;
}

.mpay-flow-bots-panel {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin: 18px auto 24px;
}

.mpay-flow-summary,
.mpay-linked-bots,
.mpay-cache-card {
  padding: 20px;
  color: #eaf2ff;
  background: rgba(6, 18, 35, .94);
  border: 1px solid #1d3a5a;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .16);
}
.mpay-flow-summary { grid-column: 1 / -1; }
.mpay-section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.mpay-section-title h2 { font-size: 17px; }
.mpay-section-title p { font-size: 12px; }
.mpay-title-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #55aaff;
  background: #0c2c50;
  border: 1px solid #174a78;
  border-radius: 7px;
  font-weight: 800;
}
.mpay-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mpay-summary-grid > div { min-height: 74px; display: grid; place-content: center; text-align: center; background: #0a1728; border: 1px solid #172f4a; border-radius: 7px; }
.mpay-summary-grid span { color: #8090a7; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.mpay-summary-grid strong { margin-top: 5px; font-size: 18px; }
.mpay-section-title-row > span { color: #778aa3; font-size: 12px; }
.mpay-linked-list { display: grid; gap: 9px; }
.mpay-linked-bot { min-height: 64px; justify-content: flex-start; padding: 10px 12px; background: #0a1728; border: 1px solid #1b3958; border-radius: 7px; }
.mpay-linked-bot.is-pending { opacity: .62; }
.mpay-bot-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; color: #72b9ff; background: #0e3157; border-radius: 7px; font-weight: 800; }
.mpay-bot-copy { min-width: 0; flex: 1; }
.mpay-bot-copy > div { display: flex; align-items: center; gap: 8px; }
.mpay-bot-copy strong,
.mpay-bot-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpay-bot-copy span { padding: 2px 7px; color: #5ee3af; background: #0b3b36; border-radius: 4px; font-size: 10px; font-weight: 800; }
.mpay-bot-copy small { margin-top: 3px; color: #8191a8; }
.mpay-switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.mpay-switch input { position: absolute; opacity: 0; }
.mpay-switch span { position: absolute; inset: 0; border-radius: 999px; background: #233449; transition: .18s ease; }
.mpay-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8190a3; transition: .18s ease; }
.mpay-switch input:checked + span { background: #2388f4; }
.mpay-switch input:checked + span::after { left: 21px; background: white; }
.mpay-unlink-button { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #ff6573; background: transparent; border: 1px solid #5e2935; border-radius: 7px; font-size: 22px; cursor: pointer; }
.mpay-empty-bots { min-height: 160px; display: grid; place-items: center; align-content: center; gap: 5px; color: #b7c5d8; border: 1px dashed #255081; border-radius: 7px; }
.mpay-empty-bots span { color: #71839d; font-size: 13px; }
.mpay-empty-bots a { display: inline-flex; align-items: center; margin-top: 10px; }
.mpay-add-bot { margin-top: 16px; padding-top: 16px; border-top: 1px solid #173350; }
.mpay-add-bot h3 { margin-bottom: 10px; font-size: 14px; }
.mpay-add-bot select { flex: 1; }
.mpay-add-bot p { font-size: 12px; }
.mpay-add-bot button:disabled,
.mpay-cache-card button:disabled { opacity: .45; cursor: not-allowed; }
.mpay-cache-grid { display: grid; gap: 13px; }
.mpay-cache-select-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; }
.mpay-cache-refresh {
  width: 42px;
  height: 42px;
  padding: 0;
  color: #a9cfff;
  background: #0a1728;
  border: 1px solid #284866;
  border-radius: 7px;
  font-size: 21px;
  cursor: pointer;
}
.mpay-cache-refresh:hover { color: white; border-color: #3797ff; background: #0e2947; }
.mpay-cache-refresh:disabled { opacity: .45; cursor: not-allowed; }
.mpay-cache-grid small { color: #71839d; font-size: 11px; font-weight: 500; }
.mpay-cache-grid .mpay-cache-error { color: #ff9aa5; }
.mpay-cache-card > button { width: 100%; margin-top: 14px; }

@media (max-width: 900px) {
  .mpay-flow-bots-panel { grid-template-columns: 1fr; padding: 0 12px; }
  .mpay-flow-summary { grid-column: auto; }
  .mpay-summary-grid { grid-template-columns: 1fr; }
  .mpay-add-bot > div { align-items: stretch; flex-direction: column; }
}
