:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --sidebar: #020617;
  --brand-50: #f5f3ff;
  --brand-100: #ede9fe;
  --brand-200: #ddd6fe;
  --brand-400: #a78bfa;
  --brand-500: #8b5cf6;
  --brand-600: #7c3aed;
  --brand-700: #6d28d9;
  --sky-50: #f0f9ff;
  --sky-600: #0284c7;
  --amber-50: #fffbeb;
  --amber-600: #d97706;
  --emerald-50: #ecfdf5;
  --emerald-600: #059669;
  --rose-50: #fff1f2;
  --rose-600: #e11d48;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-brand: 0 12px 28px rgba(124, 58, 237, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

code {
  border-radius: 8px;
  background: #eef2ff;
  padding: 2px 6px;
  color: #4338ca;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 288px;
  height: 100vh;
  background: var(--sidebar);
  color: #cbd5e1;
}

.brand,
.legal-brand,
.callback-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar .brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-500), #4f46e5);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.3);
}

.brand-title {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 20px 12px;
}

.nav-label {
  margin: 0;
  padding: 0 12px 8px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.3), rgba(79, 70, 229, 0.1));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 2px solid currentColor;
  color: #64748b;
}

.nav-item.active .nav-icon {
  color: var(--brand-400);
}

.sidebar-footer {
  position: absolute;
  inset: auto 0 0;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
}

.session-copy {
  min-width: 0;
}

.session-copy strong,
.session-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-copy strong {
  color: #ffffff;
  font-size: 14px;
}

.session-copy span,
.sidebar-footer p {
  color: #64748b;
  font-size: 12px;
}

.sidebar-footer p {
  margin: 12px 0 0;
  text-align: center;
  font-size: 10px;
}

.content-shell {
  min-height: 100vh;
  margin-left: 288px;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.84);
  padding: 0 32px;
  backdrop-filter: blur(14px);
}

.topbar h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: #94a3b8;
  padding: 0 12px;
}

.topbar-search input {
  width: 220px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.main-area {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 32px 40px;
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding: 20px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-header h1,
.page-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
}

.page-header p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.topbar-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mt {
  margin-top: 20px;
}

.full {
  grid-column: 1 / -1;
}

.card {
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.card.pad,
.pad {
  padding: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.section-title span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.stat-card {
  padding: 20px;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.stat-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.mini-stat {
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 14px;
}

.mini-stat strong,
.mini-stat span {
  display: block;
}

.mini-stat strong {
  font-size: 24px;
}

.mini-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.wide {
  width: 100%;
}

.primary-button {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.primary-button:hover {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
}

.secondary-button {
  background: #ffffff;
  color: #334155;
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--panel-soft);
}

.ghost-button {
  background: transparent;
  color: #475569;
}

.avatar {
  width: 34px;
  height: 34px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand-600);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.session-avatar {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.08);
}

.client-card {
  padding: 18px;
  display: grid;
  gap: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-card:hover {
  border-color: var(--brand-200);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.client-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.client-card h3,
.client-card p {
  margin: 0;
}

.hero-client {
  min-height: 180px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: #0f172a;
  color: #ffffff;
}

.hero-client h2,
.hero-client p {
  margin: 0;
}

.hero-client p {
  margin-top: 6px;
  color: #cbd5e1;
}

.hero-logo {
  width: 72px;
  height: 72px;
  background: var(--client-brand);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.badge.draft {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.badge.scheduled,
.badge.pending {
  background: var(--amber-50);
  color: var(--amber-600);
  border-color: #fde68a;
}

.badge.publishing {
  background: var(--sky-50);
  color: var(--sky-600);
  border-color: #bae6fd;
}

.badge.published,
.badge.connected,
.badge.active {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border-color: #bbf7d0;
}

.badge.failed,
.badge.error,
.badge.disconnected {
  background: var(--rose-50);
  color: var(--rose-600);
  border-color: #fecdd3;
}

.badge.paused,
.badge.invite-pending {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.field label {
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  outline: 0;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.two-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-box {
  min-height: 170px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.72);
  text-align: center;
}

.upload-box:hover {
  border-color: var(--brand-400);
  background: rgba(245, 243, 255, 0.55);
}

.upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #ffffff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.upload-box strong {
  color: var(--ink);
}

.upload-box span {
  color: var(--muted);
  font-size: 12px;
}

.upload-box input {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.check-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px;
  font-weight: 800;
}

.check-card:has(input:checked) {
  border-color: var(--brand-400);
  background: rgba(245, 243, 255, 0.65);
}

.check-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-600);
}

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td {
  color: #334155;
  font-size: 14px;
}

.data-table td.wrap {
  min-width: 260px;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.table-wrap {
  overflow-x: auto;
}

.strong-link {
  color: var(--ink);
  font-weight: 800;
}

.detail-list {
  display: grid;
  gap: 0;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.detail-item:last-child {
  border-bottom: 0;
}

.detail-item span {
  color: var(--muted);
  font-size: 13px;
}

.detail-item strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.channel-grid div,
.debug-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 14px;
}

.channel-grid strong,
.channel-grid span,
.debug-card strong,
.debug-card span {
  display: block;
}

.channel-grid strong,
.debug-card strong {
  color: var(--ink);
}

.channel-grid span,
.debug-card span {
  margin-top: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.debug-card + .debug-card {
  margin-top: 12px;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  padding: 32px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.alert {
  border-radius: 14px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #bbf7d0;
  background: var(--emerald-50);
  color: #047857;
  font-weight: 700;
}

.alert.error {
  border-color: #fecdd3;
  background: var(--rose-50);
  color: var(--rose-600);
}

.alert.warning {
  border-color: #fde68a;
  background: var(--amber-50);
  color: var(--amber-600);
}

.callback-code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 12px;
  background: var(--sidebar);
  color: #e2e8f0;
  padding: 14px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.preline {
  white-space: pre-line;
  line-height: 1.7;
}

.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.login-art {
  width: 46%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  overflow: hidden;
  background: var(--sidebar);
  color: #ffffff;
  padding: 48px;
}

.login-art-copy {
  max-width: 440px;
}

.login-art-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: 42px;
  line-height: 1.12;
  font-weight: 900;
}

.login-art-copy ul {
  display: grid;
  gap: 14px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: #cbd5e1;
}

.login-panel {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.login-card {
  width: min(448px, 100%);
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
}

.login-card form {
  margin-top: 30px;
}

.mobile-login-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.mobile-login-brand strong,
.mobile-login-brand small {
  display: block;
}

.mobile-login-brand strong {
  color: var(--ink);
}

.mobile-login-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-submit {
  width: 100%;
  min-height: 48px;
}

.legal-page,
.callback-page,
.setup-page {
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 26px;
  padding: 40px 20px;
}

.legal-brand .brand-title,
.callback-brand .brand-title {
  color: var(--ink);
}

.legal-card,
.setup-card,
.callback-card {
  width: min(960px, 100%);
}

.legal-card h1,
.setup-card h1 {
  margin-top: 0;
}

.legal-card p,
.setup-card p {
  color: #475569;
  line-height: 1.7;
}

.callback-card {
  overflow: hidden;
}

.callback-hero {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 34px 20px;
  text-align: center;
}

.callback-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--rose-50);
  color: var(--rose-600);
  font-size: 28px;
  font-weight: 900;
}

.callback-hero.success .callback-icon {
  background: var(--emerald-50);
  color: var(--emerald-600);
}

.callback-hero h1,
.callback-hero p {
  margin: 0;
}

.callback-hero p {
  color: var(--muted);
}

.callback-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.callback-stats div {
  padding: 22px;
  border-right: 1px solid var(--line-soft);
}

.callback-stats div:last-child {
  border-right: 0;
}

.callback-stats span,
.callback-stats strong {
  display: block;
}

.callback-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.callback-stats strong {
  margin-top: 8px;
  font-size: 28px;
}

@media (max-width: 1180px) {
  .grid.four,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    width: 100%;
    height: auto;
  }

  .sidebar .brand {
    padding: 16px;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 16px 16px;
  }

  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .content-shell {
    margin-left: 0;
  }

  .topbar {
    padding: 0 20px;
  }

  .main-area {
    padding: 24px 20px;
  }

  .login-page {
    display: block;
  }

  .login-art {
    display: none;
  }

  .mobile-login-brand {
    display: flex;
  }

  .login-panel {
    min-height: 100vh;
    padding: 32px 22px;
  }
}

@media (max-width: 760px) {
  .grid.four,
  .grid.three,
  .grid.two,
  .form-grid.two,
  .channel-grid,
  .callback-stats {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header h1,
  .page-header h2 {
    font-size: 24px;
  }

  .topbar-search,
  .topbar-new-post {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .main-area {
    padding: 22px 16px;
  }

  .detail-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .detail-item strong {
    text-align: left;
  }
}

/* Visual parity pass for the original TDO dashboard shell. */
.content-shell {
  margin-left: 288px;
}

.topbar {
  min-height: 78px;
}

.main-area {
  max-width: 1340px;
  padding-top: 40px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-500), #4f46e5);
  box-shadow: 0 18px 34px rgba(124, 58, 237, 0.34);
}

.brand-mark svg,
.nav-icon svg,
.topbar-icon svg,
.notification-button svg,
.primary-button svg,
.secondary-button svg,
.stat-icon svg {
  width: 1em;
  height: 1em;
  display: block;
  overflow: visible;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-mark svg path,
.nav-icon svg path,
.nav-icon svg rect,
.nav-icon svg circle,
.topbar-icon svg path,
.topbar-icon svg circle,
.notification-button svg path,
.primary-button svg path,
.secondary-button svg path,
.secondary-button svg rect,
.secondary-button svg circle,
.stat-icon svg path,
.stat-icon svg rect,
.stat-icon svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar .brand {
  padding: 34px 30px 28px;
}

.brand-title {
  font-size: 17px;
}

.brand-subtitle {
  margin-top: 5px;
  font-size: 13px;
  color: #64748b;
}

.nav-list {
  padding: 28px 15px;
  gap: 7px;
}

.nav-label {
  padding: 0 15px 8px;
  color: #475569;
  font-size: 14px;
}

.nav-item {
  min-height: 52px;
  gap: 14px;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  color: #64748b;
  display: grid;
  place-items: center;
}

.nav-item.active .nav-icon {
  color: var(--brand-400);
}

.nav-text {
  flex: 1;
}

.nav-count {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--brand-300);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}

.sidebar-footer {
  padding: 20px;
}

.session-card {
  border-radius: 14px;
  padding: 14px;
}

.topbar {
  padding: 0 40px;
}

.topbar h2 {
  font-size: 18px;
}

.topbar-search {
  min-height: 50px;
  border-radius: 16px;
  padding: 0 16px;
}

.topbar-icon {
  color: #94a3b8;
  font-size: 18px;
}

.topbar-search input {
  width: 260px;
  font-size: 16px;
}

.notification-button {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--muted);
  font-size: 18px;
  box-shadow: var(--shadow-card);
}

.notification-button:hover {
  background: var(--panel-soft);
}

.notification-button span {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rose-600);
  box-shadow: 0 0 0 2px #ffffff;
}

.topbar-new-post {
  min-height: 50px;
  padding-inline: 22px;
  border-radius: 14px;
  font-size: 16px;
}

.page-header {
  margin-bottom: 34px;
}

.page-header h1,
.page-header h2 {
  font-size: 36px;
}

.page-header p {
  font-size: 17px;
}

.card {
  border-radius: 20px;
}

.card.pad,
.pad {
  padding: 24px;
}

.grid {
  gap: 20px;
}

.mt {
  margin-top: 24px;
}

.stat-card {
  min-height: 180px;
  padding: 26px;
}

.stat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 21px;
}

.stat-icon-sky {
  background: var(--sky-50);
  color: var(--sky-600);
}

.stat-icon-emerald {
  background: var(--emerald-50);
  color: var(--emerald-600);
}

.stat-icon-amber {
  background: var(--amber-50);
  color: var(--amber-600);
}

.stat-label {
  font-size: 16px;
}

.stat-value {
  margin-top: 22px;
  font-size: 42px;
}

.stat-note {
  font-size: 15px;
}

.primary-button,
.secondary-button,
.ghost-button {
  gap: 10px;
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 980px) {
  .content-shell {
    margin-left: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .nav-item {
    font-size: 14px;
    min-height: 42px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .notification-button {
    width: 42px;
    height: 42px;
  }

  .page-header h1,
  .page-header h2 {
    font-size: 28px;
  }

  .page-header p {
    font-size: 14px;
  }

  .stat-card {
    min-height: 0;
  }
}

/* Professional density pass: lighter type, less bulk, same TDO colors. */
body {
  color: #101828;
}

.sidebar {
  width: 270px;
}

.content-shell {
  margin-left: 270px;
}

.sidebar .brand {
  padding: 28px 26px 22px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.nav-list {
  padding: 24px 14px;
  gap: 4px;
}

.nav-label {
  padding: 0 14px 8px;
  font-size: 12px;
  font-weight: 700;
}

.nav-item {
  min-height: 46px;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 650;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.session-card {
  padding: 12px;
}

.session-copy strong {
  font-weight: 650;
}

.topbar {
  min-height: 72px;
  padding: 0 40px;
}

.topbar h2 {
  font-size: 17px;
  font-weight: 650;
}

.topbar-search {
  min-height: 46px;
  border-radius: 15px;
}

.topbar-search input {
  width: 252px;
  font-size: 15px;
}

.notification-button {
  width: 46px;
  height: 46px;
  border-radius: 15px;
}

.topbar-new-post {
  min-height: 46px;
  padding-inline: 20px;
  font-size: 15px;
  font-weight: 700;
}

.avatar {
  width: 38px;
  height: 38px;
  font-weight: 750;
}

.main-area {
  max-width: 1320px;
  padding: 36px 40px;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1,
.page-header h2 {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: 0;
}

.page-header p {
  max-width: 700px;
  font-size: 16px;
  line-height: 1.55;
}

.card {
  border-radius: 18px;
}

.card.pad,
.pad {
  padding: 22px;
}

.grid {
  gap: 18px;
}

.stat-card {
  min-height: 158px;
  padding: 24px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 19px;
}

.stat-label {
  font-size: 15px;
  font-weight: 650;
}

.stat-value {
  margin-top: 22px;
  font-size: 36px;
  font-weight: 760;
}

.stat-note {
  font-size: 14px;
  font-weight: 600;
}

.section-title h3 {
  font-size: 18px;
  font-weight: 700;
}

.section-title span,
.muted {
  font-size: 14px;
}

.mini-stat {
  border-radius: 14px;
  padding: 14px 16px;
}

.mini-stat strong {
  font-size: 26px;
  font-weight: 720;
}

.mini-stat span {
  font-weight: 600;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 13px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 700;
}

.primary-button {
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.22);
}

.data-table th {
  font-weight: 700;
}

.data-table td,
.detail-item strong,
.detail-item span {
  font-size: 14px;
}

.nav-count.danger {
  background: rgba(225, 29, 72, 0.16);
  color: #fb7185;
}

.failure-grid {
  display: grid;
  gap: 14px;
}

.failure-grid.compact {
  gap: 12px;
}

.failure-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.failure-card.compact {
  background: var(--panel-soft);
}

.failure-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.failure-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.failure-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.failure-context div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.failure-context span,
.failure-reason span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.failure-context strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.failure-reason {
  margin-top: 12px;
}

.failure-reason pre {
  margin: 7px 0 0;
  border-radius: 12px;
  background: #020617;
  color: #e2e8f0;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.failure-results {
  margin-top: 12px;
}

.failure-hint {
  margin: 10px 0 0;
  font-weight: 600;
}

@media (max-width: 980px) {
  .content-shell {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .main-area {
    padding: 24px 16px;
  }

  .page-header h1,
  .page-header h2 {
    font-size: 26px;
  }

  .stat-value {
    font-size: 32px;
  }

  .failure-context {
    grid-template-columns: 1fr;
  }
}

/* Final typography polish: keep the TDO look, remove unnecessary heavy bold. */
body {
  font-weight: 400;
}

strong,
.strong-link,
.brand-title,
.session-copy strong,
.client-card h3,
.client-card-top h2,
.section-title h3,
.channel-grid strong,
.debug-card strong,
.detail-item strong,
.upload-box strong,
.failure-card-head strong,
.failure-context strong {
  font-weight: 600;
}

.topbar h2,
.nav-item,
.primary-button,
.secondary-button,
.ghost-button,
.badge,
.field span,
.field label,
.data-table th,
.stat-label,
.stat-note,
.mini-stat span,
.callback-stats span,
.alert {
  font-weight: 500;
}

.page-header h1,
.page-header h2 {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 600;
}

.page-header p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.topbar {
  min-height: 68px;
}

.topbar h2 {
  font-size: 16px;
}

.topbar-search,
.notification-button,
.topbar-new-post {
  min-height: 44px;
}

.topbar-new-post,
.primary-button,
.secondary-button,
.ghost-button {
  font-size: 14px;
}

.brand-title {
  font-size: 15px;
}

.brand-subtitle {
  font-weight: 500;
}

.nav-item {
  min-height: 44px;
  font-size: 15px;
}

.nav-item.active {
  font-weight: 600;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
}

.main-area {
  padding-top: 34px;
}

.card {
  border-radius: 16px;
}

.card.pad,
.pad {
  padding: 22px;
}

.stat-card {
  min-height: 146px;
  padding: 22px;
}

.stat-value,
.mini-stat strong,
.callback-stats strong {
  font-weight: 600;
}

.stat-value {
  margin-top: 18px;
  font-size: 34px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.client-card-top h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.client-card h3 {
  font-size: 17px;
  line-height: 1.3;
}

.section-title h3 {
  font-size: 16px;
}

.channel-grid div,
.debug-card,
.mini-stat {
  border-radius: 12px;
}

.channel-grid strong,
.debug-card strong {
  font-size: 15px;
}

.channel-grid span,
.debug-card span,
.detail-item span,
.detail-item strong,
.data-table td,
.muted {
  font-size: 13px;
}

.check-list {
  gap: 10px;
  color: #344054;
  font-size: 15px;
  line-height: 1.55;
}

.badge {
  min-height: 24px;
  padding: 4px 9px;
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  min-height: 48px;
  font-size: 15px;
}

.hero-client h2 {
  font-size: 24px;
  font-weight: 600;
}

.hero-client p {
  font-size: 14px;
}

/* Compact SaaS refinement: tighter client pages, calmer weight, less visual bulk. */
:root {
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.035);
  --shadow-brand: 0 10px 22px rgba(124, 58, 237, 0.2);
}

body {
  background: #f7f9fc;
}

.sidebar {
  width: 260px;
}

.content-shell {
  margin-left: 260px;
}

.sidebar .brand {
  padding: 24px 24px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
}

.nav-list {
  padding: 22px 14px;
}

.nav-item {
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

.nav-item.active {
  font-weight: 600;
}

.topbar {
  min-height: 64px;
  padding: 0 32px;
}

.topbar h2 {
  font-size: 15px;
  font-weight: 600;
}

.topbar-search {
  min-height: 42px;
  border-radius: 14px;
}

.topbar-search input {
  width: 240px;
  font-size: 14px;
}

.notification-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.topbar-new-post {
  min-height: 42px;
  padding-inline: 18px;
  font-size: 14px;
}

.avatar {
  width: 34px;
  height: 34px;
}

.main-area {
  max-width: 1220px;
  padding: 28px 32px;
}

.page-header {
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-header h1,
.page-header h2 {
  font-size: 28px;
  line-height: 1.22;
  font-weight: 550;
}

.page-header p {
  margin-top: 8px;
  font-size: 14px;
}

.grid {
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
}

.mt {
  margin-top: 18px;
}

.card {
  border-radius: 14px;
  border-color: #dfe7f1;
}

.card.pad,
.pad {
  padding: 18px;
}

.hero-client {
  min-height: 132px;
  padding: 22px 24px;
  gap: 16px;
  border-radius: 14px;
  background: #111827;
}

.hero-logo {
  width: 58px;
  height: 58px;
  font-size: 18px;
}

.hero-client h2 {
  font-size: 21px;
  font-weight: 600;
}

.hero-client p {
  margin-top: 5px;
  font-size: 13px;
}

.hero-client .badge {
  margin-left: auto;
}

.section-title {
  margin-bottom: 12px;
}

.section-title h3 {
  font-size: 15px;
  font-weight: 600;
}

.section-title span,
.muted {
  font-size: 13px;
}

.channel-grid {
  gap: 10px;
}

.channel-grid div,
.debug-card {
  border-radius: 12px;
  padding: 13px 14px;
}

.channel-grid strong,
.debug-card strong {
  font-size: 14px;
  font-weight: 600;
}

.channel-grid span,
.debug-card span {
  font-size: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
}

.stat-card {
  min-height: 116px;
  padding: 18px 20px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  margin-top: 16px;
  font-size: 30px;
  font-weight: 550;
}

.stat-note {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 17px;
}

.client-logo {
  width: 38px;
  height: 38px;
  font-weight: 600;
}

.client-card-top h2 {
  font-size: 20px;
  font-weight: 600;
}

.client-card h3 {
  font-size: 15px;
  font-weight: 600;
}

.badge {
  min-height: 23px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
}

.data-table td {
  font-size: 13px;
}

.empty-state {
  padding: 24px 18px;
  border-radius: 14px;
}

.field span,
.field label {
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
}

@media (max-width: 980px) {
  .content-shell {
    margin-left: 0;
  }

  .sidebar {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .main-area {
    padding: 22px 16px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .page-header h1,
  .page-header h2 {
    font-size: 24px;
  }

  .hero-client {
    min-height: 0;
    padding: 18px;
  }
}

/* Meta setup page alignment */
.meta-page-header {
  margin-bottom: 24px;
}

.meta-setup-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(420px, 1fr);
  align-items: start;
  gap: 18px;
}

.meta-connect-card,
.meta-check-card {
  padding: 22px 24px;
}

.meta-client-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.meta-client-head .client-logo {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

.meta-client-copy h2,
.meta-client-copy p {
  margin: 0;
}

.meta-client-copy h2 {
  font-size: 21px;
  line-height: 1.25;
  font-weight: 600;
}

.meta-client-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.meta-channel-grid {
  margin-top: 22px;
}

.meta-connect-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.meta-connect-actions .primary-button {
  min-height: 42px;
}

.meta-connect-actions p {
  max-width: 620px;
  margin: 0;
  line-height: 1.45;
}

.meta-reset-form {
  margin-top: 14px;
}

.meta-id-form {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}

.meta-id-form .section-title {
  margin-bottom: 12px;
}

.meta-id-form .secondary-button {
  margin-top: 12px;
}

.meta-check-title {
  align-items: baseline;
  margin-bottom: 18px;
}

.meta-check-list {
  display: grid;
  gap: 13px;
}

.meta-check-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.meta-check-item > span {
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: #475569;
}

.meta-check-item p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
}

.meta-check-item code {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
  overflow-wrap: anywhere;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 12px;
}

.meta-check-card .alert {
  margin: 18px 0 0;
}

@media (max-width: 1100px) {
  .meta-setup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .meta-connect-card,
  .meta-check-card {
    padding: 18px;
  }

  .meta-client-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .meta-client-head .badge {
    grid-column: 2;
    justify-self: start;
  }
}

/* Meta asset picker */
.asset-picker-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.asset-picker-summary div {
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
}

.asset-picker-summary div:last-child {
  border-right: 0;
}

.asset-picker-summary span,
.asset-picker-summary strong {
  display: block;
}

.asset-picker-summary span {
  color: var(--muted);
  font-size: 12px;
}

.asset-picker-summary strong {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
}

.asset-grid {
  display: grid;
  gap: 12px;
}

.asset-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
}

.asset-card.ready {
  border-color: #bbf7d0;
}

.asset-card.blocked {
  background: #f8fafc;
}

.asset-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.asset-card h3,
.asset-card p {
  margin: 0;
}

.asset-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.asset-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.asset-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.asset-fields div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.asset-fields span,
.asset-fields strong {
  display: block;
  overflow-wrap: anywhere;
}

.asset-fields span {
  color: var(--muted);
  font-size: 11px;
}

.asset-fields strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.asset-action {
  margin-top: 14px;
}

.scan-info-card .alert {
  margin: 0;
}

.detail-list.compact {
  gap: 8px;
}

.detail-list.compact .detail-item {
  padding: 10px 0;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.permission-grid div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px 10px;
}

.permission-grid span,
.permission-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.permission-grid span {
  color: var(--muted);
  font-size: 11px;
}

.permission-grid strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 980px) {
  .asset-fields,
  .asset-picker-summary,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .asset-picker-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .asset-picker-summary div:last-child {
    border-bottom: 0;
  }
}
