﻿/* Theme tokens live in theme.css (dark default, light via html[data-theme="light"]). */

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--tf-bg);
  color: var(--tf-text);
  min-height: 100vh;
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body.tf-app {
  display: block;
  background:
    radial-gradient(1200px 520px at 8% -12%, var(--tf-glow-a), transparent 52%),
    radial-gradient(900px 480px at 112% 10%, var(--tf-glow-b), transparent 48%),
    var(--tf-canvas);
}

body.page-auth {
  background: #0f172a;
  min-height: 100vh;
}

body.page-auth .tf-main {
  padding: 0;
  max-width: none;
  margin: 0;
}

body.page-kanban {
  background:
    radial-gradient(1000px 480px at 12% -10%, var(--tf-glow-a), transparent 52%),
    radial-gradient(800px 420px at 110% 8%, var(--tf-glow-b), transparent 48%),
    var(--tf-canvas);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.page-kanban .tf-shell {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.page-kanban .tf-topbar {
  flex-shrink: 0;
  padding: 0.4rem 1rem;
}

body.page-kanban .tf-topbar-heading,
body.page-kanban .tf-topbar-code {
  display: none;
}

body.page-kanban .tf-main.container-fluid-wide {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.55rem 0.75rem 0.45rem;
}

/* Kanban page */
.kanban-page {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.kanban-chrome {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.5rem 0.65rem;
  background: var(--tf-panel-solid);
  backdrop-filter: blur(12px);
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  box-shadow: var(--tf-shadow-sm);
}

.kanban-chrome-primary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.kanban-back {
  position: relative;
  margin: 0;
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--tf-line);
  background: var(--tf-fill-2);
  white-space: nowrap;
}

.kanban-back:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.kanban-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.kanban-identity-copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.kanban-identity-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.kanban-identity-title .tf-role-badge {
  flex-shrink: 0;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
}

.kanban-project-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.22);
}

.kanban-project-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tf-ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-hero-subtitle {
  margin: 0.05rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--tf-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-hero-subtitle.has-board-desc {
  white-space: nowrap;
}

.kanban-chrome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.kanban-chrome-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 9px;
}

.kanban-chrome-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--tf-line);
}

.kanban-viewer-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 10px;
  color: var(--tf-info-ink);
  font-size: 0.8rem;
  line-height: 1.4;
}

.kanban-viewer-banner i {
  font-size: 1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.kanban-view-tabs {
  display: inline-flex;
  padding: 0.28rem;
  background: var(--tf-fill-2);
  border-radius: 12px;
  border: 1px solid var(--tf-line);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.kanban-view-tabs .btn {
  border: none !important;
  border-radius: 8px !important;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--tf-ink-soft);
  background: transparent;
}

.kanban-view-tabs .btn.active {
  background: var(--tf-panel-solid);
  color: var(--tf-hud-accent);
  font-weight: 600;
  box-shadow: var(--tf-shadow-sm);
}

.kanban-search-wrap {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 280px;
}

.kanban-search-wrap i {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-text-muted);
  pointer-events: none;
}

.kanban-search-wrap input {
  padding-inline-start: 2.15rem;
  border-radius: 10px;
  border-color: var(--tf-input-line);
  background: var(--tf-input);
  color: var(--tf-ink);
}

.kanban-search-wrap input:focus {
  background: var(--tf-input);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  color: var(--tf-ink);
}

.kanban-search-wrap input::placeholder {
  color: var(--tf-ink-soft);
}

.kanban-filter-select {
  width: auto;
  min-width: 118px;
  max-width: 156px;
  border-radius: 10px;
  border-color: var(--tf-input-line);
  background: var(--tf-input);
  color: var(--tf-ink);
}

.kanban-filter-overdue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-radius: 10px;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  color: var(--tf-ink);
  transition: background 0.15s, border-color 0.15s;
}

.kanban-filter-overdue:hover {
  background: var(--tf-fill-hover);
  border-color: rgba(99, 102, 241, 0.25);
}

.kanban-filter-overdue:has(input:checked) {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
}

.kanban-clear-filters {
  border-radius: 10px;
}

.kanban-filter-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tf-ink-soft);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
}

.kanban-filter-count:empty {
  display: none;
}

.kanban-filter-count.is-empty {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
}

@media (min-width: 992px) {
  .kanban-filter-count {
    margin-inline-start: auto;
  }
}

/* Bootstrap overrides */
.btn-primary {
  --bs-btn-bg: var(--tf-primary);
  --bs-btn-border-color: var(--tf-primary);
  --bs-btn-hover-bg: var(--tf-primary-dark);
  --bs-btn-hover-border-color: var(--tf-primary-dark);
  --bs-btn-active-bg: var(--tf-primary-dark);
  font-weight: 500;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
}

.btn-outline-primary {
  --bs-btn-color: var(--tf-primary);
  --bs-btn-border-color: var(--tf-primary);
  --bs-btn-hover-bg: var(--tf-primary);
  --bs-btn-hover-border-color: var(--tf-primary);
  border-radius: 10px;
  font-weight: 500;
}

.btn-tf-ghost {
  background: transparent;
  border: 1px solid var(--tf-border);
  color: var(--tf-text-muted);
  border-radius: 10px;
  font-weight: 500;
}

.btn-tf-ghost:hover {
  background: var(--tf-bg);
  color: var(--tf-text);
  border-color: var(--tf-border);
}

.dropdown-menu,
.tf-dropdown {
  --bs-dropdown-bg: var(--tf-bg-elevated);
  --bs-dropdown-color: var(--tf-ink);
  --bs-dropdown-border-color: var(--tf-line);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-link-color: var(--tf-ink);
  --bs-dropdown-link-hover-color: var(--tf-ink-strong);
  --bs-dropdown-link-hover-bg: var(--tf-fill-hover);
  --bs-dropdown-link-active-color: var(--tf-ink-strong);
  --bs-dropdown-link-active-bg: var(--tf-fill-hover);
  --bs-dropdown-divider-bg: var(--tf-line);
  --bs-dropdown-spacer: 0.35rem;
  padding: 0.35rem;
  background: var(--tf-bg-elevated);
  color: var(--tf-ink);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
  box-shadow: var(--tf-shadow-lg);
}

.dropdown-item {
  border-radius: 8px;
  color: var(--tf-ink);
  font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

.dropdown-item.text-danger,
.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
  color: var(--tf-danger) !important;
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
  background: rgba(239, 68, 68, 0.12);
}

.dropdown-divider {
  border-top-color: var(--tf-line);
  opacity: 1;
  margin: 0.3rem 0.35rem;
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--tf-border);
  padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--tf-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Brand */
.tf-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.tf-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.tf-logo-for-dark,
.auth-brand-logo .tf-logo-for-dark,
.auth-mobile-logo .tf-logo-for-dark {
  display: none;
}

html:not([data-theme="light"]) .tf-logo-for-light {
  display: none;
}

html:not([data-theme="light"]) .tf-logo-for-dark,
html:not([data-theme="light"]) .auth-mobile-logo .tf-logo-for-dark,
html:not([data-theme="light"]) .tf-brand .tf-logo-for-dark {
  display: block;
}

.tf-logo-on-dark .tf-logo-for-light {
  display: none;
}

.tf-logo-on-dark .tf-logo-for-dark {
  display: block;
}

.tf-brand-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.tf-tenant-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: var(--tf-gradient-subtle);
  border: 1px solid var(--tf-input-line);
  border-radius: 999px;
  color: var(--tf-hud-accent);
}

/* App shell + sidebar */
.tf-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 240px;
  background: var(--tf-bg-elevated);
  border-inline-end: 1px solid var(--tf-line);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.2s ease;
  overflow: hidden;
  color: var(--tf-ink);
}

html:not([data-theme="light"]) .tf-sidebar {
  background: #10141f;
}

.tf-sidebar-top,
.tf-sidebar-nav,
.tf-sidebar-footer {
  position: relative;
  z-index: 1;
}

.tf-sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 0.85rem 0.35rem;
}

.tf-sidebar-brandline {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tf-sidebar-workspace {
  display: block;
  max-width: 100%;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--tf-fill-hover);
  color: var(--tf-hud-accent);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.55rem 0.65rem 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tf-sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (max-height: 820px) {
  .tf-sidebar-top { padding: 0.7rem 0.75rem 0.2rem; }
  .tf-sidebar-nav { gap: 0.55rem; padding: 0.35rem 0.55rem 0.5rem; }
  .tf-nav-label { padding-bottom: 0.2rem; }
  .tf-side-link { padding: 0.38rem 0.55rem; }
  .tf-sidebar-footer { padding: 0.45rem 0.55rem 0.65rem; gap: 0.35rem; }
}

.tf-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tf-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tf-ink-soft);
  padding: 0.35rem 0.6rem 0.25rem;
}

.tf-side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.48rem 0.6rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--tf-ink);
  text-decoration: none;
  text-align: start;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.tf-side-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-ink-soft);
  flex-shrink: 0;
  font-size: 1.02rem;
}

.tf-side-link:hover {
  color: var(--tf-ink-strong);
  background: var(--tf-fill-hover);
}

.tf-side-link:hover .tf-side-icon,
.tf-side-link.active .tf-side-icon {
  color: var(--tf-hud-accent);
}

.tf-side-link.active {
  color: var(--tf-ink-strong);
  background: var(--tf-fill-hover);
  font-weight: 600;
}

.tf-side-link.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 99px;
  background: var(--tf-primary-light);
}

.tf-sidebar-footer {
  padding: 0.55rem 0.65rem 0.75rem;
  border-top: 1px solid var(--tf-line);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.tf-app-version {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tf-ink-soft);
  line-height: 1.2;
}

.tf-sidebar-tools {
  display: flex;
  gap: 0.35rem;
}

.tf-side-tool {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--tf-line);
  background: transparent;
  color: var(--tf-ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.tf-side-tool:hover {
  color: var(--tf-ink-strong);
  background: var(--tf-fill-hover);
}

.tf-sidebar-account {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tf-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.3rem 0.35rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
}

.tf-sidebar-user-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.tf-sidebar-user-link:hover,
.tf-sidebar-user-link.active {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

.tf-topbar-user-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.tf-topbar-user-link:hover {
  background: rgba(129, 140, 248, 0.12);
  color: inherit;
}

.tf-profile-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tf-profile-hero .tf-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.auth-password-field {
  position: relative;
}

.auth-password-field .form-control {
  padding-inline-end: 2.5rem;
}

.auth-password-field .auth-password-toggle {
  position: absolute;
  inset-inline-end: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.tf-sidebar-user-meta {
  flex: 1;
  min-width: 0;
}

.tf-sidebar-user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--tf-ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-sidebar-user-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tf-hud-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tf-sidebar-more {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.95);
  background: rgba(148, 163, 184, 0.12);
  flex-shrink: 0;
}

html[dir="rtl"] .tf-sidebar-more i,
html[dir="rtl"] .tf-sidebar-logout i {
  transform: scaleX(-1);
}

.tf-sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--tf-ink-soft);
  font-size: 1rem;
  cursor: pointer;
}

.tf-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

html[data-theme="light"] .tf-sidebar-logout:hover {
  color: #b91c1c;
}

.tf-pwa-install-float {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.tf-pwa-install-float:hover {
  background: rgba(99, 102, 241, 0.24);
  color: #eef2ff;
}

.tf-pwa-install-float {
  position: fixed;
  z-index: 30;
  width: auto;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  margin: 0;
  box-shadow: 0 10px 24px -16px rgba(2, 6, 23, 0.8);
}

.tf-pwa-ios {
  margin: 0 0 0.45rem;
  color: var(--tf-text-muted, #94a3b8);
  font-size: 0.75rem;
  line-height: 1.45;
}

.tf-pwa-ios-float {
  position: fixed;
  z-index: 30;
  width: min(16rem, calc(100% - 2.5rem));
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--tf-bg-elevated, #1e293b);
  border: 1px solid var(--tf-border, rgba(255, 255, 255, 0.08));
}

.tf-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 1035;
}

.tf-sidebar-backdrop.show { display: block; }

.tf-shell {
  margin-inline-start: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tf-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.75rem;
  background: var(--tf-chrome-top);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tf-line);
  color: var(--tf-ink);
}

.tf-topbar-heading {
  min-width: 0;
}

.tf-topbar-code {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--tf-hud);
}

.tf-topbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--tf-ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-topbar-spacer { flex: 1; }

.tf-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tf-topbar .tf-lang-switcher .btn,
.tf-topbar .tf-theme-switcher .btn {
  background: var(--tf-fill);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.tf-topbar .tf-lang-switcher .btn:hover,
.tf-topbar .tf-theme-switcher .btn:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
  border-color: var(--tf-hud-accent);
}

.tf-topbar .tf-lang-switcher .btn.active,
.tf-topbar .tf-theme-switcher .btn.active {
  background: var(--tf-gradient-subtle);
  color: var(--tf-hud-accent);
  border-color: color-mix(in srgb, var(--tf-primary-light) 45%, transparent);
}

.tf-theme-switcher .btn {
  min-width: 2.1rem;
}

.tf-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: var(--tf-user-chip);
  border: 1px solid var(--tf-line);
  color: var(--tf-ink);
}

.tf-topbar-user-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--tf-ink-strong);
}

.tf-topbar-user-role {
  font-size: 0.72rem;
  color: var(--tf-ink-soft);
  line-height: 1.2;
}

.tf-sidebar-toggle {
  border: 1px solid var(--tf-input-line);
  background: var(--tf-fill);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-ink);
}

.tf-avatar {
  border-radius: 50%;
  background: var(--tf-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.tf-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.tf-avatar-md { width: 40px; height: 40px; font-size: 0.85rem; }
.tf-avatar-lg { width: 44px; height: 44px; font-size: 0.9rem; }

.tf-avatar.has-image,
.tf-member-avatar.has-image,
.kanban-card-assignee-avatar.has-image,
.kanban-comment-avatar.has-image,
.tf-chat-msg-gutter .tf-avatar.has-image {
  overflow: hidden;
  padding: 0;
}

.tf-avatar.has-image img,
.tf-member-avatar.has-image img,
.kanban-card-assignee-avatar.has-image img,
.kanban-comment-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tf-avatar.has-image {
  background: transparent;
}

.tf-member-avatar.has-image {
  background: transparent;
}

.tf-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Main & Footer */
.tf-app .tf-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.5rem 1.75rem 2rem;
}

.tf-main {
  flex: 1 0 auto;
  width: 100%;
  padding: 2rem 1.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tf-app .tf-footer {
  margin-inline-start: 0;
  padding-inline: 1.75rem;
  background: var(--tf-canvas);
  border-top-color: var(--tf-line);
  color: var(--tf-ink);
}
  color: rgba(203, 213, 225, 0.85);
}

.tf-app .tf-footer .text-muted {
  color: rgba(148, 163, 184, 0.9) !important;
}

.tf-main.container-fluid-wide {
  max-width: 100%;
  padding: 1.5rem 1.5rem 3rem;
}

.tf-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--tf-border);
  background: var(--tf-surface);
  margin-top: auto;
}

.tf-footer .container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Page header */
.tf-page-header {
  margin-bottom: 2rem;
}

.tf-page-header h1, .tf-page-header h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

body.tf-app .tf-page-header h1,
body.tf-app .tf-page-header h2 {
  color: var(--tf-ink-strong);
}

body.tf-app .tf-page-header p {
  color: rgba(148, 163, 184, 0.95);
  margin: 0;
}

body.tf-app .tf-back-link {
  color: rgba(148, 163, 184, 0.95);
}

body.tf-app .tf-back-link:hover {
  color: var(--tf-hud-accent);
}

.tf-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--tf-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}

.tf-back-link:hover { color: var(--tf-primary); }

/* Cards / Panels */
.tf-panel {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  box-shadow: var(--tf-shadow-sm);
  overflow: hidden;
}

.tf-dashboard-grid {
  align-items: flex-start;
}

.tf-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
  background: var(--tf-fill-2);
}

.tf-panel-header h3, .tf-panel-header span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tf-panel-header i {
  color: var(--tf-primary);
  font-size: 1.1rem;
}

.tf-panel-body {
  padding: 1.25rem;
}

.tf-panel-body.flush {
  padding: 0;
}

.tf-badge-count {
  background: var(--tf-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Auth */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #1e1b4b 0%, #312e81 40%, #1e3a5f 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-brand-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: authBlobFloat 12s ease-in-out infinite;
}

.auth-blob-1 {
  width: 420px;
  height: 420px;
  background: #6366f1;
  top: -10%;
  left: -15%;
}

.auth-blob-2 {
  width: 320px;
  height: 320px;
  background: #06b6d4;
  bottom: 10%;
  right: -10%;
  animation-delay: -4s;
}

.auth-blob-3 {
  width: 260px;
  height: 260px;
  background: #8b5cf6;
  top: 50%;
  left: 40%;
  animation-delay: -8s;
}

@keyframes authBlobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
}

.auth-brand-logo,
.auth-mobile-logo {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
}

.auth-brand-logo img {
  display: block;
  height: 68px;
  width: auto;
  max-width: min(100%, 320px);
}

.auth-mobile-logo {
  margin-bottom: 1rem;
}

.auth-mobile-logo img {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(100%, 220px);
}

.auth-brand-headline {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.auth-brand-desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 2rem;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.auth-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #a5b4fc;
}

.auth-features li div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-features li strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-features li span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.auth-kanban-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(12px);
}

.auth-kanban-col-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.6rem;
  padding: 0 0.15rem;
}

.auth-kanban-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.auth-kanban-card:last-child { margin-bottom: 0; }

.auth-kanban-label {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 0.45rem;
}

.auth-kanban-label-blue { background: #6366f1; }
.auth-kanban-label-purple { background: #8b5cf6; }
.auth-kanban-label-green { background: #10b981; }
.auth-kanban-label-cyan { background: #06b6d4; }

.auth-kanban-line {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.auth-kanban-line.w-80 { width: 80%; }
.auth-kanban-line.w-70 { width: 70%; }
.auth-kanban-line.w-65 { width: 65%; }
.auth-kanban-line.w-60 { width: 60%; }
.auth-kanban-line.w-55 { width: 55%; }
.auth-kanban-line.w-90 { width: 90%; }

.auth-kanban-avatars {
  display: flex;
  margin-top: 0.35rem;
}

.auth-kanban-avatars span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-inline-end: -6px;
}

.auth-kanban-avatars span:first-child { background: #6366f1; }
.auth-kanban-avatars span:last-child { background: #06b6d4; }

.auth-kanban-card-1 { animation: authCardSlide 0.6s ease-out; }
.auth-kanban-card-2 { animation: authCardSlide 0.6s ease-out 0.1s both; }
.auth-kanban-card-3 { animation: authCardSlide 0.6s ease-out 0.2s both; }
.auth-kanban-card-4 { animation: authCardSlide 0.6s ease-out 0.3s both; }

@keyframes authCardSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: var(--tf-bg-elevated);
}

.auth-form-inner {
  width: 100%;
  max-width: 420px;
  animation: authFormFadeIn 0.5s ease-out;
}

@keyframes authFormFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auth-form-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.auth-form-header p {
  color: var(--tf-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--tf-bg);
  border-radius: 12px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--tf-border);
}

.auth-tabs .nav-link {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 0.65rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--tf-text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tabs .nav-link:hover {
  color: var(--tf-text);
}

.auth-tabs .nav-link.active {
  background: white;
  color: var(--tf-primary);
  box-shadow: var(--tf-shadow-sm);
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  inset-inline-start: 0.875rem;
  color: var(--tf-text-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.auth-input-group .form-control {
  padding-inline-start: 2.5rem;
  padding-inline-end: 2.5rem;
  height: 46px;
  border: 1.5px solid var(--tf-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-group .form-control:focus {
  border-color: var(--tf-primary-light);
}

.auth-password-toggle {
  position: absolute;
  inset-inline-end: 0.5rem;
  background: none;
  border: none;
  color: var(--tf-text-muted);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s;
}

.auth-password-toggle:hover {
  color: var(--tf-text);
}

.auth-submit-btn {
  height: 46px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 11px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.auth-submit-btn:disabled {
  opacity: 0.75;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  border: none;
}

.auth-error i {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.auth-success {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  border: none;
}

.auth-success i {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
}

.auth-forgot-row a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tf-primary);
  text-decoration: none;
}

.auth-forgot-row a:hover {
  text-decoration: underline;
}

.auth-invite-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tf-text-muted);
  background: var(--tf-bg);
  border: 1px solid var(--tf-border);
}

.auth-invite-note i {
  color: var(--tf-primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.auth-otp-input {
  letter-spacing: 0.35em;
  font-weight: 700;
  text-align: center;
  font-size: 1.25rem;
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 1.75rem 0 0;
  font-size: 0.8rem;
  color: var(--tf-text-muted);
}

.auth-footer-note i {
  color: var(--tf-success);
}

/* List items */
.tf-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.tf-list-item:last-child { border-bottom: none; }

.tf-list-item:hover {
  background: rgba(99, 102, 241, 0.04);
}

.tf-list-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--tf-primary);
}

.tf-list-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.tf-list-item-meta {
  font-size: 0.8rem;
  color: var(--tf-text-muted);
}

.tf-project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.tf-project-link:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--tf-primary);
}

.tf-project-link:last-child { border-bottom: none; }

.tf-project-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--tf-border);
}

.tf-project-row:last-child { border-bottom: none; }

.tf-project-row .tf-project-link {
  flex: 1;
  border-bottom: none;
}

.tf-project-link-archived {
  opacity: 0.75;
  cursor: default;
}

.tf-project-action {
  align-self: center;
  margin-inline-end: 0.75rem;
  flex-shrink: 0;
}

.tf-project-arrow {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tf-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.tf-empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--tf-ink-soft);
  font-size: 0.9rem;
}

.tf-empty-state i {
  font-size: 2rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--tf-hud-accent);
}

/* Member row */
.tf-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
}

.tf-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tf-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tf-member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Activity feed */
.tf-activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
  font-size: 0.875rem;
}

.tf-activity-item:last-child { border-bottom: none; }

.tf-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tf-activity-icon.act-update { background: #6366f1; }
.tf-activity-icon.act-create { background: #10b981; }
.tf-activity-icon.act-complete { background: #06b6d4; }
.tf-activity-icon.act-comment { background: #f59e0b; }
.tf-activity-icon.act-default { background: #94a3b8; }

.tf-activity-body strong { font-weight: 600; }

.tf-activity-meta {
  color: var(--tf-text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.tf-activity-item time {
  display: block;
  font-size: 0.75rem;
  color: var(--tf-text-muted);
  white-space: nowrap;
}

/* Settings audit log */
.tf-audit-log {
  overflow-x: hidden;
}

.tf-audit-item {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
  font-size: 0.875rem;
}

.tf-audit-item:last-child {
  border-bottom: none;
}

.tf-audit-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
}

.tf-audit-user {
  min-width: 0;
  font-weight: 600;
  word-break: break-word;
}

.tf-audit-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--tf-text-muted);
  text-align: end;
  white-space: nowrap;
}

.tf-audit-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
  color: var(--tf-text-muted);
  font-size: 0.8125rem;
  word-break: break-word;
}

.tf-audit-action code {
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--tf-primary-dark);
  font-size: 0.75rem;
  word-break: break-all;
}

.tf-audit-changes {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  background: var(--tf-fill-2);
  color: var(--tf-text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.tf-audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tf-audit-search {
  position: relative;
  flex: 1 1 14rem;
  min-width: 12rem;
}

.tf-audit-search i {
  position: absolute;
  top: 50%;
  inset-inline-start: 0.7rem;
  transform: translateY(-50%);
  color: var(--tf-text-muted);
  pointer-events: none;
}

.tf-audit-search input {
  padding-inline-start: 2rem;
}

.tf-audit-filters .form-select {
  flex: 0 1 10rem;
  width: auto;
  min-width: 8.5rem;
}

.tf-audit-filters .tf-datepicker {
  flex: 0 1 9rem;
}

.tf-audit-count,
.tf-audit-page {
  font-size: 0.75rem;
  color: var(--tf-text-muted);
  white-space: nowrap;
}

.tf-audit-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--tf-border);
}

.tf-audit-who {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.tf-audit-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.tf-audit-extra {
  margin-top: 0.2rem;
  color: var(--tf-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-word;
}

.tf-audit-cat {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tf-audit-cat.cat-session { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; }
.tf-audit-cat.cat-work { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.tf-audit-cat.cat-people { background: rgba(139, 92, 246, 0.18); color: #d8b4fe; }
.tf-audit-cat.cat-chat { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.tf-audit-cat.cat-settings { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

html[data-theme="light"] .tf-audit-cat { color: #4338ca; background: rgba(99, 102, 241, 0.12); }
html[data-theme="light"] .tf-audit-cat.cat-session { color: #0369a1; background: rgba(14, 165, 233, 0.12); }
html[data-theme="light"] .tf-audit-cat.cat-work { color: #047857; background: rgba(16, 185, 129, 0.12); }
html[data-theme="light"] .tf-audit-cat.cat-people { color: #6d28d9; background: rgba(139, 92, 246, 0.12); }
html[data-theme="light"] .tf-audit-cat.cat-chat { color: #b45309; background: rgba(245, 158, 11, 0.14); }
html[data-theme="light"] .tf-audit-cat.cat-settings { color: #334155; background: rgba(100, 116, 139, 0.14); }

.tf-activity-icon.act-alert {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dash-audit-more {
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tf-hud-accent, var(--tf-primary));
  text-decoration: none;
  white-space: nowrap;
}

.dash-audit-more:hover { text-decoration: underline; }

.tf-role-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tf-role-badge.role-viewer {
  background: var(--tf-fill-2);
  color: var(--tf-ink-soft);
}

.tf-role-badge.role-member {
  background: rgba(6, 182, 212, 0.15);
  color: #0e7490;
}

html[data-theme="dark"] .tf-role-badge.role-member {
  color: #67e8f9;
}

.tf-role-badge.role-admin {
  background: rgba(99, 102, 241, 0.15);
  color: var(--tf-primary-dark);
}

.tf-role-badge.role-owner {
  background: rgba(139, 92, 246, 0.15);
  color: #6d28d9;
}

html[data-theme="dark"] .tf-role-badge.role-owner {
  color: #c4b5fd;
}

.kanban-readonly .kanban-card {
  cursor: pointer;
}

.kanban-readonly .kanban-card:active {
  cursor: pointer;
}

.kanban-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 0.15rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.kanban-board-wrap::-webkit-scrollbar {
  height: 8px;
}

.kanban-board-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.kanban-board-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-archive-zone {
  flex-shrink: 1;
  min-height: 0;
  max-height: 36%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

.kanban-archive-zone .boards-archive-toggle {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.kanban-page > .kanban-archive-zone {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 40%;
}

.kanban-archive-zone .boards-archive-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.kanban-archived-open {
  flex: 1;
  min-width: 0;
  text-align: start;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.kanban-archived-open strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-board {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
  width: 100%;
  min-width: 0;
  padding-bottom: 0.1rem;
}

.kanban-column {
  --column-color: #94a3b8;
  position: relative;
  flex: 1 1 0;
  width: auto;
  min-width: 250px;
  max-width: none;
  max-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--tf-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  box-shadow: var(--tf-shadow);
  overflow: hidden;
  color: var(--tf-ink);
}

.kanban-column::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--column-color);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.65rem 0.8rem 0.5rem;
  border-bottom: 1px solid var(--tf-line);
  flex-shrink: 0;
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.kanban-column-header h5 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--tf-ink-strong);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-column-count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tf-chip-ink);
  background: var(--tf-chip-bg);
  border: 1px solid var(--tf-line);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  min-width: 1.6rem;
  text-align: center;
}

.kanban-cards {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: background 0.15s;
  border-radius: 0 0 16px 16px;
  padding: 0.65rem 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.kanban-cards::-webkit-scrollbar {
  width: 6px;
}

.kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.kanban-column-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-height: 88px;
  padding: 1rem 0.75rem;
  border: 1px dashed var(--tf-line);
  border-radius: 12px;
  color: var(--tf-ink-soft);
  font-size: 0.78rem;
  text-align: center;
  background: var(--tf-fill-2);
}

.kanban-column-empty i {
  font-size: 1.15rem;
  opacity: 0.85;
}

.kanban-cards.drag-over {
  background: rgba(99, 102, 241, 0.06);
  outline: 2px dashed rgba(99, 102, 241, 0.35);
  outline-offset: 2px;
}

.kanban-card {
  position: relative;
  display: flex;
  flex-shrink: 0;
  background: var(--tf-bubble);
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  cursor: grab;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--tf-shadow-sm);
  color: var(--tf-ink);
}

.kanban-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--tf-shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.28);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.45;
}

.kanban-drop-slot {
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px dashed rgba(99, 102, 241, 0.5);
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.1);
  pointer-events: none;
}

.kanban-card-accent {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--kanban-priority-color, #94a3b8);
  border-radius: 14px 0 0 14px;
}

.kanban-card-inner {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
}

.kanban-card-priority-low { --kanban-priority-color: #94a3b8; }
.kanban-card-priority-medium { --kanban-priority-color: #3b82f6; }
.kanban-card-priority-high { --kanban-priority-color: #f59e0b; }
.kanban-card-priority-critical { --kanban-priority-color: #ef4444; }

.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.kanban-card-priority {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.kanban-card-priority.priority-low {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.kanban-card-priority.priority-medium {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.kanban-card-priority.priority-high {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.kanban-card-priority.priority-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.kanban-card-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-width: 0;
}

.kanban-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tf-ink-soft);
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  white-space: nowrap;
}

.kanban-card-chip i {
  font-size: 0.72rem;
  opacity: 0.85;
}

.kanban-card-chip.is-overdue {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.kanban-card-chip.is-warning {
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.kanban-card-chip.kanban-card-comments {
  color: var(--tf-primary-dark);
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.15);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--tf-ink-strong);
  margin-bottom: 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.kanban-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--tf-line);
}

.kanban-card-assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.kanban-card-assignee.is-unassigned {
  flex: 0;
}

.kanban-card-assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.kanban-card-assignee-avatar.is-empty {
  background: var(--tf-fill-2);
  color: var(--tf-ink-soft);
  border: 1px dashed var(--tf-line);
  box-shadow: none;
}

.kanban-card-assignee-avatar.is-empty i {
  font-size: 0.75rem;
}

.kanban-card-assignee-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tf-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-assignee-stack {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.kanban-card-assignee-stack .kanban-card-assignee-avatar {
  margin-inline-start: -0.4rem;
  border: 2px solid var(--tf-surface, #fff);
}

.kanban-card-assignee-stack .kanban-card-assignee-avatar:first-child {
  margin-inline-start: 0;
}

.kanban-card-assignee-avatar.is-more {
  background: var(--tf-fill-2);
  color: var(--tf-ink);
  font-size: 0.58rem;
}

.tf-assignee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tf-assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--tf-line);
  background: var(--tf-bg);
  color: var(--tf-ink);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tf-assignee-chip:hover:not(:disabled) {
  border-color: var(--tf-primary);
  transform: translateY(-1px);
}

.tf-assignee-chip.active {
  background: color-mix(in srgb, var(--tf-primary) 14%, transparent);
  border-color: var(--tf-primary);
  color: var(--tf-primary-dark, var(--tf-primary));
}

.tf-assignee-chip:disabled {
  cursor: default;
  opacity: 0.85;
}

.tf-assignee-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.tf-assignee-chip-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tf-assignee-chip-check {
  font-size: 0.75rem;
}

.kanban-card-indicators {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}

/* Kanban modals */
.kanban-modal .modal-body {
  padding: 1.25rem 1.35rem 1.35rem;
}

/* Shared command-deck modal */
.tf-modal .form-label,
.dash-modal .form-label,
.boards-modal .form-label {
  color: var(--tf-ink-strong);
}

.tf-modal .form-control,
.tf-modal .form-select,
.dash-modal .form-control,
.dash-modal .form-select,
.boards-modal .form-control,
.boards-modal .form-select {
  background: var(--tf-input);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.tf-modal .form-control::placeholder,
.dash-modal .form-control::placeholder,
.boards-modal .form-control::placeholder {
  color: var(--tf-ink-soft);
}

.tf-modal .form-control:focus,
.tf-modal .form-select:focus,
.dash-modal .form-control:focus,
.dash-modal .form-select:focus,
.boards-modal .form-control:focus,
.boards-modal .form-select:focus {
  background: var(--tf-input);
  color: var(--tf-ink);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.tf-modal .btn-tf-ghost,
.dash-modal .btn-tf-ghost,
.boards-modal .btn-tf-ghost {
  background: var(--tf-fill);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.tf-modal .btn-tf-ghost:hover,
.dash-modal .btn-tf-ghost:hover,
.boards-modal .btn-tf-ghost:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
  border-color: var(--tf-hud-accent);
}

html[data-theme="dark"] .tf-modal .btn-close,
html[data-theme="dark"] .dash-modal .btn-close,
html[data-theme="dark"] .boards-modal .btn-close {
  filter: invert(1) grayscale(1) brightness(2);
}

.modal-backdrop.show {
  background: var(--tf-backdrop);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
}

.kanban-modal-section {
  padding: 1rem 1.05rem;
  margin-bottom: 0.85rem;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  overflow: visible;
}

.kanban-modal-section:last-child {
  margin-bottom: 0;
}

.kanban-modal-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--tf-ink-strong);
}

.kanban-fold {
  margin-bottom: 0.85rem;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  border-radius: 14px;
}

.kanban-fold > summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--tf-ink-strong);
  font-weight: 700;
}

.kanban-fold > summary::-webkit-details-marker { display: none; }

.kanban-fold > summary::marker { content: ""; }

.kanban-fold-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.kanban-fold-meta {
  margin-inline-start: auto;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--tf-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}

.kanban-fold-meta:empty { display: none; }

.kanban-fold-chevron {
  color: var(--tf-ink-soft);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.kanban-fold[open] .kanban-fold-chevron { transform: rotate(180deg); }

.kanban-fold-body {
  padding: 0 1rem 1rem;
}

.kanban-modal-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--tf-line);
}

.kanban-modal-comments {
  background: var(--tf-fill);
}

.kanban-comment-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.kanban-comment {
  padding: 0.75rem 0.85rem;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
}

.kanban-comment-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.kanban-comment-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.kanban-comment:hover .kanban-comment-actions,
.kanban-comment:focus-within .kanban-comment-actions {
  opacity: 1;
}

.kanban-comment-action {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-ink-soft);
  text-decoration: none;
}

.kanban-comment-action:hover {
  color: var(--tf-hud-accent);
}

.kanban-comment-edited {
  margin-inline-start: 0.35rem;
  font-style: italic;
}

.kanban-comment-edit {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kanban-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.kanban-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.kanban-comment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.kanban-comment-author {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--tf-primary-dark);
}

.kanban-comment-meta time {
  font-size: 0.72rem;
  color: var(--tf-text-muted);
}

.kanban-comment-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tf-text);
  word-break: break-word;
  white-space: pre-wrap;
}

.kanban-comment-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.25rem;
  color: var(--tf-text-muted);
  font-size: 0.875rem;
  border: 1px dashed var(--tf-line);
  border-radius: 12px;
  background: var(--tf-fill-2);
}

.kanban-comment-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.kanban-comment-compose .form-control {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: var(--tf-input);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.kanban-comment-compose .form-control:focus {
  background: var(--tf-input);
  color: var(--tf-ink);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.kanban-comment-compose .btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.kanban-comment-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--tf-ink-soft);
}

.kanban-discussion-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.kanban-discussion-tab {
  border: 0;
  background: transparent;
  color: var(--tf-ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.kanban-discussion-tab.is-active {
  background: var(--tf-fill-2);
  color: var(--tf-primary-dark);
  box-shadow: inset 0 0 0 1px var(--tf-line);
}

.kanban-comment-compose-wrap {
  position: relative;
}

.kanban-mention-menu {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 3.25rem;
  bottom: calc(100% + 0.35rem);
  max-height: 220px;
  overflow-y: auto;
  background: var(--tf-bg-elevated);
  color: var(--tf-ink);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
  box-shadow: var(--tf-shadow-lg);
  z-index: 20;
  padding: 0.3rem;
}

.kanban-mention-item {
  width: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--tf-ink-strong);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  text-align: start;
}

.kanban-mention-item.is-active,
.kanban-mention-item:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

.kanban-mention-item-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: inherit;
}

.kanban-mention-empty {
  padding: 0.7rem 0.8rem;
  font-size: 0.8rem;
  color: var(--tf-text-muted);
}

.kanban-mention {
  color: var(--tf-hud-accent);
  font-weight: 700;
}

.kanban-activity-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.kanban-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: var(--tf-fill-2);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
}

.kanban-activity-body {
  min-width: 0;
  flex: 1;
}

.kanban-activity-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--tf-text);
}

.kanban-activity-item time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--tf-text-muted);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Modals */
.modal-content {
  border: none;
  border-radius: var(--tf-radius-lg);
  box-shadow: var(--tf-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--tf-border);
  padding: 1.25rem 1.5rem;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  border-top: 1px solid var(--tf-border);
  padding: 1rem 1.5rem;
}

/* Status settings */
.tf-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--tf-fill);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--tf-line);
  color: var(--tf-ink);
}

.tf-status-row:hover {
  border-color: color-mix(in srgb, var(--tf-hud-accent) 40%, transparent);
  background: var(--tf-fill-hover);
}

.tf-status-row strong {
  color: var(--tf-ink-strong);
}

.tf-status-meta,
.tf-status-row .text-muted,
.tf-status-row small {
  color: var(--tf-ink-soft) !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tf-status-row .btn-sm {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.tf-status-row .badge {
  font-weight: 650;
}

/* Settings — command deck */
body.page-settings .tf-panel {
  background: var(--tf-panel);
  border: 1px solid var(--tf-line);
  border-radius: 24px;
  box-shadow: var(--tf-shadow-lg);
  color: var(--tf-ink);
}

body.page-settings .tf-panel-header {
  background: transparent;
  border-bottom-color: var(--tf-line);
}

body.page-settings .tf-panel-header > span:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

body.page-settings .tf-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tf-ink-strong);
  font-weight: 700;
}

body.page-settings .tf-panel-header i {
  color: var(--tf-hud-accent);
}

body.page-settings .tf-panel-body {
  color: var(--tf-ink);
}

body.page-settings .text-muted,
body.page-settings .form-label.small {
  color: var(--tf-ink-soft) !important;
}

body.page-settings .form-label {
  color: var(--tf-ink);
}

body.page-settings .form-control,
body.page-settings .form-select {
  background: var(--tf-input);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

body.page-settings .form-control:focus,
body.page-settings .form-select:focus {
  background: var(--tf-fill);
  border-color: var(--tf-hud-accent);
  color: var(--tf-ink);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

body.page-settings .form-control::placeholder {
  color: var(--tf-ink-soft);
}

body.page-settings hr {
  border-color: var(--tf-line);
  opacity: 1;
}

body.page-settings h6 {
  color: var(--tf-ink-strong);
}

body.page-settings .tf-status-row {
  background: var(--tf-fill);
  border-color: var(--tf-line);
  color: var(--tf-ink-strong);
}

body.page-settings .tf-status-row:hover {
  border-color: rgba(165, 180, 252, 0.35);
}

body.page-settings .tf-empty-state {
  color: var(--tf-ink-soft);
}

body.page-settings .tf-empty-state i {
  color: var(--tf-hud-accent);
  opacity: 0.7;
}

body.page-settings .tf-audit-item {
  border-bottom-color: var(--tf-line);
}

body.page-settings .tf-audit-user {
  color: var(--tf-ink-strong);
}

body.page-settings .tf-audit-time,
body.page-settings .tf-audit-action {
  color: var(--tf-ink-soft);
}

body.page-settings .tf-audit-action code {
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

body.page-settings .tf-audit-changes {
  background: var(--tf-fill);
  border-color: var(--tf-line);
  color: var(--tf-ink);
}

body.page-settings .text-success {
  color: var(--tf-success-ink) !important;
}

/* Labels */
.tf-label-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tf-label-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--label-color) 35%, transparent);
  background: color-mix(in srgb, var(--label-color) 18%, transparent);
  color: var(--label-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tf-label-chip:hover:not(:disabled) {
  background: color-mix(in srgb, var(--label-color) 28%, transparent);
  transform: translateY(-1px);
}

.tf-label-chip.active {
  background: var(--label-color);
  color: #fff;
  border-color: var(--label-color);
}

.tf-label-chip:disabled {
  cursor: default;
  opacity: 0.85;
}

.tf-label-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--label-color);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  margin-inline-end: 0.25rem;
}

/* Dark mode: lighten chip text so dark label colors stay readable */
html:not([data-theme="light"]) .tf-label-chip:not(.active) {
  color: color-mix(in srgb, var(--label-color) 38%, #f1f5f9);
  background: color-mix(in srgb, var(--label-color) 28%, transparent);
  border-color: color-mix(in srgb, var(--label-color) 48%, transparent);
}

html:not([data-theme="light"]) .tf-label-chip:not(.active):hover:not(:disabled) {
  color: color-mix(in srgb, var(--label-color) 28%, #ffffff);
  background: color-mix(in srgb, var(--label-color) 38%, transparent);
}

html:not([data-theme="light"]) .tf-label-badge {
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 22%, transparent);
}

.kanban-card-labels .tf-label-badge {
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Comments */
.comment-item {
  padding: 0.875rem;
  background: var(--tf-bg);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.comment-item strong {
  color: var(--tf-primary-dark);
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: none;
}

/* Priority badges override */
.badge.bg-secondary { background: #94a3b8 !important; }
.badge.bg-info { background: #06b6d4 !important; }
.badge.bg-warning { background: #f59e0b !important; color: #1e293b !important; }
.badge.bg-danger { background: #ef4444 !important; }

/* Scrollable areas */
.tf-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.tf-scroll-lg {
  max-height: 480px;
  overflow-y: auto;
}

body.lang-fa {
  font-family: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif;
}

.tf-lang-switcher .btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--tf-primary-dark);
  border-color: rgba(99, 102, 241, 0.3);
}

.tf-lang-switcher-auth .btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--tf-primary-dark);
}

html[dir="rtl"] .tf-back-link i {
  transform: scaleX(-1);
}

html[dir="rtl"] .tf-list-item.active {
  border-left: none;
  border-right: 3px solid var(--tf-primary);
}

html[dir="rtl"] .kanban-card-chip,
html[dir="rtl"] .tf-project-arrow {
  direction: ltr;
}

/* â”€â”€ Premium dashboard â”€â”€ */
body.page-dashboard {
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--tf-glow-a), transparent 55%),
    radial-gradient(900px 420px at 110% 8%, var(--tf-glow-b), transparent 50%),
    var(--tf-canvas);
}

body.page-dashboard .dash-main-wrap {
  width: 100%;
  max-width: none;
  padding: 0 1.15rem 2.75rem;
}

.dash-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: calc(100vh - 96px);
  padding-top: 0.15rem;
}

.dash-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dash-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.38;
  animation: authBlobFloat 14s ease-in-out infinite;
}

.dash-blob-1 { width: 460px; height: 460px; background: #6366f1; top: -6%; right: 8%; }
.dash-blob-2 { width: 340px; height: 340px; background: #06b6d4; bottom: 8%; left: -4%; animation-delay: -5s; }
.dash-blob-3 { width: 260px; height: 260px; background: #8b5cf6; top: 40%; left: 38%; animation-delay: -9s; opacity: 0.16; }

.dash-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 15%, transparent 75%);
}

.dash-orbit {
  position: absolute;
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: 50%;
  inset-inline-end: -8%;
  top: -12%;
}

.dash-orbit-a { width: 520px; height: 520px; }
.dash-orbit-b { width: 360px; height: 360px; inset-inline-end: 2%; top: 2%; border-color: rgba(6, 182, 212, 0.12); }

.dash-page > *:not(.dash-bg) {
  position: relative;
  z-index: 1;
}

.dash-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 280px);
  gap: 1.25rem;
  align-items: stretch;
  padding: 1.5rem 1.6rem 1.45rem;
  border-radius: 28px;
  color: var(--tf-hero-ink);
  background:
    radial-gradient(circle at 88% 18%, rgba(129, 140, 248, 0.28), transparent 32%),
    radial-gradient(circle at 12% 86%, rgba(6, 182, 212, 0.18), transparent 36%),
    var(--tf-hero);
  box-shadow: 0 24px 50px -28px rgba(15, 23, 42, 0.65);
  overflow: hidden;
  animation: dashHeroIn 0.55s ease both;
}

.dash-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 32%);
}

html:not([data-theme="light"]) .dash-hero {
  min-height: 248px;
  border: 1px solid rgba(165, 180, 252, 0.14);
  box-shadow:
    0 24px 50px -28px rgba(15, 23, 42, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: #0a1229;
}

html[data-theme="light"] .dash-hero {
  min-height: 248px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 18px 40px -28px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  background: #fcfcfe;
  color: #0f172a;
}

html:not([data-theme="light"]) .dash-hero::after,
html[data-theme="light"] .dash-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 100%;
}

html:not([data-theme="light"]) .dash-hero::after {
  background-image: url("../img/dash-hero-dark.jpg");
  background-color: #0a1229;
}

html[data-theme="light"] .dash-hero::after {
  background-image: url("../img/dash-hero-light.png");
  background-color: #fcfcfe;
}

html[dir="rtl"] .dash-hero::after {
  transform: scaleX(-1);
}

html:not([data-theme="light"]) .dash-hero::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%);
}

html[data-theme="light"] .dash-hero::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 42%);
}

html[data-theme="light"] .dash-hero-kicker,
html[data-theme="light"] .dash-hero-sub,
html[data-theme="light"] .dash-clock-label,
html[data-theme="light"] .dash-clock-date {
  color: #64748b;
}

html[data-theme="light"] .dash-hero-title,
html[data-theme="light"] .dash-clock-time {
  color: #0f172a;
}

html[data-theme="light"] .dash-hero .btn-light {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

html[data-theme="light"] .dash-hero .btn-outline-light {
  color: #334155;
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .dash-hero .btn-outline-light:hover {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.35);
  background: rgba(255, 255, 255, 0.85);
}

@keyframes dashHeroIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.dash-hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.78);
}

.dash-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: dashPulse 1.8s ease-out infinite;
}

@keyframes dashPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.dash-hero-sep { opacity: 0.5; }

.dash-hero-title {
  margin: 0.7rem 0 0;
  font-size: clamp(1.55rem, 2.9vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.12;
  color: #fff;
}

.dash-hero-sub {
  margin: 0.55rem 0 0;
  max-width: 36rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.98rem;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.dash-hero-btn {
  border-radius: 999px !important;
  font-weight: 650;
  padding: 0.48rem 0.95rem !important;
}

.dash-hero-copy,
.dash-hero-clock {
  position: relative;
  z-index: 2;
}

.dash-hero-clock {
  display: grid;
  place-items: center;
  min-height: 180px;
}

html:not([data-theme="light"]) .dash-clock-face {
  width: 164px;
  min-height: 164px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: rgba(8, 12, 28, 0.52);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid rgba(199, 210, 254, 0.22);
  box-shadow:
    0 12px 36px rgba(2, 6, 23, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .dash-clock-face {
  width: 164px;
  min-height: 164px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .dash-clock-ring {
  border-color: rgba(15, 23, 42, 0.16);
}

.dash-clock-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 176px;
  height: 176px;
  margin: -88px 0 0 -88px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  animation: dashSpin 28s linear infinite;
}

.dash-clock-ring::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #818cf8;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 16px #818cf8;
}

@keyframes dashSpin {
  to { transform: rotate(360deg); }
}

.dash-clock-face {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.1rem 0.6rem;
}

.dash-clock-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.8);
}

.dash-clock-time {
  margin-top: 0.15rem;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.dash-clock-date {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.72);
}

.dash-console {
  display: grid;
  grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(0, 1fr));
  min-height: 176px;
  border-radius: 24px;
  overflow: hidden;
  color: var(--tf-ink);
  background:
    radial-gradient(circle at 8% 0%, var(--tf-chrome-glow), transparent 34%),
    var(--tf-console);
  border: 1px solid var(--tf-line);
  box-shadow: var(--tf-shadow-lg);
  animation: dashCardIn 0.5s ease both;
}

.dash-readout {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 1.15rem 1.2rem 1.05rem;
  border-inline-end: 1px solid var(--tf-line);
  overflow: hidden;
}

.dash-readout:last-child {
  border-inline-end: none;
}

.dash-readout-a {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), transparent 55%);
}

.dash-readout-copy {
  min-width: 0;
  flex: 1;
}

.dash-readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.dash-readout-code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--tf-ink-soft);
}

.dash-readout-head > i {
  color: var(--tf-ink-soft);
  font-size: 0.95rem;
}

.dash-readout-value {
  display: block;
  margin-top: 0.55rem;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--tf-ink-strong);
}

.dash-readout-a .dash-readout-value {
  font-size: clamp(2.4rem, 4vw, 3.3rem);
  margin-top: 0.7rem;
}

.dash-readout-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--tf-ink-soft);
}

.dash-readout-a .dash-readout-label {
  margin-top: 0;
}

.dash-readout-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
  max-width: 16rem;
}

.dash-readout-viz {
  pointer-events: none;
}

.dash-viz-arc {
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.dash-viz-arc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #818cf8 0 68%, rgba(255, 255, 255, 0.08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 64%, #000 65%);
  mask: radial-gradient(farthest-side, transparent 64%, #000 65%);
}

.dash-viz-arc i {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  color: var(--tf-hud-accent);
}

.dash-viz-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  margin-top: 0.85rem;
}

.dash-viz-bars i {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #38bdf8, rgba(56, 189, 248, 0.2));
}

.dash-viz-bars i:nth-child(1) { height: 38%; }
.dash-viz-bars i:nth-child(2) { height: 62%; }
.dash-viz-bars i:nth-child(3) { height: 48%; }
.dash-viz-bars i:nth-child(4) { height: 92%; }
.dash-viz-bars i:nth-child(5) { height: 70%; }

.dash-viz-nodes {
  display: flex;
  align-items: center;
  margin-top: 0.95rem;
  height: 28px;
}

.dash-viz-nodes i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: linear-gradient(135deg, #34d399, #06b6d4);
  margin-inline-start: -6px;
}

.dash-viz-nodes i:first-child { margin-inline-start: 0; }
.dash-viz-nodes i:nth-child(2) { background: linear-gradient(135deg, #818cf8, #6366f1); }
.dash-viz-nodes i:nth-child(3) { background: linear-gradient(135deg, #fbbf24, #f97316); }

.dash-viz-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  margin-top: 0.9rem;
}

.dash-viz-eq i {
  flex: 1;
  border-radius: 99px;
  background: #fbbf24;
  transform-origin: center bottom;
  animation: dashEq 1.2s ease-in-out infinite;
}

.dash-viz-eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.dash-viz-eq i:nth-child(2) { height: 75%; animation-delay: 0.1s; }
.dash-viz-eq i:nth-child(3) { height: 55%; animation-delay: 0.2s; }
.dash-viz-eq i:nth-child(4) { height: 95%; animation-delay: 0.15s; }
.dash-viz-eq i:nth-child(5) { height: 45%; animation-delay: 0.25s; }
.dash-viz-eq i:nth-child(6) { height: 70%; animation-delay: 0.05s; }
.dash-viz-eq i:nth-child(7) { height: 50%; animation-delay: 0.3s; }

@keyframes dashEq {
  0%, 100% { transform: scaleY(0.55); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; }
}

.dash-metrics,
.dash-metric,
.dash-metric-index,
.dash-metric-icon,
.dash-cinema-body,
.dash-cinema-icon,
.dash-cinema-text,
.dash-cinema-label,
.dash-cinema-title,
.dash-cinema-sub,
.dash-stat-pills,
.dash-pill {
  display: none;
}

.dash-body {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.dash-main-col,
.dash-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.dash-side-col .dash-panel:last-child {
  flex: 1;
}

.dash-panel {
  background: var(--tf-panel);
  border: 1px solid var(--tf-line);
  border-radius: 24px;
  box-shadow: var(--tf-shadow-lg);
  overflow: hidden;
  color: var(--tf-ink);
}

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--tf-line);
}

.dash-toolbar.compact {
  padding-bottom: 0.95rem;
}

.dash-toolbar-start,
.dash-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dash-panel-code {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--tf-hud);
}

.dash-section-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tf-ink-strong);
}

.dash-section-title i { color: var(--tf-hud-accent); }

.dash-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

.dash-search {
  position: relative;
  min-width: 200px;
}

.dash-search i {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
  pointer-events: none;
}

.dash-search input,
.dash-sort {
  width: 100%;
  padding-block: 0.5rem;
  padding-inline: 2.35rem 0.85rem;
  border: 1px solid var(--tf-input-line);
  border-radius: 12px;
  font-size: 0.875rem;
  background: var(--tf-input);
  color: var(--tf-ink);
}

.dash-sort {
  width: auto;
  padding-inline: 0.85rem 2rem;
  cursor: pointer;
}

.dash-search input::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.dash-search input:focus,
.dash-sort:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.dash-toolbar-btn {
  white-space: nowrap;
}

.dash-panel .btn-outline-primary {
  --bs-btn-color: var(--tf-chip-ink);
  --bs-btn-border-color: rgba(165, 180, 252, 0.45);
  --bs-btn-hover-bg: var(--tf-fill-hover);
  --bs-btn-hover-border-color: var(--tf-hud-accent);
  --bs-btn-hover-color: var(--tf-ink-strong);
}

.dash-btn-glow {
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.3);
}

.dash-panel-body {
  padding: 1.15rem 1.25rem 1.3rem;
}

.dash-panel-body.flush {
  padding: 0;
}

.dash-archive-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.95);
  margin: 1.25rem 0 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tf-line);
}

/* Project cards grid */
.dash-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  width: 100%;
}

.dash-project-grid .tf-empty-state,
.dash-project-grid .dash-empty {
  grid-column: 1 / -1;
}

.dash-project-card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
  box-shadow: var(--tf-shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: dashCardIn 0.45s ease both;
  animation-delay: var(--card-delay, 0ms);
  display: flex;
  flex-direction: column;
}

@keyframes dashCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.dash-project-pct {
  position: absolute;
  z-index: 2;
  bottom: 0.55rem;
  inset-inline-start: 0.55rem;
  min-width: 2.6rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  text-align: center;
}

.dash-project-card.is-clickable:hover {
  transform: translateY(-5px);
  border-color: rgba(165, 180, 252, 0.35);
  box-shadow: var(--tf-shadow-card-hover);
}

.dash-project-card.is-archived {
  opacity: 0.72;
}

.dash-project-visual {
  position: relative;
  aspect-ratio: 5 / 3;
  overflow: hidden;
}

.dash-project-visual-bg {
  position: absolute;
  inset: 0;
  background: var(--project-gradient);
}

.dash-project-visual-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.28) 100%);
}

.dash-project-preview {
  position: absolute;
  inset: 0.55rem 0.55rem 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.dash-project-col {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 0.5rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-project-col-head {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.58);
  width: 68%;
  flex-shrink: 0;
}

.dash-project-mini {
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.dash-project-mini.tall { height: 28px; }

.dash-project-menu {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  z-index: 2;
}

.dash-project-menu-btn {
  color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(15, 23, 42, 0.28) !important;
  border-radius: 8px !important;
  padding: 0.15rem 0.35rem !important;
  opacity: 0;
  transition: opacity 0.15s;
}

.dash-project-card:hover .dash-project-menu-btn,
.dash-project-card:focus-within .dash-project-menu-btn {
  opacity: 1;
}

.dash-project-info {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-project-progress {
  min-width: 0;
}

.dash-project-card .tf-progress-track {
  background: var(--tf-line);
}

.dash-project-card .tf-progress-meta {
  color: rgba(148, 163, 184, 0.95);
}

.dash-project-name {
  margin: 0;
  font-size: 0.975rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tf-ink-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
}

.dash-project-foot .due-soon { color: #fca5a5; font-weight: 600; }
.dash-project-foot .due-ok { color: rgba(148, 163, 184, 0.95); }

.dash-project-open {
  font-weight: 600;
  color: var(--tf-hud-accent);
  opacity: 0;
  transition: opacity 0.15s;
  cursor:pointer;
}

.dash-project-card:hover .dash-project-open { opacity: 1; }

/* Workspace list */
.dash-workspace-list .tf-list-item,
.dash-workspace-list .dash-workspace-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: none;
  background: transparent;
  text-align: start;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--tf-line);
  cursor: default;
  transition: background 0.12s;
  color: inherit;
}

.dash-workspace-list .tf-list-item:last-child,
.dash-workspace-list .dash-workspace-item:last-child {
  border-bottom: none;
}

.dash-workspace-list .tf-list-item:hover,
.dash-workspace-list .dash-workspace-item:hover {
  background: rgba(129, 140, 248, 0.08);
}

.dash-workspace-list .tf-list-item.active {
  background: rgba(129, 140, 248, 0.14);
  border-left: none;
  border-inline-start: none;
  box-shadow: inset 3px 0 0 #818cf8;
}

html[dir="rtl"] .dash-workspace-list .tf-list-item.active {
  border-right: none;
  box-shadow: inset -3px 0 0 #818cf8;
}

.dash-workspace-list .tf-list-item-title {
  color: var(--tf-ink-strong);
  font-weight: 650;
}

.dash-workspace-list .tf-list-item-meta,
.dash-workspace-list .text-muted {
  color: rgba(148, 163, 184, 0.9) !important;
}

.dash-workspace-list .text-primary {
  color: var(--tf-hud-accent) !important;
}

.dash-workspace-select {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: start;
  padding: 0.2rem 0.15rem;
  cursor: pointer;
}

.dash-workspace-select .tf-list-item-title,
.dash-workspace-select .tf-list-item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.dash-workspace-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dash-color-swatch {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--swatch);
  padding: 0;
  cursor: pointer;
}

.dash-color-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--tf-canvas), 0 0 0 3px var(--swatch);
}

.dash-modal textarea.dash-input {
  min-height: 4.5rem;
  resize: vertical;
}

.dash-workspace-profile .tf-avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 1.25rem;
}

.dash-modal .btn-outline-danger {
  --bs-btn-color: #f87171;
  --bs-btn-border-color: rgba(248, 113, 113, 0.45);
  --bs-btn-hover-bg: rgba(239, 68, 68, 0.12);
  --bs-btn-hover-border-color: #f87171;
  --bs-btn-hover-color: #fecaca;
}

/* Members */
.dash-member-list {
  display: flex;
  flex-direction: column;
}

.dash-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--tf-line);
  transition: background 0.12s, opacity 0.12s;
}

.dash-member-row:last-child { border-bottom: none; }
.dash-member-row:hover { background: var(--tf-hover-row); }
.dash-member-row.is-inactive { opacity: 0.72; }

.dash-member-row .fw-semibold { color: var(--tf-ink-strong); }
.dash-member-row .text-muted,
.dash-member-row small {
  color: rgba(148, 163, 184, 0.9) !important;
}

.dash-panel .member-role.form-select {
  background-color: var(--tf-input);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.dash-panel .tf-member-status.is-active { color: var(--tf-success-ink); }
.dash-panel .tf-member-status.is-inactive { color: var(--tf-ink-soft); }
.dash-panel .tf-member-tasks { color: var(--tf-ink); }

.dash-role-badge,
.dash-you-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.dash-role-badge {
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

.dash-you-chip {
  background: rgba(99, 102, 241, 0.16);
  color: var(--tf-hud-accent);
}

.dash-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 4.5rem;
}

.dash-member-action {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input);
  color: var(--tf-ink);
}

.dash-member-action:hover {
  border-color: var(--tf-hud-accent);
  color: var(--tf-ink-strong);
  background: var(--tf-fill-hover);
}

.dash-member-action.is-danger:hover {
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* Tasks */
.dash-task-list .dash-task-row,
.dash-task-list .tf-my-task-row {
  width: 100%;
  border: none;
  background: transparent;
  text-align: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--tf-line);
  cursor: pointer;
  transition: background 0.12s;
  color: var(--tf-ink);
}

.dash-task-list .dash-task-row:last-child,
.dash-task-list .tf-my-task-row:last-child { border-bottom: none; }

.dash-task-list .dash-task-row:hover,
.dash-task-list .tf-my-task-row:hover {
  background: rgba(129, 140, 248, 0.08);
}

.dash-task-list .tf-my-task-title {
  color: var(--tf-ink-strong);
}

.dash-task-list .tf-my-task-meta,
.dash-task-list .text-muted {
  color: rgba(148, 163, 184, 0.9) !important;
}

.dash-panel .tf-badge-soft {
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

/* Activity */
.dash-activity-list .tf-activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--tf-line);
  transition: background 0.12s;
  color: var(--tf-ink);
}

.dash-activity-list .tf-activity-item:last-child { border-bottom: none; }
.dash-activity-list .tf-activity-item:hover { background: var(--tf-hover-row); }

.dash-activity-list .tf-activity-meta,
.dash-activity-list .tf-activity-item time {
  color: rgba(148, 163, 184, 0.9);
}

.dash-side-col .dash-activity-list {
  max-height: 360px;
  overflow-y: auto;
}

/* Team workload */
.dash-workload {
  padding: 1rem 1.25rem 1.15rem;
  border-top: 1px solid var(--tf-line);
}

.dash-workload-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 0.85rem;
}

.dash-workload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.dash-workload-row:last-child { margin-bottom: 0; }

.dash-workload-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--tf-ink-strong);
}

.dash-workload-bar-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-workload-track {
  flex: 1;
  height: 8px;
  background: var(--tf-line);
  border-radius: 999px;
  overflow: hidden;
}

.dash-workload-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width 0.35s ease;
}

.dash-workload-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.95);
  min-width: 1.5rem;
  text-align: end;
}

/* Due soon list */
.dash-due-list .dash-due-row {
  width: 100%;
  border: none;
  background: transparent;
  text-align: start;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--tf-line);
  cursor: pointer;
  transition: background 0.12s;
  color: inherit;
}

.dash-due-list .dash-due-row:last-child { border-bottom: none; }
.dash-due-list .dash-due-row:hover { background: rgba(251, 191, 36, 0.08); }

.dash-due-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.dash-due-icon.is-overdue {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.dash-due-icon.is-soon {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.dash-due-main { min-width: 0; flex: 1; }

.dash-due-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--tf-ink-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-due-meta {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
  margin-top: 0.2rem;
}

.dash-due-meta .is-overdue { color: #fca5a5; font-weight: 600; }

.dash-panel-pulse {
  background: var(--tf-pulse);
}

.dash-panel-pulse .dash-section-title i {
  color: #fbbf24;
}

.dash-panel-pulse .dash-due-icon {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--tf-pulse-halo);
}

.dash-panel-pulse .dash-due-list {
  position: relative;
}

.dash-panel-pulse .dash-due-list::before {
  content: "";
  position: absolute;
  inset-inline-start: 1.95rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.45), rgba(6, 182, 212, 0.08));
}

.dash-panel-dock .dash-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.dash-panel-dock .dash-quick-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 86px;
  border-radius: 16px;
  background: var(--tf-fill-2);
  border-color: var(--tf-line);
  color: var(--tf-ink);
}

.dash-panel-dock .dash-quick-btn:hover {
  transform: translateY(-2px);
  background: var(--tf-fill-hover);
  border-color: rgba(165, 180, 252, 0.35);
  color: var(--tf-ink-strong);
}

.dash-panel-dock .dash-quick-btn i {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

.dash-quick-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-fill-2);
  color: var(--tf-ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.dash-quick-btn:hover {
  border-color: rgba(165, 180, 252, 0.4);
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
  transform: translateX(2px);
}

.dash-quick-btn i {
  width: 1.25rem;
  text-align: center;
  color: var(--tf-hud-accent);
  font-size: 1.05rem;
}

.dash-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.925rem;
}

.dash-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.65rem;
  opacity: 0.55;
  color: var(--tf-hud-accent);
}

.dash-panel .dash-member-row.tf-member-row {
  border-bottom-color: var(--tf-line);
}

.dash-alert {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5400;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
  max-width: min(90vw, 420px);
}

.dash-modal {
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--tf-modal);
  color: var(--tf-ink);
  box-shadow: var(--tf-modal-shadow);
}

.dash-modal-accent {
  height: 4px;
  background: var(--tf-gradient);
}

.dash-modal-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-hud-accent);
}

.dash-modal .modal-title {
  color: var(--tf-ink-strong);
}

.dash-input {
  border-radius: 12px;
  background: var(--tf-input);
  border-color: var(--tf-input-line);
  color: var(--tf-ink);
}

.dash-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Legacy dashboard compat */
.tf-dash-welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tf-dash-greeting {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.tf-dash-subtitle {
  color: var(--tf-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.tf-dash-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.tf-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tf-metric-card {
  background: #fff;
  border: 1px solid var(--tf-border);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  box-shadow: var(--tf-shadow-sm);
}

.tf-metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.tf-metric-icon-purple { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.tf-metric-icon-blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.tf-metric-icon-green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.tf-metric-icon-amber { background: rgba(245, 158, 11, 0.15); color: #d97706; }

.tf-metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tf-metric-label {
  color: var(--tf-text-muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.tf-dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.tf-dash-main,
.tf-dash-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    height: 100%;
}
.tf-dash-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
}

.tf-panel-dash {
  box-shadow: var(--tf-shadow-sm);
}

.tf-panel-header-tools {
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.tf-panel-header-tools > span:first-child {
  flex-shrink: 0;
}

.tf-panel-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.tf-search-wrap {
  position: relative;
  flex: 0 1 220px;
}

.tf-search-wrap i {
  position: absolute;
  inset-inline-start: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.tf-search-wrap input {
  padding-inline-start: 2rem;
  width: 220px;
  max-width: 100%;
}

.tf-status-filter {
  width: auto;
  min-width: 120px;
  flex-shrink: 0;
}

.tf-section-divider {
  padding: 0.75rem 1.25rem 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tf-text-muted);
  border-top: 1px solid var(--tf-border);
}

.tf-dash-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--tf-border);
}

.tf-dash-project-row:last-child { border-bottom: none; }

.tf-dash-project-row.is-clickable {
  cursor: pointer;
}

.tf-dash-project-row.is-clickable:hover {
  background: rgba(99, 102, 241, 0.04);
}

.tf-dash-project-row.is-archived {
  opacity: 0.75;
}

.tf-dash-project {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.1fr) minmax(120px, 1.2fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  color: inherit;
  min-width: 0;
}

.tf-dash-project-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.tf-dash-project-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.tf-dash-project-progress {
  min-width: 0;
}

.tf-progress-track {
  height: 7px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.tf-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.tf-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--tf-text-muted);
}

.tf-avatar-stack {
  display: flex;
  align-items: center;
}

.tf-avatar-stack .tf-avatar {
  margin-inline-start: -0.4rem;
  border: 2px solid #fff;
  font-size: 0.65rem;
  width: 28px;
  height: 28px;
}

.tf-avatar-stack .tf-avatar:first-child { margin-inline-start: 0; }

.tf-dash-project-meta {
  text-align: end;
  font-size: 0.8rem;
  color: var(--tf-text-muted);
  white-space: nowrap;
}

.tf-dash-project-meta .due-soon { color: #ef4444; font-weight: 600; }
.tf-dash-project-meta .due-ok { color: var(--tf-text-muted); }

.tf-dash-project-actions {
  display: flex;
  align-items: center;
  padding-inline-end: 0.85rem;
}

.tf-my-task-row {
  width: 100%;
  text-align: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
}

.tf-my-task-main {
  min-width: 0;
  flex: 1;
}

.tf-my-task-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tf-my-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--tf-text-muted);
}

.tf-my-task-side {
  text-align: end;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.tf-badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--tf-primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.tf-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--tf-border);
}

.tf-member-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.tf-member-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.tf-member-status.is-active {
  color: var(--tf-success);
}

.tf-member-status.is-active::before {
  background: var(--tf-success);
}

.tf-member-status.is-inactive {
  color: var(--tf-text-muted);
}

.tf-member-status.is-inactive::before {
  background: #94a3b8;
}

.tf-member-tasks {
  font-size: 0.85rem;
  color: var(--tf-text-muted);
  white-space: nowrap;
}

.tf-modal {
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--tf-modal);
  color: var(--tf-ink);
  box-shadow: var(--tf-modal-shadow);
}

.tf-modal .modal-header,
.tf-modal .modal-footer {
  border-color: var(--tf-line);
}

.tf-modal .modal-title {
  color: var(--tf-ink-strong);
}

.tf-modal-accent {
  height: 4px;
  background: var(--tf-gradient);
}

.tf-modal hr,
.dash-modal hr,
.boards-modal hr {
  border-color: var(--tf-line);
  opacity: 1;
}

.tf-modal h6,
.dash-modal h6,
.boards-modal h6 {
  color: var(--tf-ink-strong);
}

.tf-modal .text-muted,
.tf-modal .form-label.small,
.dash-modal .text-muted,
.dash-modal .form-label.small,
.boards-modal .text-muted,
.boards-modal .form-label.small {
  color: var(--tf-ink-soft) !important;
}

.tf-modal .form-control-color,
.dash-modal .form-control-color,
.boards-modal .form-control-color {
  min-height: 2rem;
  padding: 0.2rem;
  background: var(--tf-input);
  border-color: var(--tf-input-line);
}

.tf-modal .form-check-input {
  background-color: var(--tf-input);
  border-color: var(--tf-input-line);
}

.tf-modal .form-check-input:checked {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}

.tf-modal .form-check-label,
.dash-modal .form-check-label,
.boards-modal .form-check-label {
  color: var(--tf-ink);
}

/* Responsive */
@media (max-width: 1200px) {
  .dash-body { grid-template-columns: 1fr; }
  .dash-hero { grid-template-columns: minmax(0, 1.2fr) minmax(190px, 240px); }
  .dash-hero-clock { min-height: 160px; }
  .dash-console { grid-template-columns: 1fr 1fr; }
  .dash-readout:nth-child(1),
  .dash-readout:nth-child(2) { border-bottom: 1px solid var(--tf-line); }
  .dash-readout:nth-child(2) { border-inline-end: none; }
  .tf-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .tf-dash-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dash-console { grid-template-columns: 1fr; }
  .dash-readout { border-inline-end: none; border-bottom: 1px solid var(--tf-line); }
  .dash-readout:last-child { border-bottom: none; }
  .dash-readout-a { flex-direction: row; }
  .dash-panel-dock .dash-quick-actions { grid-template-columns: 1fr; }
  .dash-hero { padding: 1.2rem 1.1rem; border-radius: 22px; grid-template-columns: 1fr; }
  .dash-hero-clock { min-height: 140px; }
  .dash-clock-time { font-size: 1.9rem; }
  .dash-clock-ring { width: 148px; height: 148px; }
  html:not([data-theme="light"]) .dash-hero::after,
  html[data-theme="light"] .dash-hero::after {
    top: auto;
    height: 62%;
    background-size: auto 100%;
    background-position: right bottom;
  }
  html:not([data-theme="light"]) .dash-hero::before {
    background: linear-gradient(180deg, #0a1229 0%, rgba(10, 18, 41, 0.9) 46%, transparent 100%);
  }
  html[data-theme="light"] .dash-hero::before {
    background: linear-gradient(180deg, #fcfcfe 0%, rgba(252, 252, 254, 0.92) 46%, transparent 100%);
  }
}

@media (max-width: 420px) {
  .dash-readout-a { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-hero,
  .dash-console,
  .dash-project-card,
  .dash-blob,
  .dash-clock-ring,
  .dash-live-dot,
  .dash-viz-eq i {
    animation: none;
  }
}

@media (max-width: 991.98px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
  }

  .tf-sidebar {
    transform: translateX(-100%);
  }

  html[dir="rtl"] .tf-sidebar {
    transform: translateX(100%);
  }

  .tf-sidebar.open {
    transform: translateX(0);
  }

  html[dir="rtl"] .tf-sidebar.open {
    transform: translateX(0);
  }

  .tf-shell {
    margin-inline-start: 0;
  }

  .tf-panel-header-tools {
    flex-wrap: wrap;
  }

  .tf-panel-tools {
    width: 100%;
  }

  .tf-search-wrap,
  .tf-search-wrap input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .tf-dash-project {
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "icon name"
      "icon progress"
      "icon meta";
  }

  .tf-dash-project-icon { grid-area: icon; }
  .tf-dash-project-info { grid-area: name; }
  .tf-dash-project-progress { grid-area: progress; }
  .tf-dash-project-assignees { display: none; }
  .tf-dash-project-meta { grid-area: meta; text-align: start; }

  .tf-audit-head {
    flex-direction: column;
    align-items: stretch;
  }

  .tf-audit-time {
    text-align: start;
    white-space: normal;
  }

  .tf-audit-item {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 768px) {
  body.page-dashboard .dash-main-wrap { padding: 0 0.85rem 2rem; }
  .dash-cinema-body { flex-direction: column; gap: 1rem; }
  .dash-cinema-icon { width: 56px; height: 56px; font-size: 1.3rem; }
  .dash-toolbar { flex-direction: column; align-items: stretch; }
  .dash-toolbar-end { flex-direction: column; align-items: stretch; }
  .dash-search { min-width: 0; }
  .dash-project-grid { grid-template-columns: 1fr; }
  .dash-member-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .tf-app .tf-main { padding: 0.5rem 1rem 1.5rem; }
  .tf-topbar { padding: 0.75rem 1rem; }
  .tf-dash-greeting { font-size: 1.4rem; }
  .tf-metric-grid { grid-template-columns: 1fr; }
  .tf-member-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .auth-form-panel { padding: 1.5rem; }
  .auth-form-header h1 { font-size: 1.4rem; }

  .kanban-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .kanban-card-chips {
    justify-content: flex-start;
  }

  .kanban-card-inner {
    padding: 0.75rem 0.8rem 0.75rem 0.9rem;
  }
}

/* Kanban board — tablet & phone */
@media (max-width: 1199.98px) {
  .kanban-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 991.98px) {
  body.page-kanban .tf-main.container-fluid-wide {
    padding: 0.5rem 0.65rem 0.45rem;
  }

  .kanban-page {
    gap: 0.45rem;
  }

  .kanban-chrome-actions .btn {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  body.page-kanban,
  body.page-kanban .tf-shell,
  body.page-kanban .tf-main.container-fluid-wide,
  .kanban-page {
    max-width: 100%;
    min-width: 0;
  }

  body.page-kanban .tf-topbar {
    gap: 0.4rem;
    padding-inline: 0.55rem;
  }

  body.page-kanban .tf-topbar-actions {
    gap: 0.3rem;
    min-width: 0;
  }

  body.page-kanban .tf-topbar-actions .btn {
    padding: 0.3rem 0.45rem;
  }

  .kanban-chrome {
    padding: 0.45rem 0.5rem;
    gap: 0.45rem;
    max-width: 100%;
  }

  .kanban-chrome-primary {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.45rem;
  }

  .kanban-identity {
    flex: 1 1 calc(100% - 2.8rem);
  }

  .kanban-chrome-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    flex: 1 1 100%;
    margin-inline-start: 0;
    min-width: 0;
  }

  .kanban-chrome-actions > .btn,
  .kanban-chrome-actions > .kanban-sprint-filter,
  .kanban-chrome-actions > .kanban-view-tabs {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 2.4rem;
  }

  .kanban-chrome-actions > .btn {
    justify-content: center;
  }

  .kanban-view-tabs,
  #addTaskBtn,
  #manageColumnsBtn {
    grid-column: 1 / -1;
  }

  .kanban-view-tabs {
    display: flex;
    width: 100%;
  }

  .kanban-view-tabs .btn {
    flex: 1 1 0;
    justify-content: center;
    min-height: 2.25rem;
    min-width: 0;
  }

  .kanban-view-tabs .btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kanban-chrome-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    overflow: visible;
    gap: 0.4rem;
  }

  .kanban-search-wrap {
    grid-column: 1 / -1;
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .kanban-filter-select,
  .kanban-filter-overdue,
  .kanban-clear-filters {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 2.4rem;
  }

  .kanban-filter-overdue,
  .kanban-clear-filters {
    justify-content: center;
  }

  .kanban-filter-count {
    grid-column: 1 / -1;
    width: auto;
    margin-inline-start: 0;
    justify-self: start;
  }

  .kanban-board-wrap {
    margin: 0 -0.15rem;
    padding: 0 0.15rem 0.35rem;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.15rem;
  }

  .kanban-board {
    gap: 0.75rem;
  }

  .kanban-column {
    flex: 0 0 min(88%, 20rem);
    width: min(88%, 20rem);
    min-width: 0;
    max-width: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .kanban-board-wrap {
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
  }

  .modal:has(.kanban-modal) .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
  }

  .kanban-modal {
    border-radius: 0;
    height: 100%;
    min-height: 100%;
    max-height: 100dvh;
  }

  .kanban-modal .modal-body {
    padding-bottom: 1rem;
  }

  .kanban-modal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
  }

  .kanban-modal .modal-footer .btn {
    width: 100%;
    min-height: 2.6rem;
    margin: 0;
  }

  .kanban-fold > summary,
  .kanban-comment-compose .form-control,
  .kanban-card-title {
    min-width: 0;
  }

  .boards-archive-toggle {
    min-width: 0;
    gap: 0.4rem;
  }

  .boards-archive-toggle-left {
    min-width: 0;
  }

  .boards-archive-toggle-left span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tf-status-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 575.98px) {
  body.page-kanban .tf-main.container-fluid-wide {
    padding: 0.4rem 0.45rem 0.4rem;
  }

  .kanban-page {
    gap: 0.4rem;
  }

  .kanban-chrome {
    padding: 0.4rem 0.45rem;
    border-radius: 12px;
  }

  .kanban-hero-subtitle {
    display: none;
  }

  .kanban-project-icon {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .kanban-project-name {
    font-size: 0.95rem;
  }

  .modal:has(.kanban-modal) .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 100%;
  }

  .kanban-modal {
    border-radius: 0;
    height: 100%;
    min-height: 100%;
  }

  .kanban-modal .modal-header,
  .kanban-modal .modal-body,
  .kanban-modal .modal-footer {
    padding: 0.9rem 1rem;
  }

  .kanban-modal-section {
    padding: 0.8rem 0.85rem;
  }

  .kanban-modal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
  }

  .kanban-modal .modal-footer .me-auto {
    margin-inline-end: 0 !important;
  }

  .kanban-fold > summary {
    min-width: 0;
    padding-inline: 0.75rem;
  }

  .kanban-fold-title {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .kanban-fold-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kanban-fold-meta {
    flex: 0 1 38%;
    max-width: 38%;
  }

  .kanban-fold-body {
    padding-inline: 0.75rem;
  }

  .kanban-modal .form-control,
  .kanban-modal .form-select,
  .kanban-search-wrap input,
  .kanban-filter-select {
    font-size: 16px;
  }

  .kanban-discussion-tabs {
    flex-wrap: wrap;
  }

  .kanban-discussion-tab {
    flex: 1 1 auto;
    justify-content: center;
  }

  .kanban-modal-danger {
    display: grid;
    grid-template-columns: 1fr;
  }

  .kanban-modal-danger .btn {
    width: 100%;
  }

  .kanban-comment-compose {
    align-items: stretch;
  }

  .kanban-checklist-add,
  .kanban-checklist .input-group {
    width: 100%;
  }

  .tf-tenant-badge {
    display: none !important;
  }

  body.page-kanban .tf-topbar {
    padding: 0.6rem 0.7rem;
    gap: 0.5rem;
  }

  body.page-kanban .tf-topbar-actions {
    gap: 0.35rem;
  }

  body.page-kanban .tf-topbar-code {
    display: none;
  }
}

@media (max-width: 360px) {
  .kanban-view-tabs .btn i {
    display: none;
  }
}

/* â”€â”€ Project boards hub (premium) â”€â”€ */
body.page-boards {
  background:
    radial-gradient(1000px 480px at 12% -10%, var(--tf-glow-a), transparent 52%),
    radial-gradient(800px 420px at 110% 8%, var(--tf-glow-b), transparent 48%),
    var(--tf-canvas);
}

body.page-boards .boards-main-wrap {
  padding: 0 1.5rem 2.5rem;
  max-width: 1280px;
}

.boards-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: calc(100vh - 96px);
  padding-top: 0.35rem;
}

.boards-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.boards-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: authBlobFloat 14s ease-in-out infinite;
}

.boards-blob-1 {
  width: 480px;
  height: 480px;
  background: #6366f1;
  top: -8%;
  right: 5%;
}

.boards-blob-2 {
  width: 360px;
  height: 360px;
  background: #06b6d4;
  bottom: 5%;
  left: -5%;
  animation-delay: -5s;
}

.boards-blob-3 {
  width: 280px;
  height: 280px;
  background: #8b5cf6;
  top: 35%;
  left: 35%;
  animation-delay: -9s;
  opacity: 0.22;
}

.boards-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
}

.boards-page > *:not(.boards-bg) {
  position: relative;
  z-index: 1;
}

/* Cinema header — compact so board grid stays the focus */
.boards-cinema {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
}

.boards-crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tf-ink-soft);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
  backdrop-filter: blur(8px);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.boards-crumb:hover {
  color: var(--tf-hud-accent);
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--tf-fill-hover);
}

.boards-cinema-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  margin-inline-start: auto;
  align-self: center;
  padding-top: 0;
}

.boards-cinema-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-height: 2.35rem;
  padding-inline: 0.95rem;
  font-weight: 600;
  border-radius: 11px;
}

.boards-btn-glow {
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.boards-btn-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.42);
}

.boards-cinema-body {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.boards-cinema-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--tf-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow:
    0 8px 22px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  letter-spacing: -0.02em;
}

.boards-cinema-icon.has-initials {
  font-size: 1.15rem;
}

.boards-cinema-text {
  min-width: 0;
  flex: 1;
}

.boards-cinema-label {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-hud-accent);
}

.boards-cinema-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--tf-ink-strong);
}

.boards-cinema-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tf-text-muted);
  max-width: 36rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.boards-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.boards-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
  backdrop-filter: blur(10px);
  color: var(--tf-ink);
}

.boards-pill i {
  font-size: 0.85rem;
  opacity: 0.85;
}

.boards-pill-purple i { color: #6366f1; }
.boards-pill-blue i { color: #0ea5e9; }
.boards-pill-amber i { color: #f59e0b; }
.boards-pill-green i { color: #10b981; }

/* Workspace — board grid is the hero; filters stay quiet */
.boards-workspace {
  background: var(--tf-panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  box-shadow: var(--tf-shadow-lg);
  padding: 1rem 1.15rem 1.25rem;
  color: var(--tf-ink);
  flex: 1;
}

.boards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--tf-line);
}

.boards-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--tf-ink-strong);
}

.boards-section-title i {
  color: var(--tf-hud-accent);
  font-size: 1rem;
}

.boards-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
}

.boards-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.boards-search {
  position: relative;
  width: 200px;
  max-width: 100%;
}

.boards-search i {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.boards-search input {
  width: 100%;
  min-height: 2.15rem;
  padding-block: 0.4rem;
  padding-inline-start: 2.05rem;
  padding-inline-end: 0.7rem;
  border: 1px solid var(--tf-input-line);
  border-radius: 10px;
  font-size: 0.8125rem;
  background: var(--tf-input);
  color: var(--tf-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.boards-search input::placeholder {
  color: var(--tf-ink-soft);
}

.boards-search input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.boards-sort {
  min-height: 2.15rem;
  padding-block: 0.4rem;
  padding-inline-start: 0.7rem;
  padding-inline-end: 1.75rem;
  border: 1px solid var(--tf-input-line);
  border-radius: 10px;
  font-size: 0.8125rem;
  background: var(--tf-input);
  color: var(--tf-ink);
  cursor: pointer;
  max-width: 11.5rem;
}

.boards-sort:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Mosaic grid — larger cards, fewer columns */
.boards-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 1100px) {
  .boards-mosaic {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Board tile — preview + info footer */
.boards-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--tf-line);
  padding: 0;
  text-align: start;
  background: var(--tf-bg-elevated);
  box-shadow: var(--tf-shadow-card);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  animation: boardsTileIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--tile-delay, 0ms);
}

@keyframes boardsTileIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.boards-tile:hover,
.boards-tile:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--tf-shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.35);
  outline: none;
}

.boards-tile-visual {
  position: relative;
  aspect-ratio: 16 / 11;
  min-height: 148px;
  flex-shrink: 0;
  overflow: hidden;
}

.boards-tile-bg {
  position: absolute;
  inset: 0;
  background: var(--tile-gradient);
}

.boards-tile-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.18) 100%);
}

.boards-tile-preview {
  position: absolute;
  inset: 0.85rem 0.85rem 0;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.boards-tile-col {
  flex: 1;
  min-width: 0;
  max-height: 100%;
  background: rgba(15, 23, 42, 0.22);
  border-radius: 10px 10px 0 0;
  padding: 0.55rem 0.45rem 0;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}

.boards-tile-col-head {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  width: 68%;
  margin-bottom: 0.05rem;
  flex-shrink: 0;
}

.boards-tile-col-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  overflow: hidden;
}

.boards-tile-mini-card {
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
  flex-shrink: 0;
}

.boards-tile-mini-card.tall {
  height: 36px;
}

.boards-tile-mini-card.accent {
  border-inline-start: 4px solid rgba(255, 255, 255, 0.95);
}

.boards-tile-info {
  padding: 1rem 1.1rem 1.1rem;
  background: var(--tf-bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.boards-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.boards-tile-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tf-ink-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.boards-tile-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--tf-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.boards-tile-menu {
  flex-shrink: 0;
}

.boards-tile-menu-btn {
  color: var(--tf-text-muted) !important;
  padding: 0.2rem 0.35rem !important;
  line-height: 1;
  border-radius: 8px !important;
  opacity: 1;
}

.boards-tile-menu-btn:hover {
  color: var(--tf-ink-strong) !important;
  background: var(--tf-fill-hover) !important;
}

.boards-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tf-text-muted);
}

.boards-tile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}

.boards-tile-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--tf-ink-soft);
}

.boards-tile-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tf-ink-soft);
}

.boards-tile-open {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 700;
  color: var(--tf-hud-accent);
  transition: transform 0.18s, gap 0.18s;
}

.boards-tile:hover .boards-tile-open,
.boards-tile:focus-visible .boards-tile-open {
  gap: 0.4rem;
}

.boards-tile-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--tf-line);
  overflow: hidden;
}

.boards-tile-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #10b981);
  transition: width 0.35s ease;
}

/* Create tile */
.boards-tile-create {
  min-height: 18rem;
  border-radius: 18px;
  border: 2px dashed rgba(99, 102, 241, 0.38);
  background: color-mix(in srgb, var(--tf-fill-2) 80%, transparent);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  cursor: pointer;
  color: var(--tf-hud-accent);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  animation: boardsTileIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--tile-delay, 0ms);
}

.boards-tile-create:hover {
  border-color: var(--tf-primary);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-4px);
}

.boards-tile-create-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.2s;
}

.boards-tile-create:hover .boards-tile-create-icon {
  transform: scale(1.08) rotate(90deg);
}

.boards-tile-create-label {
  max-width: 12rem;
  text-align: center;
  line-height: 1.35;
}

/* Empty state */
.boards-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.06), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.boards-empty-visual {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  perspective: 600px;
}

.boards-empty-col {
  width: 72px;
  padding: 0.5rem;
  border-radius: 10px;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
  box-shadow: var(--tf-shadow-sm);
  transform: rotateY(-8deg);
}

.boards-empty-col:nth-child(2) {
  transform: rotateY(0deg) translateY(-8px);
}

.boards-empty-col:nth-child(3) {
  transform: rotateY(8deg);
}

.boards-empty-col span {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--tf-line);
  margin-bottom: 0.35rem;
}

.boards-empty-col span:first-child {
  width: 60%;
  background: var(--tf-ink-soft);
  opacity: 0.45;
  margin-bottom: 0.5rem;
}

.boards-empty h3 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--tf-ink-strong);
}

.boards-empty p {
  max-width: 24rem;
  margin: 0 auto 1.25rem;
  color: var(--tf-text-muted);
}

.boards-empty-cta {
  padding: 0.55rem 1.25rem;
}

.boards-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--tf-text-muted);
  font-size: 0.95rem;
}

.boards-no-results i {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.65rem;
  opacity: 0.5;
}

/* Archive zone */
.boards-archive-zone {
  background: var(--tf-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--tf-ink);
}

.boards-archive-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tf-text-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.boards-archive-toggle:hover {
  background: var(--tf-hover-row);
}

.boards-archive-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.boards-archive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.15);
  color: var(--tf-text-muted);
}

.boards-archive-chevron {
  transition: transform 0.2s ease;
}

.boards-archive-toggle[aria-expanded="true"] .boards-archive-chevron {
  transform: rotate(180deg);
}

.boards-archive-panel {
  border-top: 1px solid var(--tf-border);
  padding: 0.5rem;
}

.boards-archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.boards-archived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: var(--tf-ink);
  transition: background 0.12s;
}

.boards-archived-row:hover {
  background: var(--tf-hover-row);
}

.boards-archived-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 9px;
}

.boards-archived-row strong {
  color: var(--tf-ink-strong);
}

.boards-archived-desc {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--tf-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

/* Modal */
.boards-modal-dialog {
  max-width: 440px;
}

.modal-content.boards-modal {
  --bs-modal-bg: var(--tf-bg-elevated);
  --bs-modal-color: var(--tf-ink);
  --bs-modal-border-color: var(--tf-line);
  --bs-modal-border-radius: 20px;
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--tf-bg-elevated);
  color: var(--tf-ink);
  box-shadow: var(--tf-modal-shadow);
}

.boards-modal-accent {
  height: 4px;
  background: var(--tf-gradient);
}

.boards-modal-header,
.boards-modal-footer {
  border: 0;
  padding: 1.15rem 1.25rem 0.35rem;
  background: transparent;
}

.boards-modal-footer {
  padding: 0.85rem 1.25rem 1.2rem;
  gap: 0.55rem;
}

.boards-modal-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.boards-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 14px;
  background: var(--tf-gradient);
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.28);
}

.boards-modal.is-edit .boards-modal-icon {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
}

.boards-modal .modal-title {
  color: var(--tf-ink-strong);
  font-weight: 700;
  font-size: 1.15rem;
}

.boards-modal-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-hud-accent);
}

.boards-modal-body {
  padding: 1rem 1.25rem 0.4rem;
}

.boards-field {
  margin-bottom: 1rem;
}

.boards-field .form-label {
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--tf-ink-strong);
}

.boards-field-control {
  position: relative;
}

.boards-field-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-ink-soft);
  pointer-events: none;
  font-size: 1rem;
}

.boards-field-control-area .boards-field-icon {
  top: 0.85rem;
  transform: none;
}

.boards-input {
  border-radius: 12px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input) !important;
  color: var(--tf-ink) !important;
  padding-block: 0.7rem;
  padding-inline-start: 2.45rem;
  padding-inline-end: 0.9rem;
  box-shadow: none;
}

.boards-field-control-area .boards-input {
  min-height: 6.5rem;
  resize: vertical;
}

.boards-input::placeholder {
  color: var(--tf-ink-soft);
}

.boards-input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
  background: var(--tf-input) !important;
  color: var(--tf-ink) !important;
}

.boards-field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--tf-ink-soft);
  line-height: 1.4;
}

.boards-modal-footer .btn {
  border-radius: 11px;
  font-weight: 600;
  min-height: 2.45rem;
  padding-inline: 1rem;
}

.boards-modal-footer .boards-btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.boards-alert {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5400;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
  max-width: min(90vw, 420px);
}

@media (max-width: 992px) {
  .boards-cinema-body {
    flex-wrap: wrap;
  }

  .boards-cinema-actions {
    width: 100%;
    margin-inline-start: 0;
    padding-top: 0;
    justify-content: flex-end;
  }

  .boards-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body.page-boards .boards-main-wrap {
    padding: 0 0.85rem 2rem;
  }

  .boards-cinema-body {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .boards-cinema-icon {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
    border-radius: 12px;
  }

  .boards-cinema-text {
    flex: 1 1 calc(100% - 4rem);
  }

  .boards-cinema-actions {
    width: 100%;
    margin-inline-start: 0;
    padding-top: 0;
    justify-content: space-between;
  }

  .boards-cinema-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .boards-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .boards-toolbar-end {
    flex-direction: row;
    align-items: stretch;
  }

  .boards-search {
    flex: 1;
    width: auto;
  }

  .boards-sort {
    max-width: none;
    flex: 0 0 auto;
  }

  .boards-mosaic {
    grid-template-columns: 1fr;
  }

  .boards-tile-create {
    min-height: 11rem;
  }

  .boards-archived-row {
    flex-direction: column;
    align-items: stretch;
  }

  .boards-archived-actions {
    justify-content: flex-end;
  }
}

/* Task modal checklists & attachments */
.kanban-checklist {
  border: 1px solid var(--tf-line);
  background: var(--tf-fill-2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--tf-ink);
}

.kanban-checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kanban-checklist-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.kanban-checklist-title-input,
.kanban-checklist-item-input {
  flex: 1;
  min-width: 0;
}

.kanban-checklist-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.kanban-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.kanban-checklist-item-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.kanban-checklist-item.is-done .kanban-checklist-item-text {
  text-decoration: line-through;
  opacity: 0.65;
}

.kanban-checklist-edit-btn {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-ink-soft);
  opacity: 0.45;
  text-decoration: none;
}

.kanban-checklist-edit-btn:hover {
  opacity: 1;
  color: var(--tf-hud-accent);
}

.kanban-checklist-item:hover .kanban-checklist-edit-btn,
.kanban-checklist-header:hover .kanban-checklist-edit-btn {
  opacity: 1;
}

.kanban-attachment-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0;
  font-size: 0.9rem;
}

/* Workspace chat */
.tf-nav-badge {
  margin-inline-start: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
}

body.page-chat {
  background:
    radial-gradient(1000px 480px at 12% -10%, var(--tf-glow-a), transparent 52%),
    radial-gradient(800px 420px at 110% 8%, var(--tf-glow-b), transparent 48%),
    var(--tf-canvas);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

html:has(body.page-chat) {
  height: 100%;
  overflow: hidden;
}

body.page-chat .tf-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.page-chat .tf-topbar {
  position: relative;
  flex: 0 0 auto;
}

body.page-chat .tf-app .tf-main.tf-chat-main {
  flex: 1 1 auto;
  min-height: calc(100dvh - 4.75rem);
  height: calc(100dvh - 4.75rem);
  max-height: calc(100dvh - 4.75rem);
  overflow: hidden;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
}

.tf-chat-page {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tf-chat-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.tf-chat-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.38;
}

.tf-chat-blob-1 {
  width: 380px;
  height: 380px;
  background: #6366f1;
  top: -18%;
  inset-inline-end: 4%;
}

.tf-chat-blob-2 {
  width: 280px;
  height: 280px;
  background: #06b6d4;
  bottom: -12%;
  inset-inline-start: 18%;
}

.tf-chat-shell {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--tf-panel);
  border: 1px solid var(--tf-line);
  border-radius: 24px;
  box-shadow: var(--tf-shadow-lg);
  overflow: hidden;
  color: var(--tf-ink);
}

.tf-chat-list,
.tf-chat-thread {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tf-chat-list {
  background: var(--tf-chat-list);
  border-inline-end: 1px solid var(--tf-line);
}

.tf-chat-list-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--tf-line);
}

.tf-chat-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--tf-gradient);
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.36);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.tf-chat-code {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--tf-hud);
}

.tf-chat-list-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--tf-ink-strong);
}

.tf-chat-list-header p {
  margin: 0.1rem 0 0;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.78rem;
}

.tf-chat-search {
  position: relative;
  margin: 0.85rem 0.95rem 0.7rem;
}

.tf-chat-search i {
  position: absolute;
  inset-inline-start: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.85rem;
}

.tf-chat-search input {
  width: 100%;
  border: 1px solid var(--tf-input-line);
  border-radius: 999px;
  background: var(--tf-input);
  color: var(--tf-ink);
  padding-block: 0.52rem;
  padding-inline: 2.1rem 0.9rem;
  font-size: 0.82rem;
  outline: none;
}

.tf-chat-search input::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.tf-chat-search input:focus {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.tf-chat-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 0.7rem 0.9rem;
}

.tf-chat-section-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
  padding: 0.85rem 0.55rem 0.4rem;
}

.tf-chat-section-label span:first-child {
  color: var(--tf-hud-accent);
}

.tf-chat-section-label i {
  font-size: 0.78rem;
}

.tf-chat-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 0.48rem 0.55rem;
  text-align: start;
  color: inherit;
  margin-bottom: 0.12rem;
  cursor: pointer;
}

.tf-chat-item:hover {
  background: rgba(129, 140, 248, 0.1);
}

.tf-chat-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(6, 182, 212, 0.1));
  box-shadow: inset 3px 0 0 #818cf8;
}

html[dir="rtl"] .tf-chat-item.active {
  box-shadow: inset -3px 0 0 #818cf8;
}

.tf-chat-item.unread .tf-chat-item-title {
  font-weight: 700;
  color: var(--tf-ink-strong);
}

.tf-chat-item-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.tf-chat-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.tf-chat-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--tf-ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-chat-item-time {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.9);
  flex-shrink: 0;
}

.tf-chat-item-preview {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-chat-unread {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.tf-chat-list-empty {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem 0.55rem;
}

.tf-chat-hash {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-chip-bg);
  color: var(--tf-chip-ink);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tf-chat-hash-lg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.15rem;
}

.tf-chat-thread {
  position: relative;
  background: var(--tf-chat-thread);
}

.tf-chat-empty {
  margin: auto;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 380px;
  color: rgba(148, 163, 184, 0.95);
}

.tf-chat-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--tf-gradient);
  color: #fff;
  font-size: 1.7rem;
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.36);
}

.tf-chat-empty h2 {
  color: var(--tf-ink-strong);
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.tf-chat-thread-inner {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tf-chat-thread-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--tf-thread-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tf-line);
  flex-shrink: 0;
}

.tf-chat-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input);
  color: var(--tf-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[dir="rtl"] .tf-chat-back i {
  transform: scaleX(-1);
}

.tf-chat-thread-title {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--tf-ink-strong);
}

.tf-chat-thread-sub {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.95);
}

.tf-chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.tf-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.tf-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

/* Pushes messages to the bottom when the thread is short; collapses when scrolling */
.tf-chat-scroll-anchor {
  flex: 1 1 auto;
  min-height: 0;
  pointer-events: none;
}

.tf-chat-day,
.tf-chat-msg,
.tf-chat-empty-thread,
.tf-chat-loading {
  flex-shrink: 0;
}

.tf-chat-day {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 1.25rem;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.72rem;
  font-weight: 700;
}

.tf-chat-day::before,
.tf-chat-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tf-line);
}

.tf-chat-day span {
  padding: 0.12rem 0.2rem;
}

.tf-chat-msg {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  max-width: min(88%, 420px);
  padding: 0.22rem 0.65rem;
}

.tf-chat-msg.mine {
  margin-inline-start: auto;
  flex-direction: row-reverse;
}

.tf-chat-msg.grouped {
  padding-top: 0;
  padding-bottom: 0.15rem;
}

.tf-chat-msg-gutter {
  width: 32px;
  flex-shrink: 0;
}

.tf-chat-msg-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tf-chat-msg.mine .tf-chat-msg-body {
  align-items: flex-end;
}

.tf-chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
  padding-inline: 0.2rem;
}

.tf-chat-msg.mine .tf-chat-msg-meta {
  flex-direction: row-reverse;
}

.tf-chat-msg-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tf-ink-strong);
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.tf-chat-avatar-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.tf-chat-msg.mine .tf-chat-msg-name {
  color: var(--tf-chip-ink);
}

.tf-chat-msg-time {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tf-chat-seen {
  display: inline-flex;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.7;
}

.tf-chat-seen.is-seen {
  color: #67e8f9;
  opacity: 1;
}

.tf-chat-msg.mine .tf-chat-seen:not(.is-seen) {
  color: rgba(255, 255, 255, 0.75);
}

.tf-chat-quote {
  display: block;
  width: 100%;
  text-align: start;
  border: 0;
  border-inline-start: 3px solid rgba(165, 180, 252, 0.85);
  background: rgba(15, 23, 42, 0.18);
  color: inherit;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0;
  cursor: pointer;
}

.tf-chat-msg.mine .tf-chat-quote {
  background: rgba(255, 255, 255, 0.14);
  border-inline-start-color: rgba(255, 255, 255, 0.75);
}

.tf-chat-quote strong {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.1rem;
}

.tf-chat-quote span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18rem;
}

.tf-chat-forwarded {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
  padding: 0.15rem 0.35rem 0;
  margin: 0;
}

.tf-chat-bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 0.4rem;
  background: var(--tf-bubble);
  border: 1px solid var(--tf-line);
  border-radius: 16px 16px 16px 5px;
  box-shadow: var(--tf-shadow-sm);
}

.tf-chat-bubble-media {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tf-chat-bubble-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  padding: 0 0.3rem 0.05rem;
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0.78;
}

.tf-chat-pin-flag {
  position: absolute;
  top: 0.35rem;
  inset-inline-end: 0.45rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

.tf-chat-msg.is-highlight .tf-chat-bubble {
  box-shadow: 0 0 0 2px rgba(165, 180, 252, 0.65), var(--tf-shadow-sm);
}

.tf-chat-pinned {
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--tf-line);
  background: color-mix(in srgb, var(--tf-fill-2) 88%, transparent);
  flex-shrink: 0;
}

.tf-chat-pinbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--tf-ink);
  text-align: start;
  cursor: pointer;
}

.tf-chat-pinbar:hover { background: var(--tf-fill-hover); }

.tf-chat-pinbar > .bi {
  color: var(--tf-hud-accent);
  flex-shrink: 0;
  font-size: 1rem;
}

.tf-chat-pinbar-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.tf-chat-pinbar-copy strong,
.tf-chat-pinbar-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-chat-pinbar-copy strong {
  font-size: 0.78rem;
  color: var(--tf-hud-accent);
}

.tf-chat-pinbar-copy span {
  font-size: 0.8rem;
  color: var(--tf-ink-soft);
}

.tf-chat-pinbar-marks {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 2px;
  width: 3px;
  height: 28px;
  flex-shrink: 0;
}

.tf-chat-pinbar-marks i {
  display: block;
  flex: 1 1 0;
  min-height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--tf-hud-accent) 28%, transparent);
}

.tf-chat-pinbar-marks i.is-on {
  background: var(--tf-hud-accent);
}

.tf-chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 1.1rem 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--tf-line);
  background: var(--tf-fill-2);
  border-inline-start: 3px solid var(--tf-hud-accent);
}

.tf-chat-reply-bar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tf-chat-reply-bar-copy strong {
  font-size: 0.72rem;
  color: var(--tf-hud-accent);
}

.tf-chat-reply-bar-copy span {
  font-size: 0.8rem;
  color: var(--tf-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-chat-reply-cancel {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--tf-line);
  background: transparent;
  color: var(--tf-ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tf-chat-avatar-wrap,
.tf-avatar.is-online,
.tf-chat-avatar-wrap.is-online {
  position: relative;
}

.tf-chat-avatar-wrap.is-online::after,
.tf-avatar.is-online::after {
  content: "";
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--tf-bg-elevated);
  inset-inline-end: -1px;
  bottom: -1px;
}

.tf-chat-msg.mine .tf-chat-bubble {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.7);
}

html[dir="rtl"] .tf-chat-bubble {
  border-radius: 16px 16px 5px 16px;
}

html[dir="rtl"] .tf-chat-msg.mine .tf-chat-bubble {
  border-radius: 16px 16px 16px 5px;
}

.tf-chat-msg-text {
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  padding: 0.2rem 0.45rem 0.05rem;
  color: inherit;
}

.tf-chat-msg:not(.mine) .tf-chat-msg-text {
  color: var(--tf-bubble-ink);
}

body.lang-fa .tf-chat-msg-text,
body.lang-fa .tf-chat-item-preview {
  font-family: 'Vazirmatn', 'Inter', sans-serif;
}

.tf-chat-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tf-chat-msg.mine .tf-chat-msg-actions {
  justify-content: flex-end;
}

.tf-chat-task-chip { margin-top: 0.3rem; }

.tf-chat-task-chip,
.tf-chat-msg-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--tf-line);
  background: var(--tf-fill-2);
  color: var(--tf-ink);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.tf-chat-msg-action {
  opacity: 0;
  cursor: pointer;
}

.tf-chat-msg:hover .tf-chat-msg-action,
.tf-chat-msg:focus-within .tf-chat-msg-action {
  opacity: 1;
}

.tf-chat-task-chip:hover,
.tf-chat-msg-action:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--tf-primary-dark);
}

.tf-chat-msg.is-highlight .tf-chat-bubble {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
}

.tf-chat-task-preview {
  font-size: 0.85rem;
  color: var(--tf-ink-soft);
  background: var(--tf-fill);
  border: 1px dashed var(--tf-line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  max-height: 5.5rem;
  overflow: hidden;
  white-space: pre-wrap;
}

.kanban-chat-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tf-hud-accent);
  text-decoration: none;
}

.kanban-chat-link:hover {
  text-decoration: underline;
}

.tf-chat-empty-thread,
.tf-chat-loading {
  margin: auto;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.9rem;
  padding: 3rem 1rem;
  text-align: center;
}

.tf-chat-composer {
  padding: 0.7rem 1.1rem 0.95rem;
  background: var(--tf-composer-fade);
  flex-shrink: 0;
}

.tf-chat-composer-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-height: 3.15rem;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input);
  border-radius: 16px;
  padding: 0.45rem 0.45rem 0.45rem 0.9rem;
  box-shadow: var(--tf-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tf-chat-composer-box:focus-within {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16), 0 10px 30px -18px rgba(2, 6, 23, 0.55);
}

html[dir="rtl"] .tf-chat-composer-box {
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
}

.tf-chat-round {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tf-ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.tf-chat-round:hover,
.tf-chat-round.is-danger { color: #f43f5e; }

.tf-chat-attach-menu {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 8px);
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  min-width: 9.5rem;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--tf-line);
  background: var(--tf-bg-elevated);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.28);
}

.tf-chat-attach-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tf-ink);
  font: inherit;
  font-size: 0.86rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.tf-chat-attach-menu button:hover { background: var(--tf-fill-hover); }

.tf-chat-record {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.15rem;
  padding: 0.35rem 0.4rem 0.35rem 0.55rem;
  border-radius: 16px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input);
}

.tf-chat-record-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tf-chat-record-hint {
  flex: 1;
  min-width: 0;
  color: var(--tf-ink-soft);
  font-size: 0.82rem;
}

.tf-chat-record .tf-chat-send { margin-inline-start: auto; }

.tf-chat-link-bar,
.tf-chat-voice-state {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.tf-chat-link-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tf-ink);
  font: inherit;
}

.tf-chat-voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f43f5e;
}

#chatVoiceBtn.is-recording { color: #f43f5e; }

.nx-msg-head.is-person .nx-msg-head-copy,
.nx-msg-head.is-person #chatThreadAvatar { cursor: pointer; }

.tf-chat-msg-body { max-width: calc(100% - 2.6rem); }

.tf-chat-bubble .tf-chat-photo,
.tf-chat-bubble .tf-voice,
.tf-chat-bubble .tf-filechip {
  width: min(240px, 100%);
}

.tf-chat-photo,
.nx-peer-photo {
  display: block;
  width: min(220px, 100%);
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tf-fill);
  cursor: pointer;
}

.tf-chat-photo img,
.nx-peer-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

.nx-peer-photo { width: 100%; aspect-ratio: 1; }
.nx-peer-photo img { height: 100%; max-height: none; }

.tf-voice,
.tf-filechip,
.nx-peer-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(230px, 100%);
  max-width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.tf-voice-play {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--tf-hud-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tf-voice-track {
  flex: 1;
  min-width: 0;
  height: 18px;
  display: flex;
  align-items: center;
}

.tf-voice-bars {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 2px,
    transparent 2px 5px
  );
  opacity: 0.55;
}

.tf-voice.is-playing .tf-voice-bars { opacity: 1; }

.tf-voice-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.tf-filechip > i {
  font-size: 1.25rem;
  color: var(--tf-hud-accent);
  flex-shrink: 0;
}

.tf-filechip-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tf-filechip-copy strong,
.tf-filechip-copy small,
.nx-peer-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-filechip-copy small {
  color: var(--tf-ink-soft);
  font-size: 0.72rem;
}

.tf-chat-link { color: inherit; }

.tf-chat-composer textarea {
  flex: 1 1 8rem;
  min-width: 0;
  resize: none;
  min-height: 40px;
  max-height: 140px;
  border: 0;
  padding: 0.45rem 0;
  font-size: 0.94rem;
  outline: none;
  background: transparent;
  color: var(--tf-ink);
  line-height: 1.45;
  font-family: inherit;
}

.tf-chat-composer textarea::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.tf-chat-send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--tf-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.36);
}

.tf-chat-send:hover {
  filter: brightness(1.05);
}

.tf-chat-send:disabled {
  opacity: 0.55;
}

.tf-chat-composer-hint {
  margin-top: 0.4rem;
  padding-inline: 0.35rem;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.9);
}


@media (max-width: 991.98px) {
  .tf-chat-shell {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .tf-chat-page:not(.show-thread) .tf-chat-thread {
    display: none;
  }

  .tf-chat-page.show-thread .tf-chat-list {
    display: none;
  }

  body.page-chat .tf-app .tf-main.tf-chat-main {
    padding: 0 0.6rem 0.6rem;
    min-height: calc(100dvh - 4.25rem);
    height: calc(100dvh - 4.25rem);
    max-height: calc(100dvh - 4.25rem);
  }
}

/* Inbox + notification bell */
.tf-notify {
  position: relative;
}

.tf-notify-bell {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tf-input-line);
  border-radius: 12px;
  background: var(--tf-fill);
  color: var(--tf-ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tf-notify-bell:hover,
.tf-notify-bell.has-unread {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
  border-color: color-mix(in srgb, var(--tf-primary-light) 45%, transparent);
}

.tf-notify-bell .tf-nav-badge {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.35rem;
  margin: 0;
  min-width: 1.1rem;
  height: 1.1rem;
  font-size: 0.62rem;
}

.tf-notify-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  inset-inline-end: 0;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--tf-surface, var(--tf-chrome-top));
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
  z-index: 1080;
  overflow: hidden;
}

.tf-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--tf-line);
}

.tf-notify-head strong {
  font-size: 0.92rem;
}

.tf-notify-list {
  overflow: auto;
  max-height: 340px;
}

.tf-notify-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--tf-ink-soft);
  font-size: 0.88rem;
}

.tf-notify-item {
  width: 100%;
  display: flex;
  gap: 0.7rem;
  text-align: start;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--tf-line) 70%, transparent);
  cursor: pointer;
}

.tf-notify-item:hover {
  background: var(--tf-fill-hover);
}

.tf-notify-item.is-unread {
  background: color-mix(in srgb, var(--tf-primary-light, #6366f1) 10%, transparent);
}

.tf-notify-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: transparent;
  flex-shrink: 0;
}

.tf-notify-item.is-unread .tf-notify-dot {
  background: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.tf-notify-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tf-notify-text {
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--tf-ink-strong);
}

.tf-notify-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--tf-ink-soft);
}

.tf-notify-foot {
  display: block;
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--tf-hud-accent, #818cf8);
  text-decoration: none;
  border-top: 1px solid var(--tf-line);
}

.tf-notify-foot:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

body.page-inbox .tf-main.dash-main-wrap {
  position: relative;
}

.inbox-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-bottom: 2rem;
}

.inbox-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.25rem 0.15rem 0.5rem;
}

.inbox-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tf-hud);
}

.inbox-hero h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.85rem;
  letter-spacing: -0.04em;
  color: var(--tf-ink-strong);
}

.inbox-hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--tf-ink-soft);
}

.inbox-notify {
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--tf-fill) 80%, transparent);
  overflow: hidden;
}

.inbox-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--tf-line);
}

.inbox-notify-head h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
}

.inbox-notify-list {
  max-height: 280px;
}

.inbox-metrics {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.inbox-metric {
  min-width: 5.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
}

.inbox-metric-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.inbox-metric-label {
  font-size: 0.72rem;
  color: var(--tf-ink-soft);
  font-weight: 650;
}

.inbox-metric.is-overdue .inbox-metric-value { color: #fb7185; }
.inbox-metric.is-today .inbox-metric-value { color: #fbbf24; }

.inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--tf-fill) 80%, transparent);
}

.inbox-search-wrap {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
}

.inbox-search-wrap i {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tf-ink-soft);
  pointer-events: none;
}

.inbox-search-wrap input {
  padding-inline-start: 2rem;
}

.inbox-toolbar .form-select {
  width: auto;
  min-width: 9rem;
}

.inbox-completed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--tf-ink-soft);
  margin: 0;
}

.inbox-filter-count {
  margin-inline-start: auto;
  font-size: 0.78rem;
  color: var(--tf-ink-soft);
}

.inbox-viewer-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: var(--tf-ink);
  font-size: 0.85rem;
}

.inbox-empty {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--tf-line);
  border-radius: 18px;
  color: var(--tf-ink-soft);
}

.inbox-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}

.inbox-sections {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.inbox-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.inbox-section-head h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
}

.inbox-section-count {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--tf-fill);
  border: 1px solid var(--tf-line);
}

.inbox-section-overdue .inbox-section-head { color: #fb7185; }
.inbox-section-today .inbox-section-head { color: #fbbf24; }

.inbox-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--tf-surface, var(--tf-fill)) 88%, transparent);
}

.inbox-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem 0.8rem 1.05rem;
  border-bottom: 1px solid color-mix(in srgb, var(--tf-line) 80%, transparent);
}

.inbox-row:last-child { border-bottom: 0; }

.inbox-row-accent {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--kanban-priority-color, #3b82f6);
}

.inbox-row-main {
  min-width: 0;
  flex: 1 1 auto;
}

.inbox-row-title {
  display: block;
  color: var(--tf-ink-strong);
  font-weight: 650;
  text-decoration: none;
  margin-bottom: 0.2rem;
}

.inbox-row-title:hover { color: var(--tf-hud-accent, #818cf8); }

.inbox-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-size: 0.75rem;
  color: var(--tf-ink-soft);
}

.inbox-priority { font-weight: 650; }

.inbox-label {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--label-color);
  background: color-mix(in srgb, var(--label-color) 16%, transparent);
}

html:not([data-theme="light"]) .inbox-label {
  color: color-mix(in srgb, var(--label-color) 38%, #f1f5f9);
  background: color-mix(in srgb, var(--label-color) 28%, transparent);
}

.inbox-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.inbox-row-actions .inbox-due {
  width: 8.4rem;
}

.inbox-row-actions .inbox-status {
  width: 8.8rem;
}

.inbox-row.is-overdue {
  background: color-mix(in srgb, #f43f5e 8%, transparent);
}

.inbox-row.is-today {
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}

@media (max-width: 767.98px) {
  .inbox-row {
    flex-direction: column;
    align-items: stretch;
  }

  .inbox-row-actions {
    flex-wrap: wrap;
  }

  .inbox-row-actions .inbox-due,
  .inbox-row-actions .inbox-status {
    flex: 1 1 8rem;
    width: auto;
  }

  .tf-notify-panel {
    position: fixed;
    inset-inline: 0.7rem auto;
    width: calc(100vw - 1.4rem);
    top: 4.2rem;
  }
}

.kanban-sprint-filter {
  min-width: 11rem;
  max-width: 16rem;
}

@media (max-width: 768px) {
  .kanban-chrome-actions .kanban-sprint-filter {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

.kanban-card-type,
.kanban-card-parent {
  font-size: 0.72rem;
  color: var(--tf-text-muted);
}

.kanban-card-parent {
  margin-bottom: 0.2rem;
}

.kanban-card-chip.kanban-card-points {
  color: var(--tf-primary-light);
}

.scrum-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 2rem;
}

.scrum-hero-row,
.scrum-panel-head,
.scrum-sprint-top,
.scrum-sprint-stats,
.scrum-sprint-actions,
.scrum-item,
.scrum-create {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.scrum-hero-row,
.scrum-panel-head,
.scrum-sprint-top {
  justify-content: space-between;
}

.scrum-kicker,
.scrum-sub,
.scrum-sprint-meta,
.scrum-item-parent,
.scrum-sprint-goal {
  color: var(--tf-text-muted);
}

.scrum-kicker {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scrum-title {
  margin: 0;
  font-size: 1.8rem;
}

.scrum-sub,
.scrum-sprint-goal {
  margin: 0.25rem 0 0;
}

.scrum-hero-actions,
.scrum-panel-head h2,
.scrum-sprint-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.scrum-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.scrum-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 1 1 16rem;
  min-width: 0;
}

.scrum-search {
  flex: 1 1 14rem;
  max-width: 22rem;
}

.scrum-toolbar {
  position: sticky;
  top: 3.4rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  background: color-mix(in srgb, var(--tf-surface) 92%, transparent);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  box-shadow: var(--tf-shadow-sm);
  backdrop-filter: blur(12px);
}

.scrum-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.scrum-chip {
  border: 1px solid var(--tf-border);
  background: transparent;
  color: var(--tf-text-muted);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.35;
}

.scrum-chip.is-active {
  background: color-mix(in srgb, var(--tf-primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--tf-primary) 48%, var(--tf-border));
  color: var(--tf-ink-strong);
}

.scrum-filter-select {
  width: auto;
  min-width: 7.2rem;
  max-width: 10.5rem;
  border-radius: 10px;
}

.scrum-filter-count {
  margin-inline-start: auto;
  color: var(--tf-text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.scrum-sprint-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  min-height: 2.45rem;
  padding: 0.28rem 0.5rem 0.28rem 0.4rem;
}

.scrum-sprint-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  padding: 0.15rem 0.2rem;
  border-radius: 8px;
}

.scrum-sprint-toggle:hover {
  background: color-mix(in srgb, var(--tf-primary) 8%, transparent);
}

.scrum-sprint-toggle i {
  flex: 0 0 auto;
  color: var(--tf-text-muted);
  transition: transform 0.15s ease;
}

.scrum-sprint:not(.is-open) .scrum-sprint-toggle i,
.scrum-completed-toggle[aria-expanded="false"] i {
  transform: rotate(-90deg);
}

html[dir="rtl"] .scrum-sprint:not(.is-open) .scrum-sprint-toggle i,
html[dir="rtl"] .scrum-completed-toggle[aria-expanded="false"] i {
  transform: rotate(90deg);
}

.scrum-sprint-name {
  font-size: 0.92rem;
  white-space: nowrap;
}

.scrum-sprint-meta {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrum-sprint-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--tf-text-muted);
  font-size: 0.75rem;
}

.scrum-sprint.is-dimmed {
  opacity: 0.55;
}

.scrum-shown {
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  background: color-mix(in srgb, var(--tf-primary) 14%, transparent);
  color: var(--tf-ink-strong);
}

.scrum-sprint-body {
  padding: 0 0.55rem 0.5rem;
  border-top: 1px solid var(--tf-border);
}

.scrum-sprint-actions {
  margin-top: 0;
  flex-wrap: nowrap;
  gap: 0.15rem;
}

.scrum-icon-btn,
.scrum-item-actions .btn {
  --bs-btn-padding-y: 0.1rem;
  --bs-btn-padding-x: 0.32rem;
  --bs-btn-font-size: 0.8rem;
  line-height: 1.15;
}

.scrum-item-actions {
  flex: 0 0 auto;
}

.scrum-item.is-context {
  opacity: 0.62;
}

.scrum-section-mark {
  color: var(--tf-primary-light);
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.scrum-type.type-0 { background: color-mix(in srgb, #8b5cf6 22%, transparent); }
.scrum-type.type-1 { background: color-mix(in srgb, #10b981 22%, transparent); }
.scrum-type.type-2 { background: color-mix(in srgb, #3b82f6 22%, transparent); }
.scrum-type.type-3 { background: color-mix(in srgb, #f43f5e 22%, transparent); }
.scrum-type.type-4 { background: color-mix(in srgb, #94a3b8 24%, transparent); }

.scrum-guide-disclosure {
  margin-top: 0.7rem;
}

.scrum-guide-disclosure summary {
  width: fit-content;
  cursor: pointer;
  color: var(--tf-text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.scrum-guide-disclosure .scrum-guide {
  margin-top: 0.55rem;
}

.scrum-panel {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  padding: 1rem;
  box-shadow: var(--tf-shadow-sm);
}

.scrum-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.9rem;
}

.scrum-chart-card {
  min-width: 0;
}

.scrum-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.scrum-chart-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.scrum-chart-head .form-select {
  width: auto;
  max-width: 14rem;
}

.scrum-chart-note,
.scrum-chart-summary {
  margin: 0.45rem 0 0;
  color: var(--tf-text-muted);
  font-size: 0.8rem;
}

.scrum-chart {
  margin-top: 0.55rem;
}

.scrum-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.scrum-chart-empty {
  min-height: 8rem;
  display: flex;
  align-items: center;
  color: var(--tf-text-muted);
  font-size: 0.85rem;
}

.scrum-chart-axis {
  stroke: var(--tf-border);
  stroke-width: 1;
}

.scrum-chart-label {
  fill: var(--tf-text-muted);
  font-size: 11px;
}

.scrum-chart-ideal {
  fill: none;
  stroke: var(--tf-text-muted);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.scrum-chart-actual {
  fill: none;
  stroke: var(--tf-primary);
  stroke-width: 2.5;
}

.scrum-chart-actual-dot {
  fill: var(--tf-primary);
}

.scrum-chart-bar {
  fill: var(--tf-primary);
}

.scrum-chart-bar.is-active {
  fill: color-mix(in srgb, var(--tf-primary) 55%, transparent);
}

.scrum-chart-average {
  stroke: var(--tf-text-muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.scrum-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  color: var(--tf-text-muted);
  font-size: 0.75rem;
}

.scrum-legend i {
  display: inline-block;
  width: 1.1rem;
  height: 0;
  margin-inline-end: 0.35rem;
  border-top: 2px solid var(--tf-text-muted);
  vertical-align: middle;
}

.scrum-legend i.is-ideal {
  border-top-style: dashed;
}

.scrum-legend i.is-actual {
  border-top-color: var(--tf-primary);
}

.scrum-sprint-list,
.scrum-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.scrum-sprint,
.scrum-item,
.scrum-empty {
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  background: color-mix(in srgb, var(--tf-bg) 72%, transparent);
}

.scrum-sprint,
.scrum-empty {
  padding: 0.9rem 1rem;
}

.scrum-sprint {
  padding: 0;
  overflow: hidden;
}

.scrum-sprint.status-1 {
  border-color: color-mix(in srgb, var(--tf-primary) 55%, var(--tf-border));
}

.scrum-sprint.is-over-capacity {
  border-color: color-mix(in srgb, var(--tf-warning) 70%, var(--tf-border));
}

.scrum-capacity {
  margin: 0;
  width: 4.25rem;
  flex: 0 0 4.25rem;
}

.scrum-capacity-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tf-border) 80%, transparent);
  overflow: hidden;
}

.scrum-capacity-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--tf-primary);
}

.scrum-capacity.is-over .scrum-capacity-fill {
  background: var(--tf-warning);
}

.scrum-sprint-name,
.scrum-item-title {
  font-weight: 650;
}

.scrum-sprint-stats,
.scrum-item-parent {
  font-size: 0.82rem;
}

.scrum-sprint-stats {
  margin-top: 0.7rem;
  color: var(--tf-text-muted);
  flex-wrap: wrap;
}

.scrum-sprint-actions {
  margin-top: 0;
  flex-wrap: nowrap;
}

.scrum-sprint-items {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.45rem;
}

.scrum-sprint-empty {
  padding: 0.45rem 0.65rem;
}

.scrum-item-status {
  font-size: 0.72rem;
  color: var(--tf-text-muted);
  white-space: nowrap;
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

.scrum-status,
.scrum-pill,
.scrum-type,
.scrum-count {
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--tf-primary) 16%, transparent);
  color: var(--tf-ink-strong);
}

.scrum-status.status-1 {
  background: color-mix(in srgb, var(--tf-success) 20%, transparent);
}

.scrum-status.status-2 {
  background: color-mix(in srgb, var(--tf-text-muted) 18%, transparent);
}

.scrum-count {
  margin-inline-start: 0.35rem;
}

.scrum-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.scrum-guide-card {
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  padding: 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--tf-bg) 55%, transparent);
}

.scrum-guide-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.scrum-guide-lead {
  margin: 0.2rem 0 0.55rem;
  color: var(--tf-text-muted);
  font-size: 0.78rem;
}

.scrum-guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.scrum-guide-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.8rem;
  color: var(--tf-text-muted);
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
}

.scrum-guide-item strong {
  color: var(--tf-ink-strong);
  font-weight: 650;
  white-space: nowrap;
}

.scrum-guide-item.is-active {
  background: color-mix(in srgb, var(--tf-primary) 18%, transparent);
  color: var(--tf-ink);
}

.scrum-field-hint {
  margin: 0.35rem 0 0;
  min-height: 2.5em;
}

.scrum-create {
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.scrum-create .form-control,
.scrum-create .form-select {
  width: auto;
  min-width: 8rem;
  flex: 1 1 8rem;
}

.scrum-create .form-control {
  flex: 2 1 14rem;
}

.scrum-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 0 1 10rem;
  min-width: 8rem;
  max-width: 11rem;
}

.scrum-field span {
  font-size: 0.7rem;
  line-height: 1;
  color: var(--tf-text-muted);
}

.scrum-create .scrum-field .form-select {
  width: 100%;
  min-width: 0;
  flex: none;
}

.scrum-bucket {
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  padding: 0.45rem 0.55rem;
  background: color-mix(in srgb, var(--tf-bg) 42%, transparent);
}

.scrum-bucket-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
  margin-bottom: 0.55rem;
}

.scrum-bucket.is-external .scrum-bucket-title {
  color: var(--tf-primary-light);
}

.scrum-children {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.scrum-group {
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  padding: 0.2rem;
}

.scrum-group > .scrum-children {
  margin-top: 0.2rem;
  margin-inline-start: 0.7rem;
  padding-inline-start: 0.55rem;
  border-inline-start: 2px solid color-mix(in srgb, var(--tf-primary) 50%, var(--tf-border));
}

.scrum-item-actions {
  display: flex;
  gap: 0.25rem;
}

.scrum-item.is-section {
  background: color-mix(in srgb, var(--tf-primary) 12%, transparent);
}

.scrum-item {
  padding: 0.18rem 0.45rem;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  flex-wrap: nowrap;
}

.scrum-item.is-dragging {
  opacity: 0.55;
}

.scrum-grip {
  color: var(--tf-text-muted);
  cursor: grab;
}

.scrum-item-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.scrum-item-kicker {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--tf-primary-light);
}

.scrum-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.scrum-type,
.scrum-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.scrum-move {
  width: 8rem;
  min-width: 8rem;
  max-width: 8rem;
  height: 1.7rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
  font-size: 0.75rem;
}

.scrum-empty {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--tf-text-muted);
}

.scrum-completed {
  margin-top: 0.8rem;
}

.scrum-completed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--tf-text-muted);
  padding: 0;
}

@media (max-width: 720px) {
  .scrum-guide,
  .scrum-charts {
    grid-template-columns: 1fr;
  }

  .scrum-hero-row,
  .scrum-panel-head,
  .scrum-panel-tools,
  .scrum-create,
  .scrum-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .scrum-item {
    flex-direction: row;
    align-items: center;
  }

  .scrum-item-status {
    display: none;
  }

  .scrum-sprint-bar {
    flex-wrap: wrap;
  }

  .scrum-search {
    width: 100%;
    max-width: none;
  }

  .scrum-field,
  .scrum-create .form-control,
  .scrum-create .form-select,
  .scrum-create .btn,
  .scrum-filter-select {
    width: 100%;
    max-width: none;
  }

  .scrum-move {
    width: 6.6rem;
    min-width: 6.6rem;
    max-width: 6.6rem;
  }

  .scrum-filter-count {
    margin-inline-start: 0;
  }
}

.tour-spotlight {
  position: relative;
  z-index: 40;
  border-radius: 12px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--tf-primary, #6366f1);
}

.onboard {
  min-height: calc(100vh - 8.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 0 1.5rem;
}

.onboard-top,
.onboard-track,
.onboard-card,
.onboard-dots {
  width: min(34rem, 100%);
}

.onboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.onboard-count {
  color: var(--tf-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.onboard-skip {
  border: 0;
  background: transparent;
  color: var(--tf-text-muted);
  font-weight: 650;
  cursor: pointer;
}

.onboard-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.onboard-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--tf-primary, #6366f1);
  transition: width 0.2s ease;
}

.onboard-card {
  padding: 1.7rem 1.5rem 1.25rem;
  border: 1px solid var(--tf-border);
  border-radius: 22px;
  background: var(--tf-surface, #1e293b);
  text-align: center;
  box-shadow: var(--tf-shadow-lg);
}

.onboard-icon {
  display: grid;
  place-items: center;
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.8rem;
  border-radius: 18px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--tf-primary-light, #c7d2fe);
  font-size: 1.7rem;
}

.onboard-audience {
  margin: 0 0 0.3rem;
  color: var(--tf-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.onboard-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
}

.onboard-lead {
  margin: 0 auto 1rem;
  max-width: 28rem;
  color: var(--tf-text-muted);
  line-height: 1.65;
}

.onboard-points {
  margin: 0 auto 1.2rem;
  padding: 0;
  list-style: none;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.onboard-points li {
  position: relative;
  padding-inline-start: 1.3rem;
  line-height: 1.55;
}

.onboard-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--tf-primary, #6366f1);
}

.onboard-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.onboard-next { min-width: 7.5rem; }

.onboard-try,
.tour-note {
  display: inline-block;
  margin: 0.85rem 0 0;
  color: var(--tf-primary-light, #a5b4fc);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.onboard-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.onboard-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
}

.onboard-dot.is-done { background: rgba(99, 102, 241, 0.55); }
.onboard-dot.is-current { width: 1.35rem; background: var(--tf-primary, #6366f1); }

.onboard-prompt {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.62);
}

.onboard-prompt.is-continue {
  inset: auto;
  inset-inline-end: 1rem;
  bottom: 1rem;
  display: block;
  padding: 0;
  background: transparent;
}

.onboard-prompt-card {
  width: min(26rem, 100%);
  padding: 1.45rem 1.3rem 1.2rem;
  border: 1px solid var(--tf-border);
  border-radius: 20px;
  background: var(--tf-surface, #1e293b);
  text-align: center;
  box-shadow: var(--tf-shadow-lg);
}

.onboard-prompt.is-continue .onboard-prompt-card {
  width: min(24rem, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  text-align: start;
  padding: 0.85rem 0.95rem;
}

.onboard-prompt h2,
.onboard-prompt strong {
  display: block;
  margin: 0 0 0.35rem;
}

.onboard-prompt p {
  margin: 0 0 1rem;
  color: var(--tf-text-muted);
}

.onboard-prompt.is-continue p { margin: 0; }

.onboard-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nx-tour-block {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: transparent;
}

.nx-tour-hole {
  position: fixed;
  z-index: 2001;
  border-radius: 14px;
  border: 2px solid #c7d2fe;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.72);
  pointer-events: none;
}

.nx-tour-pop {
  position: fixed;
  z-index: 2002;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 24rem);
  overflow: auto;
  padding: 0.95rem 1rem 0.85rem;
  border: 1px solid var(--tf-border);
  border-radius: 16px;
  background: var(--tf-surface, #1e293b);
  color: var(--tf-text);
  box-shadow: var(--tf-shadow-lg);
}

.nx-tour-count {
  color: var(--tf-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.nx-tour-pop h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.05rem;
}

.nx-tour-pop p {
  margin: 0 0 0.85rem;
  color: var(--tf-text-muted);
  line-height: 1.55;
}

.nx-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nx-tour-actions > div {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .nx-tour-pop {
    width: calc(100vw - 1.5rem) !important;
    max-height: 46vh;
  }

  .nx-tour-actions .btn {
    min-height: 2.25rem;
  }
}

.nx-tour-skip {
  border: 0;
  background: transparent;
  color: var(--tf-text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

/* LinkedIn-style messaging dock */
.nx-msg {
  position: fixed;
  z-index: 2000;
  top: auto;
  bottom: 0;
  left: auto;
  right: 0;
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

html[dir="rtl"] .nx-msg {
  right: auto;
  left: 0;
}

.nx-msg > * { pointer-events: auto; }

.nx-msg-dock,
.nx-msg-window {
  background: var(--tf-bg-elevated);
  border: 1px solid var(--tf-line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 32px rgba(2, 6, 23, 0.28);
  overflow: hidden;
}

.nx-msg-dock {
  width: min(300px, 100vw);
  display: flex;
  flex-direction: column;
  border-start-end-radius: 0;
  border-inline-end: 0;
}

.nx-msg:not(.is-open) .nx-msg-dock {
  display: none;
}

.nx-msg-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  height: 48px;
  padding: 0 0.85rem;
  border: 0;
  background: var(--tf-bg-elevated);
  color: var(--tf-ink-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nx-msg-bar i:first-child { color: var(--tf-hud-accent); }

.nx-msg-chevron {
  margin-inline-start: auto;
  color: var(--tf-ink-soft);
  transition: transform 0.15s ease;
}

.nx-msg-dock.is-open .nx-msg-chevron,
.nx-msg.is-open .nx-msg-chevron { transform: rotate(180deg); }

.nx-msg-count {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nx-msg-panel {
  display: none;
  flex-direction: column;
  height: min(420px, 52vh);
  border-top: 0;
}

.nx-msg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem 0.15rem;
  flex-shrink: 0;
}

.nx-msg-panel-head strong {
  font-size: 0.92rem;
}

.nx-msg.is-open .nx-msg-panel { display: flex; }

.nx-msg-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.65rem 0.75rem 0.35rem;
  padding: 0 0.65rem;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--tf-input-line);
  background: var(--tf-input);
  color: var(--tf-ink-soft);
}

.nx-msg-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tf-ink-strong);
  font: inherit;
  font-size: 0.85rem;
}

.nx-msg-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.25rem 0.4rem 0.6rem;
}

.nx-msg-label {
  padding: 0.7rem 0.55rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tf-ink-soft);
}

.nx-msg .tf-chat-item {
  width: 100%;
  border-radius: 8px;
  padding: 0.45rem 0.45rem;
}

.nx-msg-window {
  width: min(360px, calc(100vw - 2rem));
  height: min(500px, calc(100dvh - 5.5rem));
  display: flex;
  flex-direction: column;
}

.nx-msg-window .tf-chat-thread-inner { height: 100%; }

.nx-msg-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--tf-line);
  flex-shrink: 0;
}

.nx-msg-head-copy { min-width: 0; flex: 1; }

.nx-msg-head .tf-chat-thread-title,
.nx-msg-head .tf-chat-thread-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-msg-iconbtn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tf-ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.nx-msg-iconbtn:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

html[dir="rtl"] #chatBackBtn i { transform: scaleX(-1); }

.nx-msg .tf-chat-bubble { cursor: context-menu; }

.nx-msg-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4990;
  background: rgba(2, 6, 23, 0.45);
}

.nx-msg-menu {
  position: fixed;
  z-index: 5000;
  min-width: 196px;
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--tf-line);
  background: var(--tf-bg-elevated);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
}

.nx-msg-menu.is-sheet {
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  min-width: 0;
  border-radius: 16px 16px 0 0;
  padding: 0.45rem 0.45rem calc(0.55rem + env(safe-area-inset-bottom));
}

.nx-msg-menu.is-sheet .nx-msg-menu-item {
  padding: 0.85rem 0.9rem;
  font-size: 1rem;
}

.nx-msg-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tf-ink);
  font: inherit;
  font-size: 0.86rem;
  text-align: start;
  cursor: pointer;
}

.nx-msg-menu-item:hover {
  background: var(--tf-fill-hover);
  color: var(--tf-ink-strong);
}

.modal-backdrop { z-index: 5090; }
.modal { z-index: 5100; }

@media (max-width: 768px) {
  .nx-msg,
  html[dir="rtl"] .nx-msg {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    gap: 0;
    flex-direction: column;
  }

  .nx-msg-dock,
  .nx-msg-window {
    width: 100%;
    border-radius: 0;
    border-inline: 0;
  }

  .nx-msg.is-open,
  html[dir="rtl"] .nx-msg.is-open {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
  }

  .nx-msg.is-open .nx-msg-dock,
  .nx-msg.is-open .nx-msg-window {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nx-msg.is-open .nx-msg-panel-head {
    padding-top: calc(0.55rem + env(safe-area-inset-top));
  }

  .nx-msg.is-open .nx-msg-panel {
    display: flex;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border-top: 0;
  }

  .nx-msg.is-open.is-thread .nx-msg-dock { display: none; }

  .nx-msg.is-open .nx-msg-window .tf-chat-thread-inner {
    height: 100%;
    padding-top: env(safe-area-inset-top);
  }

  .nx-msg.is-open .tf-chat-composer {
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
  }

  .nx-msg .tf-chat-item-preview,
  .nx-msg .tf-chat-item-title {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }

  .nx-msg .tf-chat-msg-text {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;
  }

  .nx-msg .tf-chat-msg {
    max-width: 94%;
    padding-inline: 0.45rem;
  }

  .nx-msg .tf-chat-composer-box { min-width: 0; }

  .nx-msg-search input,
  .nx-msg .tf-chat-composer textarea {
    min-width: 0;
    font-size: 16px;
  }

  body.nx-msg-lock { overflow: hidden; }

  .nx-peer-panel {
    width: 100%;
  }
}

.nx-msg-window { position: relative; }

.nx-peer:not(.d-none) {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  background: var(--tf-bg-elevated);
}

.nx-peer-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--tf-bg-elevated);
}

.nx-peer-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--tf-line);
}

html[dir="rtl"] #chatPeerClose i { transform: scaleX(-1); }

.nx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.82);
}

.nx-lightbox img {
  max-width: min(920px, 100%);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
}

.nx-lightbox-close {
  position: absolute;
  top: 0.8rem;
  inset-inline-end: 0.8rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.nx-peer-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0 1rem 0.8rem;
}

.nx-peer-profile h2 {
  margin: 0.45rem 0 0;
  font-size: 1.05rem;
}

.nx-peer-profile p {
  margin: 0;
  color: var(--tf-ink-soft);
  font-size: 0.82rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-peer-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.6rem;
  border-bottom: 1px solid var(--tf-line);
}

.nx-peer-tabs button {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tf-ink-soft);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.55rem 0.15rem;
  cursor: pointer;
  white-space: nowrap;
}

.nx-peer-tabs button.is-on {
  color: var(--tf-hud-accent);
  border-bottom-color: var(--tf-hud-accent);
}

.nx-peer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem;
}

.nx-peer-empty {
  color: var(--tf-ink-soft);
  text-align: center;
  padding: 2rem 0.5rem;
}

.nx-peer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.nx-peer-photo {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tf-fill);
  cursor: pointer;
}

.nx-peer-photo img {
  height: 100%;
  max-height: none;
}

.nx-peer-list,
.nx-voice-list { display: flex; flex-direction: column; gap: 0.45rem; }

.nx-voice-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  background: var(--tf-fill-2);
}

.nx-voice-play {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--tf-hud-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  cursor: pointer;
}

.nx-voice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }

.nx-voice-wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  color: var(--tf-ink-soft);
}

.nx-voice-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
}

.nx-voice-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tf-hud-accent) 28%, transparent);
  pointer-events: none;
}

.nx-voice-bar.is-on {
  opacity: 1;
  background: var(--tf-hud-accent);
}

.nx-voice-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--tf-ink-soft);
  font-size: 0.72rem;
}

.nx-voice-dur {
  font-weight: 700;
  color: var(--tf-ink);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.nx-voice-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-peer-link,
.nx-peer-list .tf-filechip {
  width: 100%;
  padding: 0.45rem 0.15rem;
  border-bottom: 1px solid var(--tf-line);
  border-radius: 0;
}

.page-platform .plat-kpi {
  width: 100%;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.page-platform .plat-kpi.is-on {
  border-color: rgba(116, 100, 243, 0.85);
  box-shadow: 0 0 0 1px rgba(116, 100, 243, 0.45);
}

.page-platform .plat-directory {
  min-height: 0;
}

.plat-directory-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
}

.plat-directory-count {
  margin: 2px 0 0;
  color: var(--tf-text-muted);
  font-size: 12px;
}

.plat-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.plat-toolbar .nx-tabs {
  padding: 0;
}

.plat-search {
  width: min(16rem, 100%);
  border-radius: 999px;
}

.plat-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 16px;
}

.plat-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="light"] .plat-card {
  background: #f7f8fc;
  border-color: #e6e8f0;
}

.plat-card-main {
  display: flex;
  gap: 12px;
  min-width: 0;
  align-items: flex-start;
}

.plat-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, var(--plat-a, #6366f1), var(--plat-b, #8b5cf6));
}

.plat-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--tf-ink-strong);
  font-weight: 700;
}

.plat-card-slug,
.plat-card-desc {
  color: var(--tf-text-muted);
  font-size: 12px;
}

.plat-card-desc {
  margin: 4px 0 0;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plat-metrics {
  display: flex;
  gap: 18px;
  margin: 0;
}

.plat-metrics dt {
  margin: 0;
  color: var(--tf-text-muted);
  font-size: 11px;
  font-weight: 600;
}

.plat-metrics dd {
  margin: 2px 0 0;
  color: var(--tf-ink-strong);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plat-status {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

.plat-status.is-suspended {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.plat-status.is-deleted {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
}

.plat-card .plat-action {
  border-radius: 999px;
  min-width: 6.5rem;
}

.plat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.plat-card-plan {
  margin-top: 4px;
  color: var(--tf-text-muted);
  font-size: 12px;
}

.plat-installation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 14px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(116, 100, 243, 0.35);
  background: rgba(116, 100, 243, 0.08);
}

.plat-installation p {
  margin: 4px 0 0;
  color: var(--tf-text-muted);
  font-size: 13px;
}

.lic-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(116, 100, 243, 0.35);
  background: rgba(116, 100, 243, 0.08);
}

.lic-banner strong {
  color: var(--tf-ink-strong);
}

.lic-banner span,
.lic-banner p {
  margin: 0;
  color: var(--tf-text-muted);
  font-size: 13px;
}

.lic-banner.is-expired {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.plat-form-kicker {
  margin: 0 0 8px;
  color: var(--tf-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .plat-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .plat-card .plat-action,
  .plat-actions {
    justify-self: start;
    justify-content: flex-start;
  }
}

