:root {
  --fg: #222;
  --muted: #666;
  --bg: #f5f5f5;
  --card: #fff;
  --border: #e5e5e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: var(--bg);
}

button {
  font: inherit;
  margin: 0;
}

header,
footer {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
}

header {
  background: #c4c4c4;
  border-bottom: 1px solid var(--border);
  height: 140px;
}

footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
}

.container {
  margin: 0 auto;
  padding: 16px 30px;
}

.header-bar.container {
  padding-top: 25px;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu {
  display: flex;
  gap: 16px;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
  margin-right: 12px;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.menu a,
.btn {
  text-decoration: none;
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  line-height: 1.2;
}

.btn:hover {
  background: #f5f5f5;
}

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

.btnBack {
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0; /* hides any destination text; kept for screen readers */
}

.btnBack:hover {
  background: var(--bg);
}

.btnBack::before {
  content: "\2190";
  font-size: 17px;
  line-height: 1;
}

.page-eyebrow {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}
.page-eyebrow:empty { display: none; }

.menu .pill {
  border: none;
  color: var(--muted);
}

.page-container {
  padding-top: 24px;
  padding-bottom: 24px;
  padding-left: 15px;
  padding-right: 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-top: -65px;
  position: relative;
  background: #fff;
  margin-left: 15px;
  margin-right: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.sort-toggle {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.sort-arrow {
  color: var(--muted);
  font-size: .85em;
}

.sort-arrow.active {
  color: var(--fg);
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0;
  gap: 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.small {
  color: var(--muted);
  font-size: .9em;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

textarea.code-input {
  font-family: ui-monospace, SFMono-Regular, SFMono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  min-height: 260px;
  resize: vertical;
  white-space: pre;
}

label {
  display: block;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-header-row h2 {
  margin: 0;
}

.items-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.items-toolbar-controls {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.items-search-input {
  width: 100%;
  max-width: 300px;
  margin-bottom: 0;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zoom-controls .btn {
  min-width: 44px;
  padding: 6px 8px;
}

.collapsible-card.is-collapsed .card-body {
  display: none;
}

.stacked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.account-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.account-card-user {
  display: block;
}

.account-card strong {
  font-size: 1.05em;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-status-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-pill-red {
  background: #ffe5e8;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.status-pill-yellow {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.status-pill-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-pill-blue {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

#itemsTableContainer tr.item-row-status-red td {
  background: #fff1f2;
}

#itemsTableContainer tr.item-row-status-yellow td {
  background: #fffbeb;
}

#itemsTableContainer tr.item-row-status-green td {
  background: #f0fdf4;
}

#itemsTableContainer tr.item-row-status-blue td {
  background: #eff6ff;
}

pre {
  background: #f4f4f4;
  padding: 8px;
  border-radius: 6px;
  overflow: auto;
}

/* Account/Section header + 3-dot menu */
.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.account-header-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.account-header-main h1 {
  margin: 0;
}

.account-header-actions {
  position: relative;
}

.icon-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 20;
  display: none;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-menu button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background: #f5f5f5;
}

.dropdown-menu .danger {
  color: #b00020;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal {
  background: #fff;
  border-radius: 10px;
  max-width: 480px;
  width: 100%;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.modal h2 {
  margin-top: 0;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn.primary {
  background: #222;
  color: #fff;
  border-color: #222;
}

.btn.primary:hover {
  filter: brightness(0.95);
}

.btn.secondary {
  background: #f5f5f5;
  border-color: var(--border);
  color: var(--fg);
}

.btn.secondary:hover {
  background: #e9e9e9;
}

.btn.small {
  font-size: .85em;
  padding: 4px 8px;
}

.comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.comment-icon {
  font-size: 1em;
  line-height: 1;
}

.comment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8e8e8;
  color: var(--muted);
  font-size: .75em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.comment-count--active {
  background: #222;
  color: #fff;
}

.btn.danger {
  color: #b00020;
  border: 1px solid #f3b1b9;
  background: #fff7f7;
}

.btn.danger:hover {
  background: #ffe3e6;
}

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

.hidden {
  display: none !important;
}

.empty-state {
  margin-top: 16px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 12px;
}

/* Item table */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.table-wrapper table {
  width: max-content;
  min-width: 100%;
}

#itemsTableContainer.items-table-scaled {
  --items-zoom-scale: 1;
  --items-cell-padding-y: 8px;
  --items-cell-padding-x: 8px;
}

#itemsTableContainer.items-table-scaled table {
  font-size: calc(1rem * var(--items-zoom-scale));
}

#itemsTableContainer.items-table-scaled th,
#itemsTableContainer.items-table-scaled td {
  padding: var(--items-cell-padding-y) var(--items-cell-padding-x);
}

#itemsTableContainer.items-table-scaled .sort-arrow {
  font-size: calc(.85em * var(--items-zoom-scale));
}

#itemsTableContainer.items-table-scaled .nested-table {
  font-size: inherit;
}

#itemsTableContainer.items-table-scaled .nested-table th,
#itemsTableContainer.items-table-scaled .nested-table td {
  padding: calc(var(--items-cell-padding-y) * 0.75) var(--items-cell-padding-x);
}

@media (max-width: 760px) {
  .items-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .items-toolbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .items-search-input {
    max-width: none;
  }
}

.tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .75rem;
  color: var(--muted);
}

/* Vertical properties table */
.properties-table th {
  color: var(--muted);
  font-weight: 500;
}

.properties-table td {
  word-break: break-word;
}

.item-image-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.item-image-link {
  display: inline-flex;
}

.item-image {
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f7f7f7;
  padding: 4px;
}

/* Key/value editor */
.kv-table input {
  width: 100%;
}

.kv-remove-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.kv-remove-btn:hover {
  color: #b00020;
}

/* API calls page */
.api-group {
  margin-top: 16px;
}

.api-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-group-header h2 {
  margin: 0;
}

.api-call-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.api-card code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.api-card pre {
  margin-top: 6px;
}

.tag.method-post {
  background: #e8f5e9;
  border-color: #b3e0c2;
  color: #1b5e20;
}

.tag.method-put {
  background: #e3f2fd;
  border-color: #b7d7f5;
  color: #0d47a1;
}

.tag.method-delete {
  background: #ffebee;
  border-color: #ffcdd2;
  color: #b71c1c;
}

/* Structured value helpers */
.struct-preview summary {
  cursor: pointer;
  color: var(--muted);
}

.struct-preview pre {
  margin-top: 6px;
  white-space: pre-wrap;
}

.nested-table {
  width: auto;
  border-collapse: collapse;
  margin: 4px 0;
}

.nested-table th,
.nested-table td {
  padding: 6px 8px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.nested-table thead th {
  background: #f7f7f7;
  color: var(--muted);
  font-weight: 600;
}

/* Comments page */
.comments-feed {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border: none;
  margin-bottom: 20px;
}

.comment-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  padding: 20px;
}

.comment-body {
  font-size: 1rem;
  margin-bottom: 12px;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .9rem;
  color: #555;
}

/* Image Modal */
.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.image-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}
/* Toast notifications */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-show { opacity: 1; transform: translateX(0); }
.toast-hide { opacity: 0; transform: translateX(24px); }

.toast-success { border-left-color: #2e9e44; }
.toast-error   { border-left-color: #d33; }
.toast-warning { border-left-color: #e6a700; }
.toast-info    { border-left-color: #3b82c4; }

.toast-message { flex: 1; word-break: break-word; }

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.toast-close:hover { color: var(--fg); }

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-dialog {
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 20px;
  max-width: 420px;
  width: 100%;
}

.confirm-dialog h3 { margin: 0 0 8px; }
.confirm-dialog p { margin: 0 0 16px; color: var(--fg); white-space: pre-line; }

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-danger {
  background: #d33;
  border-color: #d33;
  color: #fff;
}
.confirm-danger:hover { background: #b52a2a; }

.confirm-ok {
  background: #3b82c4;
  border-color: #3b82c4;
  color: #fff;
}
.confirm-ok:hover { background: #326ea6; }

.prompt-input {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.prompt-input:focus { outline: 2px solid #3b82c4; border-color: #3b82c4; }

.input-error {
  border-color: #d33 !important;
  outline-color: #d33;
}
.input-error:focus { outline: 2px solid #d33; }

#app-version {
  position: fixed;
  bottom: 8px;
  right: 12px;
  z-index: 9999;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  user-select: none;
}

/* Audit log page */
.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  align-items: center;
}
.audit-filters input, .audit-filters select {
  font: inherit;
  width: auto;
  flex: 0 1 auto;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.audit-filters input[type="text"] { min-width: 160px; flex: 1 1 160px; }

.audit-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.audit-table th, .audit-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.audit-table th { background: var(--bg); position: sticky; top: 0; }
.audit-time { white-space: nowrap; }
.audit-path { word-break: break-all; color: var(--muted); }
.audit-status-ok { color: #2e9e44; }
.audit-status-warn { color: #e6a700; }
.audit-status-error { color: #d33; }
.audit-action-failed td:nth-child(3) code { color: #d33; }
.audit-action-delete td:nth-child(3) code { color: #b06000; }
.audit-details pre {
  margin: 0;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 320px;
}
.audit-pager { display: flex; align-items: center; gap: 12px; margin: 12px 0; }

/* Edit user modal */
.modal-wide { max-width: 560px; max-height: 85vh; overflow-y: auto; }

.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-grid label { display: block; font-size: 14px; }
.form-grid label > input, .form-grid label > select {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.check-inline { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.check-inline input[type="checkbox"] { width: auto !important; margin: 0; }

.accounts-heading { margin: 16px 0 4px; }

.checklist-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.checklist-tools input[type="text"] {
  flex: 1;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: auto;
}
.checklist-tools .check-inline { white-space: nowrap; font-size: 14px; }

.account-checklist {
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.account-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.account-check:last-child { border-bottom: none; }
.account-check:hover { background: var(--bg); }
.account-check input[type="checkbox"] { width: auto !important; margin: 0; }

.form-card { width: 100%; max-width: 560px; padding: 16px; }

/* Password field: reveal toggle + colour-coded characters when revealed */
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  padding-right: 42px;
}
.password-wrap input.password-revealed {
  color: transparent;
  caret-color: var(--fg);
}
.password-wrap input.password-revealed::placeholder {
  color: var(--muted);
}

.password-overlay {
  position: absolute;
  inset: 1px 42px 1px 1px;
  display: none;
  align-items: center;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
}
.password-wrap input.password-revealed ~ .password-overlay {
  display: flex;
}
.password-overlay .char-letter { color: var(--fg); }
.password-overlay .char-digit  { color: #d33; }
.password-overlay .char-symbol { color: #3b82c4; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.password-toggle:hover { color: var(--fg); background: var(--bg); }

.login-box {
  max-width: 33.333%;
  margin: 0 auto;
}
@media (max-width: 700px) {
  .login-box { max-width: 100%; }
}

/* Visible-columns list on the column settings page gets more room than modal checklists */
#columnsList { max-height: 480px; }

/* Column template: input and example side by side at matched heights */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 8px 0 4px;
}
.template-grid textarea {
  height: 340px;
  min-height: 340px;
  resize: vertical;
  margin-top: 4px;
}
.template-grid pre {
  margin: 4px 0 0;
  height: 340px;
  overflow: auto;
  font-size: 12px;
}
@media (max-width: 900px) {
  .template-grid { grid-template-columns: 1fr; }
}

/* ---------- ILG Forms sync: item icon ---------- */
.sync-icon { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; line-height: 1; }
.sync-icon svg { display: block; flex: none; }
.sync-icon--synced { color: #2e9e44; }
.sync-icon--pending { color: #c98a00; }
.sync-icon--not_synced { color: #9a9a9a; }
.sync-icon-text { color: var(--muted); font-size: 13px; }
th.sync-cell, td.sync-cell { width: 1%; white-space: nowrap; text-align: center; }
th.sync-cell { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- ILG Forms sync: settings page ---------- */
.sync-banner { background: #fff6e0; border: 1px solid #f0d48a; color: #6b4e00; border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.sync-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sync-tile { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.sync-tile-value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sync-tile-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sync-tile--bad .sync-tile-value { color: #d33; }
.sync-tile--warn .sync-tile-value { color: #c98a00; }
.sync-accounts { margin-bottom: 18px; }
.sync-accounts-table { border-collapse: collapse; font-size: 14px; margin-bottom: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.sync-accounts-table th, .sync-accounts-table td { text-align: right; padding: 6px 14px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.sync-accounts-table th:first-child, .sync-accounts-table td:first-child { text-align: left; }
.sync-accounts-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.sync-accounts-table tr:last-child td { border-bottom: 0; }
.sync-good { color: #2e9e44; }
.sync-muted-strong { font-weight: 600; }
.sync-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sync-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); font-size: 14px; }
.sync-tab:hover { color: var(--fg); }
.sync-tab.is-active { color: var(--fg); border-bottom-color: var(--fg); font-weight: 600; }
.sync-tab-count:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #eee; color: var(--fg); font-size: 12px; text-align: center; }
.sync-table td { vertical-align: top; }
.sync-direction { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sync-direction--received { background: #e6f0ff; color: #1d4f9c; }
.sync-direction--sent { background: #e8f6ec; color: #1f7a35; }
.sync-direction--updated { background: #f3ecfb; color: #6a3aa8; }
.sync-result { display: inline-block; font-size: 12px; font-weight: 600; white-space: nowrap; text-transform: capitalize; }
.sync-result--success { color: #2e9e44; }
.sync-result--pending, .sync-result--retrying { color: #c98a00; }
.sync-result--failed { color: #d33; }
.sync-result--skipped { color: var(--muted); }
.sync-error { color: #d33; font-size: 13px; margin-top: 3px; word-break: break-word; }
.sync-rowid { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.sync-actions { white-space: nowrap; text-align: right; }
.sync-actions .btn { padding: 3px 9px; font-size: 13px; }
.sync-children { background: var(--bg); font-size: 13px; }
.sync-children td { border-bottom: 1px solid var(--border); }
tr[data-slot] > td { padding: 0 0 0 28px; background: var(--bg); }
tr[data-slot] .audit-details pre { margin: 8px; }

/* ---------- documentation pages ---------- */
.doc-page { max-width: 1000px; }
.doc-card { margin-bottom: 16px; line-height: 1.55; }
.doc-card h2 { font-size: 18px; margin: 0 0 8px; }
.doc-card p { margin: 0 0 10px; }
.doc-card ul { margin: 0; padding-left: 20px; }
.doc-card li { margin-bottom: 6px; }
.doc-card code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 13px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.doc-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.doc-url { word-break: break-all; }
.doc-pre { background: #1e1e1e; color: #e6e6e6; border-radius: 6px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; overflow-x: auto; margin: 0 0 10px; }
