/* Демо-зона: стили расширения + обёртка карточек */

.pex-demo-zone {
  font-size: 13px;
  line-height: 1.45;
  padding: 16px;
  background: #f1f5f9;
}

/* Карточка заявки в демо */
.pex-demo-bid {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.3s;
}
.pex-demo-bid.pex-bid-card {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: none;
}
.pex-demo-bid.highlight-qr {
  border: 1px solid #91d5ff;
  background-color: #e6f7ff;
}
.pex-demo-bid.feedback-requested-style {
  background: repeating-linear-gradient(45deg, #ffebee, #ffebee 10px, #ffcdd2 10px, #ffcdd2 20px);
  border: 1px solid #ef9a9a;
}

.pex-demo-bid__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pex-demo-bid__id {
  font-weight: 700;
  font-size: 13px;
  color: #007fae;
  background: #eef8f0;
  padding: 4px 10px;
  border-radius: 6px;
}

.pex-demo-bid__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.pex-demo-bid__grid strong { display: block; font-size: 13px; margin: 2px 0; }
.pex-demo-bid__grid em { font-style: normal; font-size: 12px; color: #64748b; background: #eef8f0; padding: 4px 8px; border-radius: 4px; display: inline-block; }
.pex-demo-lbl { display: block; font-size: 11px; font-weight: 600; color: #007fae; margin-bottom: 2px; }
.pex-demo-bid__rate { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.pex-demo-profit { color: #28a745 !important; font-size: 12px !important; }

/* Статусы PE */
.pex-demo-zone .stname {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.pex-demo-zone .st_new { background: #2196f3; }
.pex-demo-zone .st_payed { background: #0aa89e; }
.pex-demo-zone .st_success { background: #4caf50; }
.pex-demo-zone .st_verify { background: #ff9800; }

/* ─── Extension styles scoped ─── */
.pex-demo-zone .requisites-block {
  width: 100%;
  padding: 8px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  resize: none;
  background: #f8f9fa;
  transition: background 0.2s;
  box-sizing: border-box;
}
.pex-demo-zone .requisites-block.copy-success { background: #d4edda; border-color: #c3e6cb; }
.pex-demo-zone .requisites-block.remote-update { animation: flashYellow 1.5s ease-out; }
.pex-demo-zone .requisites-block.blurred { filter: blur(5px); pointer-events: none; }
@keyframes flashYellow {
  0% { background: #fff3cd; }
  100% { background: #f8f9fa; }
}

.pex-demo-zone .requisites-container { position: relative; }
.pex-demo-zone .remote-update-notice {
  position: absolute;
  bottom: 4px; right: 4px;
  font-size: 9px;
  padding: 2px 6px;
  background: #d1ecf1;
  color: #0c5460;
  border-radius: 3px;
}

.pex-demo-zone .payments-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pex-demo-zone .payments-btn.green-btn { background: #28a745; }

.pex-demo-zone .remaining-amount-display {
  font-size: 13px;
  margin-top: 8px;
  padding: 4px;
}
.pex-demo-zone .copyable-amount {
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}
.pex-demo-zone .copyable-amount.copy-animation { animation: flashGreen 0.5s ease-out; }
@keyframes flashGreen {
  0%, 100% { background: transparent; }
  50% { background: #d4edda; }
}

/* Таймер */
.pex-demo-zone .pex-bid-timer {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
}
.pex-demo-zone .pex-bid-timer.timer-level-none { background: #e8f5e9; }
.pex-demo-zone .pex-bid-timer.timer-level-yellow { background: #fff8e1; }
.pex-demo-zone .pex-bid-timer.timer-level-orange { background: #fff3e0; }
.pex-demo-zone .pex-bid-timer.timer-level-red { background: #ffebee; }
.pex-demo-zone .pex-bid-timer.timer-vstrechka { border: 1px solid #f48fb1; }

.pex-demo-zone .pex-timer-flame {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pex-demo-zone .flame-none { background: #28a745; }
.pex-demo-zone .flame-yellow { background: #ffc107; box-shadow: 0 0 6px rgba(255,193,7,0.8); }
.pex-demo-zone .flame-orange { background: #fd7e14; box-shadow: 0 0 6px rgba(253,126,20,0.8); }
.pex-demo-zone .flame-red { background: #dc3545; box-shadow: 0 0 6px rgba(220,53,69,0.85); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

.pex-demo-zone .pex-timer-remaining {
  font-family: Consolas, monospace;
  font-weight: 700;
  font-size: 12px;
}
.pex-demo-zone .pex-timer-alert {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.pex-demo-zone .timer-alert-yellow { background: #fff3cd; color: #664d03; }
.pex-demo-zone .timer-alert-orange { background: #ffe5d0; color: #7f2704; }
.pex-demo-zone .timer-alert-red { background: #dc3545; color: #fff; }
.pex-demo-zone .pex-vstrechka-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #880e4f;
  background: #f8bbd0;
}
.pex-demo-zone .pex-timer-alert[hidden] { display: none; }

.pex-demo-zone .pex-timer-add-btn {
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
}
.pex-demo-zone .pex-timer-add-btns {
  display: inline-flex;
  gap: 4px;
}
.pex-demo-zone .pex-timer-deadline {
  color: #495057;
  white-space: nowrap;
  border: none;
  background: rgba(255, 255, 255, 0.65);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline dotted;
}
.pex-demo-zone .pex-timer-deadline:hover {
  background: #fff;
  color: #0056b3;
}
.pex-demo-zone .pex-timer-remaining.is-overdue { color: #dc3545; }

.pex-deadline-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid #adb5bd;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 20;
  position: relative;
}
.pex-deadline-editor label { font-size: 11px; font-weight: 600; width: 100%; }
.pex-deadline-editor input {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 12px;
}
.pex-deadline-editor button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pex-deadline-save { background: #28a745; color: #fff; }
.pex-deadline-cancel { background: #6c757d; color: #fff; }

.pex-demo-zone .requisites-controls {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.pex-demo-zone .req-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  color: #495057;
}
.pex-demo-zone .req-btn:hover { background: #f8f9fa; border-color: #007bff; color: #007bff; }
.pex-demo-zone .requisites-container.is-editing .requisites-block {
  border-color: #007bff;
  background: #fff;
}
.pex-demo-zone .requisites-container.is-editing .requisites-block[readonly] { background: #f8f9fa; }

.pex-demo-bid .pay-modal {
  position: relative;
  z-index: 5;
}

.pex-demo-zone .pex-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
  color: #495057;
}
.pex-demo-zone .pex-feedback-btn.active {
  border-color: #ffc107;
  background: #fff8e1;
  color: #ffc107;
}

/* Попап демо */
.popup-frame {
  max-width: 340px;
  margin: 0 auto;
  background: #f9f9f9;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #333;
}
.popup-frame .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.popup-frame .popup-header h4 {
  margin: 0;
  font-size: 18px;
  color: #005a9e;
}
.popup-frame .status-light-green,
.popup-frame .status-light-red {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.popup-frame .status-light-green { background: #28a745; box-shadow: 0 0 5px #28a745; }
.popup-frame .status-light-red { background: #dc3545; box-shadow: 0 0 5px #dc3545; }
.popup-frame .cbr-rate {
  text-align: center;
  font-weight: 700;
  color: #005a9e;
  background: #e7f3fe;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
.popup-frame .api-block {
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 12px;
}
.popup-frame .api-block label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.popup-frame .api-row { display: flex; }
.popup-frame .api-row input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
}
.popup-frame .api-row button {
  padding: 8px 14px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.popup-frame .api-row button:hover { background: #0056b3; }
.popup-frame .enc-block {
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.popup-frame .enc-block h5 { margin: 0 0 6px; font-size: 14px; }
.popup-frame .btn-row { display: flex; gap: 8px; }
.popup-frame .btn-row button {
  flex: 1;
  padding: 10px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.popup-frame .success { color: #28a745; font-size: 12px; margin-top: 6px; }

/* Новости модалка */
.news-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.news-modal.is-open { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.news-modal__box {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 32px;
  border-radius: 16px;
  width: min(640px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.4s var(--ease, ease);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.news-modal__close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: #7f8c8d;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.news-modal__close:hover { color: #ecf0f1; }
.news-modal__box h2 { color: #1abc9c; text-align: center; margin-bottom: 24px; font-size: 22px; }

.news-modal .news-item {
  border: 1px solid #34495e;
  padding: 18px;
  border-radius: 8px;
  background: #34495e;
  margin-bottom: 16px;
}
.news-modal .news-item.unread { border-left: 4px solid #e67e22; background: #4a5a6a; }
.news-modal .news-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #95a5a6;
  margin-bottom: 10px;
}
.news-modal .news-header strong { color: #1abc9c; }
.news-modal .mark-read-btn {
  margin-top: 10px;
  padding: 6px 14px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

/* Платежи модалка inline */
.pay-modal {
  display: none;
  margin-top: 12px;
  background: #fefefe;
  border: 1px solid #888;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: slideUp 0.3s ease;
}
.pay-modal.is-open { display: block; }
.pay-modal__head {
  padding: 12px 16px;
  background: #f1f1f1;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}
.pay-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
}
.pay-modal__body { padding: 16px; }
.pay-modal .payment-item {
  padding: 14px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  background: #f9f9f9;
  margin-bottom: 10px;
  font-size: 13px;
}
.pay-modal .payment-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #6c757d;
  margin-bottom: 8px;
}
.pay-modal .payment-profit-usdt { font-weight: 700; color: #28a745; }
.pay-modal .add-payment-btn {
  width: 100%;
  padding: 8px;
  border: 1px dashed #ccc;
  background: #f8f8f8;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
  font-size: 13px;
}
.pay-modal .total-profit {
  margin-top: 12px;
  font-weight: 700;
  text-align: right;
  font-size: 14px;
}
.pay-modal .save-payments-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

/* Admin bar demo */
.demo-adminbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #23282d;
  color: #eee;
  font-size: 12px;
  border-radius: 0;
  min-height: 42px;
}
.demo-adminbar.compare-adminbar {
  flex-wrap: nowrap;
}
@media (max-width: 640px) {
  .demo-adminbar.compare-adminbar { flex-wrap: wrap; min-height: 44px; }
}
.demo-adminbar__ghost {
  visibility: hidden;
}
.demo-adminbar > span:first-child { flex: 1; min-width: 120px; }
.demo-adminbar__news {
  background: #007bff;
  padding: 4px 14px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 11px;
}
.demo-adminbar__dot {
  width: 6px; height: 6px;
  background: #dc3545;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.2s infinite;
}
.demo-adminbar__stat {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.stat-y { background: #ffc107; color: #212529; }
.stat-o { background: #fd7e14; color: #fff; }
.stat-r { background: #dc3545; color: #fff; }
.stat-v { background: #f8bbd0; color: #880e4f; }

@media (max-width: 640px) {
  .pex-demo-bid__grid { grid-template-columns: 1fr; }
}
