/* ============================================================================
   TradeFlow Dashboard CSS
   Component library extracted from /assets/brand/preview.html.

   Imports tokens.css for the source-of-truth palette / typography / radius /
   elevation. Adds: app shell layout, hero band, dark stat tiles, gradient
   avatars, sidebar with gradient accent rail, featured cards, badges, tables,
   tabs, forms, modal, empty / skeleton / progress, utilities.

   See /brand/SKILL.md for usage rules. Five hard rules in short:
     1. Gradient direction fixed: purple-left → green-right.
     2. Gradient is rare and earned — buttons, hero, active nav, wordmark only.
     3. Wordmark appears once per screen (app shell top-left).
     4. Surfaces stay neutral. No tinted card backgrounds.
     5. Teal #3A8487 is the cross-cutting accent.
   ============================================================================ */

@import url('/assets/brand/tokens.css');

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100vh;
  background: var(--tf-bg);
  color: var(--tf-ink-950);
  font-family: var(--tf-font);
  font-size: 14px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---- App shell ---- */
.tf-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.tf-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 18px 14px;
  background: var(--tf-surface);
  border-right: 1px solid var(--tf-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}
.tf-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 14px;
}
.tf-sidebar-logo .tf-mark { width: 36px; height: 18px; flex-shrink: 0; }
.tf-sidebar-logo-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--tf-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tf-co-info {
  padding: 10px 12px;
  background: var(--tf-bg);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.tf-co-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--tf-ink-950);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-role-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--tf-info);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.tf-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--tf-ink-400);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 14px 10px 6px;
}
.tf-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--tf-ink-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.tf-nav-item:hover { background: var(--tf-ink-100); color: var(--tf-ink-950); }
.tf-nav-item.active {
  background: var(--tf-info-bg);
  color: var(--tf-info);
  font-weight: 600;
}
.tf-nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--tf-gradient);
  border-radius: 0 3px 3px 0;
}
.tf-nav-icon {
  font-size: 16px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.tf-nav-badge {
  margin-left: auto;
  background: var(--tf-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.tf-sidebar-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--tf-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--tf-ink-500);
}
.tf-sidebar-bottom .tf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-success);
}
.tf-sidebar-bottom a {
  margin-left: auto;
  font-size: 11px;
  color: var(--tf-ink-500);
}
.tf-sidebar-bottom a:hover { color: var(--tf-info); }

/* ---- Main column ---- */
.tf-main { padding: 28px 32px 60px; max-width: 1200px; }
.tf-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.tf-page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tf-ink-950);
  margin: 0;
}
.tf-page-subtitle { font-size: 13px; color: var(--tf-ink-500); margin-top: 4px; }

/* ---- Hero band (the gradient strip that anchors a page top) ---- */
.tf-hero {
  background: var(--tf-gradient);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.tf-hero-content h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.tf-hero-content p {
  font-size: 13px;
  opacity: 0.92;
  margin: 0;
  max-width: 56ch;
}
.tf-hero-action .tf-btn {
  background: #fff;
  color: var(--tf-purple-900);
  border: none;
}
.tf-hero-action .tf-btn:hover { background: #F2F0FE; }

/* ---- Section block ---- */
.tf-section { margin-bottom: 32px; }
.tf-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tf-ink-400);
  margin: 0 0 12px;
  text-transform: uppercase;
}

/* ---- Grids ---- */
.tf-grid { display: grid; gap: 16px; }
.tf-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tf-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .tf-grid-4, .tf-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tf-grid-2, .tf-grid-3, .tf-grid-4, .tf-grid-5 { grid-template-columns: 1fr; }
  .tf-shell { grid-template-columns: 1fr; }
  .tf-sidebar { position: static; height: auto; }
}

/* ---- Stat tile (the dashboard's pulse) ---- */
.tf-stat {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: default;
}
.tf-stat.is-clickable { cursor: pointer; }
.tf-stat.is-clickable:hover {
  border-color: var(--tf-teal-500);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.tf-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tf-ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.tf-stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tf-ink-950);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin-bottom: 4px;
}
.tf-stat-sub { font-size: 12px; color: var(--tf-ink-500); }
.tf-stat.warn .tf-stat-value { color: var(--tf-warning); }
.tf-stat.danger .tf-stat-value { color: var(--tf-danger); }
.tf-stat-delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.tf-stat-delta.up { color: var(--tf-success); }
.tf-stat-delta.down { color: var(--tf-danger); }

/* ---- Card ---- */
.tf-card {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tf-border);
}
.tf-card-header h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--tf-ink-950);
  margin: 0;
}
.tf-card-header-meta { font-size: 11px; color: var(--tf-ink-500); }
.tf-card-header a {
  font-size: 12px;
  font-weight: 600;
  color: var(--tf-info);
}
.tf-card-header a:hover { text-decoration: underline; }
.tf-card-body { padding: 16px 18px; color: var(--tf-ink-700); font-size: 13px; }
.tf-card-body--flush { padding: 0; }

/* Featured card (gradient border, neutral surface) */
.tf-card-featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--tf-surface), var(--tf-surface)) padding-box,
    var(--tf-gradient) border-box;
  box-shadow: var(--shadow-md);
  border-radius: var(--r-lg);
  padding: 18px;
}

/* ---- Buttons ---- */
.tf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: filter 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.tf-btn:active { transform: translateY(1px); }
.tf-btn:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}
.tf-btn-primary {
  background: var(--tf-gradient);
  color: #fff;
  box-shadow: 0 1px 2px rgba(74, 43, 196, 0.20), 0 4px 12px rgba(98, 87, 227, 0.18);
}
.tf-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 1px 2px rgba(74, 43, 196, 0.20), 0 6px 18px rgba(98, 87, 227, 0.28);
}
.tf-btn-secondary {
  background: var(--tf-surface);
  color: var(--tf-ink-950);
  border: 1px solid var(--tf-border);
}
.tf-btn-secondary:hover { border-color: var(--tf-teal-500); color: var(--tf-teal-500); }
.tf-btn-ghost { background: transparent; color: var(--tf-ink-700); }
.tf-btn-ghost:hover { background: var(--tf-ink-100); color: var(--tf-ink-950); }
.tf-btn-danger { background: var(--tf-danger); color: #fff; }
.tf-btn-danger:hover { filter: brightness(1.05); }
.tf-btn-success { background: var(--tf-success); color: #fff; }
.tf-btn-sm { padding: 5px 11px; font-size: 11px; }
.tf-btn[disabled], .tf-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
}

/* ---- Badges ---- */
.tf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tf-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tf-badge-success { background: var(--tf-success-bg); color: var(--tf-success); }
.tf-badge-warning { background: var(--tf-warning-bg); color: #B07E1A; }
.tf-badge-danger  { background: var(--tf-danger-bg);  color: var(--tf-danger);  }
.tf-badge-info    { background: var(--tf-info-bg);    color: var(--tf-info);    }
.tf-badge-neutral { background: var(--tf-ink-100);    color: var(--tf-ink-700); }
.tf-badge-gradient { background: var(--tf-gradient); color: #fff; }

/* Role-specific badge variants (used on users.html) */
.tf-badge-role-owner { background: var(--tf-success-bg);              color: var(--tf-success); }
.tf-badge-role-admin { background: var(--tf-info-bg);                 color: var(--tf-info); }
.tf-badge-role-manager { background: rgba(98, 87, 227, 0.10);         color: var(--tf-purple-700); }
.tf-badge-role-tech { background: var(--tf-warning-bg);               color: #B07E1A; }
.tf-badge-role-viewer { background: var(--tf-ink-100);                color: var(--tf-ink-700); }
.tf-badge-global {
  background: var(--tf-gradient);
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* ---- Table ---- */
.tf-table { width: 100%; border-collapse: collapse; }
.tf-table th, .tf-table td {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--tf-border);
  color: var(--tf-ink-700);
  vertical-align: middle;
}
.tf-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--tf-ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--tf-bg);
  padding: 10px 16px;
}
.tf-table tr:hover td { background: var(--tf-bg); }
.tf-table tr:last-child td { border-bottom: none; }
.tf-table td.is-num,
.tf-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tf-table .row-primary { font-weight: 600; color: var(--tf-ink-950); }
.tf-table .row-sub { color: var(--tf-ink-500); font-size: 11px; margin-top: 2px; }
.tf-table .row-mono {
  font-family: var(--tf-font-mono);
  font-size: 11px;
  color: var(--tf-ink-500);
}

/* Gradient avatar circle (initials) */
.tf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tf-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  margin-right: 10px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.tf-avatar.is-muted { background: var(--tf-ink-200); color: var(--tf-ink-700); }

/* Status dot used in row prefixes (e.g. company active/suspended) */
.tf-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.tf-status-dot.active { background: var(--tf-success); }
.tf-status-dot.suspended { background: var(--tf-danger); }

/* ---- Tabs (segmented) ---- */
.tf-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--tf-ink-100);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.tf-tab {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--tf-ink-500);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tf-tab:hover { color: var(--tf-ink-950); }
.tf-tab.active {
  background: var(--tf-surface);
  color: var(--tf-ink-950);
  box-shadow: var(--shadow-sm);
}

/* ---- Form controls ---- */
.tf-field { display: flex; flex-direction: column; gap: 6px; }
.tf-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tf-ink-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tf-input, .tf-select, .tf-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--tf-surface);
  color: var(--tf-ink-950);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  transition: border 0.15s, box-shadow 0.15s;
}
.tf-input:focus, .tf-select:focus, .tf-textarea:focus {
  outline: none;
  border-color: var(--tf-teal-500);
  box-shadow: var(--tf-focus-ring);
}
.tf-input::placeholder, .tf-textarea::placeholder { color: var(--tf-ink-400); }
.tf-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238589A0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.tf-textarea { resize: vertical; min-height: 80px; }
.tf-hint { font-size: 11px; color: var(--tf-ink-500); margin-top: 2px; }
.tf-search {
  width: 240px;
  padding: 7px 12px;
  background: var(--tf-bg);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--tf-ink-950);
}
.tf-search:focus {
  outline: none;
  border-color: var(--tf-teal-500);
  box-shadow: var(--tf-focus-ring);
}

/* ---- Modal ---- */
.tf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 15, 26, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tf-modal-overlay.open { display: flex; }
.tf-modal {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-lg);
  width: 520px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.tf-modal h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: var(--tf-ink-950);
}
.tf-modal-row { margin-bottom: 14px; }
.tf-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ---- Empty state ---- */
.tf-empty {
  text-align: center;
  padding: 40px 24px;
  background: var(--tf-surface);
  border: 1px dashed var(--tf-border);
  border-radius: var(--r-lg);
}
.tf-empty-mark { width: 64px; height: 32px; margin: 0 auto 14px; opacity: 0.6; }
.tf-empty h3 { font-size: 15px; font-weight: 700; color: var(--tf-ink-950); margin-bottom: 4px; }
.tf-empty p  { font-size: 13px; color: var(--tf-ink-500); margin-bottom: 16px; }
.tf-empty-inline { color: var(--tf-ink-500); font-size: 13px; text-align: center; padding: 20px; }

/* ---- Skeleton (shimmer) ---- */
.tf-skeleton {
  background: linear-gradient(90deg, var(--tf-ink-100) 0%, var(--tf-ink-200) 50%, var(--tf-ink-100) 100%);
  background-size: 200% 100%;
  animation: tf-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes tf-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Progress bar ---- */
.tf-progress {
  height: 6px;
  background: var(--tf-ink-100);
  border-radius: 999px;
  overflow: hidden;
}
.tf-progress-fill {
  height: 100%;
  background: var(--tf-gradient);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---- Activity / list items ---- */
.tf-list-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--tf-border);
  align-items: center;
}
.tf-list-item:last-child { border-bottom: none; }
.tf-list-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tf-info-bg);
  color: var(--tf-info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.tf-list-body { flex: 1; min-width: 0; }
.tf-list-title { font-size: 13px; font-weight: 600; color: var(--tf-ink-950); }
.tf-list-meta { font-size: 11px; color: var(--tf-ink-500); margin-top: 2px; }
.tf-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.tf-list-dot.green { background: var(--tf-success); }
.tf-list-dot.blue  { background: var(--tf-info); }
.tf-list-dot.amber { background: var(--tf-warning); }
.tf-list-dot.red   { background: var(--tf-danger); }

/* Horizontal "cat bar" (used for role / category breakdowns) */
.tf-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.tf-bar-name {
  font-size: 12px;
  width: 96px;
  color: var(--tf-ink-700);
  text-align: right;
  flex-shrink: 0;
  text-transform: capitalize;
}
.tf-bar-track {
  flex: 1;
  height: 6px;
  background: var(--tf-ink-100);
  border-radius: 999px;
  overflow: hidden;
}
.tf-bar-fill {
  height: 100%;
  background: var(--tf-gradient);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.tf-bar-count {
  font-family: var(--tf-font-mono);
  font-size: 11px;
  color: var(--tf-ink-500);
  width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Quick actions grid ---- */
.tf-qa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tf-qa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--tf-bg);
  border: 1px solid var(--tf-border);
  color: var(--tf-ink-700);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.tf-qa-btn:hover {
  border-color: var(--tf-teal-500);
  color: var(--tf-teal-500);
  background: var(--tf-surface);
}
.tf-qa-icon { font-size: 18px; }

/* ---- Footer ---- */
.tf-powered {
  text-align: center;
  margin-top: 36px;
  font-size: 11px;
  color: var(--tf-ink-400);
  letter-spacing: 0.02em;
}
.tf-powered a { color: var(--tf-ink-400); }
.tf-powered a:hover { color: var(--tf-info); }

/* ---- Utility classes ---- */
.tf-mt-0 { margin-top: 0; }
.tf-mt-8 { margin-top: 8px; }
.tf-mt-16 { margin-top: 16px; }
.tf-mb-0 { margin-bottom: 0; }
.tf-mb-8 { margin-bottom: 8px; }
.tf-mb-16 { margin-bottom: 16px; }
.tf-mb-24 { margin-bottom: 24px; }
.tf-flex { display: flex; }
.tf-flex-between { display: flex; align-items: center; justify-content: space-between; }
.tf-gap-8 { gap: 8px; }
.tf-gap-12 { gap: 12px; }
.tf-text-muted { color: var(--tf-ink-500); }
.tf-text-info { color: var(--tf-info); }
.tf-text-success { color: var(--tf-success); }
.tf-text-warning { color: var(--tf-warning); }
.tf-text-danger { color: var(--tf-danger); }
.tf-num { font-variant-numeric: tabular-nums; }
.tf-mono { font-family: var(--tf-font-mono); }
.tf-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Focus ring fallback (anything missed by component rules) ---- */
:focus-visible {
  outline: none;
  box-shadow: var(--tf-focus-ring);
}

/* ============================================================================
   Auth-shell family — login / forgot-password / reset-password
   Centered single-card layout with the brand lockup above and a caption below.

   REG 1 (SVG sizing): .tf-auth-mark sets width:64px height:32px here, but
   the auth pages MUST also set width="64" height="32" attributes directly on
   the <svg> element. The inline attributes are the authoritative size when
   this stylesheet is slow to load or cached stale; the CSS rule keeps the
   cascade consistent and lets future redesigns retune the size in one place.

   REG 2 (alert visibility): .tf-alert defines look only (background, color,
   border, padding, typography). It does NOT set display:none. Visibility is
   controlled by inline style="display:none" on the alert div in HTML, and
   toggled via el.style.display='block' / 'none' in JS. This removes the
   dependency on this stylesheet being loaded for alerts to default-hidden.
   ============================================================================ */
.tf-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 28px;
}
.tf-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tf-auth-mark {
  width: 64px;
  height: 32px;
  flex-shrink: 0;
}
.tf-auth-wordmark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--tf-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.tf-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.tf-auth-card h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tf-ink-950);
  margin: 0 0 6px;
}
.tf-auth-subtitle {
  font-size: 13px;
  color: var(--tf-ink-500);
  margin: 0 0 24px;
  line-height: 1.5;
}
.tf-auth-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.tf-auth-link {
  font-size: 12px;
  color: var(--tf-info);
  text-decoration: none;
}
.tf-auth-link:hover { text-decoration: underline; }
.tf-auth-back {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--tf-ink-500);
  text-decoration: none;
}
.tf-auth-back:hover { color: var(--tf-info); }
.tf-auth-caption {
  font-size: 12px;
  color: var(--tf-ink-500);
  text-align: center;
  max-width: 420px;
  line-height: 1.5;
}
.tf-auth-caption a { color: var(--tf-info); }
.tf-auth-caption a:hover { text-decoration: underline; }

/* Password input + reveal toggle. Composes on top of .tf-input. */
.tf-pw-wrap { position: relative; }
.tf-pw-wrap .tf-input { padding-right: 42px; }
.tf-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tf-ink-500);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}
.tf-pw-toggle:hover { color: var(--tf-ink-950); background: var(--tf-ink-100); }
.tf-pw-toggle svg { width: 18px; height: 18px; display: block; }

/* Inline status banners. Lighter touch than .tf-empty. Visibility is set
   inline on each auth page (see REG 2 note above) — this rule is visual only. */
.tf-alert {
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.tf-alert strong { display: block; font-weight: 700; margin-bottom: 4px; }
.tf-alert-error   { background: var(--tf-danger-bg);  border-color: var(--tf-danger);  color: var(--tf-danger);  }
.tf-alert-success { background: var(--tf-success-bg); border-color: var(--tf-success); color: var(--tf-success); }

/* Full-width primary CTA inside the auth card */
.tf-btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
}

/* Inline spinner — white on the brand-gradient button surface */
.tf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tf-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes tf-spin { to { transform: rotate(360deg); } }
