/* Shared UI primitives — tables, buttons, filters, empty/loading (AD-0019) */
.thrive-btn {
  font-family: var(--ff);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  background: var(--teal);
  color: #fff;
}
.thrive-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.thrive-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--white);
}
.thrive-btn--danger { background: var(--red); }

.thrive-input, .thrive-search {
  width: 100%;
  font-family: var(--ff);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  outline: none;
}
.thrive-input:focus, .thrive-search:focus { border-color: var(--teal); }

.thrive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.thrive-table th {
  text-align: left;
  font-weight: 600;
  color: var(--soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.thrive-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--white);
}
.thrive-table tbody tr:hover { background: rgba(61, 122, 111, 0.06); }

.thrive-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.thrive-filter {
  font-family: var(--ff);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--soft);
  cursor: pointer;
}
.thrive-filter.is-active,
.thrive-filter.active {
  background: var(--teal-lt);
  border-color: var(--teal);
  color: var(--white);
}

.thrive-empty, .thrive-loading {
  text-align: center;
  padding: 28px 16px;
  color: var(--soft);
  font-size: 13px;
}
.thrive-empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(61, 122, 111, 0.04);
}
.thrive-empty-state__icon {
  font-size: 28px;
  margin-bottom: var(--space-3);
  color: var(--teal);
}
.thrive-empty-state__title {
  font-family: var(--ffm);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-2);
}
.thrive-empty-state__body {
  font-size: 13px;
  color: var(--soft);
  max-width: 360px;
  margin: 0 auto var(--space-4);
  line-height: 1.5;
}
.thrive-busy { opacity: 0.55; pointer-events: none; }

.thrive-toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}
.thrive-toast {
  font-family: var(--ff);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: pre-line;
  line-height: 1.45;
}
.thrive-toast--success { border-color: rgba(45, 198, 83, 0.45); }
.thrive-toast--error { border-color: rgba(230, 57, 70, 0.55); }
.thrive-toast--info { border-color: rgba(61, 122, 111, 0.45); }

/* ── Product Feel: breadcrumbs ─────────────────────────────── */
.thrive-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-4);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.thrive-breadcrumb__item {
  font-family: var(--ff);
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thrive-breadcrumb__item.is-current {
  color: var(--soft);
  font-weight: 600;
}
.thrive-breadcrumb__link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
  font-family: var(--ff);
}
.thrive-breadcrumb__link:hover { text-decoration: underline; }
.thrive-breadcrumb__sep { color: var(--muted); opacity: 0.7; user-select: none; }

/* ── Product Feel: hierarchy + motion ──────────────────────── */
.thrive-page-enter {
  animation: thrive-fade-in 0.2s ease;
}
@keyframes thrive-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.thrive-skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(139, 168, 196, 0.08) 0%,
    rgba(139, 168, 196, 0.18) 50%,
    rgba(139, 168, 196, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: thrive-shimmer 1.2s ease-in-out infinite;
}
.thrive-skeleton--lg { height: 20px; }
.thrive-skeleton--block { height: 64px; margin-bottom: var(--space-2); }
@keyframes thrive-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.thrive-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}
.thrive-btn:active:not(:disabled) { transform: scale(0.98); }

.thrive-hierarchy-title {
  font-family: var(--ffm);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-1);
}
.thrive-hierarchy-sub {
  font-size: 13px;
  color: var(--soft);
  margin-bottom: var(--space-5);
}
.thrive-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.thrive-primary-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  align-items: center;
}

/* ── UI Consistency: type roles ─────────────────────────────── */
.thrive-text-caption { font-size: var(--text-caption); color: var(--muted); line-height: var(--lh-body); }
.thrive-text-label {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--space-2);
}
.thrive-text-body { font-size: var(--text-body); color: var(--white); line-height: var(--lh-body); }
.thrive-text-section {
  font-family: var(--ff);
  font-size: var(--text-section);
  font-weight: 600;
  color: var(--white);
  line-height: var(--lh-tight);
}
.thrive-text-title {
  font-family: var(--ffm);
  font-size: var(--text-title);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}
.thrive-text-display {
  font-family: var(--ffm);
  font-size: var(--text-display);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

/* Canonical page chrome */
.thrive-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.thrive-page-header .page-title,
.thrive-page-header .thrive-text-title {
  font-family: var(--ffm);
  font-size: var(--text-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.thrive-page-header .page-sub {
  font-size: var(--text-body);
  color: var(--muted);
  margin-top: var(--space-1);
}
.thrive-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
/* One primary max — secondary actions use ghost */
.thrive-btn--secondary,
.thrive-btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--soft);
}
.thrive-btn--secondary:hover,
.thrive-btn--outline:hover {
  border-color: var(--soft);
  color: var(--white);
}

/* Sticky table header helper */
.thrive-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.thrive-table-wrap .thrive-table thead th,
.thrive-table-wrap .data-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

/* Focus ring — teal only */
.thrive-btn:focus-visible,
.thrive-input:focus-visible,
.thrive-search:focus-visible,
.thrive-filter:focus-visible,
.thrive-breadcrumb__link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

