/* FlowTask — layout with sidebar + projects UI + modal + tabbed drawer.
   Loaded after app.css (shell template references both). */

/* ── Layout grid ───────────────────────────────── */
.ft-layout { display: block; }
.ft-layout.with-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
  transition: grid-template-columns var(--motion);
}
.ft-layout.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.ft-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-3) var(--space-2);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
}
.ft-side-nav { display: flex; flex-direction: column; gap: 2px; }
.ft-side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: background var(--motion-fast), color var(--motion-fast);
  white-space: nowrap;
  position: relative;
}
.ft-side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.ft-side-link.is-active {
  background: var(--accent-muted); color: var(--accent); font-weight: 600;
}
.ft-side-link.is-active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.ft-side-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
  color: currentColor;
}
.ft-side-ico svg { width: 18px; height: 18px; display: block; }
.ft-side-sep { height: 1px; background: var(--border); margin: var(--space-2) 6px; }
.ft-side-heading {
  padding: 10px 12px 4px;
  font-size: .68rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-subtle);
}

.ft-layout.sidebar-collapsed .ft-side-link { justify-content: center; padding: 9px 0; }
.ft-layout.sidebar-collapsed .ft-side-link span:last-child,
.ft-layout.sidebar-collapsed .ft-side-heading { display: none; }

.ft-sidebar-toggle { margin-right: 8px; }

@media (max-width: 768px) {
  .ft-layout.with-sidebar { grid-template-columns: 1fr; }
  .ft-sidebar {
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .ft-layout.sidebar-open .ft-sidebar {
    display: block; position: fixed; z-index: 50;
    width: 80%; max-width: 300px;
    animation: ft-side-in var(--motion) both;
  }
  .ft-layout.sidebar-open::after {
    content: ''; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(15, 23, 42, .4); z-index: 49;
  }
  @keyframes ft-side-in {
    from { transform: translateX(-16px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ── Page scaffolding ──────────────────────────── */
.ft-page { padding: var(--space-5); max-width: 1280px; }
.ft-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.ft-page-head h1 { margin: 0; font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.ft-page-actions { display: flex; gap: var(--space-2); }

/* ── Empty state (shared) ──────────────────────── */
.ft-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-muted);
}
.ft-empty h3 { margin: 0 0 .4rem; color: var(--text); font-weight: 600; }
.ft-empty p { margin: 0 auto 1rem; max-width: 460px; }

/* ── Projects grid ────────────────────────────── */
.ft-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.ft-project-card {
  display: flex; gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast);
}
.ft-project-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  text-decoration: none;
}
.ft-project-card.is-archived { opacity: .55; }
.ft-project-color {
  width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0;
}
.ft-project-body { flex: 1; min-width: 0; }
.ft-project-name { font-weight: 600; font-size: .98rem; margin-bottom: 4px; color: var(--text); }
.ft-project-key {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem; color: var(--text-muted);
  background: var(--surface-2); padding: 1px 6px; border-radius: 3px;
  margin-bottom: 6px; letter-spacing: .04em;
}
.ft-project-count { font-size: .8rem; color: var(--text-muted); }

.ft-project-view .ft-project-title { display: flex; align-items: center; gap: 10px; }
.ft-project-view .ft-project-chip  { width: 4px; height: 28px; border-radius: 2px; }
.ft-project-key-badge {
  font-family: var(--font-mono);
  font-size: .78rem; background: var(--surface-2);
  padding: 2px 8px; border-radius: var(--radius-sm); margin-right: 8px;
  vertical-align: middle; color: var(--text-muted);
}
.ft-project-desc { color: var(--text-muted); margin: 0 0 16px 0; max-width: 760px; }

/* ── Modal dialog (project create etc.) ────────── */
.ft-modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 480px; width: 90%;
}
.ft-modal::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.ft-modal h3 { margin: 0 0 .75rem; font-size: 1.1rem; }
.ft-form input[type="color"] { padding: 2px; height: 36px; width: 60px; }
.ft-form-actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-2); }

/* ── Project badge on board cards ──────────────── */
.ft-card-project {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .62rem; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  margin-top: 4px;
  letter-spacing: .05em;
}

/* ── Tabbed drawer ─────────────────────────────── */
.ft-drawer-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 0 var(--space-3);
  overflow-x: auto;
  position: sticky; top: 3.5rem; background: var(--surface); z-index: 1;
}
.ft-drawer-tab {
  background: transparent; border: none;
  padding: 10px 14px; cursor: pointer;
  font: inherit; font-size: .85rem; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--motion-fast), border-color var(--motion-fast);
  white-space: nowrap;
  border-radius: 0;
}
.ft-drawer-tab small { color: var(--text-subtle); margin-left: 4px; font-size: .7rem; font-weight: 400; }
.ft-drawer-tab:hover { color: var(--text); background: transparent; }
.ft-drawer-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ft-drawer-tab.is-active small { color: var(--accent); }
.ft-drawer-pane { display: none; }
.ft-drawer-pane.is-active { display: block; }




