/* Future Technologies components. Hand-written from components/*.html and ui_kits/ in haideralibaig/ft-design-system,
   with every colour, family and radius re-pointed at tokens.css. Static, no JavaScript. */

.ft { font-family: var(--font-header); font-size: 14px; line-height: 1.45; color: var(--fg-1); -webkit-font-smoothing: antialiased; }
.ft *, .ft *::before, .ft *::after { box-sizing: border-box; }
.ft-num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.ft-mono { font-family: var(--font-mono); }
.ft-eyebrow { font-family: var(--font-display); font-weight: 700; font-size: 11px; line-height: 1.4; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }

/* Button */
.ft-btn { font: inherit; font-size: 13px; line-height: 1.45; display: inline-flex; align-items: center; gap: var(--space-3); padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--fg-1); cursor: pointer; transition: background 80ms cubic-bezier(.2,0,.2,1), border-color 80ms cubic-bezier(.2,0,.2,1); }
.ft-btn:active { transition-duration: 140ms; }
.ft-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ft-btn:disabled { opacity: .4; pointer-events: none; }
.ft-btn-primary { background: var(--primary); color: var(--primary-fg); }
.ft-btn-primary:hover { background: var(--primary-hover); }
.ft-btn-primary:active { background: var(--primary-press); }
.ft-btn-secondary { background: var(--bg-surface); border-color: var(--border-default); }
.ft-btn-secondary:hover { background: var(--bg-surface-2); }
.ft-btn-secondary:active { background: var(--bg-surface-3); }
.ft-btn-ghost:hover { background: var(--bg-surface-2); }
.ft-btn-ghost:active { background: var(--bg-surface-3); }
.ft-btn-danger { background: var(--accent); color: var(--accent-fg); }
.ft-btn-danger:hover { background: var(--accent-hover); }
.ft-btn-danger:active { background: var(--accent-press); }
.ft-btn-danger:focus-visible { box-shadow: var(--focus-ring-accent); }
.ft-btn-sm { padding: 5px 10px; font-size: 12px; }
.ft-btn-lg { padding: 12px 18px; font-size: 14px; }

/* Input */
.ft-field { display: flex; flex-direction: column; gap: 6px; }
.ft-label { font-size: 12px; line-height: 1.4; color: var(--fg-2); }
.ft-input, .ft-select, .ft-textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.45; padding: 9px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--fg-1); transition: border-color 80ms cubic-bezier(.2,0,.2,1); }
.ft-input::placeholder, .ft-textarea::placeholder { color: var(--fg-4); }
.ft-input:focus, .ft-select:focus, .ft-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.ft-input-error { border-color: var(--negative-mark); }
.ft-input-amount { font-size: 18px; line-height: 1.3; box-shadow: var(--shadow-inset); font-variant-numeric: tabular-nums lining-nums; text-align: right; padding-right: 48px; }
.ft-input-wrap { position: relative; }
.ft-input-ccy { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--fg-3); }
.ft-help { font-size: 12px; line-height: 1.4; color: var(--fg-3); }
.ft-error { font-size: 12px; line-height: 1.4; color: var(--negative-fg); }

/* Status pill */
.ft-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; line-height: 1.4; white-space: nowrap; background: var(--bg-surface-3); color: var(--fg-2); }
.ft-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); flex: none; }
.ft-pill-positive { background: var(--positive-bg); color: var(--positive-fg); } .ft-pill-positive .ft-pill-dot { background: var(--positive-mark); }
.ft-pill-negative { background: var(--negative-bg); color: var(--negative-fg); } .ft-pill-negative .ft-pill-dot { background: var(--negative-mark); }
.ft-pill-warning { background: var(--warning-bg); color: var(--warning-fg); } .ft-pill-warning .ft-pill-dot { background: var(--warning-mark); }
.ft-pill-info { background: var(--info-bg); color: var(--info-fg); } .ft-pill-info .ft-pill-dot { background: var(--info-mark); }

/* Table */
.ft-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--bg-surface); }
.ft-table th { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding: 10px 14px; border-bottom: 1px solid var(--border-default); background: var(--bg-surface-2); position: sticky; top: 0; }
.ft-table td { padding: 0 14px; height: var(--row-height-md); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.ft-table tbody tr:hover td { background: var(--bg-surface-2); }
.ft-table tbody tr[aria-selected="true"] td { background: var(--bg-surface-2); }
.ft-table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--border-strong); }
.ft-table .ft-num, .ft-table th.ft-num { text-align: right; }
.ft-table .ft-ccy { color: var(--fg-3); font-size: 11px; margin-left: 4px; }
.ft-table .ft-ref { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.ft-table-wrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }

/* Toast and banner */
.ft-toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); min-width: 320px; max-width: 420px; font-size: 13px; }
.ft-toast-stripe { width: 3px; align-self: stretch; border-radius: var(--radius-xs); background: var(--fg-3); flex: none; }
.ft-toast-positive .ft-toast-stripe { background: var(--positive-mark); }
.ft-toast-negative .ft-toast-stripe { background: var(--negative-mark); }
.ft-toast-warning .ft-toast-stripe { background: var(--warning-mark); }
.ft-toast-info .ft-toast-stripe { background: var(--info-mark); }
.ft-toast-title { color: var(--fg-1); }
.ft-toast-body { color: var(--fg-2); margin-top: 2px; font-size: 12px; }
.ft-toast-close { margin-left: auto; background: none; border: 0; color: var(--fg-3); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ft-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; }
.ft-banner-warning { background: var(--warning-bg); color: var(--warning-fg); }
.ft-banner-negative { background: var(--negative-bg); color: var(--negative-fg); }
.ft-banner-info { background: var(--info-bg); color: var(--info-fg); }

/* Amount */
.ft-amount { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; color: var(--fg-1); }
.ft-amount-xl { font-size: 48px; line-height: 1.05; letter-spacing: -0.01em; }
.ft-amount-lg { font-size: 28px; line-height: 1.15; }
.ft-amount-md { font-size: 14px; line-height: 1.45; }
.ft-amount .ft-ccy { color: var(--fg-3); font-size: .5em; margin-left: .35em; }
.ft-amount-md .ft-ccy { font-size: 11px; }
.ft-amount-credit { color: var(--positive-fg); }
.ft-amount-rejected { color: var(--negative-fg); text-decoration: line-through; text-decoration-thickness: 1px; }

/* Signatory chip */
.ft-chip { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); background: var(--bg-surface); font-size: 13px; }
.ft-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-fg); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.ft-avatar-queued { background: var(--bg-surface-3); color: var(--fg-2); }
.ft-chip-role { color: var(--fg-3); font-size: 11px; }
.ft-chip .ft-pill { margin-left: auto; }

/* Audit log */
.ft-audit { border-left: 2px solid var(--border-subtle); padding-left: 18px; font-size: 13px; }
.ft-audit-row { position: relative; padding: 10px 0; }
.ft-audit-row::before { content: ""; position: absolute; left: -23px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); border: 2px solid var(--bg-surface); }
.ft-audit-create::before { background: var(--positive-mark); }
.ft-audit-sign::before { background: var(--info-mark); }
.ft-audit-reject::before { background: var(--negative-mark); }
.ft-audit-what { color: var(--fg-2); }
.ft-audit-when { color: var(--fg-3); font-size: 11px; font-family: var(--font-mono); margin-top: 2px; }
.ft-audit-hash { margin-left: 8px; }

/* Stage track */
.ft-stage { display: flex; align-items: center; gap: 0; font-size: 12px; }
.ft-stage-step { display: flex; align-items: center; gap: 8px; color: var(--fg-3); white-space: nowrap; }
.ft-stage-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-surface); flex: none; }
.ft-stage-line { flex: 1; height: 2px; min-width: 24px; background: var(--border-subtle); margin: 0 8px; }
.ft-stage-done .ft-stage-dot { background: var(--border-strong); }
.ft-stage-done + .ft-stage-line { background: var(--border-strong); }
.ft-stage-current { color: var(--fg-1); }
.ft-stage-current .ft-stage-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px var(--bg-surface-3); }
.ft-stage-failed { color: var(--negative-fg); }
.ft-stage-failed .ft-stage-dot { background: var(--negative-mark); border-color: var(--negative-mark); }

/* Decision row */
.ft-decision { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); font-size: 13px; }
.ft-decision-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.ft-decision-text { flex: 1; min-width: 0; }
.ft-decision-meta { color: var(--fg-3); font-size: 12px; margin-top: 2px; }
.ft-decision-meta .ft-mono { font-size: 11px; }
.ft-decision-actions { display: flex; gap: 8px; flex: none; }

/* Conversation thread */
.ft-thread { display: flex; flex-direction: column; gap: 14px; font-size: 13px; }
.ft-msg { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.ft-msg-head { display: flex; gap: 8px; align-items: baseline; }
.ft-msg-who { color: var(--fg-1); }
.ft-msg-when { color: var(--fg-3); font-family: var(--font-mono); font-size: 11px; }
.ft-msg-body { color: var(--fg-2); margin-top: 3px; max-width: 60ch; }
.ft-msg-body p { margin: 0 0 6px; }
.ft-msg-body p:last-child { margin-bottom: 0; }
.ft-thread-compose { display: flex; gap: 8px; align-items: center; padding-top: 6px; }

/* Text comparison */
.ft-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); font-size: 13px; }
.ft-diff-col { padding: 14px 16px; }
.ft-diff-col + .ft-diff-col { border-left: 1px solid var(--border-subtle); }
.ft-diff-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ft-diff-body { color: var(--fg-2); font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.6; }
.ft-diff-body del { color: var(--fg-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.ft-diff-body ins { text-decoration: none; color: var(--fg-1); background: var(--bg-surface-3); }
.ft-diff-summary { grid-column: 1 / -1; border-top: 1px solid var(--border-subtle); padding: 10px 16px; color: var(--fg-3); font-size: 12px; }

/* Role row */
.ft-role { display: grid; grid-template-columns: minmax(160px, 1.2fr) 1fr 90px 1.4fr 1fr 110px; gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); font-size: 13px; }
.ft-role-cell { min-width: 0; }
.ft-role-k { display: block; font-size: 11px; color: var(--fg-3); margin-bottom: 2px; }
.ft-role-v { color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-role-effort { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.ft-role-effort i { width: 6px; height: 10px; background: var(--border-subtle); border-radius: 1px; }
.ft-role-effort i.on { background: var(--fg-2); }
.ft-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ft-tag { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-surface-3); color: var(--fg-2); white-space: nowrap; }
.ft-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-2); white-space: nowrap; }
.ft-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--positive-mark); }
.ft-ok-no { color: var(--negative-fg); }
.ft-ok-no::before { background: var(--negative-mark); }

/* Event timeline */
.ft-timeline { display: flex; flex-direction: column; font-size: 13px; }
.ft-event { display: grid; grid-template-columns: 96px 20px 1fr; gap: 0 8px; }
.ft-event-when { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); padding-top: 10px; text-align: right; }
.ft-event-rail { position: relative; display: flex; justify-content: center; }
.ft-event-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--border-subtle); }
.ft-event:first-child .ft-event-rail::before { top: 14px; }
.ft-event:last-child .ft-event-rail::before { bottom: auto; height: 14px; }
.ft-event-point { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); margin-top: 12px; border: 2px solid var(--bg-surface); box-sizing: content-box; }
.ft-event-positive .ft-event-point { background: var(--positive-mark); }
.ft-event-info .ft-event-point { background: var(--info-mark); }
.ft-event-negative .ft-event-point { background: var(--negative-mark); }
.ft-event-body { padding: 8px 0 12px; }
.ft-event-title { color: var(--fg-1); }
.ft-event-detail { color: var(--fg-2); margin-top: 2px; font-size: 12px; }
.ft-event-detail .ft-mono { font-size: 11px; color: var(--fg-3); }
