/* ── Selje shared layout & brand ───────────────────────────────── */
.svf-settings-page {
  --selje-brand: #2e7d7a;
  --selje-brand-light: #ebf5f4;
  background: var(--selje-brand-light);
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
}

/* Header card */
.svf-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-left: 3px solid var(--selje-brand);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.svf-settings-header h1 {
  margin: 0;
  font-size: 1.3em;
  line-height: 1.4;
}

.svf-settings-header__subtitle {
  color: #646970;
  margin-top: 4px;
  font-size: 13px;
}

.svf-settings-header__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Version badge */
.svf-version {
  display: inline-block;
  background: #f6f7f7;
  border: 1px solid var(--selje-brand);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--selje-brand);
  font-size: 12px;
}

/* Two-column layout */
.svf-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 16px;
  align-items: start;
}

.svf-settings-main {
  min-width: 0;
}

/* Main content card */
.svf-settings-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 14px 16px;
  min-width: 0;
}

/* Sidebar */
.svf-settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.svf-sidebar-box {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 12px;
  min-width: 0;
}

.svf-sidebar-box h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
}

.svf-doc-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.svf-doc-links li {
  margin: 6px 0;
}

.svf-doc-links a {
  font-size: 13px;
}

/* Donate button sizing (colour kept via swpb-donate-button) */
.svf-donate-button {
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.8;
  padding: 0 10px;
  min-height: auto;
}

/* Active tab brand colour */
.svf-settings-page .nav-tab-active,
.svf-settings-page .nav-tab-active:hover,
.svf-settings-page .nav-tab-active:focus {
  border-bottom-color: var(--selje-brand);
  color: var(--selje-brand);
}

@media (max-width: 782px) {
  .svf-settings-layout {
    grid-template-columns: 1fr;
  }
}
/* ─────────────────────────────────────────────────────────────── */


/* Warm orange complements the teal brand; white text meets WCAG AA (~5.2:1).
   .wp-core-ui .button prefix is needed to override core .button-secondary styles. */
.wp-core-ui .button.swpb-donate-button,
.wp-core-ui .button.swpb-donate-button:visited {
  background: #c2410c;
  border-color: #c2410c;
  color: #ffffff;
  font-weight: 700;
}

.wp-core-ui .button.swpb-donate-button:hover,
.wp-core-ui .button.swpb-donate-button:focus {
  background: #9a3412;
  border-color: #9a3412;
  color: #ffffff;
}

.wp-core-ui .button.swpb-donate-button:focus {
  box-shadow: 0 0 0 1px #ffffff, 0 0 0 3px #9a3412;
}

/* ── Tooltip info icons ─────────────────────────────────────────── */
.swpb-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  background: #646970;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  cursor: help;
  position: relative;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  text-decoration: none;
}

.swpb-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1d2327;
  color: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: 240px;
  max-width: 240px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.swpb-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1d2327;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
}

.swpb-tip:hover::after,
.swpb-tip:hover::before {
  opacity: 1;
}

/* Flip tooltip above when near right edge */
.svf-settings-sidebar .swpb-tip::after {
  left: auto;
  right: 0;
  transform: none;
}

.svf-settings-sidebar .swpb-tip::before {
  left: auto;
  right: 4px;
  transform: none;
}

/* ── Redirect URI row ───────────────────────────────────────────── */
.swpb-redirect-uri-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.swpb-redirect-uri-row code {
  flex: 1 1 auto;
  word-break: break-all;
}

/* ── Sidebar section headings ───────────────────────────────────── */
.swpb-dev-section-heading {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d2327;
  border-bottom: 1px solid #dcdcde;
  padding-bottom: 6px;
}

.swpb-sidebar-heading {
  margin: 12px 0 4px 0;
  font-size: 12px;
  font-weight: 700;
  color: #1d2327;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Documentation modal ────────────────────────────────────────── */
.swpb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.swpb-modal-box {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.swpb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #dcdcde;
  flex-shrink: 0;
}

.swpb-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #646970;
  padding: 2px 6px;
  border-radius: 3px;
}

.swpb-modal-close:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.swpb-modal-body {
  overflow-y: auto;
  padding: 16px 18px;
  flex: 1 1 auto;
}

.swpb-readme-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  color: #1d2327;
}

/* ── seljeBackup ──────────────────────────────────────────────── */
.swpb-tabs {
  margin-bottom: 12px;
}

.swpb-card {
  margin-bottom: 16px;
}

.swpb-card h2 {
  margin-top: 0;
}

.swpb-backup-now {
  border-left: 3px solid var(--selje-brand);
}

.swpb-backup-now__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.swpb-backup-now__controls .description {
  flex-basis: 100%;
  margin: 0;
}

.wp-core-ui .swpb-backup-now .button-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wp-core-ui .swpb-backup-now .button-hero .dashicons,
.wp-core-ui .swpb-backup-now .button-hero .dashicons::before {
  color: #fff;
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.wp-core-ui .swpb-backup-now .button-hero .dashicons {
  margin: 0;
  vertical-align: baseline;
}

.wp-core-ui .swpb-page .button-primary {
  background: var(--selje-brand);
  border-color: var(--selje-brand);
}

.wp-core-ui .swpb-page .button-primary:hover,
.wp-core-ui .swpb-page .button-primary:focus {
  background: #256664;
  border-color: #256664;
}

.swpb-progress__label {
  font-weight: 600;
  margin-bottom: 8px;
}

.swpb-progress__bar {
  height: 14px;
  background: #f0f0f1;
  border-radius: 999px;
  overflow: hidden;
}

.swpb-progress__bar span {
  display: block;
  height: 100%;
  background: var(--selje-brand);
  transition: width 0.4s ease;
}

.swpb-progress__log,
.swpb-code {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.swpb-code {
  max-height: none;
  font-size: 12px;
}

.swpb-result {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 4px;
  background: #edfaef;
  border: 1px solid #b8e6bf;
}

.swpb-result.is-error {
  background: #fcf0f1;
  border-color: #f0b8bd;
}

.swpb-result.is-warning {
  background: #fcf9e8;
  border-color: #f0e2a8;
}

.swpb-status-table th {
  width: 150px;
}

.swpb-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.7;
  background: #f0f0f1;
  color: #50575e;
  vertical-align: middle;
}

.swpb-badge--ok {
  background: #edfaef;
  color: #00662e;
}

.swpb-badge--warning {
  background: #fcf9e8;
  color: #7a5b00;
}

.swpb-badge--error {
  background: #fcf0f1;
  color: #8a1f28;
}

.swpb-inline-error {
  color: #8a1f28;
  margin-top: 4px;
}

.swpb-muted {
  color: #646970;
  font-size: 12px;
}

.swpb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wp-core-ui .swpb-actions .button .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
}

.swpb-backups-table .swpb-delete-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  border-left: 1px solid #dcdcde;
  padding-left: 12px;
}

.wp-core-ui .swpb-delete-cell .button-link-delete {
  background: #fcf0f1;
  border-color: #e6a4ab;
  color: #b32d2e;
}

.wp-core-ui .swpb-delete-cell .button-link-delete:hover,
.wp-core-ui .swpb-delete-cell .button-link-delete:focus {
  background: #f7dfe1;
  border-color: #b32d2e;
  color: #8a1f28;
}

.swpb-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.swpb-checks .swpb-check-icon {
  width: 16px;
}

.swpb-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00a32a;
}

.swpb-dot--warning {
  background: #dba617;
}

.swpb-dot--error {
  background: #d63638;
}

.swpb-test-result {
  font-size: 12px;
}

.swpb-test-result.is-ok {
  color: #00662e;
}

.swpb-test-result.is-error {
  color: #8a1f28;
}

.swpb-setup fieldset {
  margin: 0 0 16px;
}

.swpb-setup legend {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.swpb-setup label {
  display: block;
  margin: 4px 0;
}

.swpb-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swpb-type-tile {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #1d2327;
}

.swpb-type-tile:hover,
.swpb-type-tile.is-active {
  border-color: var(--selje-brand);
  color: var(--selje-brand);
  box-shadow: 0 0 0 1px var(--selje-brand);
}

.swpb-type-tile.is-disabled {
  color: #a7aaad;
  cursor: not-allowed;
}

.swpb-guide {
  background: var(--selje-brand-light);
  border-radius: 6px;
  padding: 8px 14px;
}

.swpb-guide h3 {
  margin: 6px 0;
}

.swpb-guide li {
  margin-bottom: 6px;
}

.swpb-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}

.swpb-copy-row code {
  flex: 1 1 auto;
  word-break: break-all;
  padding: 4px 6px;
}

.swpb-guide .swpb-copy-row {
  display: inline-flex;
  margin: 2px 0;
}

.swpb-required {
  color: #d63638;
}

.swpb-dest-form__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #dcdcde;
  padding-top: 12px;
}

.swpb-push-right {
  margin-left: auto;
}

.swpb-new-key {
  background: #fcf9e8;
  border: 1px solid #f0e2a8;
  border-radius: 6px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

.swpb-api-docs {
  margin-top: 16px;
}

/* ── What takes up space? ───────────────────────────────────────── */
.swpb-space__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
}

.swpb-space__stat {
  flex: 1 1 180px;
  background: var(--selje-brand-light);
  border-radius: 6px;
  padding: 8px 12px;
}

.swpb-space__stat-label {
  display: block;
  font-size: 12px;
  color: #50575e;
}

.swpb-space__stat strong {
  font-size: 15px;
}

.swpb-space__tips {
  background: #fcf9e8;
  border: 1px solid #f0e2a8;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.swpb-space__tips ul {
  margin: 6px 0 0 18px;
  list-style: disc;
}

.swpb-space__heading {
  margin: 16px 0 6px;
  font-size: 14px;
}

.swpb-space__table td {
  vertical-align: middle;
  padding-top: 6px;
  padding-bottom: 6px;
}

.swpb-space__name {
  word-break: break-all;
}

.swpb-space__path {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.swpb-space__bar {
  width: 22%;
  min-width: 80px;
}

.swpb-space__barfill {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--selje-brand);
}

.swpb-space__table tr.is-skipped .swpb-space__barfill {
  background: #c3c4c7;
}

.swpb-space__table tr.is-skipped .swpb-space__name {
  color: #646970;
}

.swpb-space__size {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.swpb-space__toggle,
.swpb-space__toggle-spacer {
  display: inline-block;
  width: 18px;
  text-align: center;
  text-decoration: none;
}

.wp-core-ui .swpb-space__action {
  font-size: 12px;
}

@media (max-width: 782px) {
  .swpb-space__bar {
    display: none;
  }
}

.swpb-guide__heading {
  margin: 12px 0 4px;
  font-size: 13px;
}

/* ── Restore guide ─────────────────────────────────────────────── */
.swpb-restore h4 {
  margin: 16px 0 6px;
}

.swpb-restore ol li,
.swpb-restore__list li {
  margin-bottom: 6px;
}

.swpb-restore__list {
  list-style: disc;
  margin-left: 20px;
}

.swpb-restore__code {
  display: block;
  margin: 6px 0 2px;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-all;
}
