:root {
  --tc-bg: #020617;
  --tc-bg-2: #050816;
  --tc-surface: rgba(15, 23, 42, 0.84);
  --tc-surface-strong: #111827;
  --tc-border: rgba(148, 163, 184, 0.16);
  --tc-border-strong: rgba(56, 189, 248, 0.26);
  --tc-text: #e5e7eb;
  --tc-muted: #94a3b8;
  --tc-primary: #38bdf8;
  --tc-secondary: #6366f1;
  --tc-success: #22c55e;
  --tc-warning: #f59e0b;
  --tc-danger: #ef4444;
  --tc-shadow: 0 22px 80px rgba(2, 6, 23, 0.34);
}

body {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent 28rem),
    linear-gradient(225deg, rgba(99, 102, 241, 0.10), transparent 32rem),
    var(--tc-bg) !important;
}

.tc-shell {
  color: var(--tc-text);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tc-hero,
.tc-page-header,
.tc-panel,
.tc-reading,
.tc-metric {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.80));
  border: 1px solid var(--tc-border);
  box-shadow: var(--tc-shadow);
  backdrop-filter: blur(18px);
}

.tc-hero {
  border-radius: 18px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.tc-hero:before,
.tc-page-header:before {
  background: linear-gradient(90deg, var(--tc-primary), var(--tc-secondary));
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.tc-hero__content h1,
.tc-page-header h1 {
  color: #f8fafc;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 14px 0 12px;
}

.tc-hero__content p,
.tc-page-header p {
  color: var(--tc-muted);
  font-size: 15px;
  max-width: 640px;
}

.tc-hero__aside {
  align-self: stretch;
  display: grid;
  gap: 12px;
  min-width: 280px;
}

.tc-hero__aside > div:not(.tc-hero__actions) {
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.tc-hero__aside span,
.tc-eyebrow,
.tc-filter-form label span,
.tc-metric__label {
  color: var(--tc-muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tc-hero__aside strong {
  color: #f8fafc;
  display: block;
  font-size: 14px;
  margin-top: 4px;
}

.tc-hero__actions,
.tc-filter-actions {
  display: flex;
  gap: 10px;
}

.tc-button {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tc-button:focus-visible,
.tc-filter-form input:focus,
.tc-filter-form select:focus {
  outline: 2px solid rgba(56, 189, 248, 0.58);
  outline-offset: 2px;
}

.tc-button-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: white;
}

.tc-button-ghost {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--tc-border);
  color: #cbd5e1;
}

.tc-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.tc-status-pill,
.tc-badge,
.tc-event-badge {
  align-items: center;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  color: #bae6fd;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  padding: 6px 10px;
}

.tc-status-pulse {
  background: var(--tc-success);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
  height: 8px;
  width: 8px;
}

.tc-bento,
.tc-kpi-strip {
  display: grid;
  gap: 14px;
}

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

.tc-kpi-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tc-metric {
  border-radius: 14px;
  min-height: 138px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.tc-metric:before {
  background: var(--tc-primary);
  content: "";
  height: 100%;
  left: 0;
  opacity: 0.82;
  position: absolute;
  top: 0;
  width: 3px;
}

.tc-metric:hover {
  border-color: var(--tc-border-strong);
  transform: translateY(-1px);
}

.tc-metric__icon {
  color: var(--tc-primary);
  opacity: 0.92;
}

.tc-metric__icon .material-symbols-outlined {
  font-size: 26px;
}

.tc-metric__value {
  color: #f8fafc;
  font-size: 28px;
  font-weight: 780;
  line-height: 1.1;
  margin-top: 10px;
}

.tc-metric__helper {
  color: var(--tc-muted);
  font-size: 12px;
  margin-top: 8px;
}

.tc-metric__badge {
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  position: absolute;
  right: 12px;
  top: 12px;
}

.tc-accent-green:before,
.tc-accent-emerald:before { background: var(--tc-success); }
.tc-accent-amber:before { background: var(--tc-warning); }
.tc-accent-red:before { background: var(--tc-danger); }
.tc-accent-violet:before,
.tc-accent-indigo:before { background: var(--tc-secondary); }
.tc-accent-cyan:before { background: #22d3ee; }

.tc-grid-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.tc-panel,
.tc-page-header {
  border-radius: 16px;
  padding: 20px;
}

.tc-page-header {
  overflow: hidden;
  position: relative;
}

.tc-section-header,
.tc-table-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tc-section-header h2,
.tc-table-header h2 {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 740;
  margin-top: 4px;
}

.tc-section-header__meta,
.tc-table-header > span {
  color: var(--tc-muted);
  font-size: 12px;
}

.tc-alert-list,
.tc-activity-list {
  display: grid;
  gap: 12px;
}

.tc-alert {
  align-items: flex-start;
  background: rgba(2, 6, 23, 0.24);
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  padding: 13px;
}

.tc-alert strong {
  color: #f8fafc;
  font-size: 13px;
}

.tc-alert p {
  color: var(--tc-muted);
  font-size: 12px;
  margin-top: 2px;
}

.tc-alert-info .material-symbols-outlined { color: var(--tc-primary); }
.tc-alert-success .material-symbols-outlined { color: var(--tc-success); }
.tc-alert-warning .material-symbols-outlined { color: var(--tc-warning); }
.tc-alert-danger .material-symbols-outlined { color: var(--tc-danger); }

.tc-activity-item {
  display: grid;
  gap: 12px;
  grid-template-columns: 16px minmax(0, 1fr);
}

.tc-activity-item__rail {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.tc-dot {
  background: var(--tc-primary);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.10);
  height: 8px;
  width: 8px;
}

.tc-dot-success { background: var(--tc-success); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10); }
.tc-dot-warning { background: var(--tc-warning); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.10); }
.tc-dot-danger { background: var(--tc-danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10); }

.tc-activity-item__body {
  background: rgba(2, 6, 23, 0.22);
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  padding: 12px;
}

.tc-activity-item__top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.tc-event-badge {
  font-size: 10px;
  padding: 3px 7px;
}

.tc-event-info { color: #bae6fd; }
.tc-event-success { border-color: rgba(34, 197, 94, 0.24); color: #bbf7d0; }
.tc-event-warning { border-color: rgba(245, 158, 11, 0.28); color: #fde68a; }
.tc-event-danger { border-color: rgba(239, 68, 68, 0.28); color: #fecaca; }

.tc-activity-item time,
.tc-activity-item__meta {
  color: var(--tc-muted);
  font-size: 11px;
}

.tc-activity-item p {
  color: #dbe4ef;
  font-size: 13px;
  margin: 9px 0 7px;
}

.tc-activity-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tc-activity-item__meta a,
.tc-link {
  color: #7dd3fc;
}

.tc-breadcrumbs {
  color: var(--tc-muted);
  display: flex;
  font-size: 13px;
  gap: 9px;
  padding: 12px 24px 0;
}

.tc-breadcrumbs a,
.tc-breadcrumbs strong {
  color: #cbd5e1;
}

.tc-filter-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.tc-filter-form label {
  display: grid;
  gap: 7px;
}

.tc-filter-form input,
.tc-filter-form select {
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  color: var(--tc-text);
  min-height: 40px;
  padding: 8px 10px;
}

.tc-filter-actions {
  align-items: end;
}

.tc-form-errors {
  color: #fecaca;
  font-size: 12px;
  grid-column: 1 / -1;
}

.tc-reading {
  align-items: center;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 14px 16px;
}

.tc-reading strong {
  color: #f8fafc;
}

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

.tc-table-panel {
  padding: 0;
}

.tc-table-header {
  border-bottom: 1px solid var(--tc-border);
  margin: 0;
  padding: 18px 20px;
}

.tc-table-wrap {
  overflow: auto;
  max-height: 70vh;
}

.tc-data-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1320px;
  width: 100%;
}

.tc-data-table th,
.tc-data-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  color: #cbd5e1;
  font-size: 12px;
  padding: 11px 12px;
  text-align: right;
  white-space: nowrap;
}

.tc-data-table th {
  background: #0f172a;
  color: var(--tc-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 3;
}

.tc-data-table th.is-sorted-asc:after { content: " ↑"; }
.tc-data-table th.is-sorted-desc:after { content: " ↓"; }

.tc-data-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.24);
}

.tc-data-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.tc-data-table tfoot td {
  background: #111827;
  bottom: 0;
  color: #f8fafc;
  font-weight: 800;
  position: sticky;
  z-index: 2;
}

.tc-data-table .tc-left {
  left: 0;
  max-width: 260px;
  min-width: 220px;
  overflow: hidden;
  position: sticky;
  text-align: left;
  text-overflow: ellipsis;
  z-index: 1;
}

.tc-data-table th.tc-left {
  z-index: 4;
}

.tc-data-table tbody .tc-left {
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-weight: 760;
}

.tc-ftd-cell,
.tc-income-cell {
  color: #86efac !important;
  font-weight: 800;
}

.tc-empty {
  align-items: center;
  color: var(--tc-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  text-align: center;
}

.tc-empty .material-symbols-outlined {
  color: var(--tc-primary);
  font-size: 34px;
}

.tc-empty h3 {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 760;
}

.tc-empty p {
  font-size: 13px;
}

.tc-empty code {
  background: rgba(2, 6, 23, 0.50);
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  color: #bae6fd;
  padding: 5px 8px;
}

.tc-pre {
  background: #020617;
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  color: #dbeafe;
  max-height: 520px;
  overflow: auto;
  padding: 16px;
}

.text-green-600,
.dark .dark\:text-green-400 { color: #4ade80 !important; }
.text-red-600,
.text-red-500,
.dark .dark\:text-red-400 { color: #f87171 !important; }
.text-orange-500,
.dark .dark\:text-orange-400 { color: #fbbf24 !important; }
.text-gray-400 { color: var(--tc-muted) !important; }

html:not(.dark) {
  --tc-bg: #f8fafc;
  --tc-bg-2: #eef2ff;
  --tc-surface: rgba(255, 255, 255, 0.92);
  --tc-surface-strong: #ffffff;
  --tc-border: rgba(15, 23, 42, 0.12);
  --tc-border-strong: rgba(14, 165, 233, 0.34);
  --tc-text: #0f172a;
  --tc-muted: #64748b;
  --tc-shadow: 0 18px 60px rgba(15, 23, 42, 0.10);
}

html:not(.dark) body {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.10), transparent 28rem),
    linear-gradient(225deg, rgba(99, 102, 241, 0.09), transparent 32rem),
    var(--tc-bg) !important;
  color: var(--tc-text);
}

html:not(.dark) .tc-hero,
html:not(.dark) .tc-page-header,
html:not(.dark) .tc-panel,
html:not(.dark) .tc-reading,
html:not(.dark) .tc-metric {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.90));
  border-color: var(--tc-border);
  box-shadow: var(--tc-shadow);
}

html:not(.dark) .tc-hero__content h1,
html:not(.dark) .tc-page-header h1,
html:not(.dark) .tc-metric__value,
html:not(.dark) .tc-section-header h2,
html:not(.dark) .tc-table-header h2,
html:not(.dark) .tc-alert strong,
html:not(.dark) .tc-empty h3,
html:not(.dark) .tc-reading strong,
html:not(.dark) .tc-data-table tbody .tc-left {
  color: #0f172a;
}

html:not(.dark) .tc-hero__content p,
html:not(.dark) .tc-page-header p,
html:not(.dark) .tc-hero__aside span,
html:not(.dark) .tc-eyebrow,
html:not(.dark) .tc-filter-form label span,
html:not(.dark) .tc-metric__label,
html:not(.dark) .tc-metric__helper,
html:not(.dark) .tc-alert p,
html:not(.dark) .tc-activity-item time,
html:not(.dark) .tc-activity-item__meta,
html:not(.dark) .tc-table-header > span,
html:not(.dark) .tc-section-header__meta,
html:not(.dark) .tc-reading span,
html:not(.dark) .tc-empty,
html:not(.dark) .tc-breadcrumbs {
  color: var(--tc-muted);
}

html:not(.dark) .tc-hero__aside strong,
html:not(.dark) .tc-activity-item p,
html:not(.dark) .tc-breadcrumbs a,
html:not(.dark) .tc-breadcrumbs strong {
  color: #1e293b;
}

html:not(.dark) .tc-hero__aside > div:not(.tc-hero__actions),
html:not(.dark) .tc-alert,
html:not(.dark) .tc-activity-item__body,
html:not(.dark) .tc-button-ghost,
html:not(.dark) .tc-empty code {
  background: rgba(248, 250, 252, 0.86);
  border-color: var(--tc-border);
}

html:not(.dark) .tc-button-ghost {
  color: #334155;
}

html:not(.dark) .tc-status-pill,
html:not(.dark) .tc-badge,
html:not(.dark) .tc-event-badge {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.22);
  color: #0369a1;
}

html:not(.dark) .tc-event-success {
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(34, 197, 94, 0.22);
  color: #15803d;
}

html:not(.dark) .tc-event-warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.24);
  color: #92400e;
}

html:not(.dark) .tc-event-danger {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.24);
  color: #b91c1c;
}

html:not(.dark) .tc-filter-form input,
html:not(.dark) .tc-filter-form select {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html:not(.dark) .tc-filter-form input::placeholder {
  color: #94a3b8;
}

html:not(.dark) .tc-data-table th {
  background: #eef2f7;
  color: #475569;
}

html:not(.dark) .tc-data-table th,
html:not(.dark) .tc-data-table td {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  color: #334155;
}

html:not(.dark) .tc-data-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.82);
}

html:not(.dark) .tc-data-table tbody tr:hover td {
  background: rgba(14, 165, 233, 0.08);
}

html:not(.dark) .tc-data-table tbody .tc-left {
  background: rgba(255, 255, 255, 0.96);
}

html:not(.dark) .tc-data-table tfoot td {
  background: #f1f5f9;
  color: #0f172a;
}

html:not(.dark) .tc-ftd-cell,
html:not(.dark) .tc-income-cell {
  color: #15803d !important;
}

html:not(.dark) .tc-pre {
  background: #f8fafc;
  color: #0f172a;
}

html:not(.dark) .text-green-600,
html:not(.dark) .dark .dark\:text-green-400 {
  color: #15803d !important;
}

html:not(.dark) .text-red-600,
html:not(.dark) .text-red-500,
html:not(.dark) .dark .dark\:text-red-400 {
  color: #dc2626 !important;
}

html:not(.dark) .text-orange-500,
html:not(.dark) .dark .dark\:text-orange-400 {
  color: #d97706 !important;
}

@media (max-width: 1280px) {
  .tc-bento,
  .tc-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-filter-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .tc-hero,
  .tc-grid-2 {
    grid-template-columns: 1fr;
  }

  .tc-hero__aside {
    min-width: 0;
  }

  .tc-filter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tc-bento,
  .tc-kpi-strip {
    grid-template-columns: 1fr;
  }

  .tc-hero,
  .tc-panel,
  .tc-page-header {
    border-radius: 12px;
    padding: 16px;
  }
}
