:root {
  --td-surface: #fffaf1;
  --td-surface-muted: #f6efe2;
  --td-surface-elevated: rgba(255, 250, 241, 0.92);
  --td-border: #dfcfb2;
  --td-border-soft: rgba(75, 50, 22, 0.1);
  --td-primary: #527a2d;
  --td-primary-soft: rgba(82, 122, 45, 0.12);
  --td-slate-900: #2a2114;
  --td-slate-700: #4b3a24;
  --td-slate-500: #786850;
  --td-sidebar-top: #24190c;
  --td-sidebar-bottom: #4b3216;
  --td-sidebar-muted: #c5ad83;
  --td-sidebar-active: rgba(255, 255, 255, 0.12);
  --td-shadow-sm: 0 12px 28px rgba(75, 50, 22, 0.05);
  --td-shadow-md: 0 22px 48px rgba(75, 50, 22, 0.08);
}

html {
  scroll-behavior: smooth;
}

/* Floating action buttons */
.td-floating-actions {
  position: fixed;
  bottom: 6.25rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999;
  pointer-events: auto;
}

.td-floating-actions__btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: var(--td-primary);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--td-shadow-md);
  transition: all 0.2s ease;
  font-weight: bold;
}

.td-floating-actions__btn:hover {
  background: #427a1f;
  transform: scale(1.1);
  box-shadow: 0 28px 48px rgba(75, 50, 22, 0.15);
}

.td-floating-actions__btn:active {
  transform: scale(0.95);
}

.td-floating-actions__pin.is-active {
  background: linear-gradient(145deg, #b9dd7e 0%, #5f8b34 100%);
  color: #f9fbf5;
}

.td-floating-actions__pin.is-active:hover {
  background: linear-gradient(145deg, #c9e98f 0%, #6ea040 100%);
}

@media (max-width: 768px) {
  .td-floating-actions {
    bottom: 5rem;
    right: 1rem;
  }
  .td-floating-actions__btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1rem;
  }
}

body {
  color: var(--td-slate-700);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--td-surface-muted);
}

body.app-default,
body.app-blank {
  background: var(--td-surface-muted);
}

body.app-default {
  --bs-app-header-height: 5.2em;
  --bs-app-header-height-actual: 5.2em;
}

body.app-default {
  background-attachment: fixed;
}

.app-content {
  padding-top: 1.75rem;
  padding-bottom: 2.25rem;
}

.app-header-logo img {
  width: auto;
}

.app-header-wrapper {
  min-width: 0;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(18, 35, 66, 0.05);
}

.app-navbar .btn,
.app-header-logo .btn,
.app-header-wrapper .btn {
  border-radius: 8px;
}

.btn {
  border-radius: 8px;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.btn:hover {
  transform: none;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.18rem rgba(82, 122, 45, 0.16);
}

.card {
  border: 1px solid var(--td-border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(18, 35, 66, 0.05);
  overflow: hidden;
}

.card.card-flush {
  box-shadow: var(--td-shadow-sm);
}

.card .card-header {
  background: transparent;
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

.card .card-body {
  position: relative;
}

.badge {
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.form-control,
.form-select {
  border-radius: 0.95rem;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: none !important;
  background-color: rgba(248, 250, 252, 0.96);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.form-control.bg-transparent {
  background-color: rgba(248, 250, 252, 0.96) !important;
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff;
  border-color: rgba(82, 122, 45, 0.32);
  box-shadow: 0 0 0 0.18rem rgba(82, 122, 45, 0.1) !important;
}

.form-label {
  color: var(--td-slate-700);
}

.breadcrumb {
  --bs-breadcrumb-divider: "·";
  align-items: center;
  margin-bottom: 0;
}

.breadcrumb .breadcrumb-item {
  color: var(--td-slate-500);
}

.breadcrumb .breadcrumb-item a {
  color: var(--td-slate-700);
  text-decoration: none;
}

.breadcrumb .breadcrumb-item a:hover {
  color: var(--td-primary);
}

.td-content-breadcrumbs {
  margin-bottom: 0;
}

.td-header-page {
  min-width: 0;
  gap: 0.35rem;
}

.td-header-title {
  max-width: 100%;
  margin-bottom: 0;
  line-height: 1.08;
}

.td-header-description {
  max-width: 52rem;
  color: var(--td-slate-500);
  font-size: 0.92rem;
  line-height: 1.55;
}

.td-header-stats {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.td-header-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 168px;
  max-width: 230px;
  padding: 0.8rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.td-header-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
}

.td-header-stat-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.td-header-stat-label {
  color: var(--td-slate-900);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.td-header-stat-value {
  color: var(--td-slate-500);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-header-action {
  min-width: 0;
  box-shadow: 0 12px 28px rgba(82, 122, 45, 0.16);
}

.td-page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 249, 253, 0.96) 100%);
  box-shadow: var(--td-shadow-sm);
}

.td-page-hero__content {
  min-width: 0;
  flex: 1 1 24rem;
}

.td-page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.td-page-hero__microcopy {
  color: var(--td-slate-500);
  font-size: 0.9rem;
  line-height: 1.5;
}

.td-page-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(82, 122, 45, 0.1);
  color: var(--td-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-page-title {
  color: var(--td-slate-900);
  font-size: clamp(1.45rem, 1.1rem + 1vw, 2.25rem);
  font-weight: 800;
  line-height: 1.08;
}

.td-page-hero--editorial {
  gap: 1.5rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1.45rem;
  background:
    radial-gradient(circle at 0 0, rgba(201, 133, 43, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.96) 0%, rgba(246, 239, 226, 0.96) 100%);
}

.td-page-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.td-page-kpi {
  min-width: 130px;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.td-page-kpi__label {
  color: var(--td-slate-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-page-kpi__value {
  margin-top: 0.35rem;
  color: var(--td-slate-900);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.td-editorial-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 253, 0.96) 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.td-editorial-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.td-editorial-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--td-slate-700);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

.td-editorial-list-dot {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: var(--td-primary);
  flex: 0 0 auto;
}

.td-controlbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  padding: 1rem 1.1rem;
  border-radius: 1.05rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 253, 0.96) 100%);
}

.td-controlbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.td-controlbar__result {
  flex: 0 0 auto;
}

.td-controlbar-search {
  width: min(100%, 290px);
}

.td-controlbar-select {
  min-width: 168px;
}

.td-controlbar-select-lg {
  min-width: 210px;
}

.td-action-grid {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.td-table-note {
  max-width: 31rem;
  color: var(--td-slate-500);
  font-size: 0.82rem;
  line-height: 1.45;
}

.td-muted-strong {
  color: var(--td-slate-500);
  font-size: 0.8rem;
  font-weight: 600;
}

.timeline .timeline-line {
  border-left-color: rgba(15, 23, 42, 0.12);
}

.td-marketplace-hero {
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(246, 239, 226, 0.98) 100%);
}

.td-marketplace-panel {
  background:
    linear-gradient(160deg, #24190c 0%, #4b3216 52%, #315222 100%);
}

.td-marketplace-thumb {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.td-marketplace-empty {
  padding: 2rem 0 2.5rem;
  text-align: center;
}

.td-market-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(36, 25, 12, 0.94) 0%, rgba(75, 50, 22, 0.88) 48%, rgba(82, 122, 45, 0.78) 100%);
}

.td-market-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.td-market-stat {
  padding: 1.35rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.td-market-stat-label {
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.08em;
}

.td-opportunity-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.td-opportunity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(75, 50, 22, 0.1);
}

.td-opportunity-price {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.9rem 1rem;
  min-width: 190px;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffaf1 0%, #f2e5cf 100%);
  border: 1px solid rgba(75, 50, 22, 0.1);
}

.td-opportunity-price-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--td-slate-500);
}

.td-opportunity-price-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--td-slate-900);
}

.td-opportunity-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  min-height: 100%;
  border-radius: 0.9rem;
  background: #fff6e8;
  border: 1px solid rgba(75, 50, 22, 0.08);
}

.td-opportunity-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--td-slate-500);
}

.td-opportunity-meta-value {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--td-slate-900);
}

.td-opportunity-side {
  width: 230px;
  min-width: 230px;
  padding: 1.1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffaf1 0%, #f2e5cf 100%);
  border: 1px solid rgba(75, 50, 22, 0.1);
}

.td-market-title {
  color: var(--td-slate-900);
  font-size: clamp(2rem, 1.4rem + 1.8vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.td-market-copy {
  max-width: 44rem;
  color: var(--td-slate-500);
  line-height: 1.6;
}

.td-market-stat-card {
  background: rgba(255, 250, 241, 0.95);
}

.td-market-stat-card .card-body {
  border: 0;
}

.td-market-overview-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #527a2d 0%, #4b3216 100%);
  box-shadow: 0 18px 45px rgba(75, 50, 22, 0.18);
}

.td-market-overview-card::before {
  content: "";
  position: absolute;
  inset: auto -12% -32% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
}

.td-market-overview-card .card-header,
.td-market-overview-card .card-body {
  position: relative;
  z-index: 1;
}

.td-market-switcher {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 249, 253, 0.94) 100%);
}

.td-stage-column {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.td-stage-empty {
  border: 1px dashed rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.td-opportunity-title {
  line-height: 1.35;
}

.td-opportunity-description {
  color: var(--td-slate-500);
  line-height: 1.5;
}

.td-opportunity-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.td-opportunity-meta-item {
  padding: 0.8rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
}

.td-opportunity-footer {
  padding-top: 0.15rem;
}

.td-admin-users-search {
  width: min(100%, 280px);
}

.td-admin-users-select {
  min-width: 165px;
}

.td-admin-users-sort {
  min-width: 195px;
}

.td-auth-shell {
  position: relative;
  min-height: calc(100vh - var(--bs-app-header-height, 5.2em));
  overflow: hidden;
}

.td-auth-shell::before,
.td-auth-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.td-auth-shell::before {
  inset: 2rem auto auto -8rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(82, 122, 45, 0.18) 0%, rgba(82, 122, 45, 0) 68%);
}

.td-auth-shell::after {
  inset: auto -5rem -6rem auto;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(201, 133, 43, 0.14) 0%, rgba(201, 133, 43, 0) 68%);
}

.td-auth-shell__main {
  position: relative;
  background:
    linear-gradient(180deg, rgba(246, 248, 252, 0.82) 0%, rgba(235, 241, 248, 0.92) 100%);
}

.td-auth-card {
  width: 100%;
}

.td-auth-card__inner {
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.5rem;
  background: var(--td-surface-elevated);
  box-shadow: var(--td-shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.td-auth-hero {
  position: relative;
  height: 100%;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: linear-gradient(145deg, rgba(36, 25, 12, 0.96) 0%, rgba(75, 50, 22, 0.92) 56%, rgba(82, 122, 45, 0.72) 100%);
}

.td-auth-hero::before {
  content: "";
  position: absolute;
  inset: auto -5rem -7rem auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.td-auth-hero__panel {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  background: rgba(8, 15, 30, 0.24);
  box-shadow: 0 24px 60px rgba(8, 15, 30, 0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.td-auth-hero__logo {
  width: auto;
  height: 52px;
}

.td-auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-auth-hero-title {
  color: #ffffff;
  font-size: clamp(2.2rem, 1.5rem + 2vw, 3.9rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.td-auth-hero-copy {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.6;
}

.td-auth-point-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.td-auth-point {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.td-auth-point-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-auth-point-value {
  margin-top: 0.35rem;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 991.98px) {
  .app-content {
    padding-top: 1.25rem;
  }

  .td-marketplace-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .td-opportunity-side {
    width: 100%;
    min-width: 0;
  }

  .td-opportunity-price {
    min-width: 0;
    align-items: flex-start;
  }

  .td-header-stats,
  .td-page-hero__actions {
    width: 100%;
  }

  .td-header-stats {
    flex-direction: column;
    justify-content: flex-start;
  }

  .td-header-stat {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .td-page-hero__actions {
    align-items: stretch;
  }

  .td-auth-point-list {
    grid-template-columns: 1fr;
  }

  .td-auth-shell__main,
  .td-auth-hero {
    min-height: 0;
  }

  .td-controlbar,
  .td-controlbar__group {
    width: 100%;
  }

  .td-action-grid {
    justify-items: start;
  }
}

.td-workspace-strip {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 253, 0.98) 100%);
}

.td-workspace-chip {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 130px;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.td-workspace-card .card-header {
  align-items: flex-start;
  gap: 1rem;
}

.td-workspace-title {
  font-size: 1rem;
  line-height: 1.35;
}

.td-workspace-pill {
  padding: 0.55rem 0.85rem;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  color: var(--td-slate-700);
}

.td-workspace-table td,
.td-workspace-table th {
  vertical-align: middle;
}

.td-activity-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.td-activity-toggle .td-activity-caret {
  transition: transform 0.18s ease;
}

.td-activity-toggle[aria-expanded="true"] .td-activity-caret {
  transform: rotate(180deg);
}

.td-activity-table {
  border-collapse: separate;
  border-spacing: 0;
}

.td-activity-table td,
.td-activity-table th {
  vertical-align: middle;
}

.td-activity-table thead th {
  padding: 0.35rem 0.9rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  letter-spacing: 0.08em;
}

.td-activity-toggle-row {
  cursor: pointer;
  animation: td-activity-row-in 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--td-activity-row-delay, 0ms);
}

.td-activity-toggle-row > td {
  position: relative;
  padding: 1rem 0.9rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.td-activity-toggle-row > td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.18s ease, opacity 0.18s ease;
  opacity: 0;
}

.td-activity-bulk-bar {
  margin-bottom: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 1.05rem;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 18px 34px rgba(59, 130, 246, 0.08);
}

.td-activity-select-col {
  width: 42px;
}

.td-activity-actions-col {
  min-width: 180px;
}

.td-activity-toggle-row:hover > td,
.td-activity-toggle-row:focus-visible > td {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(59, 130, 246, 0.18);
}

.td-activity-toggle-row:hover > td:first-child::before,
.td-activity-toggle-row:focus-visible > td:first-child::before,
.td-activity-toggle-row.td-activity-row-expanded > td:first-child::before,
.td-activity-toggle-row.td-activity-row-selected > td:first-child::before {
  opacity: 1;
  background: linear-gradient(180deg, var(--td-primary) 0%, rgba(14, 165, 233, 0.88) 100%);
}

.td-activity-toggle-row.td-activity-row-expanded > td {
  background: rgba(243, 248, 255, 0.92);
  border-color: rgba(59, 130, 246, 0.22);
}

.td-activity-toggle-row.td-activity-row-selected > td {
  background: rgba(239, 246, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.24);
}

.td-activity-toggle-row[aria-expanded="true"] .td-activity-caret {
  transform: rotate(180deg);
  color: var(--td-primary);
}

.td-activity-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.td-activity-cell-title {
  color: var(--td-slate-900);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.td-activity-cell-title-sm {
  font-size: 0.88rem;
}

.td-activity-cell-subtitle {
  color: var(--td-slate-500);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}

.td-activity-cell-kicker {
  color: var(--td-slate-500);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-activity-inline-separator {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.45rem;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.9);
  vertical-align: middle;
}

.td-activity-summary {
  max-width: 32rem;
  line-height: 1.45;
}

.td-activity-action-note {
  max-width: 42rem;
  line-height: 1.45;
}

.td-activity-caret {
  transition: transform 0.22s ease, color 0.22s ease;
}

.td-activity-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--td-primary);
  font-size: 0.77rem;
  font-weight: 700;
}

.td-activity-inline-link::after {
  content: "↗";
  font-size: 0.8rem;
}

.td-activity-context-cell {
  align-items: flex-start;
}

.td-activity-row-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--td-slate-500);
}

.td-activity-detail-row > td {
  padding-top: 0;
  padding-bottom: 0;
  border-top: 0;
  background: transparent;
}

.td-activity-collapse .td-activity-detail-panel {
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
}

.td-activity-collapse.show .td-activity-detail-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: td-activity-panel-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.td-activity-detail-panel {
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 251, 0.98) 100%);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.td-activity-detail-header {
  padding-bottom: 0.7rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.td-activity-detail-hero,
.td-activity-detail-card,
.td-activity-detail-section-card,
.td-activity-detail-payload-card {
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: none;
}

.td-activity-detail-hero .card-body,
.td-activity-detail-card .card-body,
.td-activity-detail-section-card .card-body,
.td-activity-detail-payload-card .card-body {
  padding-top: 0;
}

.td-activity-detail-hero-item {
  min-height: 40px;
}

.td-activity-detail-icon {
  border-radius: 0.75rem;
}

.td-activity-detail-chip {
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
}

.td-activity-detail-note {
  color: var(--td-slate-700);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.45;
}

.td-activity-detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.td-activity-detail-summary-item {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
}

.td-activity-detail-summary-label {
  color: var(--td-slate-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-activity-detail-summary-value {
  margin-top: 0.5rem;
  color: var(--td-slate-900);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.td-activity-detail-facts {
  display: flex;
  flex-direction: column;
}

.td-activity-detail-fact {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.22);
}

.td-activity-detail-fact:first-child {
  padding-top: 0;
  border-top: 0;
}

.td-activity-detail-fact:last-child {
  padding-bottom: 0;
}

.td-activity-detail-fact-label {
  color: var(--td-slate-500);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-activity-detail-fact-value {
  color: var(--td-slate-900);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.td-activity-detail-fact-link {
  color: var(--td-primary);
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}

.td-activity-detail-fact-link:hover {
  text-decoration: underline;
}

.td-activity-detail-facts-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
}

.td-activity-detail-facts-technical {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
}

.td-activity-detail-entity-card,
.td-activity-detail-actor-card {
  padding: 0.1rem 0 0;
}

.td-activity-detail-entity-title {
  color: var(--td-slate-900);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
}

.td-activity-detail-entity-meta {
  margin-top: 0.15rem;
  color: var(--td-slate-500);
  font-size: 0.78rem;
  font-weight: 600;
}

.td-activity-detail-entity-text {
  color: var(--td-slate-700);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.td-activity-detail-entity-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--td-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.td-activity-detail-entity-link::after {
  content: "↗";
  font-size: 0.82rem;
}

.td-activity-detail-entity-link:hover {
  text-decoration: underline;
}

.td-activity-detail-link {
  max-width: 100%;
  word-break: break-word;
}

.td-activity-detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.td-activity-detail-meta-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.td-activity-detail-meta-label {
  flex: 0 0 39%;
  max-width: 39%;
  line-height: 1.2;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.td-activity-detail-meta-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  line-height: 1.2;
}

.td-activity-detail-payload-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.td-activity-detail-block-title {
  color: var(--td-slate-500);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-activity-detail-pills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.td-activity-detail-pill {
  padding: 0.75rem 0.8rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.9);
}

.td-activity-detail-pill-label {
  color: var(--td-slate-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-activity-detail-pill-value {
  margin-top: 0.35rem;
  color: var(--td-slate-900);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.td-activity-detail-raw-block {
  padding-top: 0.2rem;
}

.td-activity-detail-empty-note {
  padding: 0.85rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  color: var(--td-slate-500);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  background: rgba(248, 250, 252, 0.85);
}

.td-activity-raw-payload {
  max-height: 180px;
  overflow: auto;
  padding: 0.8rem 0.9rem;
  margin-bottom: 0;
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.td-workspace-empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.td-agreement-note {
  max-width: 420px;
  line-height: 1.55;
}

.td-agreement-meta,
.td-agreement-participant,
.td-agreement-message {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #f8fafc;
}

.td-agreement-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  min-height: 100%;
}

.td-agreement-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--td-slate-500);
}

.td-agreement-meta-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--td-slate-900);
  line-height: 1.45;
}

.td-agreement-participant {
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.td-agreement-message {
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.td-agreement-history-note {
  margin-top: 0.45rem;
  color: var(--td-slate-700);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

@keyframes td-activity-row-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes td-activity-panel-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 991.98px) {
  .td-workspace-chip {
    min-width: 110px;
  }

  .td-agreement-note {
    max-width: none;
  }
}

@media (max-width: 767.98px) {
  .app-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .td-workspace-strip .card-body {
    gap: 1rem;
    padding: 1rem !important;
  }

  .td-workspace-chip {
    width: 100%;
    min-width: 0;
  }

  .td-controlbar {
    padding: 0.9rem;
  }

  .td-controlbar-search,
  .td-controlbar-select,
  .td-controlbar-select-lg,
  .td-admin-users-search,
  .td-admin-users-select,
  .td-admin-users-sort {
    width: 100%;
    min-width: 0;
  }

  .td-activity-summary {
    max-width: none;
  }

  .td-activity-table thead th {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .td-activity-toggle-row > td {
    padding: 0.85rem 0.75rem;
  }

  .td-activity-detail-panel {
    padding: 0.8rem;
  }

  .td-activity-detail-hero .card-body,
  .td-activity-detail-card .card-body,
  .td-activity-detail-section-card .card-body,
  .td-activity-detail-payload-card .card-body {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .td-activity-detail-fact {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .td-activity-detail-summary-grid,
  .td-activity-detail-facts-technical,
  .td-activity-detail-facts-compact,
  .td-activity-detail-pills-grid {
    grid-template-columns: 1fr;
  }

  .td-activity-detail-meta-item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.2rem;
    padding: 0.55rem 0.6rem;
  }

  .td-activity-detail-meta-label,
  .td-activity-detail-meta-value {
    max-width: none;
    flex: 1 1 auto;
    text-align: left;
  }

  .td-activity-raw-payload {
    max-height: 160px;
  }
}
