.admin-body {
  background: var(--bg);
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-pill {
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 4px;
}
.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}
.admin-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.admin-nav a:hover { background: var(--bg); color: var(--ink); }
.admin-nav a.active { background: var(--ink); color: #fff; }

.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.copy-row input {
  flex: 1;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
}
.copy-row button { white-space: nowrap; }

.code-block {
  background: #0f1217;
  color: #d6e0ee;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

/* ===================== Integrations ===================== */

.integration-group {
  margin-bottom: 36px;
}
.integration-group:last-child { margin-bottom: 0; }
.integration-group-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
.integration-group-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.integration-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.integration-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 18, 23, 0.04);
  transition: box-shadow .2s;
}
.integration-card:not(.is-collapsed) {
  box-shadow: 0 4px 14px rgba(15, 18, 23, 0.06);
}

.integration-card.is-collapsed .integration-body { display: none; }
.integration-card.is-collapsed .integration-head { border-bottom-color: transparent; }

.integration-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.integration-head:hover { background: #f3f5f7; }
.integration-chevron {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--muted);
  transition: transform .2s;
  margin-left: 4px;
}
.integration-card:not(.is-collapsed) .integration-chevron { transform: rotate(180deg); }
.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.waymb-icon    { background: linear-gradient(135deg, #e94e5b 0%, #c43d42 100%); }
.nexuspag-icon { background: linear-gradient(135deg, #1ec888 0%, #119464 100%); }
.utmfy-icon    { background: linear-gradient(135deg, #5b8def 0%, #3b6dd8 100%); }
.meta-icon     { background: linear-gradient(135deg, #1877f2 0%, #0d5cc7 100%); }
.tiktok-icon   { background: linear-gradient(135deg, #25f4ee 0%, #fe2c55 100%); }
.custom-icon   {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  font-family: 'Courier New', monospace;
  font-size: 14px;
}
.integration-meta { flex: 1; min-width: 0; }
.integration-meta h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.integration-meta p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.integration-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  flex-shrink: 0;
}
.integration-status.is-on  { background: #e8f8ee; color: #1f8a4f; }
.integration-status.is-off { background: #f1f3f5; color: #6b7480; }

.integration-body {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.integration-section { margin: 0; }
.integration-section h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.integration-section-sub {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 12px;
  line-height: 1.5;
}
.integration-section-sub code,
.integration-meta p code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.integration-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin: 4px -22px -18px;
  padding: 16px 22px;
  background: #fafbfc;
}

.pixel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.pixel-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pixel-row input[type="text"] {
  flex: 1;
  font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
  font-size: 13px;
}
.pixel-row-remove {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-add-pixel {
  align-self: flex-start;
  font-size: 13px;
}

#customHeadScript {
  font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre;
}

.admin-main {
  padding: 32px 20px 80px;
}
.admin-container {
  max-width: 880px;
  margin: 0 auto;
}
.admin-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.admin-subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.save-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: #2dc26b;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(45, 194, 107, 0.3);
  z-index: 100;
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.admin-section legend {
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  color: var(--orange);
  background: #fff7ed;
  border: 1px solid #fde0c2;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.form-field label,
.image-edit-col > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea {
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(246, 141, 61, 0.15);
}

.input-prefix {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-prefix:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(246, 141, 61, 0.15);
}
.input-prefix span {
  padding: 0 12px;
  display: flex;
  align-items: center;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  border-right: 1.5px solid var(--border);
}
.input-prefix input {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.char-counter {
  font-size: 11px;
  color: var(--dim);
  text-align: right;
}

/* Image editor */
.image-edit-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  margin-top: 12px;
  align-items: start;
}
.image-edit-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.image-preview {
  background: var(--chip-bg);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview img,
.image-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-preview {
  width: 160px;
  height: 160px;
  border-radius: 50%;
}
.cover-preview {
  aspect-ratio: 16 / 7;
  width: 100%;
}
.image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.file-btn { cursor: pointer; }

/* Plans editor */
.plans-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  margin-top: 14px;
}
.plan-edit-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.plan-edit-card-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr auto;
  gap: 12px;
  align-items: end;
}
.plan-edit-card .form-field { margin-top: 0; }
.plan-edit-card .form-field label {
  font-size: 11px;
}
.plan-edit-card input {
  padding: 10px 12px;
  font-size: 13px;
}
.plan-edit-card .checkbox-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
  height: 40px;
  padding: 0 4px;
}
.plan-edit-card .checkbox-field input { width: 16px; height: 16px; accent-color: var(--orange); }

/* Per-plan Order Bump section */
.plan-ob-section {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.plan-ob-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 4px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  text-align: left;
}
.plan-ob-toggle:hover {
  background: rgba(0,0,0,.04);
  color: var(--ink);
}
.plan-ob-toggle-icon { font-size: 14px; }
.plan-ob-chevron { margin-left: auto; font-size: 11px; color: var(--muted); }
.plan-ob-body {
  padding: 8px 4px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.plan-ob-body .form-grid { margin-top: 0; }
.plan-ob-body .form-field { margin-top: 10px; }
.plan-ob-body .form-field:first-child { margin-top: 0; }


.posts-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
  margin-top: 14px;
}
.post-edit-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.post-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.post-edit-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
}
.post-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.post-stats-grid .form-field { margin-top: 0; }
.post-stats-grid label { font-size: 12px; }
.post-stats-grid input { padding: 10px 12px; font-size: 13px; }
.post-right-col { display: flex; flex-direction: column; gap: 14px; }
.blur-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.blur-field label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer;
}
.blur-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.blur-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--orange);
}
.blur-slider-row input[type="range"]:disabled { opacity: .4; cursor: not-allowed; }
.post-blur-value {
  min-width: 42px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .post-edit-body { grid-template-columns: 1fr; }
}
.remove-btn {
  background: #fff;
  border: 1.5px solid var(--border-strong);
  color: var(--muted);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: border-color .15s, color .15s, background .15s;
}
.remove-btn:hover {
  border-color: #e5484d;
  color: #e5484d;
  background: #fff5f5;
}

/* Benefits editor */
.benefits-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  margin-top: 14px;
}
.benefit-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.benefit-edit-row input { flex: 1; }

/* ===== Buttons ===== */
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .12s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(246, 141, 61, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(246, 141, 61, 0.35); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary.btn-dirty { animation: pulseDirty 1.4s ease-in-out infinite; }
@keyframes pulseDirty {
  0%, 100% { box-shadow: 0 2px 8px rgba(246, 141, 61, 0.25); }
  50%      { box-shadow: 0 2px 18px rgba(246, 141, 61, 0.6); }
}

.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.btn-danger {
  background: #fff;
  color: #c43d42;
  border-color: #f3c4c6;
}
.btn-danger:hover { background: #fff5f5; border-color: #e5484d; color: #b1252a; }

.btn-submit {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(246, 141, 61, 0.3);
  transition: filter .15s, transform .12s;
}
.btn-submit:hover { filter: brightness(1.05); }
.btn-submit:active { transform: scale(.99); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; }

.admin-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head .admin-subtitle { margin-bottom: 0; }
.page-head .admin-title { margin-bottom: 6px; }

.back-link {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--orange); }

/* ===== Models grid ===== */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.models-loading,
.models-empty {
  grid-column: 1 / -1;
  background: #fff;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.models-empty-icon { font-size: 36px; margin-bottom: 8px; }
.models-empty p { margin: 4px 0; }

.model-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, transform .12s;
}
.model-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.model-card-head { display: flex; align-items: center; gap: 12px; }
.model-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip-bg);
  flex-shrink: 0;
}
.model-meta { flex: 1; min-width: 0; }
.model-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-username {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-flag {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.model-flag .model-currency {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--chip-bg);
  padding: 2px 6px;
  border-radius: 6px;
}
.model-slug {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.model-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.model-card-actions > * { flex: 1; min-width: 0; }
.model-card-actions .btn-danger { flex: 0 0 auto; padding: 10px 12px; }

/* ===== Login page ===== */
.login-main {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.login-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-error {
  background: #fff5f5;
  color: #c43d42;
  border: 1px solid #f3c4c6;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Select dropdown ===== */
.select {
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(246, 141, 61, 0.15);
}

.hint {
  font-size: 11px;
  color: var(--dim);
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 32, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: fadeIn .15s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 800; color: var(--ink); }
.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  line-height: 1;
}
.modal-close:hover { background: var(--chip-bg); color: var(--ink); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.form-actions-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ===== Landing ===== */
.landing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.landing-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.landing-text { color: var(--muted); margin-bottom: 20px; }
.landing-text code {
  background: var(--chip-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.landing-actions { display: flex; justify-content: center; gap: 8px; }

/* ===== Public page loading ===== */
.page-loading {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.page-loading.page-error { color: #c43d42; font-weight: 600; }

@media (max-width: 720px) {
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .image-edit-row { grid-template-columns: 1fr; }
  .avatar-preview { margin: 0 auto; }
  .plan-edit-card {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .plan-edit-card > .remove-btn {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .admin-title { font-size: 22px; }
  .page-head { align-items: stretch; }
  .admin-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .admin-user { display: none; }
  .admin-header-inner { flex-wrap: wrap; }
  .admin-nav { margin-left: 0; width: 100%; order: 3; justify-content: center; }
  .copy-row { flex-direction: column; }
  .integration-head { padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .integration-status { order: 4; margin-left: auto; }
  .integration-body { padding: 16px; }
  .integration-actions { margin: 4px -16px -16px; padding: 14px 16px; }
}

/* Radio group used in the deliverable section */
.radio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radio-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.radio-opt:hover { border-color: #cdd0d4; }
.radio-opt input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--orange);
}
.radio-opt span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text);
}
.radio-opt span small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.radio-opt:has(input:checked) {
  border-color: var(--orange);
  background: #fff7f0;
}
@media (max-width: 600px) {
  .radio-row { grid-template-columns: 1fr; }
}
}

/* ===================== Default Gateway Selector ===================== */
.default-gw-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
  background: #fff;
  user-select: none;
}
.default-gw-option:hover {
  border-color: #d0d0d0;
  background: #fafafa;
}
.default-gw-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
  flex-shrink: 0;
}
.default-gw-option:has(input:checked) {
  border-color: var(--orange);
  background: #fff8f3;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.08);
}
.default-gw-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.default-gw-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.default-gw-info strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.default-gw-info span {
  font-size: 12px;
  color: var(--muted);
}
.default-gw-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  background: #fff0e6;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid #ffd0b0;
}

/* ===================== Crop Modal ===================== */
.crop-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 23, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-modal-dialog {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.crop-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.crop-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.crop-modal-body {
  padding: 20px;
  flex: 1;
  min-height: 300px;
  max-height: 60vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-container {
  width: 100%;
  height: 100%;
  max-height: 50vh;
}
.crop-container img {
  display: block;
  max-width: 100%;
}
.crop-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
