/* public/admin/v2/admin.css
 *
 * Admin shell styles. Light theme, mobile-first.
 * Reuses design tokens from the public site (global.css).
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --admin-color-text: #182b38;
  --admin-color-bg: #f4f2eb;
  --admin-color-primary: #215b86;
  --admin-color-primary-hover: #163f60;
  --admin-color-surface: #ffffff;
  --admin-color-surface-soft: #eef4f8;
  --admin-color-border: #cad7e2;
  --admin-color-muted: #6b7c8a;
  --admin-color-focus: #2563eb;

  --admin-font-body: 'Avenir Next', 'Nunito Sans', 'Noto Sans', 'Segoe UI', sans-serif;
  --admin-space-xs: 0.25rem;
  --admin-space-sm: 0.5rem;
  --admin-space-md: 1rem;
  --admin-space-lg: 1.25rem;
  --admin-space-xl: 1.75rem;

  --admin-nav-height: 52px;
  --admin-max-width: 960px;
}

html {
  font-family: var(--admin-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--admin-color-text);
  background: var(--admin-color-bg);
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 3px solid var(--admin-color-focus);
  outline-offset: 2px;
}

/* ── Navigation ── */
.admin-nav-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space-sm);
  padding: var(--admin-space-sm) var(--admin-space-md);
  border-bottom: 1px solid var(--admin-color-border);
  background: var(--admin-color-surface);
  min-height: var(--admin-nav-height);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--admin-color-primary);
  text-decoration: none;
  border: 1px solid var(--admin-color-border);
  background: var(--admin-color-surface-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover {
  background: #dde8f0;
}

.nav-link.current {
  background: var(--admin-color-primary);
  border-color: var(--admin-color-primary-hover);
  color: #fff;
}

.nav-link-alert-active {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626 inset;
}

.nav-link-alert-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  margin-inline-start: 6px;
  flex-shrink: 0;
  animation: nav-alert-pulse 2s ease-in-out infinite;
}

@keyframes nav-alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link-alert-indicator { animation: none; }
}

.nav-link-legacy {
  opacity: 0.7;
  font-size: 12px;
}

.nav-link-legacy:hover {
  opacity: 1;
}

.nav-switchers {
  display: flex;
  align-items: center;
  gap: var(--admin-space-md);
  flex-wrap: wrap;
}

.nav-logout {
  background: none;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--admin-color-muted);
  cursor: pointer;
  font-family: inherit;
}
.nav-logout:hover {
  color: var(--admin-color-text);
  border-color: var(--admin-color-muted);
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--admin-space-xs);
}

.lang-switcher-label {
  font-size: 11px;
  color: var(--admin-color-muted);
  white-space: nowrap;
}

.lang-switcher-select {
  font-family: var(--admin-font-body);
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

.lang-switcher-select:focus-visible {
  outline: 3px solid var(--admin-color-focus);
  outline-offset: 1px;
}

/* ── Page content area ── */
#page-content {
  flex: 1 1 auto;
  width: min(var(--admin-max-width), 100%);
  margin: 0 auto;
  padding: var(--admin-space-xl) var(--admin-space-md);
}

.page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--admin-space-md);
  color: var(--admin-color-primary);
}

.page-description {
  color: var(--admin-color-muted);
  margin-bottom: var(--admin-space-xl);
}

.page-placeholder {
  color: var(--admin-color-muted);
  font-style: italic;
  padding: var(--admin-space-xl);
  text-align: center;
  background: var(--admin-color-surface);
  border: 1px dashed var(--admin-color-border);
  border-radius: 12px;
}

/* ── Dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--admin-space-md);
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--admin-space-sm);
  padding: var(--admin-space-xl) var(--admin-space-md);
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--admin-color-text);
  min-height: 120px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-card:hover {
  border-color: var(--admin-color-primary);
  box-shadow: 0 2px 8px rgb(33 91 134 / 0.1);
}

.dashboard-card-icon {
  font-size: 2rem;
}

.dashboard-card-label {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── RTL support ── */
[dir="rtl"] .nav-links,
[dir="rtl"] .nav-switchers {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher {
  flex-direction: row-reverse;
}

/* ── Mobile adjustments ── */
@media (max-width: 640px) {
  .admin-nav-v2 {
    flex-direction: column;
    align-items: stretch;
    gap: var(--admin-space-xs);
    padding: var(--admin-space-xs) var(--admin-space-sm);
  }

  .nav-links {
    justify-content: center;
  }

  .nav-switchers {
    justify-content: center;
    padding-top: var(--admin-space-xs);
    border-top: 1px solid var(--admin-color-border);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Resource list ── */
.resource-filter-bar {
  display: flex;
  gap: var(--admin-space-sm);
  margin-bottom: var(--admin-space-md);
  flex-wrap: wrap;
}

.resource-filter-input {
  flex: 1 1 200px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 14px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
}

.resource-filter-input::placeholder {
  color: var(--admin-color-muted);
}

.resource-filter-select {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 14px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  cursor: pointer;
}

.resource-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  overflow: hidden;
}

.resource-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--admin-color-border);
  white-space: nowrap;
}

.resource-row {
  cursor: pointer;
  transition: background 0.1s;
}

.resource-row:hover {
  background: var(--admin-color-surface-soft);
}

.resource-row-expanded {
  background: var(--admin-color-surface-soft);
}

.resource-cell {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--admin-color-border);
  vertical-align: top;
}

.resource-cell-name {
  font-weight: 600;
}

.resource-cell-phone {
  white-space: nowrap;
  color: var(--admin-color-primary);
}

.resource-cell-sections {
  font-size: 12px;
  color: var(--admin-color-muted);
}

.resource-cell-status {
  font-size: 12px;
}

.resource-unpublished {
  opacity: 0.5;
}

.resource-fallback-badge,
.resource-unpublished-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 400;
  vertical-align: middle;
}

.resource-fallback-badge {
  background: #fef3c7;
  color: #92400e;
}

.resource-unpublished-badge {
  background: #fee2e2;
  color: #991b1b;
}

.resource-detail-row {
  background: var(--admin-color-surface-soft);
}

.resource-detail-cell {
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-color-border);
}

.resource-detail-line {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.resource-detail-label {
  font-weight: 600;
  color: var(--admin-color-muted);
}

.resource-detail-value {
  color: var(--admin-color-text);
}

.resource-detail-empty {
  color: var(--admin-color-muted);
  font-style: italic;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space-md);
  margin-bottom: var(--admin-space-md);
  flex-wrap: wrap;
}

.dashboard-card-count {
  font-size: 0.75rem;
  color: var(--admin-color-muted);
}

/* ── Resource list: mobile ── */
@media (max-width: 640px) {
  .resource-table thead {
    display: none;
  }

  .resource-table,
  .resource-table tbody,
  .resource-table tr,
  .resource-table td {
    display: block;
  }

  .resource-row {
    background: var(--admin-color-surface);
    border: 1px solid var(--admin-color-border);
    border-radius: 12px;
    margin-bottom: var(--admin-space-sm);
    padding: var(--admin-space-sm);
  }

  .resource-cell {
    border-bottom: none;
    padding: 4px 8px;
  }

  .resource-cell-name {
    font-size: 15px;
  }

  .resource-cell-sections,
  .resource-cell-translations {
    display: none;
  }

  .resource-detail-row {
    border: 1px solid var(--admin-color-border);
    border-radius: 12px;
    margin-top: -6px;
    margin-bottom: var(--admin-space-sm);
  }
}

/* ── Resource list: RTL ── */
[dir="rtl"] .resource-th {
  text-align: right;
}

[dir="rtl"] .resource-fallback-badge,
[dir="rtl"] .resource-unpublished-badge {
  margin-left: 0;
  margin-right: 6px;
}

.resource-edit-link {
  color: var(--admin-color-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.resource-edit-link:hover {
  background: var(--admin-color-surface-soft);
  text-decoration: underline;
}

.resource-cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* ── Resource form ── */
.resource-form {
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  padding: var(--admin-space-xl);
}

.resource-form-group {
  margin-bottom: var(--admin-space-md);
}

.resource-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-color-muted);
  margin-bottom: 4px;
}

.resource-form-input,
.resource-form-textarea,
.resource-form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 14px;
  background: var(--admin-color-bg);
  color: var(--admin-color-text);
  min-height: 44px;
}

.resource-form-input:read-only {
  opacity: 0.6;
  cursor: not-allowed;
}

.resource-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.resource-form-multi-select {
  min-height: auto;
  height: auto;
}

.resource-form-help {
  display: block;
  font-size: 12px;
  color: var(--admin-color-muted);
  margin-top: 2px;
}

.resource-form-fieldset {
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  padding: var(--admin-space-sm) var(--admin-space-md);
  margin-bottom: var(--admin-space-md);
}

.resource-form-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-color-muted);
  padding: 0 4px;
}

.resource-form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
  min-height: 44px;
}

.resource-form-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.resource-form-section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-color-primary);
  margin: var(--admin-space-xl) 0 var(--admin-space-md);
  padding-top: var(--admin-space-md);
  border-top: 1px solid var(--admin-color-border);
}

.resource-form-actions {
  display: flex;
  gap: var(--admin-space-sm);
  margin-top: var(--admin-space-xl);
  padding-top: var(--admin-space-md);
  border-top: 1px solid var(--admin-color-border);
  flex-wrap: wrap;
}

.resource-form-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  text-decoration: none;
}

.resource-form-btn:hover {
  background: var(--admin-color-surface-soft);
}

.resource-form-btn-primary {
  background: var(--admin-color-primary);
  border-color: var(--admin-color-primary-hover);
  color: #fff;
}

.resource-form-btn-primary:hover {
  background: var(--admin-color-primary-hover);
}

.resource-form-btn-danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
  margin-left: auto;
}

.resource-form-btn-danger:hover {
  background: #b91c1c;
}

.resource-form-status {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: var(--admin-space-md);
  background: #d1fae5;
  color: #065f46;
}

.resource-form-status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Resource form RTL ── */
[dir="rtl"] .resource-form-btn-danger {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .resource-cell-actions {
  text-align: left;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--admin-color-surface);
  border-radius: 12px;
  padding: var(--admin-space-xl);
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.2);
}

.modal-prompt {
  font-size: 15px;
  margin-bottom: var(--admin-space-xl);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: var(--admin-space-sm);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Image upload dialog (toolbar image button) ── */
.image-upload-modal { max-width: 480px; }
.image-upload-group {
  margin-bottom: var(--admin-space-lg);
}
.image-upload-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--admin-color-text-muted);
}
.image-upload-label input[type="file"],
.image-upload-label input[type="url"] {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
}
.image-upload-status {
  margin: 0 0 var(--admin-space-md);
  font-size: 13px;
  color: var(--admin-color-text-muted);
}
.image-upload-status.error {
  color: var(--admin-color-danger, #b91c1c);
}

/* ── Settings ── */
.page-settings .settings-card {
  border: 1px solid var(--admin-color-border);
  border-radius: 10px;
  padding: var(--admin-space-lg);
  margin-bottom: var(--admin-space-lg);
}
.page-settings .settings-help {
  color: var(--admin-color-text-muted);
  font-size: 13px;
  margin: 0 0 var(--admin-space-md);
}
.page-settings .settings-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* ── Translation coverage badges ── */
.coverage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.4;
}

.coverage-badge-green {
  background: #d1fae5;
  color: #065f46;
}

.coverage-badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.coverage-badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.resource-cell-translations {
  white-space: nowrap;
}

/* ── Translation locale grid in detail row ── */
.translation-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.translation-locale-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.3;
  min-width: 32px;
  text-align: center;
}

.translation-locale-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.translation-locale-badge-missing {
  background: #e5e7eb;
  color: #6b7280;
}

/* ── Translate buttons ── */
.translate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  background: var(--admin-color-surface);
  color: var(--admin-color-primary);
  white-space: nowrap;
}

.translate-btn:hover {
  background: var(--admin-color-surface-soft);
}

.translate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.translate-btn-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.translate-btn-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.translation-detail-section {
  margin-top: var(--admin-space-md);
  padding-top: var(--admin-space-md);
  border-top: 1px solid var(--admin-color-border);
}

.translation-detail-header {
  display: flex;
  align-items: center;
  gap: var(--admin-space-sm);
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.translation-detail-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--admin-color-muted);
}

/* ── Batch translate progress ── */
.batch-translate-status {
  display: inline-flex;
  align-items: center;
  gap: var(--admin-space-sm);
  font-size: 13px;
  color: var(--admin-color-muted);
  margin-left: var(--admin-space-sm);
}

[dir="rtl"] .batch-translate-status {
  margin-left: 0;
  margin-right: var(--admin-space-sm);
}

/* ── Section list ── */
.section-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  overflow: hidden;
}

.section-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--admin-color-border);
  white-space: nowrap;
}

.section-row {
  cursor: pointer;
  transition: background 0.1s;
}

.section-row:hover {
  background: var(--admin-color-surface-soft);
}

.section-row-expanded {
  background: var(--admin-color-surface-soft);
}

.section-row-archived {
  opacity: 0.55;
}

.section-archived-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 400;
  vertical-align: middle;
  background: #e5e7eb;
  color: #374151;
}

.section-cell {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--admin-color-border);
  vertical-align: top;
}

.section-cell-title {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-slug {
  font-weight: 400;
  font-size: 12px;
  color: var(--admin-color-muted);
}

.section-cell-order {
  white-space: nowrap;
  color: var(--admin-color-muted);
  text-align: center;
  width: 60px;
}

.section-cell-pages {
  white-space: nowrap;
}

.section-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}

.section-badge-homepage {
  background: #dbeafe;
  color: #1e40af;
}

.section-badge-resources {
  background: #e0e7ff;
  color: #3730a3;
}

.section-detail-row {
  background: var(--admin-color-surface-soft);
}

.section-detail-cell {
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-color-border);
}

.section-detail-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--admin-color-muted);
  margin-bottom: 6px;
}

.section-resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-resource-item {
  padding: 4px 0;
}

.section-resource-link {
  color: var(--admin-color-primary);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  min-height: 44px;
  line-height: 36px;
}

.section-resource-link:hover {
  background: var(--admin-color-surface);
  text-decoration: underline;
}

.section-resource-empty {
  color: var(--admin-color-muted);
  font-style: italic;
  font-size: 13px;
  padding: 4px 8px;
}

/* ── Section list: mobile ── */
@media (max-width: 640px) {
  .section-table thead {
    display: none;
  }

  .section-table,
  .section-table tbody,
  .section-table tr,
  .section-table td {
    display: block;
  }

  .section-row {
    background: var(--admin-color-surface);
    border: 1px solid var(--admin-color-border);
    border-radius: 12px;
    margin-bottom: var(--admin-space-sm);
    padding: var(--admin-space-sm);
  }

  .section-cell {
    border-bottom: none;
    padding: 4px 8px;
  }

  .section-cell-title {
    font-size: 15px;
  }

  .section-cell-order {
    text-align: left;
    width: auto;
  }

  .section-detail-row {
    border: 1px solid var(--admin-color-border);
    border-radius: 12px;
    margin-top: -6px;
    margin-bottom: var(--admin-space-sm);
  }
}

/* ── Section list: RTL ── */
[dir="rtl"] .section-th {
  text-align: right;
}

[dir="rtl"] .section-cell-order {
  text-align: center;
}

@media (max-width: 640px) {
  [dir="rtl"] .section-cell-order {
    text-align: right;
  }
}

/* ── Section editor ── */

.section-mode-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--admin-color-border);
  margin-bottom: 0;
}

.section-mode-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--admin-color-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  min-height: 40px;
}

.section-mode-tab:hover {
  color: var(--admin-color-text);
}

.section-mode-tab.active {
  color: var(--admin-color-primary);
  border-bottom-color: var(--admin-color-primary);
}

.section-editor .ProseMirror {
  min-height: 300px;
  padding: 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  outline: none;
}
.section-editor .ProseMirror:focus {
  border-color: var(--admin-color-primary);
}

.section-editor .ProseMirror ul,
.section-editor .ProseMirror ol {
  padding-inline-start: 1.5rem;
}

.section-editor .ProseMirror li {
  margin: 0.25rem 0;
}
.section-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--admin-color-surface-soft);
  border: 1px solid var(--admin-color-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.section-markdown-source {
  width: 100%;
  min-height: 350px;
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  resize: vertical;
  tab-size: 2;
}

.section-markdown-source:focus {
  border-color: var(--admin-color-primary);
  outline: none;
}

.section-preview-pane {
  min-height: 300px;
  padding: 16px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  background: var(--admin-color-surface);
  font-family: 'Avenir Next', 'Nunito Sans', 'Noto Sans', 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #182b38;
}

.section-preview-pane h2 {
  font-size: 1.5rem;
  margin: 1rem 0 0.5rem;
}

.section-preview-pane h3 {
  font-size: 1.25rem;
  margin: 0.75rem 0 0.5rem;
}

.section-preview-pane p {
  margin: 0.5rem 0;
}

.section-preview-pane ul,
.section-preview-pane ol {
  margin: 0.5rem 0;
  padding-inline-start: 1.5rem;
}

.section-preview-pane li {
  margin: 0.25rem 0;
}

.section-preview-pane a {
  color: #215b86;
  text-decoration: underline;
}

.section-preview-pane strong {
  font-weight: 700;
}

.section-preview-pane hr {
  border: none;
  border-top: 1px solid var(--admin-color-border);
  margin: 1rem 0;
}
.toolbar-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  background: var(--admin-color-surface);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toolbar-btn:hover {
  background: var(--admin-color-surface-soft);
}
.section-side-by-side {
  display: flex;
  gap: 16px;
}
.section-source, .section-target {
  flex: 1;
  min-width: 0;
}
.section-source {
  opacity: 0.85;
  border-right: 2px solid var(--admin-color-border);
  padding-right: 16px;
}
.section-source-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.section-source-body {
  font-size: 14px;
  line-height: 1.6;
}
.section-source-body .ProseMirror {
  outline: none;
  min-height: 0;
  padding: 0;
  cursor: default;
}
.section-source-body .ProseMirror > *:first-child { margin-top: 0; }
.section-source-body .ProseMirror > *:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
  .section-side-by-side {
    flex-direction: column;
  }
  .section-source {
    border-right: none;
    border-bottom: 2px solid var(--admin-color-border);
    padding-right: 0;
    padding-bottom: 16px;
  }
}
.translation-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.translation-badge-complete { background: #d4edda; color: #155724; }
.translation-badge-good { background: #fff3cd; color: #856404; }
.translation-badge-low { background: #f8d7da; color: #721c24; }
.section-edit-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
}

/* ── Resource panel (section editor) ── */
.resource-panel {
  margin-top: var(--admin-space-xl);
  padding-top: var(--admin-space-md);
  border-top: 1px solid var(--admin-color-border);
}

.resource-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space-sm);
  margin-bottom: var(--admin-space-md);
}

.resource-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-color-primary);
}

.resource-panel-list {
  display: flex;
  flex-direction: column;
  gap: var(--admin-space-sm);
}

.resource-panel-empty {
  color: var(--admin-color-muted);
  font-style: italic;
  padding: var(--admin-space-md);
  text-align: center;
  background: var(--admin-color-surface);
  border: 1px dashed var(--admin-color-border);
  border-radius: 8px;
}

.resource-panel-card {
  display: flex;
  align-items: flex-start;
  gap: var(--admin-space-sm);
  background: linear-gradient(180deg, var(--admin-color-surface-soft) 0%, var(--admin-color-surface) 42%);
  border: 1px solid var(--admin-color-border);
  border-inline-start: 5px solid var(--admin-color-primary);
  border-radius: 0.8rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 2px 8px rgb(13 40 65 / 0.05);
  cursor: grab;
  transition: box-shadow 0.15s, opacity 0.15s;
}

.resource-panel-card-dragging {
  opacity: 0.4;
}

.resource-panel-card-dragover {
  box-shadow: 0 0 0 2px var(--admin-color-primary);
}

.resource-panel-drag {
  cursor: grab;
  font-size: 1.1rem;
  color: var(--admin-color-muted);
  padding: 4px;
  user-select: none;
  flex-shrink: 0;
}

.resource-panel-card-content {
  flex: 1;
  min-width: 0;
}

.resource-panel-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.resource-panel-card-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: var(--admin-space-sm);
  color: var(--admin-color-text);
}

.resource-panel-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: var(--admin-space-sm);
}

.resource-panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #eef3f8;
  border: 1px solid var(--admin-color-border);
  color: var(--admin-color-primary-hover);
}

.resource-panel-chip-secondary {
  background: #fff6ec;
  border-color: #f0d4b9;
  color: #88421f;
}

.resource-panel-card-meta {
  font-size: 0.78rem;
  color: #485867;
  margin: 0;
}

.resource-panel-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.resource-panel-edit {
  font-size: 12px;
  color: var(--admin-color-primary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.resource-panel-edit:hover {
  text-decoration: underline;
}

.resource-panel-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--admin-color-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-panel-remove:hover {
  color: #dc2626;
  background: #fee2e2;
}

/* ── Resource picker ── */
.resource-picker {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.resource-picker .resource-filter-input {
  flex: 0 0 auto;
}

.resource-picker-list {
  overflow-y: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resource-picker-item {
  text-align: left;
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--admin-font-body);
  font-size: 14px;
  line-height: 1.4;
  min-height: 44px;
  width: 100%;
  overflow: hidden;
}

.resource-picker-item small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--admin-color-muted);
}

.resource-picker-item:hover {
  background: var(--admin-color-surface-soft);
  border-color: var(--admin-color-primary);
}

.resource-picker-empty {
  color: var(--admin-color-muted);
  font-style: italic;
  text-align: center;
  padding: var(--admin-space-md);
}

/* ── Resource panel RTL ── */
[dir="rtl"] .resource-panel-card {
  border-inline-start: 5px solid var(--admin-color-primary);
  border-inline-end: 1px solid var(--admin-color-border);
}

/* ── Translations page ── */

.trans-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.trans-summary-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  min-height: 44px;
}

.trans-summary-btn .trans-status-badge {
  padding: 8px 16px;
  font-size: 14px;
}

.trans-summary-btn:hover {
  opacity: 0.8;
}

.trans-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.trans-filter-select {
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  background: var(--admin-color-surface);
  font-size: 14px;
  min-height: 44px;
}

.trans-filter-search {
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  font-size: 14px;
  min-height: 44px;
  flex: 1;
  min-width: 150px;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--admin-color-surface-soft);
  border-color: var(--admin-color-primary);
}

.btn:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--admin-color-primary);
  border-color: var(--admin-color-primary-hover);
  color: #fff;
}

.btn-primary:hover {
  background: var(--admin-color-primary-hover);
  border-color: var(--admin-color-primary-hover);
}

.btn-primary:disabled {
  background: var(--admin-color-primary);
}

/* ── Batch translate bar ── */

.trans-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.trans-batch-bar .btn {
  font-size: 14px;
  padding: 10px 20px;
  font-weight: 600;
}

.trans-batch-bar .trans-batch-status {
  font-size: 13px;
  color: var(--admin-color-muted);
}

.trans-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trans-group {
  position: relative;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.trans-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-inline-end: 180px;
  background: var(--admin-color-surface);
  font-weight: 600;
  font-size: 15px;
  text-transform: capitalize;
  cursor: pointer;
  min-height: 44px;
  list-style: none;
}

.trans-group-header::-webkit-details-marker { display: none; }

.trans-group-header::before {
  content: '\25B6';
  font-size: 10px;
  transition: transform 0.15s;
  color: var(--admin-color-muted);
}

.trans-group[open] > .trans-group-header::before {
  transform: rotate(90deg);
}

.trans-group-name {
  flex-shrink: 0;
}

.trans-group-badges {
  margin-inline-start: auto;
  display: flex;
  gap: 4px;
}

/* Group translate button is a sibling of <summary> (not a child) to satisfy
   the a11y rule against interactive descendants of <summary>. We overlay
   it visually so it still appears on the right edge of the header. */
.trans-group-action {
  position: absolute;
  top: 8px;
  inset-inline-end: 12px;
  flex-shrink: 0;
  z-index: 1;
}

.trans-error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-block-end: var(--admin-space-md);
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 14px;
  line-height: 1.4;
}
.trans-error-banner-message {
  flex: 1 1 auto;
}
.trans-error-banner-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}
.trans-error-banner-dismiss:hover {
  background: rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  .trans-error-banner {
    background: #4a1414;
    color: #fecaca;
    border-color: #991b1b;
  }
  .trans-error-banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.trans-mini-badge {
  font-size: 11px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.trans-group-body {
  border-top: 1px solid var(--admin-color-border);
}

.trans-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 16px 8px 32px;
  background: var(--admin-color-bg);
  border-bottom: 1px solid var(--admin-color-border);
}

.trans-group-body .trans-row:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .trans-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 16px;
  }
}

.trans-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--admin-color-border);
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trans-row-locale {
  font-size: 14px;
  color: var(--admin-color-muted);
}

.trans-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.trans-status-all {
  background: var(--admin-color-surface);
  color: var(--admin-color-text);
  border: 1px solid var(--admin-color-border);
}

.trans-status-current {
  background: #dcfce7;
  color: #166534;
}

.trans-status-needs-review {
  background: #fef3c7;
  color: #92400e;
}

.trans-status-missing {
  background: #fee2e2;
  color: #991b1b;
}

.trans-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.trans-action-btn {
  font-size: 13px;
  padding: 6px 12px;
  min-height: 36px;
}

/* Translating-in-progress row state */
.trans-row-translating {
  animation: trans-pulse 1.5s ease-in-out infinite;
}

.trans-row-translating .trans-status-badge {
  background: #dbeafe;
  color: #1e40af;
}

.trans-row-translating .trans-status-badge::before {
  content: '\21BB  ';
}

.trans-row-translating .trans-row-actions {
  visibility: hidden;
}

@keyframes trans-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Coverage by language ── */

.trans-by-language {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  background: var(--admin-color-surface);
}

.trans-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.trans-by-language-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.trans-by-language-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--admin-color-muted);
  border-bottom: 1px solid var(--admin-color-border);
}

.trans-by-language-table th:not(:first-child) {
  text-align: right;
}

.trans-by-language-row td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--admin-color-border);
}

.trans-by-language-row:last-child td {
  border-bottom: none;
}

.trans-by-language-row td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trans-by-language-name {
  padding: 0;
  border: none;
  background: none;
  color: var(--admin-color-link, #2563eb);
  cursor: pointer;
  font-size: inherit;
  text-align: left;
  min-height: 32px;
}

.trans-by-language-name:hover {
  text-decoration: underline;
}

.trans-by-language-highlight {
  font-weight: 600;
  color: #b45309;
}

.trans-by-language-no-translators {
  font-weight: 600;
  color: #b91c1c;
}

/* ── Steering notes panel ── */

.steering-panel {
  margin: 16px 0;
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  overflow: hidden;
}

.steering-panel-heading {
  margin: 0;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  background: var(--admin-color-surface);
  border-bottom: 1px solid var(--admin-color-border);
}

.steering-panel-content {
  padding: 16px;
}

.steering-notes-section {
  margin-bottom: 16px;
}

.steering-section-label {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.steering-section-help {
  font-size: 13px;
  color: var(--admin-color-muted);
  margin: 0 0 8px;
}

.steering-notes-list {
  margin-bottom: 8px;
}

.steering-note-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}

.steering-note-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--admin-color-border);
  border-radius: 6px;
  font-size: 14px;
  min-height: 44px;
}

.steering-remove-btn {
  font-size: 12px;
  padding: 4px 8px;
  min-height: 36px;
  color: #dc2626;
}

.steering-empty {
  font-size: 13px;
  color: var(--admin-color-muted);
  font-style: italic;
  margin: 4px 0;
}

.steering-notes-readonly {
  list-style: disc;
  padding-left: 20px;
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--admin-color-muted);
}

/* ── Deploy page ── */
.deploy-sync-banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-block-end: var(--admin-space-md);
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.deploy-sync-banner strong {
  display: inline;
  margin-inline-end: 0.25em;
}
.deploy-sync-current {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.deploy-sync-just-published {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}
.deploy-sync-pending {
  background: var(--admin-color-surface-soft, #f6f6f4);
  color: var(--admin-color-text, #1f2937);
  border-color: var(--admin-color-border, #d4d4d0);
}
.deploy-sync-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.deploy-sync-conflict {
  background: #fef3c7;
  color: #854d0e;
  border-color: #fcd34d;
}
.deploy-sync-dismiss {
  margin-inline-start: 0.75rem;
  padding: 2px 10px;
  font-size: 13px;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: 0.75;
  cursor: pointer;
}
.deploy-sync-dismiss:hover {
  opacity: 1;
}
@media (prefers-color-scheme: dark) {
  .deploy-sync-current {
    background: #063b2d;
    color: #a7f3d0;
    border-color: #065f46;
  }
  .deploy-sync-just-published {
    background: #0b4d2b;
    color: #bbf7d0;
    border-color: #16a34a;
  }
  .deploy-sync-error {
    background: #4a1414;
    color: #fecaca;
    border-color: #991b1b;
  }
  .deploy-sync-conflict {
    background: #3a2a0a;
    color: #fde68a;
    border-color: #854d0e;
  }
}

.deploy-env-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--admin-space-md);
  margin-block-end: var(--admin-space-xl);
}

.deploy-env-card {
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 0.5rem;
  padding: var(--admin-space-md);
}

.deploy-env-card h3 {
  margin: 0 0 var(--admin-space-sm);
}

.deploy-sha {
  font-size: 0.85em;
  background: var(--admin-color-surface-soft);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  margin-inline-end: var(--admin-space-sm);
}

.deploy-commit-msg {
  color: var(--admin-color-muted);
  font-size: 0.9em;
  margin: 0.25rem 0 0;
}

.deploy-actions {
  display: flex;
  gap: 0.75rem;
  margin-block-end: var(--admin-space-xl);
}

.deploy-pending-list {
  list-style: none;
  padding: 0;
}

.deploy-pending-item {
  padding: var(--admin-space-sm) 0;
  border-bottom: 1px solid var(--admin-color-border);
}

.deploy-pending-item:last-child {
  border-bottom: none;
}

.deploy-history-list {
  list-style: none;
  padding: 0;
}

.deploy-history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--admin-color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--admin-space-sm);
}

.deploy-history-meta {
  display: flex;
  align-items: baseline;
  gap: var(--admin-space-sm);
}

.deploy-history-summary {
  flex: 1;
  margin: 0;
  min-width: 200px;
}

.btn-danger {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.btn-small {
  font-size: 0.85em;
  padding: 0.2rem 0.6rem;
}

.deploy-empty {
  color: var(--admin-color-muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .deploy-env-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Sections list: add slug column (mobile stays stacked) ── */
.section-cell-slug {
  color: var(--admin-color-muted);
  white-space: nowrap;
}
.section-cell-slug .section-slug {
  font-family: var(--admin-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* ── Contributors page ── */
.page-contributors .page-header {
  display: flex;
  align-items: center;
  gap: var(--admin-space-sm);
  flex-wrap: wrap;
  justify-content: space-between;
}
.contrib-section {
  margin-top: var(--admin-space-lg);
}
.contrib-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--admin-space-sm) 0;
}
.contrib-empty {
  color: var(--admin-color-muted);
  font-style: italic;
  padding: var(--admin-space-sm) 0;
}
.contrib-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  overflow: hidden;
}
.contrib-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--admin-color-border);
  white-space: nowrap;
}
.contrib-cell {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--admin-color-border);
  vertical-align: top;
}
.contrib-cell-link {
  max-width: 520px;
}
.contrib-link-code {
  display: inline-block;
  font-family: var(--admin-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  background: var(--admin-color-surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  margin-right: var(--admin-space-xs);
}
.contrib-link-code-block {
  display: block;
  padding: 10px 12px;
  margin: var(--admin-space-sm) 0;
  white-space: pre-wrap;
}
.contrib-card {
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  border-radius: 12px;
  padding: var(--admin-space-md);
  margin-bottom: var(--admin-space-sm);
}
.contrib-card-inactive {
  opacity: 0.55;
}
.contrib-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--admin-space-sm);
  flex-wrap: wrap;
}
.contrib-card-title {
  display: flex;
  align-items: center;
  gap: var(--admin-space-sm);
  flex-wrap: wrap;
}
.contrib-card-label {
  font-weight: 600;
  font-size: 16px;
}
.contrib-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0e7ff;
  color: #3730a3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contrib-role-super { background: #fee2e2; color: #991b1b; }
.contrib-role-editor { background: #dbeafe; color: #1e40af; }
.contrib-role-translator { background: #dcfce7; color: #166534; }
.contrib-role-previewer { background: #f3f4f6; color: #374151; }
.contrib-revoked-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contrib-focus-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
  letter-spacing: 0.02em;
}
.contrib-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--admin-color-muted);
  user-select: none;
}
.contrib-focus-group {
  border: 1px solid var(--admin-color-border);
  border-radius: 8px;
  padding: var(--admin-space-sm);
  margin: 0;
}
.contrib-focus-hint {
  font-size: 12px;
  color: var(--admin-color-muted);
  margin: 4px 0 var(--admin-space-sm) 0;
}
.contrib-focus-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 14px;
}
.contrib-focus-specific-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 12px;
  padding: var(--admin-space-sm);
  margin-top: 6px;
  border: 1px dashed var(--admin-color-border);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.contrib-focus-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.contrib-card-username {
  font-size: 13px;
  color: var(--admin-color-muted);
  background: rgba(148, 163, 184, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}
.contrib-flag-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contrib-flag-locked {
  background: #fee2e2;
  color: #991b1b;
}
.contrib-card-actions {
  display: flex;
  gap: var(--admin-space-sm);
  flex-wrap: wrap;
}
.contrib-temp-line {
  margin: var(--admin-space-sm) 0;
  font-size: 14px;
}
.contrib-card-meta {
  color: var(--admin-color-muted);
  font-size: 12px;
  margin-top: 4px;
}
.contrib-card-creds-header {
  margin-top: var(--admin-space-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contrib-card-no-creds {
  color: var(--admin-color-muted);
  font-style: italic;
  font-size: 13px;
}
.contrib-cred-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}
.contrib-cred {
  display: flex;
  align-items: center;
  gap: var(--admin-space-sm);
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--admin-color-border);
  flex-wrap: wrap;
}
.contrib-cred:last-child {
  border-bottom: none;
}
.contrib-cred-id {
  font-family: var(--admin-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  background: var(--admin-color-surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}
.contrib-cred-type {
  font-weight: 600;
  text-transform: capitalize;
}
.contrib-cred-synced {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
}
.contrib-cred-transports,
.contrib-cred-created {
  color: var(--admin-color-muted);
  font-size: 12px;
}
.contrib-btn-remove {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--admin-color-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #991b1b;
}
.contrib-btn-remove:hover {
  background: #fee2e2;
  border-color: #fecaca;
}
.contrib-btn-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}
.contrib-btn-danger:hover {
  background: #fecaca !important;
}
.contrib-invite-modal,
.contrib-invite-link-modal {
  max-width: 520px;
}
.contrib-invite-note {
  color: var(--admin-color-muted);
  font-size: 13px;
}

/* ── Background task toasts ── */
.bg-task-tray {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-width: 360px;
}
.bg-task-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--admin-color-surface, #fff);
  border: 1px solid var(--admin-color-border, #ddd);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  animation: bg-task-slide-in 180ms ease-out;
}
.bg-task-toast-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.bg-task-toast-link:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14); }
.bg-task-toast-link:focus-visible { outline: 2px solid var(--admin-color-accent, #1976d2); outline-offset: 2px; }
@keyframes bg-task-slide-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.bg-task-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: bg-task-spin 0.8s linear infinite;
  flex: none;
}
@keyframes bg-task-spin {
  to { transform: rotate(360deg); }
}
.bg-task-toast-success {
  border-color: #2e7d32;
  color: #2e7d32;
}
.bg-task-toast-success::before {
  content: "\2713";
  font-weight: 700;
  flex: none;
}
.bg-task-toast-error {
  border-color: #c62828;
  color: #c62828;
}
.bg-task-toast-error::before {
  content: "\26A0";
  flex: none;
}
.bg-task-dismiss {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  padding: 0 4px;
}
.bg-task-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---- Profile page ------------------------------------------------------ */
.profile-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.profile-summary {
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  padding: var(--admin-space-md);
  border-radius: 12px;
  color: var(--admin-color-text);
}
.profile-label {
  font-weight: 600;
  font-size: 16px;
  color: var(--admin-color-text);
}
.profile-meta {
  color: var(--admin-color-muted);
  font-size: 13px;
  margin-top: 0.25rem;
}
.profile-section {
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  padding: var(--admin-space-md);
  border-radius: 12px;
  color: var(--admin-color-text);
}
.profile-section h2 {
  margin-bottom: var(--admin-space-sm);
  font-size: 16px;
  font-weight: 600;
  color: var(--admin-color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-hint {
  color: var(--admin-color-muted);
  font-size: 13px;
  margin-bottom: var(--admin-space-md);
}
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.profile-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--admin-color-text);
}
.profile-form input {
  padding: 8px 12px;
  background: var(--admin-color-surface);
  border: 1px solid var(--admin-color-border);
  color: var(--admin-color-text);
  border-radius: 6px;
  font-size: 14px;
}
.profile-form input:focus-visible {
  border-color: var(--admin-color-primary);
  outline: none;
}
.profile-form .btn-primary {
  align-self: flex-start;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--admin-color-primary-hover);
  border-radius: 6px;
  background: var(--admin-color-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.profile-form .btn-primary:hover {
  background: var(--admin-color-primary-hover);
}
.profile-form .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.profile-status-slot { min-height: 1.25em; }
.profile-status { font-size: 13px; }
.profile-status.error { color: #b3261e; }
.profile-status.success { color: #0f5132; }

.busy-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  background: #fff4d6;
  color: #5a3a00;
  border-bottom: 1px solid #e0c068;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.busy-banner-countdown {
  color: #8a6a1a;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
@media (prefers-color-scheme: dark) {
  .busy-banner {
    background: #3a2f12;
    color: #ffd98a;
    border-bottom-color: #6b4a1a;
  }
  .busy-banner-countdown { color: #d7b971; }
}
