/* ── FINANCIAL DASHBOARD MODAL ──────────────── */
.fd-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .45s cubic-bezier(.16,1,.3,1);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
}
.fd-overlay.open { opacity: 1; pointer-events: all; }

.fd-modal {
  width: 100%; max-width: 1120px;
  background: #f4f4f4; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 56px);
  transform: translateY(36px) scale(0.97);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  position: relative; box-shadow: 0 40px 120px rgba(0,0,0,0.6);
}
.fd-overlay.open .fd-modal { transform: translateY(0) scale(1); }

/* Mac-style titlebar */
.fd-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; height: 40px; flex-shrink: 0;
  background: #111; border-radius: 14px 14px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fd-dots { display: flex; align-items: center; gap: 7px; }
.fd-dot {
  width: 12px; height: 12px; border-radius: 50%; cursor: none;
  transition: filter .15s, transform .15s; position: relative;
  border: none; background: transparent; padding: 0; flex-shrink: 0;
}
.fd-dot:hover { filter: brightness(1.18); transform: scale(1.06); }
.fd-dot-r { background: #ff5f57; }
.fd-dot-y { background: #febc2e; }
.fd-dot-g { background: #28c840; }
.fd-dot::after {
  content: attr(data-sym); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 900; color: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity .15s; line-height: 1;
}
.fd-dots:hover .fd-dot::after { opacity: 1; }
.fd-titlebar-title { font-family: var(--font-m); font-size: 0.58rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.28); }
.fd-titlebar-spacer { width: 54px; display: flex; align-items: center; justify-content: flex-end; }
.fd-sidebar-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 44px; height: 44px; background: none; border: none; cursor: none;
}
.fd-sidebar-toggle span {
  display: block; width: 16px; height: 1.5px; background: rgba(255,255,255,0.7);
  transition: transform .2s, opacity .2s; transform-origin: center;
}
.fd-sidebar-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.fd-sidebar-toggle.open span:nth-child(2) { opacity: 0; }
.fd-sidebar-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Body wraps sidebar + main */
.fd-body { display: flex; flex: 1; overflow: hidden; min-height: 0; position: relative; }
.fd-sidebar-backdrop {
  display: none; position: absolute; inset: 0; z-index: 15;
  background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-micro) var(--ease-smooth);
}
.fd-sidebar-backdrop.open { opacity: 1; pointer-events: all; }

/* Sidebar */
.fd-sidebar {
  width: 210px; flex-shrink: 0; background: #0a0a0a;
  display: flex; flex-direction: column; padding: 28px 0;
  overflow: hidden; border-radius: 0;
}
.fd-logo {
  padding: 0 24px 36px;
  font-family: var(--font-h); font-size: 0.92rem; font-weight: 800;
  color: #fff; letter-spacing: -0.04em;
  display: flex; align-items: center; gap: 9px;
}
.fd-logo-dot { width: 7px; height: 7px; background: #fff; border-radius: 50%; }
.fd-nav-section { padding: 0 24px 8px; font-family: var(--font-m); font-size: 0.5rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.2); }
.fd-nav { list-style: none; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.fd-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; border-radius: 7px;
  font-family: var(--font-b); font-size: 0.78rem; font-weight: 400;
  color: rgba(255,255,255,0.38); cursor: none;
  transition: background .2s, color .2s; user-select: none;
}
.fd-nav-item:hover  { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }
.fd-nav-item.active { background: rgba(255,255,255,0.1);  color: #fff; font-weight: 500; }
.fd-nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
.fd-sidebar-bottom { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.fd-user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,0.05); }
.fd-user-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.15); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-h); font-size: 0.58rem; font-weight: 700; color: #fff;
}
.fd-user-name { font-family: var(--font-b); font-size: 0.72rem; font-weight: 500; color: #fff; }
.fd-user-plan { font-family: var(--font-m); font-size: 0.5rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.3); }

/* Main content area */
.fd-main {
  flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
  background: #f4f4f4; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: #0a0a0a #e8e8e8;
}
.fd-main::-webkit-scrollbar       { width: 8px; background: #e8e8e8; }
.fd-main::-webkit-scrollbar-track { background: #e8e8e8; }
.fd-main::-webkit-scrollbar-thumb { background: #0a0a0a; border-radius: 0; }
.fd-main::-webkit-scrollbar-thumb:hover { background: #333; }

/* Header */
.fd-header { padding: 28px 32px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.fd-title { font-family: var(--font-h); font-size: 1.3rem; font-weight: 800; color: #0a0a0a; letter-spacing: -0.04em; }
.fd-date  { font-family: var(--font-m); font-size: 0.56rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.35); margin-top: 3px; }
.fd-header-right { display: flex; align-items: center; gap: 10px; }
.fd-avatar  { width: 34px; height: 34px; border-radius: 50%; background: #0a0a0a; display: flex; align-items: center; justify-content: center; font-family: var(--font-h); font-size: 0.62rem; font-weight: 700; color: #fff; }
.fd-refresh { width: 34px; height: 34px; border-radius: 8px; background: #fff; border: 1px solid rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; cursor: none; transition: all .2s; color: rgba(0,0,0,0.45); font-size: 0.85rem; }
.fd-refresh:hover { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }

/* Content */
.fd-content { padding: 20px 32px 32px; display: flex; flex-direction: column; gap: 14px; }

/* KPI Cards */
.fd-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; }
.fd-kpi { background: #fff; border-radius: 11px; padding: 17px 19px; border: 1px solid rgba(0,0,0,0.07); position: relative; overflow: hidden; }
.fd-kpi.dark { background: #0a0a0a; }
.fd-kpi-label { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(0,0,0,0.38); margin-bottom: 8px; }
.fd-kpi.dark .fd-kpi-label { color: rgba(255,255,255,0.32); }
.fd-kpi-value { font-family: var(--font-h); font-size: 1.28rem; font-weight: 800; letter-spacing: -0.04em; color: #0a0a0a; margin-bottom: 6px; transition: opacity .15s ease, transform .15s ease; }
.fd-kpi.dark .fd-kpi-value { color: #fff; }
.fd-kpi-value.fd-fade { opacity: 0; transform: translateY(-5px); }
.fd-kpi-change { font-family: var(--font-m); font-size: 0.54rem; letter-spacing: 0.04em; display: flex; align-items: center; gap: 4px; color: rgba(0,0,0,0.45); }
.fd-kpi.dark .fd-kpi-change { color: rgba(255,255,255,0.38); }
.ch-up { color: #16a34a; }
.ch-dn { color: #dc2626; }
.fd-kpi-bg { position: absolute; right: -12px; bottom: -12px; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,0.04); }
.fd-kpi.dark .fd-kpi-bg { background: rgba(255,255,255,0.05); }

/* Charts */
.fd-charts { display: grid; grid-template-columns: 1.65fr 1fr; gap: 11px; }
.fd-chart-card { background: #fff; border-radius: 11px; padding: 19px 21px; border: 1px solid rgba(0,0,0,0.07); }
.fd-chart-hdr  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.fd-chart-title { font-family: var(--font-h); font-size: 0.84rem; font-weight: 700; color: #0a0a0a; letter-spacing: -0.02em; }
.fd-chart-sub   { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.08em; color: rgba(0,0,0,0.3); margin-top: 3px; }
.fd-period-btns { display: flex; gap: 3px; }
.fd-period-btn {
  font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 5px; border: 1px solid transparent;
  cursor: none; transition: all .2s; color: rgba(0,0,0,0.35); background: transparent;
}
.fd-period-btn.active { background: #0a0a0a; color: #fff; }
.fd-period-btn:hover:not(.active) { border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.6); }
.fd-chart-area     { width: 100%; height: 138px; }
.fd-chart-area svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fd-xaxis          { display: flex; justify-content: space-between; padding-top: 7px; }
.fd-xaxis span     { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.06em; color: rgba(0,0,0,0.28); }

/* Donut */
.fd-donut-wrap       { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fd-donut-ring       { position: relative; display: flex; align-items: center; justify-content: center; }
.fd-donut-svg        { width: 118px; height: 118px; }
.fd-donut-center     { position: absolute; text-align: center; pointer-events: none; }
.fd-donut-center-val { font-family: var(--font-h); font-size: 1.05rem; font-weight: 800; color: #0a0a0a; letter-spacing: -0.04em; }
.fd-donut-center-lbl { font-family: var(--font-m); font-size: 0.48rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(0,0,0,0.32); margin-top: 2px; }
.fd-donut-legend     { width: 100%; display: flex; flex-direction: column; gap: 7px; }
.fd-donut-row        { display: flex; align-items: center; justify-content: space-between; }
.fd-donut-row-l      { display: flex; align-items: center; gap: 7px; font-family: var(--font-b); font-size: 0.72rem; color: rgba(0,0,0,0.58); }
.fd-donut-dot        { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fd-donut-pct        { font-family: var(--font-m); font-size: 0.66rem; color: #0a0a0a; font-weight: 600; }

/* Bottom row */
.fd-bottom    { display: grid; grid-template-columns: 1.65fr 1fr; gap: 11px; }
.fd-txn-card  { background: #fff; border-radius: 11px; padding: 19px 21px; border: 1px solid rgba(0,0,0,0.07); }
.fd-txn-list  { display: flex; flex-direction: column; }
.fd-txn-row   { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05); transition: opacity .2s; }
.fd-txn-row:last-child { border-bottom: none; }
.fd-txn-row.fd-hidden  { display: none; }
.fd-txn-icon  { width: 34px; height: 34px; border-radius: 9px; background: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; flex-shrink: 0; }
.fd-txn-info  { flex: 1; }
.fd-txn-name  { font-family: var(--font-b); font-size: 0.78rem; font-weight: 500; color: #0a0a0a; margin-bottom: 2px; }
.fd-txn-date  { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.06em; color: rgba(0,0,0,0.32); }
.fd-txn-amt   { font-family: var(--font-h); font-size: 0.82rem; font-weight: 700; letter-spacing: -0.02em; }
.fd-txn-amt.cr { color: #16a34a; }
.fd-txn-amt.db { color: #0a0a0a; }
.fd-view-all   { font-family: var(--font-m); font-size: 0.55rem; letter-spacing: 0.06em; color: rgba(0,0,0,0.32); cursor: none; transition: color .2s; }
.fd-view-all:hover { color: #0a0a0a; }
.fd-txn-empty  { padding: 20px 0; text-align: center; font-family: var(--font-m); font-size: 0.6rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.25); display: none; }

/* Transaction filters */
.fd-txn-filters { display: flex; gap: 3px; }
.fd-txn-filter {
  font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 5px; border: 1px solid transparent;
  cursor: none; transition: all .2s; color: rgba(0,0,0,0.38); background: transparent;
}
.fd-txn-filter.active { background: #0a0a0a; color: #fff; }
.fd-txn-filter:hover:not(.active) { border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.65); }

/* Transaction search */
.fd-search-wrap { position: relative; }
.fd-search-input {
  width: 100%; padding: 7px 12px 7px 30px;
  border-radius: 7px; border: 1px solid rgba(0,0,0,0.09);
  background: rgba(0,0,0,0.03); font-family: var(--font-b);
  font-size: 0.74rem; color: #0a0a0a; outline: none;
  transition: border-color .2s, background .2s;
}
.fd-search-input:focus       { border-color: rgba(0,0,0,0.22); background: #fff; }
.fd-search-input::placeholder { color: rgba(0,0,0,0.3); }
.fd-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(0,0,0,0.3); font-size: 0.68rem; pointer-events: none; }

/* Goals / Bars */
.fd-goals-card  { background: #0a0a0a; border-radius: 11px; padding: 19px 21px; display: flex; flex-direction: column; gap: 14px; }
.fd-goals-title { font-family: var(--font-h); font-size: 0.84rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.fd-bar-item  { display: flex; flex-direction: column; gap: 5px; }
.fd-bar-lbl   { display: flex; justify-content: space-between; }
.fd-bar-name  { font-family: var(--font-b); font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.fd-bar-val   { font-family: var(--font-m); font-size: 0.62rem; color: rgba(255,255,255,0.65); }
.fd-bar-track { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.fd-bar-fill  { height: 100%; background: #fff; border-radius: 2px; width: 0; transition: width 1.1s cubic-bezier(.16,1,.3,1); }
.fd-proj      { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }
.fd-proj-lbl  { font-family: var(--font-m); font-size: 0.5rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.22); margin-bottom: 6px; }
.fd-proj-val  { font-family: var(--font-h); font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: -0.04em; }
.fd-proj-sub  { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.06em; color: rgba(255,255,255,0.28); margin-top: 3px; }

/* Card 3 thumbnail — faithful scaled-down replica */
.pthumb-dash { position: absolute; inset: 0; overflow: hidden; background: #f4f4f4; }
.ptd-scale {
  width: 1080px; height: 836px;
  transform: scale(0.335); transform-origin: top left;
  display: flex; pointer-events: none; flex-shrink: 0;
}

/* Card 3 hover hint */
.pcard-hint {
  position: absolute; bottom: 12px; right: 12px; z-index: 3;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(4px);
  font-family: var(--font-m); font-size: 0.5rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(0,0,0,0.65);
  padding: 5px 11px; border-radius: 4px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .3s, transform .3s; pointer-events: none;
}
#card3:hover .pcard-hint { opacity: 1; transform: translateY(0); }
#card2:hover .pcard-hint { opacity: 1; transform: translateY(0); }
#card2 { cursor: none; }

/* ── N8N MODAL ──────────────────────────────── */
.n8n-overlay {
  position: fixed; inset: 0; z-index: 9001;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .45s cubic-bezier(.16,1,.3,1);
  display: flex; align-items: stretch; justify-content: center;
  padding: 20px;
}
.n8n-overlay.open { opacity: 1; pointer-events: all; }
.n8n-modal {
  width: 100%; max-width: 1120px;
  background: #1e1e24; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 40px);
  transform: translateY(36px) scale(0.97);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 40px 120px rgba(0,0,0,0.7);
}
.n8n-overlay.open .n8n-modal { transform: translateY(0) scale(1); }

/* Titlebar — reuses fd-titlebar pattern */
.n8n-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; height: 40px; flex-shrink: 0;
  background: #0f0f14; border-radius: 14px 14px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.n8n-titlebar-title { font-family: var(--font-m); font-size: 0.58rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.28); }
.n8n-titlebar-spacer { width: 54px; }

/* Body */
.n8n-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* Left sidebar — icon-only */
.n8n-sidebar {
  width: 52px; flex-shrink: 0; background: #0f0f14;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 4px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.n8n-logo-mark {
  font-family: var(--font-h); font-size: 0.72rem; font-weight: 900;
  color: #ea4b71; letter-spacing: -0.06em; margin-bottom: 16px;
  line-height: 1;
}
.n8n-nav-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3); font-size: 0.9rem;
  cursor: none; transition: background .2s, color .2s;
  border: none; background: transparent; position: relative;
}
.n8n-nav-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); }
.n8n-nav-btn.active { background: rgba(234,75,113,0.15); color: #ea4b71; }
.n8n-preview-badge {
  position: absolute; top: 4px; right: 2px;
  font-family: var(--font-m); font-size: 0.38rem; letter-spacing: 0.06em;
  background: #7c9cf8; color: #fff;
  padding: 1px 3px; border-radius: 3px; line-height: 1.4;
}
.n8n-sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: center; }

/* Main area */
.n8n-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* Topbar */
.n8n-topbar {
  height: 52px; flex-shrink: 0; background: #16161d;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; padding: 0 20px;
  gap: 12px;
}
.n8n-breadcrumb { font-family: var(--font-b); font-size: 0.74rem; color: rgba(255,255,255,0.4); }
.n8n-breadcrumb .sep { margin: 0 4px; }
.n8n-wf-name { font-family: var(--font-b); font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.82); }
.n8n-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.n8n-publish-btn {
  display: flex; align-items: center; gap: 7px;
  background: #22c55e; color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; font-family: var(--font-b); font-size: 0.74rem; font-weight: 600;
  cursor: none; transition: background .2s;
}
.n8n-publish-btn:hover { background: #16a34a; }
.n8n-publish-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.8); }
.n8n-star-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65); border-radius: 6px;
  padding: 5px 10px; font-family: var(--font-b); font-size: 0.72rem;
  cursor: none; transition: background .2s;
}
.n8n-star-btn:hover { background: rgba(255,255,255,0.12); }

/* Tab bar */
.n8n-tabs {
  height: 40px; flex-shrink: 0; background: #16161d;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: flex-end; padding: 0 16px; gap: 0;
}
.n8n-tab {
  padding: 10px 18px; font-family: var(--font-b); font-size: 0.76rem;
  color: rgba(255,255,255,0.4); border-bottom: 2px solid transparent;
  cursor: none; transition: color .2s, border-color .2s;
}
.n8n-tab.active { color: rgba(255,255,255,0.88); border-color: #ff821e; }
.n8n-tab:hover:not(.active) { color: rgba(255,255,255,0.65); }

/* Canvas */
.n8n-canvas-wrap { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.n8n-canvas {
  position: absolute; inset: 0;
  background-color: #1e1e24;
  background-image: radial-gradient(circle, rgba(255,255,255,0.065) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  background-position: 0 0;
}
.n8n-edges {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible; z-index: 0;
}

/* Nodes */
.n8n-node {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; gap: 8px; cursor: none; user-select: none; z-index: 1;
  width: 90px;
}
.n8n-node.dragging { z-index: 10; }
.n8n-node-card {
  width: 80px; height: 80px; border-radius: 12px;
  background: #2d2d3a; border: 1.5px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, box-shadow .2s;
  position: relative; overflow: visible;
}
.n8n-node:hover .n8n-node-card { border-color: rgba(255,255,255,0.28); box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.n8n-node.selected .n8n-node-card { border-color: #ff821e; box-shadow: 0 0 0 2.5px rgba(255,130,30,0.28); }
.n8n-node.executing .n8n-node-card { border-color: #ff821e; box-shadow: 0 0 28px rgba(255,130,30,0.55); animation: nPulse .55s ease-in-out; }
.n8n-node.executed .n8n-node-card  { border-color: #22c55e; box-shadow: 0 0 18px rgba(34,197,94,0.4); }
@keyframes nPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }

.n8n-node-label    { font-family: var(--font-b); font-size: 0.68rem; font-weight: 500; color: rgba(255,255,255,0.82); text-align: center; max-width: 120px; white-space: nowrap; }
.n8n-node-sublabel { font-family: var(--font-m); font-size: 0.52rem; color: rgba(255,255,255,0.35); text-align: center; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Trigger badge */
.n8n-trigger-badge {
  position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 28px; background: #ff821e; border-radius: 5px 0 0 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 700;
}
/* Exec count badge */
.n8n-node-badge {
  position: absolute; top: -8px; right: -8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #7c9cf8; color: #fff; border: 2px solid #2d2d3a;
  font-family: var(--font-b); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* Add output button */
.n8n-node-plus {
  position: absolute; right: -22px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: rgba(255,255,255,0.45); cursor: none;
  transition: background .2s, border-color .2s;
}
.n8n-node-plus:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.35); }

/* Bottom toolbar */
.n8n-toolbar {
  height: 52px; flex-shrink: 0; background: #16161d;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; padding: 0 20px;
  justify-content: space-between;
}
.n8n-zoom-controls { display: flex; align-items: center; gap: 4px; }
.n8n-zoom-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: none; transition: background .2s;
}
.n8n-zoom-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.n8n-execute-btn {
  display: flex; align-items: center; gap: 8px;
  background: #ff821e; color: #fff; border: none; border-radius: 7px;
  padding: 9px 22px; font-family: var(--font-b); font-size: 0.8rem; font-weight: 600;
  cursor: none; transition: background .2s, transform .15s;
}
.n8n-execute-btn:hover { background: #ff9a3e; transform: translateY(-1px); }
.n8n-execute-btn.running { background: #3d3d4a; color: rgba(255,255,255,0.5); }
.n8n-execute-icon { font-size: 0.85rem; }

/* Properties panel (slide in from right) */
.n8n-props {
  position: absolute; right: 0; top: 0; bottom: 0; width: 260px;
  background: #16161d; border-left: 1px solid rgba(255,255,255,0.08);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.16,1,.3,1);
  z-index: 5;
}
.n8n-props.open { transform: translateX(0); }
.n8n-props-title { font-family: var(--font-h); font-size: 0.88rem; font-weight: 700; color: rgba(255,255,255,0.88); }
.n8n-props-type  { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase; color: #ff821e; margin-bottom: 4px; }
.n8n-props-close {
  background: none; border: none; color: rgba(255,255,255,0.35); font-size: 1rem;
  cursor: none; margin-left: auto; transition: color .2s;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.n8n-props-close:hover { color: rgba(255,255,255,0.7); }
.n8n-props-field { display: flex; flex-direction: column; gap: 5px; }
.n8n-props-label { font-family: var(--font-m); font-size: 0.52rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.3); }
.n8n-props-value { font-family: var(--font-b); font-size: 0.8rem; color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 8px 10px; }
.n8n-props-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); }

/* Card 2 — N8N thumbnail */
.pthumb-n8n { position: absolute; inset: 0; overflow: hidden; background: #1e1e24; }
.ptd-n8n-scale {
  width: 1080px; height: 836px;
  transform: scale(0.335); transform-origin: top left;
  display: flex; pointer-events: none; flex-shrink: 0;
}

/* ══════════════════════════════════════════
   DASHBOARD / N8N / MODALS RESPONSIVE
══════════════════════════════════════════ */

/* ── 1100px — tablet ────────────────────── */
@media (max-width: 1100px) {
  /* Financial Dashboard */
  .fd-sidebar           { width: 175px; }
  .fd-logo              { font-size: 0.84rem; padding: 0 20px 28px; }
  .fd-charts            { grid-template-columns: 1fr; }
  .fd-bottom            { grid-template-columns: 1fr; }

  /* N8N */
  .n8n-topbar-right     { gap: 6px; }
  .n8n-wf-name          { font-size: 0.76rem; }
}

/* ── 768px — mobile ─────────────────────── */
@media (max-width: 768px) {

  /* Close button: 48x48 touch target, dot stays visually small */
  .fd-titlebar, .n8n-titlebar { height: 56px; }
  .fd-dot-r {
    width: 48px; height: 48px; background: transparent;
    display: flex; align-items: center; justify-content: center;
  }
  .fd-dot-r::before {
    content: ''; width: 12px; height: 12px; border-radius: 50%;
    background: #ff5f57; transition: filter .15s, transform .15s;
  }
  .fd-dot-r:active::before { filter: brightness(1.18); transform: scale(1.06); }

  /* ---- Financial Dashboard modal ---- */
  .fd-overlay  { padding: 0; }
  .fd-modal    { border-radius: 0; height: 100svh; max-height: 100svh; }
  .fd-sidebar-toggle { display: flex; }
  .fd-sidebar-backdrop { display: block; }
  .fd-sidebar {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 20;
    width: 240px; max-width: 80vw;
    transform: translateX(-100%);
    transition: transform var(--dur-micro) var(--ease-smooth);
    box-shadow: 20px 0 40px rgba(0,0,0,0.4);
  }
  .fd-sidebar.open { transform: translateX(0); }
  .fd-header   { padding: 18px 16px 0; }
  .fd-title    { font-size: 1.1rem; }
  .fd-content  { padding: 16px 16px 24px; gap: 12px; }
  .fd-kpis     { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .fd-kpi      { padding: 14px 14px; }
  .fd-kpi-value { font-size: 1.1rem; }
  .fd-kpi-label { font-size: 0.48rem; }
  .fd-charts   { grid-template-columns: 1fr; gap: 10px; }
  .fd-bottom   { grid-template-columns: 1fr; gap: 10px; }
  .fd-chart-area { height: 110px; }
  .fd-xaxis span { font-size: 0.48rem; }
  .fd-donut-wrap { flex-direction: row; align-items: flex-start; gap: 20px; }
  .fd-donut-ring { flex-shrink: 0; }
  .fd-period-btns { flex-wrap: wrap; gap: 2px; }

  /* Financial transactions */
  .fd-txn-filters { flex-wrap: wrap; gap: 4px; }
  .fd-search-wrap { max-width: 100% !important; }

  /* Financial goals */
  .fd-goals-card { gap: 12px; }

  /* Thumbnail scale — narrower card on mobile */
  .ptd-scale     { transform: scale(0.29); }
  .ptd-n8n-scale { transform: scale(0.29); }

  /* pcard hint: always visible on touch */
  .pcard-hint    { opacity: 0.88; transform: translateY(0); background: rgba(0,0,0,0.7); color: #fff; }

  /* ---- N8N modal ---- */
  .n8n-overlay  { padding: 0; }
  .n8n-modal    { border-radius: 0; height: 100svh; max-height: 100svh; }
  .n8n-sidebar  { display: none; }
  .n8n-topbar   { padding: 0 14px; gap: 8px; }
  .n8n-wf-name  { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .n8n-publish-btn { padding: 5px 10px; font-size: 0.68rem; }
  .n8n-star-btn { display: none; }
  .n8n-tabs     { padding: 0 10px; }
  .n8n-tab      { padding: 9px 12px; font-size: 0.7rem; }
  .n8n-toolbar  { padding: 0 14px; }
  .n8n-execute-btn { padding: 7px 16px; font-size: 0.74rem; }
  /* Canvas: pan (1 dedo) + pinch-zoom (2 dedos) via JS */
  .n8n-canvas-wrap { touch-action: none; }

  /* N8N props panel */
  .n8n-props { width: 220px; }
}

/* ── 480px — small phone ────────────────── */
@media (max-width: 480px) {
  /* Financial */
  .fd-kpis      { grid-template-columns: repeat(2,1fr); gap: 6px; }
  .fd-kpi       { padding: 12px 10px; }
  .fd-kpi-value { font-size: 1rem; }
  .fd-header-right .fd-refresh { display: none; }
  .fd-content   { padding: 12px 12px 20px; gap: 10px; }

  /* Thumbnail tiny scale */
  .ptd-scale     { transform: scale(0.26); }
  .ptd-n8n-scale { transform: scale(0.26); }

  /* N8N */
  .n8n-wf-name   { max-width: 120px; font-size: 0.64rem; }
  .n8n-zoom-controls { gap: 2px; }
  .n8n-zoom-btn  { width: 28px; height: 28px; font-size: 0.85rem; }
}

