/* EPTCA Hub — flat B2B dashboard */

:root {
  --dash-bg: #f5f7fa;
  --dash-card: #ffffff;
  --dash-border: #e5eaf0;
  --dash-radius: 12px;
  --dash-radius-sm: 10px;
  --dash-radius-lg: 14px;
  --brand: #00aeef;
  --brand-hover: #0096d1;
  --brand-soft: #e8f7fd;
  --brand-dark: #0077a8;
}

.dash-page {
  background: var(--dash-bg);
  min-height: 100%;
}

.dash-card {
  border-radius: var(--dash-radius);
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
}

.dash-card-flat {
  border-radius: var(--dash-radius);
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
}

.dash-pill {
  border-radius: 999px;
}

.dash-feature {
  border-radius: var(--dash-radius-lg);
  background: var(--brand);
}

.dash-feature-glow {
  display: none;
}

.dash-mod {
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dash-mod:hover {
  border-color: var(--brand);
  background: #fafcfe;
}

.dash-kpi-icon {
  border-radius: var(--dash-radius-sm);
}

.dash-header {
  border-bottom: 1px solid var(--dash-border);
  background: #fff;
}

.dash-topbar {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--dash-border);
  background: #fff;
}

.dash-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #4b5563;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-icon-btn:hover {
  background: #f3f4f6;
  color: var(--brand-dark);
}

.dash-notify-dot {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.dash-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  max-width: 16rem;
  height: 2.5rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  transition: background 0.15s ease;
}

.dash-user-chip:hover {
  background: var(--brand-soft);
}

.dash-topbar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  width: 16rem;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--dash-border);
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.dash-topbar-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-topbar-item:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.dash-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.dash-btn-primary:hover {
  background: var(--brand-hover);
}

.dash-btn-primary:disabled {
  cursor: wait;
  opacity: 0.6;
}

.dash-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--dash-border);
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--brand);
}

.dash-input,
.dash-select {
  height: 2.5rem;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--dash-border);
  background: #fff;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.dash-input:focus,
.dash-select:focus {
  border-color: var(--brand);
}

.dash-table-wrap {
  border-radius: var(--dash-radius);
  background: #fff;
  border: 1px solid var(--dash-border);
}

/* Wrapper da tabela — sem overflow vertical próprio (usa o scroll da página) */
.table-x-scroll {
  max-width: 100%;
}

.dash-table thead {
  background: #f8fafc;
}

.dash-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.dash-sort-btn::after {
  content: "↕";
  opacity: 0.35;
  font-size: 0.7rem;
  line-height: 1;
}

.dash-sort-btn:hover {
  color: var(--brand-dark);
}

.dash-sort-btn.is-active {
  color: var(--brand-dark);
}

.dash-sort-btn.is-active::after {
  opacity: 1;
  content: "↓";
}

.dash-sort-btn.is-active.is-asc::after {
  content: "↑";
}

.dash-table tbody tr {
  transition: background 0.12s ease;
}

.dash-table tbody tr:hover {
  background: var(--brand-soft);
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #111827;
  border: 1px solid var(--dash-border);
}

.dash-chip-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.dash-period {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--dash-border);
  background: #f1f5f9;
}

.dash-period-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  text-align: left;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.dash-period-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.dash-period-btn.is-active {
  background: #fff;
  color: var(--brand-dark);
  border-color: rgba(0, 174, 239, 0.35);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dash-period-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.dash-period-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
}

.dash-period-btn.is-active .dash-period-sub {
  color: #64748b;
}

@media (max-width: 640px) {
  .dash-period-btn {
    padding: 0.55rem 0.65rem;
  }
  .dash-period-title {
    font-size: 0.8125rem;
  }
}

.dash-sidebar {
  background: #fff;
  border-right: 1px solid var(--dash-border);
}

.dash-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  font-family: inherit;
  width: 100%;
  max-width: 100vw;
}

.dash-shell > .dash-page {
  min-width: 0;
  max-width: 100%;
}

#page-content {
  min-width: 0;
  max-width: 100%;
}

html {
  overflow-y: scroll;
}

html.overflow-hidden,
html.overflow-hidden body {
  overflow: hidden;
}

body {
  min-height: 100%;
}

.dash-sidebar-backdrop {
  display: none;
}

.dash-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #4b5563;
}

.dash-menu-btn:hover {
  background: #f3f4f6;
  color: var(--brand-dark);
}

@media (max-width: 767px) {
  .dash-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(18rem, 86vw);
    min-height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.12);
  }

  .dash-shell.is-nav-open .dash-sidebar {
    transform: translateX(0);
  }

  .dash-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    border: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .dash-shell.is-nav-open .dash-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 768px) {
  .dash-shell {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .dash-sidebar {
    position: relative;
    inset: auto;
    width: auto;
    transform: none !important;
    box-shadow: none;
  }

  .dash-menu-btn {
    display: none;
  }

  .dash-sidebar-backdrop {
    display: none !important;
  }
}

.dash-nav-active {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
  font-weight: 600;
}

.dash-modal-panel {
  position: relative;
  z-index: 1;
  border-radius: var(--dash-radius-lg);
  background: #fff;
  border: 1px solid var(--dash-border);
  overflow: hidden;
}

.match-simple {
  display: grid;
  gap: 1rem;
}

.match-simple-score {
  text-align: center;
  padding: 0.25rem 0 0.15rem;
}

.match-simple-score strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 750;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.match-simple-score span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: #1f2937;
}

.match-simple-score p {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.match-simple-block {
  border: 1px solid #e5eaf0;
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 0.9rem;
}

.match-simple-block.is-muted {
  background: #f8fafc;
}

.match-simple-label {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.match-simple-meta {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.match-simple-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}

.match-simple-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.match-simple-chip {
  display: inline-flex;
  align-items: center;
  height: 1.45rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.6875rem;
  font-weight: 700;
}

.match-simple-list {
  display: grid;
  gap: 0.5rem;
}

.match-simple-alt {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e8eef4;
  border-radius: 10px;
  background: #fff;
}

.match-simple-alt strong {
  flex-shrink: 0;
  min-width: 2.5rem;
  font-size: 0.8125rem;
  font-weight: 750;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.match-simple-alt p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #334155;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.match-simple-note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
}

/* Notificações / confirmações do app (substitui alert/confirm) */
.dash-notify-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.dash-notify-root.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dash-notify-panel {
  width: min(100%, 26rem);
  border-radius: var(--dash-radius-lg);
  border: 1px solid var(--dash-border);
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}

.dash-notify-root.is-open .dash-notify-panel {
  transform: none;
}

.dash-notify-body {
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem 1.25rem 0.25rem;
}

.dash-notify-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 12px;
}

.dash-notify-icon[data-tone="info"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.dash-notify-icon[data-tone="success"] {
  background: #ecfdf5;
  color: #047857;
}

.dash-notify-icon[data-tone="warning"] {
  background: #fff7ed;
  color: #c2410c;
}

.dash-notify-icon[data-tone="error"],
.dash-notify-icon[data-tone="danger"] {
  background: #fef2f2;
  color: #b91c1c;
}

.dash-notify-copy {
  min-width: 0;
  flex: 1;
  padding-top: 0.1rem;
}

.dash-notify-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}

.dash-notify-message {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
  white-space: pre-wrap;
}

.dash-notify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
}

.dash-notify-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #dc2626;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-notify-btn-danger:hover {
  background: #b91c1c;
  border-color: #f87171;
}

@media (prefers-reduced-motion: reduce) {
  .dash-notify-root,
  .dash-notify-panel {
    transition: none;
  }
}

.detail-expand > td {
  background: linear-gradient(180deg, #f4f8fb 0%, #eef3f7 100%);
  padding: 0 !important;
}

.detail-panel {
  border-top: 2px solid var(--brand);
  background: #fff;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-panel-head {
  min-width: 0;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
}

.detail-edital-chip {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-panel-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
}

.detail-panel-actions {
  max-width: 100%;
}

.detail-kpi-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.detail-kpi {
  border: 1px solid #e2eaf2;
  border-radius: var(--dash-radius-sm);
  background: linear-gradient(180deg, #f8fbfe 0%, #fff 100%);
  padding: 0.625rem 0.75rem;
  min-width: 0;
}

.detail-kpi p:last-child {
  overflow-wrap: anywhere;
}

.detail-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--dash-border);
  background: #fafcfe;
  scrollbar-width: thin;
}

.detail-tab {
  flex: 0 0 auto;
  height: 2.625rem;
  padding: 0 0.95rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.detail-tab:hover {
  color: var(--brand-dark);
  background: rgba(0, 174, 239, 0.04);
}

.detail-tab[aria-selected="true"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
  background: #fff;
}

.detail-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.125rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 700;
}

.detail-tab[aria-selected="true"] .detail-tab-count {
  background: var(--brand-soft);
  color: var(--brand);
}

.detail-pane-wrap {
  background: #fff;
}

.detail-pane[hidden] {
  display: none !important;
}

.detail-section-title {
  margin: 0 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.detail-field {
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  background: #fff;
  padding: 0.625rem 0.75rem;
}

.detail-field-soft {
  background: #f8fafc;
  border-color: #e8eef4;
}

.detail-empty {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border: 1px dashed #d5dee8;
  border-radius: var(--dash-radius);
  background: linear-gradient(180deg, #f8fafc 0%, #f3f7fa 100%);
}

.detail-empty-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #e8f1f7;
  color: #5b7290;
  flex-shrink: 0;
}

.detail-empty-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: #1f2937;
}

.detail-empty-body {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
  max-width: 42rem;
}

.detail-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  height: 1.875rem;
  padding: 0 0.7rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.detail-empty-action:hover {
  background: var(--brand-hover);
  color: #fff;
}

.detail-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2eaf2;
  border-radius: var(--dash-radius-sm);
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.detail-link-row:hover {
  border-color: #b9d7ea;
  background: #f7fbfe;
  box-shadow: 0 1px 0 rgba(0, 174, 239, 0.08);
}

.detail-link-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  flex-shrink: 0;
}

.detail-link-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 650;
  color: #1f2937;
}

.detail-link-url {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-link-open {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--brand);
}

.detail-match {
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  background: #fff;
  padding: 0.75rem;
}

.item-similarity-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.75rem;
  padding: 0 0.6rem;
  border-radius: 8px;
  border: 1px solid #dbe7f0;
  background: #f8fbfd;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.item-similarity-btn:hover {
  background: var(--brand-soft);
  border-color: rgba(0, 174, 239, 0.35);
}

.item-similarity-score {
  display: inline-flex;
  align-items: center;
  height: 1.15rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.6875rem;
  font-weight: 700;
  tabular-nums: true;
  font-variant-numeric: tabular-nums;
}

.item-similarity-verdict {
  font-size: 0.6875rem;
  font-weight: 700;
}

.item-similarity-verdict.is-ok {
  color: #047857;
}

.item-similarity-verdict.is-bad {
  color: #b91c1c;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #4285f4;
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-google:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

.item-desc-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--clamp, 4);
  overflow: hidden;
}

.item-desc-collapsed.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.sync-loading-panel {
  display: grid;
  place-items: center;
  min-height: 22rem;
  padding: 2rem 1rem 2.25rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 174, 239, 0.14), transparent 65%),
    linear-gradient(180deg, #f4f9fc 0%, #ffffff 55%);
}

.sync-loading-card {
  width: min(100%, 28rem);
  padding: 1.5rem 1.35rem 1.35rem;
  border: 1px solid #dbe7f0;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 28px rgba(15, 23, 42, 0.06);
  text-align: center;
}

.sync-loading-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  position: relative;
}

.sync-loading-spinner {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2.5px solid transparent;
  border-top-color: var(--brand);
  border-right-color: rgba(0, 174, 239, 0.25);
  animation: sync-spin 0.85s linear infinite;
}

.sync-loading-title {
  margin: 1rem 0 0;
  font-size: 1.0625rem;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.sync-loading-detail {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #475569;
  min-height: 2.6em;
}

.sync-loading-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 1.15rem;
}

.sync-loading-step {
  padding: 0.4rem 0.25rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8eef4;
  color: #94a3b8;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sync-loading-step.is-done {
  background: #eef9f1;
  border-color: #cceed6;
  color: #15803d;
}

.sync-loading-step.is-active {
  background: var(--brand-soft);
  border-color: #b9dcf0;
  color: var(--brand-dark);
}

.sync-loading-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.sync-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.625rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid #d5e6f1;
  background: #f3f9fd;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 650;
}

.sync-loading-track {
  margin-top: 1.15rem;
}

.sync-loading-track-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: #64748b;
}

.sync-loading-track-top strong {
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.sync-loading-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: #e7eef4;
  overflow: hidden;
}

.sync-loading-bar > span {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0096d1, var(--brand), #5ad0f7);
  transition: width 0.35s ease;
}

.sync-loading-bar.is-indeterminate > span {
  width: 42%;
  animation: sync-bar-slide 1.15s ease-in-out infinite;
}

.sync-loading-hint {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid #eef2f6;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #64748b;
}

body.is-syncing .dash-table thead,
body.is-syncing #table-footer {
  display: none;
}

body.is-syncing .dash-table-wrap {
  overflow: hidden;
  border-color: #cfe3f0;
  box-shadow: 0 0 0 1px rgba(0, 174, 239, 0.08);
}

body.is-syncing .dash-table tbody {
  display: block;
}

body.is-syncing .dash-table tbody tr.sync-loading-row,
body.is-syncing .dash-table tbody tr.sync-loading-row > td {
  display: block;
  width: 100%;
  border: 0;
}

body.is-syncing #btn-sync {
  pointer-events: none;
  opacity: 0.72;
}

body.is-syncing #btn-sync i {
  animation: sync-spin 0.9s linear infinite;
}

body.is-syncing #sync-status {
  display: inline !important;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand-dark);
  font-weight: 600;
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sync-bar-slide {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(280%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sync-loading-spinner,
  body.is-syncing #btn-sync i,
  .sync-loading-bar.is-indeterminate > span {
    animation: none;
  }
}

@keyframes dash-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dash-in {
  animation: dash-in 0.3s ease both;
}
.dash-in-2 {
  animation-delay: 0.04s;
}
.dash-in-3 {
  animation-delay: 0.08s;
}
.dash-in-4 {
  animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  .dash-in {
    animation: none;
  }
}
